Authored by LUOXC

Merge branch 'hotfix-20181219' into test6.8.4

... ... @@ -121,7 +121,7 @@ public class ShoppingServiceImpl implements IShoppingService {
PaymentResponse response = new PaymentResponse();
response.setPaymentWay(shoppingSupport.getPaymentWay());
response.setDeliveryWay(shoppingSupport.getDeliverWay());
response.setDeliveryWay(shoppingSupport.getDeliverWay(chargeContext.getChargeResult().getShippingAmount()));
response.setGood(shoppingSupport.getGoodsInfo(skupGood));
response.setPromotionFormulaList(shoppingSupport.getPromotionFormula(chargeResult));
response.setAmount(MathUtils.formatStr(chargeResult.getFinalAmount()));
... ...
... ... @@ -20,7 +20,7 @@ public class DeliveryWayCostSupport {
@Autowired
private UfoServiceCaller ufoServiceCaller;
private ThreadLocal<Double> costOfSf = ThreadLocal.withInitial(() -> {
public double getCostOfSf() {
String key = "buyer.delivery.way.cost.sf";
double defaultValue = 15;
try {
... ... @@ -39,10 +39,6 @@ public class DeliveryWayCostSupport {
log.warn("request cost of sf fail", e);
return defaultValue;
}
});
public double getCostOfSf() {
return costOfSf.get();
}
}
... ...
... ... @@ -4,6 +4,7 @@ import com.google.common.collect.Lists;
import com.yohoufo.common.helper.ImageUrlAssist;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohobuy.ufo.model.order.constants.OrderConstant;
import com.yohoufo.order.charge.ChargeContext;
import com.yohoufo.order.charge.model.ChargeResult;
import com.yohoufo.order.charge.model.CouponPayResult;
import com.yohoufo.order.model.response.GoodsInfo;
... ... @@ -16,14 +17,11 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.List;
import java.util.function.Supplier;
@Service
public class ShoppingSupport {
@Autowired
private DeliveryWayCostSupport deliveryWayCostSupport;
/**
* 支付方式
* @return
... ... @@ -41,10 +39,7 @@ public class ShoppingSupport {
* 配送方式
* @return
*/
public PaymentResponse.DeliveryWay getDeliverWay() {
double deliveryWayCost = deliveryWayCostSupport.getCostOfSf();
public PaymentResponse.DeliveryWay getDeliverWay(double deliveryWayCost) {
// 快递方式
PaymentResponse.DeliveryWay deliveryWay = new PaymentResponse.DeliveryWay();
deliveryWay.setDeliveryWayId(OrderConstant.DELIVERY_WAY_SF);
... ...