1
This commit is contained in:
@@ -288,7 +288,7 @@ public class JDUtils {
|
|||||||
|| orderRow.getValidCode() == 2).mapToDouble(orderRow -> orderRow.getEstimateCosPrice() * orderRow.getCommissionRate() * 0.01).sum());
|
|| orderRow.getValidCode() == 2).mapToDouble(orderRow -> orderRow.getEstimateCosPrice() * orderRow.getCommissionRate() * 0.01).sum());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "一个月统计":{
|
case "一个月统计": {
|
||||||
List<OrderRow> last30DaysOrders = filterOrdersByDate(orderRows, 30);
|
List<OrderRow> last30DaysOrders = filterOrdersByDate(orderRows, 30);
|
||||||
content.append("一个月统计:");
|
content.append("一个月统计:");
|
||||||
content.append("订单总数:").append(last30DaysOrders.size()).append("\r");
|
content.append("订单总数:").append(last30DaysOrders.size()).append("\r");
|
||||||
@@ -305,7 +305,7 @@ public class JDUtils {
|
|||||||
|| orderRow.getValidCode() == 2).mapToDouble(orderRow -> orderRow.getEstimateCosPrice() * orderRow.getCommissionRate() * 0.01).sum());
|
|| orderRow.getValidCode() == 2).mapToDouble(orderRow -> orderRow.getEstimateCosPrice() * orderRow.getCommissionRate() * 0.01).sum());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "两个月统计":{
|
case "两个月统计": {
|
||||||
List<OrderRow> last60DaysOrders = filterOrdersByDate(orderRows, 60);
|
List<OrderRow> last60DaysOrders = filterOrdersByDate(orderRows, 60);
|
||||||
content.append("两个月统计:");
|
content.append("两个月统计:");
|
||||||
content.append("订单总数:").append(last60DaysOrders.size()).append("\r");
|
content.append("订单总数:").append(last60DaysOrders.size()).append("\r");
|
||||||
@@ -322,7 +322,7 @@ public class JDUtils {
|
|||||||
|| orderRow.getValidCode() == 2).mapToDouble(orderRow -> orderRow.getEstimateCosPrice() * orderRow.getCommissionRate() * 0.01).sum());
|
|| orderRow.getValidCode() == 2).mapToDouble(orderRow -> orderRow.getEstimateCosPrice() * orderRow.getCommissionRate() * 0.01).sum());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "三个月统计":{
|
case "三个月统计": {
|
||||||
List<OrderRow> last90DaysOrders = filterOrdersByDate(orderRows, 90);
|
List<OrderRow> last90DaysOrders = filterOrdersByDate(orderRows, 90);
|
||||||
content.append("订单总数:").append(last90DaysOrders.size()).append("\r");
|
content.append("订单总数:").append(last90DaysOrders.size()).append("\r");
|
||||||
content.append("已付款:").append(last90DaysOrders.stream().filter(orderRow -> orderRow.getValidCode() == 16).count()).append("\r");
|
content.append("已付款:").append(last90DaysOrders.stream().filter(orderRow -> orderRow.getValidCode() == 16).count()).append("\r");
|
||||||
@@ -432,7 +432,7 @@ public class JDUtils {
|
|||||||
.sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).collect(Collectors.toList());
|
.sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).collect(Collectors.toList());
|
||||||
Integer num = 0;
|
Integer num = 0;
|
||||||
for (Map.Entry<String, Long> entry : sortedViolationCounts) {
|
for (Map.Entry<String, Long> entry : sortedViolationCounts) {
|
||||||
num ++;
|
num++;
|
||||||
String skuName = entry.getKey();
|
String skuName = entry.getKey();
|
||||||
Long count = entry.getValue();
|
Long count = entry.getValue();
|
||||||
content.append(num + ",商品:").append(skuName).append(" 违规次数:").append(count).append("\r");
|
content.append(num + ",商品:").append(skuName).append(" 违规次数:").append(count).append("\r");
|
||||||
@@ -481,20 +481,22 @@ public class JDUtils {
|
|||||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
ValidCodeConverter converter = new ValidCodeConverter();
|
ValidCodeConverter converter = new ValidCodeConverter();
|
||||||
String orderInfo =
|
String orderInfo =
|
||||||
|
//+ "订单+sku:" + orderRow.getId() + "\r"
|
||||||
|
"订单号:" + orderRow.getOrderId() + "(" + (orderRow.getPlus() == 1 ? "plus" : "非plus") + ")\r" +
|
||||||
|
|
||||||
|
"最新订单状态:" + (converter.getCodeDescription(orderRow.getValidCode())) + "\r" +
|
||||||
|
|
||||||
"商品名称:" + orderRow.getSkuName() + "\r"
|
"商品名称:" + orderRow.getSkuName() + "\r"
|
||||||
+ "订单+sku:" + orderRow.getId() + "\r"
|
|
||||||
+ "订单号:" + orderRow.getOrderId() + "(" + (orderRow.getPlus() == 1 ? "plus" : "非plus") + ")\r"
|
|
||||||
+ "佣金比例:" + orderRow.getCommissionRate() + "%\r\r"
|
|
||||||
+ "商品单价:" + orderRow.getPrice() + "\r"
|
+ "商品单价:" + orderRow.getPrice() + "\r"
|
||||||
+ "商品数量:" + orderRow.getSkuNum() + "\r"
|
+ "商品数量:" + orderRow.getSkuNum() + "\r"
|
||||||
+ "商品总价:" + (orderRow.getPrice() * orderRow.getSkuNum()) + "\r"
|
+ "商品总价:" + (orderRow.getPrice() * orderRow.getSkuNum()) + "\r"
|
||||||
+ "订单总价:" + (orderRow.getActualCosPrice() * orderRow.getSkuNum()) + "\r"
|
|
||||||
+ "预估计佣金额:" + orderRow.getEstimateCosPrice() + "\n"
|
+ "预估计佣金额:" + orderRow.getEstimateCosPrice() + "\n"
|
||||||
|
|
||||||
|
+ "佣金比例:" + orderRow.getCommissionRate() + "%\r\r"
|
||||||
+ "推客的预估佣金:" + orderRow.getEstimateFee() + "\r"
|
+ "推客的预估佣金:" + orderRow.getEstimateFee() + "\r"
|
||||||
+ "实际计算佣金的金额:" + orderRow.getActualCosPrice() + "\r"
|
+ "实际计算佣金的金额:" + orderRow.getActualCosPrice() + "\r"
|
||||||
+ "下单时间:" + formatter.format(orderRow.getOrderTime()) + "\r"
|
+ "下单时间:" + formatter.format(orderRow.getOrderTime()) + "\r"
|
||||||
+ "完成时间:" + (orderRow.getFinishTime() != null ? formatter.format(orderRow.getFinishTime()) : "未完成") + "\r\n"
|
+ "完成时间:" + (orderRow.getFinishTime() != null ? formatter.format(orderRow.getFinishTime()) : "未完成") + "\r\n";
|
||||||
+ "最新订单状态:" + (converter.getCodeDescription(orderRow.getValidCode())) + "\r";
|
|
||||||
if (oldValidCode != -100) {
|
if (oldValidCode != -100) {
|
||||||
orderInfo = "订单状态从 :" + (converter.getCodeDescription(oldValidCode)) + " --变成-- " +
|
orderInfo = "订单状态从 :" + (converter.getCodeDescription(oldValidCode)) + " --变成-- " +
|
||||||
(converter.getCodeDescription(orderRow.getValidCode())) + "\r" + orderInfo;
|
(converter.getCodeDescription(orderRow.getValidCode())) + "\r" + orderInfo;
|
||||||
@@ -606,7 +608,7 @@ public class JDUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 拉取历史订单 2880 次请求
|
// 拉取历史订单 2880 次请求
|
||||||
@Scheduled(cron = "0 0 8,12,20,0 * * ?")
|
@Scheduled(cron = "0 0 * * * ?")
|
||||||
public void fetchHistoricalOrders() throws Exception {
|
public void fetchHistoricalOrders() throws Exception {
|
||||||
// 从设定的开始日期到昨天的同一时间
|
// 从设定的开始日期到昨天的同一时间
|
||||||
System.out.println("开始拉取历史订单");
|
System.out.println("开始拉取历史订单");
|
||||||
|
|||||||
Reference in New Issue
Block a user