Authored by LUOXC

fix bug 退保证金

@@ -99,6 +99,7 @@ public class ActionStatusHold { @@ -99,6 +99,7 @@ public class ActionStatusHold {
99 CanRefundStatus = Arrays.asList(SellerOrderStatus.YOHO_CANCEL_SELL.getCode(), 99 CanRefundStatus = Arrays.asList(SellerOrderStatus.YOHO_CANCEL_SELL.getCode(),
100 SellerOrderStatus.FINISH.getCode(), 100 SellerOrderStatus.FINISH.getCode(),
101 SellerOrderStatus.PLAY_SELF.getCode(), 101 SellerOrderStatus.PLAY_SELF.getCode(),
  102 + SellerOrderStatus.PLAY_BUYER.getCode(),
102 SellerOrderStatus.BUYER_CANCEL_BEFORE_SELLER_DELIVER.getCode(), 103 SellerOrderStatus.BUYER_CANCEL_BEFORE_SELLER_DELIVER.getCode(),
103 SellerOrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode(), 104 SellerOrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode(),
104 SellerOrderStatus.MINI_FAULT_REJECT.getCode(), 105 SellerOrderStatus.MINI_FAULT_REJECT.getCode(),
@@ -516,10 +516,12 @@ public class SellerOrderCancelService { @@ -516,10 +516,12 @@ public class SellerOrderCancelService {
516 if (Objects.nonNull(penaltyResult)) { 516 if (Objects.nonNull(penaltyResult)) {
517 // 退剩余保证金给卖家 517 // 退剩余保证金给卖家
518 BigDecimal backEarnestMoney = penaltyResult.getLeftAmount(); 518 BigDecimal backEarnestMoney = penaltyResult.getLeftAmount();
519 - try {  
520 - refundEarnestMoney(sellerOrder, targetSOStatus,backEarnestMoney);  
521 - } catch (Exception e) {  
522 - logger.warn("返回剩余保证金失败, sellerUid is {}, skup is {}, err is {}", sellerUid, skup, e.getMessage()); 519 + if(backEarnestMoney.compareTo(BigDecimal.ZERO) > 0){
  520 + try {
  521 + refundEarnestMoney(sellerOrder, targetSOStatus,backEarnestMoney);
  522 + } catch (Exception e) {
  523 + logger.warn("返回剩余保证金失败, sellerUid is {}, skup is {}, err is {}", sellerUid, skup, e.getMessage());
  524 + }
523 } 525 }
524 // 赔偿给买家的保证金金额 526 // 赔偿给买家的保证金金额
525 BigDecimal penaltyAmount = penaltyResult.getPenaltyAmount().subtract(penaltyResult.getYhServiceAmount()); 527 BigDecimal penaltyAmount = penaltyResult.getPenaltyAmount().subtract(penaltyResult.getYhServiceAmount());