zhijiezhao преди 3 години
родител
ревизия
b8aceeb0ad

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

@@ -148,7 +148,7 @@ public class ProductService {
                 // 获取赠品
                 List<CartItemVo> giftList = baseMapper.getPromotionGifts(promotions.getId());
                 // 符合条件赠品翻倍
-                if (floor != null && promotions.getDiscount() != null && floor > 1 && promotions.getDiscount() == 0) {
+                if (floor != null && promotions.getDiscount() != null && floor > 1 && promotions.getDiscount() == 1) {
                     Integer in = floor.intValue();
                     List<CartItemVo> g = new ArrayList<>();
                     for (Integer i = 1; i < in; i++) {

+ 2 - 2
src/main/java/com/caimei365/order/model/vo/PromotionsVo.java

@@ -17,11 +17,11 @@ import java.util.List;
 public class PromotionsVo implements Serializable {
     private static final long serialVersionUID = 1L;
     /**
-     * 活动可见度,0所有人,1仅对机构
+     * 活动可见度, 1所有人,2仅对机构
      */
     private Integer seen;
     /**
-     * 是否支持叠加优惠,0支持,1不支持
+     * 是否支持叠加优惠,1支持,2不支持
      */
     private Integer discount;
     /**

+ 27 - 27
src/main/java/com/caimei365/order/service/impl/CartClubServiceImpl.java

@@ -115,7 +115,7 @@ public class CartClubServiceImpl implements CartClubService {
                 AtomicDouble shopOriginalPrice = new AtomicDouble(0);
                 // 供应商促销优惠活动,以活动分类排序,店铺>凑单>单品
                 PromotionsVo shopPromotion = baseMapper.getPromotionByShopId(shop.getShopId());
-                if (shopPromotion != null && shopPromotion.getSeen() != null && shopPromotion.getSeen() == 1 && userIdentity == 1) {
+                if (shopPromotion != null && shopPromotion.getSeen() != null && shopPromotion.getSeen() == 2 && userIdentity == 1) {
                     shopPromotion = null;
                 }
                 // 供应商下商品列表 ,购物车里的该供应商商品
@@ -154,7 +154,7 @@ public class CartClubServiceImpl implements CartClubService {
                                     // 获取商品促销信息
                                     promotions = baseMapper.getPromotionByProductId(cartItemVo.getProductId());
                                     // 促销活动如果协销不可见直接置空
-                                    if (promotions != null && promotions.getSeen() != null && promotions.getSeen() == 1 && userIdentity == 1) {
+                                    if (promotions != null && promotions.getSeen() != null && promotions.getSeen() == 2 && userIdentity == 1) {
                                         promotions = null;
                                     }
                                     /*
@@ -170,7 +170,7 @@ public class CartClubServiceImpl implements CartClubService {
                                         //单品满减-计算供应商总价/满减金额
                                         // 叠加优惠计算
                                         if (promotions.getType() == 1 && promotions.getMode() == 2) {
-                                            if (promotions.getDiscount() != null && promotions.getDiscount() == 0 && floor > 1) {
+                                            if (promotions.getDiscount() != null && promotions.getDiscount() == 1 && floor > 1) {
                                                 //叠加优惠计算
                                                 //叠加倍数
                                                 shopPrice.set(MathUtil.sub(shopPrice.get(), MathUtil.mul(promotions.getReducedPrice(), floor)).doubleValue());
@@ -272,7 +272,7 @@ public class CartClubServiceImpl implements CartClubService {
                                 // 获取赠品
                                 List<CartItemVo> giftList = baseMapper.getPromotionGifts(shopPromotion.getId());
                                 // 叠加赠品
-                                if (shopPromotion.getDiscount() != null && shopPromotion.getDiscount() == 0 && floor > 1) {
+                                if (shopPromotion.getDiscount() != null && shopPromotion.getDiscount() == 1 && floor > 1) {
                                     Integer in = floor.intValue();
                                     List<CartItemVo> g = new ArrayList<>();
                                     g.addAll(giftList);
@@ -301,7 +301,7 @@ public class CartClubServiceImpl implements CartClubService {
                             totalPromotions.add(shopPromotion);
                             // 店铺满减-计算供应商总价/满减金额
                             if (shopPromotion.getMode() == 2 && MathUtil.compare(shopPromotionFee, shopPromotion.getTouchPrice()) > -1) {
-                                if (shopPromotion.getDiscount() != null && shopPromotion.getDiscount() == 0 && floor > 1) {
+                                if (shopPromotion.getDiscount() != null && shopPromotion.getDiscount() == 1 && floor > 1) {
                                     // 该供应商总价 - 满减金额
                                     shopPrice.set(MathUtil.sub(shopPrice.get(), MathUtil.mul(shopPromotion.getReducedPrice(), floor)).doubleValue());
                                     // 该供应商优惠总额 + 满减金额
@@ -350,7 +350,7 @@ public class CartClubServiceImpl implements CartClubService {
                     //叠加倍数
                     Double floor = Math.floor(MathUtil.div(touchPrice, promotions.getTouchPrice()).doubleValue());
                     if (MathUtil.compare(touchPrice, promotions.getTouchPrice()) > -1) {
-                        if (promotions.getDiscount() != null && promotions.getDiscount() == 0 && floor > 1) {
+                        if (promotions.getDiscount() != null && promotions.getDiscount() == 1 && floor > 1) {
                             //叠加优惠计算
                             // 总价 - 满减金额
                             totalPrice.set(MathUtil.sub(totalPrice, MathUtil.mul(promotions.getReducedPrice(), floor)).doubleValue());
@@ -528,7 +528,7 @@ public class CartClubServiceImpl implements CartClubService {
                 // 获取商品促销信息
                 PromotionsVo promotions = baseMapper.getPromotionByProductId(cartItemVo.getProductId());
                 // 如果促销活动协销不可见,移除促销
-                if (promotions != null && promotions.getSeen() != null && promotions.getSeen() == 1 && userIdentity == 1) {
+                if (promotions != null && promotions.getSeen() != null && promotions.getSeen() == 2 && userIdentity == 1) {
                     promotions = null;
                 }
                 /*
@@ -581,7 +581,7 @@ public class CartClubServiceImpl implements CartClubService {
                     //叠加倍数
                     Double floor = Math.floor(MathUtil.div(touchPrice, promotions.getTouchPrice()).doubleValue());
                     if (MathUtil.compare(touchPrice, promotions.getTouchPrice()) > -1) {
-                        if (promotions.getDiscount() != null && promotions.getDiscount() == 0 && floor > 1) {
+                        if (promotions.getDiscount() != null && promotions.getDiscount() == 1 && floor > 1) {
                             //叠加优惠计算
                             // 总价 - 满减金额
                             totalPrice.set(MathUtil.sub(totalPrice, MathUtil.mul(promotions.getReducedPrice(), floor)).doubleValue());
@@ -797,7 +797,7 @@ public class CartClubServiceImpl implements CartClubService {
                     AtomicDouble shopOriginalPrice = new AtomicDouble(0);
                     // 供应商促销优惠活动
                     PromotionsVo shopPromotion = baseMapper.getPromotionByShopId(shop.getShopId());
-                    if (shopPromotion != null && shopPromotion.getSeen() != null && shopPromotion.getSeen() == 1 && userIdentity == 1) {
+                    if (shopPromotion != null && shopPromotion.getSeen() != null && shopPromotion.getSeen() == 2 && userIdentity == 1) {
                         shopPromotion = null;
                     }
                     // 供应商下商品列表
@@ -835,7 +835,7 @@ public class CartClubServiceImpl implements CartClubService {
                                     // 获取商品促销信息
                                     promotions = baseMapper.getPromotionByProductId(cartItemVo.getProductId());
                                     // 如果促销活动协销不可见,移除促销
-                                    if (promotions != null && promotions.getSeen() != null && promotions.getSeen() == 1 && userIdentity == 1) {
+                                    if (promotions != null && promotions.getSeen() != null && promotions.getSeen() == 2 && userIdentity == 1) {
                                         promotions = null;
                                     }
                                     /*
@@ -852,7 +852,7 @@ public class CartClubServiceImpl implements CartClubService {
                                         //单品满减-计算供应商总价/满减金额
                                         if (promotions.getType() == 1 && promotions.getMode() == 2) {
                                             if (MathUtil.compare(totalAmount, promotions.getTouchPrice()) > -1) {
-                                                if (promotions.getDiscount() != null && promotions.getDiscount() == 0 && floor > 1) {
+                                                if (promotions.getDiscount() != null && promotions.getDiscount() == 1 && floor > 1) {
                                                     //叠加优惠计算
                                                     shopPrice.set(MathUtil.sub(shopPrice.get(), MathUtil.mul(promotions.getReducedPrice(), floor)).doubleValue());
                                                     shopReducedPrice.set(MathUtil.add(shopReducedPrice, MathUtil.mul(promotions.getReducedPrice(), floor)).doubleValue());
@@ -915,7 +915,7 @@ public class CartClubServiceImpl implements CartClubService {
                                         // 获取赠品
                                         List<CartItemVo> giftList = baseMapper.getPromotionGifts(shopPromotion.getId());
                                         //叠加满赠
-                                        if (shopPromotion.getDiscount() != null && shopPromotion.getDiscount() == 0 && floor > 1) {
+                                        if (shopPromotion.getDiscount() != null && shopPromotion.getDiscount() == 1 && floor > 1) {
                                             Integer in = floor.intValue();
                                             List<CartItemVo> g = new ArrayList<>();
                                             g.addAll(giftList);
@@ -945,7 +945,7 @@ public class CartClubServiceImpl implements CartClubService {
                                     // 店铺满减-计算供应商总价/满减金额
                                     // 满减叠加计算
                                     if (shopPromotion.getMode() == 2 && MathUtil.compare(shopPromotionFee, shopPromotion.getTouchPrice()) > -1) {
-                                        if (shopPromotion.getDiscount() != null && shopPromotion.getDiscount() == 0 && floor > 1) {
+                                        if (shopPromotion.getDiscount() != null && shopPromotion.getDiscount() == 1 && floor > 1) {
                                             shopPrice.set(MathUtil.sub(shopPrice.get(), MathUtil.mul(shopPromotion.getReducedPrice(), floor)).doubleValue());
                                             shopReducedPrice.set(MathUtil.add(shopReducedPrice, MathUtil.mul(shopPromotion.getReducedPrice(), floor)).doubleValue());
                                         } else {
@@ -1001,7 +1001,7 @@ public class CartClubServiceImpl implements CartClubService {
                 Double floor = Math.floor(MathUtil.div(touchPrice, promotions.getTouchPrice()).doubleValue());
                 // 凑单满减
                 if (promotions.getType() == 2 && promotions.getMode() == 2) {
-                    if (promotions.getDiscount() != null && promotions.getDiscount() == 0 && floor > 1) {
+                    if (promotions.getDiscount() != null && promotions.getDiscount() == 1 && floor > 1) {
                         //叠加优惠计算
                         // 总价 - 满减金额
                         totalPrice.set(MathUtil.sub(totalPrice, MathUtil.mul(promotions.getReducedPrice(), floor)).doubleValue());
@@ -1017,7 +1017,7 @@ public class CartClubServiceImpl implements CartClubService {
                     //满赠叠加
                     List<CartItemVo> giftList = baseMapper.getPromotionGifts(promotions.getId());
                     //满足叠加
-                    if (promotions.getDiscount() != null && promotions.getDiscount() == 0 && floor > 1) {
+                    if (promotions.getDiscount() != null && promotions.getDiscount() == 1 && floor > 1) {
                         Integer in = floor.intValue();
                         List<CartItemVo> g = new ArrayList<>();
                         g.addAll(giftList);
@@ -1156,7 +1156,7 @@ public class CartClubServiceImpl implements CartClubService {
                     AtomicDouble shopOriginalPrice = new AtomicDouble(0);
                     // 供应商促销优惠活动
                     PromotionsVo shopPromotion = baseMapper.getPromotionByShopId(shop.getShopId());
-                    if (shopPromotion != null && shopPromotion.getSeen() != null && shopPromotion.getSeen() == 1 && userIdentity == 1) {
+                    if (shopPromotion != null && shopPromotion.getSeen() != null && shopPromotion.getSeen() == 2 && userIdentity == 1) {
                         shopPromotion = null;
                     }
                     // 供应商下商品列表
@@ -1195,7 +1195,7 @@ public class CartClubServiceImpl implements CartClubService {
                                     // 获取商品促销信息
                                     promotions = baseMapper.getPromotionByProductId(cartItemVo.getProductId());
                                     // 如果促销活动协销不可见,移除促销
-                                    if (promotions != null && promotions.getSeen() != null && promotions.getSeen() == 1 && userIdentity == 1) {
+                                    if (promotions != null && promotions.getSeen() != null && promotions.getSeen() == 2 && userIdentity == 1) {
                                         promotions = null;
                                     }
                                     /*
@@ -1212,7 +1212,7 @@ public class CartClubServiceImpl implements CartClubService {
                                         //单品满减-计算供应商总价/满减金额
                                         if (promotions.getType() == 1 && promotions.getMode() == 2) {
                                             if (MathUtil.compare(totalAmount, promotions.getTouchPrice()) > -1) {
-                                                if (promotions.getDiscount() != null && promotions.getDiscount() == 0 && floor > 1) {
+                                                if (promotions.getDiscount() != null && promotions.getDiscount() == 1 && floor > 1) {
                                                     //叠加优惠计算
                                                     shopPrice.set(MathUtil.sub(shopPrice.get(), MathUtil.mul(promotions.getReducedPrice(), floor)).doubleValue());
                                                     shopReducedPrice.set(MathUtil.add(shopReducedPrice, MathUtil.mul(promotions.getReducedPrice(), floor)).doubleValue());
@@ -1275,7 +1275,7 @@ public class CartClubServiceImpl implements CartClubService {
                                         // 获取赠品
                                         List<CartItemVo> giftList = baseMapper.getPromotionGifts(shopPromotion.getId());
                                         //叠加满赠
-                                        if (shopPromotion.getDiscount() != null && shopPromotion.getDiscount() == 0 && floor > 1) {
+                                        if (shopPromotion.getDiscount() != null && shopPromotion.getDiscount() == 1 && floor > 1) {
                                             Integer in = floor.intValue();
                                             List<CartItemVo> g = new ArrayList<>();
                                             g.addAll(giftList);
@@ -1305,7 +1305,7 @@ public class CartClubServiceImpl implements CartClubService {
                                     // 店铺满减-计算供应商总价/满减金额
                                     // 满减叠加计算
                                     if (shopPromotion.getMode() == 2 && MathUtil.compare(shopPromotionFee, shopPromotion.getTouchPrice()) > -1) {
-                                        if (shopPromotion.getDiscount() != null && shopPromotion.getDiscount() == 0 && floor > 1) {
+                                        if (shopPromotion.getDiscount() != null && shopPromotion.getDiscount() == 1 && floor > 1) {
                                             shopPrice.set(MathUtil.sub(shopPrice.get(), MathUtil.mul(shopPromotion.getReducedPrice(), floor)).doubleValue());
                                             shopReducedPrice.set(MathUtil.add(shopReducedPrice, MathUtil.mul(shopPromotion.getReducedPrice(), floor)).doubleValue());
                                         } else {
@@ -1361,7 +1361,7 @@ public class CartClubServiceImpl implements CartClubService {
                 Double floor = Math.floor(MathUtil.div(touchPrice, promotions.getTouchPrice()).doubleValue());
                 // 凑单满减
                 if (promotions.getType() == 2 && promotions.getMode() == 2) {
-                    if (promotions.getDiscount() != null && promotions.getDiscount() == 0 && floor > 1) {
+                    if (promotions.getDiscount() != null && promotions.getDiscount() == 1 && floor > 1) {
                         //叠加优惠计算
                         // 总价 - 满减金额
                         totalPrice.set(MathUtil.sub(totalPrice, MathUtil.mul(promotions.getReducedPrice(), floor)).doubleValue());
@@ -1377,7 +1377,7 @@ public class CartClubServiceImpl implements CartClubService {
                     //满赠叠加
                     List<CartItemVo> giftList = baseMapper.getPromotionGifts(promotions.getId());
                     //满足叠加
-                    if (promotions.getDiscount() != null && promotions.getDiscount() == 0 && floor > 1) {
+                    if (promotions.getDiscount() != null && promotions.getDiscount() == 1 && floor > 1) {
                         Integer in = floor.intValue();
                         List<CartItemVo> g = new ArrayList<>();
                         g.addAll(giftList);
@@ -1491,7 +1491,7 @@ public class CartClubServiceImpl implements CartClubService {
 
         // 供应商促销优惠活动
         PromotionsVo promotions = baseMapper.getPromotionByShopId(shop.getShopId());
-        if (promotions != null && promotions.getSeen() != null && promotions.getSeen() == 1 && userIdentity == 1) {
+        if (promotions != null && promotions.getSeen() != null && promotions.getSeen() == 2 && userIdentity == 1) {
             promotions = null;
         }
         boolean hasGift = false;
@@ -1509,7 +1509,7 @@ public class CartClubServiceImpl implements CartClubService {
                 // 获取商品促销信息
                 promotions = baseMapper.getPromotionByProductId(cartItemVo.getProductId());
                 //协销不可见
-                if (promotions != null && promotions.getSeen() != null && promotions.getSeen() == 1 && userIdentity == 1) {
+                if (promotions != null && promotions.getSeen() != null && promotions.getSeen() == 2 && userIdentity == 1) {
                     promotions = null;
                 }
             } else {
@@ -1529,7 +1529,7 @@ public class CartClubServiceImpl implements CartClubService {
                     // 满减
                     if (promotions.getMode() == 2) {
                         // 总价 - 满减金额
-                        if (promotions.getDiscount() != null && promotions.getDiscount() == 0 && floor > 1) {
+                        if (promotions.getDiscount() != null && promotions.getDiscount() == 1 && floor > 1) {
                             totalPrice.set(MathUtil.sub(totalPrice.get(), MathUtil.mul(promotions.getReducedPrice(), floor)).doubleValue());
                             // 优惠总额 + 满减金额
                             reducedPrice.set(MathUtil.add(reducedPrice.get(), MathUtil.mul(promotions.getReducedPrice(), floor)).doubleValue());
@@ -1543,7 +1543,7 @@ public class CartClubServiceImpl implements CartClubService {
                         hasGift = true;
                         List<CartItemVo> giftList = baseMapper.getPromotionGifts(promotions.getId());
                         //满足叠加
-                        if (promotions.getDiscount() != null && promotions.getDiscount() == 0 && floor > 1) {
+                        if (promotions.getDiscount() != null && promotions.getDiscount() == 1 && floor > 1) {
                             Integer in = floor.intValue();
                             List<CartItemVo> g = new ArrayList<>();
                             g.addAll(giftList);
@@ -1606,7 +1606,7 @@ public class CartClubServiceImpl implements CartClubService {
             Double totalAmount = MathUtil.mul(cartItemVo.getNumber(), cartItemVo.getPrice()).doubleValue();
             Double floor = Math.floor(MathUtil.div(totalAmount, promotions.getTouchPrice()).doubleValue());
             //满足叠加
-            if (promotions.getDiscount() != null && promotions.getDiscount() == 0 && floor > 1) {
+            if (promotions.getDiscount() != null && promotions.getDiscount() == 1 && floor > 1) {
                 Integer in = floor.intValue();
                 List<CartItemVo> g = new ArrayList<>();
                 g.addAll(giftList);

+ 12 - 12
src/main/java/com/caimei365/order/service/impl/CartSellerServiceImpl.java

@@ -107,7 +107,7 @@ public class CartSellerServiceImpl implements CartSellerService {
                 AtomicDouble shopSvipReducedPrice = new AtomicDouble(0);
                 // 供应商促销优惠活动
                 PromotionsVo shopPromotion = baseMapper.getPromotionByShopId(shop.getShopId());
-                if (shopPromotion != null && shopPromotion.getSeen() != null && shopPromotion.getSeen() == 1) {
+                if (shopPromotion != null && shopPromotion.getSeen() != null && shopPromotion.getSeen() == 2) {
                     shopPromotion = null;
                 }
                 // 供应商下商品列表
@@ -147,7 +147,7 @@ public class CartSellerServiceImpl implements CartSellerService {
                                 // 获取商品促销信息
                                 promotions = baseMapper.getPromotionByProductId(cartItemVo.getProductId());
                                 // 促销活动如果协销不可见直接置空
-                                if (promotions != null && promotions.getSeen() != null && promotions.getSeen() == 1) {
+                                if (promotions != null && promotions.getSeen() != null && promotions.getSeen() == 2) {
                                     promotions = null;
                                 }
                                 /*
@@ -164,7 +164,7 @@ public class CartSellerServiceImpl implements CartSellerService {
                                     //单品满减-计算供应商总价/满减金额
                                     if (promotions.getType() == 1 && promotions.getMode() == 2) {
                                         if (MathUtil.compare(totalAmount, promotions.getTouchPrice()) > -1) {
-                                            if (promotions.getDiscount() != null && promotions.getDiscount() == 0 && floor > 1) {
+                                            if (promotions.getDiscount() != null && promotions.getDiscount() == 1 && floor > 1) {
                                                 //叠加优惠计算
                                                 shopPrice.set(MathUtil.sub(shopPrice.get(), MathUtil.mul(promotions.getReducedPrice(), floor)).doubleValue());
                                                 shopReducedPrice.set(MathUtil.add(shopReducedPrice, MathUtil.mul(promotions.getReducedPrice(), floor)).doubleValue());
@@ -227,7 +227,7 @@ public class CartSellerServiceImpl implements CartSellerService {
                             // 获取赠品
                             List<CartItemVo> giftList = baseMapper.getPromotionGifts(shopPromotion.getId());
                             // 叠加赠品
-                            if (shopPromotion.getDiscount() != null && shopPromotion.getDiscount() == 0 && floor > 1) {
+                            if (shopPromotion.getDiscount() != null && shopPromotion.getDiscount() == 1 && floor > 1) {
                                 Integer in = floor.intValue();
                                 List<CartItemVo> g = new ArrayList<>();
                                 g.addAll(giftList);
@@ -253,7 +253,7 @@ public class CartSellerServiceImpl implements CartSellerService {
                         totalPromotions.add(shopPromotion);
                         // 店铺满减-计算供应商总价/满减金额
                         if (shopPromotion.getMode() == 2 && MathUtil.compare(shopPrice, shopPromotion.getTouchPrice()) > -1) {
-                            if (shopPromotion.getDiscount() != null && shopPromotion.getDiscount() == 0 && floor > 1) {
+                            if (shopPromotion.getDiscount() != null && shopPromotion.getDiscount() == 1 && floor > 1) {
                                 // 该供应商总价 - 满减金额
                                 shopPrice.set(MathUtil.sub(shopPrice.get(), MathUtil.mul(shopPromotion.getReducedPrice(), floor)).doubleValue());
                                 // 该供应商优惠总额 + 满减金额
@@ -484,7 +484,7 @@ public class CartSellerServiceImpl implements CartSellerService {
                 AtomicDouble shopSvipReducedPrice = new AtomicDouble(0);
                 // 供应商促销优惠活动
                 PromotionsVo shopPromotion = baseMapper.getPromotionByShopId(shop.getShopId());
-                if (shopPromotion != null && shopPromotion.getSeen() != null && shopPromotion.getSeen() == 1) {
+                if (shopPromotion != null && shopPromotion.getSeen() != null && shopPromotion.getSeen() == 2) {
                     shopPromotion = null;
                 }
                 // 供应商下商品列表
@@ -514,7 +514,7 @@ public class CartSellerServiceImpl implements CartSellerService {
                                 // 获取商品促销信息
                                 promotions = baseMapper.getPromotionByProductId(cartItemVo.getProductId());
                                 // 促销活动如果协销不可见直接置空
-                                if (promotions != null && promotions.getSeen() != null && promotions.getSeen() == 1) {
+                                if (promotions != null && promotions.getSeen() != null && promotions.getSeen() == 2) {
                                     promotions = null;
                                 }
                                 /*
@@ -531,7 +531,7 @@ public class CartSellerServiceImpl implements CartSellerService {
                                     //单品满减-计算供应商总价/满减金额
                                     if (promotions.getType() == 1 && promotions.getMode() == 2) {
                                         if (MathUtil.compare(totalAmount, promotions.getTouchPrice()) > -1) {
-                                            if (promotions.getDiscount() != null && promotions.getDiscount() == 0 && floor > 1) {
+                                            if (promotions.getDiscount() != null && promotions.getDiscount() == 1 && floor > 1) {
                                                 //叠加优惠计算
                                                 shopPrice.set(MathUtil.sub(shopPrice.get(), MathUtil.mul(promotions.getReducedPrice(), floor)).doubleValue());
                                                 shopReducedPrice.set(MathUtil.add(shopReducedPrice, MathUtil.mul(promotions.getReducedPrice(), floor)).doubleValue());
@@ -592,7 +592,7 @@ public class CartSellerServiceImpl implements CartSellerService {
                                     // 获取赠品
                                     List<CartItemVo> giftList = baseMapper.getPromotionGifts(shopPromotion.getId());
                                     // 叠加赠品
-                                    if (shopPromotion.getDiscount() != null && shopPromotion.getDiscount() == 0 && floor > 1) {
+                                    if (shopPromotion.getDiscount() != null && shopPromotion.getDiscount() == 1 && floor > 1) {
                                         Integer in = floor.intValue();
                                         List<CartItemVo> g = new ArrayList<>();
                                         g.addAll(giftList);
@@ -621,7 +621,7 @@ public class CartSellerServiceImpl implements CartSellerService {
                                 totalPromotions.add(shopPromotion);
                                 // 店铺满减-计算供应商总价/满减金额
                                 if (shopPromotion.getMode() == 2 && MathUtil.compare(shopPromotionFee, shopPromotion.getTouchPrice()) > -1) {
-                                    if (shopPromotion.getDiscount() != null && shopPromotion.getDiscount() == 0 && floor > 1) {
+                                    if (shopPromotion.getDiscount() != null && shopPromotion.getDiscount() == 1 && floor > 1) {
                                         // 该供应商总价 - 满减金额
                                         shopPrice.set(MathUtil.sub(shopPrice.get(), MathUtil.mul(shopPromotion.getReducedPrice(), floor)).doubleValue());
                                         // 该供应商优惠总额 + 满减金额
@@ -676,7 +676,7 @@ public class CartSellerServiceImpl implements CartSellerService {
             Double floor = Math.floor(MathUtil.div(touchPrice, promotions.getTouchPrice()).doubleValue());
             if (promotions.getType() == 2 && promotions.getMode() == 2) {
                 if (MathUtil.compare(touchPrice, promotions.getTouchPrice()) > -1) {
-                    if (promotions.getDiscount() != null && promotions.getDiscount() == 0 && floor > 1) {
+                    if (promotions.getDiscount() != null && promotions.getDiscount() == 1 && floor > 1) {
                         //叠加优惠计算
                         // 总价 - 满减金额
                         totalPrice.set(MathUtil.sub(totalPrice, MathUtil.mul(promotions.getReducedPrice(), floor)).doubleValue());
@@ -693,7 +693,7 @@ public class CartSellerServiceImpl implements CartSellerService {
                 //满赠叠加
                 List<CartItemVo> giftList = baseMapper.getPromotionGifts(promotions.getId());
                 //满足叠加
-                if (promotions.getDiscount() != null && promotions.getDiscount() == 0 && floor > 1) {
+                if (promotions.getDiscount() != null && promotions.getDiscount() == 1 && floor > 1) {
                     Integer in = floor.intValue();
                     List<CartItemVo> g = new ArrayList<>();
                     g.addAll(giftList);

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

@@ -501,10 +501,10 @@ public class SubmitServiceImpl implements SubmitService {
                         promotions = baseMapper.getPromotionByProductId(productId);
                     }
                     //促销活动如果协销不可见,置为空
-                    if (promotions != null && promotions.getSeen() != null && promotions.getSeen() == 1 && userIdentity == 1) {
+                    if (promotions != null && promotions.getSeen() != null && promotions.getSeen() == 2 && userIdentity == 1) {
                         promotions = null;
                     }
-                    if (shopPromotions != null && shopPromotions.getSeen() != null && shopPromotions.getSeen() == 1 && userIdentity == 1) {
+                    if (shopPromotions != null && shopPromotions.getSeen() != null && shopPromotions.getSeen() == 2 && userIdentity == 1) {
                         shopPromotions = null;
                     }
                     // 计算单价
@@ -603,7 +603,7 @@ public class SubmitServiceImpl implements SubmitService {
                                 // 满减
                                 if (promotions.getMode() == 2) {
 
-                                    if (promotions.getDiscount() != null && promotions.getDiscount() == 0) {
+                                    if (promotions.getDiscount() != null && promotions.getDiscount() == 1) {
                                         //叠加优惠计算
                                         //叠加倍数
                                         Double floor = Math.floor(MathUtil.div(productFee, promotions.getTouchPrice()).doubleValue());
@@ -764,7 +764,7 @@ public class SubmitServiceImpl implements SubmitService {
                     hasActProductFlag = true;
                     // 满减
                     if (shopPromotions.getMode() == 2) {
-                        if (shopPromotions.getDiscount() != null && shopPromotions.getDiscount() == 0) {
+                        if (shopPromotions.getDiscount() != null && shopPromotions.getDiscount() == 1) {
                             //叠加优惠计算
                             //叠加倍数
                             Double floor = Math.floor(MathUtil.div(shopPromotionFee.get(), shopPromotions.getTouchPrice()).doubleValue());
@@ -866,7 +866,7 @@ public class SubmitServiceImpl implements SubmitService {
                         //判断是否达到满减满赠要求
                         if (MathUtil.compare(tempProductFee.get(), promotions.getTouchPrice()) >= 0) {
                             if (promotions.getMode() == 2) {
-                                if (promotions.getDiscount() != null && promotions.getDiscount() == 0) {
+                                if (promotions.getDiscount() != null && promotions.getDiscount() == 1) {
                                     //叠加优惠计算
                                     //叠加倍数
                                     Double floor = Math.floor(MathUtil.div(tempProductFee.get(), promotions.getTouchPrice()).doubleValue());

+ 9 - 6
src/test/java/com/caimei365/order/OrderApplicationTests.java

@@ -1,13 +1,15 @@
 //package com.caimei365.order;
 //
-//import com.caimei365.order.utils.MathUtil;
+//import com.alibaba.fastjson.JSON;
+//import com.alibaba.fastjson.JSONObject;
 //import org.junit.jupiter.api.Test;
 //import org.springframework.boot.test.context.SpringBootTest;
 //
-//import java.util.ArrayList;
-//import java.util.List;
-//import java.util.Random;
-//import java.util.concurrent.atomic.AtomicReference;
+//import java.io.IOException;
+//import java.io.InputStream;
+//import java.lang.reflect.Type;
+//import java.util.*;
+//import java.util.stream.Collectors;
 //
 ///**
 // * Description
@@ -19,7 +21,7 @@
 //class OrderApplicationTests {
 //
 //    @Test
-//    void contextLoads() {
+//    void contextLoads() throws IOException {
 ////        Random rand = new Random();
 ////        String code = "";
 ////        for (int j = 0; j < 5; j++) {
@@ -29,5 +31,6 @@
 ////        System.out.println(System.currentTimeMillis());
 ////        System.out.println(System.currentTimeMillis()/1000);
 ////        System.out.println(Math.floor(MathUtil.div(100, 1.7).doubleValue()));
+//
 //    }
 //}