文档库--导入
This commit is contained in:
+12
-6
@@ -3563,7 +3563,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
if (!str.equals("zip") && !str.equals("rar")) {
|
||||
throw new JeroBootException("请上传zip格式的文件或rar格式的文件");
|
||||
}
|
||||
String path = uploadpath + File.separator + "modal" + File.separator + filenameorg;
|
||||
String path = uploadpath + File.separator + "modal" + File.separator + filenameorg + System.currentTimeMillis();
|
||||
File saveDirectory = new File(path);
|
||||
if (!saveDirectory.isDirectory()) {
|
||||
saveDirectory.mkdir();
|
||||
@@ -3693,13 +3693,14 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
}
|
||||
}
|
||||
}
|
||||
workbook.close();
|
||||
//树形数据字典
|
||||
List<SysCategory> categoryList = sysCategoryService.list();
|
||||
//普通数据字典
|
||||
List<SysDictItem> dictItemList = sysDictItemServiceImpl.selectItemsAll();
|
||||
//表头
|
||||
List<Map<String, Object>> addForm = getField(ModuleEnum.DOCUMENT_LIBRARY.getValue(), "cn", "add");
|
||||
exportDatas(dataList, addForm, categoryList, dictItemList, zipEntryName);
|
||||
exportDatas(dataList, addForm, categoryList, dictItemList, zipEntryName,saveDirectory);
|
||||
//删除原上传文件
|
||||
FileUnZip.deleteDir(saveDirectory);
|
||||
|
||||
@@ -3709,7 +3710,8 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
List<Map<String, Object>> fieldList,
|
||||
List<SysCategory> categoryList,
|
||||
List<SysDictItem> dictItemList,
|
||||
String zipEntryName) {
|
||||
String zipEntryName,
|
||||
File saveDirectory) {
|
||||
//树形数据字典
|
||||
List<String> treeNameList = categoryList.stream().map(SysCategory::getName).collect(Collectors.toList());
|
||||
//普通数据字典
|
||||
@@ -3996,11 +3998,14 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
}
|
||||
}
|
||||
|
||||
if (countError > 0) {
|
||||
msgList.add(errorMsg);
|
||||
}
|
||||
// if (countError > 0) {
|
||||
// msgList.add(errorMsg);
|
||||
// }
|
||||
mapResult.put(field, value);
|
||||
}
|
||||
if (countError > 0) {
|
||||
msgList.add(errorMsg);
|
||||
}
|
||||
mapList.add(mapResult);
|
||||
}
|
||||
if (msgList.size() > 0) {
|
||||
@@ -4009,6 +4014,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
for (String s : msgList) {
|
||||
html += s + "</br>";
|
||||
}
|
||||
FileUnZip.deleteDir(saveDirectory);
|
||||
throw new JeroBootException(html);
|
||||
} else {
|
||||
if (mapList.size() != 0) {
|
||||
|
||||
@@ -81,6 +81,8 @@ public class FileUnZip {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}else if(dir.isFile()){
|
||||
return dir.delete();
|
||||
}
|
||||
// 目录此时为空,可以删除
|
||||
return dir.delete();
|
||||
|
||||
Reference in New Issue
Block a user