This commit is contained in:
yjz
2024-08-15 16:18:46 +08:00
parent 4aca7f4a5e
commit 76da1d1db0
2 changed files with 20 additions and 4 deletions
@@ -1278,7 +1278,7 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
List<ProcessStandardInterpretClauseSublist> clauseSublistList) {
List<String> errorList = new ArrayList<>();
String itemNum = data.getItemNum();
String itemTitle = data.getItemTitle();
String itemTitle = Objects.isNull(data.getItemTitle()) ? "" : data.getItemTitle();
boolean exist = true;
if (StringUtils.isBlank(itemNum)){
errorList.add("标准编号/条款号不能为空!");
@@ -1453,7 +1453,9 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
if(ObjectUtil.isEmpty(importDto.get("item_content"))){
continue;
}
addItemValList = (List<SarFileSplitItemsValEO>) oldItems.get("itemValEOList");
if(!Objects.isNull(oldItems.get("itemValEOList"))){
addItemValList = (List<SarFileSplitItemsValEO>) oldItems.get("itemValEOList");
}
String itemContent = oldItems.get("item_content").toString() + importDto.get("item_content").toString();
oldItems.put("item_content", itemContent);
String[] valArr = importDto.get("item_content").toString().split("\n");
@@ -1834,6 +1836,20 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
resultMsg = "Only one Excel file can be imported in the compressed package root directory";
}
return Result.error(1, resultMsg);
}else {
// 校验名称
File file1 = excelfilelist.get(0);
String name = file1.getName().substring(0, file1.getName().lastIndexOf("."));
if(!"条款导入模板".equals(name)){
//删除原上传文件
FileUnZip.deleteDir(saveDirectory);
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())){
resultMsg = "excel名称不正确,应为:条款导入模板";
}else{
resultMsg = "excel name is incorrect, should be: 条款导入模板";
}
return Result.error(1, resultMsg);
}
}
File excelfile = excelfilelist.get(0);
@@ -4087,8 +4103,8 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
}
try{
//创建临时文件夹
String tempPath = "";
if (fileOriName.length() > 10){
String tempPath = fileOriName;
if (fileOriName.length() > 50){
int index = fileOriName.lastIndexOf(".");
tempPath = fileOriName.substring(0, 50) + fileOriName.substring(index);
}