1
This commit is contained in:
@@ -1,7 +1,11 @@
|
|||||||
package cn.van.business.enums;
|
package cn.van.business.enums;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Leo
|
* @author Leo
|
||||||
@@ -11,6 +15,11 @@ import java.util.Map;
|
|||||||
public class ValidCodeConverter {
|
public class ValidCodeConverter {
|
||||||
private static final Map<Integer, String> codeDescriptions = new HashMap<>();
|
private static final Map<Integer, String> codeDescriptions = new HashMap<>();
|
||||||
|
|
||||||
|
/** 违规订单 validCode(13、25-28、36-43) */
|
||||||
|
public static final Set<Integer> ILLEGAL_CODES = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(
|
||||||
|
13, 25, 26, 27, 28, 36, 37, 38, 39, 40, 41, 42, 43
|
||||||
|
)));
|
||||||
|
|
||||||
static {
|
static {
|
||||||
codeDescriptions.put(-100, "无变化");
|
codeDescriptions.put(-100, "无变化");
|
||||||
codeDescriptions.put(-1, "未知");
|
codeDescriptions.put(-1, "未知");
|
||||||
@@ -43,6 +52,20 @@ public class ValidCodeConverter {
|
|||||||
codeDescriptions.put(31, "无效-黑名单sku");
|
codeDescriptions.put(31, "无效-黑名单sku");
|
||||||
codeDescriptions.put(33, "超市卡充值订单");
|
codeDescriptions.put(33, "超市卡充值订单");
|
||||||
codeDescriptions.put(34, "无效-推卡订单无效");
|
codeDescriptions.put(34, "无效-推卡订单无效");
|
||||||
|
codeDescriptions.put(35, "无效-非CID订单");
|
||||||
|
codeDescriptions.put(36, "违规订单-账户绑定有误");
|
||||||
|
codeDescriptions.put(37, "违规订单-利用京东域内流量推广");
|
||||||
|
codeDescriptions.put(38, "违规订单-利用短信形式推广");
|
||||||
|
codeDescriptions.put(39, "违规订单-推广京东首页");
|
||||||
|
codeDescriptions.put(40, "违规订单-refer与备案信息不符");
|
||||||
|
codeDescriptions.put(41, "违规订单-用户交易异常");
|
||||||
|
codeDescriptions.put(42, "违规订单-批量下单");
|
||||||
|
codeDescriptions.put(43, "违规订单-超过类目上限");
|
||||||
|
codeDescriptions.put(44, "不计佣订单");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isIllegal(Integer code) {
|
||||||
|
return code != null && ILLEGAL_CODES.contains(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package cn.van.business.util;
|
|||||||
|
|
||||||
import cn.hutool.http.HttpRequest;
|
import cn.hutool.http.HttpRequest;
|
||||||
import cn.hutool.http.HttpResponse;
|
import cn.hutool.http.HttpResponse;
|
||||||
|
import cn.van.business.enums.ValidCodeConverter;
|
||||||
import cn.van.business.model.cj.XbMessage;
|
import cn.van.business.model.cj.XbMessage;
|
||||||
import cn.van.business.model.cj.XbMessageItem;
|
import cn.van.business.model.cj.XbMessageItem;
|
||||||
import cn.van.business.model.jd.JDOrder;
|
import cn.van.business.model.jd.JDOrder;
|
||||||
@@ -224,7 +225,7 @@ public class JDUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Stream<OrderRow> getStreamForWeiGui(List<OrderRow> todayOrders) {
|
private Stream<OrderRow> getStreamForWeiGui(List<OrderRow> todayOrders) {
|
||||||
return todayOrders.stream().filter(orderRow -> orderRow.getValidCode() == 13 || orderRow.getValidCode() == 25 || orderRow.getValidCode() == 26 || orderRow.getValidCode() == 27 || orderRow.getValidCode() == 28 || orderRow.getValidCode() == 29);
|
return todayOrders.stream().filter(orderRow -> ValidCodeConverter.isIllegal(orderRow.getValidCode()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package cn.van.business.util;
|
package cn.van.business.util;
|
||||||
|
|
||||||
|
import cn.van.business.enums.ValidCodeConverter;
|
||||||
import cn.van.business.model.jd.OrderRow;
|
import cn.van.business.model.jd.OrderRow;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@@ -62,14 +63,7 @@ public class OrderStatsUtil {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取违规订单流
|
|
||||||
private static Stream<OrderRow> getStreamForWeiGui(List<OrderRow> orderRows) {
|
private static Stream<OrderRow> getStreamForWeiGui(List<OrderRow> orderRows) {
|
||||||
return orderRows.stream().filter(orderRow ->
|
return orderRows.stream().filter(orderRow -> ValidCodeConverter.isIllegal(orderRow.getValidCode()));
|
||||||
orderRow.getValidCode() == 13 ||
|
|
||||||
orderRow.getValidCode() == 25 ||
|
|
||||||
orderRow.getValidCode() == 26 ||
|
|
||||||
orderRow.getValidCode() == 27 ||
|
|
||||||
orderRow.getValidCode() == 28 ||
|
|
||||||
orderRow.getValidCode() == 29);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ public class OrderUtil {
|
|||||||
if (Util.isNotEmpty(wxId)) {
|
if (Util.isNotEmpty(wxId)) {
|
||||||
wxUtil.sendTextMessage(wxId, content, 1, wxId, true, touser);
|
wxUtil.sendTextMessage(wxId, content, 1, wxId, true, touser);
|
||||||
// 不是已完成,不是违规的才发送
|
// 不是已完成,不是违规的才发送
|
||||||
if (newValidCode != 17 && newValidCode != 25 && newValidCode != 26 && newValidCode != 27 && newValidCode != 28) {
|
if (newValidCode != 17 && !ValidCodeConverter.isIllegal(newValidCode)) {
|
||||||
// 发送今日统计信息
|
// 发送今日统计信息
|
||||||
sendDailyStats(wxId);
|
sendDailyStats(wxId);
|
||||||
}
|
}
|
||||||
@@ -369,7 +369,7 @@ public class OrderUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Stream<OrderRow> getStreamForWeiGui(List<OrderRow> todayOrders) {
|
private Stream<OrderRow> getStreamForWeiGui(List<OrderRow> todayOrders) {
|
||||||
return todayOrders.stream().filter(orderRow -> orderRow.getValidCode() == 13 || orderRow.getValidCode() == 25 || orderRow.getValidCode() == 26 || orderRow.getValidCode() == 27 || orderRow.getValidCode() == 28 || orderRow.getValidCode() == 29);
|
return todayOrders.stream().filter(orderRow -> ValidCodeConverter.isIllegal(orderRow.getValidCode()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 统计指标DTO
|
// 统计指标DTO
|
||||||
|
|||||||
Reference in New Issue
Block a user