Commit abddbcbb by 姜海波

Merge remote-tracking branch 'remotes/origin/feature-2020/2/10-1.9.15-免配送费二期-海波' into qa

# Conflicts:
#	shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
parent 2d05dbc7
...@@ -1011,9 +1011,11 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1011,9 +1011,11 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
ActivityQueryResponseDto activityQueryResponseDto = activityService.queryActivityByType(activityQueryDto, activityTypeEnums, null); ActivityQueryResponseDto activityQueryResponseDto = activityService.queryActivityByType(activityQueryDto, activityTypeEnums, null);
ActivityResponseDto activityResponse =null; ActivityResponseDto activityResponse =null;
BenefitBeanDto beanDto=null;
if (activityQueryResponseDto != null &&activityQueryResponseDto.getResult()!=null && activityQueryResponseDto.getResult().size()>0) { if (activityQueryResponseDto != null &&activityQueryResponseDto.getResult()!=null && activityQueryResponseDto.getResult().size()>0) {
activityResponse = activityQueryResponseDto.getResult().get(0); activityResponse = activityQueryResponseDto.getResult().get(0);
shoppingCartGoodsResponseVo.setDiscountDeliveryActivityCode(activityResponse.getActivityCode()); shoppingCartGoodsResponseVo.setDiscountDeliveryActivityCode(activityResponse.getActivityCode());
beanDto=activityResponse.getBenefits().get(0);
} }
ActivityCalculationDiscountResponseDto.CalculationDiscountResult.Discount discount=null; ActivityCalculationDiscountResponseDto.CalculationDiscountResult.Discount discount=null;
...@@ -1027,13 +1029,12 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1027,13 +1029,12 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
discount=discountop.orElseGet(() -> {return null ;}); discount=discountop.orElseGet(() -> {return null ;});
} }
if(discount!=null){ if(discount!=null){
if(calculationDiscountResult.getDistributionFee()>0){ if(beanDto.getBenefitType() == 1){
String desc = DELIVERY_DISCOUNT_DESC1;
shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, discount.getThresholdAmount().doubleValue() / 100
, (calculationDiscountResult.getDeliveryAmount().doubleValue() - calculationDiscountResult.getDistributionFee().doubleValue()) / 100));
}else{
String desc = DELIVERY_DISCOUNT_DESC2; String desc = DELIVERY_DISCOUNT_DESC2;
shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, discount.getThresholdAmount().doubleValue() / 100)); shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, beanDto.getThresholdAmount() /100 ));
}else{
String desc = DELIVERY_DISCOUNT_DESC1;
shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, beanDto.getThresholdAmount() /100 ,beanDto.getDiscountAmount() / 100));
} }
shoppingCartGoodsResponseVo.setDeliveryAmount(calculationDiscountResult.getDeliveryAmount()); shoppingCartGoodsResponseVo.setDeliveryAmount(calculationDiscountResult.getDeliveryAmount());
shoppingCartGoodsResponseVo.setDiscountDeliveryAmount(calculationDiscountResult.getDistributionFee()); shoppingCartGoodsResponseVo.setDiscountDeliveryAmount(calculationDiscountResult.getDistributionFee());
...@@ -1043,14 +1044,12 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1043,14 +1044,12 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
if (activityResponse!=null) { if (activityResponse!=null) {
BenefitBeanDto beanDto=activityResponse.getBenefits().get(0); if(beanDto.getBenefitType() == 1){
if(beanDto.getBenefitType() == 1||beanDto.getDiscountAmount()>=deliveryAmount){
String desc = DELIVERY_DISCOUNT_DESC2; String desc = DELIVERY_DISCOUNT_DESC2;
shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, beanDto.getThresholdAmount().doubleValue() /100 )); shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, beanDto.getThresholdAmount() /100 ));
}else{ }else{
String desc = DELIVERY_DISCOUNT_DESC1; String desc = DELIVERY_DISCOUNT_DESC1;
shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, beanDto.getThresholdAmount().doubleValue() /100 ,beanDto.getDiscountAmount().doubleValue() / 100)); shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, beanDto.getThresholdAmount() /100 ,beanDto.getDiscountAmount() / 100));
} }
shoppingCartGoodsResponseVo.setDeliveryAmount(deliveryAmount); shoppingCartGoodsResponseVo.setDeliveryAmount(deliveryAmount);
...@@ -1059,7 +1058,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1059,7 +1058,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}else{ }else{
String desc = DELIVERY_DISCOUNT_DESC3; String desc = DELIVERY_DISCOUNT_DESC3;
shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, deliveryAmount.doubleValue() / 100)); shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, deliveryAmount / 100));
shoppingCartGoodsResponseVo.setDeliveryAmount(deliveryAmount); shoppingCartGoodsResponseVo.setDeliveryAmount(deliveryAmount);
shoppingCartGoodsResponseVo.setDiscountDeliveryAmount(deliveryAmount); shoppingCartGoodsResponseVo.setDiscountDeliveryAmount(deliveryAmount);
shoppingCartGoodsResponseVo.setIsDiscountDelivery(false); shoppingCartGoodsResponseVo.setIsDiscountDelivery(false);
......
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