Commit 3cf90c42 by chongfu.liang

添加运费

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