【代码优化】Bpm:调整 IntArrayValuable 到 ArrayValuable
This commit is contained in:
parent
bb798681f7
commit
d63e315876
|
@ -1,6 +1,6 @@
|
||||||
package cn.iocoder.yudao.module.bpm.enums.definition;
|
package cn.iocoder.yudao.module.bpm.enums.definition;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@ -13,19 +13,19 @@ import java.util.Arrays;
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum BpmAutoApproveTypeEnum implements IntArrayValuable {
|
public enum BpmAutoApproveTypeEnum implements ArrayValuable<Integer> {
|
||||||
|
|
||||||
NONE(0, "不自动通过"),
|
NONE(0, "不自动通过"),
|
||||||
APPROVE_ALL(1, "仅审批一次,后续重复的审批节点均自动通过"),
|
APPROVE_ALL(1, "仅审批一次,后续重复的审批节点均自动通过"),
|
||||||
APPROVE_SEQUENT(2, "仅针对连续审批的节点自动通过");
|
APPROVE_SEQUENT(2, "仅针对连续审批的节点自动通过");
|
||||||
|
|
||||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmAutoApproveTypeEnum::getType).toArray();
|
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmAutoApproveTypeEnum::getType).toArray(Integer[]::new);
|
||||||
|
|
||||||
private final Integer type;
|
private final Integer type;
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[] array() {
|
public Integer[] array() {
|
||||||
return ARRAYS;
|
return ARRAYS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package cn.iocoder.yudao.module.bpm.enums.definition;
|
package cn.iocoder.yudao.module.bpm.enums.definition;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ import java.util.Arrays;
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum BpmDelayTimerTypeEnum implements IntArrayValuable {
|
public enum BpmDelayTimerTypeEnum implements ArrayValuable<Integer> {
|
||||||
|
|
||||||
FIXED_TIME_DURATION(1, "固定时长"),
|
FIXED_TIME_DURATION(1, "固定时长"),
|
||||||
FIXED_DATE_TIME(2, "固定日期");
|
FIXED_DATE_TIME(2, "固定日期");
|
||||||
|
@ -21,10 +21,10 @@ public enum BpmDelayTimerTypeEnum implements IntArrayValuable {
|
||||||
private final Integer type;
|
private final Integer type;
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmDelayTimerTypeEnum::getType).toArray();
|
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmDelayTimerTypeEnum::getType).toArray(Integer[]::new);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[] array() {
|
public Integer[] array() {
|
||||||
return ARRAYS;
|
return ARRAYS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package cn.iocoder.yudao.module.bpm.enums.definition;
|
package cn.iocoder.yudao.module.bpm.enums.definition;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ import java.util.Arrays;
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum BpmHttpRequestParamTypeEnum implements IntArrayValuable {
|
public enum BpmHttpRequestParamTypeEnum implements ArrayValuable<Integer> {
|
||||||
|
|
||||||
FIXED_VALUE(1, "固定值"),
|
FIXED_VALUE(1, "固定值"),
|
||||||
FROM_FORM(2, "表单");
|
FROM_FORM(2, "表单");
|
||||||
|
@ -21,10 +21,10 @@ public enum BpmHttpRequestParamTypeEnum implements IntArrayValuable {
|
||||||
private final Integer type;
|
private final Integer type;
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmHttpRequestParamTypeEnum::getType).toArray();
|
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmHttpRequestParamTypeEnum::getType).toArray(Integer[]::new);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[] array() {
|
public Integer[] array() {
|
||||||
return ARRAYS;
|
return ARRAYS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package cn.iocoder.yudao.module.bpm.enums.definition;
|
package cn.iocoder.yudao.module.bpm.enums.definition;
|
||||||
|
|
||||||
import cn.hutool.core.util.ArrayUtil;
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ import java.util.Arrays;
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum BpmTriggerTypeEnum implements IntArrayValuable {
|
public enum BpmTriggerTypeEnum implements ArrayValuable<Integer> {
|
||||||
|
|
||||||
HTTP_REQUEST(1, "发起 HTTP 请求");
|
HTTP_REQUEST(1, "发起 HTTP 请求");
|
||||||
|
|
||||||
|
@ -28,14 +28,15 @@ public enum BpmTriggerTypeEnum implements IntArrayValuable {
|
||||||
*/
|
*/
|
||||||
private final String desc;
|
private final String desc;
|
||||||
|
|
||||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmTriggerTypeEnum::getType).toArray();
|
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmTriggerTypeEnum::getType).toArray(Integer[]::new);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[] array() {
|
public Integer[] array() {
|
||||||
return ARRAYS;
|
return ARRAYS;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static BpmTriggerTypeEnum typeOf(Integer type) {
|
public static BpmTriggerTypeEnum typeOf(Integer type) {
|
||||||
return ArrayUtil.firstMatch(item -> item.getType().equals(type), values());
|
return ArrayUtil.firstMatch(item -> item.getType().equals(type), values());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue