From 5638e31c6113fc66106ed89e42ac5497cb218d17 Mon Sep 17 00:00:00 2001 From: chenhao <852066789@qq.com> Date: Fri, 6 Jun 2025 16:10:32 +0800 Subject: [PATCH] =?UTF-8?q?feat(project):=20=E5=A2=9E=E5=8A=A0=20BG=20?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=B9=B6=E4=BC=98=E5=8C=96=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 ProjectInfoServiceImpl 中添加 BG_TYPE_DICT_TYPE 常量 - 更新项目信息变更日志,增加 BG 字段对比 - 修改产品新增和删除日志的生成逻辑,优化空列表处理- 在项目操作日志页面增加内容换行显示,提高可读性 --- .../ruoyi/sip/service/impl/ProjectInfoServiceImpl.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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++;