parent
ec49751f25
commit
040a321b4e
@ -0,0 +1,69 @@
|
||||
package cn.iocoder.yudao.module.trade.api.order.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 订单信息 Response DTO
|
||||
*
|
||||
* @author HUIHUI
|
||||
*/
|
||||
@Schema(description = "RPC 服务 - 订单信息 Response DTO")
|
||||
@Data
|
||||
public class TradeOrderRespDTO {
|
||||
|
||||
// ========== 订单基本信息 ==========
|
||||
|
||||
@Schema(description = "订单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "订单流水号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1146347329394184195")
|
||||
private String no;
|
||||
|
||||
@Schema(description = "订单类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer type; // 参见 TradeOrderTypeEnum 枚举
|
||||
|
||||
@Schema(description = "订单来源", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer terminal; // 参见 TerminalEnum 枚举
|
||||
|
||||
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "用户 IP", requiredMode = Schema.RequiredMode.REQUIRED, example = "127.0.0.1")
|
||||
private String userIp;
|
||||
|
||||
@Schema(description = "用户备注", example = "这个商品不错哦")
|
||||
private String userRemark;
|
||||
|
||||
@Schema(description = "订单状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
|
||||
private Integer status; // 参见 TradeOrderStatusEnum 枚举
|
||||
|
||||
@Schema(description = "购买的商品数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||
private Integer productCount;
|
||||
|
||||
@Schema(description = "订单完成时间")
|
||||
private LocalDateTime finishTime;
|
||||
|
||||
@Schema(description = "订单取消时间")
|
||||
private LocalDateTime cancelTime;
|
||||
|
||||
@Schema(description = "取消类型", example = "1")
|
||||
private Integer cancelType; // 参见 TradeOrderCancelTypeEnum 枚举
|
||||
|
||||
@Schema(description = "商家备注", example = "这个用户很喜欢退货")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "是否评价", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
|
||||
private Boolean commentStatus;
|
||||
|
||||
// ========== 价格 + 支付基本信息 ==========
|
||||
|
||||
@Schema(description = "支付订单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
private Long payOrderId;
|
||||
|
||||
@Schema(description = "是否已支付", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
|
||||
private Boolean payStatus;
|
||||
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
package cn.iocoder.yudao.module.trade.api;
|
||||
@ -0,0 +1,12 @@
|
||||
package cn.iocoder.yudao.module.trade.enums;
|
||||
|
||||
/**
|
||||
* Trade 字典类型的枚举类
|
||||
*
|
||||
* @author owen
|
||||
*/
|
||||
public interface DictTypeConstants {
|
||||
|
||||
String BROKERAGE_WITHDRAW_STATUS = "brokerage_withdraw_status"; // 佣金提现状态
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package cn.iocoder.yudao.module.trade.enums;
|
||||
|
||||
// TODO @芋艿:枚举
|
||||
/**
|
||||
* 通知模板枚举类
|
||||
*
|
||||
* @author HUIHUI
|
||||
*/
|
||||
public interface MessageTemplateConstants {
|
||||
|
||||
String ORDER_DELIVERY = "order_delivery"; // 短信模版编号
|
||||
|
||||
String BROKERAGE_WITHDRAW_AUDIT_APPROVE = "brokerage_withdraw_audit_approve"; // 佣金提现(审核通过)
|
||||
String BROKERAGE_WITHDRAW_AUDIT_REJECT = "brokerage_withdraw_audit_reject"; // 佣金提现(审核不通过)
|
||||
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.trade.enums.aftersale;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* 售后操作类型的枚举
|
||||
*
|
||||
* @author 陈賝
|
||||
* @since 2023/6/13 13:53
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum AfterSaleOperateTypeEnum {
|
||||
|
||||
MEMBER_CREATE(10, "会员申请退款"),
|
||||
ADMIN_AGREE_APPLY(11, "商家同意退款"),
|
||||
ADMIN_DISAGREE_APPLY(12, "商家拒绝退款"),
|
||||
MEMBER_DELIVERY(20, "会员填写退货物流信息,快递公司:{deliveryName},快递单号:{logisticsNo}"),
|
||||
ADMIN_AGREE_RECEIVE(21, "商家收货"),
|
||||
ADMIN_DISAGREE_RECEIVE(22, "商家拒绝收货,原因:{reason}"),
|
||||
ADMIN_REFUND(30, "商家退款"),
|
||||
MEMBER_CANCEL(40, "会员取消退款"),
|
||||
;
|
||||
|
||||
/**
|
||||
* 操作类型
|
||||
*/
|
||||
private final Integer type;
|
||||
/**
|
||||
* 操作描述
|
||||
*/
|
||||
private final String content;
|
||||
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.trade.enums.aftersale;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 交易售后 - 类型
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum AfterSaleTypeEnum implements IntArrayValuable {
|
||||
|
||||
IN_SALE(10, "售中退款"), // 交易完成前买家申请退款
|
||||
AFTER_SALE(20, "售后退款"); // 交易完成后买家申请退款
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(AfterSaleTypeEnum::getType).toArray();
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private final Integer type;
|
||||
/**
|
||||
* 类型名
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.trade.enums.aftersale;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 交易售后 - 方式
|
||||
*
|
||||
* @author Sin
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum AfterSaleWayEnum implements IntArrayValuable {
|
||||
|
||||
REFUND(10, "仅退款"),
|
||||
RETURN_AND_REFUND(20, "退货退款");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(AfterSaleWayEnum::getWay).toArray();
|
||||
|
||||
/**
|
||||
* 方式
|
||||
*/
|
||||
private final Integer way;
|
||||
/**
|
||||
* 方式名
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package cn.iocoder.yudao.module.trade.enums.brokerage;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 分佣模式枚举
|
||||
*
|
||||
* @author owen
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum BrokerageEnabledConditionEnum implements IntArrayValuable {
|
||||
|
||||
/**
|
||||
* 所有用户都可以分销
|
||||
*/
|
||||
ALL(1, "人人分销"),
|
||||
/**
|
||||
* 仅可后台手动设置推广员
|
||||
*/
|
||||
ADMIN(2, "指定分销"),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BrokerageEnabledConditionEnum::getCondition).toArray();
|
||||
|
||||
/**
|
||||
* 模式
|
||||
*/
|
||||
private final Integer condition;
|
||||
/**
|
||||
* 名字
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.trade.enums.brokerage;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 佣金记录业务类型枚举
|
||||
*
|
||||
* @author owen
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum BrokerageRecordBizTypeEnum implements IntArrayValuable {
|
||||
|
||||
ORDER(1, "获得推广佣金", "获得推广佣金 {}", true),
|
||||
WITHDRAW(2, "提现申请", "提现申请扣除佣金 {}", false),
|
||||
WITHDRAW_REJECT(3, "提现申请驳回", "提现申请驳回,返还佣金 {}", true),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BrokerageRecordBizTypeEnum::getType).toArray();
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private final Integer type;
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private final String title;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private final String description;
|
||||
/**
|
||||
* 是否为增加佣金
|
||||
*/
|
||||
private final boolean add;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package cn.iocoder.yudao.module.trade.enums.brokerage;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 佣金记录状态枚举
|
||||
*
|
||||
* @author owen
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum BrokerageRecordStatusEnum implements IntArrayValuable {
|
||||
|
||||
WAIT_SETTLEMENT(0, "待结算"),
|
||||
SETTLEMENT(1, "已结算"),
|
||||
CANCEL(2, "已取消"),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BrokerageRecordStatusEnum::getStatus).toArray();
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private final Integer status;
|
||||
/**
|
||||
* 名字
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package cn.iocoder.yudao.module.trade.enums.brokerage;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
// TODO 芋艿:提现的打通,在纠结下;
|
||||
/**
|
||||
* 佣金提现状态枚举
|
||||
*
|
||||
* @author owen
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum BrokerageWithdrawStatusEnum implements IntArrayValuable {
|
||||
|
||||
AUDITING(0, "审核中"),
|
||||
AUDIT_SUCCESS(10, "审核通过"),
|
||||
WITHDRAW_SUCCESS(11, "提现成功"),
|
||||
AUDIT_FAIL(20, "审核不通过"),
|
||||
WITHDRAW_FAIL(21, "提现失败"),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BrokerageWithdrawStatusEnum::getStatus).toArray();
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private final Integer status;
|
||||
/**
|
||||
* 名字
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.trade.enums.brokerage;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 佣金提现类型枚举
|
||||
*
|
||||
* @author owen
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum BrokerageWithdrawTypeEnum implements IntArrayValuable {
|
||||
|
||||
WALLET(1, "钱包"),
|
||||
BANK(2, "银行卡"),
|
||||
WECHAT(3, "微信"),
|
||||
ALIPAY(4, "支付宝"),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BrokerageWithdrawTypeEnum::getType).toArray();
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private final Integer type;
|
||||
/**
|
||||
* 名字
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.trade.enums.delivery;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 快递配送计费方式枚举
|
||||
*
|
||||
* @author jason
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum DeliveryExpressChargeModeEnum implements IntArrayValuable {
|
||||
|
||||
COUNT(1, "按件"),
|
||||
WEIGHT(2,"按重量"),
|
||||
VOLUME(3, "按体积");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(DeliveryExpressChargeModeEnum::getType).toArray();
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private final Integer type;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
public static DeliveryExpressChargeModeEnum valueOf(Integer value) {
|
||||
return ArrayUtil.firstMatch(chargeMode -> chargeMode.getType().equals(value), DeliveryExpressChargeModeEnum.values());
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.trade.enums.delivery;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 配送方式枚举
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum DeliveryTypeEnum implements IntArrayValuable {
|
||||
|
||||
EXPRESS(1, "快递发货"),
|
||||
PICK_UP(2, "用户自提"),;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(DeliveryTypeEnum::getType).toArray();
|
||||
|
||||
/**
|
||||
* 配送方式
|
||||
*/
|
||||
private final Integer type;
|
||||
/**
|
||||
* 状态名
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
package cn.iocoder.yudao.module.trade.enums.notify;
|
||||
|
||||
// TODO @芋艿:这个枚举的作用?
|
||||
public interface TradeNotifyEnums {
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.trade.enums.order;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 交易订单 - 关闭类型
|
||||
*
|
||||
* @author Sin
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum TradeOrderCancelTypeEnum implements IntArrayValuable {
|
||||
|
||||
PAY_TIMEOUT(10, "超时未支付"),
|
||||
AFTER_SALE_CLOSE(20, "退款关闭"),
|
||||
MEMBER_CANCEL(30, "买家取消");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(TradeOrderCancelTypeEnum::getType).toArray();
|
||||
|
||||
/**
|
||||
* 关闭类型
|
||||
*/
|
||||
private final Integer type;
|
||||
/**
|
||||
* 关闭类型名
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package cn.iocoder.yudao.module.trade.enums.order;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* 订单操作类型的枚举
|
||||
*
|
||||
* @author 陈賝
|
||||
* @since 2023/7/6 15:31
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum TradeOrderOperateTypeEnum {
|
||||
|
||||
MEMBER_CREATE(1, "用户下单"),
|
||||
ADMIN_UPDATE_PRICE(2, "订单价格 {oldPayPrice} 修改,实际支付金额为 {newPayPrice} 元"),
|
||||
MEMBER_PAY(10, "用户付款成功"),
|
||||
ADMIN_UPDATE_ADDRESS(11, "收货地址修改"),
|
||||
ADMIN_DELIVERY(20, "已发货,快递公司:{deliveryName},快递单号:{logisticsNo}"),
|
||||
MEMBER_RECEIVE(30, "用户已收货"),
|
||||
SYSTEM_RECEIVE(31, "到期未收货,系统自动确认收货"),
|
||||
ADMIN_PICK_UP_RECEIVE(32, "管理员自提收货"),
|
||||
MEMBER_COMMENT(33, "用户评价"),
|
||||
SYSTEM_COMMENT(34, "到期未评价,系统自动评价"),
|
||||
MEMBER_CANCEL(40, "取消订单"),
|
||||
SYSTEM_CANCEL(41, "到期未支付,系统自动取消订单"),
|
||||
// 42 预留:管理员取消订单
|
||||
ADMIN_CANCEL_AFTER_SALE(43, "订单全部售后,管理员自动取消订单"),
|
||||
MEMBER_DELETE(49, "删除订单"),
|
||||
;
|
||||
|
||||
/**
|
||||
* 操作类型
|
||||
*/
|
||||
private final Integer type;
|
||||
/**
|
||||
* 操作描述
|
||||
*/
|
||||
private final String content;
|
||||
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.trade.enums.order;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 交易订单 - 退款状态
|
||||
*
|
||||
* @author Sin
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum TradeOrderRefundStatusEnum implements IntArrayValuable {
|
||||
|
||||
NONE(0, "未退款"),
|
||||
PART(10, "部分退款"),
|
||||
ALL(20, "全部退款");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(TradeOrderRefundStatusEnum::getStatus).toArray();
|
||||
|
||||
/**
|
||||
* 状态值
|
||||
*/
|
||||
private final Integer status;
|
||||
/**
|
||||
* 状态名
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
package cn.iocoder.yudao.module.trade.enums.order;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 交易订单 - 类型
|
||||
*
|
||||
* @author Sin
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum TradeOrderTypeEnum implements IntArrayValuable {
|
||||
|
||||
NORMAL(0, "普通订单"),
|
||||
SECKILL(1, "秒杀订单"),
|
||||
BARGAIN(2, "砍价订单"),
|
||||
COMBINATION(3, "拼团订单"),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(TradeOrderTypeEnum::getType).toArray();
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private final Integer type;
|
||||
/**
|
||||
* 类型名
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
public static boolean isNormal(Integer type) {
|
||||
return ObjectUtil.equal(type, NORMAL.getType());
|
||||
}
|
||||
|
||||
public static boolean isSeckill(Integer type) {
|
||||
return ObjectUtil.equal(type, SECKILL.getType());
|
||||
}
|
||||
|
||||
public static boolean isBargain(Integer type) {
|
||||
return ObjectUtil.equal(type, BARGAIN.getType());
|
||||
}
|
||||
|
||||
public static boolean isCombination(Integer type) {
|
||||
return ObjectUtil.equal(type, COMBINATION.getType());
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in new issue