录单+价保
This commit is contained in:
@@ -289,13 +289,12 @@ public class JDUtil {
|
||||
|
||||
if (!priceProtectedOrders.isEmpty()) {
|
||||
//调用 orderUtil.orderToWx(orderRow, true);
|
||||
priceProtectedOrders.forEach(orderRow -> orderUtil.orderToWx(orderRow, true, true));
|
||||
//priceProtectedOrders.forEach(orderRow -> orderUtil.orderToWx(orderRow, true, true));
|
||||
// 可选:发送具体的订单信息给用户
|
||||
orderUtil.orderToWxBatch(priceProtectedOrders);
|
||||
orderUtil.orderToWxBatchForJB(priceProtectedOrders);
|
||||
} else {
|
||||
wxUtil.sendTextMessage(fromWxid, "没有找到符合条件的价保订单。", 1, fromWxid, false);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -221,20 +221,37 @@ public class OrderUtil {
|
||||
Long unionId = orderRow.getUnionId();
|
||||
String remarkFromJdid = getRemarkFromJdid(String.valueOf(unionId));
|
||||
StringBuilder orderInfo = new StringBuilder().append(" ").append(getEmjoy(orderRow.getValidCode())).append(" ").append(converter.getCodeDescription(orderRow.getValidCode())).append("\r");
|
||||
|
||||
//if (oldValidCode != -100 && !oldValidCode.equals(orderRow.getValidCode())) {
|
||||
// orderInfo.insert(0, "从 :" + getEmjoy(oldValidCode) + " "
|
||||
// + converter.getCodeDescription(oldValidCode) + "\r变成 "
|
||||
// + getEmjoy(orderRow.getValidCode()) + " "
|
||||
// + converter.getCodeDescription(orderRow.getValidCode()) + "\r\n");
|
||||
//}
|
||||
|
||||
orderInfo
|
||||
//+ "订单+sku:" + orderRow.getId() + "\r"
|
||||
.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()) : "未完成");
|
||||
|
||||
return orderInfo.toString();
|
||||
}
|
||||
/**
|
||||
* 手动调用 将订单发送到微信 批量
|
||||
*/
|
||||
@Async("threadPoolTaskExecutor")
|
||||
public void orderToWxBatchForJB(List<OrderRow> orderRowList) {
|
||||
if (!orderRowList.isEmpty()) {
|
||||
int i = 1;
|
||||
String wxId = getWxidFromJdid(orderRowList.get(0).getUnionId().toString());
|
||||
StringBuilder content = new StringBuilder();
|
||||
content.append("批量订单:\n\r ").append(" 共 ").append(orderRowList.size()).append("单 \r");
|
||||
List<OrderRow> filterList = orderRowList.stream().filter(orderRow -> orderRow.getValidCode() != 2 && orderRow.getValidCode() != 3).toList();
|
||||
content.append("移除 拆单或者取消 的订单, 共 ").append(filterList.size()).append("单: \n\r");
|
||||
for (OrderRow orderRow : filterList) {
|
||||
content.append("\r\n");
|
||||
content.append(i++).append("、");
|
||||
content.append(getFormattedOrderInfoBatchForJB(orderRow));
|
||||
|
||||
}
|
||||
if (Util.isNotEmpty(wxId)) {
|
||||
wxUtil.sendTextMessage(wxId, content.toString(), 1, wxId, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public String getEmjoy(Integer status) {
|
||||
@@ -263,19 +280,6 @@ public class OrderUtil {
|
||||
Long unionId = orderRow.getUnionId();
|
||||
String remarkFromJdid = getRemarkFromJdid(String.valueOf(unionId));
|
||||
|
||||
//+ "订单+sku:" + orderRow.getId() + "\r"
|
||||
//+ "商品单价:" + orderRow.getPrice() + "\r"
|
||||
//+ "商品数量:" + orderRow.getSkuNum() + "\r"
|
||||
//+ "商品总价:" + (orderRow.getPrice() * orderRow.getSkuNum()) + "\r"
|
||||
//+ "计佣金额:" + orderRow.getEstimateCosPrice() + "\r"
|
||||
//+ "金额:" + orderRow.getActualCosPrice() + "\r"
|
||||
//+ "比例:" + orderRow.getCommissionRate() + "\r"
|
||||
//if (oldValidCode != -100) {
|
||||
// if (!oldValidCode.equals(orderRow.getValidCode()))
|
||||
// orderInfo = "从 :" + (converter.getCodeDescription(oldValidCode)) + "\r变成 " +
|
||||
// (converter.getCodeDescription(orderRow.getValidCode())) + "\r\n" + orderInfo;
|
||||
//}
|
||||
|
||||
|
||||
return "订单:" + orderRow.getOrderId() + " (" + (orderRow.getPlus() == 1 ? "plus" : "非plus") + ")\r" + "走的京粉:" + remarkFromJdid + "\r"
|
||||
|
||||
@@ -293,6 +297,18 @@ public class OrderUtil {
|
||||
|
||||
+ "下单:" + formatter.format(orderRow.getOrderTime()) + "\r" + "完成:" + (orderRow.getFinishTime() != null ? formatter.format(orderRow.getFinishTime()) : "未完成") + "\r";
|
||||
}
|
||||
/**
|
||||
* 将数据库订单转化成微信所需要文本 简洁版
|
||||
*/
|
||||
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()) : "未完成");
|
||||
return orderInfo.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* JDUtil拷贝的方法,避免循环注入
|
||||
|
||||
Reference in New Issue
Block a user