This commit is contained in:
雷欧(林平凡)
2024-12-02 11:44:58 +08:00
parent dbbd1de26d
commit d2f1c977b4
2 changed files with 13 additions and 11 deletions

View File

@@ -29,6 +29,7 @@ public class OrderUtil {
private WXUtil wxUtil; private WXUtil wxUtil;
//标记唯一订单行:订单+sku维度的唯一标识 //标记唯一订单行:订单+sku维度的唯一标识
private static final String ORDER_ROW_KEY = "jd:order:row:"; private static final String ORDER_ROW_KEY = "jd:order:row:";
/** /**
* 手动调用 将订单发送到微信 * 手动调用 将订单发送到微信
*/ */
@@ -52,6 +53,7 @@ public class OrderUtil {
redisTemplate.opsForValue().set(ORDER_ROW_KEY + orderRow.getId(), String.valueOf(orderRow.getValidCode())); redisTemplate.opsForValue().set(ORDER_ROW_KEY + orderRow.getId(), String.valueOf(orderRow.getValidCode()));
} }
/** /**
* 将数据库订单转化成微信所需要文本 * 将数据库订单转化成微信所需要文本
*/ */
@@ -60,25 +62,25 @@ public class OrderUtil {
ValidCodeConverter converter = new ValidCodeConverter(); ValidCodeConverter converter = new ValidCodeConverter();
String orderInfo = String orderInfo =
//+ "订单+sku" + orderRow.getId() + "\r" //+ "订单+sku" + orderRow.getId() + "\r"
"订单" + orderRow.getOrderId() + " (" + (orderRow.getPlus() == 1 ? "plus" : "非plus") + ")\r" + "订单:" + orderRow.getOrderId() + " (" + (orderRow.getPlus() == 1 ? "plus" : "非plus") + ")\r" +
"最新订单状态:" + (converter.getCodeDescription(orderRow.getValidCode())) + "\r" "状态:" + (converter.getCodeDescription(orderRow.getValidCode())) + "\r"
+"商品名称:" + orderRow.getSkuName() + "\r" + "名称:" + orderRow.getSkuName() + "\r"
//+ "商品单价:" + orderRow.getPrice() + "\r" //+ "商品单价:" + orderRow.getPrice() + "\r"
//+ "商品数量:" + orderRow.getSkuNum() + "\r" //+ "商品数量:" + orderRow.getSkuNum() + "\r"
//+ "商品总价:" + (orderRow.getPrice() * orderRow.getSkuNum()) + "\r" //+ "商品总价:" + (orderRow.getPrice() * orderRow.getSkuNum()) + "\r"
//+ "预估计佣金额:" + orderRow.getEstimateCosPrice() + "\n" //+ "预估计佣金额:" + orderRow.getEstimateCosPrice() + "\n"
+ "实际计算佣金的金额:" + orderRow.getActualCosPrice() + "\r" + "金额:" + orderRow.getActualCosPrice() + "\r"
+ "佣金比例:" + orderRow.getCommissionRate() + "%\r" + "比例:" + orderRow.getCommissionRate() + "%\r"
+ "推客的预估佣金:" + orderRow.getEstimateFee() + "\r\n" + "佣金:" + orderRow.getEstimateFee() + "\r\n"
+ "下单时间" + 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";
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\n" + orderInfo;
} }

View File

@@ -102,7 +102,7 @@ public class WXUtil {
//logger.info("发送文本消息 msgType: {} wxid: {} fromwxid: {} content: {}", msgType, wxid, fromwxid, content); //logger.info("发送文本消息 msgType: {} wxid: {} fromwxid: {} content: {}", msgType, wxid, fromwxid, content);
// 先在content顶部插入时间戳 // 先在content顶部插入时间戳
// 因为引入了消息队列,所以在每条消息都加上时间戳 格式化成 yyyy-MM-dd HH:mm:ss // 因为引入了消息队列,所以在每条消息都加上时间戳 格式化成 yyyy-MM-dd HH:mm:ss
content = "[ " + DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss") + " ] \r" + content; content = "[ " + DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss") + " ] \r\n" + content;
// 如果是自己的微信,所有信息都加上少爷 // 如果是自己的微信,所有信息都加上少爷
//if (wxid.equals(super_admin_wxid) || fromwxid.equals(super_admin_wxid)) { //if (wxid.equals(super_admin_wxid) || fromwxid.equals(super_admin_wxid)) {