Commit d68a91af authored by 吴琼's avatar 吴琼

删除mockMutiFile

parent 26f1f661
......@@ -273,10 +273,10 @@
<artifactId>jsch</artifactId>
<version>0.1.54</version>
</dependency>
<dependency>
<!-- <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
</dependency>
</dependency>-->
</dependencies>
</project>
......@@ -9,19 +9,10 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.entity.ContentType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
......@@ -62,13 +53,9 @@ public class TransactionReceiptRecordRest {
*/
@RequestMapping("/orderQuery/importTransactionReceiptRecord")
@ResponseBody
public JsonResult importTransactionReceiptRecord(MultipartFile multipartFile) {
public JsonResult importTransactionReceiptRecord(@RequestParam("file")MultipartFile file) {
try{
/*File excelFile =new File("D://交易凭证.xlsx");
FileInputStream inputStream =new FileInputStream(excelFile);
multipartFile = new MockMultipartFile(excelFile.getName(), excelFile.getName(),
ContentType.APPLICATION_OCTET_STREAM.toString(), inputStream);*/
return transactionReceiptRecordService.importTransactionReceiptRecord(multipartFile);
return transactionReceiptRecordService.importTransactionReceiptRecord(file);
}catch(IOException e){
e.printStackTrace();
return JsonResult.buildErrorStateResult("上传文件出现错误");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment