feat(flow): 添加业务类型和业务ID字段到流程动作记录
- 在HrmFlowAction实体中新增bizType和bizId字段 - 修改saveAction方法签名以接收业务类型和业务ID参数 - 更新审批、盖章、拒绝、撤回、转办等操作的调用以传递业务类型和业务ID - 在动作记录中保存业务类型和业务ID信息到数据库
This commit is contained in:
@@ -22,6 +22,8 @@ public class HrmFlowAction extends BaseEntity implements Serializable {
|
||||
private String action;
|
||||
private String remark;
|
||||
private Long actionUserId;
|
||||
private String bizType;
|
||||
private Long bizId;
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
}
|
||||
|
||||
@@ -145,9 +145,9 @@ public class HrmFlowTaskServiceImpl implements IHrmFlowTaskService {
|
||||
// 无模板一次性审批(tplId=0 或 nodeId=0):直接结束流程
|
||||
if (inst.getTplId() != null && inst.getTplId() == 0L) {
|
||||
// 记录动作
|
||||
saveAction(taskId, inst.getInstId(), "approve", remark, actionUserId);
|
||||
saveAction(taskId, inst.getInstId(), "approve", remark, actionUserId,task.getBizType(), task.getBizId());
|
||||
if (stampBo != null) {
|
||||
saveAction(taskId, inst.getInstId(), "stamp", "盖章", actionUserId);
|
||||
saveAction(taskId, inst.getInstId(), "stamp", "盖章", actionUserId,task.getBizType(), task.getBizId());
|
||||
}
|
||||
task.setStatus("approved");
|
||||
baseMapper.updateById(task);
|
||||
@@ -159,7 +159,7 @@ public class HrmFlowTaskServiceImpl implements IHrmFlowTaskService {
|
||||
sealReqService.updateStatus(inst.getBizId(), "approved");
|
||||
if (stampBo != null) {
|
||||
// 盖章动作也写入流转历史
|
||||
saveAction(taskId, inst.getInstId(), "stamp", "盖章", actionUserId);
|
||||
saveAction(taskId, inst.getInstId(), "stamp", "盖章", actionUserId,task.getBizType(), task.getBizId());
|
||||
sealReqService.stampWithJava(inst.getBizId(), stampBo);
|
||||
}
|
||||
}
|
||||
@@ -172,7 +172,7 @@ public class HrmFlowTaskServiceImpl implements IHrmFlowTaskService {
|
||||
return false;
|
||||
}
|
||||
// 记录动作
|
||||
saveAction(taskId, inst.getInstId(), "approve", remark, actionUserId);
|
||||
saveAction(taskId, inst.getInstId(), "approve", remark, actionUserId,task.getBizType(),task.getBizId());
|
||||
// 完成当前任务
|
||||
task.setStatus("approved");
|
||||
baseMapper.updateById(task);
|
||||
@@ -254,7 +254,7 @@ public class HrmFlowTaskServiceImpl implements IHrmFlowTaskService {
|
||||
if (inst == null) {
|
||||
return false;
|
||||
}
|
||||
saveAction(taskId, inst.getInstId(), "reject", remark, actionUserId);
|
||||
saveAction(taskId, inst.getInstId(), "reject", remark, actionUserId,task.getBizType(),task.getBizId());
|
||||
task.setStatus("rejected");
|
||||
baseMapper.updateById(task);
|
||||
inst.setStatus("rejected");
|
||||
@@ -278,7 +278,7 @@ public class HrmFlowTaskServiceImpl implements IHrmFlowTaskService {
|
||||
if (inst == null) {
|
||||
return false;
|
||||
}
|
||||
saveAction(taskId, inst.getInstId(), "withdraw", remark, actionUserId);
|
||||
saveAction(taskId, inst.getInstId(), "withdraw", remark, actionUserId, task.getBizType(), task.getBizId());
|
||||
task.setStatus("withdraw");
|
||||
baseMapper.updateById(task);
|
||||
// 无模板一次性审批:撤回后业务回到 pending,并重新生成一个待办(仍然只允许一次审批)
|
||||
@@ -313,7 +313,7 @@ public class HrmFlowTaskServiceImpl implements IHrmFlowTaskService {
|
||||
return true;
|
||||
}
|
||||
|
||||
private void saveAction(Long taskId, Long instId, String action, String remark, Long userId) {
|
||||
private void saveAction(Long taskId, Long instId, String action, String remark, Long userId, String bizType, Long bizId) {
|
||||
HrmFlowAction log = new HrmFlowAction();
|
||||
log.setTaskId(taskId);
|
||||
log.setInstId(instId);
|
||||
@@ -321,6 +321,8 @@ public class HrmFlowTaskServiceImpl implements IHrmFlowTaskService {
|
||||
log.setRemark(remark);
|
||||
log.setActionUserId(userId);
|
||||
log.setCreateTime(new Date());
|
||||
log.setBizType(bizType);
|
||||
log.setBizId(bizId);
|
||||
actionMapper.insert(log);
|
||||
}
|
||||
|
||||
@@ -339,7 +341,7 @@ public class HrmFlowTaskServiceImpl implements IHrmFlowTaskService {
|
||||
return false;
|
||||
}
|
||||
// 记录动作
|
||||
saveAction(taskId, inst.getInstId(), "transfer", remark, actionUserId);
|
||||
saveAction(taskId, inst.getInstId(), "transfer", remark, actionUserId, task.getBizType(), task.getBizId());
|
||||
|
||||
// 更新办理人
|
||||
HrmFlowTask u = new HrmFlowTask();
|
||||
|
||||
Reference in New Issue
Block a user