zhijiezhao 1 year ago
parent
commit
f7cd3d7c72

+ 1 - 1
src/main/java/com/caimei365/order/components/OrderCommonService.java

@@ -320,7 +320,7 @@ public class OrderCommonService {
                     if (null != promotions) {
                         if (1 == promotions.getType() && 1 == promotions.getMode()) {
                             // 单品优惠价取sku的优惠价
-                            Double touchPrice = baseMapper.getTouchPriceBySku(orderProduct.getSkuId(),promotions.getId());
+                            Double touchPrice = baseMapper.getTouchPriceBySku(orderProduct.getSkuId(),promotions.getPromotionsId());
                             promotions.setTouchPrice(touchPrice);
                         }
                         if (taxFlag && Integer.valueOf(1).equals(promotions.getType()) && Integer.valueOf(1).equals(promotions.getMode())) {

+ 4 - 2
src/main/java/com/caimei365/order/service/impl/SubmitServiceImpl.java

@@ -556,6 +556,8 @@ public class SubmitServiceImpl implements SubmitService {
             AtomicDouble shopPromotionFee = new AtomicDouble(0);
             // 供应商超级会员优惠
             AtomicDouble svipShopReduction = new AtomicDouble(0);
+            // 商品的单品满减优惠金额
+            AtomicDouble singlePromotionFee = new AtomicDouble(0);
 
             // 遍历所有商品
             for (Object productObject : productArr) {
@@ -774,13 +776,13 @@ 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();
-                                            shopOrder.setPromotionFullReduction(MathUtil.mul(promotions.getReducedPrice(), floor).doubleValue());
+                                            singlePromotionFee.set(MathUtil.add(singlePromotionFee.get(),MathUtil.mul(promotions.getReducedPrice(), floor)).doubleValue());
                                         } else {
                                             // 统计订单总满减金额
                                             promotionFullReduction.set(MathUtil.add(promotionFullReduction.get(), promotions.getReducedPrice()).doubleValue());
                                             // 统计单个商品的折后金额
                                             productFee = MathUtil.sub(productFee, promotions.getReducedPrice()).doubleValue();
-                                            shopOrder.setPromotionFullReduction(promotions.getReducedPrice());
+                                            singlePromotionFee.set(MathUtil.add(singlePromotionFee.get(),promotions.getReducedPrice()).doubleValue());
                                         }
                                     }
                                     // 添加到总促销

+ 1 - 0
src/main/resources/mapper/OrderCommonMapper.xml

@@ -147,6 +147,7 @@
         SELECT id,
                name,
                description,
+               promotionsId,
                orderId,
                type,
                mode,

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

@@ -1252,6 +1252,7 @@
                         cso.orderType,
                         cso.organizeId,
                         cso.shopStatus as status,
+                        ifnull(cso.orderStatusFlag,1) as orderStatusFlag,
                         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,
@@ -1299,6 +1300,7 @@
         cso.orderType,
         cso.organizeId,
         cso.shopStatus as status,
+        ifnull(cso.orderStatusFlag,1) as orderStatusFlag,
         (select userName from user where userID = cso.userId LIMIT 1) as userName,
         sum(cror.associateAmount) as receiptAmount,
         ifnull(cso.sendOutStatus, 1) as sendOutStatus,