Commit 1b267c3d by 周晓航

运费修改运费计算

Signed-off-by: 周晓航 <xiaohang.zhou@freemud.com>
parent 6718285e
......@@ -26,6 +26,7 @@ import cn.freemud.entities.dto.pay.CombPayResponse;
import cn.freemud.entities.dto.promotion.OrderBeanRequest;
import cn.freemud.entities.dto.promotion.ShoppingCartGoodsResponse;
import cn.freemud.entities.dto.shoppingCart.ActivityDiscountsDto;
import cn.freemud.entities.dto.shoppingCart.CollageOrderDto;
import cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto;
import cn.freemud.entities.ttpay.OrderInfo;
import cn.freemud.entities.vo.*;
......@@ -186,9 +187,20 @@ public class OrderAdapter {
if (createOrderVo.getMenuType().equals(BusinessTypeEnum.SAAS_DELIVERY.getCode())) {
deliveryAmount = shoppingCartGoodsDto.getDeliveryAmount() == null ? 9l : shoppingCartGoodsDto.getDeliveryAmount();
discountDeliveryAmount = shoppingCartGoodsDto.getDeliveryAmount() == null ? 9l : shoppingCartGoodsDto.getDeliveryAmount();
if (shoppingCartGoodsDto.getIsDiscountDelivery() && deliveryAmount > shoppingCartGoodsDto.getDiscountDeliveryAmount()) {
// 参加满减活动 || 有运费券
boolean isUseFreightCoupon = false;
List<ActivityDiscountsDto> activityDiscountsDtos = shoppingCartGoodsDto.getActivityDiscountsDtos();
if (CollectionUtils.isNotEmpty(activityDiscountsDtos)) {
ActivityDiscountsDto activityDiscountsDto = activityDiscountsDtos.stream().filter(a -> a.getActivityType() != null && a.getActivityType().equals(ActivityTypeEnum.TYPE_34.getCode())).findFirst().orElse(null);
if (activityDiscountsDto !=null) {
isUseFreightCoupon= true;
}
}
if ((shoppingCartGoodsDto.getIsDiscountDelivery() || isUseFreightCoupon)
&& deliveryAmount > shoppingCartGoodsDto.getDiscountDeliveryAmount()) {
discountDeliveryAmount = shoppingCartGoodsDto.getDiscountDeliveryAmount();
}
}else if( createOrderVo.getMenuType().equals(BusinessTypeEnum.SAAS_MALL.getCode())){
deliveryAmount = shoppingCartGoodsDto.getDeliveryAmount() == null ? 0 : shoppingCartGoodsDto.getDeliveryAmount();
discountDeliveryAmount = shoppingCartGoodsDto.getDeliveryAmount() == null ? 0 : shoppingCartGoodsDto.getDeliveryAmount();
......
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