This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
package com.yunhai.svchall.enums;
|
||||
|
||||
/**
|
||||
* 办件在办事大厅侧的镜像状态(V2.0 Part B.2.4)。
|
||||
* 由流程中心回调驱动**单向推进**(按 payload.instanceVersion 丢弃乱序旧事件);
|
||||
* 数值对齐 flw_instance.status:10 审批中 / 20 已完成 / 30 已拒绝 / 40 已撤回,
|
||||
* 另有本地态 0=待提交(已落库但代发起尚未成功,可重试)。
|
||||
*/
|
||||
public enum ApplyFlowStatusEnum {
|
||||
|
||||
/** 待提交(本地落库,FlowClient 代发起未成功;重试复用同一 bizId) */
|
||||
PENDING(0),
|
||||
/** 审批中 */
|
||||
APPROVING(10),
|
||||
/** 已完成 */
|
||||
COMPLETED(20),
|
||||
/** 已拒绝 */
|
||||
REJECTED(30),
|
||||
/** 已撤回 */
|
||||
WITHDRAWN(40);
|
||||
|
||||
private final int code;
|
||||
|
||||
ApplyFlowStatusEnum(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public static ApplyFlowStatusEnum byCode(Integer code) {
|
||||
if (code != null) {
|
||||
for (ApplyFlowStatusEnum e : values()) {
|
||||
if (e.code == code) {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
}
|
||||
return PENDING;
|
||||
}
|
||||
|
||||
/** 是否为终态(终态只接受例外性回退——对账以 flow-center 为准修正) */
|
||||
public boolean terminal() {
|
||||
return this == COMPLETED || this == REJECTED || this == WITHDRAWN;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.yunhai.svchall.enums;
|
||||
|
||||
/**
|
||||
* 办理方式(承袭 CMS HandleModeEnum)。与 onlineFlag 语义不同、允许不一致:
|
||||
* 如「线上线下」但本期未开通在线入口时 online_flag=0。
|
||||
*/
|
||||
public enum HandleModeEnum {
|
||||
|
||||
/** 线上办理 */
|
||||
ONLINE(1),
|
||||
/** 线下办理 */
|
||||
OFFLINE(2),
|
||||
/** 线上线下均可 */
|
||||
BOTH(3);
|
||||
|
||||
private final int code;
|
||||
|
||||
HandleModeEnum(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public static boolean isValid(Integer code) {
|
||||
if (code == null) {
|
||||
return false;
|
||||
}
|
||||
for (HandleModeEnum e : values()) {
|
||||
if (e.code == code) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.yunhai.svchall.enums;
|
||||
|
||||
/**
|
||||
* 事项字典类型(承袭 CMS ServiceDictTypeEnum):object=服务对象、category=事项类别。
|
||||
*/
|
||||
public enum ServiceDictTypeEnum {
|
||||
|
||||
/** 服务对象 */
|
||||
OBJECT("object"),
|
||||
/** 事项类别 */
|
||||
CATEGORY("category");
|
||||
|
||||
private final String key;
|
||||
|
||||
ServiceDictTypeEnum(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
/** 非法值(含 null)返回 null,由调用方决定报错口径 */
|
||||
public static ServiceDictTypeEnum byKey(String key) {
|
||||
if (key != null) {
|
||||
for (ServiceDictTypeEnum e : values()) {
|
||||
if (e.key.equals(key)) {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.yunhai.svchall.enums;
|
||||
|
||||
/**
|
||||
* 事项状态(承袭 CMS ServiceItemStatusEnum):草稿→发布→下架;
|
||||
* 门户可见性:仅已发布。
|
||||
*/
|
||||
public enum ServiceItemStatusEnum {
|
||||
|
||||
/** 草稿 */
|
||||
DRAFT(0),
|
||||
/** 已发布 */
|
||||
PUBLISHED(1),
|
||||
/** 已下架 */
|
||||
OFFLINE(2);
|
||||
|
||||
private final int code;
|
||||
|
||||
ServiceItemStatusEnum(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public static ServiceItemStatusEnum byCode(Integer code) {
|
||||
if (code != null) {
|
||||
for (ServiceItemStatusEnum e : values()) {
|
||||
if (e.code == code) {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
}
|
||||
return DRAFT;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user