This commit is contained in:
雷欧(林平凡)
2025-08-03 16:32:31 +08:00
parent dbf082ae0c
commit e335c1b484
2 changed files with 121 additions and 10 deletions

View File

@@ -0,0 +1,75 @@
package com.ruoyi.jarvis.enums;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author Leo
* @create 2024/11/9 下午3:08
* @description
*/
public class ValidCodeConverter {
private static final Map<Integer, String> codeDescriptions = new HashMap<>();
static {
codeDescriptions.put(-100, "无变化");
codeDescriptions.put(-1, "未知");
codeDescriptions.put(2, "无效-拆单");
codeDescriptions.put(3, "无效-取消");
codeDescriptions.put(4, "无效-京东帮帮主订单");
codeDescriptions.put(5, "无效-账号异常");
codeDescriptions.put(6, "无效-赠品类目不返佣");
codeDescriptions.put(7, "无效-校园订单");
codeDescriptions.put(8, "无效-企业订单");
codeDescriptions.put(9, "无效-团购订单");
codeDescriptions.put(11, "无效-乡村推广员下单");
codeDescriptions.put(13, "违规订单-其他");
codeDescriptions.put(14, "无效-来源与备案网址不符");
codeDescriptions.put(15, "待付款");
codeDescriptions.put(16, "已付款");
codeDescriptions.put(17, "已完成(购买用户确认收货)");
codeDescriptions.put(19, "无效-佣金比例为0");
codeDescriptions.put(20, "无效-此复购订单对应的首购订单无效");
codeDescriptions.put(21, "无效-云店订单");
codeDescriptions.put(22, "无效-PLUS会员佣金比例为0");
codeDescriptions.put(23, "无效-支付有礼");
codeDescriptions.put(24, "已付定金");
codeDescriptions.put(25, "违规订单-流量劫持");
codeDescriptions.put(26, "违规订单-流量异常");
codeDescriptions.put(27, "违规订单-违反京东平台规则");
codeDescriptions.put(28, "违规订单-多笔交易异常");
codeDescriptions.put(29, "无效-跨屏跨店");
codeDescriptions.put(30, "无效-累计件数超出类目上限");
codeDescriptions.put(31, "无效-黑名单sku");
codeDescriptions.put(33, "超市卡充值订单");
codeDescriptions.put(34, "无效-推卡订单无效");
}
/**
* 获取有效码所对应的描述
*
* @param code 有效码
* @return 对应的描述信息
*/
public String getCodeDescription(Integer code) {
return codeDescriptions.getOrDefault(code, "代码描述未定义");
}
/**
* 获取所有有效码选项
*
* @return 有效码选项列表
*/
public static List<Map<String, Object>> getAllValidCodeOptions() {
List<Map<String, Object>> options = new ArrayList<>();
for (Map.Entry<Integer, String> entry : codeDescriptions.entrySet()) {
Map<String, Object> option = new HashMap<>();
option.put("label", entry.getValue());
option.put("value", entry.getKey());
options.add(option);
}
return options;
}
}