This commit is contained in:
Van0313
2025-06-19 00:11:59 +08:00
parent 97e62eda54
commit 6105e963fa

View File

@@ -132,6 +132,7 @@ public class JDUtil {
//京粉链接 //京粉链接
private final HashMap<String, String> productWithJF = new HashMap<>(); private final HashMap<String, String> productWithJF = new HashMap<>();
// 构造函数中注入StringRedisTemplate // 构造函数中注入StringRedisTemplate
@Autowired @Autowired
public JDUtil(JDOrderRepository jdOrderRepository, StringRedisTemplate redisTemplate, OrderRowRepository orderRowRepository, WXUtil wxUtil, OrderUtil orderUtil, DeepSeekClientUtil deepSeekClientUtil, CommentRepository commentRepository, GPTClientUtil gptClientUtil) { public JDUtil(JDOrderRepository jdOrderRepository, StringRedisTemplate redisTemplate, OrderRowRepository orderRowRepository, WXUtil wxUtil, OrderUtil orderUtil, DeepSeekClientUtil deepSeekClientUtil, CommentRepository commentRepository, GPTClientUtil gptClientUtil) {
@@ -145,6 +146,7 @@ public class JDUtil {
this.gptClientUtil = gptClientUtil; this.gptClientUtil = gptClientUtil;
handleProductWithJF(); handleProductWithJF();
} }
private void handleProductWithJF() { private void handleProductWithJF() {
productWithJF.put("ZQD130F-EB130", "https://u.jd.com/3GPePLu"); productWithJF.put("ZQD130F-EB130", "https://u.jd.com/3GPePLu");
productWithJF.put("ZQD130F-EB130B", "https://u.jd.com/3gPeGf6"); productWithJF.put("ZQD130F-EB130B", "https://u.jd.com/3gPeGf6");
@@ -978,6 +980,7 @@ public class JDUtil {
cacheMap.remove("finalWenAn" + wxid); cacheMap.remove("finalWenAn" + wxid);
} }
} }
/* /*
将礼金信息写入 Redis **/ 将礼金信息写入 Redis **/
public void saveGiftCouponToRedis(String skuId, String giftKey, String skuName, String owner) { public void saveGiftCouponToRedis(String skuId, String giftKey, String skuName, String owner) {
@@ -994,6 +997,7 @@ public class JDUtil {
// 存入 Redis Hash // 存入 Redis Hash
redisTemplate.opsForHash().put(key, hashKey, JSON.toJSONString(data)); redisTemplate.opsForHash().put(key, hashKey, JSON.toJSONString(data));
} }
/** /**
* 处理用户输入的推广方案内容 * 处理用户输入的推广方案内容
* *
@@ -2169,7 +2173,8 @@ public class JDUtil {
// 发送详细订单列表 // 发送详细订单列表
StringBuilder detailBuilder = new StringBuilder(); StringBuilder detailBuilder = new StringBuilder();
for (JDOrder order : sortedOrders) { for (JDOrder order : sortedOrders) {
detailBuilder.append("单:").append(order.getRemark() != null ? order.getRemark() : "未提供").append("\n型号").append(order.getModelNumber() != null ? order.getModelNumber() : "未提供").append("\n下单付款").append(order.getPaymentAmount() != null ? String.format("%.2f", order.getPaymentAmount()) : "0.00").append("").append("\n后返金额").append(order.getRebateAmount() != null ? String.format("%.2f", order.getRebateAmount()) : "0.00").append("").append("\n地址").append(order.getAddress() != null ? order.getAddress() : "未提供").append("\n物流链接\n").append(order.getLogisticsLink() != null ? order.getLogisticsLink() : "").append("\n────────────\n"); detailBuilder.append("单:").append(order.getRemark() != null ? order.getRemark() : "未提供")
.append("\n备注").append(order.getStatus() != null ? order.getStatus() : " ").append("\n型号").append(order.getModelNumber() != null ? order.getModelNumber() : "未提供").append("\n下单付款").append(order.getPaymentAmount() != null ? String.format("%.2f", order.getPaymentAmount()) : "0.00").append("").append("\n后返金额").append(order.getRebateAmount() != null ? String.format("%.2f", order.getRebateAmount()) : "0.00").append("").append("\n地址").append(order.getAddress() != null ? order.getAddress() : "未提供").append("\n物流链接\n").append(order.getLogisticsLink() != null ? order.getLogisticsLink() : "").append("\n────────────\n");
} }
// 发送详细订单消息 // 发送详细订单消息
@@ -2206,7 +2211,7 @@ public class JDUtil {
} }
} }
batchSb.append(jdOrder.getRemark()).append("\t").append(jdOrder.getOrderId()).append("\t").append(DateUtil.dateToStr(jdOrder.getOrderTime(), "yyyy-MM-dd")).append("\t").append(jdOrder.getModelNumber()).append("\t").append(jdOrder.getAddress()).append("\t").append(jdOrder.getLogisticsLink()).append("\t\t").append(jdOrder.getBuyer()).append("\t").append(jdOrder.getPaymentAmount()).append("\t").append(jdOrder.getRebateAmount()).append("\t").append(distributionMark2).append("\n"); batchSb.append(jdOrder.getRemark()).append("\t").append(jdOrder.getOrderId()).append("\t").append(DateUtil.dateToStr(jdOrder.getOrderTime(), "yyyy-MM-dd")).append("\t").append(jdOrder.getModelNumber()).append("\t").append(jdOrder.getAddress()).append("\t").append(jdOrder.getLogisticsLink()).append("\t\t").append(jdOrder.getBuyer()).append("\t").append(jdOrder.getPaymentAmount()).append("\t").append(jdOrder.getRebateAmount()).append("\t").append(distributionMark2).append("\t").append(jdOrder.getStatus()).append("\n");
} }
// 发送每批次的订单信息 // 发送每批次的订单信息