Commit fb97dd77 by 张跃

新老接口判断

parent a5bc6a23
...@@ -304,21 +304,22 @@ public class CheckOrder { ...@@ -304,21 +304,22 @@ public class CheckOrder {
} }
} }
//todo : 这里不再支持从表中获取门店配送信息 改用接口方式调用 //todo : 这里不再支持从表中获取门店配送信息 改用接口方式调用
//外卖起送条件(1:杯数,2:金额) if (!storeDeliveryUseOld) {
if (!Arrays.asList(1, 2).contains(storeDeliveryInfoDto.getDeliveryCondition())) { //外卖起送条件(1:杯数,2:金额)
throw new ServiceException(ResponseResult.STORE_DISCONTENT_DELIVERY_CONDITION); if (!Arrays.asList(1, 2).contains(storeDeliveryInfoDto.getDeliveryCondition())) {
} throw new ServiceException(ResponseResult.STORE_DISCONTENT_DELIVERY_CONDITION);
if (1 == storeDeliveryInfoDto.getDeliveryCondition()) { }
int sum = shoppingCartGoodsDto.getProducts().stream().mapToInt(ShoppingCartGoodsDto.CartGoodsDetailDto::getQty).sum(); if (1 == storeDeliveryInfoDto.getDeliveryCondition()) {
if (sum < storeDeliveryInfoDto.getFreeDeliveryCup()) { int sum = shoppingCartGoodsDto.getProducts().stream().mapToInt(ShoppingCartGoodsDto.CartGoodsDetailDto::getQty).sum();
throw new ServiceException(ResponseResult.STORE_DISCONTENT_DELIVERY_CUP); if (sum < storeDeliveryInfoDto.getFreeDeliveryCup()) {
throw new ServiceException(ResponseResult.STORE_DISCONTENT_DELIVERY_CUP);
}
}
//订单金额小于起送费提示
else if ((2 == storeDeliveryInfoDto.getDeliveryCondition() && storeDeliveryInfoDto.getDeliveryLimitAmount() > shoppingCartGoodsDto.getTotalAmount()) && !cocoPartnerId.contains(createOrderVo.getPartnerId())) {
throw new ServiceException(ResponseResult.STORE_DISCONTENT_DELIVERY_FEE);
} }
} }
//订单金额小于起送费提示
else if ((2 == storeDeliveryInfoDto.getDeliveryCondition() && storeDeliveryInfoDto.getDeliveryLimitAmount() > shoppingCartGoodsDto.getTotalAmount()) && !cocoPartnerId.contains(createOrderVo.getPartnerId())) {
throw new ServiceException(ResponseResult.STORE_DISCONTENT_DELIVERY_FEE);
}
storeDeliveryInfoDto.setEnableTakeaway(true); storeDeliveryInfoDto.setEnableTakeaway(true);
// 校验收货地址是否可配送 fisherman -> 获取门店预计送达时间 // 校验收货地址是否可配送 fisherman -> 获取门店预计送达时间
checkReceiveAddress(storeDeliveryInfoDto, createOrderVo,storeResponseDto.getStoreCode()); checkReceiveAddress(storeDeliveryInfoDto, createOrderVo,storeResponseDto.getStoreCode());
......
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