|
|
@@ -31,20 +31,20 @@ public class ImportServiceImpl {
|
|
31
|
31
|
|
|
32
|
32
|
|
|
33
|
33
|
|
|
34
|
|
- public String importFile(MultipartFile file, String fileType, HttpServletRequest request,String[] titleArr,boolean[] emptyArr,List<List<String>> lists) throws Exception{
|
|
|
34
|
+ public String importFile(String uploadPath,MultipartFile file, String fileType, HttpServletRequest request,String[] titleArr,boolean[] emptyArr,List<List<String>> lists) throws Exception{
|
|
35
|
35
|
|
|
36
|
|
- // 服务器路径
|
|
37
|
|
- String rootPath = request.getSession().getServletContext().getRealPath("");
|
|
38
|
|
- // 文件相对路径
|
|
39
|
|
- String relativePath = "/upload/" + fileType;
|
|
40
|
|
- //创建临时文件
|
|
41
|
|
- createTemp(file,request,rootPath,relativePath);
|
|
42
|
|
- //读取临时文件,并且返回错误信息
|
|
43
|
|
- String fileAllpath = rootPath+relativePath+"/"+file.getOriginalFilename();
|
|
|
36
|
+ // 服务器路径
|
|
|
37
|
+ // String rootPath = request.getSession().getServletContext().getRealPath("");
|
|
|
38
|
+ // 文件相对路径
|
|
|
39
|
+ String relativePath = "/upload/" + fileType;
|
|
|
40
|
+ //创建临时文件
|
|
|
41
|
+ createTemp(file,request,uploadPath,relativePath);
|
|
|
42
|
+ //读取临时文件,并且返回错误信息
|
|
|
43
|
+ String fileAllpath = uploadPath+relativePath+"/"+file.getOriginalFilename();
|
|
44
|
44
|
|
|
45
|
|
- String retVal = readExcelValue(fileAllpath,titleArr,emptyArr,lists);
|
|
|
45
|
+ String retVal = readExcelValue(fileAllpath,titleArr,emptyArr,lists);
|
|
46
|
46
|
|
|
47
|
|
- return retVal;
|
|
|
47
|
+ return retVal;
|
|
48
|
48
|
}
|
|
49
|
49
|
|
|
50
|
50
|
/**
|