Commit 3cf90c42 by chongfu.liang

添加运费

parent 06f64d32
...@@ -22,6 +22,8 @@ public class CalCostBO { ...@@ -22,6 +22,8 @@ public class CalCostBO {
*/ */
private Boolean changed=false; private Boolean changed=false;
private Long deliveryAmount;
private HashMap<String, CheckSpqInfoResponseDto> validCouponMap; private HashMap<String, CheckSpqInfoResponseDto> validCouponMap;
private ShoppingCartContext shoppingCartContext; private ShoppingCartContext shoppingCartContext;
......
...@@ -16,6 +16,8 @@ public class DistributeBO { ...@@ -16,6 +16,8 @@ public class DistributeBO {
* 购物车中商品价格或有效性是否发生变化 * 购物车中商品价格或有效性是否发生变化
*/ */
private Boolean changed=false; private Boolean changed=false;
private Long deliveryAmount;
List<CartGoods> cartGoods; List<CartGoods> cartGoods;
......
...@@ -363,6 +363,7 @@ public class AbstractApportionService implements GetShoppingCartGoodsApportionSe ...@@ -363,6 +363,7 @@ public class AbstractApportionService implements GetShoppingCartGoodsApportionSe
distributeBO.setCartGoods(calCostBO.getCartGoods()); distributeBO.setCartGoods(calCostBO.getCartGoods());
distributeBO.setChanged(calCostBO.getChanged()); distributeBO.setChanged(calCostBO.getChanged());
distributeBO.setToastMsg(calCostBO.getToastMsg()); distributeBO.setToastMsg(calCostBO.getToastMsg());
distributeBO.setDeliveryAmount(calCostBO.getDeliveryAmount());
return distributeBO; return distributeBO;
} }
...@@ -501,7 +502,7 @@ public class AbstractApportionService implements GetShoppingCartGoodsApportionSe ...@@ -501,7 +502,7 @@ public class AbstractApportionService implements GetShoppingCartGoodsApportionSe
DeliveryBO delivery = null; DeliveryBO delivery = null;
if (BusinessTypeEnum.SAAS_DELIVERY.getCode().equals(baseRequestDTO.getMenuType())) { if (BusinessTypeEnum.SAAS_DELIVERY.getCode().equals(baseRequestDTO.getMenuType())) {
delivery = this.delivery(distributeBO.getCalculationDiscountBO(), baseRequestDTO, delivery = this.delivery(distributeBO.getCalculationDiscountBO(), baseRequestDTO,
activityQueryDto); activityQueryDto, distributeBO.getDeliveryAmount());
} }
/** /**
...@@ -736,12 +737,14 @@ public class AbstractApportionService implements GetShoppingCartGoodsApportionSe ...@@ -736,12 +737,14 @@ public class AbstractApportionService implements GetShoppingCartGoodsApportionSe
} }
public DeliveryBO delivery(CalculationDiscountBO calculationDiscountBO, ShoppingCartGoodsApportionBO baseRequestDTO public DeliveryBO delivery(CalculationDiscountBO calculationDiscountBO, ShoppingCartGoodsApportionBO baseRequestDTO
, ActivityQueryDto activityQueryDto , ActivityQueryDto activityQueryDto, Long calDeliveryAmount
) { ) {
CalculationDiscountBO.CalculationDiscountResult discountResult = null; CalculationDiscountBO.CalculationDiscountResult discountResult = null;
Long deliveryAmount = 0L; Long deliveryAmount = 0L;
if (calDeliveryAmount != null){
deliveryAmount = calDeliveryAmount;
}
if (calculationDiscountBO != null){ if (calculationDiscountBO != null){
deliveryAmount = calculationDiscountBO.getDistributionFee();
discountResult = calculationDiscountBO.getResult(); discountResult = calculationDiscountBO.getResult();
} }
......
...@@ -299,6 +299,7 @@ public class AbstractListCartGoodsService implements ListCartGoodsService { ...@@ -299,6 +299,7 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
distributeBO.setCartGoods(calCostBO.getCartGoods()); distributeBO.setCartGoods(calCostBO.getCartGoods());
distributeBO.setChanged(calCostBO.getChanged()); distributeBO.setChanged(calCostBO.getChanged());
distributeBO.setToastMsg(calCostBO.getToastMsg()); distributeBO.setToastMsg(calCostBO.getToastMsg());
distributeBO.setDeliveryAmount(calCostBO.getDeliveryAmount());
return distributeBO; return distributeBO;
} }
...@@ -483,7 +484,7 @@ public class AbstractListCartGoodsService implements ListCartGoodsService { ...@@ -483,7 +484,7 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
DeliveryBO delivery = null; DeliveryBO delivery = null;
if (BusinessTypeEnum.SAAS_DELIVERY.getCode().equals(baseRequestDTO.getMenuType())) { if (BusinessTypeEnum.SAAS_DELIVERY.getCode().equals(baseRequestDTO.getMenuType())) {
delivery = this.delivery(distributeBO.getCalculationDiscountBO(), baseRequestDTO, delivery = this.delivery(distributeBO.getCalculationDiscountBO(), baseRequestDTO,
activityQueryDto); activityQueryDto, distributeBO.getDeliveryAmount());
} }
/** /**
...@@ -607,7 +608,7 @@ public class AbstractListCartGoodsService implements ListCartGoodsService { ...@@ -607,7 +608,7 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
} }
public DeliveryBO delivery(CalculationDiscountBO calculationDiscountBO, ListCartGoodsBO baseRequestDTO public DeliveryBO delivery(CalculationDiscountBO calculationDiscountBO, ListCartGoodsBO baseRequestDTO
, ActivityQueryDto activityQueryDto) { , ActivityQueryDto activityQueryDto, Long calDeliveryAmount) {
DeliveryBO deliveryBO = new DeliveryBO(); DeliveryBO deliveryBO = new DeliveryBO();
DecimalFormat df = new DecimalFormat("###.##"); DecimalFormat df = new DecimalFormat("###.##");
List<ActivityTypeEnum> activityTypeEnums = new LinkedList<>(); List<ActivityTypeEnum> activityTypeEnums = new LinkedList<>();
...@@ -625,8 +626,8 @@ public class AbstractListCartGoodsService implements ListCartGoodsService { ...@@ -625,8 +626,8 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
CalculationDiscountBO.CalculationDiscountResult.Discount discount=null; CalculationDiscountBO.CalculationDiscountResult.Discount discount=null;
CalculationDiscountBO.CalculationDiscountResult discountResult = null; CalculationDiscountBO.CalculationDiscountResult discountResult = null;
Long deliveryAmount = 0L; Long deliveryAmount = 0L;
if (calculationDiscountBO != null){ if (calDeliveryAmount != null){
deliveryAmount = calculationDiscountBO.getDistributionFee(); deliveryAmount = calDeliveryAmount;
} }
if (calculationDiscountBO != null && calculationDiscountBO.getResult() != null && CollectionUtils.isNotEmpty(calculationDiscountBO.getResult().getDiscounts())) { if (calculationDiscountBO != null && calculationDiscountBO.getResult() != null && CollectionUtils.isNotEmpty(calculationDiscountBO.getResult().getDiscounts())) {
discountResult = calculationDiscountBO.getResult(); discountResult = calculationDiscountBO.getResult();
......
...@@ -152,6 +152,7 @@ public class PlatformApportionService extends AbstractApportionService { ...@@ -152,6 +152,7 @@ public class PlatformApportionService extends AbstractApportionService {
} }
calCostBO.setValidCouponMap(discountResultBO.getValidCouponMap()); calCostBO.setValidCouponMap(discountResultBO.getValidCouponMap());
calCostBO.setCartGoods(discountResultBO.getCartGoods()); calCostBO.setCartGoods(discountResultBO.getCartGoods());
calCostBO.setDeliveryAmount(deliveryAmount);
return calCostBO; return calCostBO;
} }
......
...@@ -163,6 +163,7 @@ public class PlatformListCartGoodsService extends AbstractListCartGoodsService { ...@@ -163,6 +163,7 @@ public class PlatformListCartGoodsService extends AbstractListCartGoodsService {
} }
calCostBO.setValidCouponMap(discountResultBO.getValidCouponMap()); calCostBO.setValidCouponMap(discountResultBO.getValidCouponMap());
calCostBO.setCartGoods(discountResultBO.getCartGoods()); calCostBO.setCartGoods(discountResultBO.getCartGoods());
calCostBO.setDeliveryAmount(deliveryAmount);
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