Commit f84efaf2 by ping.wu

微商城快递到付返回前端标识

parent 71806011
package cn.freemud.entities.dto.delivery;
import lombok.Data;
@Data
public class DeliveryFeeInfo {
private Long deliveryAmount;
private Integer deliveryType;
}
...@@ -96,6 +96,11 @@ public class ShoppingCartGoodsResponseVo extends ShoppingCartGoodsBaseResponseV ...@@ -96,6 +96,11 @@ public class ShoppingCartGoodsResponseVo extends ShoppingCartGoodsBaseResponseV
private Long deliveryAmount; private Long deliveryAmount;
/** /**
* 微商城配送类型 到付
*/
private Integer deliveryType;
/**
* 减免后配送费 * 减免后配送费
*/ */
private Long discountDeliveryAmount; private Long discountDeliveryAmount;
......
...@@ -23,6 +23,7 @@ import cn.freemud.entities.dto.*; ...@@ -23,6 +23,7 @@ import cn.freemud.entities.dto.*;
import cn.freemud.entities.dto.activity.ActivityQueryDto; import cn.freemud.entities.dto.activity.ActivityQueryDto;
import cn.freemud.entities.dto.calculate.CalculationSharingDiscountRequestDto; import cn.freemud.entities.dto.calculate.CalculationSharingDiscountRequestDto;
import cn.freemud.entities.dto.calculate.CalculationSharingDiscountResponseDto; import cn.freemud.entities.dto.calculate.CalculationSharingDiscountResponseDto;
import cn.freemud.entities.dto.delivery.DeliveryFeeInfo;
import cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto; import cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto;
import cn.freemud.entities.dto.user.GetSessionUserInfoDto; import cn.freemud.entities.dto.user.GetSessionUserInfoDto;
import cn.freemud.entities.ecology.VirtualBindStoreResponse; import cn.freemud.entities.ecology.VirtualBindStoreResponse;
...@@ -416,11 +417,11 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService { ...@@ -416,11 +417,11 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
buildCoupons(coupons,shoppingCartInfoRequestVo.getCouponCodes()); buildCoupons(coupons,shoppingCartInfoRequestVo.getCouponCodes());
DeliveryFeeInfo deliveryFeeInfo = calculateDeliveryAmount(partnerId, shoppingCartInfoRequestVo.getProvince(), cartGoodsList);
Long deliveryAmount = deliveryFeeInfo.getDeliveryAmount();
shoppingCartGoodsResponseVo.setDeliveryType(deliveryFeeInfo.getDeliveryType());
Long deliveryAmount = calculateDeliveryAmount(partnerId, shoppingCartInfoRequestVo.getProvince(),cartGoodsList); ActivityQueryDto activityQueryDto = activityAdapter.getActivityQueryDto(partnerId, storeId, userId, appId, shoppingCartInfoRequestVo.getOrderType());
ActivityQueryDto activityQueryDto = activityAdapter.getActivityQueryDto(partnerId, storeId, userId, appId, shoppingCartInfoRequestVo.getOrderType());
CouponPromotionVO couponPromotionVO = couponAdapter.getCouponPromotionVO(shoppingCartInfoRequestVo, userLoginInfoDto); CouponPromotionVO couponPromotionVO = couponAdapter.getCouponPromotionVO(shoppingCartInfoRequestVo, userLoginInfoDto);
List<ShoppingCartInfoRequestVo.SendGoods> sendGoodsList = shoppingCartInfoRequestVo.getSendGoods(); List<ShoppingCartInfoRequestVo.SendGoods> sendGoodsList = shoppingCartInfoRequestVo.getSendGoods();
List<ShoppingCartInfoRequestVo.SendGoods> sendGoods = new ArrayList<>(); List<ShoppingCartInfoRequestVo.SendGoods> sendGoods = new ArrayList<>();
...@@ -582,7 +583,8 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService { ...@@ -582,7 +583,8 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
buildCoupons(coupons,shoppingCartInfoRequestVo.getCouponCodes()); buildCoupons(coupons,shoppingCartInfoRequestVo.getCouponCodes());
Long deliveryAmount = calculateDeliveryAmount(partnerId, shoppingCartInfoRequestVo.getProvince(),cartGoodsList); DeliveryFeeInfo deliveryFeeInfo = calculateDeliveryAmount(partnerId, shoppingCartInfoRequestVo.getProvince(), cartGoodsList);
Long deliveryAmount = deliveryFeeInfo.getDeliveryAmount();
ActivityQueryDto activityQueryDto = activityAdapter.getActivityQueryDto(partnerId, storeId, userId, appId, shoppingCartInfoRequestVo.getOrderType()); ActivityQueryDto activityQueryDto = activityAdapter.getActivityQueryDto(partnerId, storeId, userId, appId, shoppingCartInfoRequestVo.getOrderType());
...@@ -964,11 +966,13 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService { ...@@ -964,11 +966,13 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
return oldCoupons; return oldCoupons;
} }
public Long calculateDeliveryAmount(String partnerId,String province,List<CartGoods> cartGoodsList) { public DeliveryFeeInfo calculateDeliveryAmount(String partnerId, String province, List<CartGoods> cartGoodsList) {
DeliveryFeeInfo deliveryFeeInfo = new DeliveryFeeInfo();
Long deliveryAmount = 0L; Long deliveryAmount = 0L;
//区code 为空则运费为0 //区code 为空则运费为0
if (StringUtils.isBlank(province)) { if (StringUtils.isBlank(province)) {
return deliveryAmount; deliveryFeeInfo.setDeliveryAmount(deliveryAmount);
return deliveryFeeInfo;
} }
log.info("获取配送配逻辑 tackingNo:{},partnerId:{},province", LogThreadLocal.getTrackingNo(), partnerId,province); log.info("获取配送配逻辑 tackingNo:{},partnerId:{},province", LogThreadLocal.getTrackingNo(), partnerId,province);
Long orderAmount = 0L ; Long orderAmount = 0L ;
...@@ -986,7 +990,11 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService { ...@@ -986,7 +990,11 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
if(!isDispatchFree) { if(!isDispatchFree) {
deliveryAmount = Long.valueOf(null == queryDeliveryTemplateResponseVo.getData().getFreight() ? 0 : queryDeliveryTemplateResponseVo.getData().getFreight() ); deliveryAmount = Long.valueOf(null == queryDeliveryTemplateResponseVo.getData().getFreight() ? 0 : queryDeliveryTemplateResponseVo.getData().getFreight() );
} }
return deliveryAmount; if(queryDeliveryTemplateResponseVo.getData() != null){
deliveryFeeInfo.setDeliveryType(1);
}
deliveryFeeInfo.setDeliveryAmount(deliveryAmount);
return deliveryFeeInfo;
} }
/** /**
......
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