diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectInfoServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectInfoServiceImpl.java index f5546e69..64748db2 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectInfoServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectInfoServiceImpl.java @@ -54,6 +54,7 @@ public class ProjectInfoServiceImpl implements IProjectInfoService { public static final String INDUSTRY_TYPE_DICT_TYPE = "industry_type"; + public static final String BG_TYPE_DICT_TYPE = "bg_type"; public static final String PROJECT_STAGE_DICT_TYPE = "project_stage"; public static final String OPERATE_INSTITUTION_DICT_TYPE = "operate_institution"; @@ -222,7 +223,10 @@ public class ProjectInfoServiceImpl implements IProjectInfoService { int logIndex = 1; // 比较项目信息字段差异 logIndex = compareField(logContent, logIndex, "项目名称", oldProjectInfo.getProjectName(), projectInfo.getProjectName()); - logIndex = compareField(logContent, logIndex, "客户名称", oldProjectInfo.getCustomerName(), projectInfo.getCustomerName()); + logIndex = compareField(logContent, logIndex, "最终客户", oldProjectInfo.getCustomerName(), projectInfo.getCustomerName()); + logIndex = compareField(logContent, logIndex, "BG", + DictUtils.getDictLabel(BG_TYPE_DICT_TYPE, oldProjectInfo.getBgProperty()), + DictUtils.getDictLabel(BG_TYPE_DICT_TYPE, projectInfo.getBgProperty())); logIndex = compareField(logContent, logIndex, "行业", DictUtils.getDictLabel(INDUSTRY_TYPE_DICT_TYPE, oldProjectInfo.getIndustryType()) , DictUtils.getDictLabel(INDUSTRY_TYPE_DICT_TYPE, projectInfo.getIndustryType())); @@ -321,13 +325,13 @@ public class ProjectInfoServiceImpl implements IProjectInfoService { Map newMap = CollUtil.isEmpty(newList) ? new HashMap<>() : newList.stream() .collect(Collectors.toMap(ProjectProductInfo::getId, product -> product)); //新增 - List addCode = newList.stream().filter(item -> item.getId() == null).map(ProjectProductInfo::getProductBomCode).collect(Collectors.toList()); + List addCode = CollUtil.isEmpty(newList) ? Collections.emptyList() : newList.stream().filter(item -> item.getId() == null).map(ProjectProductInfo::getProductBomCode).collect(Collectors.toList()); if (CollUtil.isNotEmpty(addCode)) { logContent.append(index).append(".产品新增").append(type).append(":").append(String.join(",", addCode)).append("\n"); index++; } //删除 - List deleteCode = oldList.stream().filter(item -> !newMap.containsKey(item.getId())).map(ProjectProductInfo::getProductBomCode).collect(Collectors.toList()); + List deleteCode =CollUtil.isEmpty(oldList) ? Collections.emptyList() : oldList.stream().filter(item -> !newMap.containsKey(item.getId())).map(ProjectProductInfo::getProductBomCode).collect(Collectors.toList()); if (CollUtil.isNotEmpty(deleteCode)) { logContent.append(index).append(".产品删除").append(type).append(":").append(String.join(",", deleteCode)).append("\n"); index++;