feat(sip): 新增 BG属性并优化项目产品信息管理- 在 ProjectInfo 模型中添加 bgProperty 字段,用于存储 BG 属性
- 将软件项目产品信息和硬件项目产品信息合并为一个列表,简化数据结构 - 更新 ProjectInfoMapper.xml,增加 bgProperty 相关的 SQL 语句 - 修改 ProjectInfoServiceImpl 中的产品信息保存和比较逻辑master
parent
81939a2af0
commit
4c24430399
|
@ -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<ProjectProductInfo> softwareProjectProductInfoList;
|
||||
/** 硬件项目产品信息 */
|
||||
private List<ProjectProductInfo> hardwareProjectProductInfoList;
|
||||
/** 项目产品信息 */
|
||||
private List<ProjectProductInfo> projectProductInfoList;
|
||||
|
||||
/** 项目操作日志信息 */
|
||||
private List<ProjectOperateLog> projectOperateLogList;
|
||||
/** 项目工作进度信息 */
|
||||
|
|
|
@ -64,9 +64,7 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
|
|||
ProjectInfo projectInfo = projectInfoMapper.selectProjectInfoById(id);
|
||||
//查询产品信息
|
||||
List<ProjectProductInfo> projectProductInfos = productInfoService.selectProjectProductInfoListByProjectId(projectInfo.getId());
|
||||
Map<String, List<ProjectProductInfo>> 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<ProjectWorkProgress> projectWorkProgresses = workProgressService.selectProjectWorkProgressListByProjectId((projectInfo.getId()));
|
||||
projectInfo.setProjectWorkProgressList(projectWorkProgresses);
|
||||
|
@ -138,20 +136,12 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
|
|||
|
||||
private void saveOtherInfo(ProjectInfo projectInfo1) {
|
||||
//插入产品信息
|
||||
List<ProjectProductInfo> hardwareProjectProductInfoList = projectInfo1.getHardwareProjectProductInfoList();
|
||||
List<ProjectProductInfo> softwareProjectProductInfoList = projectInfo1.getSoftwareProjectProductInfoList();
|
||||
List<ProjectProductInfo> 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<ProjectProductInfo> projectProductInfoList = projectInfo1.getProjectProductInfoList();
|
||||
if (CollUtil.isNotEmpty(projectProductInfoList)) {
|
||||
for (ProjectProductInfo projectProductInfo : projectProductInfoList) {
|
||||
projectProductInfo.setProjectId(projectInfo1.getId());
|
||||
}
|
||||
productInfoService.saveBatch(addList);
|
||||
productInfoService.saveBatch(projectProductInfoList);
|
||||
}
|
||||
//插入变更记录信息
|
||||
List<ProjectWorkProgress> 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<ProjectProductInfo> oldHardwareList = oldProjectInfo.getHardwareProjectProductInfoList();
|
||||
List<ProjectProductInfo> oldSoftwareList = oldProjectInfo.getSoftwareProjectProductInfoList();
|
||||
List<ProjectProductInfo> newHardwareList = projectInfo.getHardwareProjectProductInfoList();
|
||||
List<ProjectProductInfo> newSoftwareList = projectInfo.getSoftwareProjectProductInfoList();
|
||||
List<ProjectProductInfo> oldProductList = oldProjectInfo.getProjectProductInfoList();
|
||||
|
||||
// 比较硬件产品信息
|
||||
logIndex = compareProductInfoList(logContent, logIndex, "硬件产品", oldHardwareList, newHardwareList);
|
||||
List<ProjectProductInfo> 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) {
|
||||
|
|
|
@ -31,10 +31,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="bgProperty" column="bg_property" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProjectInfoVo">
|
||||
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
|
||||
</sql>
|
||||
|
@ -47,6 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="customerCode != null and customerCode != ''"> and customer_code = #{customerCode}</if>
|
||||
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
|
||||
<if test="industryType != null and industryType != ''"> and industry_type = #{industryType}</if>
|
||||
<if test="bgProperty != null and bgProperty != ''"> and bg_property = #{bgProperty}</if>
|
||||
<if test="province != null and province != ''"> and province = #{province}</if>
|
||||
<if test="projectStage != null and projectStage != ''"> and project_stage = #{projectStage}</if>
|
||||
<if test="projectGraspDegree != null and projectGraspDegree != ''"> and project_grasp_degree = #{projectGraspDegree}</if>
|
||||
|
@ -135,6 +137,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="customerCode != null">customer_code,</if>
|
||||
<if test="customerName != null">customer_name,</if>
|
||||
<if test="industryType != null">industry_type,</if>
|
||||
<if test="bgProperty != null">bg_property,</if>
|
||||
<if test="province != null">province,</if>
|
||||
<if test="projectStage != null">project_stage,</if>
|
||||
<if test="projectGraspDegree != null">project_grasp_degree,</if>
|
||||
|
@ -163,6 +166,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="customerCode != null">#{customerCode},</if>
|
||||
<if test="customerName != null">#{customerName},</if>
|
||||
<if test="industryType != null">#{industryType},</if>
|
||||
<if test="bgProperty != null">#{bgProperty},</if>
|
||||
<if test="province != null">#{province},</if>
|
||||
<if test="projectStage != null">#{projectStage},</if>
|
||||
<if test="projectGraspDegree != null">#{projectGraspDegree},</if>
|
||||
|
@ -194,6 +198,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="projectName != null">project_name = #{projectName},</if>
|
||||
<if test="customerCode != null">customer_code = #{customerCode},</if>
|
||||
<if test="customerName != null">customer_name = #{customerName},</if>
|
||||
<if test="bgProperty != null">bg_property=#{bgProperty},</if>
|
||||
<if test="industryType != null">industry_type = #{industryType},</if>
|
||||
<if test="province != null">province = #{province},</if>
|
||||
<if test="projectStage != null">project_stage = #{projectStage},</if>
|
||||
|
|
Loading…
Reference in New Issue