Commit 6a22e638 by chongfu.liang

优惠为空时

parent fdba72eb
...@@ -391,24 +391,20 @@ public abstract class AbstractAddGoodsService implements AddGoodsService { ...@@ -391,24 +391,20 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
BenefitBeanBO benefitBeanBO = benefitBeanBOList.get(0); BenefitBeanBO benefitBeanBO = benefitBeanBOList.get(0);
//调用没有加入购物车的提示语的方法 //调用没有加入购物车的提示语的方法
activityList = setMessageNotInShoppingCart(messageBuilder, activityBO, benefitBeanBOList, benefitBeanBO); activityList = setMessageNotInShoppingCart(messageBuilder, activityBO, benefitBeanBOList, benefitBeanBO);
} else {
//促销返回满减提示语
} List<CalculationDiscountBO.CalculationDiscountResult.ActivityPrompt> activityPrompts = discountResult.getActivityPrompts();
//List<CalculationSharingDiscountResponseDto.CalculationDiscountResult.Discount> discounts = discountResult.getDiscounts();
/**
//促销返回满减提示语 * 构建提示语
List<CalculationDiscountBO.CalculationDiscountResult.ActivityPrompt> activityPrompts = discountResult.getActivityPrompts(); */
//List<CalculationSharingDiscountResponseDto.CalculationDiscountResult.Discount> discounts = discountResult.getDiscounts(); if (CollectionUtils.isNotEmpty(activityPrompts)) {
/** activityList = setMessageSatisfyCart(messageBuilder, activityPrompts, activityBO);
* 构建提示语 }
*/ else {
if (CollectionUtils.isNotEmpty(activityPrompts)) { activityList = setMessageNoSatisfyCart(messageBuilder, discountResult.getDiscounts());
activityList = setMessageSatisfyCart(messageBuilder, activityPrompts, activityBO); }
}
else {
activityList = setMessageNoSatisfyCart(messageBuilder, discountResult.getDiscounts());
} }
/** /**
* 调用促销统一活动查询,过滤出参与的满减(目前只有每满减和阶梯满减) * 调用促销统一活动查询,过滤出参与的满减(目前只有每满减和阶梯满减)
*/ */
...@@ -438,6 +434,10 @@ public abstract class AbstractAddGoodsService implements AddGoodsService { ...@@ -438,6 +434,10 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
private CalCostBO getComDiscountResult(BaseAddGoodsBO baseRequestDTO, DiscountResultBO discountResultBO, CalCostBO before) { private CalCostBO getComDiscountResult(BaseAddGoodsBO baseRequestDTO, DiscountResultBO discountResultBO, CalCostBO before) {
if (before.getGetCalculationDiscountBO() == null){
before.setCalculationDiscountBO(new CalculationDiscountBO());
return before;
}
CalculationDiscountBO calculationDiscountBO = promotionManager.calculationDiscount(before.getGetCalculationDiscountBO(), baseRequestDTO.getManagerService().getPromotionService()); CalculationDiscountBO calculationDiscountBO = promotionManager.calculationDiscount(before.getGetCalculationDiscountBO(), baseRequestDTO.getManagerService().getPromotionService());
before.setCalculationDiscountBO(calculationDiscountBO); before.setCalculationDiscountBO(calculationDiscountBO);
...@@ -755,7 +755,7 @@ public abstract class AbstractAddGoodsService implements AddGoodsService { ...@@ -755,7 +755,7 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
ActivityBO activityBO = promotionManager.queryActivityByType(getActivityBO, baseRequestDTO.getManagerService().getPromotionService()); ActivityBO activityBO = promotionManager.queryActivityByType(getActivityBO, baseRequestDTO.getManagerService().getPromotionService());
fullReduction.setActivityBO(activityBO); fullReduction.setActivityBO(activityBO);
if (activityBO == null){ if (discountResult == null || activityBO == null){
return fullReduction; return fullReduction;
} }
......
...@@ -371,7 +371,10 @@ public class AbstractApportionService implements GetShoppingCartGoodsApportionSe ...@@ -371,7 +371,10 @@ public class AbstractApportionService implements GetShoppingCartGoodsApportionSe
} }
private CalCostBO getComDiscountResult(ShoppingCartGoodsApportionBO baseRequestDTO, DiscountResultBO discountResultBO, CalCostBO before) { private CalCostBO getComDiscountResult(ShoppingCartGoodsApportionBO baseRequestDTO, DiscountResultBO discountResultBO, CalCostBO before) {
if (before.getGetCalculationDiscountBO() == null){
before.setCalculationDiscountBO(new CalculationDiscountBO());
return before;
}
CalculationDiscountBO calculationDiscountBO = promotionManager.calculationDiscount(before.getGetCalculationDiscountBO(), baseRequestDTO.getManagerService().getPromotionService()); CalculationDiscountBO calculationDiscountBO = promotionManager.calculationDiscount(before.getGetCalculationDiscountBO(), baseRequestDTO.getManagerService().getPromotionService());
before.setCalculationDiscountBO(calculationDiscountBO); before.setCalculationDiscountBO(calculationDiscountBO);
......
...@@ -428,7 +428,10 @@ public class AbstractListCartGoodsService implements ListCartGoodsService { ...@@ -428,7 +428,10 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
} }
private CalCostBO getComDiscountResult(ListCartGoodsBO baseRequestDTO, DiscountResultBO discountResultBO, CalCostBO before) { private CalCostBO getComDiscountResult(ListCartGoodsBO baseRequestDTO, DiscountResultBO discountResultBO, CalCostBO before) {
if (before.getGetCalculationDiscountBO() == null){
before.setCalculationDiscountBO(new CalculationDiscountBO());
return before;
}
if (CollectionUtils.isNotEmpty(before.getGetCalculationDiscountBO().getGoods())){ if (CollectionUtils.isNotEmpty(before.getGetCalculationDiscountBO().getGoods())){
CalculationDiscountBO calculationDiscountBO = promotionManager.calculationDiscount(before.getGetCalculationDiscountBO(), baseRequestDTO.getManagerService().getPromotionService()); CalculationDiscountBO calculationDiscountBO = promotionManager.calculationDiscount(before.getGetCalculationDiscountBO(), baseRequestDTO.getManagerService().getPromotionService());
calculationDiscountBO.getResult().setValidCouponMap(before.getValidCouponMap()); calculationDiscountBO.getResult().setValidCouponMap(before.getValidCouponMap());
......
...@@ -357,20 +357,19 @@ public abstract class AbstractUpdateGoodsQtyService implements UpdateGoodsQtySer ...@@ -357,20 +357,19 @@ public abstract class AbstractUpdateGoodsQtyService implements UpdateGoodsQtySer
activityList = setMessageNotInShoppingCart(messageBuilder, activityBO, benefitBeanBOList, benefitBeanBO); activityList = setMessageNotInShoppingCart(messageBuilder, activityBO, benefitBeanBOList, benefitBeanBO);
} } else {
//促销返回满减提示语
List<CalculationDiscountBO.CalculationDiscountResult.ActivityPrompt> activityPrompts = discountResult.getActivityPrompts();
//促销返回满减提示语 //List<CalculationSharingDiscountResponseDto.CalculationDiscountResult.Discount> discounts = discountResult.getDiscounts();
List<CalculationDiscountBO.CalculationDiscountResult.ActivityPrompt> activityPrompts = discountResult.getActivityPrompts(); /**
//List<CalculationSharingDiscountResponseDto.CalculationDiscountResult.Discount> discounts = discountResult.getDiscounts(); * 构建提示语
/** */
* 构建提示语 if (CollectionUtils.isNotEmpty(activityPrompts)) {
*/ activityList = setMessageSatisfyCart(messageBuilder, activityPrompts, activityBO);
if (CollectionUtils.isNotEmpty(activityPrompts)) { }
activityList = setMessageSatisfyCart(messageBuilder, activityPrompts, activityBO); else {
} activityList = setMessageNoSatisfyCart(messageBuilder, discountResult.getDiscounts());
else { }
activityList = setMessageNoSatisfyCart(messageBuilder, discountResult.getDiscounts());
} }
/** /**
...@@ -400,7 +399,10 @@ public abstract class AbstractUpdateGoodsQtyService implements UpdateGoodsQtySer ...@@ -400,7 +399,10 @@ public abstract class AbstractUpdateGoodsQtyService implements UpdateGoodsQtySer
} }
private CalCostBO getComDiscountResult(UpdateAddGoodsBO baseRequestDTO, DiscountResultBO discountResultBO, CalCostBO before) { private CalCostBO getComDiscountResult(UpdateAddGoodsBO baseRequestDTO, DiscountResultBO discountResultBO, CalCostBO before) {
if (before.getGetCalculationDiscountBO() == null){
before.setCalculationDiscountBO(new CalculationDiscountBO());
return before;
}
CalculationDiscountBO calculationDiscountBO = promotionManager.calculationDiscount(before.getGetCalculationDiscountBO(), baseRequestDTO.getManagerService().getPromotionService()); CalculationDiscountBO calculationDiscountBO = promotionManager.calculationDiscount(before.getGetCalculationDiscountBO(), baseRequestDTO.getManagerService().getPromotionService());
before.setCalculationDiscountBO(calculationDiscountBO); before.setCalculationDiscountBO(calculationDiscountBO);
...@@ -719,7 +721,7 @@ public abstract class AbstractUpdateGoodsQtyService implements UpdateGoodsQtySer ...@@ -719,7 +721,7 @@ public abstract class AbstractUpdateGoodsQtyService implements UpdateGoodsQtySer
ActivityBO activityBO = promotionManager.queryActivityByType(getActivityBO, baseRequestDTO.getManagerService().getPromotionService()); ActivityBO activityBO = promotionManager.queryActivityByType(getActivityBO, baseRequestDTO.getManagerService().getPromotionService());
fullReduction.setActivityBO(activityBO); fullReduction.setActivityBO(activityBO);
if (activityBO == null){ if (discountResult == null || activityBO == null){
return fullReduction; return fullReduction;
} }
......
...@@ -82,11 +82,7 @@ public class PlatformAddGoodsService extends AbstractAddGoodsService { ...@@ -82,11 +82,7 @@ public class PlatformAddGoodsService extends AbstractAddGoodsService {
} }
} }
//剔除商品数量为空的
calculationDiscountGoodsList.removeIf(v->v.getGoodsQuantity().equals(0));
if (CollectionUtils.isEmpty(calculationDiscountGoodsList)) {
return null;
}
//组装促销 //组装促销
calculationSharingDiscountRequestDto.setGoods(calculationDiscountGoodsList); calculationSharingDiscountRequestDto.setGoods(calculationDiscountGoodsList);
...@@ -94,8 +90,13 @@ public class PlatformAddGoodsService extends AbstractAddGoodsService { ...@@ -94,8 +90,13 @@ public class PlatformAddGoodsService extends AbstractAddGoodsService {
calculationSharingDiscountRequestDto.setOrgIds(baseRequestDTO.getManagerService().getStoreService().getOrgIds(new GetStoreBO(baseRequestDTO.getPartnerId(), baseRequestDTO.getShopId()))); calculationSharingDiscountRequestDto.setOrgIds(baseRequestDTO.getManagerService().getStoreService().getOrgIds(new GetStoreBO(baseRequestDTO.getPartnerId(), baseRequestDTO.getShopId())));
calculationSharingDiscountRequestDto.setDistributionFee(deliveryAmount); calculationSharingDiscountRequestDto.setDistributionFee(deliveryAmount);
calculationSharingDiscountRequestDto.setIsMember(discountResultBO.getIsMember()); calculationSharingDiscountRequestDto.setIsMember(discountResultBO.getIsMember());
//剔除商品数量为空的
calCostBO.setGetCalculationDiscountBO(calculationSharingDiscountRequestDto); calculationDiscountGoodsList.removeIf(v->v.getGoodsQuantity().equals(0));
if (CollectionUtils.isEmpty(calculationDiscountGoodsList)) {
calCostBO.setGetCalculationDiscountBO(null);
} else {
calCostBO.setGetCalculationDiscountBO(calculationSharingDiscountRequestDto);
}
calCostBO.setCartGoods(discountResultBO.getCartGoods()); calCostBO.setCartGoods(discountResultBO.getCartGoods());
return calCostBO; return calCostBO;
} }
......
...@@ -136,12 +136,6 @@ public class PlatformApportionService extends AbstractApportionService { ...@@ -136,12 +136,6 @@ public class PlatformApportionService extends AbstractApportionService {
calculationSharingDiscountRequestDto.setSelectActivityList(selectActivityLists); calculationSharingDiscountRequestDto.setSelectActivityList(selectActivityLists);
} }
//剔除商品数量为空的
calculationDiscountGoodsList.removeIf(v->v.getGoodsQuantity().equals(0));
if (CollectionUtils.isEmpty(calculationDiscountGoodsList)) {
return null;
}
//组装促销 //组装促销
calculationSharingDiscountRequestDto.setGoods(calculationDiscountGoodsList); calculationSharingDiscountRequestDto.setGoods(calculationDiscountGoodsList);
calculationSharingDiscountRequestDto.setCoupons(coupons); calculationSharingDiscountRequestDto.setCoupons(coupons);
...@@ -149,7 +143,13 @@ public class PlatformApportionService extends AbstractApportionService { ...@@ -149,7 +143,13 @@ public class PlatformApportionService extends AbstractApportionService {
calculationSharingDiscountRequestDto.setDistributionFee(deliveryAmount); calculationSharingDiscountRequestDto.setDistributionFee(deliveryAmount);
calculationSharingDiscountRequestDto.setIsMember(discountResultBO.getIsMember()); calculationSharingDiscountRequestDto.setIsMember(discountResultBO.getIsMember());
calCostBO.setGetCalculationDiscountBO(calculationSharingDiscountRequestDto); //剔除商品数量为空的
calculationDiscountGoodsList.removeIf(v->v.getGoodsQuantity().equals(0));
if (CollectionUtils.isEmpty(calculationDiscountGoodsList)) {
calCostBO.setGetCalculationDiscountBO(null);
} else {
calCostBO.setGetCalculationDiscountBO(calculationSharingDiscountRequestDto);
}
calCostBO.setValidCouponMap(discountResultBO.getValidCouponMap()); calCostBO.setValidCouponMap(discountResultBO.getValidCouponMap());
calCostBO.setCartGoods(discountResultBO.getCartGoods()); calCostBO.setCartGoods(discountResultBO.getCartGoods());
return calCostBO; return calCostBO;
......
...@@ -147,14 +147,20 @@ public class PlatformListCartGoodsService extends AbstractListCartGoodsService { ...@@ -147,14 +147,20 @@ public class PlatformListCartGoodsService extends AbstractListCartGoodsService {
calculationSharingDiscountRequestDto.setSelectActivityList(selectActivityLists); calculationSharingDiscountRequestDto.setSelectActivityList(selectActivityLists);
} }
//组装促销 //组装促销
calculationSharingDiscountRequestDto.setGoods(calculationDiscountGoodsList); calculationSharingDiscountRequestDto.setGoods(calculationDiscountGoodsList);
calculationSharingDiscountRequestDto.setCoupons(coupons); calculationSharingDiscountRequestDto.setCoupons(coupons);
calculationSharingDiscountRequestDto.setOrgIds(baseRequestDTO.getManagerService().getStoreService().getOrgIds(new GetStoreBO(baseRequestDTO.getPartnerId(), baseRequestDTO.getShopId()))); calculationSharingDiscountRequestDto.setOrgIds(baseRequestDTO.getManagerService().getStoreService().getOrgIds(new GetStoreBO(baseRequestDTO.getPartnerId(), baseRequestDTO.getShopId())));
calculationSharingDiscountRequestDto.setDistributionFee(deliveryAmount); calculationSharingDiscountRequestDto.setDistributionFee(deliveryAmount);
calculationSharingDiscountRequestDto.setIsMember(discountResultBO.getIsMember()); calculationSharingDiscountRequestDto.setIsMember(discountResultBO.getIsMember());
//剔除商品数量为空的
calCostBO.setGetCalculationDiscountBO(calculationSharingDiscountRequestDto); calculationDiscountGoodsList.removeIf(v->v.getGoodsQuantity().equals(0));
if (CollectionUtils.isEmpty(calculationDiscountGoodsList)) {
calCostBO.setGetCalculationDiscountBO(null);
} else {
calCostBO.setGetCalculationDiscountBO(calculationSharingDiscountRequestDto);
}
calCostBO.setValidCouponMap(discountResultBO.getValidCouponMap()); calCostBO.setValidCouponMap(discountResultBO.getValidCouponMap());
calCostBO.setCartGoods(discountResultBO.getCartGoods()); calCostBO.setCartGoods(discountResultBO.getCartGoods());
return calCostBO; return calCostBO;
......
...@@ -94,20 +94,19 @@ public class PlatformUpdateGoodsQtyService extends AbstractUpdateGoodsQtyService ...@@ -94,20 +94,19 @@ public class PlatformUpdateGoodsQtyService extends AbstractUpdateGoodsQtyService
} }
} }
//剔除商品数量为空的
calculationDiscountGoodsList.removeIf(v->v.getGoodsQuantity().equals(0));
if (CollectionUtils.isEmpty(calculationDiscountGoodsList)) {
return null;
}
//组装促销 //组装促销
calculationSharingDiscountRequestDto.setGoods(calculationDiscountGoodsList); calculationSharingDiscountRequestDto.setGoods(calculationDiscountGoodsList);
calculationSharingDiscountRequestDto.setCoupons(coupons); calculationSharingDiscountRequestDto.setCoupons(coupons);
calculationSharingDiscountRequestDto.setOrgIds(baseRequestDTO.getManagerService().getStoreService().getOrgIds(new GetStoreBO(baseRequestDTO.getPartnerId(), baseRequestDTO.getShopId()))); calculationSharingDiscountRequestDto.setOrgIds(baseRequestDTO.getManagerService().getStoreService().getOrgIds(new GetStoreBO(baseRequestDTO.getPartnerId(), baseRequestDTO.getShopId())));
calculationSharingDiscountRequestDto.setDistributionFee(deliveryAmount); calculationSharingDiscountRequestDto.setDistributionFee(deliveryAmount);
calculationSharingDiscountRequestDto.setIsMember(discountResultBO.getIsMember()); calculationSharingDiscountRequestDto.setIsMember(discountResultBO.getIsMember());
//剔除商品数量为空的
calCostBO.setGetCalculationDiscountBO(calculationSharingDiscountRequestDto); calculationDiscountGoodsList.removeIf(v->v.getGoodsQuantity().equals(0));
if (CollectionUtils.isEmpty(calculationDiscountGoodsList)) {
calCostBO.setGetCalculationDiscountBO(null);
} else {
calCostBO.setGetCalculationDiscountBO(calculationSharingDiscountRequestDto);
}
calCostBO.setCartGoods(discountResultBO.getCartGoods()); calCostBO.setCartGoods(discountResultBO.getCartGoods());
return calCostBO; return calCostBO;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment