This commit is contained in:
雷欧(林平凡)
2025-05-29 17:13:59 +08:00
parent 5a02bdaedd
commit e216f2f686
2 changed files with 30 additions and 22 deletions

View File

@@ -280,23 +280,6 @@ public class JDUtil {
//
//contents.add(content);
break;
case "价保": {
// 获取过去30天内的订单
List<OrderRow> last30DaysOrders = filterOrdersByDate(orderRows, 30);
// 过滤出 proPriceAmount 大于 0 的订单
List<OrderRow> priceProtectedOrders = last30DaysOrders.stream().filter(orderRow -> orderRow.getProPriceAmount() > 0).collect(Collectors.toList());
if (!priceProtectedOrders.isEmpty()) {
//调用 orderUtil.orderToWx(orderRow, true);
//priceProtectedOrders.forEach(orderRow -> orderUtil.orderToWx(orderRow, true, true));
// 可选:发送具体的订单信息给用户
orderUtil.orderToWxBatchForJB(priceProtectedOrders);
} else {
wxUtil.sendTextMessage(fromWxid, "没有找到符合条件的价保订单。", 1, fromWxid, false);
}
break;
}
case "今日统计": {
// 订单总数,已付款,已取消,佣金总计
@@ -442,6 +425,34 @@ public class JDUtil {
if (order.startsWith("高级")) {
content = new StringBuilder();
order = order.replace("高级", "");
if (order.startsWith("价保")) {
String search;
if (order.length() > 2) {
search = order.substring(2);
} else {
search = null;
}
// 获取过去30天内的订单
List<OrderRow> last30DaysOrders = filterOrdersByDate(orderRows, 30);
// 过滤出 proPriceAmount 大于 0 的订单
List<OrderRow> priceProtectedOrders = last30DaysOrders.stream().filter(orderRow -> {
if (search != null) {
return orderRow.getProPriceAmount() > 0 && orderRow.getSkuName().contains(search);
}
return false;
}).collect(Collectors.toList());
if (!priceProtectedOrders.isEmpty()) {
//调用 orderUtil.orderToWx(orderRow, true);
//priceProtectedOrders.forEach(orderRow -> orderUtil.orderToWx(orderRow, true, true));
// 可选:发送具体的订单信息给用户
orderUtil.orderToWxBatchForJB(priceProtectedOrders);
} else {
wxUtil.sendTextMessage(fromWxid, "没有找到符合条件的价保订单。", 1, fromWxid, false);
}
}
if (order.startsWith("违规")) {
String days = order.replace("违规", "");
Integer daysInt = 365;

View File

@@ -302,11 +302,8 @@ public class OrderUtil {
*/
public String getFormattedOrderInfoBatchForJB(OrderRow orderRow) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
ValidCodeConverter converter = new ValidCodeConverter();
Long unionId = orderRow.getUnionId();
String remarkFromJdid = getRemarkFromJdid(String.valueOf(unionId));
StringBuilder orderInfo = new StringBuilder().append("价保了:").append(orderRow.getProPriceAmount()).append("\n").append(" ").append(getEmjoy(orderRow.getValidCode())).append(" ").append(converter.getCodeDescription(orderRow.getValidCode())).append("\r");
orderInfo.append("京粉:").append(remarkFromJdid).append("\r").append("订单:").append(orderRow.getOrderId()).append(" (").append(orderRow.getPlus() == 1 ? "plus" : "非plus").append(")\r").append("名称:").append(orderRow.getSkuName()).append("\r").append("\r").append("下单:").append(formatter.format(orderRow.getOrderTime())).append("\r").append("完成:").append(orderRow.getFinishTime() != null ? formatter.format(orderRow.getFinishTime()) : "未完成");
StringBuilder orderInfo = new StringBuilder().append("\n").append("价保了:").append(orderRow.getProPriceAmount()).append("\n");
orderInfo.append("订单:").append(orderRow.getOrderId()).append(" (").append(orderRow.getPlus() == 1 ? "plus" : "非plus").append(")\r").append("名称:").append(orderRow.getSkuName()).append("\r").append("\r").append("下单:").append(formatter.format(orderRow.getOrderTime())).append("\r").append("完成:").append(orderRow.getFinishTime() != null ? formatter.format(orderRow.getFinishTime()) : "未完成");
return orderInfo.toString();
}