From 35d33220697854e622c6e3d39c18ce9ef2537320 Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期一, 08 九月 2025 17:02:45 +0800
Subject: [PATCH] 初始化用户行为分析

---
 framework/src/main/java/cn/lili/modules/order/order/serviceimpl/OrderServiceImpl.java |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/OrderServiceImpl.java b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/OrderServiceImpl.java
index bcf11bf..dfe3ded 100644
--- a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/OrderServiceImpl.java
+++ b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/OrderServiceImpl.java
@@ -71,6 +71,7 @@
 import cn.lili.trigger.util.DelayQueueTools;
 import cn.lili.utils.COSUtil;
 import cn.lili.utils.CommonUtil;
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -98,6 +99,7 @@
 import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletResponse;
 import java.io.InputStream;
+import java.math.BigDecimal;
 import java.net.URLEncoder;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
@@ -263,7 +265,7 @@
         List<OrderSimpleVO> list =  this.baseMapper.queryByParamsCount(queryWrapper);
         OrderCountVO orderCountVO = new OrderCountVO();
         orderCountVO.setOrderNumCount(0);
-        orderCountVO.setOrderPriceCount(0.0);
+        orderCountVO.setOrderPriceCount(BigDecimal.ZERO);
         if (CollectionUtil.isEmpty(list)) {
             return orderCountVO;
         }else {
@@ -273,9 +275,14 @@
                     continue; // 璺宠繃null鍏冪礌锛屾垨鏍规嵁涓氬姟澶勭悊
                 }
                 orderCountVO.setOrderNumCount(orderCountVO.getOrderNumCount() + 1);
-                Double flowPrice = vo.getFlowPrice() != null ? vo.getFlowPrice() : 0.0;
 
-                orderCountVO.setOrderPriceCount(orderCountVO.getOrderPriceCount() + flowPrice);;
+                // 閲戦绱姞锛氱敤BigDecimal澶勭悊锛岄伩鍏嶇簿搴﹂棶棰�
+                BigDecimal flowPrice = vo.getFlowPrice() != null ?
+                        BigDecimal.valueOf(vo.getFlowPrice()) : BigDecimal.ZERO;
+
+                // 鐢˙igDecimal鐨刟dd鏂规硶绱姞
+                BigDecimal totalPrice = orderCountVO.getOrderPriceCount().add(flowPrice);
+                orderCountVO.setOrderPriceCount(totalPrice);
 
             }
         }
@@ -666,9 +673,12 @@
     public Order delivery(String orderSn, String logisticsNo, String logisticsId) {
         Order order = OperationalJudgment.judgment(this.getBySn(orderSn));
         //濡傛灉璁㈠崟鏈彂璐э紝骞朵笖璁㈠崟鐘舵�佸�肩瓑浜庡緟鍙戣揣
+        log.info("鑾峰彇鍒扮殑璁㈠崟淇℃伅涓簕}", JSON.toJSONString(order));
         if (order.getDeliverStatus().equals(DeliverStatusEnum.UNDELIVERED.name()) && order.getOrderStatus().equals(OrderStatusEnum.UNDELIVERED.name())) {
             //鑾峰彇瀵瑰簲鐗╂祦
             Logistics logistics = logisticsService.getById(logisticsId);
+            log.info("鑾峰彇鍒扮殑鐗╂祦淇℃伅id涓簕}", logisticsId);
+            log.info("鑾峰彇鍒扮殑鐗╂祦淇℃伅涓簕}", JSON.toJSONString(logistics));
             if (logistics == null) {
                 throw new ServiceException(ResultCode.ORDER_LOGISTICS_ERROR);
             }
@@ -1335,6 +1345,12 @@
         this.update(new LambdaUpdateWrapper<Order>()
                 .eq(Order::getSn, orderSn)
                 .set(Order::getOrderStatus, orderStatusEnum.name()));
+        //淇敼璁㈠崟鍟嗗搧 todo 鎵�鏈夌殑璁㈠崟闇�瑕佸鏍稿悗鎵嶈兘閫�娆�
+        orderItemService.update(new LambdaUpdateWrapper<OrderItem>()
+                .eq(OrderItem::getOrderSn,orderSn)
+                .set(OrderItem::getAfterSaleStatus, OrderItemAfterSaleStatusEnum.NOT_APPLIED.name())
+                .set(OrderItem::getCommentStatus,CommentStatusEnum.UNFINISHED.name())
+                .set(OrderItem::getComplainStatus, OrderComplaintStatusEnum.NO_APPLY.name()));
         //淇敼璁㈠崟
         OrderMessage orderMessage = new OrderMessage();
         orderMessage.setNewStatus(orderStatusEnum);
@@ -1457,7 +1473,7 @@
         // 鍒涘缓琛ㄥご
         Row header = sheet.createRow(0);
         String[] headers = {"涓昏鍗曠紪鍙�", "瀛愯鍗曠紪鍙�", "閫夎喘鍟嗗搧", "鍟嗗搧鏁伴噺", "鍟嗗搧ID", "鍟嗗搧鍗曚环", "璁㈠崟搴斾粯閲戦",
-                "杩愯垂", "浼樻儬鎬婚噾棰�", "骞冲彴浼樻儬", "鍟嗗浼樻儬", "鍟嗗鏀逛环", "鏀粯鏂瑰紡","鍗栧鍚嶇О", "鏀朵欢浜�", "鏀朵欢浜烘墜鏈哄彿",
+                "杩愯垂", "浼樻儬鎬婚噾棰�", "骞冲彴浼樻儬", "鍟嗗浼樻儬", "鍟嗗鏀逛环", "鏀粯鏂瑰紡","涔板鍚嶇О", "鏀朵欢浜�", "鏀朵欢浜烘墜鏈哄彿",
                 "鐪�", "甯�", "鍖�", "琛楅亾", "璇︾粏鍦板潃", "涔板鐣欒█", "璁㈠崟鎻愪氦鏃堕棿", "鏀粯瀹屾垚鏃堕棿", "鏉ユ簮",
                 "璁㈠崟鐘舵��", "璁㈠崟绫诲瀷", "鍞悗鐘舵��", "鍙栨秷鍘熷洜", "鍙戣揣鏃堕棿", "瀹屾垚鏃堕棿", "搴楅摵"};
 

--
Gitblit v1.8.0