...
|
...
|
@@ -5,7 +5,6 @@ import com.yoho.error.exception.ServiceException; |
|
|
import com.yohobuy.ufo.model.order.bo.MerchantOrderAttachInfo;
|
|
|
import com.yohobuy.ufo.model.order.common.*;
|
|
|
import com.yohoufo.common.alarm.EventBusPublisher;
|
|
|
import com.yohoufo.common.alarm.SmsAlarmEvent;
|
|
|
import com.yohoufo.common.alarm.UfoInfluxdbEvent;
|
|
|
import com.yohoufo.common.alarm.UfoInfluxdbVo;
|
|
|
import com.yohoufo.common.constant.InfluxdbFieldEnum;
|
...
|
...
|
@@ -14,11 +13,13 @@ import com.yohoufo.common.exception.UfoServiceException; |
|
|
import com.yohoufo.common.utils.DateUtil;
|
|
|
import com.yohoufo.dal.order.*;
|
|
|
import com.yohoufo.dal.order.model.*;
|
|
|
import com.yohoufo.order.common.*;
|
|
|
import com.yohoufo.order.common.ActionStatusHold;
|
|
|
import com.yohoufo.order.common.Payment;
|
|
|
import com.yohoufo.order.common.RefundCase;
|
|
|
import com.yohoufo.order.common.TransferCase;
|
|
|
import com.yohoufo.order.constants.AlarmConfig;
|
|
|
import com.yohoufo.order.event.*;
|
|
|
import com.yohoufo.order.model.PayQueryBo;
|
|
|
import com.yohoufo.order.model.PayRefundBo;
|
|
|
import com.yohoufo.order.model.request.OrderRequest;
|
|
|
import com.yohoufo.order.model.request.PaymentRequest;
|
|
|
import com.yohoufo.order.model.request.TranseferCellNode;
|
...
|
...
|
@@ -477,7 +478,6 @@ public class SellerOrderCancelService { |
|
|
.loadRefundAction(payRefundService::refund)
|
|
|
.loadBillLogEventBuilder(bleb)
|
|
|
.loadPaymentRequest(refundReq)
|
|
|
.loadBuyer(null, null, null)
|
|
|
.loadSeller(sellerUid, isSuper, orderCode, targetSOStatus)
|
|
|
.loadLogger(logger)
|
|
|
.refund();
|
...
|
...
|
@@ -715,8 +715,8 @@ public class SellerOrderCancelService { |
|
|
}
|
|
|
|
|
|
SkupStatus expectSkupStatus = SkupStatus.CAN_SELL;
|
|
|
boolean isPayEarnestMoney = expectSkupStatus.getCode() == skupStatus;
|
|
|
if (!isPayEarnestMoney){
|
|
|
boolean earnestMoneyPaidFlag = expectSkupStatus.getCode() == skupStatus;
|
|
|
if (!earnestMoneyPaidFlag){
|
|
|
logger.warn("in offShelveCancelCase, SellerOrderGoods status illegal, skup {}, status {}", skup, skupStatus);
|
|
|
return;
|
|
|
}
|
...
|
...
|
@@ -750,42 +750,41 @@ public class SellerOrderCancelService { |
|
|
double earnestMoney = sellerOrder.getEarnestMoney().doubleValue();
|
|
|
|
|
|
Integer sop = sellerOrder.getPayment() == null ? 0 : sellerOrder.getPayment();
|
|
|
PaymentRequest refundReq = PaymentRequest.builder().uid(sellerUid)
|
|
|
.orderCode(orderCode)
|
|
|
.refundCase(RefundCase.SELLER_EARNEST_MONEY)
|
|
|
.payment(sop)
|
|
|
.refundAmount(earnestMoney).build();
|
|
|
boolean sellerIsSurper = sellerService.isSuperEntrySeller(sellerUid);
|
|
|
refundReq.setSuper(sellerIsSurper);
|
|
|
//
|
|
|
if(!sellerIsSurper && PaymentHelper.isWallet(sop)){
|
|
|
MerchantOrderAttachInfo moai = MerchantOrderAttachInfo.builder().uid(sellerUid)
|
|
|
|
|
|
boolean sellerIsSuper = sellerService.isSuperEntrySeller(sellerUid);
|
|
|
|
|
|
//不是超级卖家 ,上架商品用钱包支付保证金
|
|
|
MerchantOrderAttachInfo moai = null;
|
|
|
if(!sellerIsSuper && PaymentHelper.isWallet(sop)){
|
|
|
moai = MerchantOrderAttachInfo.builder().uid(sellerUid)
|
|
|
.orderCode(orderCode).skup(skup).earnestMoney(sellerOrder.getEarnestMoney())
|
|
|
.type(SellerWalletDetail.Type.SYSTEM_OFF.getValue()).build();
|
|
|
refundReq.setRefundattch(moai);
|
|
|
}
|
|
|
|
|
|
BillLogEvent.BillLogEventBuilder bleb = BillLogEvent.builder()
|
|
|
.sellerUid(sellerUid).orderCode(orderCode)
|
|
|
.payType(sellerOrder.getPayment()).refundCase(RefundCase.SELLER_EARNEST_MONEY)
|
|
|
.payType(sellerOrder.getPayment())
|
|
|
.refundCase(RefundCase.SELLER_EARNEST_MONEY)
|
|
|
.skup(skup);
|
|
|
PaymentRequest refundReq = PaymentRequest.builder().uid(sellerUid)
|
|
|
.orderCode(orderCode)
|
|
|
.refundCase(RefundCase.SELLER_EARNEST_MONEY)
|
|
|
.payment(sop)
|
|
|
.refundAmount(earnestMoney)
|
|
|
.isSuper(sellerIsSuper)
|
|
|
.refundattch(moai)
|
|
|
.build();
|
|
|
|
|
|
try {
|
|
|
PayRefundBo payRefundBo = payRefundService.refund(refundReq, bleb);
|
|
|
logger.info("in yoho Off Shelve Cancel , refund earnestMoney finish, seller {}, order code {}, skup {}, earnestMoney {}",
|
|
|
sellerUid, orderCode, skup, earnestMoney);
|
|
|
boolean refundEarnMoneyFlag = new RefundEarnestMoneyHandler()
|
|
|
.loadRefundAction(payRefundService::refund)
|
|
|
.loadBillLogEventBuilder(bleb)
|
|
|
.loadPaymentRequest(refundReq)
|
|
|
.loadSeller(sellerUid, sellerIsSuper, orderCode, targetSellerOrderStatus)
|
|
|
.loadLogger(logger)
|
|
|
.refund();
|
|
|
|
|
|
if (refundEarnMoneyFlag){
|
|
|
inBoxFacade.notifyUnshelfCauseBySpecialReason(sellerUid, psog);
|
|
|
}catch (Exception ex){
|
|
|
logger.warn("in yoho Off Shelve Cancel, refund earnestMoney fail, seller {}, order code {}, skup {}, earnestMoney {}",
|
|
|
sellerUid, orderCode, skup, earnestMoney, ex);
|
|
|
if(!sellerIsSurper) {
|
|
|
BillLogEvent sellerBillLogEvent = bleb.tradeStatus(BillTradeStatus.FAIL.getCode())
|
|
|
.build();
|
|
|
EventBusPublisher.publishEvent(sellerBillLogEvent);
|
|
|
}
|
|
|
String content = "下架skup时,退用户" + sellerUid + "保证金订单"+ orderCode +"失败";
|
|
|
SmsAlarmEvent smsAlarmEvent = new SmsAlarmEvent("PaidSellerOrder.PlatformCancel", "cancelBeforeBuy", content);
|
|
|
EventBusPublisher.publishEvent(smsAlarmEvent);
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|