From 3b2f88facfa178cdd944b306571b2a0fa7dcb6a1 Mon Sep 17 00:00:00 2001 From: caihaohan Date: Tue, 30 Jul 2024 19:28:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=8D=E5=9B=9E=E6=98=BE=E6=B6=89?= =?UTF-8?q?=E5=8F=8A=E7=B3=BB=E7=BB=9F=E9=83=A8=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/LawsCommonServiceImpl.java | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/laws-modules/src/main/java/com/jero/modules/laws/common/service/impl/LawsCommonServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/laws/common/service/impl/LawsCommonServiceImpl.java index e6925867..148475b4 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/common/service/impl/LawsCommonServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/common/service/impl/LawsCommonServiceImpl.java @@ -489,7 +489,7 @@ public class LawsCommonServiceImpl implements ILawsCommonService { resultMap.put(key + FieldCommon._DICT_TEXT, StringUtils.join(fileList.stream() .map(OSSFile::getFileName).collect(Collectors.toList()), ",")); } - } else if (FieldCommon.PART_NAME.equals(key) && StringUtils.isNotBlank(value)) { + } else if (FieldCommon.PART_NAME.equals(key)) { // 如果是零部件 List partNameIdList = partNameStandardService.getByStandardId(id); if (CollectionUtils.isEmpty(partNameIdList)) { @@ -776,6 +776,7 @@ public class LawsCommonServiceImpl implements ILawsCommonService { if (CollUtil.isNotEmpty(partNameStandardList)) { partNameStandardService.saveBatch(partNameStandardList); } + parameterMap.remove(FieldCommon.PART_NAME); } /** @@ -1278,7 +1279,7 @@ public class LawsCommonServiceImpl implements ILawsCommonService { try { initMap = lawsCommonMapper.getByIdAndModule(tableName, selectField, id, standardNumber); } catch (Exception e) { - e.printStackTrace(); + log.error(e.getMessage()); throw new JeroBootException("非法参数异常"); } if (initMap == null) { @@ -1288,24 +1289,24 @@ public class LawsCommonServiceImpl implements ILawsCommonService { Map stringObjectMap = processResultMap(initMap, fieldList); if (module.equals(TableNameEnum.ENTERPRISE_STANDARDS.getValue())) { -// // 企标独有的稽查内容列表 -// LambdaQueryWrapper esIcWrapper = new LambdaQueryWrapper<>(); -// esIcWrapper.eq(EnterpriseStandardInspectContent::getStandardId, id); -// List list = esInspectContentService.list(esIcWrapper); -// List departIdList = list.stream().map(EnterpriseStandardInspectContent::getRectificationDepartment) -// .collect(Collectors.toList()); -// if (departIdList.size() != 0) { -// LambdaQueryWrapper sysDepartLambdaQueryWrapper = new LambdaQueryWrapper<>(); -// sysDepartLambdaQueryWrapper.in(SysDepart::getId, departIdList); -// List departList = sysDepartService.list(sysDepartLambdaQueryWrapper); -// Map> departMap = departList.stream().collect(Collectors.groupingBy(SysDepart::getId)); -// for (EnterpriseStandardInspectContent content : list) { -// if (content.getRectificationDepartment() != null) { -// content.setRectificationDepartment_dictText(departMap.get(content.getRectificationDepartment()).get(0).getDepartName()); -// } -// } -// } -// stringObjectMap.put("checkList", list); + // 企标独有的稽查内容列表 + LambdaQueryWrapper esIcWrapper = new LambdaQueryWrapper<>(); + esIcWrapper.eq(EnterpriseStandardInspectContent::getStandardId, id); + List list = esInspectContentService.list(esIcWrapper); + List departIdList = list.stream().map(EnterpriseStandardInspectContent::getRectificationDepartment) + .collect(Collectors.toList()); + if (!departIdList.isEmpty()) { + LambdaQueryWrapper sysDepartLambdaQueryWrapper = new LambdaQueryWrapper<>(); + sysDepartLambdaQueryWrapper.in(SysDepart::getId, departIdList); + List departList = sysDepartService.list(sysDepartLambdaQueryWrapper); + Map> departMap = departList.stream().collect(Collectors.groupingBy(SysDepart::getId)); + for (EnterpriseStandardInspectContent content : list) { + if (content.getRectificationDepartment() != null) { + content.setRectificationDepartment_dictText(departMap.get(content.getRectificationDepartment()).get(0).getDepartName()); + } + } + } + stringObjectMap.put("checkList", list); // // 设置企标独有的标准适用范围 // // 查询标准拆分表 // LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>();