Commit b0a51ffd by ping.wu

Merge branches 'feature/20210714_微商城运费到付_wuping' and 'master' of…

Merge branches 'feature/20210714_微商城运费到付_wuping' and 'master' of http://gitlab.freemud.com/order-group-application/order-group
parents 2a4cbdeb ba1be733
package cn.freemud.entities.dto.delivery;
import lombok.Data;
@Data
public class DeliveryFeeInfo {
private Long deliveryAmount;
/**
* 微商城配送类型 到付 0:不包邮; 1:包邮; 2:运费到付
*/
private Integer costType;
}
......@@ -34,6 +34,12 @@ public class QueryDeliveryTemplateResponseVo {
/**
* 是否包邮 -> true:是; false:否
*/
@Deprecated
private Boolean isDispatchFree;
/**
* 微商城配送类型 到付 0:不包邮; 1:包邮; 2:运费到付
*/
private Integer costType;
}
}
......@@ -96,6 +96,11 @@ public class ShoppingCartGoodsResponseVo extends ShoppingCartGoodsBaseResponseV
private Long deliveryAmount;
/**
* 微商城配送类型 到付 0:不包邮; 1:包邮; 2:运费到付
*/
private Integer costType;
/**
* 减免后配送费
*/
private Long discountDeliveryAmount;
......
package cn.freemud.enums;
public enum DeliveryTemplateCostTypeEnum {
//0:不包邮; 1:包邮; 2:运费到付
COST_TYPE_0(0,"不包邮"),
COST_TYPE_1(1,"包邮"),
COST_TYPE_2(2,"运费到付");
private Integer code;
private String desc;
DeliveryTemplateCostTypeEnum(Integer code, String desc) {
this.code = code;
this.desc = desc;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}
......@@ -23,6 +23,7 @@ import cn.freemud.entities.dto.*;
import cn.freemud.entities.dto.activity.ActivityQueryDto;
import cn.freemud.entities.dto.calculate.CalculationSharingDiscountRequestDto;
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.user.GetSessionUserInfoDto;
import cn.freemud.entities.ecology.VirtualBindStoreResponse;
......@@ -416,11 +417,11 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
buildCoupons(coupons,shoppingCartInfoRequestVo.getCouponCodes());
DeliveryFeeInfo deliveryFeeInfo = calculateDeliveryAmount(partnerId, shoppingCartInfoRequestVo.getProvince(), cartGoodsList);
Long deliveryAmount = deliveryFeeInfo.getDeliveryAmount();
shoppingCartGoodsResponseVo.setCostType(deliveryFeeInfo.getCostType());
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);
List<ShoppingCartInfoRequestVo.SendGoods> sendGoodsList = shoppingCartInfoRequestVo.getSendGoods();
List<ShoppingCartInfoRequestVo.SendGoods> sendGoods = new ArrayList<>();
......@@ -582,7 +583,8 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
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());
......@@ -964,11 +966,13 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
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;
//区code 为空则运费为0
if (StringUtils.isBlank(province)) {
return deliveryAmount;
deliveryFeeInfo.setDeliveryAmount(deliveryAmount);
return deliveryFeeInfo;
}
log.info("获取配送配逻辑 tackingNo:{},partnerId:{},province", LogThreadLocal.getTrackingNo(), partnerId,province);
Long orderAmount = 0L ;
......@@ -983,10 +987,15 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
throw new ServiceException(ResponseResult.SHOPPING_CART_QUERY_DELIVERY_TEMPLATE_ERR);
}
Boolean isDispatchFree = queryDeliveryTemplateResponseVo.getData().getIsDispatchFree();
if(!isDispatchFree) {
if(isDispatchFree != null && !isDispatchFree) {
deliveryAmount = Long.valueOf(null == queryDeliveryTemplateResponseVo.getData().getFreight() ? 0 : queryDeliveryTemplateResponseVo.getData().getFreight() );
}
return deliveryAmount;
//邮费付款方式 DeliveryTemplateCostTypeEnum
if(queryDeliveryTemplateResponseVo.getData() != null){
deliveryFeeInfo.setCostType(queryDeliveryTemplateResponseVo.getData().getCostType());
}
deliveryFeeInfo.setDeliveryAmount(deliveryAmount);
return deliveryFeeInfo;
}
/**
......
......@@ -9,7 +9,7 @@ import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@FeignClient(name = "DELIVERYCENTER", url = "${delivery.center.baseUrl}")
@FeignClient(name = "DELIVERYCENTER", url = "${delivery.center.feign.Url}")
public interface DeliveryFeiginClient {
@PostMapping("/delivery/queryDeliveryTemplate")
......
......@@ -9,4 +9,4 @@ apollo.meta=http://212.129.229.203
env=dev
apollo.cluster=default
apollo.bootstrap.enabled=true
apollo.bootstrap.namespaces=micro_progeram_commons,shopping_cart
\ No newline at end of file
apollo.bootstrap.namespaces=shopping_cart,micro_progeram_commons
\ No newline at end of file
......@@ -9,4 +9,4 @@ apollo.meta=http://public-apollo-configservice.koderover-qa-apollo-config.svc:80
env=uat
apollo.cluster=default
apollo.bootstrap.enabled=true
apollo.bootstrap.namespaces=micro_progeram_commons,shopping_cart
apollo.bootstrap.namespaces=shopping_cart,micro_progeram_commons
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