Commit 5edf0984 by 姜海波

满额减配送费

parent d63df331
...@@ -126,7 +126,7 @@ public class OrderAdapter { ...@@ -126,7 +126,7 @@ public class OrderAdapter {
long deliveryAmount = 0; long deliveryAmount = 0;
long discountDeliveryAmount = 0; long discountDeliveryAmount = 0;
if (deliveryInfoDto != null) { if (deliveryInfoDto != null) {
deliveryAmount = getUserRealDeliveryAmount(deliveryInfoDto.getStoreDeliveryInfoDto(), deliveryInfoDto.getUserLongitude(), deliveryInfoDto.getUserLatitude()); deliveryAmount = shoppingCartGoodsDto.getDeliveryAmount();
if(shoppingCartGoodsDto.getIsDiscountDelivery() && deliveryAmount>shoppingCartGoodsDto.getDiscountDeliveryAmount()){ if(shoppingCartGoodsDto.getIsDiscountDelivery() && deliveryAmount>shoppingCartGoodsDto.getDiscountDeliveryAmount()){
discountDeliveryAmount = shoppingCartGoodsDto.getDiscountDeliveryAmount(); discountDeliveryAmount = shoppingCartGoodsDto.getDiscountDeliveryAmount();
...@@ -586,7 +586,7 @@ public class OrderAdapter { ...@@ -586,7 +586,7 @@ public class OrderAdapter {
long deliveryAmount = 0; long deliveryAmount = 0;
long discountDeliveryAmount = 0; long discountDeliveryAmount = 0;
if (userDeliveryInfoDto != null) { if (userDeliveryInfoDto != null) {
deliveryAmount = getUserRealDeliveryAmount(userDeliveryInfoDto.getStoreDeliveryInfoDto(), userDeliveryInfoDto.getUserLongitude(), userDeliveryInfoDto.getUserLatitude()); deliveryAmount = shoppingCartGoodsDto.getDeliveryAmount();
if(shoppingCartGoodsDto.getIsDiscountDelivery() && deliveryAmount>shoppingCartGoodsDto.getDiscountDeliveryAmount()){ if(shoppingCartGoodsDto.getIsDiscountDelivery() && deliveryAmount>shoppingCartGoodsDto.getDiscountDeliveryAmount()){
discountDeliveryAmount = shoppingCartGoodsDto.getDiscountDeliveryAmount(); discountDeliveryAmount = shoppingCartGoodsDto.getDiscountDeliveryAmount();
......
...@@ -93,6 +93,8 @@ public class ShoppingCartInfoRequestVo { ...@@ -93,6 +93,8 @@ public class ShoppingCartInfoRequestVo {
*/ */
private String channelType; private String channelType;
private String receiveId;
@Data @Data
public final static class SendGoods { public final static class SendGoods {
/** /**
......
...@@ -296,6 +296,7 @@ public class CheckOrder { ...@@ -296,6 +296,7 @@ public class CheckOrder {
.orderType(createOrderVo.getOrderType()) .orderType(createOrderVo.getOrderType())
.reachStoreType(createOrderVo.getReachStoreType()) .reachStoreType(createOrderVo.getReachStoreType())
.flag(CouponFlag.NO.getCode()) .flag(CouponFlag.NO.getCode())
.receiveId(createOrderVo.getReceiveId())
.useCustomerScore(createOrderVo.getUseCustomerScore()) .useCustomerScore(createOrderVo.getUseCustomerScore())
.buyMemberCard(buyMemberCard) .buyMemberCard(buyMemberCard)
.menuType(createOrderVo.getMenuType()) .menuType(createOrderVo.getMenuType())
......
...@@ -257,7 +257,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -257,7 +257,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
// 获取优惠信息 // 获取优惠信息
ActivityCalculationDiscountResponseDto.CalculationDiscountResult calculationDiscountResult ActivityCalculationDiscountResponseDto.CalculationDiscountResult calculationDiscountResult
=getCalculationDiscountResult(menuType,partnerId,storeId,userId,appId,userLoginInfoDto.getWxAppid(),orderType,allCartGoodsList,new ArrayList(),new ArrayList<>()); =getCalculationDiscountResult(menuType,partnerId,storeId,userId,appId,userLoginInfoDto.getWxAppid(),orderType,allCartGoodsList,new ArrayList(),new ArrayList<>(),null);
// 当商品数量被设为0时 // 当商品数量被设为0时
...@@ -346,7 +346,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -346,7 +346,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
// 获取优惠信息 // 获取优惠信息
ActivityCalculationDiscountResponseDto.CalculationDiscountResult calculationDiscountResult ActivityCalculationDiscountResponseDto.CalculationDiscountResult calculationDiscountResult
=getCalculationDiscountResult(menuType,partnerId,storeId,userId,appId,userLoginInfoDto.getWxAppid(),orderType,cartGoodsList,new ArrayList(),new ArrayList<>()); =getCalculationDiscountResult(menuType,partnerId,storeId,userId,appId,userLoginInfoDto.getWxAppid(),orderType,cartGoodsList,new ArrayList(),new ArrayList<>(),null);
if (calculationDiscountResult == null) { if (calculationDiscountResult == null) {
shoppingCartGoodsResponseVo.setProducts(cartGoodsList); shoppingCartGoodsResponseVo.setProducts(cartGoodsList);
// return shoppingCartGoodsResponseVo; // return shoppingCartGoodsResponseVo;
...@@ -445,7 +445,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -445,7 +445,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
} }
// 获取优惠信息 // 获取优惠信息
ActivityCalculationDiscountResponseDto.CalculationDiscountResult calculationDiscountResult = getCalculationDiscountResult(menuType,partnerId,storeId,userId,appId,userLoginInfoDto.getWxAppid(),orderType,cartGoodsList,coupons,null); ActivityCalculationDiscountResponseDto.CalculationDiscountResult calculationDiscountResult = getCalculationDiscountResult(menuType,partnerId,storeId,userId,appId,userLoginInfoDto.getWxAppid(),orderType,cartGoodsList,coupons,null,shoppingCartInfoRequestVo.getReceiveId());
if (calculationDiscountResult == null) { if (calculationDiscountResult == null) {
shoppingCartGoodsResponseVo.setProducts(cartGoodsList); shoppingCartGoodsResponseVo.setProducts(cartGoodsList);
...@@ -607,7 +607,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -607,7 +607,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
} }
} }
// 获取优惠信息 // 获取优惠信息
ActivityCalculationDiscountResponseDto.CalculationDiscountResult calculationDiscountResult = getCalculationDiscountResult(menuType,partnerId,storeId,userId,appId,userLoginInfoDto.getWxAppid(),orderType,cartGoodsList,coupons,sendGoodsList); ActivityCalculationDiscountResponseDto.CalculationDiscountResult calculationDiscountResult = getCalculationDiscountResult(menuType,partnerId,storeId,userId,appId,userLoginInfoDto.getWxAppid(),orderType,cartGoodsList,coupons,sendGoodsList,shoppingCartInfoRequestVo.getReceiveId());
ActivityQueryDto activityQueryDto = activityAdapter.getActivityQueryDto(partnerId, storeId, userId, appId, shoppingCartInfoRequestVo.getOrderType()); ActivityQueryDto activityQueryDto = activityAdapter.getActivityQueryDto(partnerId, storeId, userId, appId, shoppingCartInfoRequestVo.getOrderType());
...@@ -1410,18 +1410,25 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1410,18 +1410,25 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
private ActivityCalculationDiscountResponseDto.CalculationDiscountResult getCalculationDiscountResult(String menuType private ActivityCalculationDiscountResponseDto.CalculationDiscountResult getCalculationDiscountResult(String menuType
,String partnerId,String storeId,String userId,String appId,String wxappid,Integer orderType ,String partnerId,String storeId,String userId,String appId,String wxappid,Integer orderType
,List<CartGoods> cartGoodsList,List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> coupons ,List<CartGoods> cartGoodsList,List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> coupons
,List<ShoppingCartInfoRequestVo.SendGoods> sendGoodsList){ ,List<ShoppingCartInfoRequestVo.SendGoods> sendGoodsList,String receiveId){
// 获取优惠信息 // 获取优惠信息
ActivityCalculationDiscountResponseDto.CalculationDiscountResult calculationDiscountResult=null; ActivityCalculationDiscountResponseDto.CalculationDiscountResult calculationDiscountResult=null;
//外卖场景下 查询门店配送信息 //外卖场景下 查询门店配送信息
if(BusinessTypeEnum.SAAS_DELIVERY.getCode().equals(menuType)){ if(BusinessTypeEnum.SAAS_DELIVERY.getCode().equals(menuType)){
//TODO 查询门店信息 Long deliveryAmount=0l;
StoreResponseDto storeResponseDto = storeService.getStoreInfo(partnerId, storeId); if(receiveId!=null) {
//TODO 查询门店外卖信息 //TODO 查询门店信息
StoreDeliveryInfoDto storeDeliveryInfoDto = storeService.getStoreDeliveryInfo(storeResponseDto, wxappid); StoreResponseDto storeResponseDto = storeService.getStoreInfo(partnerId, storeId);
//TODO 查询门店外卖信息
StoreDeliveryInfoDto storeDeliveryInfoDto = storeService.getStoreDeliveryInfo(storeResponseDto, wxappid);
calculationDiscountResult = this.getActivityCalculationDiscountResponse(partnerId, storeId, userId, appId, orderType, cartGoodsList, coupons, sendGoodsList,BusinessTypeEnum.getByType(menuType).getCode(),storeDeliveryInfoDto.getDeliveryAmount()); deliveryAmount = storeDeliveryInfoDto.getDeliveryAmount();
}else{
deliveryAmount = Long.parseLong(getDeliveryAmount(receiveId,partnerId,storeId).toString());
}
calculationDiscountResult = this.getActivityCalculationDiscountResponse(partnerId, storeId, userId, appId, orderType, cartGoodsList, coupons, sendGoodsList,BusinessTypeEnum.getByType(menuType).getCode(),deliveryAmount);
}else{ }else{
calculationDiscountResult = this.getActivityCalculationDiscountResponse(partnerId, storeId, userId, appId, orderType, cartGoodsList, coupons, sendGoodsList,BusinessTypeEnum.getByType(menuType).getCode(),null); calculationDiscountResult = this.getActivityCalculationDiscountResponse(partnerId, storeId, userId, appId, orderType, cartGoodsList, coupons, sendGoodsList,BusinessTypeEnum.getByType(menuType).getCode(),null);
} }
......
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