From 6b13839488edcd06046e26a41fe897358176689c Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期五, 13 十二月 2024 17:56:41 +0800
Subject: [PATCH] 采集质量

---
 iailab-module-bpm/iailab-module-bpm-api/src/main/java/com/iailab/module/bpm/enums/definition/BpmUserTaskApproveMethodEnum.java |   47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/iailab-module-bpm/iailab-module-bpm-api/src/main/java/com/iailab/module/bpm/enums/definition/BpmUserTaskApproveMethodEnum.java b/iailab-module-bpm/iailab-module-bpm-api/src/main/java/com/iailab/module/bpm/enums/definition/BpmUserTaskApproveMethodEnum.java
new file mode 100644
index 0000000..ec5069f
--- /dev/null
+++ b/iailab-module-bpm/iailab-module-bpm-api/src/main/java/com/iailab/module/bpm/enums/definition/BpmUserTaskApproveMethodEnum.java
@@ -0,0 +1,47 @@
+package com.iailab.module.bpm.enums.definition;
+
+import cn.hutool.core.util.ArrayUtil;
+import com.iailab.framework.common.core.IntArrayValuable;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.Arrays;
+
+/**
+ * BPM 多人审批方式的枚举
+ *
+ * @author hou
+ */
+@Getter
+@AllArgsConstructor
+public enum BpmUserTaskApproveMethodEnum implements IntArrayValuable {
+
+    RANDOM(1, "随机挑选一人审批", null),
+    RATIO(2, "多人会签(按通过比例)", "${ nrOfCompletedInstances/nrOfInstances >= %s}"), // 会签(按通过比例)
+    ANY(3, "多人或签(一人通过或拒绝)", "${ nrOfCompletedInstances > 0 }"), // 或签(通过只需一人,拒绝只需一人)
+    SEQUENTIAL(4, "依次审批", "${ nrOfCompletedInstances >= nrOfInstances }"); // 依次审批
+
+    /**
+     * 审批方式
+     */
+    private final Integer method;
+    /**
+     * 名字
+     */
+    private final String name;
+    /**
+     * 完成表达式
+     */
+    private final String completionCondition;
+
+    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmUserTaskApproveMethodEnum::getMethod).toArray();
+
+    public static BpmUserTaskApproveMethodEnum valueOf(Integer method) {
+        return ArrayUtil.firstMatch(item -> item.getMethod().equals(method), values());
+    }
+
+    @Override
+    public int[] array() {
+        return ARRAYS;
+    }
+}

--
Gitblit v1.9.3