refactor(oa): 优化项目进度步骤查询逻辑
- 引入LambdaQueryWrapper提升查询安全性 - 新增buildQueryWrapperLambda方法构建查询条件 - 移除旧版QueryWrapper使用方式 - 增强查询条件的类型检查和可读性- 保持分页查询功能不变 - 添加必要的参数校验逻辑
This commit is contained in:
@@ -15,6 +15,7 @@ import com.ruoyi.oa.domain.OaProjectSchedule;
|
|||||||
import com.ruoyi.oa.domain.bo.BatchBo;
|
import com.ruoyi.oa.domain.bo.BatchBo;
|
||||||
import com.ruoyi.oa.domain.dto.NodeDTO;
|
import com.ruoyi.oa.domain.dto.NodeDTO;
|
||||||
import com.ruoyi.oa.mapper.OaProjectScheduleMapper;
|
import com.ruoyi.oa.mapper.OaProjectScheduleMapper;
|
||||||
|
import kotlin.jvm.internal.Lambda;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.flowable.job.service.impl.ServiceImpl;
|
import org.flowable.job.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -62,11 +63,25 @@ public class OaProjectScheduleStepServiceImpl implements IOaProjectScheduleStepS
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public TableDataInfo<OaProjectScheduleStepVo> queryPageListPage(OaProjectScheduleStepBo bo, PageQuery pageQuery) {
|
public TableDataInfo<OaProjectScheduleStepVo> queryPageListPage(OaProjectScheduleStepBo bo, PageQuery pageQuery) {
|
||||||
QueryWrapper<OaProjectScheduleStep> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<OaProjectScheduleStep> lqw = buildQueryWrapperLambda(bo);
|
||||||
Page<OaProjectScheduleStepVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<OaProjectScheduleStepVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
return TableDataInfo.build(result);
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询项目进度步骤跟踪列表
|
* 查询项目进度步骤跟踪列表
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user