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 action;
|
||||||
private String remark;
|
private String remark;
|
||||||
private Long actionUserId;
|
private Long actionUserId;
|
||||||
|
private String bizType;
|
||||||
|
private Long bizId;
|
||||||
@TableLogic
|
@TableLogic
|
||||||
private Integer delFlag;
|
private Integer delFlag;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,9 +145,9 @@ public class HrmFlowTaskServiceImpl implements IHrmFlowTaskService {
|
|||||||
// 无模板一次性审批(tplId=0 或 nodeId=0):直接结束流程
|
// 无模板一次性审批(tplId=0 或 nodeId=0):直接结束流程
|
||||||
if (inst.getTplId() != null && inst.getTplId() == 0L) {
|
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) {
|
if (stampBo != null) {
|
||||||
saveAction(taskId, inst.getInstId(), "stamp", "盖章", actionUserId);
|
saveAction(taskId, inst.getInstId(), "stamp", "盖章", actionUserId,task.getBizType(), task.getBizId());
|
||||||
}
|
}
|
||||||
task.setStatus("approved");
|
task.setStatus("approved");
|
||||||
baseMapper.updateById(task);
|
baseMapper.updateById(task);
|
||||||
@@ -159,7 +159,7 @@ public class HrmFlowTaskServiceImpl implements IHrmFlowTaskService {
|
|||||||
sealReqService.updateStatus(inst.getBizId(), "approved");
|
sealReqService.updateStatus(inst.getBizId(), "approved");
|
||||||
if (stampBo != null) {
|
if (stampBo != null) {
|
||||||
// 盖章动作也写入流转历史
|
// 盖章动作也写入流转历史
|
||||||
saveAction(taskId, inst.getInstId(), "stamp", "盖章", actionUserId);
|
saveAction(taskId, inst.getInstId(), "stamp", "盖章", actionUserId,task.getBizType(), task.getBizId());
|
||||||
sealReqService.stampWithJava(inst.getBizId(), stampBo);
|
sealReqService.stampWithJava(inst.getBizId(), stampBo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -172,7 +172,7 @@ public class HrmFlowTaskServiceImpl implements IHrmFlowTaskService {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// 记录动作
|
// 记录动作
|
||||||
saveAction(taskId, inst.getInstId(), "approve", remark, actionUserId);
|
saveAction(taskId, inst.getInstId(), "approve", remark, actionUserId,task.getBizType(),task.getBizId());
|
||||||
// 完成当前任务
|
// 完成当前任务
|
||||||
task.setStatus("approved");
|
task.setStatus("approved");
|
||||||
baseMapper.updateById(task);
|
baseMapper.updateById(task);
|
||||||
@@ -254,7 +254,7 @@ public class HrmFlowTaskServiceImpl implements IHrmFlowTaskService {
|
|||||||
if (inst == null) {
|
if (inst == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
saveAction(taskId, inst.getInstId(), "reject", remark, actionUserId);
|
saveAction(taskId, inst.getInstId(), "reject", remark, actionUserId,task.getBizType(),task.getBizId());
|
||||||
task.setStatus("rejected");
|
task.setStatus("rejected");
|
||||||
baseMapper.updateById(task);
|
baseMapper.updateById(task);
|
||||||
inst.setStatus("rejected");
|
inst.setStatus("rejected");
|
||||||
@@ -278,7 +278,7 @@ public class HrmFlowTaskServiceImpl implements IHrmFlowTaskService {
|
|||||||
if (inst == null) {
|
if (inst == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
saveAction(taskId, inst.getInstId(), "withdraw", remark, actionUserId);
|
saveAction(taskId, inst.getInstId(), "withdraw", remark, actionUserId, task.getBizType(), task.getBizId());
|
||||||
task.setStatus("withdraw");
|
task.setStatus("withdraw");
|
||||||
baseMapper.updateById(task);
|
baseMapper.updateById(task);
|
||||||
// 无模板一次性审批:撤回后业务回到 pending,并重新生成一个待办(仍然只允许一次审批)
|
// 无模板一次性审批:撤回后业务回到 pending,并重新生成一个待办(仍然只允许一次审批)
|
||||||
@@ -313,7 +313,7 @@ public class HrmFlowTaskServiceImpl implements IHrmFlowTaskService {
|
|||||||
return true;
|
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();
|
HrmFlowAction log = new HrmFlowAction();
|
||||||
log.setTaskId(taskId);
|
log.setTaskId(taskId);
|
||||||
log.setInstId(instId);
|
log.setInstId(instId);
|
||||||
@@ -321,6 +321,8 @@ public class HrmFlowTaskServiceImpl implements IHrmFlowTaskService {
|
|||||||
log.setRemark(remark);
|
log.setRemark(remark);
|
||||||
log.setActionUserId(userId);
|
log.setActionUserId(userId);
|
||||||
log.setCreateTime(new Date());
|
log.setCreateTime(new Date());
|
||||||
|
log.setBizType(bizType);
|
||||||
|
log.setBizId(bizId);
|
||||||
actionMapper.insert(log);
|
actionMapper.insert(log);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -339,7 +341,7 @@ public class HrmFlowTaskServiceImpl implements IHrmFlowTaskService {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// 记录动作
|
// 记录动作
|
||||||
saveAction(taskId, inst.getInstId(), "transfer", remark, actionUserId);
|
saveAction(taskId, inst.getInstId(), "transfer", remark, actionUserId, task.getBizType(), task.getBizId());
|
||||||
|
|
||||||
// 更新办理人
|
// 更新办理人
|
||||||
HrmFlowTask u = new HrmFlowTask();
|
HrmFlowTask u = new HrmFlowTask();
|
||||||
|
|||||||
Reference in New Issue
Block a user