fix: 解读流程导入校验问题

This commit is contained in:
yjz
2024-08-15 11:09:27 +08:00
parent 9b92fadf6b
commit 1f7139d519
2 changed files with 15 additions and 1 deletions
@@ -1289,7 +1289,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("标准编号/条款号不能为空!");
@@ -1906,6 +1906,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);