fix: 77892

企业标准--导入--必填字段未填写,错误提示语行数不对应
This commit is contained in:
2023-11-05 22:23:13 +08:00
parent a97d0fd3b6
commit 2b6d097f0c
2 changed files with 9 additions and 3 deletions
@@ -1471,7 +1471,13 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
// 按照实际顺序创建headerList
List<LawsTag> headerList = new ArrayList<>();
for (Cell cell : hearderRow) {
headerList.add(headerMap.get(cell.toString().replace("*", "")));
LawsTag tag = headerMap.get(cell.toString().replace("*", ""));
if (tag == null && !cell.toString().equals("稽查内容")) {
FileUnZip.deleteDir(saveDirectory);
throw new JeroBootException(MessageUtils.getMessage(ResultCommon.IMPORT_TEMPLATE_ERROR));
} else {
headerList.add(tag);
}
}
// 如果是企标的话手动添加稽查内容字段
if (TableNameEnum.ENTERPRISE_STANDARDS.getTableName().equals(tableName)) {
@@ -102,7 +102,7 @@ public class ImportUtil {
if (YesOrNoEnum.YES.getValue().equals(tag.getFieldMustInput())) {
if (!this.mustInputValid(cell)) {
log.error("" + row + "" + tag.getDbFieldTxt() + "为必填 ");
errMsg.append("").append(i).append("行第").append(row).append("").append(tag.getDbFieldTxt()).append("为必填 ");
errMsg.append("").append(row).append("").append(tag.getDbFieldTxt()).append("为必填 ");
continue;
}
}
@@ -293,7 +293,7 @@ public class ImportUtil {
}
}
}
if (errMsg.toString().contains("填写错误")) {
if (errMsg.toString().contains("")) {
errMsgList.add(errMsg.toString());
} else {
insertDataList.add(parameterMap);