...
|
...
|
@@ -132,6 +132,15 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi |
|
|
@Autowired
|
|
|
private PriceComputePrepareProcessor priceComputePrepareProcessor;
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
private ChangePricePrepareProcessor changePricePrepareProcessor;
|
|
|
|
|
|
@Autowired
|
|
|
private SellerFeeService sellerFeeService;
|
|
|
|
|
|
|
|
|
|
|
|
public SoldPrdComputeBo computePublishPrd(SellerOrderComputeReq req) throws GatewayException {
|
|
|
log.info("in computePublishPrd, req {}", req);
|
|
|
PriceComputePrepareProcessor.PriceComputeNode pcn = priceComputePrepareProcessor.checkBasePrice(req);
|
...
|
...
|
@@ -155,35 +164,14 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi |
|
|
return spc;
|
|
|
}
|
|
|
|
|
|
public SoldPrdComputeBo computeChangePrice(SellerOrderComputeReq req) throws GatewayException {
|
|
|
public SoldPrdComputeBo computeChangePrice(BatchChangePriceReq req) throws GatewayException {
|
|
|
log.info("in computeChangePrice, req {}", req);
|
|
|
PriceComputePrepareProcessor.PriceComputeNode pcn = priceComputePrepareProcessor.checkBasePrice(req);
|
|
|
int uid = pcn.getUid();
|
|
|
Integer storageId = pcn.getStorageId();
|
|
|
int num = pcn.getNum();
|
|
|
BigDecimal prdPrice = pcn.getPrdPrice();
|
|
|
|
|
|
SellerOrderComputeResult computeResult = computeHandler.compute(prdPrice);
|
|
|
/**
|
|
|
* 验证是否是入驻商家
|
|
|
*/
|
|
|
if(sellerOrderPrepareProcessor.checkIsEntry(uid)){
|
|
|
sellerOrderPrepareProcessor.checkNGetMergeEarnestMoney(uid, computeResult.getEarnestMoney().getEarnestMoney(), num, prdPrice);
|
|
|
ChangePricePrepareDTO pcn = changePricePrepareProcessor.checkAndAcquire(req);
|
|
|
if (pcn.getTips() != null){
|
|
|
throw new UfoServiceException(SellerOrderPrepareProcessor.TIPS_ERROR_CODE, pcn.getTips() );
|
|
|
}
|
|
|
|
|
|
SellerOrderComputeResult computeResult = pcn.getComputeResult();
|
|
|
SoldPrdComputeBo spc = SellerOrderConvertor.computeResult2SoldPrdComputeBo(computeResult);
|
|
|
|
|
|
String tips = null;
|
|
|
try {
|
|
|
sellerOrderPrepareProcessor.checkPrice(storageId, prdPrice, true);
|
|
|
}catch (Exception ex){
|
|
|
if (ex instanceof UfoServiceException && ((UfoServiceException) ex).getCode() == SellerOrderPrepareProcessor.TIPS_ERROR_CODE){
|
|
|
tips = ((UfoServiceException) ex).getMessage();
|
|
|
}else{
|
|
|
throw ex;
|
|
|
}
|
|
|
}
|
|
|
spc.setTips(tips);
|
|
|
return spc;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -551,11 +539,7 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi |
|
|
.actor(orderRequest.getTabType()).build();
|
|
|
}
|
|
|
|
|
|
@Autowired
|
|
|
private ChangePricePrepareProcessor changePricePrepareProcessor;
|
|
|
|
|
|
@Autowired
|
|
|
private SellerFeeService sellerFeeService;
|
|
|
/**
|
|
|
* 批量调价
|
|
|
* @param req
|
...
|
...
|
@@ -563,11 +547,15 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi |
|
|
*/
|
|
|
public BatchChangePriceResp batchChangePrice(BatchChangePriceReq req) throws GatewayException {
|
|
|
ChangePricePrepareDTO cppDto = changePricePrepareProcessor.checkAndAcquire(req);
|
|
|
BigDecimal diffEarnestMoney = cppDto.getDiffEarnestMoney();
|
|
|
if (diffEarnestMoney.compareTo(BigDecimal.ZERO) == 0){
|
|
|
throw new UfoServiceException(401, "前后价格没有变化");
|
|
|
}
|
|
|
int uid = req.getUid();
|
|
|
Map<Integer, SkupDto> skupMap = cppDto.getSkupMap();
|
|
|
SellerOrderComputeResult computeResult = cppDto.getComputeResult();
|
|
|
//1 划账
|
|
|
BigDecimal diffEarnestMoney = cppDto.getDiffEarnestMoney();
|
|
|
|
|
|
BigDecimal totalDiffMoney = diffEarnestMoney.multiply(new BigDecimal(skupMap.size()));
|
|
|
SellerWalletDetail.Type swdType = SellerWalletDetail.Type.ADD_PRICE;
|
|
|
MerchantOrderAttachInfo moai = MerchantOrderAttachInfo.builder().uid(req.getUid())
|
...
|
...
|
|