feat(erp): 新增项目变更编号字段支持

- 在ErpProjectChange、ErpProjectChangeBo和ErpProjectChangeVo中新增projectChangeCode字段
- 更新ErpProjectChangeMapper.xml,查询和更新语句中加入projectChangeCode字段
- 在ErpProjectChangeServiceImpl的查询条件中添加projectChangeCode的匹配逻辑
- 修改变更进度查询,使用连表查询带出项目计划阶段信息,提高数据完整性和查询效率
dev
zangch@mesnac.com 1 month ago
parent 85aae5bb1e
commit dfad1177ee

@ -31,6 +31,11 @@ public class ErpProjectChange extends TenantEntity {
@TableId(value = "project_change_id", type = IdType.ASSIGN_ID)
private Long projectChangeId;
/**
*
*/
private String projectChangeCode;
/**
* ID
*/

@ -34,6 +34,11 @@ public class ErpProjectChangeBo extends BaseEntity {
@NotNull(message = "项目变更ID不能为空", groups = { EditGroup.class })
private Long projectChangeId;
/**
*
*/
private String projectChangeCode;
/**
* ID
*/

@ -41,6 +41,12 @@ public class ErpProjectChangeVo implements Serializable {
@ExcelProperty(value = "项目变更ID")
private Long projectChangeId;
/**
*
*/
@ExcelProperty(value = "项目变更编号")
private String projectChangeCode;
/**
* ID
*/

@ -152,6 +152,7 @@ public class ErpProjectChangeServiceImpl implements IErpProjectChangeService {
.selectAll(ErpProjectChange.class)
.eq(ErpProjectChange::getDelFlag, "0")
.eq(bo.getProjectId() != null, ErpProjectChange::getProjectId, bo.getProjectId())
.eq(StringUtils.isNotBlank(bo.getProjectChangeCode()), ErpProjectChange::getProjectChangeCode, bo.getProjectChangeCode())
.eq(StringUtils.isNotBlank(bo.getProjectCode()), ErpProjectChange::getProjectCode, bo.getProjectCode())
.like(StringUtils.isNotBlank(bo.getProjectName()), ErpProjectChange::getProjectName, bo.getProjectName())
.eq(StringUtils.isNotBlank(bo.getProjectCategory()), ErpProjectChange::getProjectCategory, bo.getProjectCategory())
@ -376,12 +377,8 @@ public class ErpProjectChangeServiceImpl implements IErpProjectChangeService {
}
vo.setBudgetList(budgetList);
// 查询上一次变更的进度变更明细作为参考
List<ErpProjectChangeProgress> lastProgressList = changeProgressMapper.selectList(
Wrappers.<ErpProjectChangeProgress>lambdaQuery()
.eq(ErpProjectChangeProgress::getProjectChangeId, lastChange.getProjectChangeId())
.orderByAsc(ErpProjectChangeProgress::getSortOrder)
);
// 查询上一次变更的进度变更明细作为参考(连表查询项目计划阶段,带出 projectPhases 字段)
List<ErpProjectChangeProgress> lastProgressList = changeProgressMapper.selectProgressWithStageInfo(lastChange.getProjectChangeId());
List<ErpProjectChangeProgress> progressList = new ArrayList<>();
// 将上一次的变更后时间作为本次的原计划时间

@ -7,7 +7,7 @@
</resultMap>
<select id="selectCustomErpProjectChangeVoList" resultMap="ErpProjectChangeResult">
select t.project_change_id, t.tenant_id, t.project_id, t.project_code, t.project_name, t.project_category,
select t.project_change_id, t.project_change_code, t.tenant_id, t.project_id, t.project_code, t.project_name, t.project_category,
t.change_type, t.change_number, t.project_manager_id, t.dept_head_id, t.responsible_vp_id,
t.apply_change_date, t.contract_amount, t.contract_net_amount, t.current_status, t.change_reason,
t.follow_up_work, t.project_change_status, t.flow_status, t.remark, t.active_flag, t.del_flag,
@ -26,7 +26,7 @@
<!-- 根据ID查询详情 -->
<select id="selectCustomErpProjectChangeVoById" resultMap="ErpProjectChangeResult">
select t.project_change_id, t.tenant_id, t.project_id, t.project_code, t.project_name, t.project_category,
select t.project_change_id, t.project_change_code, t.tenant_id, t.project_id, t.project_code, t.project_name, t.project_category,
t.change_type, t.change_number, t.project_manager_id, t.dept_head_id, t.responsible_vp_id,
t.apply_change_date, t.contract_amount, t.contract_net_amount, t.current_status, t.change_reason,
t.follow_up_work, t.project_change_status, t.flow_status, t.remark, t.active_flag, t.del_flag,
@ -45,7 +45,7 @@
<!-- 批量查询 - 根据ID列表 -->
<select id="selectCustomErpProjectChangeVoByIds" resultMap="ErpProjectChangeResult">
select project_change_id, tenant_id, project_id, project_code, project_name, project_category, change_type, change_number, project_manager_id, project_manager_name, dept_head_id, dept_head_name, responsible_vp_id, responsible_vp_name, apply_change_date, contract_amount, contract_net_amount, current_status, change_reason, follow_up_work, project_change_status, flow_status, remark, active_flag, del_flag, create_dept, create_by, create_time, update_by, update_time
select project_change_id, project_change_code, tenant_id, project_id, project_code, project_name, project_category, change_type, change_number, project_manager_id, project_manager_name, dept_head_id, dept_head_name, responsible_vp_id, responsible_vp_name, apply_change_date, contract_amount, contract_net_amount, current_status, change_reason, follow_up_work, project_change_status, flow_status, remark, active_flag, del_flag, create_dept, create_by, create_time, update_by, update_time
from erp_project_change t
where t.project_change_id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
@ -61,7 +61,7 @@
<!-- 分页查询(带自定义条件) -->
<select id="selectCustomErpProjectChangeVoPage" resultMap="ErpProjectChangeResult">
select project_change_id, tenant_id, project_id, project_code, project_name, project_category, change_type, change_number, project_manager_id, project_manager_name, dept_head_id, dept_head_name, responsible_vp_id, responsible_vp_name, apply_change_date, contract_amount, contract_net_amount, current_status, change_reason, follow_up_work, project_change_status, flow_status, remark, active_flag, del_flag, create_dept, create_by, create_time, update_by, update_time
select project_change_id, project_change_code, tenant_id, project_id, project_code, project_name, project_category, change_type, change_number, project_manager_id, project_manager_name, dept_head_id, dept_head_name, responsible_vp_id, responsible_vp_name, apply_change_date, contract_amount, contract_net_amount, current_status, change_reason, follow_up_work, project_change_status, flow_status, remark, active_flag, del_flag, create_dept, create_by, create_time, update_by, update_time
from erp_project_change t
${ew.getCustomSqlSegment}
</select>
@ -73,6 +73,8 @@
project_id,
project_change_code,
project_code,
project_name,
@ -135,6 +137,8 @@
#{item.projectId},
#{item.projectChangeCode},
#{item.projectCode},
#{item.projectName},
@ -204,6 +208,9 @@
<if test="item.projectId != null">
project_id = #{item.projectId},
</if>
<if test="item.projectChangeCode != null and item.projectChangeCode != ''">
project_change_code = #{item.projectChangeCode},
</if>
<if test="item.projectCode != null and item.projectCode != ''">
project_code = #{item.projectCode},
</if>

Loading…
Cancel
Save