|
@@ -5,7 +5,6 @@ import com.yoho.error.exception.ServiceException; |
|
@@ -5,7 +5,6 @@ import com.yoho.error.exception.ServiceException; |
5
|
import com.yohobuy.ufo.model.order.bo.MerchantOrderAttachInfo;
|
5
|
import com.yohobuy.ufo.model.order.bo.MerchantOrderAttachInfo;
|
6
|
import com.yohobuy.ufo.model.order.common.*;
|
6
|
import com.yohobuy.ufo.model.order.common.*;
|
7
|
import com.yohoufo.common.alarm.EventBusPublisher;
|
7
|
import com.yohoufo.common.alarm.EventBusPublisher;
|
8
|
-import com.yohoufo.common.alarm.SmsAlarmEvent;
|
|
|
9
|
import com.yohoufo.common.alarm.UfoInfluxdbEvent;
|
8
|
import com.yohoufo.common.alarm.UfoInfluxdbEvent;
|
10
|
import com.yohoufo.common.alarm.UfoInfluxdbVo;
|
9
|
import com.yohoufo.common.alarm.UfoInfluxdbVo;
|
11
|
import com.yohoufo.common.constant.InfluxdbFieldEnum;
|
10
|
import com.yohoufo.common.constant.InfluxdbFieldEnum;
|
|
@@ -14,11 +13,13 @@ import com.yohoufo.common.exception.UfoServiceException; |
|
@@ -14,11 +13,13 @@ import com.yohoufo.common.exception.UfoServiceException; |
14
|
import com.yohoufo.common.utils.DateUtil;
|
13
|
import com.yohoufo.common.utils.DateUtil;
|
15
|
import com.yohoufo.dal.order.*;
|
14
|
import com.yohoufo.dal.order.*;
|
16
|
import com.yohoufo.dal.order.model.*;
|
15
|
import com.yohoufo.dal.order.model.*;
|
17
|
-import com.yohoufo.order.common.*;
|
16
|
+import com.yohoufo.order.common.ActionStatusHold;
|
|
|
17
|
+import com.yohoufo.order.common.Payment;
|
|
|
18
|
+import com.yohoufo.order.common.RefundCase;
|
|
|
19
|
+import com.yohoufo.order.common.TransferCase;
|
18
|
import com.yohoufo.order.constants.AlarmConfig;
|
20
|
import com.yohoufo.order.constants.AlarmConfig;
|
19
|
import com.yohoufo.order.event.*;
|
21
|
import com.yohoufo.order.event.*;
|
20
|
import com.yohoufo.order.model.PayQueryBo;
|
22
|
import com.yohoufo.order.model.PayQueryBo;
|
21
|
-import com.yohoufo.order.model.PayRefundBo;
|
|
|
22
|
import com.yohoufo.order.model.request.OrderRequest;
|
23
|
import com.yohoufo.order.model.request.OrderRequest;
|
23
|
import com.yohoufo.order.model.request.PaymentRequest;
|
24
|
import com.yohoufo.order.model.request.PaymentRequest;
|
24
|
import com.yohoufo.order.model.request.TranseferCellNode;
|
25
|
import com.yohoufo.order.model.request.TranseferCellNode;
|
|
@@ -477,7 +478,6 @@ public class SellerOrderCancelService { |
|
@@ -477,7 +478,6 @@ public class SellerOrderCancelService { |
477
|
.loadRefundAction(payRefundService::refund)
|
478
|
.loadRefundAction(payRefundService::refund)
|
478
|
.loadBillLogEventBuilder(bleb)
|
479
|
.loadBillLogEventBuilder(bleb)
|
479
|
.loadPaymentRequest(refundReq)
|
480
|
.loadPaymentRequest(refundReq)
|
480
|
- .loadBuyer(null, null, null)
|
|
|
481
|
.loadSeller(sellerUid, isSuper, orderCode, targetSOStatus)
|
481
|
.loadSeller(sellerUid, isSuper, orderCode, targetSOStatus)
|
482
|
.loadLogger(logger)
|
482
|
.loadLogger(logger)
|
483
|
.refund();
|
483
|
.refund();
|
|
@@ -715,8 +715,8 @@ public class SellerOrderCancelService { |
|
@@ -715,8 +715,8 @@ public class SellerOrderCancelService { |
715
|
}
|
715
|
}
|
716
|
|
716
|
|
717
|
SkupStatus expectSkupStatus = SkupStatus.CAN_SELL;
|
717
|
SkupStatus expectSkupStatus = SkupStatus.CAN_SELL;
|
718
|
- boolean isPayEarnestMoney = expectSkupStatus.getCode() == skupStatus;
|
|
|
719
|
- if (!isPayEarnestMoney){
|
718
|
+ boolean earnestMoneyPaidFlag = expectSkupStatus.getCode() == skupStatus;
|
|
|
719
|
+ if (!earnestMoneyPaidFlag){
|
720
|
logger.warn("in offShelveCancelCase, SellerOrderGoods status illegal, skup {}, status {}", skup, skupStatus);
|
720
|
logger.warn("in offShelveCancelCase, SellerOrderGoods status illegal, skup {}, status {}", skup, skupStatus);
|
721
|
return;
|
721
|
return;
|
722
|
}
|
722
|
}
|
|
@@ -750,42 +750,41 @@ public class SellerOrderCancelService { |
|
@@ -750,42 +750,41 @@ public class SellerOrderCancelService { |
750
|
double earnestMoney = sellerOrder.getEarnestMoney().doubleValue();
|
750
|
double earnestMoney = sellerOrder.getEarnestMoney().doubleValue();
|
751
|
|
751
|
|
752
|
Integer sop = sellerOrder.getPayment() == null ? 0 : sellerOrder.getPayment();
|
752
|
Integer sop = sellerOrder.getPayment() == null ? 0 : sellerOrder.getPayment();
|
753
|
- PaymentRequest refundReq = PaymentRequest.builder().uid(sellerUid)
|
|
|
754
|
- .orderCode(orderCode)
|
|
|
755
|
- .refundCase(RefundCase.SELLER_EARNEST_MONEY)
|
|
|
756
|
- .payment(sop)
|
|
|
757
|
- .refundAmount(earnestMoney).build();
|
|
|
758
|
- boolean sellerIsSurper = sellerService.isSuperEntrySeller(sellerUid);
|
|
|
759
|
- refundReq.setSuper(sellerIsSurper);
|
|
|
760
|
- //
|
|
|
761
|
- if(!sellerIsSurper && PaymentHelper.isWallet(sop)){
|
|
|
762
|
- MerchantOrderAttachInfo moai = MerchantOrderAttachInfo.builder().uid(sellerUid)
|
753
|
+
|
|
|
754
|
+ boolean sellerIsSuper = sellerService.isSuperEntrySeller(sellerUid);
|
|
|
755
|
+
|
|
|
756
|
+ //不是超级卖家 ,上架商品用钱包支付保证金
|
|
|
757
|
+ MerchantOrderAttachInfo moai = null;
|
|
|
758
|
+ if(!sellerIsSuper && PaymentHelper.isWallet(sop)){
|
|
|
759
|
+ moai = MerchantOrderAttachInfo.builder().uid(sellerUid)
|
763
|
.orderCode(orderCode).skup(skup).earnestMoney(sellerOrder.getEarnestMoney())
|
760
|
.orderCode(orderCode).skup(skup).earnestMoney(sellerOrder.getEarnestMoney())
|
764
|
.type(SellerWalletDetail.Type.SYSTEM_OFF.getValue()).build();
|
761
|
.type(SellerWalletDetail.Type.SYSTEM_OFF.getValue()).build();
|
765
|
- refundReq.setRefundattch(moai);
|
|
|
766
|
}
|
762
|
}
|
767
|
|
763
|
|
768
|
BillLogEvent.BillLogEventBuilder bleb = BillLogEvent.builder()
|
764
|
BillLogEvent.BillLogEventBuilder bleb = BillLogEvent.builder()
|
769
|
.sellerUid(sellerUid).orderCode(orderCode)
|
765
|
.sellerUid(sellerUid).orderCode(orderCode)
|
770
|
- .payType(sellerOrder.getPayment()).refundCase(RefundCase.SELLER_EARNEST_MONEY)
|
766
|
+ .payType(sellerOrder.getPayment())
|
|
|
767
|
+ .refundCase(RefundCase.SELLER_EARNEST_MONEY)
|
771
|
.skup(skup);
|
768
|
.skup(skup);
|
|
|
769
|
+ PaymentRequest refundReq = PaymentRequest.builder().uid(sellerUid)
|
|
|
770
|
+ .orderCode(orderCode)
|
|
|
771
|
+ .refundCase(RefundCase.SELLER_EARNEST_MONEY)
|
|
|
772
|
+ .payment(sop)
|
|
|
773
|
+ .refundAmount(earnestMoney)
|
|
|
774
|
+ .isSuper(sellerIsSuper)
|
|
|
775
|
+ .refundattch(moai)
|
|
|
776
|
+ .build();
|
772
|
|
777
|
|
773
|
- try {
|
|
|
774
|
- PayRefundBo payRefundBo = payRefundService.refund(refundReq, bleb);
|
|
|
775
|
- logger.info("in yoho Off Shelve Cancel , refund earnestMoney finish, seller {}, order code {}, skup {}, earnestMoney {}",
|
|
|
776
|
- sellerUid, orderCode, skup, earnestMoney);
|
778
|
+ boolean refundEarnMoneyFlag = new RefundEarnestMoneyHandler()
|
|
|
779
|
+ .loadRefundAction(payRefundService::refund)
|
|
|
780
|
+ .loadBillLogEventBuilder(bleb)
|
|
|
781
|
+ .loadPaymentRequest(refundReq)
|
|
|
782
|
+ .loadSeller(sellerUid, sellerIsSuper, orderCode, targetSellerOrderStatus)
|
|
|
783
|
+ .loadLogger(logger)
|
|
|
784
|
+ .refund();
|
|
|
785
|
+
|
|
|
786
|
+ if (refundEarnMoneyFlag){
|
777
|
inBoxFacade.notifyUnshelfCauseBySpecialReason(sellerUid, psog);
|
787
|
inBoxFacade.notifyUnshelfCauseBySpecialReason(sellerUid, psog);
|
778
|
- }catch (Exception ex){
|
|
|
779
|
- logger.warn("in yoho Off Shelve Cancel, refund earnestMoney fail, seller {}, order code {}, skup {}, earnestMoney {}",
|
|
|
780
|
- sellerUid, orderCode, skup, earnestMoney, ex);
|
|
|
781
|
- if(!sellerIsSurper) {
|
|
|
782
|
- BillLogEvent sellerBillLogEvent = bleb.tradeStatus(BillTradeStatus.FAIL.getCode())
|
|
|
783
|
- .build();
|
|
|
784
|
- EventBusPublisher.publishEvent(sellerBillLogEvent);
|
|
|
785
|
- }
|
|
|
786
|
- String content = "下架skup时,退用户" + sellerUid + "保证金订单"+ orderCode +"失败";
|
|
|
787
|
- SmsAlarmEvent smsAlarmEvent = new SmsAlarmEvent("PaidSellerOrder.PlatformCancel", "cancelBeforeBuy", content);
|
|
|
788
|
- EventBusPublisher.publishEvent(smsAlarmEvent);
|
|
|
789
|
}
|
788
|
}
|
790
|
}
|
789
|
}
|
791
|
|
790
|
|