...
|
...
|
@@ -932,35 +932,42 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServic |
|
|
|
|
|
|
|
|
|
|
|
public SoldPrdComputeBo computeByBuyerOrder(SellerFeeComputeWithOrderReq req){
|
|
|
log.info("in computeByBuyerOrder {}",req);
|
|
|
public SoldPrdComputeBo computeWithCoupon(SellerFeeComputeWithOrderReq req){
|
|
|
log.info("in computeWithCoupon {}",req);
|
|
|
int uid = req.getUid();
|
|
|
if (uid<1){
|
|
|
log.warn("computeByBuyerOrder uid error,{}", req);
|
|
|
log.warn("computeWithCoupon uid error,{}", req);
|
|
|
throw new UfoServiceException(401, "用户信息不正确");
|
|
|
}
|
|
|
|
|
|
Long orderCode = req.getOrderCode();
|
|
|
if (Objects.isNull(orderCode)){
|
|
|
log.warn("computeByBuyerOrder orderCode error,{}", req);
|
|
|
log.warn("computeWithCoupon orderCode error,{}", req);
|
|
|
throw new UfoServiceException(401, "订单号不正确");
|
|
|
}
|
|
|
BuyerOrderAssistant.PreparedData preparedData = buyerOrderAssistant.prepare(orderCode);
|
|
|
|
|
|
BuyerOrder pbo = preparedData.getBuyerOrder();
|
|
|
if (Objects.isNull(pbo)){
|
|
|
log.warn("computeByBuyerOrder can not find order in DB,{}", req);
|
|
|
log.warn("computeWithCoupon can not find order in DB,{}", req);
|
|
|
throw new UfoServiceException(401, "订单号不正确");
|
|
|
}
|
|
|
if (!pbo.getSellerUid().equals(uid)){
|
|
|
log.warn("computeByBuyerOrder can not find seller self order in DB,{}", req);
|
|
|
log.warn("computeWithCoupon can not find seller self order in DB,{}", req);
|
|
|
throw new UfoServiceException(401, "非你所属的订单");
|
|
|
}
|
|
|
Integer status;
|
|
|
if (!ActionStatusHold.sellerCanUseCoupon(status=pbo.getStatus())){
|
|
|
log.warn("computeWithCoupon buyer order status not support,{} status {}", req,status);
|
|
|
throw new UfoServiceException(401, "订单当前状态不能用券");
|
|
|
}
|
|
|
|
|
|
|
|
|
SellerOrderGoods psog = preparedData.getSellerOrderGoods();
|
|
|
|
|
|
SellerOrderComputeResult computeResult = sellerFeeService.getSellerOrderComputeResult(psog.getUid(), psog.getId());
|
|
|
|
|
|
//autoRecommended
|
|
|
//todo next version maybe set autoRecommended
|
|
|
boolean autoRecommended = "Y".equalsIgnoreCase(req.getAutoRecommended());
|
|
|
//
|
|
|
SellerOrderChargeParam chargeParam = SellerOrderChargeParam.builder()
|
...
|
...
|
@@ -971,7 +978,7 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServic |
|
|
sorboc.setBusinessClient(req.getBusinessClient());
|
|
|
sorboc.setCouponCode(req.getCouponCode());
|
|
|
sorboc.setSkupInfo(psog);
|
|
|
sorboc.setAutoRecommended(autoRecommended);
|
|
|
//sorboc.setAutoRecommended(autoRecommended);
|
|
|
sorboc.setChargeParam(chargeParam);
|
|
|
sorboc.setSellerOrderComputeResult(computeResult);
|
|
|
|
...
|
...
|
|