Merge branch '0.8.X' of https://gitee.com/hdka/klp-oa into 0.8.X

This commit is contained in:
砂糖
2026-01-05 11:42:58 +08:00
3 changed files with 17 additions and 8 deletions

View File

@@ -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;
}

View File

@@ -1,5 +1,6 @@
package com.klp.hrm.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
@@ -26,9 +27,11 @@ public class HrmFlowTask extends BaseEntity implements Serializable {
private String remark;
/** 业务类型leave/travel/seal */
@TableField("biz_type")
private String bizType;
/** 业务ID对应请假/出差/用印的 bizId */
@TableField("biz_id")
private Long bizId;
@TableLogic

View File

@@ -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);
@@ -225,6 +225,8 @@ public class HrmFlowTaskServiceImpl implements IHrmFlowTaskService {
nextTask.setInstId(inst.getInstId());
nextTask.setNodeId(next.getNodeId());
nextTask.setAssigneeUserId(assignees.get(0));
nextTask.setBizType(inst.getBizType());
nextTask.setBizId(inst.getBizId());
nextTask.setStatus("pending");
baseMapper.insert(nextTask);
} else {
@@ -254,7 +256,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 +280,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 +315,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 +323,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 +343,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();