From 4c24430399837742c9c5d1c85b7c69e2ffb4373f Mon Sep 17 00:00:00 2001 From: chenhao <852066789@qq.com> Date: Wed, 4 Jun 2025 10:03:17 +0800 Subject: [PATCH] =?UTF-8?q?feat(sip):=20=E6=96=B0=E5=A2=9E=20BG=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E5=B9=B6=E4=BC=98=E5=8C=96=E9=A1=B9=E7=9B=AE=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E4=BF=A1=E6=81=AF=E7=AE=A1=E7=90=86-=20=E5=9C=A8=20Pr?= =?UTF-8?q?ojectInfo=20=E6=A8=A1=E5=9E=8B=E4=B8=AD=E6=B7=BB=E5=8A=A0=20bgP?= =?UTF-8?q?roperty=20=E5=AD=97=E6=AE=B5=EF=BC=8C=E7=94=A8=E4=BA=8E?= =?UTF-8?q?=E5=AD=98=E5=82=A8=20BG=20=E5=B1=9E=E6=80=A7=20-=20=E5=B0=86?= =?UTF-8?q?=E8=BD=AF=E4=BB=B6=E9=A1=B9=E7=9B=AE=E4=BA=A7=E5=93=81=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=92=8C=E7=A1=AC=E4=BB=B6=E9=A1=B9=E7=9B=AE=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E4=BF=A1=E6=81=AF=E5=90=88=E5=B9=B6=E4=B8=BA=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E5=88=97=E8=A1=A8=EF=BC=8C=E7=AE=80=E5=8C=96=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=BB=93=E6=9E=84=20-=20=E6=9B=B4=E6=96=B0=20ProjectI?= =?UTF-8?q?nfoMapper.xml=EF=BC=8C=E5=A2=9E=E5=8A=A0=20bgProperty=20?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E7=9A=84=20SQL=20=E8=AF=AD=E5=8F=A5=20-=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=20ProjectInfoServiceImpl=20=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E4=BA=A7=E5=93=81=E4=BF=A1=E6=81=AF=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E5=92=8C=E6=AF=94=E8=BE=83=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/sip/domain/ProjectInfo.java | 9 +++-- .../service/impl/ProjectInfoServiceImpl.java | 37 ++++++------------- .../mapper/sip/ProjectInfoMapper.xml | 7 +++- 3 files changed, 23 insertions(+), 30 deletions(-) diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/ProjectInfo.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/ProjectInfo.java index 61a7cd95..7597c1ba 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/ProjectInfo.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/ProjectInfo.java @@ -36,6 +36,8 @@ public class ProjectInfo extends BaseEntity /** 客户code */ // @Excel(name = "客户code") private String customerCode; + /** BG属性 */ + private String bgProperty; /** 客户名称 */ @Excel(name = "客户名称") @@ -120,10 +122,9 @@ public class ProjectInfo extends BaseEntity private String projectDesc; private Boolean highlight; private Boolean canGenerate; - /** 软件项目产品信息 */ - private List softwareProjectProductInfoList; - /** 硬件项目产品信息 */ - private List hardwareProjectProductInfoList; + /** 项目产品信息 */ + private List projectProductInfoList; + /** 项目操作日志信息 */ private List projectOperateLogList; /** 项目工作进度信息 */ 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 637eaa7a..430fdbc5 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 @@ -64,9 +64,7 @@ public class ProjectInfoServiceImpl implements IProjectInfoService { ProjectInfo projectInfo = projectInfoMapper.selectProjectInfoById(id); //查询产品信息 List projectProductInfos = productInfoService.selectProjectProductInfoListByProjectId(projectInfo.getId()); - Map> productListMap = projectProductInfos.stream().collect(Collectors.groupingBy(ProjectProductInfo::getType, Collectors.toList())); - projectInfo.setHardwareProjectProductInfoList(productListMap.get(ProductInfo.ProductTypeEnum.HARDWARE.getType())); - projectInfo.setSoftwareProjectProductInfoList(productListMap.get(ProductInfo.ProductTypeEnum.SOFTWARE.getType())); + projectInfo.setProjectProductInfoList(projectProductInfos); //查询变更记录信息 List projectWorkProgresses = workProgressService.selectProjectWorkProgressListByProjectId((projectInfo.getId())); projectInfo.setProjectWorkProgressList(projectWorkProgresses); @@ -138,20 +136,12 @@ public class ProjectInfoServiceImpl implements IProjectInfoService { private void saveOtherInfo(ProjectInfo projectInfo1) { //插入产品信息 - List hardwareProjectProductInfoList = projectInfo1.getHardwareProjectProductInfoList(); - List softwareProjectProductInfoList = projectInfo1.getSoftwareProjectProductInfoList(); - List addList = new ArrayList<>(); - if (CollUtil.isNotEmpty(hardwareProjectProductInfoList)) { - addList.addAll(hardwareProjectProductInfoList); - } - if (CollUtil.isNotEmpty(softwareProjectProductInfoList)) { - addList.addAll(softwareProjectProductInfoList); - } - if (CollUtil.isNotEmpty(addList)) { - for (ProjectProductInfo projectProductInfo : addList) { + List projectProductInfoList = projectInfo1.getProjectProductInfoList(); + if (CollUtil.isNotEmpty(projectProductInfoList)) { + for (ProjectProductInfo projectProductInfo : projectProductInfoList) { projectProductInfo.setProjectId(projectInfo1.getId()); } - productInfoService.saveBatch(addList); + productInfoService.saveBatch(projectProductInfoList); } //插入变更记录信息 List projectWorkProgressList = projectInfo1.getProjectWorkProgressList(); @@ -238,22 +228,19 @@ public class ProjectInfoServiceImpl implements IProjectInfoService { logIndex = compareField(logContent, logIndex, "项目简述", oldProjectInfo.getProjectDesc(), projectInfo.getProjectDesc()); if (logIndex > 1) { logSimpleIndex = logIndex; - logSimpleContent.append("1.配置信息发生变更\n"); + logSimpleContent.append("1.项目信息发生变更\n"); } // 配置信息变更 - List oldHardwareList = oldProjectInfo.getHardwareProjectProductInfoList(); - List oldSoftwareList = oldProjectInfo.getSoftwareProjectProductInfoList(); - List newHardwareList = projectInfo.getHardwareProjectProductInfoList(); - List newSoftwareList = projectInfo.getSoftwareProjectProductInfoList(); + List oldProductList = oldProjectInfo.getProjectProductInfoList(); - // 比较硬件产品信息 - logIndex = compareProductInfoList(logContent, logIndex, "硬件产品", oldHardwareList, newHardwareList); + List newProductList = projectInfo.getProjectProductInfoList(); + + // 比较产品信息 + logIndex = compareProductInfoList(logContent, logIndex, "配置", oldProductList, newProductList); if (logSimpleIndex != logIndex) { - logSimpleContent.append(StringUtils.isNotEmpty(logSimpleContent)?"1.":"2.").append("产品信息发生变更"); + logSimpleContent.append(StringUtils.isNotEmpty(logSimpleContent)?"1.":"2.").append("配置信息发生变更"); } - // 比较软件产品信息 - logIndex = compareProductInfoList(logContent, logIndex, "软件产品", oldSoftwareList, newSoftwareList); // 插入操作日志 if (logContent.length() > 0) { diff --git a/ruoyi-sip/src/main/resources/mapper/sip/ProjectInfoMapper.xml b/ruoyi-sip/src/main/resources/mapper/sip/ProjectInfoMapper.xml index 23cd3b38..c2a483f3 100644 --- a/ruoyi-sip/src/main/resources/mapper/sip/ProjectInfoMapper.xml +++ b/ruoyi-sip/src/main/resources/mapper/sip/ProjectInfoMapper.xml @@ -31,10 +31,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + - select id, project_code, project_name, customer_code, customer_name, industry_type, province, project_stage, project_grasp_degree, hz_support_user, operate_institution + select id, project_code, project_name,bg_property, customer_code, customer_name, industry_type, province, project_stage, project_grasp_degree, hz_support_user, operate_institution , partner_code, partner_name, contact_way, estimated_amount, currency_type, estimated_order_time, estimated_deliver_time, competitor, country_product, server_configuration , key_problem, project_desc, create_by, create_time, update_by, update_time from project_info @@ -47,6 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and customer_code = #{customerCode} and customer_name like concat('%', #{customerName}, '%') and industry_type = #{industryType} + and bg_property = #{bgProperty} and province = #{province} and project_stage = #{projectStage} and project_grasp_degree = #{projectGraspDegree} @@ -135,6 +137,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" customer_code, customer_name, industry_type, + bg_property, province, project_stage, project_grasp_degree, @@ -163,6 +166,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{customerCode}, #{customerName}, #{industryType}, + #{bgProperty}, #{province}, #{projectStage}, #{projectGraspDegree}, @@ -194,6 +198,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" project_name = #{projectName}, customer_code = #{customerCode}, customer_name = #{customerName}, + bg_property=#{bgProperty}, industry_type = #{industryType}, province = #{province}, project_stage = #{projectStage},