feat(导入拆分结果): 临时提交
This commit is contained in:
+15
@@ -1424,7 +1424,10 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
// 表头
|
||||
List<Map<String, Object>> fieldList = getImportOnlField(ModuleEnum.FILE_SPLIT_ITEMS.getValue(),cut);
|
||||
//验证导入数据是否符合规则
|
||||
long a = System.currentTimeMillis();
|
||||
Map map = validateImportDatas(list,categoryList,dictItemList,fieldList,filepath,cut);
|
||||
long b = System.currentTimeMillis();
|
||||
log.error("================校验耗时:" + (b - a) + "ms");
|
||||
boolean isOk = (boolean) map.get("result");
|
||||
if (!isOk) {
|
||||
//验证没有通过
|
||||
@@ -1437,6 +1440,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
// 最终添加的数据
|
||||
List<Map<String, Object>> addItemsEOList = new ArrayList<>();
|
||||
int itemNum = 0;
|
||||
long c = System.currentTimeMillis();
|
||||
for (Map<String, Object> importDto : list) {
|
||||
//判断此行数据是否全部为空,是则不读取
|
||||
if(checkObjAllFieldsIsNull(importDto)){
|
||||
@@ -1729,6 +1733,8 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
}
|
||||
itemNum++;
|
||||
}
|
||||
long d = System.currentTimeMillis();
|
||||
log.error("================for耗时:" + (d - c) + "ms");
|
||||
//TODO 创建树结构
|
||||
Long treeListDisplay = 1L;
|
||||
//获取导入数据一级节点级数
|
||||
@@ -1793,12 +1799,15 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
// throw new AdcDaBaseException("导入目录命名不规范");
|
||||
// }
|
||||
//添加条款
|
||||
long aa = System.currentTimeMillis();
|
||||
for (Map<String, Object> itemsEO : addItemsEOList) {
|
||||
if(menuAndItemMap.get(itemsEO.get("id")) != null) {
|
||||
createItemsInfo(itemsEO, menuAndItemMap.get((String)itemsEO.get("id")), infoId);
|
||||
}
|
||||
countSuccess++;
|
||||
}
|
||||
long bb = System.currentTimeMillis();
|
||||
log.error("================插入条款耗时:" + (bb - aa) + "ms");
|
||||
//导入之后的节点(包括子节点),序号加一
|
||||
SarFileSplitMenuEOPage page = new SarFileSplitMenuEOPage();
|
||||
page.setInfoId(targetMenuEO.getInfoId());
|
||||
@@ -1821,6 +1830,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
}
|
||||
}
|
||||
}
|
||||
long e = System.currentTimeMillis();
|
||||
for (SarFileSplitMenuTreeNode treeNode : treeList) {
|
||||
//创建菜单
|
||||
SarFileSplitMenuEO sarFileSplitMenuEO = new SarFileSplitMenuEO();
|
||||
@@ -1837,6 +1847,8 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
sarFileSplitMenuEO.setModifyTime(new Date());
|
||||
sarFileSplitMenuEOMapper.insertSelective(sarFileSplitMenuEO);
|
||||
}
|
||||
long f = System.currentTimeMillis();
|
||||
log.error("================插入菜单耗时:" + (f - e) + "ms");
|
||||
String msg = "";
|
||||
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())){
|
||||
msg = "成功导入" + countSuccess + "条";
|
||||
@@ -2100,7 +2112,10 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
OSSFile ossFile = ossFileService.getById(splitFileId);
|
||||
String url = ossFile.getUrl();
|
||||
MultipartFile mFile = null;
|
||||
long a = System.currentTimeMillis();
|
||||
try (InputStream inputStream = ObsBootUtil.getOssFile(url)) {
|
||||
long b = System.currentTimeMillis();
|
||||
log.error("================获取文件耗时:" + (b - a) + "ms");
|
||||
if (Objects.isNull(inputStream)) {
|
||||
if (MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) {
|
||||
throw new JeroBootException("导入的压缩包不存在!");
|
||||
|
||||
Reference in New Issue
Block a user