|
@@ -164,8 +164,12 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
|
@@ -164,8 +164,12 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
164
|
.orderAttributes(getOrderAttributes())
|
164
|
.orderAttributes(getOrderAttributes())
|
165
|
.build();
|
165
|
.build();
|
166
|
appraiseOrderCreateService.createSellerDepoistOrder(context);
|
166
|
appraiseOrderCreateService.createSellerDepoistOrder(context);
|
167
|
- //TODO notice
|
|
|
168
|
-
|
167
|
+ //
|
|
|
168
|
+ SellerDepositOrderCancelAsyncEvent event = new SellerDepositOrderCancelAsyncEvent(this::handleOrderCancelAsyncEvent);
|
|
|
169
|
+ event.setUid(req.getUid());
|
|
|
170
|
+ event.setOrderCode(orderCode);
|
|
|
171
|
+ EventBusPublisher.publishEvent(event);
|
|
|
172
|
+ logger.info("submit seller deposit order , SellerDepositOrderCancelAsyncEvent send out, event {}", event);
|
169
|
return SellerDepositOrderSubmitResp.builder().orderCode(orderCode).build();
|
173
|
return SellerDepositOrderSubmitResp.builder().orderCode(orderCode).build();
|
170
|
}
|
174
|
}
|
171
|
|
175
|
|
|
@@ -208,12 +212,12 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
|
@@ -208,12 +212,12 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
208
|
case WAITING_PAY:
|
212
|
case WAITING_PAY:
|
209
|
targetOrderStatus = AppraiseOrderStatus.CANCEL_BEFORE_PAY;
|
213
|
targetOrderStatus = AppraiseOrderStatus.CANCEL_BEFORE_PAY;
|
210
|
super.triggerStatusChange(orderCode, targetOrderStatus, appraiseOrderStatus);
|
214
|
super.triggerStatusChange(orderCode, targetOrderStatus, appraiseOrderStatus);
|
211
|
- inBoxFacade.sellerDepositOrderNotice(pao.getUid(), orderCode, targetOrderStatus);
|
215
|
+ inBoxFacade.sellerDepositOrderNotice(pao.getUid(), orderCode, targetOrderStatus, true);
|
212
|
break;
|
216
|
break;
|
213
|
case HAS_PAYED:
|
217
|
case HAS_PAYED:
|
214
|
targetOrderStatus = AppraiseOrderStatus.CANCEL_BEFORE_DELIVER;
|
218
|
targetOrderStatus = AppraiseOrderStatus.CANCEL_BEFORE_DELIVER;
|
215
|
super.triggerStatusChange(orderCode, targetOrderStatus , appraiseOrderStatus);
|
219
|
super.triggerStatusChange(orderCode, targetOrderStatus , appraiseOrderStatus);
|
216
|
- inBoxFacade.sellerDepositOrderNotice(pao.getUid(), orderCode, targetOrderStatus);
|
220
|
+ inBoxFacade.sellerDepositOrderNotice(pao.getUid(), orderCode, targetOrderStatus, true);
|
217
|
//refund amount
|
221
|
//refund amount
|
218
|
new GoodsServiceRefundHandler()
|
222
|
new GoodsServiceRefundHandler()
|
219
|
.loadLogger(logger)
|
223
|
.loadLogger(logger)
|
|
@@ -231,6 +235,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
|
@@ -231,6 +235,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
231
|
}
|
235
|
}
|
232
|
|
236
|
|
233
|
public int cancelByTimeout(OrderCancelEvent orderCancelEvent){
|
237
|
public int cancelByTimeout(OrderCancelEvent orderCancelEvent){
|
|
|
238
|
+ logger.info("in seller deposit order cancelByTimeout orderCancelEvent {}", orderCancelEvent);
|
234
|
Long orderCode = orderCancelEvent.getOrderCode();
|
239
|
Long orderCode = orderCancelEvent.getOrderCode();
|
235
|
int uid = orderCancelEvent.getUid();
|
240
|
int uid = orderCancelEvent.getUid();
|
236
|
if(!serviceOrderProcessor.isGoodsServiceOrder(orderCode)){
|
241
|
if(!serviceOrderProcessor.isGoodsServiceOrder(orderCode)){
|
|
@@ -287,7 +292,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
|
@@ -287,7 +292,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
287
|
Long orderCode = req.getOrderCode();
|
292
|
Long orderCode = req.getOrderCode();
|
288
|
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.SELLER_SEND_OUT;
|
293
|
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.SELLER_SEND_OUT;
|
289
|
//
|
294
|
//
|
290
|
- inBoxFacade.sellerDepositOrderNotice(req.getUid(), orderCode, targetOrderStatus);
|
295
|
+ inBoxFacade.sellerDepositOrderNotice(req.getUid(), orderCode, targetOrderStatus, true);
|
291
|
//split sku 2 order
|
296
|
//split sku 2 order
|
292
|
List<AppraiseOrderGoods> paogList = appraiseOrderGoodsMapper.selectByOrderCode(orderCode);
|
297
|
List<AppraiseOrderGoods> paogList = appraiseOrderGoodsMapper.selectByOrderCode(orderCode);
|
293
|
SellerDepositOrderListService.OrderDataNode node = sellerDepositOrderListService.buildDataSourceOfParentOrder(orderCode, paogList);
|
298
|
SellerDepositOrderListService.OrderDataNode node = sellerDepositOrderListService.buildDataSourceOfParentOrder(orderCode, paogList);
|
|
@@ -339,7 +344,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
|
@@ -339,7 +344,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
339
|
triggerStatusConsistencyCheck(orderCode);
|
344
|
triggerStatusConsistencyCheck(orderCode);
|
340
|
|
345
|
|
341
|
Long paidCode = pao.getParentOrderCode();
|
346
|
Long paidCode = pao.getParentOrderCode();
|
342
|
- inBoxFacade.sellerDepositOrderNotice(pao.getUid(), orderCode, targetStatus);
|
347
|
+ inBoxFacade.sellerDepositOrderNotice(pao.getUid(), orderCode, targetStatus, false);
|
343
|
BigDecimal left = calLeftMoney(pao.getAmount(), orderCode);
|
348
|
BigDecimal left = calLeftMoney(pao.getAmount(), orderCode);
|
344
|
if (left.compareTo(BigDecimal.ZERO)>0){
|
349
|
if (left.compareTo(BigDecimal.ZERO)>0){
|
345
|
|
350
|
|
|
@@ -405,7 +410,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
|
@@ -405,7 +410,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
405
|
triggerStatusConsistencyCheck(orderCode);
|
410
|
triggerStatusConsistencyCheck(orderCode);
|
406
|
//
|
411
|
//
|
407
|
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.CHECKING_FAKE;
|
412
|
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.CHECKING_FAKE;
|
408
|
- inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetOrderStatus);
|
413
|
+ inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), orderCode, targetOrderStatus, false);
|
409
|
depositService.insertFakeDeposit(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), appraiseOrder.getParentOrderCode());
|
414
|
depositService.insertFakeDeposit(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), appraiseOrder.getParentOrderCode());
|
410
|
return rows;
|
415
|
return rows;
|
411
|
}
|
416
|
}
|
|
@@ -433,7 +438,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
|
@@ -433,7 +438,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
433
|
.refund();
|
438
|
.refund();
|
434
|
|
439
|
|
435
|
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE;
|
440
|
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE;
|
436
|
- inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetOrderStatus);
|
441
|
+ inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetOrderStatus, false);
|
437
|
depositService.insertFakeDeposit(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), appraiseOrder.getParentOrderCode());
|
442
|
depositService.insertFakeDeposit(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), appraiseOrder.getParentOrderCode());
|
438
|
return rows;
|
443
|
return rows;
|
439
|
}
|
444
|
}
|
|
@@ -451,10 +456,18 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
|
@@ -451,10 +456,18 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
451
|
}
|
456
|
}
|
452
|
//
|
457
|
//
|
453
|
Long orderCode = appraiseOrder.getOrderCode();
|
458
|
Long orderCode = appraiseOrder.getOrderCode();
|
454
|
- triggerStatusConsistencyCheck(orderCode);
|
|
|
455
|
- //
|
459
|
+ Long parentOrderCode;
|
|
|
460
|
+ boolean isParent = Objects.isNull(parentOrderCode=appraiseOrder.getParentOrderCode());
|
456
|
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.SHAM_SEND_OUT;
|
461
|
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.SHAM_SEND_OUT;
|
457
|
- inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetOrderStatus);
|
462
|
+ AppraiseOrderStatus expectedStatus = AppraiseOrderStatus.SELLER_SEND_OUT;
|
|
|
463
|
+ if(isParent){
|
|
|
464
|
+ triggerStatusChangeByParentCode(parentOrderCode, targetOrderStatus, expectedStatus);
|
|
|
465
|
+ }else {
|
|
|
466
|
+ //no parent
|
|
|
467
|
+ triggerStatusConsistencyCheck(orderCode);
|
|
|
468
|
+ }
|
|
|
469
|
+ //notice
|
|
|
470
|
+ inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), orderCode, targetOrderStatus, isParent);
|
458
|
//refund amount
|
471
|
//refund amount
|
459
|
new GoodsServiceRefundHandler()
|
472
|
new GoodsServiceRefundHandler()
|
460
|
.loadLogger(logger)
|
473
|
.loadLogger(logger)
|
|
@@ -576,7 +589,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
|
@@ -576,7 +589,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
576
|
Long orderCode = appraiseOrder.getOrderCode();
|
589
|
Long orderCode = appraiseOrder.getOrderCode();
|
577
|
triggerStatusConsistencyCheck(orderCode);
|
590
|
triggerStatusConsistencyCheck(orderCode);
|
578
|
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.QUALITY_CHECK_FAKE;
|
591
|
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.QUALITY_CHECK_FAKE;
|
579
|
- inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), orderCode, targetOrderStatus);
|
592
|
+ inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), orderCode, targetOrderStatus, false);
|
580
|
new GoodsServiceRefundHandler()
|
593
|
new GoodsServiceRefundHandler()
|
581
|
.loadLogger(logger)
|
594
|
.loadLogger(logger)
|
582
|
.loadUser(appraiseOrder.getUid())
|
595
|
.loadUser(appraiseOrder.getUid())
|
|
@@ -606,12 +619,9 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
|
@@ -606,12 +619,9 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
606
|
Long orderCode = orderInfo.getOrderCode();
|
619
|
Long orderCode = orderInfo.getOrderCode();
|
607
|
Integer uid = orderInfo.getUid();
|
620
|
Integer uid = orderInfo.getUid();
|
608
|
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.HAS_PAYED;
|
621
|
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.HAS_PAYED;
|
609
|
- inBoxFacade.sellerDepositOrderNotice(orderInfo.getUid(), orderInfo.getOrderCode(), targetOrderStatus);
|
|
|
610
|
- SellerDepositOrderCancelAsyncEvent event = new SellerDepositOrderCancelAsyncEvent(this::handleOrderCancelAsyncEvent);
|
|
|
611
|
- event.setUid(uid);
|
|
|
612
|
- event.setOrderCode(orderCode);
|
|
|
613
|
- EventBusPublisher.publishEvent(event);
|
|
|
614
|
- logger.info("processAfterPay seller deposit order , SellerDepositOrderCancelAsyncEvent send out, event {}", event);
|
622
|
+ inBoxFacade.sellerDepositOrderNotice(uid, orderInfo.getOrderCode(), targetOrderStatus, true);
|
|
|
623
|
+
|
|
|
624
|
+
|
615
|
SellerCancelDeliverEvent cancelDeliverEvent =
|
625
|
SellerCancelDeliverEvent cancelDeliverEvent =
|
616
|
SellerCancelDeliverEvent.builder()
|
626
|
SellerCancelDeliverEvent.builder()
|
617
|
.uid(orderInfo.getUid())
|
627
|
.uid(orderInfo.getUid())
|
|
@@ -722,7 +732,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
|
@@ -722,7 +732,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
722
|
|
732
|
|
723
|
if(rows>0){
|
733
|
if(rows>0){
|
724
|
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.PLATFORM_RECEIVE;
|
734
|
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.PLATFORM_RECEIVE;
|
725
|
- inBoxFacade.sellerDepositOrderNotice(uid, parentCode, targetOrderStatus);
|
735
|
+ inBoxFacade.sellerDepositOrderNotice(uid, parentCode, targetOrderStatus, true);
|
726
|
|
736
|
|
727
|
}
|
737
|
}
|
728
|
return rows;
|
738
|
return rows;
|
|
@@ -750,7 +760,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
|
@@ -750,7 +760,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
750
|
orderCode, parentOrderCode, prows);
|
760
|
orderCode, parentOrderCode, prows);
|
751
|
if (prows>0){
|
761
|
if (prows>0){
|
752
|
AppraiseOrderStatus targetStatus = AppraiseOrderStatus.FINISH;
|
762
|
AppraiseOrderStatus targetStatus = AppraiseOrderStatus.FINISH;
|
753
|
- inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), parentOrderCode, targetStatus);
|
763
|
+ inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), parentOrderCode, targetStatus, true);
|
754
|
}
|
764
|
}
|
755
|
return prows;
|
765
|
return prows;
|
756
|
}
|
766
|
}
|
|
@@ -800,7 +810,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
|
@@ -800,7 +810,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
800
|
.loadOrder(orderCode, orderCode, pao.getPayment(), pao.getAmount())
|
810
|
.loadOrder(orderCode, orderCode, pao.getPayment(), pao.getAmount())
|
801
|
.refund();
|
811
|
.refund();
|
802
|
//notice
|
812
|
//notice
|
803
|
- inBoxFacade.sellerDepositOrderNotice(uid, orderCode, targetOrderStatus);
|
813
|
+ inBoxFacade.sellerDepositOrderNotice(uid, orderCode, targetOrderStatus, true);
|
804
|
}
|
814
|
}
|
805
|
|
815
|
|
806
|
|
816
|
|