Commit 2b995ad8 by 周晓航

夜间配送费字段新增

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