Bläddra i källkod

Merge remote-tracking branch 'origin/developerD' into developerD

huangzhiguo 1 år sedan
förälder
incheckning
3ccf2f2862

+ 5 - 3
src/main/java/com/caimei365/order/service/impl/ReceiptServiceImpl.java

@@ -60,13 +60,11 @@ public class ReceiptServiceImpl implements ReceiptService {
     @Resource
     private OrderCommonService orderCommonService;
     @Resource
-    private OrderClubMapper orderClubMapper;
-    @Resource
     private BaseMapper baseMapper;
-
     @Resource
     private cmOfflineCollectionMapper collectionMapper;
 
+
     /**
      * 只有当识别出来的收款类型是广发银行-5461 ,中信银行-0897,中信银行0897-财付通 和 中信银行0897-支付宝时,才会显示手续费,并且自动勾选上手续费,默认按收款金额的千分之一计算 (收款金额 - 手续费 = 短信中收到的金额)
      */
@@ -1050,6 +1048,7 @@ public class ReceiptServiceImpl implements ReceiptService {
             // 已关联子订单,展示关联信息
             shopOrderList = receiptMapper.getShopOrderListByReceiptId(id);
             for (ShopOrderVo shopOrder : shopOrderList) {
+                orderCommonService.setShopOrderStatus(shopOrder);
                 setReceiptedAmount(shopOrder);
             }
         } else {
@@ -1067,6 +1066,7 @@ public class ReceiptServiceImpl implements ReceiptService {
             shopOrderList = receiptMapper.getRefundShopOrders(confirmedType, shopName, userName, orderId);
             for (ShopOrderVo shopOrder : shopOrderList) {
                 setReceiptedAmount(shopOrder);
+                orderCommonService.setShopOrderStatus(shopOrder);
                 if (confirmedType != null && confirmedType == 2) {
                     shopOrder.setHaveReturning("1");
                 }
@@ -1156,6 +1156,7 @@ public class ReceiptServiceImpl implements ReceiptService {
             // 已关联子订单,展示关联信息
             shopOrderList = receiptMapper.getShopOrderListByReceiptId(id);
             for (ShopOrderVo shopOrder : shopOrderList) {
+                orderCommonService.setShopOrderStatus(shopOrder);
                 setReceiptedAmount(shopOrder);
             }
         } else {
@@ -1163,6 +1164,7 @@ public class ReceiptServiceImpl implements ReceiptService {
             //这里的子订单  必须满足 它的主订单只进行过返佣收款或者主订单根本没有收过款
             shopOrderList = receiptMapper.getRebateShopOrders(shopName);
             for (ShopOrderVo shopOrder : shopOrderList) {
+                orderCommonService.setShopOrderStatus(shopOrder);
                 setReceiptedAmount(shopOrder);
             }
         }

+ 5 - 8
src/main/java/com/caimei365/order/service/impl/SubmitServiceImpl.java

@@ -520,6 +520,7 @@ public class SubmitServiceImpl implements SubmitService {
              * 初始化子订单
              */
             OrderShopPo shopOrder = new OrderShopPo();
+            shopOrder.setPromotionFullReduction(0d);
             shopOrder.setShopId(shopId);
             shopOrder.setShopName(shopName);
             shopOrder.setNote(shopNote);
@@ -558,8 +559,6 @@ public class SubmitServiceImpl implements SubmitService {
             AtomicDouble shopPromotionFee = new AtomicDouble(0);
             // 供应商超级会员优惠
             AtomicDouble svipShopReduction = new AtomicDouble(0);
-            // 商品的单品满减优惠金额
-            AtomicDouble singlePromotionFee = new AtomicDouble(0);
 
             // 遍历所有商品
             for (Object productObject : productArr) {
@@ -778,16 +777,14 @@ public class SubmitServiceImpl implements SubmitService {
                                             Double floor = Math.floor(MathUtil.div(productFee, promotions.getTouchPrice()).doubleValue());
                                             promotionFullReduction.set(MathUtil.add(promotionFullReduction.get(), MathUtil.mul(promotions.getReducedPrice(), floor)).doubleValue());
                                             productFee = MathUtil.sub(productFee, MathUtil.mul(promotions.getReducedPrice(), floor)).doubleValue();
-                                            singlePromotionFee.set(MathUtil.add(singlePromotionFee.get(), MathUtil.mul(promotions.getReducedPrice(), floor)).doubleValue());
-                                            shopOrder.setPromotionFullReduction(singlePromotionFee.get());
+                                            shopOrder.setPromotionFullReduction(MathUtil.add(shopOrder.getPromotionFullReduction(), MathUtil.mul(promotions.getReducedPrice(), floor)).doubleValue());
 
                                         } else {
                                             // 统计订单总满减金额
                                             promotionFullReduction.set(MathUtil.add(promotionFullReduction.get(), promotions.getReducedPrice()).doubleValue());
                                             // 统计单个商品的折后金额
                                             productFee = MathUtil.sub(productFee, promotions.getReducedPrice()).doubleValue();
-                                            singlePromotionFee.set(MathUtil.add(singlePromotionFee.get(), promotions.getReducedPrice()).doubleValue());
-                                            shopOrder.setPromotionFullReduction(singlePromotionFee.get());
+                                            shopOrder.setPromotionFullReduction(MathUtil.add(shopOrder.getPromotionFullReduction(), promotions.getReducedPrice()).doubleValue());
                                         }
                                     }
                                     // 添加到总促销
@@ -994,7 +991,7 @@ public class SubmitServiceImpl implements SubmitService {
                                 //叠加倍数
                                 Double floor = Math.floor(MathUtil.div(shopPromotionFee.get(), shopPromotions.getTouchPrice()).doubleValue());
                                 // 供应商满减金额
-                                shopOrder.setPromotionFullReduction(MathUtil.add(singlePromotionFee.get(), MathUtil.mul(shopPromotions.getReducedPrice(), floor)).doubleValue());
+                                shopOrder.setPromotionFullReduction(MathUtil.add(shopOrder.getPromotionFullReduction(), MathUtil.mul(shopPromotions.getReducedPrice(), floor)).doubleValue());
                                 // 统计订单总满减金额
                                 promotionFullReduction.set(MathUtil.add(promotionFullReduction.get(), MathUtil.mul(shopPromotions.getReducedPrice(), floor)).doubleValue());
                                 // 统计店铺商品总金额
@@ -1005,7 +1002,7 @@ public class SubmitServiceImpl implements SubmitService {
                                 shopAmount.set(MathUtil.sub(shopAmount.get(), MathUtil.mul(shopPromotions.getReducedPrice(), floor)).doubleValue());
                             } else {
                                 // 供应商满减金额
-                                shopOrder.setPromotionFullReduction(MathUtil.add(singlePromotionFee.get(), shopPromotions.getReducedPrice()).doubleValue());
+                                shopOrder.setPromotionFullReduction(MathUtil.add(shopOrder.getPromotionFullReduction(), shopPromotions.getReducedPrice()).doubleValue());
                                 // 统计订单总满减金额
                                 promotionFullReduction.set(MathUtil.add(promotionFullReduction.get(), shopPromotions.getReducedPrice()).doubleValue());
                                 // 统计店铺商品总金额

+ 20 - 2
src/main/resources/mapper/ReceiptMapper.xml

@@ -842,6 +842,12 @@
                         cso.shopOtherFee,
                         s.name                            AS shopName,
                         ifnull(co.secondHandOrderFlag, 0) as secondHandOrderFlag,
+                        cso.orderType,
+                        cso.organizeId,
+                        cso.shopStatus as status,
+                        ifnull(cso.orderStatusFlag,1) as orderStatusFlag,
+                        (select sum(associateAmount) from cm_receipt_order_relation where shopOrderID = cso.shopOrderID) as receiptAmount,
+                        (select userName from user where userID = cso.userId LIMIT 1) as userName,
                         IFNULL((SELECT SUM(refundAmount)
                                 FROM cm_refund_shop_record
                                 WHERE shopOrderID = cso.shopOrderID
@@ -886,6 +892,12 @@
         cso.splitFlag,
         cso.shopOtherFee,
         s.name AS shopName,
+        cso.orderType,
+        cso.organizeId,
+        cso.shopStatus as status,
+        ifnull(cso.orderStatusFlag,1) as orderStatusFlag,
+        (select sum(associateAmount) from cm_receipt_order_relation where shopOrderID = cso.shopOrderID) as receiptAmount,
+        (select userName from user where userID = cso.userId LIMIT 1) as userName,
         IFNULL((SELECT SUM(refundAmount) FROM cm_refund_shop_record WHERE shopOrderID = cso.shopOrderID AND delFlag =
         0), 0) AS shopRefundAmount
         FROM cm_shop_order cso
@@ -948,6 +960,12 @@
         cso.shopOtherFee,
         s.name AS shopName,
         ifnull(co.secondHandOrderFlag,0) as secondHandOrderFlag,
+        cso.orderType,
+        cso.organizeId,
+        cso.shopStatus as status,
+        ifnull(cso.orderStatusFlag,1) as orderStatusFlag,
+        (select sum(associateAmount) from cm_receipt_order_relation where shopOrderID = cso.shopOrderID) as receiptAmount,
+        (select userName from user where userID = cso.userId LIMIT 1) as userName,
         IF((SELECT (crpp.id) FROM cm_returned_purchase_product crpp LEFT JOIN cm_returned_purchase crp ON crp.id =
         crpp.returnedID
         WHERE crpp.shopOrderID = cso.shopOrderID AND crp.status = '1' AND crp.delFlag = 0 LIMIT 1) > 0, 1, 0) AS
@@ -1257,7 +1275,7 @@
                         s.name                            AS shopName,
                         (SELECT SUM(cmCostPrice*(num+presentnum) )FROM cm_order_product WHERE shopOrderId = cso.shopOrderId) AS cmCostPrice,
                         (select userName from user where userID = cso.userId LIMIT 1) as userName,
-                        (select sum(associateAmount) from cm_receipt_order_relation where cdr.shopOrderID = cso.shopOrderID) as receiptAmount,
+                        (select sum(associateAmount) from cm_receipt_order_relation where shopOrderID = cso.shopOrderID) as receiptAmount,
                         IFNULL((SELECT SUM(refundAmount)
                                 FROM cm_refund_shop_record
                                 WHERE shopOrderID = cso.shopOrderID
@@ -1304,7 +1322,7 @@
         ifnull(cso.orderStatusFlag,1) as orderStatusFlag,
         IFNULL(cso.refundStatus, 1) AS refundStatus,
         (select userName from user where userID = cso.userId LIMIT 1) as userName,
-        (select sum(associateAmount) from cm_receipt_order_relation where cdr.shopOrderID = cso.shopOrderID) as receiptAmount,
+        (select sum(associateAmount) from cm_receipt_order_relation where shopOrderID = cso.shopOrderID) as receiptAmount,
         ifnull(cso.sendOutStatus, 1) as sendOutStatus,
         ifnull(cso.receiptStatus, 1) as receiptStatus,
         cso.splitFlag,