feat(oa): 新增个人项目进度步骤分页查询功能
- 在IOaProjectScheduleStepService接口中新增queryPageListMyPage方法 - 在OaProjectScheduleStepController中新增/listMyPage接口 - 实现buildQueryMyWrapper方法,默认筛选当前用户负责的节点 - 添加按照负责人(steward)字段进行筛选的功能 - 查询条件包括状态、供应商、计划完成时间范围等 - 结果按计划完成时间倒序排列,已完成项排在最后 - 支持分页查询和个人工作台页面展示需求
This commit is contained in:
@@ -61,6 +61,13 @@ public class OaProjectScheduleStepController extends BaseController {
|
||||
return iOaProjectScheduleStepService.queryPageListPage(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目进度步骤跟踪列表
|
||||
*/
|
||||
@GetMapping("/listMyPage")
|
||||
public TableDataInfo<OaProjectScheduleStepVo> listMyPage(OaProjectScheduleStepBo bo, PageQuery pageQuery) {
|
||||
return iOaProjectScheduleStepService.queryPageListMyPage(bo, pageQuery);
|
||||
}
|
||||
/**
|
||||
* 导出项目进度步骤跟踪列表
|
||||
*/
|
||||
|
||||
@@ -76,4 +76,5 @@ public interface IOaProjectScheduleStepService{
|
||||
|
||||
PersonalReportDTO personalReport(Long poolId, String nickName);
|
||||
|
||||
TableDataInfo<OaProjectScheduleStepVo> queryPageListMyPage(OaProjectScheduleStepBo bo, PageQuery pageQuery);
|
||||
}
|
||||
|
||||
@@ -93,6 +93,8 @@ public class OaProjectScheduleServiceImpl implements IOaProjectScheduleService {
|
||||
lqw.eq(bo.getStatus() != null, "ops.status", bo.getStatus());
|
||||
//根据内外贸
|
||||
lqw.eq(bo.getTradeType() !=null, "op.trade_type",bo.getTradeType());
|
||||
//新增按照steward筛选
|
||||
lqw.eq(bo.getSteward() != null, "ops.steward", bo.getSteward());
|
||||
//根据代号
|
||||
lqw.like(bo.getProjectCode() != null, "op.project_code", bo.getProjectCode());
|
||||
lqw.like(bo.getProjectNum() != null, "op.project_num", bo.getProjectNum());
|
||||
|
||||
@@ -105,6 +105,33 @@ public class OaProjectScheduleStepServiceImpl implements IOaProjectScheduleStepS
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<OaProjectScheduleStepVo> queryPageListMyPage(OaProjectScheduleStepBo bo, PageQuery pageQuery) {
|
||||
QueryWrapper<OaProjectScheduleStep> lqw = buildQueryMyWrapper(bo);
|
||||
Page<OaProjectScheduleStepVo> result = baseMapper.selectVoPageNew(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
private QueryWrapper<OaProjectScheduleStep> buildQueryMyWrapper(OaProjectScheduleStepBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
QueryWrapper<OaProjectScheduleStep> lqw = Wrappers.query();
|
||||
lqw.eq("opss.use_flag", 1);
|
||||
lqw.eq(bo.getScheduleId() != null, "opss.schedule_id", bo.getScheduleId());
|
||||
lqw.eq("opss.del_flag", 0);
|
||||
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());
|
||||
// 默认将负责人设置为当前用户
|
||||
String currentUser = LoginHelper.getNickName();
|
||||
lqw.eq(StringUtils.isNotBlank(currentUser), "opss.node_header", currentUser);
|
||||
lqw.eq(bo.getSupplierId() != null, "opss.supplier_id", bo.getSupplierId());
|
||||
//根据开始时间和结束时间作为范围判断planEnd
|
||||
lqw.ge(bo.getStartTime() != null, "opss.plan_end", bo.getStartTime());
|
||||
lqw.le(bo.getEndTime() != null, "opss.plan_end", bo.getEndTime());
|
||||
// 按时间倒序排列,已完成的排在最后
|
||||
lqw.orderByDesc("opss.plan_end");
|
||||
lqw.orderByAsc("opss.status = 2"); // 状态为2表示已完成,将其排在最后
|
||||
return lqw;
|
||||
}
|
||||
/**
|
||||
* 查询项目进度步骤跟踪列表
|
||||
*/
|
||||
@@ -488,6 +515,8 @@ public class OaProjectScheduleStepServiceImpl implements IOaProjectScheduleStepS
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 统计用户活跃天数
|
||||
* @param userId 用户ID
|
||||
|
||||
Reference in New Issue
Block a user