...
|
...
|
@@ -2,11 +2,13 @@ package com.yohoufo.order.service.impl.processor; |
|
|
|
|
|
import com.yoho.error.ServiceError;
|
|
|
import com.yoho.error.exception.ServiceException;
|
|
|
import com.yohobuy.ufo.model.GoodsSize;
|
|
|
import com.yohobuy.ufo.model.order.bo.GoodsInfo;
|
|
|
import com.yohobuy.ufo.model.order.common.SellerWalletType;
|
|
|
import com.yohobuy.ufo.model.order.constants.OrderConstant;
|
|
|
import com.yohobuy.ufo.model.order.constants.SkupType;
|
|
|
import com.yohobuy.ufo.model.order.req.SellerOrderSubmitReq;
|
|
|
import com.yohobuy.ufo.model.order.vo.AddressInfo;
|
|
|
import com.yohobuy.ufo.model.response.StorageDataResp;
|
|
|
import com.yohoufo.common.exception.GatewayException;
|
|
|
import com.yohoufo.common.exception.UfoServiceException;
|
...
|
...
|
@@ -14,15 +16,14 @@ import com.yohoufo.common.utils.AddressUtil; |
|
|
import com.yohoufo.common.utils.BigDecimalHelper;
|
|
|
import com.yohoufo.dal.order.SellerWalletMapper;
|
|
|
import com.yohoufo.dal.order.model.SellerWallet;
|
|
|
import com.yohobuy.ufo.model.order.vo.AddressInfo;
|
|
|
import com.yohoufo.order.model.SellerOrderContext;
|
|
|
import com.yohoufo.order.model.dto.SellerOrderComputeResult;
|
|
|
import com.yohoufo.order.service.handler.SellerOrderComputeHandler;
|
|
|
import com.yohoufo.order.service.proxy.ProductProxyService;
|
|
|
import com.yohoufo.order.service.proxy.UserProxyService;
|
|
|
import com.yohoufo.order.service.seller.OrderComputeHandler;
|
|
|
import com.yohoufo.order.service.seller.OrderComputeProvider;
|
|
|
import com.yohoufo.order.utils.AddressHelper;
|
|
|
import com.yohoufo.order.utils.LoggerUtils;
|
|
|
import com.yohobuy.ufo.model.GoodsSize;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
...
|
...
|
@@ -45,7 +46,7 @@ public class SellerOrderPrepareProcessor { |
|
|
private ProductProxyService productProxyService;
|
|
|
|
|
|
@Autowired
|
|
|
private SellerOrderComputeHandler computeHandler;
|
|
|
private OrderComputeProvider orderComputeProvider;
|
|
|
|
|
|
@Autowired
|
|
|
private SellerWalletMapper sellerWalletMapper;
|
...
|
...
|
@@ -137,16 +138,17 @@ public class SellerOrderPrepareProcessor { |
|
|
}catch (UfoServiceException ex){
|
|
|
context.setPriceOverFlowTips( ex.getErrorMessage());
|
|
|
}
|
|
|
|
|
|
//
|
|
|
SkupType skupType = SkupType.getSkupType(req.getSkupType());
|
|
|
context.setSkupType(skupType);
|
|
|
// compute every fee from price
|
|
|
OrderComputeHandler computeHandler = orderComputeProvider.findBySkupType(skupType);
|
|
|
SellerOrderComputeResult computeResult = computeHandler.compute(goodsInfo.getPrice());
|
|
|
checkIncome(storageId, computeResult.getIncome());
|
|
|
log.info("in buildSellerOrderContext , uid {}, storageId {}, price {}, computeResult {}", uid, storageId,
|
|
|
goodsInfo.getPrice(), computeResult);
|
|
|
context.setSellerOrderComputeResult(computeResult);
|
|
|
//
|
|
|
SkupType skupType = SkupType.getSkupType(req.getSkupType());
|
|
|
context.setSkupType(skupType);
|
|
|
|
|
|
return context;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -303,6 +305,8 @@ public class SellerOrderPrepareProcessor { |
|
|
goodsInfo.setStorageNum(storageNum);
|
|
|
|
|
|
// compute every fee from price
|
|
|
SkupType skupType = SkupType.IN_STOCK;
|
|
|
OrderComputeHandler computeHandler = orderComputeProvider.findBySkupType(skupType);
|
|
|
SellerOrderComputeResult computeResult = computeHandler.compute(goodsInfo.getPrice());
|
|
|
log.info("in buildImportPrdCxt , uid {}, storageId {}, price {}, computeResult {}", uid, storageId,
|
|
|
goodsInfo.getPrice(), computeResult);
|
...
|
...
|
|