|
@@ -13,6 +13,7 @@ import com.yohobuy.ufo.model.promotion.request.CouponSendMqBean; |
|
@@ -13,6 +13,7 @@ import com.yohobuy.ufo.model.promotion.request.CouponSendMqBean; |
13
|
import com.yohobuy.ufo.model.promotion.request.CouponSendType;
|
13
|
import com.yohobuy.ufo.model.promotion.request.CouponSendType;
|
14
|
import com.yohoufo.common.ApiResponse;
|
14
|
import com.yohoufo.common.ApiResponse;
|
15
|
import com.yohoufo.common.alarm.EventBusPublisher;
|
15
|
import com.yohoufo.common.alarm.EventBusPublisher;
|
|
|
16
|
+import com.yohoufo.common.constant.EnumPlatformDeliveryStatus;
|
16
|
import com.yohoufo.common.utils.DateUtil;
|
17
|
import com.yohoufo.common.utils.DateUtil;
|
17
|
import com.yohoufo.dal.order.*;
|
18
|
import com.yohoufo.dal.order.*;
|
18
|
import com.yohoufo.dal.order.model.*;
|
19
|
import com.yohoufo.dal.order.model.*;
|
|
@@ -68,7 +69,7 @@ public class AppraiseService { |
|
@@ -68,7 +69,7 @@ public class AppraiseService { |
68
|
|
69
|
|
69
|
private static final Logger LOGGER = LoggerFactory.getLogger(AppraiseService.class);
|
70
|
private static final Logger LOGGER = LoggerFactory.getLogger(AppraiseService.class);
|
70
|
|
71
|
|
71
|
- private ExecutorService executorService = new ThreadPoolExecutor(3, 5, 60, TimeUnit.SECONDS, new ArrayBlockingQueue<>(100), new PubThreadFactory("appraise-processor"));
|
72
|
+ private ExecutorService executorService = new ThreadPoolExecutor(5, 10, 60, TimeUnit.SECONDS, new ArrayBlockingQueue<>(1000), new PubThreadFactory("appraise-processor"));
|
72
|
|
73
|
|
73
|
@Autowired
|
74
|
@Autowired
|
74
|
private IExpressInfoService expressInfoService;
|
75
|
private IExpressInfoService expressInfoService;
|
|
@@ -214,10 +215,15 @@ public class AppraiseService { |
|
@@ -214,10 +215,15 @@ public class AppraiseService { |
214
|
BuyerConfirmEvent buyerConfirmEvent = BuyerConfirmEvent.builder().uid(buyerUid).orderCode(orderCode).build();
|
215
|
BuyerConfirmEvent buyerConfirmEvent = BuyerConfirmEvent.builder().uid(buyerUid).orderCode(orderCode).build();
|
215
|
EventBusPublisher.publishEvent(buyerConfirmEvent);
|
216
|
EventBusPublisher.publishEvent(buyerConfirmEvent);
|
216
|
|
217
|
|
|
|
218
|
+ executorService.execute(() -> {
|
217
|
//记录物流信息
|
219
|
//记录物流信息
|
218
|
//发物流
|
220
|
//发物流
|
219
|
expressInfoService.deliverGoods(buyerUid, appraiseExpressInfoBo.getExpressCompanyId(), orderCode, appraiseExpressInfoBo.getWayBillCode(), appraiseExpressInfoBo.getDepotNum(), appraiseExpressInfoBo.getMobile());
|
221
|
expressInfoService.deliverGoods(buyerUid, appraiseExpressInfoBo.getExpressCompanyId(), orderCode, appraiseExpressInfoBo.getWayBillCode(), appraiseExpressInfoBo.getDepotNum(), appraiseExpressInfoBo.getMobile());
|
220
|
|
222
|
|
|
|
223
|
+ //更新平台物流状态为已发货
|
|
|
224
|
+ buyerOrderMapper.updatePlatformDeliveryStatusByOrderCode(orderCode, buyerOrder.getUid(),
|
|
|
225
|
+ EnumPlatformDeliveryStatus.delivery_to_buyer.getCode(), DateUtil.getCurrentTimeSecond());
|
|
|
226
|
+ });
|
221
|
//记录订单的状态变更信息
|
227
|
//记录订单的状态变更信息
|
222
|
orderStatusFlowService.addAsy(buyerOrder.getOrderCode(), targetOrderStatus.getCode());
|
228
|
orderStatusFlowService.addAsy(buyerOrder.getOrderCode(), targetOrderStatus.getCode());
|
223
|
|
229
|
|
|
@@ -291,11 +297,16 @@ public class AppraiseService { |
|
@@ -291,11 +297,16 @@ public class AppraiseService { |
291
|
LOGGER.info("returnBackOrderCauseOfJudgeFailure check status ok expectStatus {}, actual status {}, orderCode {}", expectStatus,
|
297
|
LOGGER.info("returnBackOrderCauseOfJudgeFailure check status ok expectStatus {}, actual status {}, orderCode {}", expectStatus,
|
292
|
buyerOrder.getStatus(), orderCode);
|
298
|
buyerOrder.getStatus(), orderCode);
|
293
|
|
299
|
|
294
|
-
|
300
|
+ executorService.execute(() -> {
|
295
|
//更新物流信息
|
301
|
//更新物流信息
|
296
|
int sellerUid = buyerOrder.getSellerUid();
|
302
|
int sellerUid = buyerOrder.getSellerUid();
|
297
|
expressInfoService.returnBackOrderCauseOfJudgeFailure(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum, mobile);
|
303
|
expressInfoService.returnBackOrderCauseOfJudgeFailure(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum, mobile);
|
298
|
|
304
|
|
|
|
305
|
+ //更新平台物流状态为已发货
|
|
|
306
|
+ buyerOrderMapper.updatePlatformDeliveryStatusByOrderCode(orderCode, buyerOrder.getUid(),
|
|
|
307
|
+ EnumPlatformDeliveryStatus.delivery_to_seller.getCode(), DateUtil.getCurrentTimeSecond());
|
|
|
308
|
+
|
|
|
309
|
+ });
|
299
|
//清缓存
|
310
|
//清缓存
|
300
|
SellerOrderGoods sellerOrderGoods = cleanCacheAfterUpdateStatus(buyerOrder.getOrderCode(), buyerOrder.getUid(), buyerOrder.getSellerUid());
|
311
|
SellerOrderGoods sellerOrderGoods = cleanCacheAfterUpdateStatus(buyerOrder.getOrderCode(), buyerOrder.getUid(), buyerOrder.getSellerUid());
|
301
|
|
312
|
|
|
@@ -342,10 +353,15 @@ public class AppraiseService { |
|
@@ -342,10 +353,15 @@ public class AppraiseService { |
342
|
throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE);
|
353
|
throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE);
|
343
|
}
|
354
|
}
|
344
|
|
355
|
|
345
|
- //记录物流信息
|
|
|
346
|
int sellerUid = buyerOrder.getSellerUid();
|
356
|
int sellerUid = buyerOrder.getSellerUid();
|
|
|
357
|
+ executorService.execute(() -> {
|
|
|
358
|
+ //记录物流信息
|
347
|
expressInfoService.returnBackCauseOfBuyerCancelAfterSellerSendOut(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum, mobile, false);
|
359
|
expressInfoService.returnBackCauseOfBuyerCancelAfterSellerSendOut(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum, mobile, false);
|
348
|
|
360
|
|
|
|
361
|
+ //更新平台物流状态为已发货
|
|
|
362
|
+ buyerOrderMapper.updatePlatformDeliveryStatusByOrderCode(orderCode, buyerOrder.getUid(),
|
|
|
363
|
+ EnumPlatformDeliveryStatus.delivery_to_seller.getCode(), DateUtil.getCurrentTimeSecond());
|
|
|
364
|
+ });
|
349
|
//发送消息
|
365
|
//发送消息
|
350
|
inBoxFacade.sendCancelledProductToSellerByCenter(sellerUid, wayBillCode);
|
366
|
inBoxFacade.sendCancelledProductToSellerByCenter(sellerUid, wayBillCode);
|
351
|
|
367
|
|
|
@@ -384,8 +400,14 @@ public class AppraiseService { |
|
@@ -384,8 +400,14 @@ public class AppraiseService { |
384
|
|
400
|
|
385
|
//记录物流信息
|
401
|
//记录物流信息
|
386
|
int sellerUid = buyerOrder.getSellerUid();
|
402
|
int sellerUid = buyerOrder.getSellerUid();
|
|
|
403
|
+ executorService.execute(() -> {
|
387
|
expressInfoService.returnBackCauseOfBuyerCancelAfterSellerSendOut(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum, mobile, true);
|
404
|
expressInfoService.returnBackCauseOfBuyerCancelAfterSellerSendOut(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum, mobile, true);
|
388
|
|
405
|
|
|
|
406
|
+ //更新平台物流状态为已发货
|
|
|
407
|
+ buyerOrderMapper.updatePlatformDeliveryStatusByOrderCode(orderCode, buyerOrder.getUid(),
|
|
|
408
|
+ EnumPlatformDeliveryStatus.delivery_to_seller.getCode(), DateUtil.getCurrentTimeSecond());
|
|
|
409
|
+ });
|
|
|
410
|
+
|
389
|
//发送消息
|
411
|
//发送消息
|
390
|
//清缓存
|
412
|
//清缓存
|
391
|
SellerOrderGoods sellerOrderGoods = cleanCacheAfterUpdateStatus(buyerOrder.getOrderCode(), buyerOrder.getUid(), buyerOrder.getSellerUid());
|
413
|
SellerOrderGoods sellerOrderGoods = cleanCacheAfterUpdateStatus(buyerOrder.getOrderCode(), buyerOrder.getUid(), buyerOrder.getSellerUid());
|
|
@@ -403,9 +425,6 @@ public class AppraiseService { |
|
@@ -403,9 +425,6 @@ public class AppraiseService { |
403
|
LOGGER.info("Buyer Order miniFaultAccept (OrderRequest) {}", orderRequest);
|
425
|
LOGGER.info("Buyer Order miniFaultAccept (OrderRequest) {}", orderRequest);
|
404
|
//订单状态变更为鉴定中 ,记录调拨的物流信息 ,发消息 ,
|
426
|
//订单状态变更为鉴定中 ,记录调拨的物流信息 ,发消息 ,
|
405
|
OrderStatus expectStatus = OrderStatus.MINI_FAULT_WAITING;
|
427
|
OrderStatus expectStatus = OrderStatus.MINI_FAULT_WAITING;
|
406
|
- //拆分状态,版本升级之后存在的特殊订单
|
|
|
407
|
- //OrderStatus expectStatusAnother = OrderStatus.PLATFORM_RECEIVE;
|
|
|
408
|
- //List<Integer> expectStatusList= Lists.newArrayList(expectStatus.getCode(),expectStatusAnother.getCode());
|
|
|
409
|
OrderStatus targetStatus = OrderStatus.MINI_FAULT_ACCEPT;
|
428
|
OrderStatus targetStatus = OrderStatus.MINI_FAULT_ACCEPT;
|
410
|
|
429
|
|
411
|
// 参数检查
|
430
|
// 参数检查
|
|
@@ -426,8 +445,6 @@ public class AppraiseService { |
|
@@ -426,8 +445,6 @@ public class AppraiseService { |
426
|
buyerOrder.getStatus(), buyerOrder.getOrderCode());
|
445
|
buyerOrder.getStatus(), buyerOrder.getOrderCode());
|
427
|
throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE);
|
446
|
throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE);
|
428
|
}
|
447
|
}
|
429
|
- //checkStatusWithMoreExpectStatus(buyerOrder,orderRequest, expectStatusList);
|
|
|
430
|
-
|
|
|
431
|
int buyerUid = orderRequest.getUid();
|
448
|
int buyerUid = orderRequest.getUid();
|
432
|
long orderCode = orderRequest.getOrderCode();
|
449
|
long orderCode = orderRequest.getOrderCode();
|
433
|
int sellerUid = buyerOrder.getSellerUid();
|
450
|
int sellerUid = buyerOrder.getSellerUid();
|
|
@@ -497,9 +514,7 @@ public class AppraiseService { |
|
@@ -497,9 +514,7 @@ public class AppraiseService { |
497
|
LOGGER.info("Buyer Order miniFaultNotAccept (OrderRequest) {}", orderRequest);
|
514
|
LOGGER.info("Buyer Order miniFaultNotAccept (OrderRequest) {}", orderRequest);
|
498
|
//订单状态变更为 鉴定不通过 ,记录调拨的物流信息 ,发消息 ,
|
515
|
//订单状态变更为 鉴定不通过 ,记录调拨的物流信息 ,发消息 ,
|
499
|
OrderStatus expectStatus = OrderStatus.MINI_FAULT_WAITING;
|
516
|
OrderStatus expectStatus = OrderStatus.MINI_FAULT_WAITING;
|
500
|
- //拆分状态,版本升级之后存在的特殊订单
|
|
|
501
|
- //OrderStatus expectStatusAnother = OrderStatus.PLATFORM_RECEIVE;
|
|
|
502
|
- //List<Integer> expectStatusList= Lists.newArrayList(expectStatusNew.getCode(),expectStatusAnother.getCode());
|
517
|
+
|
503
|
OrderStatus targetStatus = OrderStatus.MINI_FAULT_REJECT;
|
518
|
OrderStatus targetStatus = OrderStatus.MINI_FAULT_REJECT;
|
504
|
// 参数检查
|
519
|
// 参数检查
|
505
|
if (orderRequest.getUid() < 0
|
520
|
if (orderRequest.getUid() < 0
|
|
@@ -521,8 +536,6 @@ public class AppraiseService { |
|
@@ -521,8 +536,6 @@ public class AppraiseService { |
521
|
throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE);
|
536
|
throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE);
|
522
|
}
|
537
|
}
|
523
|
|
538
|
|
524
|
- //checkStatusWithMoreExpectStatus(buyerOrder,orderRequest, expectStatusList);
|
|
|
525
|
-
|
|
|
526
|
long orderCode = orderRequest.getOrderCode();
|
539
|
long orderCode = orderRequest.getOrderCode();
|
527
|
ApiResponse result = this.miniFaultReject(orderCode, targetStatus, false);
|
540
|
ApiResponse result = this.miniFaultReject(orderCode, targetStatus, false);
|
528
|
|
541
|
|
|
@@ -536,21 +549,6 @@ public class AppraiseService { |
|
@@ -536,21 +549,6 @@ public class AppraiseService { |
536
|
|
549
|
|
537
|
}
|
550
|
}
|
538
|
|
551
|
|
539
|
- /*
|
|
|
540
|
- * 该方法再6.8.6.5版本中使用,拆分订单的时候,存在多种情况expectStatus
|
|
|
541
|
- * 瑕疵接受
|
|
|
542
|
- * 瑕疵不接受 这两种情形使用
|
|
|
543
|
- @Deprecated
|
|
|
544
|
- private void checkStatusWithMoreExpectStatus(BuyerOrder buyerOrder, OrderRequest orderRequest, List<Integer> expectStatusList ) {
|
|
|
545
|
- // 检查 订单状态
|
|
|
546
|
- int status = buyerOrder.getStatus() == null ? -1 : buyerOrder.getStatus().intValue();
|
|
|
547
|
- OrderStatus orderStatus = OrderStatus.getOrderStatus(status);
|
|
|
548
|
- if (orderStatus == null || !expectStatusList.contains(orderStatus.getCode())){
|
|
|
549
|
- LOGGER.warn("check status invalidate, uid is {}, orderCode is {}, status is {}",
|
|
|
550
|
- orderRequest.getUid(), orderRequest.getOrderCode(), buyerOrder.getStatus());
|
|
|
551
|
- throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE);
|
|
|
552
|
- }
|
|
|
553
|
- }*/
|
|
|
554
|
|
552
|
|
555
|
/**
|
553
|
/**
|
556
|
* 瑕疵不通过: 买家不接受或者超时确认
|
554
|
* 瑕疵不通过: 买家不接受或者超时确认
|
|
@@ -561,9 +559,6 @@ public class AppraiseService { |
|
@@ -561,9 +559,6 @@ public class AppraiseService { |
561
|
public ApiResponse miniFaultReject(Long orderCode, OrderStatus targetStatus, boolean outTimeFlag) {
|
559
|
public ApiResponse miniFaultReject(Long orderCode, OrderStatus targetStatus, boolean outTimeFlag) {
|
562
|
LOGGER.info("miniFaultReject enter , orderCode {} ,targetStatus {},outTimeFlag {}", orderCode, targetStatus, outTimeFlag);
|
560
|
LOGGER.info("miniFaultReject enter , orderCode {} ,targetStatus {},outTimeFlag {}", orderCode, targetStatus, outTimeFlag);
|
563
|
OrderStatus expectStatus = OrderStatus.MINI_FAULT_WAITING;
|
561
|
OrderStatus expectStatus = OrderStatus.MINI_FAULT_WAITING;
|
564
|
- //拆分状态,版本升级之后存在的特殊订单
|
|
|
565
|
- //OrderStatus expectStatusAnother = OrderStatus.PLATFORM_RECEIVE;
|
|
|
566
|
- //List<Integer> expectStatusList= Lists.newArrayList(expectStatusNew.getCode(),expectStatusAnother.getCode());
|
|
|
567
|
ApiResponse apiResponse = new ApiResponse();
|
562
|
ApiResponse apiResponse = new ApiResponse();
|
568
|
BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
|
563
|
BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
|
569
|
|
564
|
|
|
@@ -741,70 +736,6 @@ public class AppraiseService { |
|
@@ -741,70 +736,6 @@ public class AppraiseService { |
741
|
DateUtil.getCurrentTimeSecond());
|
736
|
DateUtil.getCurrentTimeSecond());
|
742
|
|
737
|
|
743
|
if (rows > 0) {
|
738
|
if (rows > 0) {
|
744
|
- /*
|
|
|
745
|
- //refund coupons of buyer
|
|
|
746
|
- BuyerRefundCouponEvent brce = BuyerRefundCouponEvent.builder().bizCase(BuyerRefundCouponEvent.BizCase.APPRAISE_FAIL)
|
|
|
747
|
- .uid(buyerUid).orderCode(orderCode).build();
|
|
|
748
|
- EventBusPublisher.publishEvent(brce);
|
|
|
749
|
- //
|
|
|
750
|
-
|
|
|
751
|
- BuyerOrderGoods bog = buyerOrderGoodsMapper.selectByOrderCode(buyerUid, orderCode);
|
|
|
752
|
- int skup = bog.getSkup();
|
|
|
753
|
-
|
|
|
754
|
- SellerOrder sellerOrder = sellerOrderMapper.selectBySkup(skup);
|
|
|
755
|
- long sellerOrderCode = sellerOrder.getOrderCode();
|
|
|
756
|
-
|
|
|
757
|
- final SellerOrderStatus expectSOStatus = SellerOrderStatus.HAS_PAYED;
|
|
|
758
|
- final SellerOrderStatus targetSoStatus = SellerOrderStatus.APPRAISAL_FAIL_COMPENSATE;
|
|
|
759
|
-
|
|
|
760
|
- SellerOrderGoods sellerOrderGoods = updateSellerOrderStatusAndCleanCache(sellerUid ,sellerOrderCode,expectSOStatus,targetSoStatus,
|
|
|
761
|
- skup, orderCode, buyerUid);
|
|
|
762
|
-
|
|
|
763
|
- //将卖家的保证金分账给平台和买家
|
|
|
764
|
- PenaltyResult penaltyResult = SellerEarnestMoney2BuyerPenaltyCalculator.from(sellerOrderMetaMapper.selectByMetaKey(sellerUid, skup, "fee"))
|
|
|
765
|
- .calculate()
|
|
|
766
|
- .orElse(null);
|
|
|
767
|
- if(Objects.nonNull(penaltyResult)){
|
|
|
768
|
- TransferCase transferCase = TransferCase.EARNEST_MONEY_TO_BUYER;
|
|
|
769
|
- TranseferCellNode transeferCellNode = new TranseferCellNode();
|
|
|
770
|
- transeferCellNode.setUid(buyerUid);
|
|
|
771
|
- transeferCellNode.setAmount(penaltyResult.getPenaltyAmountWithoutYhServiceAmount());
|
|
|
772
|
- TransferMoneyRequest tmReq = TransferMoneyRequest.builder()
|
|
|
773
|
- .sellerUid(sellerUid)
|
|
|
774
|
- .buyerOrderCode(orderCode)
|
|
|
775
|
- .type(transferCase.getCode())
|
|
|
776
|
- .transferCase(transferCase)
|
|
|
777
|
- .transeferCellNode(transeferCellNode)
|
|
|
778
|
- .swdType(SellerWalletDetail.Type.APPRAISE_FAIL)
|
|
|
779
|
- .alarmConfig(AlarmConfig.APPRAISE_FAIL)
|
|
|
780
|
- .build();
|
|
|
781
|
-
|
|
|
782
|
- //先校验,提前把错误抛出
|
|
|
783
|
- paymentService.transferMonCheck(tmReq);
|
|
|
784
|
- //再分账
|
|
|
785
|
-
|
|
|
786
|
- //改成异步的分账,不关心分账执行结果
|
|
|
787
|
- executorService.execute(()->{
|
|
|
788
|
- LOGGER.info("in appraiseFail,begin transfer async");
|
|
|
789
|
- transferService.transfer(tmReq);
|
|
|
790
|
- });
|
|
|
791
|
- }
|
|
|
792
|
-
|
|
|
793
|
-
|
|
|
794
|
- //退钱给买家
|
|
|
795
|
- BigDecimal goodsAmount = buyerOrder.getAmount();
|
|
|
796
|
- BillLogEvent.BillLogEventBuilder bleb = BillLogEvent.builder()
|
|
|
797
|
- .buyerUid(buyerUid).sellerUid(sellerUid).orderCode(orderCode)
|
|
|
798
|
- .payType(buyerOrder.getPayment()).refundCase(RefundCase.BUYER_GOODS_MONEY)
|
|
|
799
|
- .amount(goodsAmount)
|
|
|
800
|
- .skup(skup);
|
|
|
801
|
- boolean refundGoodsMoneyFlag = new RefundGoodsMoneyHandler().loadPaymentRequest(buyerUid,orderCode,goodsAmount)
|
|
|
802
|
- .loadBillLogEventBuilder(bleb)
|
|
|
803
|
- .loadTargetOrderStatus(targetStatus)
|
|
|
804
|
- .loadRefundAction(payRefundService::refund)
|
|
|
805
|
- .loadLogger(LOGGER)
|
|
|
806
|
- .refund();
|
|
|
807
|
- */
|
|
|
808
|
RefundMoneyResultModel refundMoneyResultModel = operateMoneyWhenCheckFail(buyerOrder, orderCode, targetStatus);
|
739
|
RefundMoneyResultModel refundMoneyResultModel = operateMoneyWhenCheckFail(buyerOrder, orderCode, targetStatus);
|
809
|
boolean refundGoodsMoneyFlag = refundMoneyResultModel.isRefundGoodsMoneyFlag();
|
740
|
boolean refundGoodsMoneyFlag = refundMoneyResultModel.isRefundGoodsMoneyFlag();
|
810
|
SellerOrderGoods sellerOrderGoods = refundMoneyResultModel.getSellerOrderGoods();
|
741
|
SellerOrderGoods sellerOrderGoods = refundMoneyResultModel.getSellerOrderGoods();
|
|
@@ -838,6 +769,10 @@ public class AppraiseService { |
|
@@ -838,6 +769,10 @@ public class AppraiseService { |
838
|
EnumExpressDataOperateTransferCode operateTransferCode = EnumExpressDataOperateTransferCode.judge_reject;
|
769
|
EnumExpressDataOperateTransferCode operateTransferCode = EnumExpressDataOperateTransferCode.judge_reject;
|
839
|
expressInfoService.saveOperateTransferExpressInfo(sellerUid, orderCode, expressType.getCode(), expressDataType, operateTransferCode);
|
770
|
expressInfoService.saveOperateTransferExpressInfo(sellerUid, orderCode, expressType.getCode(), expressDataType, operateTransferCode);
|
840
|
|
771
|
|
|
|
772
|
+ //更新平台物流状态为已发货
|
|
|
773
|
+ buyerOrderMapper.updatePlatformDeliveryStatusByOrderCode(orderCode, buyerOrder.getUid(),
|
|
|
774
|
+ EnumPlatformDeliveryStatus.delivery_to_seller.getCode(), DateUtil.getCurrentTimeSecond());
|
|
|
775
|
+
|
841
|
//发货物流(平台已发货)
|
776
|
//发货物流(平台已发货)
|
842
|
expressInfoService.returnBackOrderCauseOfJudgeFailure(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum, mobile);
|
777
|
expressInfoService.returnBackOrderCauseOfJudgeFailure(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum, mobile);
|
843
|
|
778
|
|
|
@@ -1331,59 +1266,21 @@ public class AppraiseService { |
|
@@ -1331,59 +1266,21 @@ public class AppraiseService { |
1331
|
* 退款给卖家(仅退一次)
|
1266
|
* 退款给卖家(仅退一次)
|
1332
|
*
|
1267
|
*
|
1333
|
*/
|
1268
|
*/
|
1334
|
- /*
|
|
|
1335
|
- SellerOrder tso = new SellerOrder();
|
|
|
1336
|
- tso.setUid(sellerUid);
|
|
|
1337
|
- tso.setOrderCode(sellerOrderCode);
|
|
|
1338
|
- tso.setStatus(targetSoStatus.getCode());
|
|
|
1339
|
- tso.setUpdateTime(DateUtil.getCurrentTimeSecond());
|
|
|
1340
|
- tso.setExceptStatus(expectSOStatus.getCode());
|
|
|
1341
|
- int soCnt = sellerOrderMapper.updateByOrderCode(tso);
|
|
|
1342
|
- */
|
|
|
1343
|
//更新卖家订单状态
|
1269
|
//更新卖家订单状态
|
1344
|
SellerOrderGoods sellerOrderGoods = updateSellerOrderStatusAndCleanCache(sellerUid, sellerOrderCode, expectSOStatus, targetSoStatus,
|
1270
|
SellerOrderGoods sellerOrderGoods = updateSellerOrderStatusAndCleanCache(sellerUid, sellerOrderCode, expectSOStatus, targetSoStatus,
|
1345
|
skup, orderCode, buyerUid);
|
1271
|
skup, orderCode, buyerUid);
|
1346
|
|
1272
|
|
1347
|
//退款给卖家(仅退一次)
|
1273
|
//退款给卖家(仅退一次)
|
1348
|
PaymentRequest refundReqOfSeller = operateMoneyWhenOk(buyerUid, orderCode, skup, sellerOrder, targetSoStatus);
|
1274
|
PaymentRequest refundReqOfSeller = operateMoneyWhenOk(buyerUid, orderCode, skup, sellerOrder, targetSoStatus);
|
1349
|
-
|
|
|
1350
|
-
|
|
|
1351
|
- /*
|
|
|
1352
|
- BigDecimal saleIncome = getSaleIncome(sellerUid, skup);
|
|
|
1353
|
-
|
|
|
1354
|
- TransferCase transferCase = TransferCase.ALL_GOODS_MONEY_TO_SELLER;
|
|
|
1355
|
- TranseferCellNode transeferCellNode = new TranseferCellNode();
|
|
|
1356
|
- transeferCellNode.setUid(sellerUid);
|
|
|
1357
|
- transeferCellNode.setAmount(saleIncome);
|
|
|
1358
|
- TransferMoneyRequest tmReq = TransferMoneyRequest.builder()
|
|
|
1359
|
- .buyerOrderCode(orderCode)
|
|
|
1360
|
- .type(transferCase.getCode())
|
|
|
1361
|
- .transferCase(transferCase)
|
|
|
1362
|
- .transeferCellNode(transeferCellNode)
|
|
|
1363
|
- .alarmConfig(AlarmConfig.APPRAISE_SUCCESS)
|
|
|
1364
|
- .build();
|
|
|
1365
|
-
|
|
|
1366
|
- //先校验,提前把错误抛出
|
|
|
1367
|
- paymentService.transferMonCheck(tmReq);
|
|
|
1368
|
-
|
|
|
1369
|
- //改成异步的分账,不关心分账执行结果
|
|
|
1370
|
- executorService.execute(()->{
|
|
|
1371
|
- LOGGER.info("in appraiseSuccess,begin transfer async");
|
|
|
1372
|
- transferService.transfer(tmReq);
|
|
|
1373
|
- });
|
|
|
1374
|
-
|
|
|
1375
|
- //退保证金给卖家
|
|
|
1376
|
- //refund earnestMoney
|
|
|
1377
|
- BigDecimal earnestMoney = sellerOrder.getEarnestMoney();
|
|
|
1378
|
- PaymentRequest refundReqOfSeller = refundEarnestMoney(SellerWalletDetail.Type.APPRAISE_OK,orderCode,sellerUid ,sellerOrder,skup,buyerUid,targetSoStatus,earnestMoney.doubleValue());
|
|
|
1379
|
- LOGGER.info("in appraiseSuccess,refund ok, refundReqOfSeller {}", refundReqOfSeller);
|
|
|
1380
|
-
|
|
|
1381
|
- SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(skup);
|
|
|
1382
|
- */
|
|
|
1383
|
try {
|
1275
|
try {
|
1384
|
//鉴定通过后自动发货,这个时候产生:买家确认收货的mq
|
1276
|
//鉴定通过后自动发货,这个时候产生:买家确认收货的mq
|
1385
|
BuyerConfirmEvent buyerConfirmEvent = BuyerConfirmEvent.builder().uid(buyerUid).orderCode(orderCode).build();
|
1277
|
BuyerConfirmEvent buyerConfirmEvent = BuyerConfirmEvent.builder().uid(buyerUid).orderCode(orderCode).build();
|
1386
|
EventBusPublisher.publishEvent(buyerConfirmEvent);
|
1278
|
EventBusPublisher.publishEvent(buyerConfirmEvent);
|
|
|
1279
|
+
|
|
|
1280
|
+ //更新平台物流状态为已发货
|
|
|
1281
|
+ buyerOrderMapper.updatePlatformDeliveryStatusByOrderCode(orderCode, buyerOrder.getUid(),
|
|
|
1282
|
+ EnumPlatformDeliveryStatus.delivery_to_buyer.getCode(), DateUtil.getCurrentTimeSecond());
|
|
|
1283
|
+
|
1387
|
//记录物流信息
|
1284
|
//记录物流信息
|
1388
|
//发物流
|
1285
|
//发物流
|
1389
|
expressInfoService.deliverGoods(buyerUid, expressCompanyId, orderCode, wayBillCode, depotNum, mobile);
|
1286
|
expressInfoService.deliverGoods(buyerUid, expressCompanyId, orderCode, wayBillCode, depotNum, mobile);
|
|
@@ -1409,18 +1306,6 @@ public class AppraiseService { |
|
@@ -1409,18 +1306,6 @@ public class AppraiseService { |
1409
|
expressInfoService.saveOperateTransferExpressInfo(sellerUid, orderCode, expressType.getCode(), expressDataType, operateTransferCode);
|
1306
|
expressInfoService.saveOperateTransferExpressInfo(sellerUid, orderCode, expressType.getCode(), expressDataType, operateTransferCode);
|
1410
|
}
|
1307
|
}
|
1411
|
|
1308
|
|
1412
|
- /*
|
|
|
1413
|
- cacheCleaner.delete(Arrays.asList(CacheKeyBuilder.orderListKey(sellerUid, TabType.SELL.getValue()),
|
|
|
1414
|
- CacheKeyBuilder.orderListKey(buyerUid, TabType.BUY.getValue()),
|
|
|
1415
|
- CacheKeyBuilder.sellerOrderDetailKey(sellerOrderGoods),
|
|
|
1416
|
- CacheKeyBuilder.orderDetailKey(sellerUid, TabType.SELL.getValue(), orderCode),
|
|
|
1417
|
- CacheKeyBuilder.orderDetailKey(buyerUid,TabType.BUY.getValue(), orderCode),
|
|
|
1418
|
- CacheKeyBuilder.buyerOrderNums(buyerUid)));
|
|
|
1419
|
-
|
|
|
1420
|
- ErpBuyerOrderEvent event = new ErpBuyerOrderEvent(buyerUid);
|
|
|
1421
|
- EventBusPublisher.publishEvent(event);
|
|
|
1422
|
- */
|
|
|
1423
|
-
|
|
|
1424
|
LOGGER.info("in appraiseSuccess, refund earnestMoney finish, seller {}, order code {}, skup {}, earnestMoney {}",
|
1309
|
LOGGER.info("in appraiseSuccess, refund earnestMoney finish, seller {}, order code {}, skup {}, earnestMoney {}",
|
1425
|
sellerUid, sellerOrderCode, skup, sellerOrder.getEarnestMoney());
|
1310
|
sellerUid, sellerOrderCode, skup, sellerOrder.getEarnestMoney());
|
1426
|
|
1311
|
|