fix: 87523 企业标准-导入 涉及系统/部件没有正常回显
This commit is contained in:
@@ -385,7 +385,10 @@ public class ImportUtil {
|
|||||||
|
|
||||||
// 企标稽查内容文件导入
|
// 企标稽查内容文件导入
|
||||||
if (FieldShowTypeEnum.INSPECT_CONTENT_FILE_UPLOAD.getValue().equals(tag.getFieldShowType())) {
|
if (FieldShowTypeEnum.INSPECT_CONTENT_FILE_UPLOAD.getValue().equals(tag.getFieldShowType())) {
|
||||||
if (!this.inspectContentFileValid(cellValue, fileMap)) {
|
List<SysDepart> departList = sysDepartService.list();
|
||||||
|
Map<String, List<SysDepart>> deaprtMap = departList.stream().collect(Collectors.groupingBy(SysDepart::getDepartName));
|
||||||
|
Map<String, String> departPartMap = SysDepart.buildPaths(departList);
|
||||||
|
if (!this.inspectContentFileValid(cellValue, fileMap, deaprtMap, departPartMap)) {
|
||||||
log.error("第" + row + "列" + tag.getDbFieldTxt() + "填写错误 ");
|
log.error("第" + row + "列" + tag.getDbFieldTxt() + "填写错误 ");
|
||||||
errMsg.append("第").append(row).append("列").append(tag.getDbFieldTxt()).append("填写错误 ");
|
errMsg.append("第").append(row).append("列").append(tag.getDbFieldTxt()).append("填写错误 ");
|
||||||
} else {
|
} else {
|
||||||
@@ -808,7 +811,8 @@ public class ImportUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 文件校验
|
// 文件校验
|
||||||
private boolean inspectContentFileValid(String cellValue, Map<String, File> fileMap) {
|
private boolean inspectContentFileValid(String cellValue, Map<String, File> fileMap,
|
||||||
|
Map<String, List<SysDepart>> deaprtMap, Map<String, String> departPartMap) {
|
||||||
// 检查是否真的有这个文件
|
// 检查是否真的有这个文件
|
||||||
if (!this.fileValid(cellValue, fileMap)) {
|
if (!this.fileValid(cellValue, fileMap)) {
|
||||||
return false;
|
return false;
|
||||||
@@ -835,12 +839,12 @@ public class ImportUtil {
|
|||||||
String cellContent2 = getCellContent(row.getCell(1));
|
String cellContent2 = getCellContent(row.getCell(1));
|
||||||
String cellContent3 = getCellContent(row.getCell(2));
|
String cellContent3 = getCellContent(row.getCell(2));
|
||||||
// 执行valid方法进行校验
|
// 执行valid方法进行校验
|
||||||
if (!valid(cellContent1, cellContent2)) {
|
if (!valid(cellContent1, cellContent2, cellContent3, deaprtMap, departPartMap)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
log.error(e.getMessage());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -876,9 +880,16 @@ public class ImportUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 必填校验
|
// 必填校验
|
||||||
private boolean valid(String content1, String content2) {
|
private boolean valid(String content1, String content2, String content3, Map<String, List<SysDepart>> deaprtMap, Map<String, String> departPartMap) {
|
||||||
// 这里只做简单的非空校验
|
// 这里只做简单的非空校验
|
||||||
return content1 != null && !content1.trim().isEmpty() && content2 != null && !content2.trim().isEmpty();
|
if (content1 != null && !content1.trim().isEmpty() && content2 != null && !content2.trim().isEmpty()) {
|
||||||
|
if (StrUtil.isNotBlank(content3)) {
|
||||||
|
return multiOrgValid(content3, deaprtMap, departPartMap);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user