Merge branch 'develop' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into master-jdk17
This commit is contained in:
commit
295fad7d97
|
@ -0,0 +1,15 @@
|
|||
package cn.iocoder.yudao.framework.common.core;
|
||||
|
||||
/**
|
||||
* 可生成 T 数组的接口
|
||||
*
|
||||
* @author HUIHUI
|
||||
*/
|
||||
public interface ArrayValuable<T> {
|
||||
|
||||
/**
|
||||
* @return 数组
|
||||
*/
|
||||
T[] array();
|
||||
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
package cn.iocoder.yudao.framework.common.core;
|
||||
|
||||
/**
|
||||
* 可生成 Int 数组的接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface IntArrayValuable {
|
||||
|
||||
/**
|
||||
* @return int 数组
|
||||
*/
|
||||
int[] array();
|
||||
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
package cn.iocoder.yudao.framework.common.enums;
|
||||
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -14,12 +14,12 @@ import java.util.Arrays;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum CommonStatusEnum implements IntArrayValuable {
|
||||
public enum CommonStatusEnum implements ArrayValuable<Integer> {
|
||||
|
||||
ENABLE(0, "开启"),
|
||||
DISABLE(1, "关闭");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CommonStatusEnum::getStatus).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(CommonStatusEnum::getStatus).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 状态值
|
||||
|
@ -31,7 +31,7 @@ public enum CommonStatusEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.iocoder.yudao.framework.common.enums;
|
||||
|
||||
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.Getter;
|
||||
|
||||
|
@ -14,7 +14,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum DateIntervalEnum implements IntArrayValuable {
|
||||
public enum DateIntervalEnum implements ArrayValuable<Integer> {
|
||||
|
||||
DAY(1, "天"),
|
||||
WEEK(2, "周"),
|
||||
|
@ -23,7 +23,7 @@ public enum DateIntervalEnum implements IntArrayValuable {
|
|||
YEAR(5, "年")
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(DateIntervalEnum::getInterval).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(DateIntervalEnum::getInterval).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 类型
|
||||
|
@ -35,7 +35,7 @@ public enum DateIntervalEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.framework.common.enums;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
|
@ -13,7 +13,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum TerminalEnum implements IntArrayValuable {
|
||||
public enum TerminalEnum implements ArrayValuable<Integer> {
|
||||
|
||||
UNKNOWN(0, "未知"), // 目的:在无法解析到 terminal 时,使用它
|
||||
WECHAT_MINI_PROGRAM(10, "微信小程序"),
|
||||
|
@ -22,7 +22,7 @@ public enum TerminalEnum implements IntArrayValuable {
|
|||
APP(31, "手机 App"),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(TerminalEnum::getTerminal).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(TerminalEnum::getTerminal).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 终端
|
||||
|
@ -34,7 +34,7 @@ public enum TerminalEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.iocoder.yudao.framework.common.enums;
|
||||
|
||||
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.Getter;
|
||||
|
||||
|
@ -12,12 +12,12 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum UserTypeEnum implements IntArrayValuable {
|
||||
public enum UserTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
MEMBER(1, "会员"), // 面向 c 端,普通用户
|
||||
ADMIN(2, "管理员"); // 面向 b 端,管理后台
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(UserTypeEnum::getValue).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(UserTypeEnum::getValue).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 类型
|
||||
|
@ -33,7 +33,7 @@ public enum UserTypeEnum implements IntArrayValuable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package cn.iocoder.yudao.framework.common.validation;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import jakarta.validation.Constraint;
|
||||
import jakarta.validation.Payload;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Target({
|
||||
|
@ -22,9 +22,9 @@ import java.lang.annotation.*;
|
|||
public @interface InEnum {
|
||||
|
||||
/**
|
||||
* @return 实现 EnumValuable 接口的
|
||||
* @return 实现 ArrayValuable 接口的类
|
||||
*/
|
||||
Class<? extends IntArrayValuable> value();
|
||||
Class<? extends ArrayValuable<?>> value();
|
||||
|
||||
String message() default "必须在指定范围 {value}";
|
||||
|
||||
|
|
|
@ -1,37 +1,39 @@
|
|||
package cn.iocoder.yudao.framework.common.validation;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import jakarta.validation.ConstraintValidator;
|
||||
import jakarta.validation.ConstraintValidatorContext;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class InEnumCollectionValidator implements ConstraintValidator<InEnum, Collection<Integer>> {
|
||||
public class InEnumCollectionValidator implements ConstraintValidator<InEnum, Collection<?>> {
|
||||
|
||||
private List<Integer> values;
|
||||
private List<?> values;
|
||||
|
||||
@Override
|
||||
public void initialize(InEnum annotation) {
|
||||
IntArrayValuable[] values = annotation.value().getEnumConstants();
|
||||
ArrayValuable<?>[] values = annotation.value().getEnumConstants();
|
||||
if (values.length == 0) {
|
||||
this.values = Collections.emptyList();
|
||||
} else {
|
||||
this.values = Arrays.stream(values[0].array()).boxed().collect(Collectors.toList());
|
||||
this.values = Arrays.asList(values[0].array());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(Collection<Integer> list, ConstraintValidatorContext context) {
|
||||
public boolean isValid(Collection<?> list, ConstraintValidatorContext context) {
|
||||
if (list == null) {
|
||||
return true;
|
||||
}
|
||||
// 校验通过
|
||||
if (CollUtil.containsAll(values, list)) {
|
||||
return true;
|
||||
}
|
||||
// 校验不通过,自定义提示语句(因为,注解上的 value 是枚举类,无法获得枚举类的实际值)
|
||||
// 校验不通过,自定义提示语句
|
||||
context.disableDefaultConstraintViolation(); // 禁用默认的 message 的值
|
||||
context.buildConstraintViolationWithTemplate(context.getDefaultConstraintMessageTemplate()
|
||||
.replaceAll("\\{value}", CollUtil.join(list, ","))).addConstraintViolation(); // 重新添加错误提示语句
|
||||
|
|
|
@ -1,30 +1,29 @@
|
|||
package cn.iocoder.yudao.framework.common.validation;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import jakarta.validation.ConstraintValidator;
|
||||
import jakarta.validation.ConstraintValidatorContext;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class InEnumValidator implements ConstraintValidator<InEnum, Integer> {
|
||||
public class InEnumValidator implements ConstraintValidator<InEnum, Object> {
|
||||
|
||||
private List<Integer> values;
|
||||
private List<?> values;
|
||||
|
||||
@Override
|
||||
public void initialize(InEnum annotation) {
|
||||
IntArrayValuable[] values = annotation.value().getEnumConstants();
|
||||
ArrayValuable<?>[] values = annotation.value().getEnumConstants();
|
||||
if (values.length == 0) {
|
||||
this.values = Collections.emptyList();
|
||||
} else {
|
||||
this.values = Arrays.stream(values[0].array()).boxed().collect(Collectors.toList());
|
||||
this.values = Arrays.asList(values[0].array());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(Integer value, ConstraintValidatorContext context) {
|
||||
public boolean isValid(Object value, ConstraintValidatorContext context) {
|
||||
// 为空时,默认不校验,即认为通过
|
||||
if (value == null) {
|
||||
return true;
|
||||
|
@ -33,7 +32,7 @@ public class InEnumValidator implements ConstraintValidator<InEnum, Integer> {
|
|||
if (values.contains(value)) {
|
||||
return true;
|
||||
}
|
||||
// 校验不通过,自定义提示语句(因为,注解上的 value 是枚举类,无法获得枚举类的实际值)
|
||||
// 校验不通过,自定义提示语句
|
||||
context.disableDefaultConstraintViolation(); // 禁用默认的 message 的值
|
||||
context.buildConstraintViolationWithTemplate(context.getDefaultConstraintMessageTemplate()
|
||||
.replaceAll("\\{value}", values.toString())).addConstraintViolation(); // 重新添加错误提示语句
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.framework.ip.core.enums;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,7 +13,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum AreaTypeEnum implements IntArrayValuable {
|
||||
public enum AreaTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
COUNTRY(1, "国家"),
|
||||
PROVINCE(2, "省份"),
|
||||
|
@ -21,7 +21,7 @@ public enum AreaTypeEnum implements IntArrayValuable {
|
|||
DISTRICT(4, "地区"), // 县、镇、区等
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(AreaTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(AreaTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 类型
|
||||
|
@ -33,7 +33,7 @@ public enum AreaTypeEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.ai.enums.knowledge;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,7 +13,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum AiKnowledgeDocumentStatusEnum implements IntArrayValuable {
|
||||
public enum AiKnowledgeDocumentStatusEnum implements ArrayValuable<Integer> {
|
||||
|
||||
IN_PROGRESS(10, "索引中"),
|
||||
SUCCESS(20, "可用"),
|
||||
|
@ -29,10 +29,10 @@ public enum AiKnowledgeDocumentStatusEnum implements IntArrayValuable {
|
|||
*/
|
||||
private final String name;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(AiKnowledgeDocumentStatusEnum::getStatus).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(AiKnowledgeDocumentStatusEnum::getStatus).toArray(Integer[]::new);
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.ai.enums.music;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,7 +13,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum AiMusicGenerateModeEnum implements IntArrayValuable {
|
||||
public enum AiMusicGenerateModeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
DESCRIPTION(1, "描述模式"),
|
||||
LYRIC(2, "歌词模式");
|
||||
|
@ -27,10 +27,10 @@ public enum AiMusicGenerateModeEnum implements IntArrayValuable {
|
|||
*/
|
||||
private final String name;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(AiMusicGenerateModeEnum::getMode).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(AiMusicGenerateModeEnum::getMode).toArray(Integer[]::new);
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.ai.enums.music;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,7 +13,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum AiMusicStatusEnum implements IntArrayValuable {
|
||||
public enum AiMusicStatusEnum implements ArrayValuable<Integer> {
|
||||
|
||||
IN_PROGRESS(10, "进行中"),
|
||||
SUCCESS(20, "已完成"),
|
||||
|
@ -29,10 +29,10 @@ public enum AiMusicStatusEnum implements IntArrayValuable {
|
|||
*/
|
||||
private final String name;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(AiMusicStatusEnum::getStatus).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(AiMusicStatusEnum::getStatus).toArray(Integer[]::new);
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.ai.enums.write;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,7 +13,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum AiWriteTypeEnum implements IntArrayValuable {
|
||||
public enum AiWriteTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
WRITING(1, "撰写", "请撰写一篇关于 [{}] 的文章。文章的内容格式:{},语气:{},语言:{},长度:{}。请确保涵盖主要内容,不需要除了正文内容外的其他回复,如标题、额外的解释或道歉。"),
|
||||
REPLY(2, "回复", "请针对如下内容:[{}] 做个回复。回复内容参考:[{}], 回复格式:{},语气:{},语言:{},长度:{}。不需要除了正文内容外的其他回复,如标题、开头、额外的解释或道歉。");
|
||||
|
@ -32,10 +32,10 @@ public enum AiWriteTypeEnum implements IntArrayValuable {
|
|||
*/
|
||||
private final String prompt;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(AiWriteTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(AiWriteTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
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.Getter;
|
||||
|
||||
|
@ -13,19 +13,19 @@ import java.util.Arrays;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BpmModelFormTypeEnum implements IntArrayValuable {
|
||||
public enum BpmModelFormTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
NORMAL(10, "流程表单"), // 对应 BpmFormDO
|
||||
CUSTOM(20, "业务表单") // 业务自己定义的表单,自己进行数据的存储
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmModelFormTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmModelFormTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
private final Integer type;
|
||||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
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.Getter;
|
||||
|
||||
|
@ -13,18 +13,18 @@ import java.util.Arrays;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BpmModelTypeEnum implements IntArrayValuable {
|
||||
public enum BpmModelTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
BPMN(10, "BPMN 设计器"), // https://bpmn.io/toolkit/bpmn-js/
|
||||
SIMPLE(20, "SIMPLE 设计器"); // 参考钉钉、飞书工作流的设计器
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmModelTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmModelTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
private final Integer type;
|
||||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.iocoder.yudao.module.bpm.enums.definition;
|
||||
|
||||
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.Getter;
|
||||
|
||||
|
@ -14,12 +14,12 @@ import java.util.Arrays;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BpmSimpleModeConditionType implements IntArrayValuable {
|
||||
public enum BpmSimpleModeConditionType implements ArrayValuable<Integer> {
|
||||
|
||||
EXPRESSION(1, "条件表达式"),
|
||||
RULE(2, "条件规则");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmSimpleModeConditionType::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmSimpleModeConditionType::getType).toArray(Integer[]::new);
|
||||
|
||||
private final Integer type;
|
||||
|
||||
|
@ -30,7 +30,7 @@ public enum BpmSimpleModeConditionType implements IntArrayValuable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.iocoder.yudao.module.bpm.enums.definition;
|
||||
|
||||
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.Getter;
|
||||
|
||||
|
@ -15,7 +15,7 @@ import java.util.Objects;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BpmSimpleModelNodeType implements IntArrayValuable {
|
||||
public enum BpmSimpleModelNodeType implements ArrayValuable<Integer> {
|
||||
|
||||
// 0 ~ 1 开始和结束
|
||||
START_NODE(0, "开始", "startEvent"),
|
||||
|
@ -33,7 +33,7 @@ public enum BpmSimpleModelNodeType implements IntArrayValuable {
|
|||
INCLUSIVE_BRANCH_NODE(53, "包容分支", "inclusiveGateway"),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmSimpleModelNodeType::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmSimpleModelNodeType::getType).toArray(Integer[]::new);
|
||||
|
||||
private final Integer type;
|
||||
private final String name;
|
||||
|
@ -55,7 +55,7 @@ public enum BpmSimpleModelNodeType implements IntArrayValuable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.iocoder.yudao.module.bpm.enums.definition;
|
||||
|
||||
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.Getter;
|
||||
|
||||
|
@ -14,7 +14,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BpmUserTaskApproveMethodEnum implements IntArrayValuable {
|
||||
public enum BpmUserTaskApproveMethodEnum implements ArrayValuable<Integer> {
|
||||
|
||||
RANDOM(1, "随机挑选一人审批", null),
|
||||
RATIO(2, "多人会签(按通过比例)", "${ nrOfCompletedInstances/nrOfInstances >= %s}"), // 会签(按通过比例)
|
||||
|
@ -34,14 +34,14 @@ public enum BpmUserTaskApproveMethodEnum implements IntArrayValuable {
|
|||
*/
|
||||
private final String completionCondition;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmUserTaskApproveMethodEnum::getMethod).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmUserTaskApproveMethodEnum::getMethod).toArray(Integer[]::new);
|
||||
|
||||
public static BpmUserTaskApproveMethodEnum valueOf(Integer method) {
|
||||
return ArrayUtil.firstMatch(item -> item.getMethod().equals(method), values());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
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.Getter;
|
||||
|
||||
|
@ -13,18 +13,18 @@ import java.util.Arrays;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BpmUserTaskApproveTypeEnum implements IntArrayValuable {
|
||||
public enum BpmUserTaskApproveTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
USER(1), // 人工审批
|
||||
AUTO_APPROVE(2), // 自动通过
|
||||
AUTO_REJECT(3); // 自动拒绝
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmUserTaskApproveTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmUserTaskApproveTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
private final Integer type;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
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.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
|
@ -13,7 +13,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum BpmUserTaskAssignEmptyHandlerTypeEnum implements IntArrayValuable {
|
||||
public enum BpmUserTaskAssignEmptyHandlerTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
APPROVE(1), // 自动通过
|
||||
REJECT(2), // 自动拒绝
|
||||
|
@ -21,12 +21,12 @@ public enum BpmUserTaskAssignEmptyHandlerTypeEnum implements IntArrayValuable {
|
|||
ASSIGN_ADMIN(4), // 转交给流程管理员
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmUserTaskAssignEmptyHandlerTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmUserTaskAssignEmptyHandlerTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
private final Integer type;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
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.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
|
@ -13,18 +13,18 @@ import java.util.Arrays;
|
|||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum BpmUserTaskAssignStartUserHandlerTypeEnum implements IntArrayValuable {
|
||||
public enum BpmUserTaskAssignStartUserHandlerTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
START_USER_AUDIT(1), // 由发起人对自己审批
|
||||
SKIP(2), // 自动跳过【参考飞书】:1)如果当前节点还有其他审批人,则交由其他审批人进行审批;2)如果当前节点没有其他审批人,则该节点自动通过
|
||||
TRANSFER_DEPT_LEADER(3); // 转交给部门负责人审批【参考飞书】:若部门负责人为空,则自动通过
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmUserTaskAssignStartUserHandlerTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmUserTaskAssignStartUserHandlerTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
private final Integer type;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.iocoder.yudao.module.bpm.enums.definition;
|
||||
|
||||
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.Getter;
|
||||
|
||||
|
@ -14,7 +14,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BpmUserTaskRejectHandlerType implements IntArrayValuable {
|
||||
public enum BpmUserTaskRejectHandlerType implements ArrayValuable<Integer> {
|
||||
|
||||
FINISH_PROCESS_INSTANCE(1, "终止流程"),
|
||||
RETURN_USER_TASK(2, "驳回到指定任务节点");
|
||||
|
@ -22,14 +22,14 @@ public enum BpmUserTaskRejectHandlerType implements IntArrayValuable {
|
|||
private final Integer type;
|
||||
private final String name;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmUserTaskRejectHandlerType::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmUserTaskRejectHandlerType::getType).toArray(Integer[]::new);
|
||||
|
||||
public static BpmUserTaskRejectHandlerType typeOf(Integer type) {
|
||||
return ArrayUtil.firstMatch(item -> item.getType().equals(type), values());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
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.Getter;
|
||||
|
||||
|
@ -13,7 +13,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BpmUserTaskTimeoutHandlerTypeEnum implements IntArrayValuable {
|
||||
public enum BpmUserTaskTimeoutHandlerTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
REMINDER(1,"自动提醒"),
|
||||
APPROVE(2, "自动同意"),
|
||||
|
@ -22,10 +22,10 @@ public enum BpmUserTaskTimeoutHandlerTypeEnum implements IntArrayValuable {
|
|||
private final Integer type;
|
||||
private final String name;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmUserTaskTimeoutHandlerTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmUserTaskTimeoutHandlerTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.bpm.enums.task;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.util.object.ObjectUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
@ -14,7 +14,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BpmProcessInstanceStatusEnum implements IntArrayValuable {
|
||||
public enum BpmProcessInstanceStatusEnum implements ArrayValuable<Integer> {
|
||||
|
||||
NOT_START(-1, "未开始"),
|
||||
RUNNING(1, "审批中"),
|
||||
|
@ -22,7 +22,7 @@ public enum BpmProcessInstanceStatusEnum implements IntArrayValuable {
|
|||
REJECT(3, "审批不通过"),
|
||||
CANCEL(4, "已取消");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmProcessInstanceStatusEnum::getStatus).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmProcessInstanceStatusEnum::getStatus).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 状态
|
||||
|
@ -34,7 +34,7 @@ public enum BpmProcessInstanceStatusEnum implements IntArrayValuable {
|
|||
private final String desc;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.iocoder.yudao.module.bpm.framework.flowable.core.enums;
|
||||
|
||||
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.Getter;
|
||||
|
||||
|
@ -16,7 +16,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BpmTaskCandidateStrategyEnum implements IntArrayValuable {
|
||||
public enum BpmTaskCandidateStrategyEnum implements ArrayValuable<Integer> {
|
||||
|
||||
ROLE(10, "角色"),
|
||||
DEPT_MEMBER(20, "部门的成员"), // 包括负责人
|
||||
|
@ -35,7 +35,7 @@ public enum BpmTaskCandidateStrategyEnum implements IntArrayValuable {
|
|||
ASSIGN_EMPTY(1, "审批人为空"),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmTaskCandidateStrategyEnum::getStrategy).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmTaskCandidateStrategyEnum::getStrategy).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 类型
|
||||
|
@ -51,7 +51,7 @@ public enum BpmTaskCandidateStrategyEnum implements IntArrayValuable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.crm.enums.business;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
|
@ -13,13 +13,13 @@ import java.util.Arrays;
|
|||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum CrmBusinessEndStatusEnum implements IntArrayValuable {
|
||||
public enum CrmBusinessEndStatusEnum implements ArrayValuable<Integer> {
|
||||
|
||||
WIN(1, "赢单"),
|
||||
LOSE(2, "输单"),
|
||||
INVALID(3, "无效");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CrmBusinessEndStatusEnum::getStatus).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(CrmBusinessEndStatusEnum::getStatus).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 场景类型
|
||||
|
@ -31,7 +31,7 @@ public enum CrmBusinessEndStatusEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.crm.enums.common;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
|
@ -13,7 +13,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum CrmAuditStatusEnum implements IntArrayValuable {
|
||||
public enum CrmAuditStatusEnum implements ArrayValuable<Integer> {
|
||||
|
||||
DRAFT(0, "未提交"),
|
||||
PROCESS(10, "审批中"),
|
||||
|
@ -24,10 +24,10 @@ public enum CrmAuditStatusEnum implements IntArrayValuable {
|
|||
private final Integer status;
|
||||
private final String name;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CrmAuditStatusEnum::getStatus).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(CrmAuditStatusEnum::getStatus).toArray(Integer[]::new);
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.crm.enums.common;
|
|||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
|
@ -15,7 +15,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum CrmBizTypeEnum implements IntArrayValuable {
|
||||
public enum CrmBizTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
CRM_CLUE(1, "线索"),
|
||||
CRM_CUSTOMER(2, "客户"),
|
||||
|
@ -27,7 +27,7 @@ public enum CrmBizTypeEnum implements IntArrayValuable {
|
|||
CRM_RECEIVABLE_PLAN(8, "回款计划")
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CrmBizTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(CrmBizTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 类型
|
||||
|
@ -45,7 +45,7 @@ public enum CrmBizTypeEnum implements IntArrayValuable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.iocoder.yudao.module.crm.enums.common;
|
||||
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -14,13 +14,13 @@ import java.util.Arrays;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum CrmSceneTypeEnum implements IntArrayValuable {
|
||||
public enum CrmSceneTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
OWNER(1, "我负责的"),
|
||||
INVOLVED(2, "我参与的"),
|
||||
SUBORDINATE(3, "下属负责的");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CrmSceneTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(CrmSceneTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 场景类型
|
||||
|
@ -44,7 +44,7 @@ public enum CrmSceneTypeEnum implements IntArrayValuable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.crm.enums.customer;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,13 +13,13 @@ import java.util.Arrays;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum CrmCustomerLevelEnum implements IntArrayValuable {
|
||||
public enum CrmCustomerLevelEnum implements ArrayValuable<Integer> {
|
||||
|
||||
IMPORTANT(1, "A(重点客户)"),
|
||||
GENERAL(2, "B(普通客户)"),
|
||||
LOW_PRIORITY(3, "C(非优先客户)");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CrmCustomerLevelEnum::getLevel).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(CrmCustomerLevelEnum::getLevel).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 状态
|
||||
|
@ -31,7 +31,7 @@ public enum CrmCustomerLevelEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.crm.enums.customer;
|
|||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -15,7 +15,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum CrmCustomerLimitConfigTypeEnum implements IntArrayValuable {
|
||||
public enum CrmCustomerLimitConfigTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
/**
|
||||
* 拥有客户数限制
|
||||
|
@ -27,7 +27,7 @@ public enum CrmCustomerLimitConfigTypeEnum implements IntArrayValuable {
|
|||
CUSTOMER_LOCK_LIMIT(2, "锁定客户数限制"),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CrmCustomerLimitConfigTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(CrmCustomerLimitConfigTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 状态
|
||||
|
@ -45,7 +45,7 @@ public enum CrmCustomerLimitConfigTypeEnum implements IntArrayValuable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.crm.enums.permission;
|
|||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -17,13 +17,13 @@ import java.util.Arrays;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum CrmPermissionLevelEnum implements IntArrayValuable {
|
||||
public enum CrmPermissionLevelEnum implements ArrayValuable<Integer> {
|
||||
|
||||
OWNER(1, "负责人"),
|
||||
READ(2, "只读"),
|
||||
WRITE(3, "读写");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CrmPermissionLevelEnum::getLevel).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(CrmPermissionLevelEnum::getLevel).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 级别
|
||||
|
@ -35,7 +35,7 @@ public enum CrmPermissionLevelEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.iocoder.yudao.module.crm.enums.product;
|
||||
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -15,12 +15,12 @@ import java.util.Arrays;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum CrmProductStatusEnum implements IntArrayValuable {
|
||||
public enum CrmProductStatusEnum implements ArrayValuable<Integer> {
|
||||
|
||||
DISABLE(0, "下架"),
|
||||
ENABLE(1, "上架");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CrmProductStatusEnum::getStatus).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(CrmProductStatusEnum::getStatus).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 状态
|
||||
|
@ -32,7 +32,7 @@ public enum CrmProductStatusEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.crm.enums.receivable;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,7 +13,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum CrmReceivableReturnTypeEnum implements IntArrayValuable {
|
||||
public enum CrmReceivableReturnTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
CHECK(1, "支票"),
|
||||
CASH(2, "现金"),
|
||||
|
@ -24,7 +24,7 @@ public enum CrmReceivableReturnTypeEnum implements IntArrayValuable {
|
|||
WECHAT_PAY(7, "微信支付"),
|
||||
OTHER(8, "其它");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CrmReceivableReturnTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(CrmReceivableReturnTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 类型
|
||||
|
@ -36,7 +36,7 @@ public enum CrmReceivableReturnTypeEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.erp.enums;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
|
@ -15,12 +15,12 @@ import java.util.Arrays;
|
|||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum ErpAuditStatus implements IntArrayValuable {
|
||||
public enum ErpAuditStatus implements ArrayValuable<Integer> {
|
||||
|
||||
PROCESS(10, "未审核"), // 审核中
|
||||
APPROVE(20, "已审核"); // 审核通过
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ErpAuditStatus::getStatus).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(ErpAuditStatus::getStatus).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 状态
|
||||
|
@ -32,7 +32,7 @@ public enum ErpAuditStatus implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.erp.enums.common;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
|
@ -13,7 +13,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum ErpBizTypeEnum implements IntArrayValuable {
|
||||
public enum ErpBizTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
PURCHASE_ORDER(10, "采购订单"),
|
||||
PURCHASE_IN(11, "采购入库"),
|
||||
|
@ -24,7 +24,7 @@ public enum ErpBizTypeEnum implements IntArrayValuable {
|
|||
SALE_RETURN(22, "销售退货"),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ErpBizTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(ErpBizTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 类型
|
||||
|
@ -36,7 +36,7 @@ public enum ErpBizTypeEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.erp.enums.stock;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
|
@ -13,7 +13,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum ErpStockRecordBizTypeEnum implements IntArrayValuable {
|
||||
public enum ErpStockRecordBizTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
OTHER_IN(10, "其它入库"),
|
||||
OTHER_IN_CANCEL(11, "其它入库(作废)"),
|
||||
|
@ -44,7 +44,7 @@ public enum ErpStockRecordBizTypeEnum implements IntArrayValuable {
|
|||
PURCHASE_RETURN_CANCEL(81, "采购退货出库(作废)"),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ErpStockRecordBizTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(ErpStockRecordBizTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 类型
|
||||
|
@ -56,7 +56,7 @@ public enum ErpStockRecordBizTypeEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.iot.enums.device;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
@ -11,14 +11,14 @@ import java.util.Arrays;
|
|||
* @author haohao
|
||||
*/
|
||||
@Getter
|
||||
public enum IotDeviceStatusEnum implements IntArrayValuable {
|
||||
public enum IotDeviceStatusEnum implements ArrayValuable<Integer> {
|
||||
|
||||
INACTIVE(0, "未激活"),
|
||||
ONLINE(1, "在线"),
|
||||
OFFLINE(2, "离线"),
|
||||
DISABLED(3, "已禁用");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(IotDeviceStatusEnum::getStatus).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(IotDeviceStatusEnum::getStatus).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 状态
|
||||
|
@ -48,7 +48,7 @@ public enum IotDeviceStatusEnum implements IntArrayValuable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.iot.enums.product;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -14,12 +14,12 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum IotDataFormatEnum implements IntArrayValuable {
|
||||
public enum IotDataFormatEnum implements ArrayValuable<Integer> {
|
||||
|
||||
JSON(0, "标准数据格式(JSON)"),
|
||||
CUSTOMIZE(1, "透传/自定义");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(IotDataFormatEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(IotDataFormatEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 类型
|
||||
|
@ -31,7 +31,7 @@ public enum IotDataFormatEnum implements IntArrayValuable {
|
|||
private final String description;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.iot.enums.product;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,14 +13,14 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum IotNetTypeEnum implements IntArrayValuable {
|
||||
public enum IotNetTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
WIFI(0, "Wi-Fi"),
|
||||
CELLULAR(1, "Cellular"),
|
||||
ETHERNET(2, "Ethernet"),
|
||||
OTHER(3, "其他");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(IotNetTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(IotNetTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 类型
|
||||
|
@ -32,7 +32,7 @@ public enum IotNetTypeEnum implements IntArrayValuable {
|
|||
private final String description;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.iot.enums.product;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,7 +13,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum IotProductDeviceTypeEnum implements IntArrayValuable {
|
||||
public enum IotProductDeviceTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
DIRECT(0, "直连设备"),
|
||||
GATEWAY_CHILD(1, "网关子设备"),
|
||||
|
@ -29,10 +29,10 @@ public enum IotProductDeviceTypeEnum implements IntArrayValuable {
|
|||
*/
|
||||
private final String description;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(IotProductDeviceTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(IotProductDeviceTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.iot.enums.product;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,13 +13,13 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum IotProductFunctionTypeEnum implements IntArrayValuable {
|
||||
public enum IotProductFunctionTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
PROPERTY(1, "属性"),
|
||||
SERVICE(2, "服务"),
|
||||
EVENT(3, "事件");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(IotProductFunctionTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(IotProductFunctionTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 类型
|
||||
|
@ -31,7 +31,7 @@ public enum IotProductFunctionTypeEnum implements IntArrayValuable {
|
|||
private final String description;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.iot.enums.product;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,12 +13,12 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum IotProductStatusEnum implements IntArrayValuable {
|
||||
public enum IotProductStatusEnum implements ArrayValuable<Integer> {
|
||||
|
||||
UNPUBLISHED(0, "开发中"),
|
||||
PUBLISHED(1, "已发布");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(IotProductStatusEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(IotProductStatusEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 类型
|
||||
|
@ -30,7 +30,7 @@ public enum IotProductStatusEnum implements IntArrayValuable {
|
|||
private final String description;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.iot.enums.product;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,7 +13,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum IotProtocolTypeEnum implements IntArrayValuable {
|
||||
public enum IotProtocolTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
CUSTOM(0, "自定义"),
|
||||
MODBUS(1, "Modbus"),
|
||||
|
@ -21,7 +21,7 @@ public enum IotProtocolTypeEnum implements IntArrayValuable {
|
|||
ZIGBEE(3, "ZigBee"),
|
||||
BLE(4, "BLE");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(IotProtocolTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(IotProtocolTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 类型
|
||||
|
@ -33,7 +33,7 @@ public enum IotProtocolTypeEnum implements IntArrayValuable {
|
|||
private final String description;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.iot.enums.product;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,12 +13,12 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum IotValidateTypeEnum implements IntArrayValuable {
|
||||
public enum IotValidateTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
WEAK(0, "弱校验"),
|
||||
NONE(1, "免校验");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(IotValidateTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(IotValidateTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 类型
|
||||
|
@ -30,7 +30,7 @@ public enum IotValidateTypeEnum implements IntArrayValuable {
|
|||
private final String description;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.product.enums.comment;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,13 +13,13 @@ import java.util.Arrays;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ProductCommentAuditStatusEnum implements IntArrayValuable {
|
||||
public enum ProductCommentAuditStatusEnum implements ArrayValuable<Integer> {
|
||||
|
||||
NONE(0, "待审核"),
|
||||
APPROVE(1, "审批通过"),
|
||||
REJECT(2, "审批不通过"),;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ProductCommentAuditStatusEnum::getStatus).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(ProductCommentAuditStatusEnum::getStatus).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 审批状态
|
||||
|
@ -31,7 +31,7 @@ public enum ProductCommentAuditStatusEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.product.enums.comment;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,7 +13,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ProductCommentScoresEnum implements IntArrayValuable {
|
||||
public enum ProductCommentScoresEnum implements ArrayValuable<Integer> {
|
||||
|
||||
ONE(1, "1星"),
|
||||
TWO(2, "2星"),
|
||||
|
@ -21,7 +21,7 @@ public enum ProductCommentScoresEnum implements IntArrayValuable {
|
|||
FOUR(4, "4星"),
|
||||
FIVE(5, "5星");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ProductCommentScoresEnum::getScores).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(ProductCommentScoresEnum::getScores).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 星级
|
||||
|
@ -34,7 +34,7 @@ public enum ProductCommentScoresEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.product.enums.spu;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,13 +13,13 @@ import java.util.Arrays;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ProductSpuStatusEnum implements IntArrayValuable {
|
||||
public enum ProductSpuStatusEnum implements ArrayValuable<Integer> {
|
||||
|
||||
RECYCLE(-1, "回收站"),
|
||||
DISABLE(0, "下架"),
|
||||
ENABLE(1, "上架");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ProductSpuStatusEnum::getStatus).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(ProductSpuStatusEnum::getStatus).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 状态
|
||||
|
@ -31,7 +31,7 @@ public enum ProductSpuStatusEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.promotion.enums.banner;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,7 +13,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum BannerPositionEnum implements IntArrayValuable {
|
||||
public enum BannerPositionEnum implements ArrayValuable<Integer> {
|
||||
|
||||
HOME_POSITION(1, "首页"),
|
||||
SECKILL_POSITION(2, "秒杀活动页"),
|
||||
|
@ -21,7 +21,7 @@ public enum BannerPositionEnum implements IntArrayValuable {
|
|||
DISCOUNT_POSITION(4, "限时折扣页"),
|
||||
REWARD_POSITION(5, "满减送页");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BannerPositionEnum::getPosition).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BannerPositionEnum::getPosition).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 值
|
||||
|
@ -33,7 +33,7 @@ public enum BannerPositionEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.promotion.enums.bargain;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,14 +13,14 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum BargainRecordStatusEnum implements IntArrayValuable {
|
||||
public enum BargainRecordStatusEnum implements ArrayValuable<Integer> {
|
||||
|
||||
IN_PROGRESS(1, "砍价中"),
|
||||
SUCCESS(2, "砍价成功"),
|
||||
FAILED(3, "砍价失败"), // 活动到期时,会自动将到期的砍价全部设置为过期
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BargainRecordStatusEnum::getStatus).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BargainRecordStatusEnum::getStatus).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 值
|
||||
|
@ -32,7 +32,7 @@ public enum BargainRecordStatusEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.iocoder.yudao.module.promotion.enums.combination;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -14,13 +14,13 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum CombinationRecordStatusEnum implements IntArrayValuable {
|
||||
public enum CombinationRecordStatusEnum implements ArrayValuable<Integer> {
|
||||
|
||||
IN_PROGRESS(0, "进行中"),
|
||||
SUCCESS(1, "拼团成功"),
|
||||
FAILED(2, "拼团失败");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CombinationRecordStatusEnum::getStatus).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(CombinationRecordStatusEnum::getStatus).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 状态值
|
||||
|
@ -32,7 +32,7 @@ public enum CombinationRecordStatusEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.promotion.enums.common;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -14,14 +14,14 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum PromotionActivityStatusEnum implements IntArrayValuable {
|
||||
public enum PromotionActivityStatusEnum implements ArrayValuable<Integer> {
|
||||
|
||||
WAIT(10, "未开始"),
|
||||
RUN(20, "进行中"),
|
||||
END(30, "已结束"),
|
||||
CLOSE(40, "已关闭");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(PromotionActivityStatusEnum::getStatus).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(PromotionActivityStatusEnum::getStatus).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 状态值
|
||||
|
@ -33,7 +33,7 @@ public enum PromotionActivityStatusEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.promotion.enums.common;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,12 +13,12 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum PromotionConditionTypeEnum implements IntArrayValuable {
|
||||
public enum PromotionConditionTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
PRICE(10, "满 N 元"),
|
||||
COUNT(20, "满 N 件");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(PromotionConditionTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(PromotionConditionTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 类型值
|
||||
|
@ -30,7 +30,7 @@ public enum PromotionConditionTypeEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.promotion.enums.common;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,13 +13,13 @@ import java.util.Arrays;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum PromotionDiscountTypeEnum implements IntArrayValuable {
|
||||
public enum PromotionDiscountTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
PRICE(1, "满减"), // 具体金额
|
||||
PERCENT(2, "折扣"), // 百分比
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(PromotionDiscountTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(PromotionDiscountTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 优惠类型
|
||||
|
@ -31,7 +31,7 @@ public enum PromotionDiscountTypeEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.promotion.enums.common;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -14,13 +14,13 @@ import java.util.Objects;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum PromotionProductScopeEnum implements IntArrayValuable {
|
||||
public enum PromotionProductScopeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
ALL(1, "全部商品"),
|
||||
SPU(2, "指定商品"),
|
||||
CATEGORY(3, "指定品类");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(PromotionProductScopeEnum::getScope).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(PromotionProductScopeEnum::getScope).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 范围值
|
||||
|
@ -32,7 +32,7 @@ public enum PromotionProductScopeEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.promotion.enums.common;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,7 +13,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum PromotionTypeEnum implements IntArrayValuable {
|
||||
public enum PromotionTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
SECKILL_ACTIVITY(1, "秒杀活动"),
|
||||
BARGAIN_ACTIVITY(2, "砍价活动"),
|
||||
|
@ -27,7 +27,7 @@ public enum PromotionTypeEnum implements IntArrayValuable {
|
|||
POINT(8, "积分")
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(PromotionTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(PromotionTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 类型值
|
||||
|
@ -39,7 +39,7 @@ public enum PromotionTypeEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.promotion.enums.coupon;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,13 +13,13 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum CouponStatusEnum implements IntArrayValuable {
|
||||
public enum CouponStatusEnum implements ArrayValuable<Integer> {
|
||||
|
||||
UNUSED(1, "未使用"),
|
||||
USED(2, "已使用"),
|
||||
EXPIRE(3, "已过期");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CouponStatusEnum::getStatus).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(CouponStatusEnum::getStatus).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 值
|
||||
|
@ -31,7 +31,7 @@ public enum CouponStatusEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.promotion.enums.coupon;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -14,14 +14,14 @@ import java.util.Objects;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum CouponTakeTypeEnum implements IntArrayValuable {
|
||||
public enum CouponTakeTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
USER(1, "直接领取"), // 用户可在首页、每日领劵直接领取
|
||||
ADMIN(2, "指定发放"), // 后台指定会员赠送优惠劵
|
||||
REGISTER(3, "新人券"), // 注册时自动领取
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CouponTakeTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(CouponTakeTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 值
|
||||
|
@ -33,7 +33,7 @@ public enum CouponTakeTypeEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.promotion.enums.coupon;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,13 +13,13 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum CouponTemplateValidityTypeEnum implements IntArrayValuable {
|
||||
public enum CouponTemplateValidityTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
DATE(1, "固定日期"),
|
||||
TERM(2, "领取之后"),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CouponTemplateValidityTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(CouponTemplateValidityTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 值
|
||||
|
@ -31,7 +31,7 @@ public enum CouponTemplateValidityTypeEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.promotion.enums.diy;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,13 +13,13 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum DiyPageEnum implements IntArrayValuable {
|
||||
public enum DiyPageEnum implements ArrayValuable<Integer> {
|
||||
|
||||
INDEX(1, "首页"),
|
||||
MY(2, "我的"),
|
||||
;
|
||||
|
||||
private static final int[] ARRAYS = Arrays.stream(values()).mapToInt(DiyPageEnum::getPage).toArray();
|
||||
private static final Integer[] ARRAYS = Arrays.stream(values()).map(DiyPageEnum::getPage).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 页面编号
|
||||
|
@ -32,7 +32,7 @@ public enum DiyPageEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.promotion.enums.kefu;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,7 +13,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum KeFuMessageContentTypeEnum implements IntArrayValuable {
|
||||
public enum KeFuMessageContentTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
TEXT(1, "文本消息"),
|
||||
IMAGE(2, "图片消息"),
|
||||
|
@ -25,7 +25,7 @@ public enum KeFuMessageContentTypeEnum implements IntArrayValuable {
|
|||
PRODUCT(10, "商品消息"),
|
||||
ORDER(11, "订单消息");
|
||||
|
||||
private static final int[] ARRAYS = Arrays.stream(values()).mapToInt(KeFuMessageContentTypeEnum::getType).toArray();
|
||||
private static final Integer[] ARRAYS = Arrays.stream(values()).map(KeFuMessageContentTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 类型
|
||||
|
@ -38,7 +38,7 @@ public enum KeFuMessageContentTypeEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -375,7 +375,7 @@ public class CombinationRecordServiceImpl implements CombinationRecordService {
|
|||
CombinationRecordDO updateRecord = new CombinationRecordDO().setId(item.getId())
|
||||
.setStatus(status.getStatus()).setEndTime(now);
|
||||
if (CombinationRecordStatusEnum.isSuccess(status.getStatus())) { // 虚拟成团完事更改状态成功后还需要把参与人数修改为成团需要人数
|
||||
updateRecord.setUserCount(records.size());
|
||||
updateRecord.setUserCount(records.size()).setVirtualGroup(Boolean.TRUE); // 标记为虚拟成团
|
||||
}
|
||||
updateRecords.add(updateRecord);
|
||||
});
|
||||
|
|
|
@ -100,7 +100,7 @@ public class PointActivityServiceImpl implements PointActivityService {
|
|||
}
|
||||
pointActivityMapper.updateById(updateObj);
|
||||
// 2.2 更新商品
|
||||
updateSeckillProduct(updateObj, updateReqVO.getProducts());
|
||||
updatePointProduct(updateObj, updateReqVO.getProducts());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -157,12 +157,12 @@ public class PointActivityServiceImpl implements PointActivityService {
|
|||
}
|
||||
|
||||
/**
|
||||
* 更新秒杀商品
|
||||
* 更新积分商品
|
||||
*
|
||||
* @param activity 秒杀活动
|
||||
* @param activity 积分活动
|
||||
* @param products 该活动的最新商品配置
|
||||
*/
|
||||
private void updateSeckillProduct(PointActivityDO activity, List<PointProductSaveReqVO> products) {
|
||||
private void updatePointProduct(PointActivityDO activity, List<PointProductSaveReqVO> products) {
|
||||
// 第一步,对比新老数据,获得添加、修改、删除的列表
|
||||
List<PointProductDO> newList = buildPointProductDO(activity, products);
|
||||
List<PointProductDO> oldList = pointProductMapper.selectListByActivityId(activity.getId());
|
||||
|
@ -211,10 +211,10 @@ public class PointActivityServiceImpl implements PointActivityService {
|
|||
}
|
||||
|
||||
/**
|
||||
* 校验秒杀商品是否都存在
|
||||
* 校验积分商品是否都存在
|
||||
*
|
||||
* @param spuId 商品 SPU 编号
|
||||
* @param products 秒杀商品
|
||||
* @param products 积分商品
|
||||
*/
|
||||
private void validateProductExists(Long spuId, List<PointProductSaveReqVO> products) {
|
||||
// 1. 校验商品 spu 是否存在
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.statistics.enums;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,7 +13,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum TimeRangeTypeEnum implements IntArrayValuable {
|
||||
public enum TimeRangeTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
/**
|
||||
* 天
|
||||
|
@ -33,7 +33,7 @@ public enum TimeRangeTypeEnum implements IntArrayValuable {
|
|||
YEAR(365),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(TimeRangeTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(TimeRangeTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 类型
|
||||
|
@ -41,7 +41,7 @@ public enum TimeRangeTypeEnum implements IntArrayValuable {
|
|||
private final Integer type;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ public interface ErrorCodeConstants {
|
|||
ErrorCode ORDER_CREATE_FAIL_EXIST_UNPAID = new ErrorCode(1_011_000_032, "交易订单创建失败,原因:存在未付款订单");
|
||||
ErrorCode ORDER_CANCEL_PAID_FAIL = new ErrorCode(1_011_000_033, "交易订单取消支付失败,原因:订单不是【{}】状态");
|
||||
ErrorCode ORDER_PICK_UP_FAIL_NOT_VERIFY_USER = new ErrorCode(1_011_000_034, "交易订单自提失败,原因:你没有核销该门店订单的权限");
|
||||
ErrorCode ORDER_CREATE_FAIL_INSUFFICIENT_USER_POINTS = new ErrorCode(1_011_000_035, "交易订单创建失败,原因:用户积分不足");
|
||||
|
||||
// ========== After Sale 模块 1-011-000-100 ==========
|
||||
ErrorCode AFTER_SALE_NOT_FOUND = new ErrorCode(1_011_000_100, "售后单不存在");
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.trade.enums.aftersale;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -18,7 +18,7 @@ import static cn.hutool.core.util.ArrayUtil.firstMatch;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum AfterSaleStatusEnum implements IntArrayValuable {
|
||||
public enum AfterSaleStatusEnum implements ArrayValuable<Integer> {
|
||||
|
||||
/**
|
||||
* 【申请售后】
|
||||
|
@ -54,7 +54,7 @@ public enum AfterSaleStatusEnum implements IntArrayValuable {
|
|||
SELLER_REFUSE(63,"卖家拒绝收货", "商家拒绝收货"), // 有赞的状态提示:商家拒绝收货,不同意退款
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(AfterSaleStatusEnum::getStatus).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(AfterSaleStatusEnum::getStatus).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 进行中的售后状态
|
||||
|
@ -84,7 +84,7 @@ public enum AfterSaleStatusEnum implements IntArrayValuable {
|
|||
private final String content;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.trade.enums.aftersale;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
|
@ -13,12 +13,12 @@ import java.util.Arrays;
|
|||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum AfterSaleTypeEnum implements IntArrayValuable {
|
||||
public enum AfterSaleTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
IN_SALE(10, "售中退款"), // 交易完成前买家申请退款
|
||||
AFTER_SALE(20, "售后退款"); // 交易完成后买家申请退款
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(AfterSaleTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(AfterSaleTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 类型
|
||||
|
@ -30,7 +30,7 @@ public enum AfterSaleTypeEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.trade.enums.aftersale;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
|
@ -13,12 +13,12 @@ import java.util.Arrays;
|
|||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum AfterSaleWayEnum implements IntArrayValuable {
|
||||
public enum AfterSaleWayEnum implements ArrayValuable<Integer> {
|
||||
|
||||
REFUND(10, "仅退款"),
|
||||
RETURN_AND_REFUND(20, "退货退款");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(AfterSaleWayEnum::getWay).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(AfterSaleWayEnum::getWay).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 方式
|
||||
|
@ -30,7 +30,7 @@ public enum AfterSaleWayEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.trade.enums.brokerage;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,7 +13,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum BrokerageBindModeEnum implements IntArrayValuable {
|
||||
public enum BrokerageBindModeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
/**
|
||||
* 只要用户没有推广人,随时都可以绑定分销关系
|
||||
|
@ -29,7 +29,7 @@ public enum BrokerageBindModeEnum implements IntArrayValuable {
|
|||
OVERRIDE(3, "覆盖绑定"),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BrokerageBindModeEnum::getMode).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BrokerageBindModeEnum::getMode).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 模式
|
||||
|
@ -41,7 +41,7 @@ public enum BrokerageBindModeEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.trade.enums.brokerage;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,7 +13,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum BrokerageEnabledConditionEnum implements IntArrayValuable {
|
||||
public enum BrokerageEnabledConditionEnum implements ArrayValuable<Integer> {
|
||||
|
||||
/**
|
||||
* 所有用户都可以分销
|
||||
|
@ -25,7 +25,7 @@ public enum BrokerageEnabledConditionEnum implements IntArrayValuable {
|
|||
ADMIN(2, "指定分销"),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BrokerageEnabledConditionEnum::getCondition).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BrokerageEnabledConditionEnum::getCondition).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 模式
|
||||
|
@ -37,7 +37,7 @@ public enum BrokerageEnabledConditionEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.trade.enums.brokerage;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,14 +13,14 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum BrokerageRecordBizTypeEnum implements IntArrayValuable {
|
||||
public enum BrokerageRecordBizTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
ORDER(1, "获得推广佣金", "获得推广佣金 {}", true),
|
||||
WITHDRAW(2, "提现申请", "提现申请扣除佣金 {}", false),
|
||||
WITHDRAW_REJECT(3, "提现申请驳回", "提现申请驳回,返还佣金 {}", true),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BrokerageRecordBizTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BrokerageRecordBizTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 类型
|
||||
|
@ -40,7 +40,7 @@ public enum BrokerageRecordBizTypeEnum implements IntArrayValuable {
|
|||
private final boolean add;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.trade.enums.brokerage;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,14 +13,14 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum BrokerageRecordStatusEnum implements IntArrayValuable {
|
||||
public enum BrokerageRecordStatusEnum implements ArrayValuable<Integer> {
|
||||
|
||||
WAIT_SETTLEMENT(0, "待结算"),
|
||||
SETTLEMENT(1, "已结算"),
|
||||
CANCEL(2, "已取消"),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BrokerageRecordStatusEnum::getStatus).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BrokerageRecordStatusEnum::getStatus).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 状态
|
||||
|
@ -32,7 +32,7 @@ public enum BrokerageRecordStatusEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.trade.enums.brokerage;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -14,7 +14,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum BrokerageWithdrawStatusEnum implements IntArrayValuable {
|
||||
public enum BrokerageWithdrawStatusEnum implements ArrayValuable<Integer> {
|
||||
|
||||
AUDITING(0, "审核中"),
|
||||
AUDIT_SUCCESS(10, "审核通过"),
|
||||
|
@ -23,7 +23,7 @@ public enum BrokerageWithdrawStatusEnum implements IntArrayValuable {
|
|||
WITHDRAW_FAIL(21, "提现失败"),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BrokerageWithdrawStatusEnum::getStatus).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BrokerageWithdrawStatusEnum::getStatus).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 状态
|
||||
|
@ -35,7 +35,7 @@ public enum BrokerageWithdrawStatusEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.trade.enums.brokerage;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,7 +13,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum BrokerageWithdrawTypeEnum implements IntArrayValuable {
|
||||
public enum BrokerageWithdrawTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
WALLET(1, "钱包"),
|
||||
BANK(2, "银行卡"),
|
||||
|
@ -22,7 +22,7 @@ public enum BrokerageWithdrawTypeEnum implements IntArrayValuable {
|
|||
WECHAT_API(5, "微信零钱"), // 自动打款,通过微信转账 API
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BrokerageWithdrawTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BrokerageWithdrawTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 类型
|
||||
|
@ -34,7 +34,7 @@ public enum BrokerageWithdrawTypeEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.iocoder.yudao.module.trade.enums.delivery;
|
||||
|
||||
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.Getter;
|
||||
|
||||
|
@ -14,13 +14,13 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum DeliveryExpressChargeModeEnum implements IntArrayValuable {
|
||||
public enum DeliveryExpressChargeModeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
COUNT(1, "按件"),
|
||||
WEIGHT(2,"按重量"),
|
||||
VOLUME(3, "按体积");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(DeliveryExpressChargeModeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(DeliveryExpressChargeModeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 类型
|
||||
|
@ -32,7 +32,7 @@ public enum DeliveryExpressChargeModeEnum implements IntArrayValuable {
|
|||
private final String desc;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.trade.enums.delivery;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,12 +13,12 @@ import java.util.Arrays;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum DeliveryTypeEnum implements IntArrayValuable {
|
||||
public enum DeliveryTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
EXPRESS(1, "快递发货"),
|
||||
PICK_UP(2, "用户自提"),;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(DeliveryTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(DeliveryTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 配送方式
|
||||
|
@ -30,7 +30,7 @@ public enum DeliveryTypeEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.trade.enums.order;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
|
@ -13,14 +13,14 @@ import java.util.Arrays;
|
|||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum TradeOrderCancelTypeEnum implements IntArrayValuable {
|
||||
public enum TradeOrderCancelTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
PAY_TIMEOUT(10, "超时未支付"),
|
||||
AFTER_SALE_CLOSE(20, "退款关闭"),
|
||||
MEMBER_CANCEL(30, "买家取消"),
|
||||
COMBINATION_CLOSE(40, "拼团关闭");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(TradeOrderCancelTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(TradeOrderCancelTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 关闭类型
|
||||
|
@ -32,7 +32,7 @@ public enum TradeOrderCancelTypeEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.iocoder.yudao.module.trade.enums.order;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
|
@ -14,13 +14,13 @@ import java.util.Arrays;
|
|||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum TradeOrderItemAfterSaleStatusEnum implements IntArrayValuable {
|
||||
public enum TradeOrderItemAfterSaleStatusEnum implements ArrayValuable<Integer> {
|
||||
|
||||
NONE(0, "未售后"),
|
||||
APPLY(10, "售后中"),
|
||||
SUCCESS(20, "售后成功");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(TradeOrderItemAfterSaleStatusEnum::getStatus).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(TradeOrderItemAfterSaleStatusEnum::getStatus).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 状态值
|
||||
|
@ -32,7 +32,7 @@ public enum TradeOrderItemAfterSaleStatusEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.trade.enums.order;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
|
@ -13,13 +13,13 @@ import java.util.Arrays;
|
|||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum TradeOrderRefundStatusEnum implements IntArrayValuable {
|
||||
public enum TradeOrderRefundStatusEnum implements ArrayValuable<Integer> {
|
||||
|
||||
NONE(0, "未退款"),
|
||||
PART(10, "部分退款"),
|
||||
ALL(20, "全部退款");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(TradeOrderRefundStatusEnum::getStatus).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(TradeOrderRefundStatusEnum::getStatus).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 状态值
|
||||
|
@ -31,7 +31,7 @@ public enum TradeOrderRefundStatusEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.iocoder.yudao.module.trade.enums.order;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.util.object.ObjectUtils;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
@ -15,7 +15,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum TradeOrderStatusEnum implements IntArrayValuable {
|
||||
public enum TradeOrderStatusEnum implements ArrayValuable<Integer> {
|
||||
|
||||
UNPAID(0, "待支付"),
|
||||
UNDELIVERED(10, "待发货"),
|
||||
|
@ -23,7 +23,7 @@ public enum TradeOrderStatusEnum implements IntArrayValuable {
|
|||
COMPLETED(30, "已完成"),
|
||||
CANCELED(40, "已取消");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(TradeOrderStatusEnum::getStatus).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(TradeOrderStatusEnum::getStatus).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 状态值
|
||||
|
@ -35,7 +35,7 @@ public enum TradeOrderStatusEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.iocoder.yudao.module.trade.enums.order;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
|
@ -14,7 +14,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum TradeOrderTypeEnum implements IntArrayValuable {
|
||||
public enum TradeOrderTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
NORMAL(0, "普通订单"),
|
||||
SECKILL(1, "秒杀订单"),
|
||||
|
@ -23,7 +23,7 @@ public enum TradeOrderTypeEnum implements IntArrayValuable {
|
|||
POINT(4, "积分商城"),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(TradeOrderTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(TradeOrderTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 类型
|
||||
|
@ -35,7 +35,7 @@ public enum TradeOrderTypeEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,23 +13,24 @@ import cn.iocoder.yudao.module.trade.enums.brokerage.BrokerageWithdrawStatusEnum
|
|||
import cn.iocoder.yudao.module.trade.service.brokerage.BrokerageRecordService;
|
||||
import cn.iocoder.yudao.module.trade.service.brokerage.BrokerageUserService;
|
||||
import cn.iocoder.yudao.module.trade.service.brokerage.BrokerageWithdrawService;
|
||||
import cn.iocoder.yudao.module.trade.service.brokerage.bo.UserBrokerageSummaryRespBO;
|
||||
import cn.iocoder.yudao.module.trade.service.brokerage.bo.BrokerageWithdrawSummaryRespBO;
|
||||
import cn.iocoder.yudao.module.trade.service.brokerage.bo.UserBrokerageSummaryRespBO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
@Tag(name = "管理后台 - 分销用户")
|
||||
@RestController
|
||||
|
@ -110,7 +111,7 @@ public class BrokerageUserController {
|
|||
// 合计分佣的提现
|
||||
// TODO @疯狂:如果未来支持了打款这个动作,可能 status 会不对;
|
||||
Map<Long, BrokerageWithdrawSummaryRespBO> withdrawMap = brokerageWithdrawService.getWithdrawSummaryMapByUserId(
|
||||
userIds, BrokerageWithdrawStatusEnum.AUDIT_SUCCESS);
|
||||
userIds, asList(BrokerageWithdrawStatusEnum.AUDIT_SUCCESS, BrokerageWithdrawStatusEnum.WITHDRAW_SUCCESS));
|
||||
// 拼接返回
|
||||
return success(BrokerageUserConvert.INSTANCE.convertPage(pageResult, userMap, brokerageUserCountMap,
|
||||
brokerageOrderSummaryMap, withdrawMap));
|
||||
|
|
|
@ -35,6 +35,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
@Tag(name = "用户 APP - 分销用户")
|
||||
@RestController
|
||||
|
@ -84,7 +85,7 @@ public class AppBrokerageUserController {
|
|||
BrokerageRecordBizTypeEnum.ORDER, BrokerageRecordStatusEnum.SETTLEMENT, beginTime, endTime);
|
||||
// 统计用户提现的佣金
|
||||
Integer withdrawPrice = brokerageWithdrawService.getWithdrawSummaryListByUserId(Collections.singleton(userId),
|
||||
BrokerageWithdrawStatusEnum.AUDIT_SUCCESS).stream()
|
||||
asList(BrokerageWithdrawStatusEnum.AUDIT_SUCCESS, BrokerageWithdrawStatusEnum.WITHDRAW_SUCCESS)).stream()
|
||||
.findFirst().map(BrokerageWithdrawSummaryRespBO::getPrice).orElse(0);
|
||||
// 统计分销用户数量(一级)
|
||||
Long firstBrokerageUserCount = brokerageUserService.getBrokerageUserCountByBindUserId(userId, 1);
|
||||
|
|
|
@ -41,13 +41,14 @@ public interface BrokerageWithdrawMapper extends BaseMapperX<BrokerageWithdrawDO
|
|||
.eq(BrokerageWithdrawDO::getStatus, status));
|
||||
}
|
||||
|
||||
default List<BrokerageWithdrawSummaryRespBO> selectCountAndSumPriceByUserIdAndStatus(Collection<Long> userIds, Integer status) {
|
||||
default List<BrokerageWithdrawSummaryRespBO> selectCountAndSumPriceByUserIdAndStatus(Collection<Long> userIds,
|
||||
Collection<Integer> status) {
|
||||
List<Map<String, Object>> list = selectMaps(new MPJLambdaWrapper<BrokerageWithdrawDO>()
|
||||
.select(BrokerageWithdrawDO::getUserId)
|
||||
.selectCount(BrokerageWithdrawDO::getId, BrokerageWithdrawSummaryRespBO::getCount)
|
||||
.selectSum(BrokerageWithdrawDO::getPrice)
|
||||
.in(BrokerageWithdrawDO::getUserId, userIds)
|
||||
.eq(BrokerageWithdrawDO::getStatus, status)
|
||||
.in(BrokerageWithdrawDO::getStatus, status)
|
||||
.groupBy(BrokerageWithdrawDO::getUserId));
|
||||
return BeanUtil.copyToList(list, BrokerageWithdrawSummaryRespBO.class);
|
||||
// selectJoinList有BUG,会与租户插件冲突:解析SQL时,发生异常 https://gitee.com/best_handsome/mybatis-plus-join/issues/I84GYW
|
||||
|
|
|
@ -7,6 +7,7 @@ import cn.iocoder.yudao.framework.mybatis.core.query.MPJLambdaWrapperX;
|
|||
import cn.iocoder.yudao.module.trade.controller.admin.order.vo.TradeOrderPageReqVO;
|
||||
import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderPageReqVO;
|
||||
import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderDO;
|
||||
import cn.iocoder.yudao.module.trade.enums.order.TradeOrderTypeEnum;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
@ -106,10 +107,22 @@ public interface TradeOrderMapper extends BaseMapperX<TradeOrderDO> {
|
|||
.eq(TradeOrderDO::getCommentStatus, commentStatus));
|
||||
}
|
||||
|
||||
default List<TradeOrderDO> selectListByUserIdAndSeckillActivityId(Long userId, Long seckillActivityId) {
|
||||
return selectList(new LambdaUpdateWrapper<>(TradeOrderDO.class)
|
||||
.eq(TradeOrderDO::getUserId, userId)
|
||||
.eq(TradeOrderDO::getSeckillActivityId, seckillActivityId));
|
||||
default List<TradeOrderDO> selectListByUserIdAndActivityId(Long userId, Long activityId, TradeOrderTypeEnum type) {
|
||||
LambdaQueryWrapperX<TradeOrderDO> queryWrapperX = new LambdaQueryWrapperX<>();
|
||||
queryWrapperX.eq(TradeOrderDO::getUserId, userId);
|
||||
if (TradeOrderTypeEnum.isSeckill(type.getType())) {
|
||||
queryWrapperX.eq(TradeOrderDO::getSeckillActivityId, activityId);
|
||||
}
|
||||
if (TradeOrderTypeEnum.isBargain(type.getType())) {
|
||||
queryWrapperX.eq(TradeOrderDO::getBargainActivityId, activityId);
|
||||
}
|
||||
if (TradeOrderTypeEnum.isCombination(type.getType())) {
|
||||
queryWrapperX.eq(TradeOrderDO::getCombinationActivityId, activityId);
|
||||
}
|
||||
if (TradeOrderTypeEnum.isPoint(type.getType())) {
|
||||
queryWrapperX.eq(TradeOrderDO::getPointActivityId, activityId);
|
||||
}
|
||||
return selectList(queryWrapperX);
|
||||
}
|
||||
|
||||
default TradeOrderDO selectOneByPickUpVerifyCode(String pickUpVerifyCode) {
|
||||
|
|
|
@ -74,7 +74,7 @@ public interface BrokerageWithdrawService {
|
|||
* @return 用户提现汇总 List
|
||||
*/
|
||||
List<BrokerageWithdrawSummaryRespBO> getWithdrawSummaryListByUserId(Collection<Long> userIds,
|
||||
BrokerageWithdrawStatusEnum status);
|
||||
Collection<BrokerageWithdrawStatusEnum> status);
|
||||
|
||||
/**
|
||||
* 按照 userId,汇总每个用户的提现
|
||||
|
@ -84,7 +84,7 @@ public interface BrokerageWithdrawService {
|
|||
* @return 用户提现汇总 Map
|
||||
*/
|
||||
default Map<Long, BrokerageWithdrawSummaryRespBO> getWithdrawSummaryMapByUserId(Set<Long> userIds,
|
||||
BrokerageWithdrawStatusEnum status) {
|
||||
Collection<BrokerageWithdrawStatusEnum> status) {
|
||||
return convertMap(getWithdrawSummaryListByUserId(userIds, status), BrokerageWithdrawSummaryRespBO::getUserId);
|
||||
}
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
||||
import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getClientIP;
|
||||
import static cn.iocoder.yudao.module.trade.enums.ErrorCodeConstants.*;
|
||||
|
||||
|
@ -98,7 +99,7 @@ public class BrokerageWithdrawServiceImpl implements BrokerageWithdrawService {
|
|||
// 3.1 审批通过的后续处理
|
||||
if (BrokerageWithdrawStatusEnum.AUDIT_SUCCESS.equals(status)) {
|
||||
auditBrokerageWithdrawSuccess(withdraw);
|
||||
// 3.2 审批不通过的后续处理
|
||||
// 3.2 审批不通过的后续处理
|
||||
} else if (BrokerageWithdrawStatusEnum.AUDIT_FAIL.equals(status)) {
|
||||
brokerageRecordService.addBrokerage(withdraw.getUserId(), BrokerageRecordBizTypeEnum.WITHDRAW_REJECT,
|
||||
String.valueOf(withdraw.getId()), withdraw.getPrice(), BrokerageRecordBizTypeEnum.WITHDRAW_REJECT.getTitle());
|
||||
|
@ -114,11 +115,11 @@ public class BrokerageWithdrawServiceImpl implements BrokerageWithdrawService {
|
|||
.setUserId(withdraw.getUserId()).setUserType(UserTypeEnum.MEMBER.getValue())
|
||||
.setBizType(PayWalletBizTypeEnum.BROKERAGE_WITHDRAW.getType()).setBizId(withdraw.getId().toString())
|
||||
.setPrice(withdraw.getPrice()));
|
||||
// 1.2 微信 API
|
||||
// 1.2 微信 API
|
||||
} else if (BrokerageWithdrawTypeEnum.WECHAT_API.getType().equals(withdraw.getType())) {
|
||||
// TODO @luchi:这里,要加个转账单号的记录;另外,调用 API 转账,是立马成功,还是有延迟的哈?
|
||||
Long payTransferId = createPayTransfer(withdraw);
|
||||
// 1.3 剩余类型,都是手动打款,所以不处理
|
||||
// 1.3 剩余类型,都是手动打款,所以不处理
|
||||
} else {
|
||||
// TODO 可优化:未来可以考虑,接入支付宝、银联等 API 转账,实现自动打款
|
||||
log.info("[auditBrokerageWithdrawSuccess][withdraw({}) 类型({}) 手动打款,无需处理]", withdraw.getId(), withdraw.getType());
|
||||
|
@ -239,11 +240,12 @@ public class BrokerageWithdrawServiceImpl implements BrokerageWithdrawService {
|
|||
|
||||
@Override
|
||||
public List<BrokerageWithdrawSummaryRespBO> getWithdrawSummaryListByUserId(Collection<Long> userIds,
|
||||
BrokerageWithdrawStatusEnum status) {
|
||||
if (CollUtil.isEmpty(userIds)) {
|
||||
Collection<BrokerageWithdrawStatusEnum> statuses) {
|
||||
if (CollUtil.isEmpty(userIds) || CollUtil.isEmpty(statuses)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return brokerageWithdrawMapper.selectCountAndSumPriceByUserIdAndStatus(userIds, status.getStatus());
|
||||
return brokerageWithdrawMapper.selectCountAndSumPriceByUserIdAndStatus(userIds,
|
||||
convertSet(statuses, BrokerageWithdrawStatusEnum::getStatus));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.trade.controller.admin.order.vo.TradeOrderSummary
|
|||
import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderPageReqVO;
|
||||
import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderDO;
|
||||
import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderItemDO;
|
||||
import cn.iocoder.yudao.module.trade.enums.order.TradeOrderTypeEnum;
|
||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.ExpressTrackRespDTO;
|
||||
|
||||
import java.util.Collection;
|
||||
|
@ -110,13 +111,14 @@ public interface TradeOrderQueryService {
|
|||
List<ExpressTrackRespDTO> getExpressTrackList(Long id);
|
||||
|
||||
/**
|
||||
* 【会员】在指定秒杀活动下,用户购买的商品数量
|
||||
* 【会员】在指定活动下,用户购买的商品数量
|
||||
*
|
||||
* @param userId 用户编号
|
||||
* @param activityId 活动编号
|
||||
* @return 秒杀商品数量
|
||||
* @param type 订单类型
|
||||
* @return 活动商品数量
|
||||
*/
|
||||
int getSeckillProductCount(Long userId, Long activityId);
|
||||
int getActivityProductCount(Long userId, Long activityId, TradeOrderTypeEnum type);
|
||||
|
||||
// =================== Order Item ===================
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ import cn.iocoder.yudao.module.trade.dal.mysql.order.TradeOrderMapper;
|
|||
import cn.iocoder.yudao.module.trade.dal.redis.RedisKeyConstants;
|
||||
import cn.iocoder.yudao.module.trade.enums.order.TradeOrderRefundStatusEnum;
|
||||
import cn.iocoder.yudao.module.trade.enums.order.TradeOrderStatusEnum;
|
||||
import cn.iocoder.yudao.module.trade.enums.order.TradeOrderTypeEnum;
|
||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.ExpressClientFactory;
|
||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.ExpressTrackQueryReqDTO;
|
||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.ExpressTrackRespDTO;
|
||||
|
@ -174,9 +175,9 @@ public class TradeOrderQueryServiceImpl implements TradeOrderQueryService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getSeckillProductCount(Long userId, Long activityId) {
|
||||
public int getActivityProductCount(Long userId, Long activityId, TradeOrderTypeEnum type) {
|
||||
// 获得订单列表
|
||||
List<TradeOrderDO> orders = tradeOrderMapper.selectListByUserIdAndSeckillActivityId(userId, activityId);
|
||||
List<TradeOrderDO> orders = tradeOrderMapper.selectListByUserIdAndActivityId(userId, activityId, type);
|
||||
orders.removeIf(order -> TradeOrderStatusEnum.isCanceled(order.getStatus())); // 过滤掉【已取消】的订单
|
||||
if (CollUtil.isEmpty(orders)) {
|
||||
return 0;
|
||||
|
|
|
@ -2,6 +2,8 @@ package cn.iocoder.yudao.module.trade.service.order.handler;
|
|||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
|
||||
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
|
||||
import cn.iocoder.yudao.module.promotion.api.point.PointActivityApi;
|
||||
import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderDO;
|
||||
import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderItemDO;
|
||||
|
@ -13,6 +15,9 @@ import org.springframework.stereotype.Component;
|
|||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.trade.enums.ErrorCodeConstants.ORDER_CREATE_FAIL_INSUFFICIENT_USER_POINTS;
|
||||
|
||||
/**
|
||||
* 积分商城活动订单的 {@link TradeOrderHandler} 实现类
|
||||
*
|
||||
|
@ -23,6 +28,8 @@ public class TradePointOrderHandler implements TradeOrderHandler {
|
|||
|
||||
@Resource
|
||||
private PointActivityApi pointActivityApi;
|
||||
@Resource
|
||||
private MemberUserApi memberUserApi;
|
||||
|
||||
@Override
|
||||
public void beforeOrderCreate(TradeOrderDO order, List<TradeOrderItemDO> orderItems) {
|
||||
|
@ -31,6 +38,11 @@ public class TradePointOrderHandler implements TradeOrderHandler {
|
|||
}
|
||||
// 明确校验一下
|
||||
Assert.isTrue(orderItems.size() == 1, "积分商城活动兑换商品兑换时,只允许选择一个商品");
|
||||
// 校验用户剩余积分是否足够兑换商品
|
||||
MemberUserRespDTO user = memberUserApi.getUser(order.getUserId());
|
||||
if (user.getPoint() < order.getUsePoint()) {
|
||||
throw exception(ORDER_CREATE_FAIL_INSUFFICIENT_USER_POINTS);
|
||||
}
|
||||
|
||||
// 扣减积分商城活动的库存
|
||||
pointActivityApi.updatePointStockDecr(order.getPointActivityId(),
|
||||
|
|
|
@ -56,36 +56,36 @@ public class TradePointActivityPriceCalculator implements TradePriceCalculator {
|
|||
Assert.isTrue(param.getItems().size() == 1, "积分商城兑换商品时,只允许选择一个商品");
|
||||
// 2. 校验是否可以参与积分商城活动
|
||||
TradePriceCalculateRespBO.OrderItem orderItem = result.getItems().get(0);
|
||||
PointValidateJoinRespDTO activity = validateJoinSeckill(
|
||||
PointValidateJoinRespDTO activity = validateJoinPointActivity(
|
||||
param.getUserId(), param.getPointActivityId(),
|
||||
orderItem.getSkuId(), orderItem.getCount());
|
||||
|
||||
// 3.1 记录优惠明细
|
||||
int discountPrice = orderItem.getPayPrice(); // 情况一:单使用积分兑换
|
||||
// 3.0 积分兑换前置校验
|
||||
Assert.isTrue(activity.getPoint() >= 1, "积分商城商品兑换积分必须大于 1");
|
||||
result.setUsePoint(activity.getPoint() * orderItem.getCount());
|
||||
orderItem.setUsePoint(activity.getPoint() * orderItem.getCount());
|
||||
// 3.1 记录优惠明细
|
||||
int usePoint = activity.getPoint() * orderItem.getCount();
|
||||
result.setUsePoint(usePoint);
|
||||
orderItem.setUsePoint(usePoint);
|
||||
int discountPrice = orderItem.getPayPrice(); // 情况一:单使用积分兑换
|
||||
if (activity.getPrice() != null && activity.getPrice() > 0) { // 情况二:积分 + 金额
|
||||
discountPrice = orderItem.getPayPrice() - activity.getPrice() * orderItem.getCount();
|
||||
}
|
||||
// 3.2 记录优惠明细
|
||||
TradePriceCalculatorHelper.addPromotion(result, orderItem,
|
||||
param.getPointActivityId(), "积分商城活动", PromotionTypeEnum.POINT.getType(),
|
||||
StrUtil.format("积分商城活动:省 {} 元", TradePriceCalculatorHelper.formatPrice(discountPrice)),
|
||||
discountPrice);
|
||||
|
||||
// 3.3 更新 SKU 优惠金额
|
||||
// 3.2 更新 SKU 优惠金额
|
||||
orderItem.setDiscountPrice(orderItem.getDiscountPrice() + discountPrice);
|
||||
TradePriceCalculatorHelper.recountPayPrice(orderItem);
|
||||
TradePriceCalculatorHelper.recountAllPrice(result);
|
||||
}
|
||||
|
||||
private PointValidateJoinRespDTO validateJoinSeckill(Long userId, Long activityId, Long skuId, Integer count) {
|
||||
private PointValidateJoinRespDTO validateJoinPointActivity(Long userId, Long activityId, Long skuId, Integer count) {
|
||||
// 1. 校验是否可以参与积分商城活动
|
||||
PointValidateJoinRespDTO pointValidateJoinRespDTO = pointActivityApi.validateJoinPointActivity(activityId, skuId, count);
|
||||
// 2. 校验总限购数量,目前只有 trade 有具体下单的数据,需要交给 trade 价格计算使用
|
||||
int activityProductCount = tradeOrderQueryService.getSeckillProductCount(userId, activityId);
|
||||
if (activityProductCount + count > pointValidateJoinRespDTO.getCount()) {
|
||||
int pointProductCount = tradeOrderQueryService.getActivityProductCount(userId, activityId, TradeOrderTypeEnum.POINT);
|
||||
if (pointProductCount + count > pointValidateJoinRespDTO.getCount()) {
|
||||
throw exception(PRICE_CALCULATE_POINT_TOTAL_LIMIT_COUNT);
|
||||
}
|
||||
return pointValidateJoinRespDTO;
|
||||
|
|
|
@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil;
|
|||
import cn.iocoder.yudao.module.promotion.api.seckill.SeckillActivityApi;
|
||||
import cn.iocoder.yudao.module.promotion.api.seckill.dto.SeckillValidateJoinRespDTO;
|
||||
import cn.iocoder.yudao.module.promotion.enums.common.PromotionTypeEnum;
|
||||
import cn.iocoder.yudao.module.trade.enums.order.TradeOrderTypeEnum;
|
||||
import cn.iocoder.yudao.module.trade.service.order.TradeOrderQueryService;
|
||||
import cn.iocoder.yudao.module.trade.service.price.bo.TradePriceCalculateReqBO;
|
||||
import cn.iocoder.yudao.module.trade.service.price.bo.TradePriceCalculateRespBO;
|
||||
|
@ -60,7 +61,7 @@ public class TradeSeckillActivityPriceCalculator implements TradePriceCalculator
|
|||
// 1. 校验是否可以参与秒杀
|
||||
SeckillValidateJoinRespDTO seckillActivity = seckillActivityApi.validateJoinSeckill(activityId, skuId, count);
|
||||
// 2. 校验总限购数量,目前只有 trade 有具体下单的数据,需要交给 trade 价格计算使用
|
||||
int seckillProductCount = tradeOrderQueryService.getSeckillProductCount(userId, activityId);
|
||||
int seckillProductCount = tradeOrderQueryService.getActivityProductCount(userId, activityId, TradeOrderTypeEnum.SECKILL);
|
||||
if (seckillProductCount + count > seckillActivity.getTotalLimitCount()) {
|
||||
throw exception(PRICE_CALCULATE_SECKILL_TOTAL_LIMIT_COUNT);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.iocoder.yudao.module.member.enums.point;
|
||||
|
||||
import cn.hutool.core.util.EnumUtil;
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -14,7 +14,7 @@ import java.util.Objects;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum MemberPointBizTypeEnum implements IntArrayValuable {
|
||||
public enum MemberPointBizTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
SIGN(1, "签到", "签到获得 {} 积分", true),
|
||||
ADMIN(2, "管理员修改", "管理员修改 {} 积分", true),
|
||||
|
@ -46,8 +46,8 @@ public enum MemberPointBizTypeEnum implements IntArrayValuable {
|
|||
private final boolean add;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return new int[0];
|
||||
public Integer[] array() {
|
||||
return new Integer[0];
|
||||
}
|
||||
|
||||
public static MemberPointBizTypeEnum getByType(Integer type) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.pay.enums.order;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.util.object.ObjectUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
@ -14,7 +14,7 @@ import java.util.Objects;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum PayOrderStatusEnum implements IntArrayValuable {
|
||||
public enum PayOrderStatusEnum implements ArrayValuable<Integer> {
|
||||
|
||||
WAITING(0, "未支付"),
|
||||
SUCCESS(10, "支付成功"),
|
||||
|
@ -26,8 +26,8 @@ public enum PayOrderStatusEnum implements IntArrayValuable {
|
|||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return new int[0];
|
||||
public Integer[] array() {
|
||||
return new Integer[0];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.iocoder.yudao.module.pay.enums.transfer;
|
||||
|
||||
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.Getter;
|
||||
|
||||
|
@ -14,7 +14,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum PayTransferTypeEnum implements IntArrayValuable {
|
||||
public enum PayTransferTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
ALIPAY_BALANCE(1, "支付宝余额"),
|
||||
WX_BALANCE(2, "微信余额"),
|
||||
|
@ -30,10 +30,10 @@ public enum PayTransferTypeEnum implements IntArrayValuable {
|
|||
private final Integer type;
|
||||
private final String name;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(PayTransferTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(PayTransferTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.pay.enums.wallet;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -13,7 +13,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum PayWalletBizTypeEnum implements IntArrayValuable {
|
||||
public enum PayWalletBizTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
RECHARGE(1, "充值"),
|
||||
RECHARGE_REFUND(2, "充值退款"),
|
||||
|
@ -31,10 +31,10 @@ public enum PayWalletBizTypeEnum implements IntArrayValuable {
|
|||
*/
|
||||
private final String description;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(PayWalletBizTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(PayWalletBizTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.iocoder.yudao.framework.pay.core.enums.transfer;
|
||||
|
||||
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.Getter;
|
||||
|
||||
|
@ -14,7 +14,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum PayTransferTypeEnum implements IntArrayValuable {
|
||||
public enum PayTransferTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
ALIPAY_BALANCE(1, "支付宝余额"),
|
||||
WX_BALANCE(2, "微信余额"),
|
||||
|
@ -30,10 +30,10 @@ public enum PayTransferTypeEnum implements IntArrayValuable {
|
|||
private final Integer type;
|
||||
private final String name;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(PayTransferTypeEnum::getType).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(PayTransferTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.system.enums.permission;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -15,7 +15,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum DataScopeEnum implements IntArrayValuable {
|
||||
public enum DataScopeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
ALL(1), // 全部数据权限
|
||||
|
||||
|
@ -30,10 +30,10 @@ public enum DataScopeEnum implements IntArrayValuable {
|
|||
*/
|
||||
private final Integer scope;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(DataScopeEnum::getScope).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(DataScopeEnum::getScope).toArray(Integer[]::new);
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.iocoder.yudao.module.system.enums.sms;
|
||||
|
||||
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.Getter;
|
||||
|
||||
|
@ -14,7 +14,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum SmsSceneEnum implements IntArrayValuable {
|
||||
public enum SmsSceneEnum implements ArrayValuable<Integer> {
|
||||
|
||||
MEMBER_LOGIN(1, "user-sms-login", "会员用户 - 手机号登陆"),
|
||||
MEMBER_UPDATE_MOBILE(2, "user-update-mobile", "会员用户 - 修改手机"),
|
||||
|
@ -25,7 +25,7 @@ public enum SmsSceneEnum implements IntArrayValuable {
|
|||
ADMIN_MEMBER_REGISTER(22, "admin-sms-register", "后台用户 - 手机号注册"),
|
||||
ADMIN_MEMBER_RESET_PASSWORD(23, "admin-reset-password", "后台用户 - 忘记密码");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(SmsSceneEnum::getScene).toArray();
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(SmsSceneEnum::getScene).toArray(Integer[]::new);
|
||||
|
||||
/**
|
||||
* 验证场景的编号
|
||||
|
@ -41,7 +41,7 @@ public enum SmsSceneEnum implements IntArrayValuable {
|
|||
private final String description;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue