feat(oa): 新增项目进度步骤分页查询功能

- 在OaProjectScheduleStepMapper中添加selectVoPageNew方法
- 在OaProjectScheduleStepMapper.xml中实现对应的SQL查询逻辑
- 修改OaProjectScheduleStepServiceImpl中的queryPageListPage方法,使用新的查询方法
- 删除旧的buildQueryWrapperLambda方法,改用QueryWrapper构建查询条件
- 在buildQueryWrapper方法中增加nodeHeader、startTime和endTime的查询条件- 在OaProjectScheduleStepVo中添加projectId和projectName字段
This commit is contained in:
2025-11-11 14:01:45 +08:00
parent d2a6d40e93
commit 53f58dc9e1
4 changed files with 60 additions and 16 deletions

View File

@@ -187,6 +187,10 @@ public class OaProjectScheduleStepVo extends BaseEntity {
//其他
private String other;
private Long projectId;
private String projectName;
/** 进度统计内部类封装total、completed等字段 */
@Data
public static class ProgressStats {

View File

@@ -37,4 +37,6 @@ public interface OaProjectScheduleStepMapper extends BaseMapperPlus<OaProjectSch
* @return 删除的记录数
*/
int deleteByScheduleIds(@Param("scheduleIds") Collection<Long> scheduleIds);
Page<OaProjectScheduleStepVo> selectVoPageNew(Page<Object> build,@Param(Constants.WRAPPER) QueryWrapper<OaProjectScheduleStep> lqw);
}

View File

@@ -100,25 +100,11 @@ public class OaProjectScheduleStepServiceImpl implements IOaProjectScheduleStepS
}
@Override
public TableDataInfo<OaProjectScheduleStepVo> queryPageListPage(OaProjectScheduleStepBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<OaProjectScheduleStep> lqw = buildQueryWrapperLambda(bo);
Page<OaProjectScheduleStepVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
QueryWrapper<OaProjectScheduleStep> lqw = buildQueryWrapper(bo);
Page<OaProjectScheduleStepVo> result = baseMapper.selectVoPageNew(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
private LambdaQueryWrapper<OaProjectScheduleStep> buildQueryWrapperLambda(OaProjectScheduleStepBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<OaProjectScheduleStep> lqw = Wrappers.lambdaQuery();
lqw.eq(bo.getScheduleId() != null, OaProjectScheduleStep::getScheduleId, bo.getScheduleId())
.eq(OaProjectScheduleStep::getDelFlag, 0)
.eq(bo.getStepOrder() != null, OaProjectScheduleStep::getStepOrder, bo.getStepOrder())
.like(StringUtils.isNotBlank(bo.getStepName()), OaProjectScheduleStep::getStepName, bo.getStepName())
.eq(bo.getStatus() != null, OaProjectScheduleStep::getStatus, bo.getStatus());
return lqw;
}
/**
* 查询项目进度步骤跟踪列表
*/
@@ -137,6 +123,10 @@ public class OaProjectScheduleStepServiceImpl implements IOaProjectScheduleStepS
lqw.eq(bo.getStepOrder() != null, "opss.step_order", bo.getStepOrder());
lqw.like(StringUtils.isNotBlank(bo.getStepName()), "opss.step_name", bo.getStepName());
lqw.eq(bo.getStatus() != null, "opss.status", bo.getStatus());
lqw.eq(StringUtils.isNotBlank(bo.getNodeHeader()), "opss.node_header", bo.getNodeHeader());
//根据开始时间和结束时间作为范围判断planEnd
lqw.ge(bo.getStartTime() != null, "opss.plan_end", bo.getStartTime());
lqw.le(bo.getEndTime() != null, "opss.plan_end", bo.getEndTime());
return lqw;
}

View File

@@ -209,6 +209,54 @@
and use_flag = '1'
AND del_flag = '0'
</select>
<select id="selectVoPageNew" resultType="com.ruoyi.oa.domain.vo.OaProjectScheduleStepVo">
SELECT
opss.track_id,
opss.accessory,
opss.schedule_id,
opss.step_order,
opss.step_name,
opss.plan_start,
opss.plan_end,
opss.actual_start,
opss.actual_end,
opss.status,
opss.create_by,
opss.create_time,
opss.update_by,
opss.update_time,
opss.del_flag,
opss.header,
opss.use_flag,
opss.batch_id,
opss.tab_node,
opss.first_level_node,
opss.second_level_node,
opss.start_time,
opss.original_end_time,
opss.end_time,
opss.node_header,
opss.related_docs,
opss.related_images,
opss.supplier_id,
opss.requirement_file,
opss.other,
opss.specification,
opss.sort_num,
schedule.project_id AS projectId,
project.project_name AS projectName,
supplier.supplier_name AS supplierName
FROM
oa_project_schedule_step opss
INNER JOIN oa_project_schedule schedule
ON opss.schedule_id = schedule.schedule_id
INNER JOIN sys_oa_project project
ON schedule.project_id = project.project_id
-- 根据供应商id拿供应商名字
LEFT JOIN oa_supplier supplier
ON opss.supplier_id = supplier.supplier_id
#{ew.customSqlSegment}
</select>
</mapper>