新增订单添加修改商品状态的逻辑

This commit is contained in:
longbinbin
2024-12-06 16:58:49 +08:00
parent 90b2851092
commit 3bb091d06d
4 changed files with 132 additions and 29 deletions

View File

@ -426,7 +426,7 @@ public enum BizCodeEnum {
ADVANCE_PAYMENT_REFUND_FAILED(2003, "退款失败"),
ADVANCE_PAYMENT_CALLBACK_REFUND_FAILED(2004, "退款回调失败"),
REQUEST_WECHAT_FAIL(2005, "请求微信服务器发生异常"),
;
GOODS_NOT_EXIST(2006, "商品不存在");
BizCodeEnum(Integer code, String message) {

View File

@ -0,0 +1,69 @@
package com.ycwl.basic.enums;
import java.util.HashMap;
import java.util.Map;
/**
* @Authorlongbinbin
* @Date2024/12/6 16:46
*/
public enum GoodsTypeEnum {
VIDEO(1,"成片"),
SOURCE(2,"源素材")
;
public Integer code;
private String value;
public static final Map<Integer, GoodsTypeEnum> cacheMap;
static {
cacheMap = new HashMap<>(GoodsTypeEnum.values().length);
for (GoodsTypeEnum value : GoodsTypeEnum.values()) {
cacheMap.put(value.code, value);
}
}
public static final java.util.Map<String, GoodsTypeEnum> valueMap;
static {
valueMap = new HashMap<>(GoodsTypeEnum.values().length);
for (GoodsTypeEnum value : GoodsTypeEnum.values()) {
valueMap.put(value.value, value);
}
}
GoodsTypeEnum(Integer code, String value) {
this.code = code;
this.value = value;
}
/**
* 获取value值
*/
public static String getValue(Integer noticeMethod) {
if (noticeMethod == null) {
return null;
}
GoodsTypeEnum GoodsTypeEnum = cacheMap.get(noticeMethod);
if (GoodsTypeEnum == null) {
return null;
}
return GoodsTypeEnum.value;
}
/**
* 获取code值
*/
public static Integer getCode(String noticeMethod) {
if (noticeMethod == null) {
return -1;
}
GoodsTypeEnum GoodsTypeEnum = valueMap.get(noticeMethod);
if (GoodsTypeEnum == null) {
return -1;
}
return GoodsTypeEnum.code;
}
}