zhijiezhao 1 year ago
parent
commit
69b946707d

+ 7 - 6
src/main/java/com/caimei365/order/service/impl/SubmitServiceImpl.java

@@ -506,8 +506,6 @@ public class SubmitServiceImpl implements SubmitService {
                 secondHandOrderFlag = true;
             }
             log.info("postageFlag*****************" + postageFlag);
-            // 运费方式为空: 赠品 包邮
-            postageFlag = null == postageFlag ? 0 : postageFlag;
             // 运费
             Double postage = 0d;
             // 在 运费类型为有运费时 运费生效
@@ -778,13 +776,16 @@ 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());
+                                            singlePromotionFee.set(MathUtil.add(singlePromotionFee.get(), MathUtil.mul(promotions.getReducedPrice(), floor)).doubleValue());
+                                            shopOrder.setPromotionFullReduction(singlePromotionFee.get());
+
                                         } 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());
+                                            singlePromotionFee.set(MathUtil.add(singlePromotionFee.get(), promotions.getReducedPrice()).doubleValue());
+                                            shopOrder.setPromotionFullReduction(singlePromotionFee.get());
                                         }
                                     }
                                     // 添加到总促销
@@ -991,7 +992,7 @@ public class SubmitServiceImpl implements SubmitService {
                                 //叠加倍数
                                 Double floor = Math.floor(MathUtil.div(shopPromotionFee.get(), shopPromotions.getTouchPrice()).doubleValue());
                                 // 供应商满减金额
-                                shopOrder.setPromotionFullReduction(MathUtil.mul(shopPromotions.getReducedPrice(), floor).doubleValue());
+                                shopOrder.setPromotionFullReduction(MathUtil.add(singlePromotionFee.get(), MathUtil.mul(shopPromotions.getReducedPrice(), floor)).doubleValue());
                                 // 统计订单总满减金额
                                 promotionFullReduction.set(MathUtil.add(promotionFullReduction.get(), MathUtil.mul(shopPromotions.getReducedPrice(), floor)).doubleValue());
                                 // 统计店铺商品总金额
@@ -1002,7 +1003,7 @@ public class SubmitServiceImpl implements SubmitService {
                                 shopAmount.set(MathUtil.sub(shopAmount.get(), MathUtil.mul(shopPromotions.getReducedPrice(), floor)).doubleValue());
                             } else {
                                 // 供应商满减金额
-                                shopOrder.setPromotionFullReduction(shopPromotions.getReducedPrice());
+                                shopOrder.setPromotionFullReduction(MathUtil.add(singlePromotionFee.get(), shopPromotions.getReducedPrice()).doubleValue());
                                 // 统计订单总满减金额
                                 promotionFullReduction.set(MathUtil.add(promotionFullReduction.get(), shopPromotions.getReducedPrice()).doubleValue());
                                 // 统计店铺商品总金额

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

@@ -1257,7 +1257,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,
-                        sum(cror.associateAmount) as receiptAmount,
+                        (select sum(associateAmount) from cm_receipt_order_relation where cdr.shopOrderID = cso.shopOrderID) as receiptAmount,
                         IFNULL((SELECT SUM(refundAmount)
                                 FROM cm_refund_shop_record
                                 WHERE shopOrderID = cso.shopOrderID
@@ -1304,7 +1304,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,
-        sum(cror.associateAmount) as receiptAmount,
+        (select sum(associateAmount) from cm_receipt_order_relation where cdr.shopOrderID = cso.shopOrderID) as receiptAmount,
         ifnull(cso.sendOutStatus, 1) as sendOutStatus,
         ifnull(cso.receiptStatus, 1) as receiptStatus,
         cso.splitFlag,