...
|
...
|
@@ -200,27 +200,43 @@ public class AppraiseService { |
|
|
*/
|
|
|
public void deliveryGoodsToBuyer(AppraiseExpressInfoBo appraiseExpressInfoBo) {
|
|
|
LOGGER.info("deliveryGoodsToBuyer enter req {}", appraiseExpressInfoBo);
|
|
|
final OrderStatus expectOrderStatus;
|
|
|
final OrderStatus targetOrderStatus = OrderStatus.WAITING_RECEIVE;
|
|
|
Long orderCode = appraiseExpressInfoBo.getOrderCode();
|
|
|
BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
|
|
|
|
|
|
if (buyerOrder == null) {
|
|
|
LOGGER.warn("deliveryGoodsToBuyer getOrderInfo order not exist, orderCode is {}", orderCode);
|
|
|
throw new ServiceException(ServiceError.ORDER_NULL);
|
|
|
}
|
|
|
// 寄存订单
|
|
|
if(BuyerOrderUtils.isDeposit(buyerOrder.getAttributes())){
|
|
|
deliveryDepositGoodsToBuyer(appraiseExpressInfoBo, buyerOrder);
|
|
|
} else {
|
|
|
deliveryNonDepositGoodsToBuyer(appraiseExpressInfoBo, buyerOrder);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
private void deliveryDepositGoodsToBuyer(AppraiseExpressInfoBo appraiseExpressInfoBo, BuyerOrder buyerOrder) {
|
|
|
if(buyerOrder.getStatus() == OrderStatus.DONE.getCode()){
|
|
|
expressInfoService.deliverGoods(buyerOrder.getUid(),
|
|
|
appraiseExpressInfoBo.getExpressCompanyId(),
|
|
|
buyerOrder.getOrderCode(),
|
|
|
appraiseExpressInfoBo.getWayBillCode(),
|
|
|
appraiseExpressInfoBo.getDepotNum(),
|
|
|
appraiseExpressInfoBo.getMobile());
|
|
|
}else {
|
|
|
LOGGER.warn("in deliveryGoodsToBuyer, buyer Deposit Order orderCode {}", buyerOrder.getOrderCode());
|
|
|
throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private void deliveryNonDepositGoodsToBuyer(AppraiseExpressInfoBo appraiseExpressInfoBo, BuyerOrder buyerOrder) {
|
|
|
final Long orderCode = buyerOrder.getOrderCode();
|
|
|
final OrderStatus expectOrderStatus;
|
|
|
final OrderStatus targetOrderStatus = OrderStatus.WAITING_RECEIVE;
|
|
|
if (buyerOrder.getStatus() == OrderStatus.JUDGE_PASS.getCode()) {
|
|
|
expectOrderStatus = OrderStatus.JUDGE_PASS;
|
|
|
} else if (buyerOrder.getStatus() == OrderStatus.MINI_FAULT_ACCEPT.getCode()) {
|
|
|
expectOrderStatus = OrderStatus.MINI_FAULT_ACCEPT;
|
|
|
}
|
|
|
// 寄存订单已完成
|
|
|
else if (BuyerOrderUtils.isDeposit(buyerOrder.getAttributes())
|
|
|
&& buyerOrder.getStatus() == OrderStatus.DONE.getCode()) {
|
|
|
//记录物流信息
|
|
|
//发物流
|
|
|
expressInfoService.deliverGoods(buyerOrder.getUid(), appraiseExpressInfoBo.getExpressCompanyId(), orderCode, appraiseExpressInfoBo.getWayBillCode(), appraiseExpressInfoBo.getDepotNum(), appraiseExpressInfoBo.getMobile());
|
|
|
return;
|
|
|
} else {
|
|
|
LOGGER.warn("in deliveryGoodsToBuyer, buyer Order orderCode {} pstatus {}, expect Order Status JUDGE_PASS or MINI_FAULT_ACCEPT ",
|
|
|
orderCode, buyerOrder.getStatus());
|
...
|
...
|
|