Authored by chenjian

Merge branch 'hotfix-20191023' into test6.9.14

package com.yohoufo.order.model;
import com.yohobuy.ufo.model.order.common.OrderAttributes;
import com.yohobuy.ufo.model.order.constants.DeliveryWayEnum;
import com.yohobuy.ufo.model.order.constants.SkupType;
import com.yohobuy.ufo.model.order.vo.AddressInfo;
... ... @@ -26,4 +27,10 @@ public class OfflineOrderBuilderFactory extends OrderBuilderFactory {
public int getDeliveryWayCode(SkupType skupType) {
return DeliveryWayEnum.SELF_FETCH.getCode();
}
@Override
protected OrderAttributes buildOrderAttribute(SellerOrderGoods skup, boolean depositRequirement) {
return OrderAttributes.OFFLINE;
}
}
... ...
... ... @@ -10,6 +10,8 @@ import com.yohoufo.common.ApiResponse;
import com.yohoufo.common.caller.UfoServiceCaller;
import com.yohoufo.common.exception.UfoServiceException;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.order.charge.ChargeContext;
import com.yohoufo.order.charge.model.ActivityPrice;
import com.yohoufo.order.model.OfflineOrderBuilderFactory;
import com.yohoufo.order.model.OrderBuilderFactory;
import com.yohoufo.order.model.request.OfflineShoppingRequest;
... ... @@ -19,7 +21,9 @@ import com.yohoufo.order.model.response.OfflinePaymentResponse;
import com.yohoufo.order.model.response.OrderSubmitResponse;
import com.yohoufo.order.model.response.PaymentResponse;
import com.yohoufo.order.service.IOfflineShoppingService;
import com.yohoufo.order.utils.DeliveryWayUtils;
import com.yohoufo.order.utils.LoggerUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -122,4 +126,20 @@ public class OfflineShoppingServiceImpl extends ShoppingServiceImpl implements I
protected OrderBuilderFactory getOrderBuilderFactory() {
return new OfflineOrderBuilderFactory();
}
@Override
protected ChargeContext buildChargeContext(ShoppingRequest request,
SellerOrderGoods skupInfo,
ActivityPrice activityPrice,
int chargeStage) {
return chargeContextFactory.buildChargeContext(request, skupInfo, activityPrice, chargeStage,
(skupType) -> DeliveryWayEnum.SELF_FETCH.getCode(),
(shoppingRequest) -> {
if (StringUtils.isNoneBlank(request.getAddressId())) {
return getAndCheckAddressInfo(request);
} else {
return null;
}
});
}
}
... ...
... ... @@ -10,6 +10,7 @@ import com.yohobuy.ufo.model.order.common.*;
import com.yohobuy.ufo.model.order.constants.*;
import com.yohobuy.ufo.model.order.vo.AddressInfo;
import com.yohoufo.common.alarm.EventBusPublisher;
import com.yohoufo.common.constant.BusinessClientEnum;
import com.yohoufo.common.exception.UfoServiceException;
import com.yohoufo.common.lock.RedisLock;
import com.yohoufo.common.lock.RedisLockFactory;
... ... @@ -133,7 +134,7 @@ public class ShoppingServiceImpl implements IShoppingService {
private RedisLockFactory redisLockFactory;
@Autowired
private ChargeContextFactory chargeContextFactory;
protected ChargeContextFactory chargeContextFactory;
/**
* 结算页数据
* @param request
... ... @@ -294,7 +295,7 @@ public class ShoppingServiceImpl implements IShoppingService {
}
private ChargeContext buildChargeContext(ShoppingRequest request,
protected ChargeContext buildChargeContext(ShoppingRequest request,
SellerOrderGoods skupInfo,
ActivityPrice activityPrice,
int chargeStage) {
... ...