feat: 添加审批历史页面,处于办公中心下

This commit is contained in:
2026-04-15 15:09:03 +08:00
parent f4dbe29d8e
commit 09f1adb63b
9 changed files with 105 additions and 50 deletions

View File

@@ -6,6 +6,7 @@ import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.helper.LoginHelper;
import com.ruoyi.hrm.domain.bo.HrmFlowTaskBo;
import com.ruoyi.hrm.domain.bo.HrmFlowTaskApproveBo;
import com.ruoyi.hrm.domain.bo.HrmSealStampBo;
@@ -112,4 +113,14 @@ public class HrmFlowTaskController extends BaseController {
@RequestParam(required = false) String remark) {
return toAjax(service.transfer(taskId, newAssigneeUserId, actionUserId, remark));
}
/**
* 审批历史列表:查询当前用户的审批历史,包含分页
*/
@GetMapping("/historyList")
public TableDataInfo<HrmFlowTaskVo> historyList(PageQuery pageQuery) {
// 使用若依自带的 LoginHelper 获取当前登录用户的 ID (类型是 Long)
Long userId = LoginHelper.getUserId();
// 调用 Service
return service.selectHistoryTaskList(userId, pageQuery);
}
}

View File

@@ -2,6 +2,7 @@ package com.ruoyi.hrm.service;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.hrm.domain.HrmFlowTask;
import com.ruoyi.hrm.domain.bo.HrmFlowTaskBo;
import com.ruoyi.hrm.domain.vo.HrmFlowTaskVo;
@@ -42,6 +43,10 @@ public interface IHrmFlowTaskService {
*/
Boolean transfer(Long taskId, Long newAssigneeUserId, Long actionUserId, String remark);
/**
* 查询当前用户的审批历史,并回填业务数据
*/
TableDataInfo<HrmFlowTaskVo> selectHistoryTaskList(Long userId, PageQuery pageQuery);
/**
* 根据业务类型 + 业务ID 查询当前待办任务pending用于详情页自动带出 currentTaskId
*/

View File

@@ -38,6 +38,7 @@ public class HrmFlowTaskServiceImpl implements IHrmFlowTaskService {
private final FlowAssigneeHelper assigneeHelper;
private final BizStatusSyncHelper bizStatusSyncHelper;
private final HrmFlowTaskMapper hrmFlowTaskMapper;
// 注入五个业务Mapper
private final HrmLeaveReqMapper leaveReqMapper;
private final HrmTravelReqMapper travelReqMapper;
@@ -397,4 +398,27 @@ public class HrmFlowTaskServiceImpl implements IHrmFlowTaskService {
lqw.orderByDesc(HrmFlowTask::getCreateTime);
return lqw;
}
/**
* 查询当前用户的审批历史,回填业务数据以便前端复用页面
*/
@Override
public TableDataInfo<HrmFlowTaskVo> selectHistoryTaskList(Long userId, PageQuery pageQuery) {
LambdaQueryWrapper<HrmFlowTask> lqw = Wrappers.lambdaQuery();
lqw.eq(HrmFlowTask::getAssigneeUserId, userId);
lqw.ne(HrmFlowTask::getStatus, "pending");
lqw.orderByDesc(HrmFlowTask::getCreateTime);
Page<HrmFlowTaskVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
if (result.getRecords() != null && !result.getRecords().isEmpty()) {
fillBizData(result.getRecords());
}
return TableDataInfo.build(result);
}
}