完成基本京粉功能推送,订单统计,订单拉取的稳定版初版
This commit is contained in:
94
src/main/java/cn/van/business/enums/EventType.java
Normal file
94
src/main/java/cn/van/business/enums/EventType.java
Normal file
@@ -0,0 +1,94 @@
|
||||
package cn.van.business.enums;
|
||||
|
||||
/**
|
||||
* @author Leo
|
||||
* @version 1.0
|
||||
* @create 2023/12/19 0019 上午 10:27
|
||||
* @description:
|
||||
*/
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public enum EventType implements IEnum {
|
||||
// New Events
|
||||
INJECTED_SUCCESS(10000, "注入成功"),
|
||||
ACCOUNT_CHANGED(10014, "账号变动事件"),
|
||||
GROUP_MESSAGE_RECEIVED(10008, "收到群聊消息"),
|
||||
PRIVATE_MESSAGE_RECEIVED(10009, "收到私聊消息"),
|
||||
OWN_MESSAGE_SENT(10010, "自己发出消息"),
|
||||
TRANSFER_EVENT(10006, "转账事件"),
|
||||
REVOKE_EVENT(10013, "撤回事件"),
|
||||
FRIEND_REQUEST(10011, "好友请求"),
|
||||
PAYMENT_EVENT(10007, "支付事件"),
|
||||
AUTH_EXPIRED(99999, "授权到期"),
|
||||
QR_CODE_PAYMENT_RECEIVED(10015, "二维码收款事件"),
|
||||
GROUP_MEMBER_CHANGED(10016, "群成员变动事件");
|
||||
private final int key;
|
||||
|
||||
private final String name;
|
||||
|
||||
EventType(int key, String name) {
|
||||
this.key = key;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static EventType get(int key) {
|
||||
for (EventType e : EventType.values()) {
|
||||
if (e.getKey() == key) {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getName(Integer key) {
|
||||
//if (Object.isNotEmpty(key)) {
|
||||
EventType[] items = EventType.values();
|
||||
for (EventType item : items) {
|
||||
if (item.getKey() == key) {
|
||||
return item.getName();
|
||||
}
|
||||
}
|
||||
//}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static Map<String, String> getKeyValue() {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
EventType[] items = EventType.values();
|
||||
for (EventType item : items) {
|
||||
map.put(item.getKey() + "", item.getName());
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public static List<Map<String, Object>> getSelectItems() {
|
||||
List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
|
||||
EventType[] items = EventType.values();
|
||||
for (EventType item : items) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("label", item.getName());
|
||||
map.put("value", item.getKey());
|
||||
result.add(map);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonValue
|
||||
public Integer getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
87
src/main/java/cn/van/business/enums/FromType.java
Normal file
87
src/main/java/cn/van/business/enums/FromType.java
Normal file
@@ -0,0 +1,87 @@
|
||||
package cn.van.business.enums;
|
||||
|
||||
/**
|
||||
* @author Leo
|
||||
* @version 1.0
|
||||
* @create 2023/12/19 0019 上午 10:27
|
||||
* @description:
|
||||
*/
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public enum FromType implements IEnum {
|
||||
/**
|
||||
* fromType 来源类型:1|私聊 2|群聊 3|公众号
|
||||
*/
|
||||
PRIVATE(10009, "私聊"),
|
||||
GROUP(10008, "群聊"),
|
||||
MP(3, "公众号");
|
||||
private final int key;
|
||||
|
||||
private final String name;
|
||||
|
||||
FromType(int key, String name) {
|
||||
this.key = key;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static FromType get(int key) {
|
||||
for (FromType e : FromType.values()) {
|
||||
if (e.getKey() == key) {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getName(Integer key) {
|
||||
//if (Object.isNotEmpty(key)) {
|
||||
FromType[] items = FromType.values();
|
||||
for (FromType item : items) {
|
||||
if (item.getKey() == key) {
|
||||
return item.getName();
|
||||
}
|
||||
}
|
||||
//}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static Map<String, String> getKeyVlue() {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
FromType[] items = FromType.values();
|
||||
for (FromType item : items) {
|
||||
map.put(item.getKey() + "", item.getName());
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public static List<Map<String, Object>> getSelectItems() {
|
||||
List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
|
||||
FromType[] items = FromType.values();
|
||||
for (FromType item : items) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("label", item.getName());
|
||||
map.put("value", item.getKey());
|
||||
result.add(map);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonValue
|
||||
public Integer getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
14
src/main/java/cn/van/business/enums/IEnum.java
Normal file
14
src/main/java/cn/van/business/enums/IEnum.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package cn.van.business.enums;
|
||||
|
||||
/**
|
||||
* @author Leo
|
||||
* @version 1.0
|
||||
* @create 2023/12/19 0019 上午 10:33
|
||||
* @description:
|
||||
*/
|
||||
public interface IEnum {
|
||||
|
||||
Integer getKey();
|
||||
|
||||
String getName();
|
||||
}
|
||||
14
src/main/java/cn/van/business/enums/IEnumForString.java
Normal file
14
src/main/java/cn/van/business/enums/IEnumForString.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package cn.van.business.enums;
|
||||
|
||||
/**
|
||||
* @author Leo
|
||||
* @version 1.0
|
||||
* @create 2023/12/19 0019 上午 10:33
|
||||
* @description:
|
||||
*/
|
||||
public interface IEnumForString {
|
||||
|
||||
String getKey();
|
||||
|
||||
String getName();
|
||||
}
|
||||
94
src/main/java/cn/van/business/enums/JdOrderType.java
Normal file
94
src/main/java/cn/van/business/enums/JdOrderType.java
Normal file
@@ -0,0 +1,94 @@
|
||||
package cn.van.business.enums;
|
||||
|
||||
/**
|
||||
* @author Leo
|
||||
* @version 1.0
|
||||
* @create 2023/12/19 0019 上午 10:27
|
||||
* @description:
|
||||
*/
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public enum JdOrderType implements IEnum {
|
||||
// New Events
|
||||
INJECTED_SUCCESS(10000, "注入成功"),
|
||||
ACCOUNT_CHANGED(10014, "账号变动事件"),
|
||||
GROUP_MESSAGE_RECEIVED(10008, "收到群聊消息"),
|
||||
PRIVATE_MESSAGE_RECEIVED(10009, "收到私聊消息"),
|
||||
OWN_MESSAGE_SENT(10010, "自己发出消息"),
|
||||
TRANSFER_EVENT(10006, "转账事件"),
|
||||
REVOKE_EVENT(10013, "撤回事件"),
|
||||
FRIEND_REQUEST(10011, "好友请求"),
|
||||
PAYMENT_EVENT(10007, "支付事件"),
|
||||
AUTH_EXPIRED(99999, "授权到期"),
|
||||
QR_CODE_PAYMENT_RECEIVED(10015, "二维码收款事件"),
|
||||
GROUP_MEMBER_CHANGED(10016, "群成员变动事件");
|
||||
private final int key;
|
||||
|
||||
private final String name;
|
||||
|
||||
JdOrderType(int key, String name) {
|
||||
this.key = key;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static JdOrderType get(int key) {
|
||||
for (JdOrderType e : JdOrderType.values()) {
|
||||
if (e.getKey() == key) {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getName(Integer key) {
|
||||
//if (Object.isNotEmpty(key)) {
|
||||
JdOrderType[] items = JdOrderType.values();
|
||||
for (JdOrderType item : items) {
|
||||
if (item.getKey() == key) {
|
||||
return item.getName();
|
||||
}
|
||||
}
|
||||
//}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static Map<String, String> getKeyValue() {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
JdOrderType[] items = JdOrderType.values();
|
||||
for (JdOrderType item : items) {
|
||||
map.put(item.getKey() + "", item.getName());
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public static List<Map<String, Object>> getSelectItems() {
|
||||
List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
|
||||
JdOrderType[] items = JdOrderType.values();
|
||||
for (JdOrderType item : items) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("label", item.getName());
|
||||
map.put("value", item.getKey());
|
||||
result.add(map);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonValue
|
||||
public Integer getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
91
src/main/java/cn/van/business/enums/MsgTypeEnum.java
Normal file
91
src/main/java/cn/van/business/enums/MsgTypeEnum.java
Normal file
@@ -0,0 +1,91 @@
|
||||
package cn.van.business.enums;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Leo
|
||||
* @version 1.0
|
||||
* @create 2023/12/19 0019 下午 02:31
|
||||
* @description:
|
||||
*/
|
||||
public enum MsgTypeEnum implements IEnum {
|
||||
/**
|
||||
msgType :
|
||||
1|文本 3|图片 34|语音
|
||||
42|名片 43|视频 47|动态表情
|
||||
48|地理位置 49|分享链接或附件 2001|红包
|
||||
2002|小程序 2003|群邀请 10000|系统消息 * */
|
||||
TEXT(1, "文本"),
|
||||
IMAGE(3, "图片"),
|
||||
VOICE(34, "语音"),
|
||||
ANIMATION(47, "动态表情"),
|
||||
//名片 42
|
||||
CARD(42, "名片"),
|
||||
|
||||
|
||||
VIDEO(43, "视频"),
|
||||
SHARE(49, "分享链接或附件"),
|
||||
LOCATION(48, "位置"),
|
||||
REDPACKET(2001, "红包"),
|
||||
MINIPROGRAM(2002, "小程序"),
|
||||
GROUP_INVITE(2003, "群邀请"),
|
||||
SYSTEM(10000, "系统消息"),
|
||||
;
|
||||
private final int key;
|
||||
|
||||
private final String name;
|
||||
|
||||
MsgTypeEnum(int key, String name) {
|
||||
this.key = key;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static String getName(Integer key) {
|
||||
for (MsgTypeEnum msgTypeEnum : MsgTypeEnum.values()) {
|
||||
if (msgTypeEnum.key == key) {
|
||||
return msgTypeEnum.name;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Map<String, String> getKeyVlue() {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
for (MsgTypeEnum msgTypeEnum : MsgTypeEnum.values()) {
|
||||
map.put(msgTypeEnum.key + "", msgTypeEnum.name);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public static List<Map<String, Object>> getSelectItems() {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (MsgTypeEnum msgTypeEnum : MsgTypeEnum.values()) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("key", msgTypeEnum.key);
|
||||
map.put("value", msgTypeEnum.name);
|
||||
list.add(map);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static MsgTypeEnum get(int key) {
|
||||
for (MsgTypeEnum msgTypeEnum : MsgTypeEnum.values()) {
|
||||
if (msgTypeEnum.key == key) {
|
||||
return msgTypeEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Integer getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
||||
57
src/main/java/cn/van/business/enums/ValidCodeConverter.java
Normal file
57
src/main/java/cn/van/business/enums/ValidCodeConverter.java
Normal file
@@ -0,0 +1,57 @@
|
||||
package cn.van.business.enums;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Leo
|
||||
* @version 1.0
|
||||
* @create 2024/11/9 下午3:08
|
||||
* @description:
|
||||
*/
|
||||
public class ValidCodeConverter {
|
||||
private static final Map<Integer, String> codeDescriptions = new HashMap<>();
|
||||
|
||||
static {
|
||||
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, "代码描述未定义");
|
||||
}
|
||||
}
|
||||
129
src/main/java/cn/van/business/enums/WXReqType.java
Normal file
129
src/main/java/cn/van/business/enums/WXReqType.java
Normal file
@@ -0,0 +1,129 @@
|
||||
package cn.van.business.enums;
|
||||
|
||||
/**
|
||||
* @author Leo
|
||||
* @version 1.0
|
||||
* @create 2023/12/19 0019 上午 10:27
|
||||
* @description:
|
||||
*/
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public enum WXReqType {
|
||||
/**
|
||||
* * 获取微信列表 (X0000)
|
||||
* * 微信状态检测(Q0000)
|
||||
* * 发送文本消息(Q0001)
|
||||
* * 修改下载图片 (Q0002)
|
||||
* * 获取个人信息 (Q0003)
|
||||
* * 查询对象信(Q0004)
|
||||
* * 获取好友列表(Q0005)
|
||||
* * 获取群聊列表(Q0006)
|
||||
* * 获取公众号列表(Q0007)
|
||||
* * 获取群成员列表(Q0008)
|
||||
* * 发送聊天记录(Q0009)
|
||||
* * 发送图片 (Q0010)
|
||||
* * 发送本地文件(Q0011)
|
||||
* * 发送分享链接(Q0012)
|
||||
* * 发送小程序(Q0013)
|
||||
* * 发送音乐分享(Q0014)
|
||||
* * 发送XML (Q0015)
|
||||
* * 确认收款 (Q0016)
|
||||
* * 同意好友请求(Q0017)
|
||||
* * 添加好友通过v3(Q0018)
|
||||
* * 添加好友_通过wxid (Q0019)
|
||||
* * 查询陌生人信息(Q0020)
|
||||
* * 邀请进群(Q0021)
|
||||
* * 删除好友(Q0022)
|
||||
* * 修改对象备注(Q0023)
|
||||
* * 修改群聊名称(Q0024)
|
||||
* * 发送名片(Q0025)
|
||||
*/
|
||||
GET_WX_LIST("getWeChatList", "获取微信列表"),
|
||||
GET_WX_STATUS("checkWeChat", "微信状态检测"),
|
||||
SEND_TEXT_MESSAGE("sendText", "发送文本消息"),
|
||||
UPDATE_DOWNLOAD_IMAGE("Q0002", "修改下载图片"),
|
||||
GET_USER_INFO("Q0003", "获取个人信息"),
|
||||
QUERY_OBJECT_INFO("Q0004", "查询对象信"),
|
||||
GET_FRIEND_LIST("Q0005", "获取好友列表"),
|
||||
GET_GROUP_LIST("Q0006", "获取群聊列表"),
|
||||
GET_MP_LIST("Q0007", "获取公众号列表"),
|
||||
GET_GROUP_MEMBER_LIST("Q0008", "获取群成员列表"),
|
||||
SEND_CHAT_RECORD("Q0009", "发送聊天记录"),
|
||||
SEND_IMAGE("Q0010", "发送图片"),
|
||||
SEND_LOCAL_FILE("Q0011", "发送本地文件"),
|
||||
SEND_SHARE_LINK("Q0012", "发送分享链接"),
|
||||
SEND_MINIPROGRAM("Q0013", "发送小程序"),
|
||||
SEND_MUSIC_SHARE("Q0014", "发送音乐分享"),
|
||||
SEND_XML("Q0015", "发送XML"),
|
||||
CONFIRM_RECEIPT("Q0016", "确认收款"),
|
||||
AGREE_FRIEND_REQUEST("Q0017", "同意好友请求"),
|
||||
ADD_FRIEND_V3("Q0018", "添加好友通过v3"),
|
||||
ADD_FRIEND_WXID("Q0019", "添加好友_通过wxid"),
|
||||
QUERY_STRANGER_INFO("Q0020", "查询陌生人信息"),
|
||||
INVITE_GROUP("Q0021", "邀请进群"),
|
||||
DELETE_FRIEND("Q0022", "删除好友"),
|
||||
MODIFY_OBJECT_REMARK("Q0023", "修改对象备注"),
|
||||
MODIFY_GROUP_NAME("Q0024", "修改群聊名称");
|
||||
private final String type;
|
||||
|
||||
@Getter
|
||||
private final String name;
|
||||
|
||||
WXReqType(String type, String name) {
|
||||
this.type = type;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static WXReqType get(String key) {
|
||||
for (WXReqType e : WXReqType.values()) {
|
||||
if (Objects.equals(e.getType(), key)) {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getName(String key) {
|
||||
//if (Object.isNotEmpty(key)) {
|
||||
WXReqType[] items = WXReqType.values();
|
||||
for (WXReqType item : items) {
|
||||
if (Objects.equals(item.getType(), key)) {
|
||||
return item.getName();
|
||||
}
|
||||
}
|
||||
//}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static Map<String, String> getKeyVlue() {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
WXReqType[] items = WXReqType.values();
|
||||
for (WXReqType item : items) {
|
||||
map.put(item.getType() + "", item.getName());
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public static List<Map<String, Object>> getSelectItems() {
|
||||
List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
|
||||
WXReqType[] items = WXReqType.values();
|
||||
for (WXReqType item : items) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("label", item.getName());
|
||||
map.put("value", item.getType());
|
||||
result.add(map);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user