|
@@ -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);
|