|
|
@ -1467,7 +1467,14 @@ public class ArchiveImportServiceImpl implements ArchiveImportService { |
|
|
|
fos.close(); |
|
|
|
fos.close(); |
|
|
|
fis.close(); |
|
|
|
fis.close(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
* @Description:批量上传文件 |
|
|
|
|
|
|
|
* @param stringArchiveRecordInfoMap 需要导入上传文件的数据 |
|
|
|
|
|
|
|
* @param byAction 根据ArchiveRecordInfo1的那个字段读取文件 |
|
|
|
|
|
|
|
* @Date: 2022/5/18 22:32 |
|
|
|
|
|
|
|
*/ |
|
|
|
public void uploadAllFiles(Map<String, ArchiveRecordInfo> stringArchiveRecordInfoMap,String byAction){ |
|
|
|
public void uploadAllFiles(Map<String, ArchiveRecordInfo> stringArchiveRecordInfoMap,String byAction){ |
|
|
|
//读取文件
|
|
|
|
//读取文件
|
|
|
|
log.info("准备读取文件*********************************"); |
|
|
|
log.info("准备读取文件*********************************"); |
|
|
@ -1487,6 +1494,12 @@ public class ArchiveImportServiceImpl implements ArchiveImportService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
* @Description:单个上传 |
|
|
|
|
|
|
|
* @param fileUploadList 上传后保存的对象 |
|
|
|
|
|
|
|
* @param file 需要上传的文件 |
|
|
|
|
|
|
|
* @Date: 2022/5/18 22:33 |
|
|
|
|
|
|
|
*/ |
|
|
|
public void uploadFile(FileUploadList fileUploadList,File file){ |
|
|
|
public void uploadFile(FileUploadList fileUploadList,File file){ |
|
|
|
String dateUrl=fileUploadList.getPath(); |
|
|
|
String dateUrl=fileUploadList.getPath(); |
|
|
|
String finallyPath=ArchiveUploadConfig.getPath(); |
|
|
|
String finallyPath=ArchiveUploadConfig.getPath(); |
|
|
@ -1507,6 +1520,12 @@ public class ArchiveImportServiceImpl implements ArchiveImportService { |
|
|
|
e.printStackTrace(); |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
* @Description:获取从本地读取的文件信息 key:为字段名 value:为所对应的文件的路径 |
|
|
|
|
|
|
|
* @param |
|
|
|
|
|
|
|
* @return: java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
|
|
|
|
|
|
|
* @Date: 2022/5/18 22:35 |
|
|
|
|
|
|
|
*/ |
|
|
|
public Map<String,List<String>> getFils(){ |
|
|
|
public Map<String,List<String>> getFils(){ |
|
|
|
// Map<String, List<String>> fileMsg = redisTemplate.opsForValue().get(FILE_MSG);
|
|
|
|
// Map<String, List<String>> fileMsg = redisTemplate.opsForValue().get(FILE_MSG);
|
|
|
|
// if (fileMsg==null){
|
|
|
|
// if (fileMsg==null){
|
|
|
@ -1525,6 +1544,14 @@ public class ArchiveImportServiceImpl implements ArchiveImportService { |
|
|
|
// return fileMsg;
|
|
|
|
// return fileMsg;
|
|
|
|
return fils; |
|
|
|
return fils; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
* @Description:从本地读取文件并保存相关信息 |
|
|
|
|
|
|
|
* @param file 从那个路径开始读取 例如 /opt/doc/ |
|
|
|
|
|
|
|
* @param map 保存读取的文件信息 |
|
|
|
|
|
|
|
* @param index 记录读取文件的第几层 |
|
|
|
|
|
|
|
* @return: java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
|
|
|
|
|
|
|
* @Date: 2022/5/18 22:38 |
|
|
|
|
|
|
|
*/ |
|
|
|
public Map<String,List<String>> getFils(File file,Map<String,List<String>> map,int index){ |
|
|
|
public Map<String,List<String>> getFils(File file,Map<String,List<String>> map,int index){ |
|
|
|
if (!file.isFile()){ |
|
|
|
if (!file.isFile()){ |
|
|
|
index++; |
|
|
|
index++; |
|
|
@ -1561,6 +1588,13 @@ public class ArchiveImportServiceImpl implements ArchiveImportService { |
|
|
|
} |
|
|
|
} |
|
|
|
return map; |
|
|
|
return map; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
* @Description:file 转换 MultipartFile |
|
|
|
|
|
|
|
* @param file 需要转换的文件 |
|
|
|
|
|
|
|
* @return: org.springframework.web.multipart.commons.CommonsMultipartFile |
|
|
|
|
|
|
|
* @Date: 2022/5/18 22:39 |
|
|
|
|
|
|
|
*/ |
|
|
|
public CommonsMultipartFile creat(File file) { |
|
|
|
public CommonsMultipartFile creat(File file) { |
|
|
|
DiskFileItemFactory factory = new DiskFileItemFactory(16, null); |
|
|
|
DiskFileItemFactory factory = new DiskFileItemFactory(16, null); |
|
|
|
FileItem item = factory.createItem("textField", "text/plain", true, file.getName()); |
|
|
|
FileItem item = factory.createItem("textField", "text/plain", true, file.getName()); |
|
|
|