Commit 5edf0984 by 姜海波

满额减配送费

parent d63df331
......@@ -126,7 +126,7 @@ public class OrderAdapter {
long deliveryAmount = 0;
long discountDeliveryAmount = 0;
if (deliveryInfoDto != null) {
deliveryAmount = getUserRealDeliveryAmount(deliveryInfoDto.getStoreDeliveryInfoDto(), deliveryInfoDto.getUserLongitude(), deliveryInfoDto.getUserLatitude());
deliveryAmount = shoppingCartGoodsDto.getDeliveryAmount();
if(shoppingCartGoodsDto.getIsDiscountDelivery() && deliveryAmount>shoppingCartGoodsDto.getDiscountDeliveryAmount()){
discountDeliveryAmount = shoppingCartGoodsDto.getDiscountDeliveryAmount();
......@@ -586,7 +586,7 @@ public class OrderAdapter {
long deliveryAmount = 0;
long discountDeliveryAmount = 0;
if (userDeliveryInfoDto != null) {
deliveryAmount = getUserRealDeliveryAmount(userDeliveryInfoDto.getStoreDeliveryInfoDto(), userDeliveryInfoDto.getUserLongitude(), userDeliveryInfoDto.getUserLatitude());
deliveryAmount = shoppingCartGoodsDto.getDeliveryAmount();
if(shoppingCartGoodsDto.getIsDiscountDelivery() && deliveryAmount>shoppingCartGoodsDto.getDiscountDeliveryAmount()){
discountDeliveryAmount = shoppingCartGoodsDto.getDiscountDeliveryAmount();
......
......@@ -93,6 +93,8 @@ public class ShoppingCartInfoRequestVo {
*/
private String channelType;
private String receiveId;
@Data
public final static class SendGoods {
/**
......
......@@ -296,6 +296,7 @@ public class CheckOrder {
.orderType(createOrderVo.getOrderType())
.reachStoreType(createOrderVo.getReachStoreType())
.flag(CouponFlag.NO.getCode())
.receiveId(createOrderVo.getReceiveId())
.useCustomerScore(createOrderVo.getUseCustomerScore())
.buyMemberCard(buyMemberCard)
.menuType(createOrderVo.getMenuType())
......
......@@ -257,7 +257,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
// 获取优惠信息
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时
......@@ -346,7 +346,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
// 获取优惠信息
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) {
shoppingCartGoodsResponseVo.setProducts(cartGoodsList);
// return shoppingCartGoodsResponseVo;
......@@ -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) {
shoppingCartGoodsResponseVo.setProducts(cartGoodsList);
......@@ -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());
......@@ -1410,18 +1410,25 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
private ActivityCalculationDiscountResponseDto.CalculationDiscountResult getCalculationDiscountResult(String menuType
,String partnerId,String storeId,String userId,String appId,String wxappid,Integer orderType
,List<CartGoods> cartGoodsList,List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> coupons
,List<ShoppingCartInfoRequestVo.SendGoods> sendGoodsList){
,List<ShoppingCartInfoRequestVo.SendGoods> sendGoodsList,String receiveId){
// 获取优惠信息
ActivityCalculationDiscountResponseDto.CalculationDiscountResult calculationDiscountResult=null;
//外卖场景下 查询门店配送信息
if(BusinessTypeEnum.SAAS_DELIVERY.getCode().equals(menuType)){
Long deliveryAmount=0l;
if(receiveId!=null) {
//TODO 查询门店信息
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{
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