perf: 企标外标导入部门验证优化

This commit is contained in:
2024-10-10 13:42:21 +08:00
parent f2c9e15023
commit 718af5bfe7
@@ -277,15 +277,12 @@ public class ImportUtil {
// 组织机构 // 组织机构
if (FieldShowTypeEnum.SINGLE_ORGANIZATION_DIALOG.getValue().equals(tag.getFieldShowType()) || if (FieldShowTypeEnum.SINGLE_ORGANIZATION_DIALOG.getValue().equals(tag.getFieldShowType()) ||
FieldShowTypeEnum.MULTI_ORGANIZATION_DIALOG.getValue().equals(tag.getFieldShowType())) { FieldShowTypeEnum.MULTI_ORGANIZATION_DIALOG.getValue().equals(tag.getFieldShowType())) {
List<SysDepart> departList = sysDepartService.list(); if (!this.multiOrgValid(cellValue, sysDepartMap, sysDepartPathMap)) {
Map<String, List<SysDepart>> deaprtMap = departList.stream().collect(Collectors.groupingBy(SysDepart::getDepartName));
Map<String, String> departPartMap = SysDepart.buildPaths(departList);
if (!this.multiOrgValid(cellValue, 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 {
// 转为id // 转为id
cellValue = this.convertMultiOrgId(cellValue, deaprtMap, departPartMap); cellValue = this.convertMultiOrgId(cellValue, sysDepartMap, sysDepartPathMap);
} }
} }
// 单选人员 // 单选人员