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<>();