...
|
...
|
@@ -11,6 +11,7 @@ import java.util.concurrent.ArrayBlockingQueue; |
|
|
import java.util.concurrent.ExecutorService;
|
|
|
import java.util.concurrent.ThreadPoolExecutor;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.function.Consumer;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import javax.annotation.Resource;
|
...
|
...
|
@@ -310,13 +311,21 @@ public class AppraiseService { |
|
|
buyerNoticeFacade.deliveryDepositGoodsToBuyer(buyerOrder.getUid(), appraiseExpressInfoBo.getWayBillCode(),
|
|
|
() -> cleanCacheAfterUpdateStatus(buyerOrder.getOrderCode(), buyerOrder.getUid(), buyerOrder.getSellerUid()),
|
|
|
sellerOrderGoods -> Optional.ofNullable(sellerOrderGoods).map(SellerOrderGoods::getProductId).map(productMapper::selectByPrimaryKey).orElse(null));
|
|
|
}else {
|
|
|
}
|
|
|
// 买家接受瑕疵,走非寄存流程
|
|
|
else if (buyerOrder.getStatus() == OrderStatus.MINI_FAULT_ACCEPT.getCode()) {
|
|
|
deliveryNonDepositGoodsToBuyerAndRun(appraiseExpressInfoBo,buyerOrder,sog -> {
|
|
|
// 通知买家已发货
|
|
|
buyerNoticeFacade.deliveryDepositGoodsToBuyer(buyerOrder.getUid(), appraiseExpressInfoBo.getWayBillCode(), sog,
|
|
|
sellerOrderGoods -> Optional.ofNullable(sellerOrderGoods).map(SellerOrderGoods::getProductId).map(productMapper::selectByPrimaryKey).orElse(null));
|
|
|
});
|
|
|
} 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) {
|
|
|
private void deliveryNonDepositGoodsToBuyerAndRun(AppraiseExpressInfoBo appraiseExpressInfoBo, BuyerOrder buyerOrder, Consumer<SellerOrderGoods> run) {
|
|
|
final Long orderCode = buyerOrder.getOrderCode();
|
|
|
final OrderStatus expectOrderStatus;
|
|
|
final OrderStatus targetOrderStatus = OrderStatus.WAITING_RECEIVE;
|
...
|
...
|
@@ -350,11 +359,12 @@ public class AppraiseService { |
|
|
});
|
|
|
//记录订单的状态变更信息
|
|
|
orderStatusFlowService.addAsy(buyerOrder.getOrderCode(), targetOrderStatus.getCode());
|
|
|
|
|
|
//清缓存
|
|
|
SellerOrderGoods sellerOrderGoods = cleanCacheAfterUpdateStatus(buyerOrder.getOrderCode(), buyerOrder.getUid(), buyerOrder.getSellerUid());
|
|
|
Product product = Optional.ofNullable(sellerOrderGoods).map(SellerOrderGoods::getProductId).map(productMapper::selectByPrimaryKey).orElse(null);
|
|
|
buyerNoticeFacade.deliveryGoodsToBuyer(buyerOrder, sellerOrderGoods, product);
|
|
|
if(Objects.nonNull(run)){
|
|
|
run.accept(sellerOrderGoods);
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
LOGGER.warn("in deliveryGoodsToBuyer update status number zero, buyer Order orderCode {} pstatus {}, expect Order Status {}",
|
|
|
orderCode, buyerOrder.getStatus(), expectOrderStatus);
|
...
|
...
|
@@ -362,6 +372,13 @@ public class AppraiseService { |
|
|
}
|
|
|
}
|
|
|
|
|
|
private void deliveryNonDepositGoodsToBuyer(AppraiseExpressInfoBo appraiseExpressInfoBo, BuyerOrder buyerOrder) {
|
|
|
deliveryNonDepositGoodsToBuyerAndRun(appraiseExpressInfoBo, buyerOrder, sellerOrderGoods -> {
|
|
|
Product product = Optional.ofNullable(sellerOrderGoods).map(SellerOrderGoods::getProductId).map(productMapper::selectByPrimaryKey).orElse(null);
|
|
|
buyerNoticeFacade.deliveryGoodsToBuyer(buyerOrder, sellerOrderGoods, product);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 鉴定不通过退回
|
|
|
* (1)记录物流
|
...
|
...
|
|