|
@@ -11,6 +11,7 @@ import java.util.concurrent.ArrayBlockingQueue; |
|
@@ -11,6 +11,7 @@ import java.util.concurrent.ArrayBlockingQueue; |
11
|
import java.util.concurrent.ExecutorService;
|
11
|
import java.util.concurrent.ExecutorService;
|
12
|
import java.util.concurrent.ThreadPoolExecutor;
|
12
|
import java.util.concurrent.ThreadPoolExecutor;
|
13
|
import java.util.concurrent.TimeUnit;
|
13
|
import java.util.concurrent.TimeUnit;
|
|
|
14
|
+import java.util.function.Consumer;
|
14
|
import java.util.stream.Collectors;
|
15
|
import java.util.stream.Collectors;
|
15
|
|
16
|
|
16
|
import javax.annotation.Resource;
|
17
|
import javax.annotation.Resource;
|
|
@@ -310,13 +311,21 @@ public class AppraiseService { |
|
@@ -310,13 +311,21 @@ public class AppraiseService { |
310
|
buyerNoticeFacade.deliveryDepositGoodsToBuyer(buyerOrder.getUid(), appraiseExpressInfoBo.getWayBillCode(),
|
311
|
buyerNoticeFacade.deliveryDepositGoodsToBuyer(buyerOrder.getUid(), appraiseExpressInfoBo.getWayBillCode(),
|
311
|
() -> cleanCacheAfterUpdateStatus(buyerOrder.getOrderCode(), buyerOrder.getUid(), buyerOrder.getSellerUid()),
|
312
|
() -> cleanCacheAfterUpdateStatus(buyerOrder.getOrderCode(), buyerOrder.getUid(), buyerOrder.getSellerUid()),
|
312
|
sellerOrderGoods -> Optional.ofNullable(sellerOrderGoods).map(SellerOrderGoods::getProductId).map(productMapper::selectByPrimaryKey).orElse(null));
|
313
|
sellerOrderGoods -> Optional.ofNullable(sellerOrderGoods).map(SellerOrderGoods::getProductId).map(productMapper::selectByPrimaryKey).orElse(null));
|
313
|
- }else {
|
314
|
+ }
|
|
|
315
|
+ // 买家接受瑕疵,走非寄存流程
|
|
|
316
|
+ else if (buyerOrder.getStatus() == OrderStatus.MINI_FAULT_ACCEPT.getCode()) {
|
|
|
317
|
+ deliveryNonDepositGoodsToBuyerAndRun(appraiseExpressInfoBo,buyerOrder,sog -> {
|
|
|
318
|
+ // 通知买家已发货
|
|
|
319
|
+ buyerNoticeFacade.deliveryDepositGoodsToBuyer(buyerOrder.getUid(), appraiseExpressInfoBo.getWayBillCode(), sog,
|
|
|
320
|
+ sellerOrderGoods -> Optional.ofNullable(sellerOrderGoods).map(SellerOrderGoods::getProductId).map(productMapper::selectByPrimaryKey).orElse(null));
|
|
|
321
|
+ });
|
|
|
322
|
+ } else {
|
314
|
LOGGER.warn("in deliveryGoodsToBuyer, buyer Deposit Order orderCode {}", buyerOrder.getOrderCode());
|
323
|
LOGGER.warn("in deliveryGoodsToBuyer, buyer Deposit Order orderCode {}", buyerOrder.getOrderCode());
|
315
|
throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE);
|
324
|
throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE);
|
316
|
}
|
325
|
}
|
317
|
}
|
326
|
}
|
318
|
|
327
|
|
319
|
- private void deliveryNonDepositGoodsToBuyer(AppraiseExpressInfoBo appraiseExpressInfoBo, BuyerOrder buyerOrder) {
|
328
|
+ private void deliveryNonDepositGoodsToBuyerAndRun(AppraiseExpressInfoBo appraiseExpressInfoBo, BuyerOrder buyerOrder, Consumer<SellerOrderGoods> run) {
|
320
|
final Long orderCode = buyerOrder.getOrderCode();
|
329
|
final Long orderCode = buyerOrder.getOrderCode();
|
321
|
final OrderStatus expectOrderStatus;
|
330
|
final OrderStatus expectOrderStatus;
|
322
|
final OrderStatus targetOrderStatus = OrderStatus.WAITING_RECEIVE;
|
331
|
final OrderStatus targetOrderStatus = OrderStatus.WAITING_RECEIVE;
|
|
@@ -350,11 +359,12 @@ public class AppraiseService { |
|
@@ -350,11 +359,12 @@ public class AppraiseService { |
350
|
});
|
359
|
});
|
351
|
//记录订单的状态变更信息
|
360
|
//记录订单的状态变更信息
|
352
|
orderStatusFlowService.addAsy(buyerOrder.getOrderCode(), targetOrderStatus.getCode());
|
361
|
orderStatusFlowService.addAsy(buyerOrder.getOrderCode(), targetOrderStatus.getCode());
|
353
|
-
|
|
|
354
|
//清缓存
|
362
|
//清缓存
|
355
|
SellerOrderGoods sellerOrderGoods = cleanCacheAfterUpdateStatus(buyerOrder.getOrderCode(), buyerOrder.getUid(), buyerOrder.getSellerUid());
|
363
|
SellerOrderGoods sellerOrderGoods = cleanCacheAfterUpdateStatus(buyerOrder.getOrderCode(), buyerOrder.getUid(), buyerOrder.getSellerUid());
|
356
|
- Product product = Optional.ofNullable(sellerOrderGoods).map(SellerOrderGoods::getProductId).map(productMapper::selectByPrimaryKey).orElse(null);
|
|
|
357
|
- buyerNoticeFacade.deliveryGoodsToBuyer(buyerOrder, sellerOrderGoods, product);
|
364
|
+ if(Objects.nonNull(run)){
|
|
|
365
|
+ run.accept(sellerOrderGoods);
|
|
|
366
|
+ }
|
|
|
367
|
+
|
358
|
} else {
|
368
|
} else {
|
359
|
LOGGER.warn("in deliveryGoodsToBuyer update status number zero, buyer Order orderCode {} pstatus {}, expect Order Status {}",
|
369
|
LOGGER.warn("in deliveryGoodsToBuyer update status number zero, buyer Order orderCode {} pstatus {}, expect Order Status {}",
|
360
|
orderCode, buyerOrder.getStatus(), expectOrderStatus);
|
370
|
orderCode, buyerOrder.getStatus(), expectOrderStatus);
|
|
@@ -362,6 +372,13 @@ public class AppraiseService { |
|
@@ -362,6 +372,13 @@ public class AppraiseService { |
362
|
}
|
372
|
}
|
363
|
}
|
373
|
}
|
364
|
|
374
|
|
|
|
375
|
+ private void deliveryNonDepositGoodsToBuyer(AppraiseExpressInfoBo appraiseExpressInfoBo, BuyerOrder buyerOrder) {
|
|
|
376
|
+ deliveryNonDepositGoodsToBuyerAndRun(appraiseExpressInfoBo, buyerOrder, sellerOrderGoods -> {
|
|
|
377
|
+ Product product = Optional.ofNullable(sellerOrderGoods).map(SellerOrderGoods::getProductId).map(productMapper::selectByPrimaryKey).orElse(null);
|
|
|
378
|
+ buyerNoticeFacade.deliveryGoodsToBuyer(buyerOrder, sellerOrderGoods, product);
|
|
|
379
|
+ });
|
|
|
380
|
+ }
|
|
|
381
|
+
|
365
|
/**
|
382
|
/**
|
366
|
* 鉴定不通过退回
|
383
|
* 鉴定不通过退回
|
367
|
* (1)记录物流
|
384
|
* (1)记录物流
|