Commit 2b995ad8 by 周晓航

夜间配送费字段新增

Signed-off-by: 周晓航 <xiaohang.zhou@freemud.com>
parent 90a927d5
......@@ -360,6 +360,7 @@ public abstract class AbstractShoppingCartImpl implements ShoppingCartNewService
*/
public void updateShoppingCartGoodsDiscount(CouponPromotionVO couponPromotionVO, ActivityQueryDto activityQueryDto, CalculationDiscountResult calculationDiscountResult, List<CartGoods> cartGoodsList
, ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo, ShoppingCartInfoRequestVo shoppingCartInfoRequestVo, UserLoginInfoDto userLoginInfoDto,String menuType,Long deliveryAmount,long nightDistributionFee) {
deliveryAmount = Objects.isNull(deliveryAmount) ? 0L : deliveryAmount;
//默认计算优惠
DefaultPromotionService defaultPromotionService = (DefaultPromotionService) PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.DEFAULT_PROMOTION);
defaultPromotionService.updateShoppingCartGoodsDiscount(couponPromotionVO, activityQueryDto, calculationDiscountResult, cartGoodsList, shoppingCartGoodsResponseVo, userLoginInfoDto, shoppingCartInfoRequestVo);
......@@ -488,15 +489,15 @@ public abstract class AbstractShoppingCartImpl implements ShoppingCartNewService
shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, df.format(beanDto.getThresholdAmount().doubleValue() /100 ),df.format(beanDto.getDiscountAmount().doubleValue() / 100)));
}
shoppingCartGoodsResponseVo.setDeliveryAmount(deliveryAmount);
shoppingCartGoodsResponseVo.setDiscountDeliveryAmount(deliveryAmount);
shoppingCartGoodsResponseVo.setDeliveryAmount(deliverAmountNew);
shoppingCartGoodsResponseVo.setDiscountDeliveryAmount(deliverAmountNew);
shoppingCartGoodsResponseVo.setIsDiscountDelivery(false);
} else {
String desc = DELIVERY_DISCOUNT_DESC3;
shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, df.format(deliveryAmount.doubleValue() / 100)));
shoppingCartGoodsResponseVo.setDeliveryAmount(deliveryAmount);
shoppingCartGoodsResponseVo.setDiscountDeliveryAmount(deliveryAmount);
shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, df.format(deliverAmountNew.doubleValue() / 100)));
shoppingCartGoodsResponseVo.setDeliveryAmount(deliverAmountNew);
shoppingCartGoodsResponseVo.setDiscountDeliveryAmount(deliverAmountNew);
shoppingCartGoodsResponseVo.setIsDiscountDelivery(false);
}
}
......
......@@ -196,7 +196,7 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
CalculationDiscountResult discountResult = null;
discountResult = sharingDiscountService.getCalculationSharingDiscountResult(menuType, partnerId, storeId, userId, appId, orderType, assortmentCustomerInfoVo.isMemberPaid(), allCartGoodsList, new ArrayList<>(), null, deliveryAmount, null,null, accountType,new DiscountSharingDto(),0L);
sharingCartService.distribute(discountResult, allCartGoodsList, shoppingCartGoodsResponseVo, null, null, null, activityQueryDto, menuType, deliveryAmount, ShoppingCartConstant.ADD_AND_UPDATE, partnerId, null, userId, storeId);
sharingCartService.distribute(discountResult, allCartGoodsList, shoppingCartGoodsResponseVo, null, null, null, activityQueryDto, menuType, deliveryAmount, ShoppingCartConstant.ADD_AND_UPDATE, partnerId, null, userId, storeId,0L);
buildShoppingCartGoodsResponse(shoppingCartGoodsResponseVo,discountResult,null,partnerId);
......@@ -305,7 +305,7 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
, partnerId
, null
, userId
, storeId);
, storeId,0L);
buildShoppingCartGoodsResponse(shoppingCartGoodsResponseVo,discountResult,null,partnerId);
......@@ -463,7 +463,7 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
, partnerId
,shoppingCartInfoRequestVo.getFlag()
, userId
, storeId);
, storeId,0L);
buildShoppingCartGoodsResponse(shoppingCartGoodsResponseVo,calculationSharingDiscountResult,shoppingCartInfoRequestVo.getFlag(),partnerId);
......@@ -632,7 +632,7 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
, menuType
, deliveryAmount
, shoppingCartGoodsDto
, premiumExchangeActivity);
, premiumExchangeActivity,0L);
return ResponseUtil.success(shoppingCartGoodsDto);
}
......
......@@ -390,7 +390,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
newCalculationUpdateCouponStatus(userId, partnerId, storeId, bizType, cartGoods, allCartGoodsList, discountResult);
sharingCartService.distribute(discountResult, allCartGoodsList, shoppingCartGoodsResponseVo, null
, userLoginInfoDto, null, activityQueryDto, menuType, deliveryAmount
, ShoppingCartConstant.ADD_AND_UPDATE, partnerId, null, userId, storeId);
, ShoppingCartConstant.ADD_AND_UPDATE, partnerId, null, userId, storeId,this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList()));
buildShoppingCartGoodsResponse(shoppingCartGoodsResponseVo, discountResult, null, partnerId);
//
......@@ -554,7 +554,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
, partnerId
, null
, userId
, storeId);
, storeId
,this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList()));
buildShoppingCartGoodsResponse(shoppingCartGoodsResponseVo, discountResult, null, partnerId);
} else {
......@@ -794,7 +795,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
, partnerId
, shoppingCartInfoRequestVo.getFlag()
, userId
, storeId);
, storeId,this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList()));
buildShoppingCartGoodsResponse(shoppingCartGoodsResponseVo, calculationSharingDiscountResult, shoppingCartInfoRequestVo.getFlag(), partnerId);
} else {
List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> coupons = new ArrayList<>();
......@@ -1255,7 +1256,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
, menuType
, deliveryAmount
, shoppingCartGoodsDto
, premiumExchangeActivity);
, premiumExchangeActivity, this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList()));
} else {
List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> coupons = new ArrayList<>();
if (StringUtils.isNotEmpty(couponCode)) {
......
......@@ -68,7 +68,7 @@ public class CalculationSharingCartService {
, String partnerId
, Integer flag
, String userId
, String storeId) {
, String storeId, long nightDistributionFee) {
/**
* 用促销价格初始化购物车行记录成交价
......@@ -106,7 +106,7 @@ public class CalculationSharingCartService {
*/
scoreSharingService.scoreResponse(discountResult, shoppingCartGoodsResponseVo, userLoginInfoDto, shoppingCartInfoRequestVo);
if(BusinessTypeEnum.SAAS_DELIVERY.getCode().equals(menuType)){
deliverySharingService.deliveryResponse(discountResult, activityQueryDto, shoppingCartGoodsResponseVo, deliveryAmount);
deliverySharingService.deliveryResponse(discountResult, activityQueryDto, shoppingCartGoodsResponseVo, deliveryAmount, nightDistributionFee);
}
......
......@@ -77,7 +77,7 @@ public class CalculationSharingEquallyService {
, String menuType
, Long deliveryAmount
, ShoppingCartGoodsDto shoppingCartGoodsDto
, CreateOrderVo.PremiumExchangeActivity premiumExchangeActivity) {
, CreateOrderVo.PremiumExchangeActivity premiumExchangeActivity, long nightDistributionFee) {
calculationCommonService.initShoppingCart(discountResult,
cartGoodsList,
......@@ -148,7 +148,7 @@ public class CalculationSharingEquallyService {
calculationCommonService.getNeedCardAmount(shoppingCartInfoRequestVo, shoppingCartGoodsDto);
if(BusinessTypeEnum.SAAS_DELIVERY.getCode().equals(menuType)){
deliverySharingService.deliveryResponse(discountResult, activityQueryDto, shoppingCartGoodsResponseVo, deliveryAmount);
deliverySharingService.deliveryResponse(discountResult, activityQueryDto, shoppingCartGoodsResponseVo, deliveryAmount, nightDistributionFee);
}
calculationCommonService.setAddAndUpdateResponse(cartGoodsList, shoppingCartGoodsResponseVo, shoppingCartInfoRequestVo, ShoppingCartConstant.QUERY_INFO);
......
......@@ -47,7 +47,7 @@ public class DeliverySharingService {
public void deliveryResponse(CalculationDiscountResult discountResult
, ActivityQueryDto activityQueryDto
, ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo
, Long deliveryAmount) {
, Long deliveryAmount, long nightDistributionFee) {
DecimalFormat df = new DecimalFormat("###.##");
List<ActivityTypeEnum> activityTypeEnums = new LinkedList<>();
......@@ -90,6 +90,7 @@ public class DeliverySharingService {
shoppingCartGoodsResponseVo.setIsDiscountDelivery(true);
}
else {
Long deliverAmountNew = deliveryAmount + nightDistributionFee;
if (activityResponse!=null) {
// 这里表示有活动, 但是没有参加上
if(beanDto.getBenefitType() == 1) {
......@@ -101,8 +102,8 @@ public class DeliverySharingService {
shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, df.format(beanDto.getThresholdAmount().doubleValue() /100 ),df.format(beanDto.getDiscountAmount().doubleValue() / 100)));
}
shoppingCartGoodsResponseVo.setDeliveryAmount(deliveryAmount);
shoppingCartGoodsResponseVo.setDiscountDeliveryAmount(deliveryAmount);
shoppingCartGoodsResponseVo.setDeliveryAmount(deliverAmountNew);
shoppingCartGoodsResponseVo.setDiscountDeliveryAmount(deliverAmountNew);
shoppingCartGoodsResponseVo.setIsDiscountDelivery(false);
// fisherman 有活动 使用了优惠券
boolean isType34 = verifyActivity(discountResult);
......@@ -115,9 +116,9 @@ public class DeliverySharingService {
} else {
String desc = DELIVERY_DISCOUNT_DESC3;
shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, df.format(deliveryAmount.doubleValue() / 100)));
shoppingCartGoodsResponseVo.setDeliveryAmount(deliveryAmount);
shoppingCartGoodsResponseVo.setDiscountDeliveryAmount(deliveryAmount);
shoppingCartGoodsResponseVo.setDeliveryDiscountDesc(String.format(desc, df.format(deliverAmountNew.doubleValue() / 100)));
shoppingCartGoodsResponseVo.setDeliveryAmount(deliverAmountNew);
shoppingCartGoodsResponseVo.setDiscountDeliveryAmount(deliverAmountNew);
shoppingCartGoodsResponseVo.setIsDiscountDelivery(false);
// fisherman 确认是否 使用了优惠券
boolean isType34 = verifyActivity(discountResult);
......
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