feat(hrm): 添加抄送标志字段支持已审批流程查询

- 在HrmFlowCcBo中新增ccFlag字段
- 修改HrmFlowCcController的my方法增加ccFlag参数支持
- 在HrmFlowCcServiceImpl中实现ccFlag为1时查询已审批流程实例逻辑
- 添加flowInstMapper依赖注入用于查询流程实例数据
- 增加stream包导入支持列表转换操作
- 在OaSalaryMasterServiceImpl中添加按创建时间倒序排序功能
This commit is contained in:
2026-02-10 14:56:19 +08:00
parent 77346b97e9
commit 613bf59833
4 changed files with 27 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ import com.ruoyi.common.helper.LoginHelper;
import com.ruoyi.hrm.domain.bo.HrmFlowCcBo;
import com.ruoyi.hrm.domain.vo.HrmFlowCcVo;
import com.ruoyi.hrm.service.IHrmFlowCcService;
import liquibase.pro.packaged.F;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -26,7 +27,7 @@ public class HrmFlowCcController extends BaseController {
* 抄送我的
*/
@GetMapping("/my")
public TableDataInfo<HrmFlowCcVo> my(@RequestParam(required = false) Long ccUserId,@RequestParam(required = false) Integer readFlag, PageQuery pageQuery) {
public TableDataInfo<HrmFlowCcVo> my(@RequestParam(required = false) Long ccUserId,@RequestParam(required = false) Integer readFlag, @RequestParam(required = false) Integer ccFlag,PageQuery pageQuery) {
Long uid = ccUserId;
if (uid == null) {
try {
@@ -38,6 +39,9 @@ public class HrmFlowCcController extends BaseController {
HrmFlowCcBo bo = new HrmFlowCcBo();
bo.setCcUserId(uid);
bo.setReadFlag(readFlag);
if (ccFlag != null) {
bo.setCcFlag(ccFlag);
}
return service.queryPageList(bo, pageQuery);
}

View File

@@ -29,5 +29,7 @@ public class HrmFlowCcBo extends BaseEntity {
private Long fromUserId;
private String remark;
private Integer ccFlag;
}

View File

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.hrm.domain.HrmFlowCc;
import com.ruoyi.hrm.domain.HrmFlowInstance;
import com.ruoyi.hrm.domain.bo.HrmFlowCcBo;
import com.ruoyi.hrm.domain.vo.HrmFlowCcVo;
import com.ruoyi.hrm.mapper.HrmFlowCcMapper;
@@ -16,6 +17,7 @@ import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
@RequiredArgsConstructor
@Service
@@ -26,6 +28,7 @@ public class HrmFlowCcServiceImpl implements IHrmFlowCcService {
private final com.ruoyi.hrm.mapper.HrmTravelReqMapper travelReqMapper;
private final com.ruoyi.hrm.mapper.HrmReimburseReqMapper reimburseReqMapper;
private final com.ruoyi.hrm.mapper.HrmSealReqMapper sealReqMapper;
private final com.ruoyi.hrm.mapper.HrmFlowInstanceMapper flowInstMapper;
@Override
public TableDataInfo<HrmFlowCcVo> queryPageList(HrmFlowCcBo bo, PageQuery pageQuery) {
@@ -103,6 +106,21 @@ public class HrmFlowCcServiceImpl implements IHrmFlowCcService {
lqw.eq(bo.getInstId() != null, HrmFlowCc::getInstId, bo.getInstId());
lqw.eq(bo.getBizType() != null, HrmFlowCc::getBizType, bo.getBizType());
lqw.eq(bo.getReadFlag() != null, HrmFlowCc::getReadFlag, bo.getReadFlag());
if (bo.getCcFlag() != null && bo.getCcFlag() == 1) {
// 这样的话就去查询instance表查找所有已审批 未删除的数据 然后使用in
List<HrmFlowInstance> approved = flowInstMapper.selectList(
Wrappers.<HrmFlowInstance>lambdaQuery()
.eq(HrmFlowInstance::getStatus, "approved")
.eq(HrmFlowInstance::getDelFlag, 0)
);
// 提取实例ID列表用于IN查询
if (!approved.isEmpty()) {
List<Long> instIds = approved.stream()
.map(HrmFlowInstance::getInstId)
.collect(Collectors.toList());
lqw.in(HrmFlowCc::getInstId, instIds);
}
}
lqw.orderByDesc(HrmFlowCc::getCreateTime);
return lqw;
}

View File

@@ -75,6 +75,8 @@ public class OaSalaryMasterServiceImpl implements IOaSalaryMasterService {
lqw.eq(StringUtils.isNotBlank(bo.getDeptManager()), OaSalaryMaster::getDeptManager, bo.getDeptManager());
lqw.eq(StringUtils.isNotBlank(bo.getOperator()), OaSalaryMaster::getOperator, bo.getOperator());
lqw.eq(bo.getSalaryStatus() != null, OaSalaryMaster::getSalaryStatus, bo.getSalaryStatus());
// 根据创建时间倒叙
lqw.orderByDesc(OaSalaryMaster::getCreateTime);
return lqw;
}