feat(REQ-4418) - 处理枚举类
This commit is contained in:
parent
d03fd9cc17
commit
c387eee91b
@ -1,17 +1,41 @@
|
||||
package cn.axzo.workflow.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@Getter
|
||||
public enum AdminDataSource {
|
||||
SYSTEM_ENTRY("systemEntry", "系统录入"),
|
||||
USER_ENTRY("userEntry", "用户手动录入");
|
||||
USER_ENTRY("userEntry", "用户手动录入"),
|
||||
@JsonEnumDefaultValue
|
||||
UNKNOWN("unknown", "未知"),
|
||||
;
|
||||
|
||||
private final String type;
|
||||
private final String desc;
|
||||
|
||||
@JsonValue
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
AdminDataSource(String type, String desc) {
|
||||
this.type = type;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static AdminDataSource fromValue(String value) {
|
||||
if (value == null) {
|
||||
return UNKNOWN;
|
||||
}
|
||||
return Arrays.stream(AdminDataSource.values())
|
||||
.filter(v -> v.getType().equalsIgnoreCase(value))
|
||||
.findFirst()
|
||||
.orElse(UNKNOWN);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,19 +1,42 @@
|
||||
package cn.axzo.workflow.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@Getter
|
||||
public enum AdminRoleType {
|
||||
ORGANIZATION_ADMIN("organizationAdmin", "单位超管"),
|
||||
ORG_WORKSPACE_ADMIN("organizationWorkspaceAdmin", "项目内单位负责人"),
|
||||
WORKSPACE_ADMIN("workspaceAdmin", "项目超管"),
|
||||
OTHER("other", "其他用户");
|
||||
OTHER("other", "其他用户"),
|
||||
@JsonEnumDefaultValue
|
||||
UNKNOWN("unknown", "未知");
|
||||
|
||||
private final String type;
|
||||
private final String desc;
|
||||
|
||||
@JsonValue
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
AdminRoleType(String type, String desc) {
|
||||
this.type = type;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static AdminRoleType fromValue(String value) {
|
||||
if (value == null) {
|
||||
return UNKNOWN;
|
||||
}
|
||||
return Arrays.stream(AdminRoleType.values())
|
||||
.filter(v -> v.getType().equalsIgnoreCase(value))
|
||||
.findFirst()
|
||||
.orElse(UNKNOWN);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,20 +1,44 @@
|
||||
package cn.axzo.workflow.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 审批管理员类型
|
||||
*/
|
||||
@Getter
|
||||
public enum AdminTypeEnum {
|
||||
SUPER_ADMIN("super_admin", "超级管理员"),
|
||||
COMMON_ADMIN("common_admin", "普通管理员");
|
||||
COMMON_ADMIN("common_admin", "普通管理员"),
|
||||
@JsonEnumDefaultValue
|
||||
UNKNOWN("unknown", "未知"),
|
||||
;
|
||||
|
||||
private final String type;
|
||||
private final String desc;
|
||||
|
||||
@JsonValue
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
AdminTypeEnum(String type, String desc) {
|
||||
this.type = type;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static AdminTypeEnum fromValue(String value) {
|
||||
if (value == null) {
|
||||
return UNKNOWN;
|
||||
}
|
||||
return Arrays.stream(AdminTypeEnum.values())
|
||||
.filter(v -> v.getType().equalsIgnoreCase(value))
|
||||
.findFirst()
|
||||
.orElse(UNKNOWN);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,11 @@
|
||||
package cn.axzo.workflow.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 审批方式枚举
|
||||
@ -9,6 +13,7 @@ import java.util.Objects;
|
||||
* @author wangli
|
||||
* @since 2023/11/16 10:10
|
||||
*/
|
||||
@Getter
|
||||
public enum ApprovalMethodEnum {
|
||||
|
||||
human("human", "人工审批", ""),
|
||||
@ -19,12 +24,12 @@ public enum ApprovalMethodEnum {
|
||||
nobody("nobody", "不设置审批人", "[仅业务节点可能有该值]"),
|
||||
bizSpecify("bizSpecify", "业务指定审批人", "[仅业务节点可能有该值]"),
|
||||
transferToAdmin("transferToAdmin", "转办给管理员", "该枚举仅日志处理使用"),
|
||||
unknown("unknown", "未知", "兜底")
|
||||
;
|
||||
@JsonEnumDefaultValue
|
||||
unknown("unknown", "未知", "兜底");
|
||||
|
||||
private String type;
|
||||
private String desc;
|
||||
private String remark;
|
||||
private final String type;
|
||||
private final String desc;
|
||||
private final String remark;
|
||||
|
||||
ApprovalMethodEnum(String type, String desc, String remark) {
|
||||
this.type = type;
|
||||
@ -32,34 +37,23 @@ public enum ApprovalMethodEnum {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
@JsonCreator
|
||||
public static ApprovalMethodEnum fromValue(String value) {
|
||||
if (value == null) {
|
||||
return unknown;
|
||||
}
|
||||
return Arrays.stream(values())
|
||||
.filter(e -> e.getType().equalsIgnoreCase(value))
|
||||
.findFirst()
|
||||
.orElse(unknown);
|
||||
}
|
||||
|
||||
public static ApprovalMethodEnum valueOfType(String type) {
|
||||
return Arrays.stream(ApprovalMethodEnum.values())
|
||||
.filter(i -> Objects.equals(i.getType(), type))
|
||||
.findAny()
|
||||
.orElse(null);
|
||||
return fromValue(type);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,17 +1,27 @@
|
||||
package cn.axzo.workflow.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 审批人为空时的处理方式枚举
|
||||
*
|
||||
* @author wangli
|
||||
* @since 2023/11/16 10:22
|
||||
*/
|
||||
@Getter
|
||||
public enum ApproverEmptyHandleTypeEnum {
|
||||
autoPassed("autoPassed", "自动通过"),
|
||||
autoRejection("autoRejection", "自动驳回"),
|
||||
autoSkipped("autoSkipped", "自动跳过"),
|
||||
transferToAdmin("transferToAdmin", "转交给管理员"),
|
||||
specifyAssignee("specifyAssignee", "指定审批人"),
|
||||
@JsonEnumDefaultValue
|
||||
unknown("unknown", "未知"),
|
||||
;
|
||||
private String type;
|
||||
private String desc;
|
||||
@ -21,19 +31,20 @@ public enum ApproverEmptyHandleTypeEnum {
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
@JsonCreator
|
||||
public static ApproverEmptyHandleTypeEnum fromValue(String value) {
|
||||
if (value == null) {
|
||||
return unknown;
|
||||
}
|
||||
return Arrays.stream(values())
|
||||
.filter(e -> e.getType().equalsIgnoreCase(value))
|
||||
.findFirst()
|
||||
.orElse(unknown);
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,10 @@
|
||||
package cn.axzo.workflow.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
@ -9,12 +14,15 @@ import java.util.Objects;
|
||||
* @author wangli
|
||||
* @since 2023/11/16 10:14
|
||||
*/
|
||||
@Getter
|
||||
public enum ApproverScopeEnum {
|
||||
entWorkspace("entWorkspace", "企业工作台", "entWorkspaceProcessor"),
|
||||
govWorkspace("govWorkspace", "政务工作台", "govWorkspaceProcessor"),
|
||||
projectWorkspace("projectWorkspace", "项目工作台","projectWorkspaceProcessor"),
|
||||
preTaskUser("preTaskUser", "上节点审批人所在单位","preTaskUserProcessor"),
|
||||
preTaskSpecified("preTaskSpecified", "上节点审批人指定","preTaskUserProcessor"),
|
||||
projectWorkspace("projectWorkspace", "项目工作台", "projectWorkspaceProcessor"),
|
||||
preTaskUser("preTaskUser", "上节点审批人所在单位", "preTaskUserProcessor"),
|
||||
preTaskSpecified("preTaskSpecified", "上节点审批人指定", "preTaskUserProcessor"),
|
||||
@JsonEnumDefaultValue
|
||||
unknown("unknown", "未知", "unknownProcessor"),
|
||||
;
|
||||
private final String type;
|
||||
private final String desc;
|
||||
@ -26,20 +34,20 @@ public enum ApproverScopeEnum {
|
||||
this.processor = processor;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public String getProcessor() {
|
||||
return processor;
|
||||
}
|
||||
|
||||
public boolean selectWorkspace() {
|
||||
return this == ApproverScopeEnum.projectWorkspace;
|
||||
@JsonCreator
|
||||
public static ApprovalMethodEnum fromValue(String value) {
|
||||
if (value == null) {
|
||||
return ApprovalMethodEnum.unknown;
|
||||
}
|
||||
return Arrays.stream(ApprovalMethodEnum.values())
|
||||
.filter(e -> e.getType().equalsIgnoreCase(value))
|
||||
.findFirst()
|
||||
.orElse(ApprovalMethodEnum.unknown);
|
||||
}
|
||||
|
||||
public static ApproverScopeEnum valueOfProcessor(String processor) {
|
||||
|
||||
@ -1,11 +1,19 @@
|
||||
package cn.axzo.workflow.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 审批人指定枚举
|
||||
*
|
||||
* @author wangli
|
||||
* @since 2023/11/16 10:16
|
||||
*/
|
||||
@Getter
|
||||
public enum ApproverSpecifyEnum {
|
||||
|
||||
position("position", "指定岗位", 1),
|
||||
@ -28,11 +36,13 @@ public enum ApproverSpecifyEnum {
|
||||
initiatorLeader_v2("initiatorLeader_v2", "发起人主管", 2),
|
||||
fixedPerson_v2("fixedPerson_v2", "固定人员", 2),
|
||||
preAllNodApprover_v2("preAllNodeApprover_v2", "所有前序节点审批人", 2),
|
||||
@JsonEnumDefaultValue
|
||||
unknown("unknown", "未知", 1),
|
||||
;
|
||||
|
||||
private String type;
|
||||
private String desc;
|
||||
private Integer version;
|
||||
private final String type;
|
||||
private final String desc;
|
||||
private final Integer version;
|
||||
|
||||
ApproverSpecifyEnum(String type, String desc, Integer version) {
|
||||
this.type = type;
|
||||
@ -40,27 +50,19 @@ public enum ApproverSpecifyEnum {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public Integer getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(Integer version) {
|
||||
this.version = version;
|
||||
@JsonCreator
|
||||
public static ApproverSpecifyEnum fromValue(String value) {
|
||||
if (value == null) {
|
||||
return unknown;
|
||||
}
|
||||
return Arrays.stream(values())
|
||||
.filter(e -> e.getType().equalsIgnoreCase(value))
|
||||
.findFirst()
|
||||
.orElse(unknown);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,11 +1,19 @@
|
||||
package cn.axzo.workflow.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 审批人指定的二次范围限定枚举
|
||||
*
|
||||
* @author wangli
|
||||
* @since 2025-08-13 14:32
|
||||
*/
|
||||
@Getter
|
||||
public enum ApproverSpecifyRangeEnum {
|
||||
|
||||
within_the_project("within_the_project", "项目内岗位"),
|
||||
@ -13,29 +21,31 @@ public enum ApproverSpecifyRangeEnum {
|
||||
specified_org("specified_org", "审批单指定的末级组织"),
|
||||
initiator("initiator", "审批单发起人"),
|
||||
pre_node_approver("pre_node_approver", "上节点审批人"),
|
||||
@JsonEnumDefaultValue
|
||||
unknown("unknown", "未知"),
|
||||
;
|
||||
|
||||
private String type;
|
||||
private String desc;
|
||||
private final String type;
|
||||
private final String desc;
|
||||
|
||||
ApproverSpecifyRangeEnum(String type, String desc) {
|
||||
this.type = type;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
@JsonCreator
|
||||
public static ApproverSpecifyRangeEnum fromValue(String value) {
|
||||
if (value == null) {
|
||||
return unknown;
|
||||
}
|
||||
return Arrays.stream(values())
|
||||
.filter(e -> e.getType().equalsIgnoreCase(value))
|
||||
.findFirst()
|
||||
.orElse(unknown);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,11 +1,19 @@
|
||||
package cn.axzo.workflow.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 审批人指定的范围“单位”枚举
|
||||
*
|
||||
* @author wangli
|
||||
* @since 2025-08-13 15:05
|
||||
*/
|
||||
@Getter
|
||||
public enum ApproverSpecifyRangeUnitEnum {
|
||||
in_project("in_project", "项目内", null),
|
||||
in_ent("in_ent", "企业内", null),
|
||||
@ -14,8 +22,8 @@ public enum ApproverSpecifyRangeUnitEnum {
|
||||
in_group_lv_3("in_group_lv_3", "集团岗位,上三级", 3),
|
||||
in_group_lv_4("in_group_lv_4", "集团岗位,上四级", 4),
|
||||
in_group_lv_top("in_group_lv_top", "集团岗位,总公司", Integer.MAX_VALUE),
|
||||
UNKNOWN("UNKNOWN", "未知范围", null)
|
||||
;
|
||||
@JsonEnumDefaultValue
|
||||
UNKNOWN("UNKNOWN", "未知范围", null);
|
||||
private final String type;
|
||||
private final String desc;
|
||||
private final Integer value;
|
||||
@ -26,15 +34,19 @@ public enum ApproverSpecifyRangeUnitEnum {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
@JsonCreator
|
||||
public static ApproverSpecifyRangeUnitEnum fromValue(String value) {
|
||||
if (value == null) {
|
||||
return UNKNOWN;
|
||||
}
|
||||
return Arrays.stream(values())
|
||||
.filter(e -> e.getType().equalsIgnoreCase(value))
|
||||
.findFirst()
|
||||
.orElse(UNKNOWN);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,39 +1,49 @@
|
||||
package cn.axzo.workflow.common.enums;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 附件类型枚举
|
||||
*
|
||||
* @author wangli
|
||||
* @since 2023/11/22 23:19
|
||||
*/
|
||||
@Getter
|
||||
public enum AttachmentTypeEnum {
|
||||
|
||||
image("image", "图片"),
|
||||
file("file", "文件"),
|
||||
signature("signature", "签名"),
|
||||
@JsonEnumDefaultValue
|
||||
unknown("unknown", "未知"),
|
||||
;
|
||||
|
||||
private String type;
|
||||
private String desc;
|
||||
private final String type;
|
||||
private final String desc;
|
||||
|
||||
AttachmentTypeEnum(String type, String desc) {
|
||||
this.type = type;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
@JSONCreator
|
||||
public static AttachmentTypeEnum fromValue(String value) {
|
||||
if (value == null) {
|
||||
return unknown;
|
||||
}
|
||||
return Arrays.stream(values())
|
||||
.filter(e -> e.getType().equalsIgnoreCase(value))
|
||||
.findFirst()
|
||||
.orElse(unknown);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package cn.axzo.workflow.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.Getter;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@ -11,7 +13,10 @@ import org.springframework.util.StringUtils;
|
||||
public enum AutoApprovalTypeEnum {
|
||||
|
||||
NO_AUTO_APPROVAL("noAutoApproval", "不自动过审"),
|
||||
CONTINUOUS_NODES_AUTO_APPROVAL("continuousNodesAutoApproval", "连续节点自动过审");
|
||||
CONTINUOUS_NODES_AUTO_APPROVAL("continuousNodesAutoApproval", "连续节点自动过审"),
|
||||
@JsonEnumDefaultValue
|
||||
UNKNOWN("unknown", "未知"),
|
||||
;
|
||||
|
||||
private final String type;
|
||||
private final String desc;
|
||||
@ -21,6 +26,11 @@ public enum AutoApprovalTypeEnum {
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public static AutoApprovalTypeEnum fromType(String type) {
|
||||
if (!StringUtils.hasText(type)) {
|
||||
return null;
|
||||
|
||||
@ -1,8 +1,12 @@
|
||||
package cn.axzo.workflow.common.enums;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.axzo.workflow.common.enums.BusinessTypeEnum.APPROVAL;
|
||||
@ -14,6 +18,7 @@ import static cn.axzo.workflow.common.enums.BusinessTypeEnum.SIGN;
|
||||
* @author wangli
|
||||
* @since 2023/9/4 10:38
|
||||
*/
|
||||
@Getter
|
||||
public enum BpmnButtonEnum {
|
||||
/**
|
||||
* 同意按钮
|
||||
@ -66,25 +71,18 @@ public enum BpmnButtonEnum {
|
||||
/**
|
||||
* 管理员转交按钮
|
||||
*/
|
||||
BPMN_ADMIN_TRANSFER(90, "BPMN_ADMIN_TRANSFER", "管理员转交", Lists.newArrayList());
|
||||
|
||||
|
||||
public int getOrder() {
|
||||
return order;
|
||||
}
|
||||
BPMN_ADMIN_TRANSFER(90, "BPMN_ADMIN_TRANSFER", "管理员转交", Lists.newArrayList()),
|
||||
/**
|
||||
* 兜底
|
||||
*/
|
||||
UNKNOWN(99, "UNKNOWN", "未知", Lists.newArrayList()),
|
||||
;
|
||||
|
||||
@JsonValue
|
||||
public String getBtnKey() {
|
||||
return btnKey;
|
||||
}
|
||||
|
||||
public String getBtnName() {
|
||||
return btnName;
|
||||
}
|
||||
|
||||
public List<BusinessTypeEnum> getSupportBizType() {
|
||||
return supportBizType;
|
||||
}
|
||||
|
||||
private final int order;
|
||||
private final String btnKey;
|
||||
private final String btnName;
|
||||
@ -98,4 +96,15 @@ public enum BpmnButtonEnum {
|
||||
this.supportBizType = supportBizType;
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static BpmnButtonEnum fromValue(String value) {
|
||||
if (value == null) {
|
||||
return UNKNOWN;
|
||||
}
|
||||
return Arrays.stream(values())
|
||||
.filter(e -> e.getBtnKey().equalsIgnoreCase(value))
|
||||
.findFirst()
|
||||
.orElse(UNKNOWN);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,12 +1,19 @@
|
||||
package cn.axzo.workflow.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.Getter;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 加签类型
|
||||
*
|
||||
* @author zuoqinbo
|
||||
*/
|
||||
@Getter
|
||||
public enum BpmnCountersignTypeEnum {
|
||||
/**
|
||||
* 向前加签
|
||||
@ -20,6 +27,11 @@ public enum BpmnCountersignTypeEnum {
|
||||
* 共享加签
|
||||
*/
|
||||
SHARE_COUNTERSIGN("SHARE_COUNTERSIGN", "共享加签"),
|
||||
/**
|
||||
* 兜底
|
||||
*/
|
||||
@JsonEnumDefaultValue
|
||||
UNKNOW("UNKNOW", "未知"),
|
||||
;
|
||||
|
||||
private final String type;
|
||||
@ -30,14 +42,11 @@ public enum BpmnCountersignTypeEnum {
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public static BpmnCountersignTypeEnum valueOfType(String countersignType) {
|
||||
if (StringUtils.isBlank(countersignType)) {
|
||||
return null;
|
||||
@ -50,4 +59,15 @@ public enum BpmnCountersignTypeEnum {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static BpmnCountersignTypeEnum fromValue(String value) {
|
||||
if (value == null) {
|
||||
return UNKNOW;
|
||||
}
|
||||
return Arrays.stream(values())
|
||||
.filter(v -> v.getType().equalsIgnoreCase(value))
|
||||
.findFirst()
|
||||
.orElse(UNKNOW);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,48 +1,48 @@
|
||||
package cn.axzo.workflow.common.enums;
|
||||
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@Getter
|
||||
public enum BpmnFlowNodeMode {
|
||||
GENERAL("GENERAL", "普通节点"),
|
||||
OR("OR", "或签节点"),
|
||||
AND("AND", "会签节点"),
|
||||
EXCEPTIONAL("EXCEPTIONAL", "异常"),
|
||||
@JsonEnumDefaultValue
|
||||
UNKNOWN("UNKNOWN", "未知"),
|
||||
;
|
||||
|
||||
private String type;
|
||||
private String desc;
|
||||
private final String type;
|
||||
private final String desc;
|
||||
|
||||
BpmnFlowNodeMode(String type, String desc) {
|
||||
this.type = type;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public boolean isEqual(String type) {
|
||||
return this.type.equals(type);
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public static BpmnFlowNodeMode valueOfType(String type) {
|
||||
return fromValue(type);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static BpmnFlowNodeMode fromValue(String value) {
|
||||
if (value == null) {
|
||||
return UNKNOWN;
|
||||
}
|
||||
return Arrays.stream(BpmnFlowNodeMode.values())
|
||||
.filter(i -> Objects.equals(i.getType(), type))
|
||||
.findAny()
|
||||
.orElse(null);
|
||||
.filter(e -> e.getType().equalsIgnoreCase(value))
|
||||
.findFirst()
|
||||
.orElse(UNKNOWN);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,11 +1,15 @@
|
||||
package cn.axzo.workflow.common.enums;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.Getter;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
@Getter
|
||||
public enum BpmnFlowNodeType {
|
||||
|
||||
//0 发起人 1审批 2抄送 3条件 4路由
|
||||
@ -25,53 +29,35 @@ public enum BpmnFlowNodeType {
|
||||
NODE_ALTER("NODE_ALTER", "告警节点"),
|
||||
NODE_CANCEL("NODE_CANCEL", "撤回节点"),
|
||||
NODE_EMPTY("NODE_EMPTY", "空节点"),
|
||||
;
|
||||
@JsonEnumDefaultValue
|
||||
UNKNOWN("UNKNOWN", "未知");
|
||||
|
||||
private String type;
|
||||
private String desc;
|
||||
private final String type;
|
||||
private final String desc;
|
||||
|
||||
BpmnFlowNodeType(String type, String desc) {
|
||||
this.type = type;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public boolean isEqual(String type) {
|
||||
return this.type.equals(type);
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public static BpmnFlowNodeType getByType(String type) {
|
||||
if (!StringUtils.hasText(type)) {
|
||||
return null;
|
||||
}
|
||||
BpmnFlowNodeType[] values = BpmnFlowNodeType.values();
|
||||
for (BpmnFlowNodeType value : values) {
|
||||
if (value.getType().equals(type)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static BpmnFlowNodeType valueOfType(String type) {
|
||||
return fromValue(type);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static BpmnFlowNodeType fromValue(String value) {
|
||||
if (!StringUtils.hasText(value)) {
|
||||
return UNKNOWN;
|
||||
}
|
||||
return Arrays.stream(BpmnFlowNodeType.values())
|
||||
.filter(i -> Objects.equals(i.getType(), type))
|
||||
.findAny()
|
||||
.orElse(null);
|
||||
.filter(e -> e.getType().equalsIgnoreCase(value))
|
||||
.findFirst()
|
||||
.orElse(UNKNOWN);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,12 @@
|
||||
package cn.axzo.workflow.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.TEMPLATE_NOTICE_MESSAGE_CONFIG;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.TEMPLATE_PENDING_MESSAGE_ID;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.TEMPLATE_SMS_MESSAGE_ID;
|
||||
@ -10,11 +17,14 @@ import static cn.axzo.workflow.common.constant.BpmnConstants.TEMPLATE_SMS_MESSAG
|
||||
* @author wangli
|
||||
* @since 2023/11/22 11:02
|
||||
*/
|
||||
@Getter
|
||||
public enum BpmnNoticeEnum {
|
||||
|
||||
notice("notice", TEMPLATE_NOTICE_MESSAGE_CONFIG, "通知模板"),
|
||||
pending("pending", TEMPLATE_PENDING_MESSAGE_ID, "待办模板"),
|
||||
sms("sms", TEMPLATE_SMS_MESSAGE_ID, "短信模板"),
|
||||
@JsonEnumDefaultValue
|
||||
unknown("unknown", "unknown", "未知类型"),
|
||||
;
|
||||
private final String key;
|
||||
private final String configName;
|
||||
@ -26,15 +36,19 @@ public enum BpmnNoticeEnum {
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public String getConfigName() {
|
||||
return configName;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
@JsonCreator
|
||||
public static BpmnNoticeEnum fromValue(String key) {
|
||||
if (key == null) {
|
||||
return unknown;
|
||||
}
|
||||
return Arrays.stream(values())
|
||||
.filter(e -> e.getKey().equalsIgnoreCase(key))
|
||||
.findFirst()
|
||||
.orElse(unknown);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,13 @@
|
||||
package cn.axzo.workflow.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@Getter
|
||||
public enum BpmnProcessInstanceResultEnum {
|
||||
PROCESSING("PROCESSING", "审批中"),
|
||||
APPROVED("APPROVED", "已通过"),
|
||||
@ -14,6 +20,8 @@ public enum BpmnProcessInstanceResultEnum {
|
||||
UPGRADED("UPGRADED", "已提级"),
|
||||
COMMENTED("COMMENTED", "已评论"),
|
||||
DELETED("DELETED", "已删除"),
|
||||
@JsonEnumDefaultValue
|
||||
UNKNOWN("UNKNOWN", "未知"),
|
||||
;
|
||||
/**
|
||||
* 结果
|
||||
@ -29,34 +37,26 @@ public enum BpmnProcessInstanceResultEnum {
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断该结果是否已经处于 End 最终结果
|
||||
* <p>
|
||||
* 主要用于一些结果更新的逻辑,如果已经是最终结果,就不再进行更新
|
||||
*
|
||||
* @param result 结果
|
||||
* @return 是否
|
||||
*/
|
||||
public static boolean isEndResult(String result) {
|
||||
return Arrays.asList(PROCESSING.getStatus(), APPROVED.getStatus(), REJECTED.getStatus(),
|
||||
CANCELLED.getStatus()).contains(result);
|
||||
}
|
||||
|
||||
public static BpmnProcessInstanceResultEnum valueOfStatus(String status) {
|
||||
return Arrays.stream(values()).filter(it -> it.getStatus().equals(status)).findFirst()
|
||||
.orElse(DELETED);
|
||||
}
|
||||
|
||||
public static BpmnProcessInstanceResultEnum valueOfDesc(String desc) {
|
||||
return Arrays.stream(values()).filter(it -> it.getDesc().equals(desc)).findFirst()
|
||||
.orElse(DELETED);
|
||||
@JsonCreator
|
||||
public static BpmnProcessInstanceResultEnum fromValue(String value) {
|
||||
if (value == null) {
|
||||
return UNKNOWN;
|
||||
}
|
||||
return Arrays.stream(BpmnProcessInstanceResultEnum.values())
|
||||
.filter(e -> e.getStatus().equalsIgnoreCase(value))
|
||||
.findFirst()
|
||||
.orElse(UNKNOWN);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,7 +1,12 @@
|
||||
package cn.axzo.workflow.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@Getter
|
||||
public enum BpmnProcessTaskResultEnum {
|
||||
PENDING("PENDING", "待处理"),
|
||||
@ -11,6 +16,8 @@ public enum BpmnProcessTaskResultEnum {
|
||||
CANCELED("CANCELED", "已撤销"),
|
||||
TRANSFERRED("TRANSFERRED", "已转交"),
|
||||
NONE("NONE", "没有执行动作,例如 抄送"),
|
||||
@JsonEnumDefaultValue
|
||||
UNKNOWN("UNKNOWN", "未知"),
|
||||
;
|
||||
/**
|
||||
* 结果
|
||||
@ -26,4 +33,19 @@ public enum BpmnProcessTaskResultEnum {
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static BpmnProcessTaskResultEnum fromValue(String status) {
|
||||
if (status == null) {
|
||||
return UNKNOWN;
|
||||
}
|
||||
return Arrays.stream(values())
|
||||
.filter(e -> e.getStatus().equalsIgnoreCase(status))
|
||||
.findFirst()
|
||||
.orElse(UNKNOWN);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,18 @@
|
||||
package cn.axzo.workflow.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 加签类型
|
||||
*
|
||||
* @author zuoqinbo
|
||||
*/
|
||||
@Getter
|
||||
public enum BpmnReminderType {
|
||||
/**
|
||||
* 短信
|
||||
@ -13,7 +21,10 @@ public enum BpmnReminderType {
|
||||
/**
|
||||
* 站内信
|
||||
*/
|
||||
INBOX_MESSAGE("INBOX_MESSAGE", "站内信");
|
||||
INBOX_MESSAGE("INBOX_MESSAGE", "站内信"),
|
||||
@JsonEnumDefaultValue
|
||||
UNKNOWN("UNKNOWN", "未知"),
|
||||
;
|
||||
|
||||
private String type;
|
||||
private String desc;
|
||||
@ -23,24 +34,20 @@ public enum BpmnReminderType {
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public boolean isEqual(String type) {
|
||||
return this.type.equals(type);
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
@JsonCreator
|
||||
public static BpmnReminderType fromValue(String value) {
|
||||
if (value == null) {
|
||||
return UNKNOWN;
|
||||
}
|
||||
return Arrays.stream(values())
|
||||
.filter(e -> e.getType().equalsIgnoreCase(value))
|
||||
.findFirst()
|
||||
.orElse(UNKNOWN);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,7 +1,11 @@
|
||||
package cn.axzo.workflow.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 签署方式
|
||||
@ -9,10 +13,13 @@ import java.util.Objects;
|
||||
* @author wangli
|
||||
* @since 2025-03-25 17:00
|
||||
*/
|
||||
@Getter
|
||||
public enum BpmnSignType {
|
||||
|
||||
SINGLE("SINGLE", "指定人群,所有人共同签署一份文件"),
|
||||
MULTI("MULTI", "指定人群,每人签署一份文件"),
|
||||
@JsonEnumDefaultValue
|
||||
UNKNOWN("UNKNOWN", "未知"),
|
||||
;
|
||||
|
||||
private final String type;
|
||||
@ -23,20 +30,25 @@ public enum BpmnSignType {
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
public static BpmnSignType valueOfType(String type) {
|
||||
return fromValue(type);
|
||||
}
|
||||
|
||||
public static BpmnSignType valueOfType(String type) {
|
||||
@JsonCreator
|
||||
public static BpmnSignType fromValue(String value) {
|
||||
if (value == null) {
|
||||
return UNKNOWN;
|
||||
}
|
||||
return Arrays.stream(BpmnSignType.values())
|
||||
.filter(i -> Objects.equals(i.getType(), type))
|
||||
.findAny()
|
||||
.orElse(null);
|
||||
.filter(e -> e.getType().equalsIgnoreCase(value))
|
||||
.findFirst()
|
||||
.orElse(UNKNOWN);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,18 +1,41 @@
|
||||
package cn.axzo.workflow.common.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
import java.util.Arrays;
|
||||
|
||||
@Getter
|
||||
public enum BusinessTypeEnum {
|
||||
|
||||
SIGN("sign", "签署业务"),
|
||||
APPROVAL("approval", "审批业务"),
|
||||
@JsonEnumDefaultValue
|
||||
UNKNOWN("unknown", "未知");
|
||||
|
||||
APPROVAL("approval", "审批业务");
|
||||
private final String type;
|
||||
private final String desc;
|
||||
|
||||
private String type;
|
||||
private String desc;
|
||||
BusinessTypeEnum(String type, String desc) {
|
||||
this.type = type;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static BusinessTypeEnum fromValue(String value) {
|
||||
if (value == null) {
|
||||
return UNKNOWN;
|
||||
}
|
||||
return Arrays.stream(values())
|
||||
.filter(v -> v.getType().equalsIgnoreCase(value))
|
||||
.findFirst()
|
||||
.orElse(UNKNOWN);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,14 +1,19 @@
|
||||
package cn.axzo.workflow.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@Getter
|
||||
public enum ButtonVisibleScopeEnum {
|
||||
|
||||
INITIATOR("INITIATOR", "发起人"),
|
||||
|
||||
EXECUTOR("EXECUTOR", "当前操作人"),
|
||||
;
|
||||
@JsonEnumDefaultValue
|
||||
UNKNOWN("UNKNOWN", "未知");
|
||||
|
||||
/**
|
||||
* 结果
|
||||
@ -23,4 +28,20 @@ public enum ButtonVisibleScopeEnum {
|
||||
this.status = status;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static ButtonVisibleScopeEnum fromValue(String value) {
|
||||
if (value == null) {
|
||||
return UNKNOWN;
|
||||
}
|
||||
return Arrays.stream(values())
|
||||
.filter(e -> e.getStatus().equalsIgnoreCase(value))
|
||||
.findFirst()
|
||||
.orElse(UNKNOWN);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,11 @@
|
||||
package cn.axzo.workflow.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 抄送对象类型枚举
|
||||
@ -9,6 +13,7 @@ import java.util.Objects;
|
||||
* @author wangli
|
||||
* @since 12/03/2024 09:33
|
||||
*/
|
||||
@Getter
|
||||
public enum CarbonCopyObjectType {
|
||||
// 单位下
|
||||
ent_role("ent_role", "role", "单位内指定角色", "entWorkspaceProcessor"),
|
||||
@ -33,12 +38,14 @@ public enum CarbonCopyObjectType {
|
||||
approver("approver", "approver", "审批人", "common"),
|
||||
ent_initiator_leader("ent_initiator_leader", "initiatorLeader", "单位内发起人主管", "entWorkspaceProcessor"),
|
||||
project_initiator_leader("project_initiator_leader", "initiatorLeader", "项目部内发起人主管", "projectWorkspaceProcessor"),
|
||||
;
|
||||
|
||||
private String type;
|
||||
private String simpleType;
|
||||
private String desc;
|
||||
private String processor;
|
||||
@JsonEnumDefaultValue
|
||||
unknown("unknown", "unknown", "未知", "unknownProcessor");
|
||||
|
||||
private final String type;
|
||||
private final String simpleType;
|
||||
private final String desc;
|
||||
private final String processor;
|
||||
|
||||
CarbonCopyObjectType(String type, String simpleType, String desc, String processor) {
|
||||
this.type = type;
|
||||
@ -47,43 +54,25 @@ public enum CarbonCopyObjectType {
|
||||
this.processor = processor;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getSimpleType() {
|
||||
return simpleType;
|
||||
}
|
||||
|
||||
public void setSimpleType(String simpleType) {
|
||||
this.simpleType = simpleType;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public String getProcessor() {
|
||||
return processor;
|
||||
}
|
||||
|
||||
public void setProcessor(String processor) {
|
||||
this.processor = processor;
|
||||
}
|
||||
|
||||
public static CarbonCopyObjectType valueOfType(String type) {
|
||||
return Arrays.stream(CarbonCopyObjectType.values())
|
||||
.filter(i -> Objects.equals(i.getType(), type))
|
||||
.findAny()
|
||||
.orElse(null);
|
||||
return fromValue(type);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static CarbonCopyObjectType fromValue(String value) {
|
||||
if (value == null) {
|
||||
return unknown;
|
||||
}
|
||||
return Arrays.stream(values())
|
||||
.filter(e -> e.getType().equalsIgnoreCase(value))
|
||||
.findFirst()
|
||||
.orElse(unknown);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,10 @@
|
||||
package cn.axzo.workflow.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 参建单位类型枚举
|
||||
* <p>
|
||||
@ -22,7 +27,9 @@ public enum CooperateShipTypeEnum {
|
||||
PROJ_GROUP(11, "项目内小组"),
|
||||
SURVEY_UNIT(12, "地勘单位"),
|
||||
DESIGN_UNIT(13, "设计单位"),
|
||||
OTHER(30, "其他");
|
||||
OTHER(30, "其他"),
|
||||
@JsonEnumDefaultValue
|
||||
UNKNOWN(99, "未知");
|
||||
|
||||
private final Integer code;
|
||||
private final String desc;
|
||||
@ -40,4 +47,15 @@ public enum CooperateShipTypeEnum {
|
||||
return desc;
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static CooperateShipTypeEnum fromValue(String value) {
|
||||
if (value == null) {
|
||||
return UNKNOWN;
|
||||
}
|
||||
return Arrays.stream(values())
|
||||
.filter(v -> v.name().equalsIgnoreCase(value))
|
||||
.findFirst()
|
||||
.orElse(UNKNOWN);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,11 +1,34 @@
|
||||
package cn.axzo.workflow.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 模型扩展表的状态枚举
|
||||
*
|
||||
* @author wangli
|
||||
* @since 2025-01-15 09:46
|
||||
*/
|
||||
@Getter
|
||||
public enum ExtModelStateFieldEnum {
|
||||
status, printStatus
|
||||
status,
|
||||
printStatus,
|
||||
@JsonEnumDefaultValue
|
||||
unknown,
|
||||
;
|
||||
|
||||
@JsonCreator
|
||||
public static ExtModelStateFieldEnum fromValue(String value) {
|
||||
if (value == null) {
|
||||
return unknown;
|
||||
}
|
||||
return Arrays.stream(ExtModelStateFieldEnum.values())
|
||||
.filter(e -> e.name().equalsIgnoreCase(value))
|
||||
.findFirst()
|
||||
.orElse(unknown);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,7 +1,11 @@
|
||||
package cn.axzo.workflow.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 文档类型枚举
|
||||
@ -9,11 +13,14 @@ import java.util.Objects;
|
||||
* @author wangli
|
||||
* @since 2025-03-27 09:55
|
||||
*/
|
||||
@Getter
|
||||
public enum FileTypeEnum {
|
||||
WORD("word", "文本", ".docx"),
|
||||
EXCEL("excel", "表格", ".xlsx"),
|
||||
HIPRINT("hiprint", "智能文档", ""),
|
||||
PDF("pdf", "PDF", ".pdf"),
|
||||
@JsonEnumDefaultValue
|
||||
UNKNOWN("unknown", "未知", ""),
|
||||
;
|
||||
private final String type;
|
||||
private final String desc;
|
||||
@ -25,22 +32,24 @@ public enum FileTypeEnum {
|
||||
this.suffix = suffix;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public String getSuffix() {
|
||||
return suffix;
|
||||
}
|
||||
|
||||
public static FileTypeEnum valueOfType(String type) {
|
||||
return Arrays.stream(FileTypeEnum.values())
|
||||
.filter(i -> Objects.equals(i.getType().toUpperCase(), type.toUpperCase()))
|
||||
.findAny()
|
||||
.orElse(null);
|
||||
return fromValue(type);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static FileTypeEnum fromValue(String value) {
|
||||
if (value == null) {
|
||||
return UNKNOWN;
|
||||
}
|
||||
return Arrays.stream(FileTypeEnum.values())
|
||||
.filter(e -> e.getType().equalsIgnoreCase(value))
|
||||
.findFirst()
|
||||
.orElse(UNKNOWN);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
package cn.axzo.workflow.core.deletage.approverscope;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 兜底的处理器
|
||||
*
|
||||
* @author wangli
|
||||
* @since 2025-08-28 16:45
|
||||
*/
|
||||
@Component
|
||||
public class UnknownProcessor implements ApproverScopeProcessor {
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user