BPM:完善 task 委托的实现

This commit is contained in:
YunaiV
2024-03-18 19:24:07 +08:00
parent c4688d887c
commit b2b2b497b1
4 changed files with 29 additions and 36 deletions

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.bpm.enums.task;
import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;
@ -15,10 +16,11 @@ public enum BpmCommentTypeEnum {
APPROVE("1", "审批通过", ""), // 理由:直接使用用户的评论
REJECT("2", "不通过", ""),
CANCEL("3", "已取消", ""),
BACK("4", "退回", ""), // 理由:直接使用用户的评论
DELEGATE("5", "委派", ""),
ADD_SIGN("6", "加签", "[{}]{}给了[{}],理由为{}"),
SUB_SIGN("7", "", "[{}]操作了【减签】,审批人[{}]的任务被取消"),
BACK("4", "退回", "{}"), // 直接使用用户填写的原因
DELEGATE_START("5", "委派发起", "[{}]将任务委派给[{}],委派理由为:{}"),
DELEGATE_END("6", "委派完成", "[{}]将任务委派给[{}]委派理由为:{}"),
ADD_SIGN("7", "", "[{}]{}给了[{}],理由为:{}"),
SUB_SIGN("8", "减签", "[{}]操作了【减签】,审批人[{}]的任务被取消"),
;
/**
@ -36,4 +38,8 @@ public enum BpmCommentTypeEnum {
*/
private final String comment;
public String formatComment(Object... params) {
return StrUtil.format(comment, params);
}
}

View File

@ -18,9 +18,7 @@ public enum BpmTaskStatustEnum {
REJECT(3, "审批不通过"),
CANCEL(4, "已取消"),
// ========== 流程任务独有的状态 ==========
BACK(5, "已驳回"), // 退回
RETURN(5, "已退回"),
DELEGATE(6, "委派中"),
/**
@ -64,7 +62,7 @@ public enum BpmTaskStatustEnum {
public static boolean isEndStatus(Integer status) {
return ObjectUtils.equalsAny(status,
APPROVE.getStatus(), REJECT.getStatus(), CANCEL.getStatus(),
BACK.getStatus(), APPROVING.getStatus());
RETURN.getStatus(), APPROVING.getStatus());
}
}