Authored by chenchao

show express info and clean cache when fail

@@ -34,7 +34,9 @@ public class ActionStatusHold { @@ -34,7 +34,9 @@ public class ActionStatusHold {
34 OrderStatus.MINI_FAULT_REJECT.getCode(), 34 OrderStatus.MINI_FAULT_REJECT.getCode(),
35 OrderStatus.MINI_FAULT_OUT_TIME_REJECT.getCode(), 35 OrderStatus.MINI_FAULT_OUT_TIME_REJECT.getCode(),
36 OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode(), 36 OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode(),
37 - OrderStatus.PLATFORM_APPRAISE_UNSURE.getCode() 37 + OrderStatus.PLATFORM_APPRAISE_UNSURE.getCode(),
  38 + OrderStatus.PLATFORM_BLOWN_CUSTOMS_CLEARANCE.getCode(),
  39 + OrderStatus.BUYER_BLOWN_CUSTOMS_CLEARANCE.getCode()
38 ); 40 );
39 41
40 42
@@ -111,7 +113,9 @@ public class ActionStatusHold { @@ -111,7 +113,9 @@ public class ActionStatusHold {
111 OrderStatus.MINI_FAULT_OUT_TIME_REJECT.getCode(), 113 OrderStatus.MINI_FAULT_OUT_TIME_REJECT.getCode(),
112 OrderStatus.WAITING_RECEIVE.getCode(),OrderStatus.DONE.getCode(), 114 OrderStatus.WAITING_RECEIVE.getCode(),OrderStatus.DONE.getCode(),
113 OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode(), 115 OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode(),
114 - OrderStatus.PLATFORM_APPRAISE_UNSURE.getCode() 116 + OrderStatus.PLATFORM_APPRAISE_UNSURE.getCode(),
  117 + OrderStatus.PLATFORM_BLOWN_CUSTOMS_CLEARANCE.getCode(),
  118 + OrderStatus.BUYER_BLOWN_CUSTOMS_CLEARANCE.getCode()
115 ); 119 );
116 // 120 //
117 static List<Integer> CanRefundStatus; 121 static List<Integer> CanRefundStatus;
@@ -76,7 +76,7 @@ public class AlarmEventBuilder { @@ -76,7 +76,7 @@ public class AlarmEventBuilder {
76 smsAlarmEvent = new SmsAlarmEvent("buyerPaidOrder.selfCancel", "cancel", content); 76 smsAlarmEvent = new SmsAlarmEvent("buyerPaidOrder.selfCancel", "cancel", content);
77 break; 77 break;
78 default: 78 default:
79 - smsAlarmEvent = new SmsAlarmEvent("","",""); 79 + smsAlarmEvent = new SmsAlarmEvent("RefundBuyerGoodsMoney","RefundBuyerGoodsMoney",content);
80 } 80 }
81 return smsAlarmEvent; 81 return smsAlarmEvent;
82 } 82 }
@@ -79,19 +79,14 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { @@ -79,19 +79,14 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService {
79 @Autowired 79 @Autowired
80 UfoServiceCaller ufoServiceCaller; 80 UfoServiceCaller ufoServiceCaller;
81 81
82 - //@Value("${order.seller.tip.publishMoneyTip:保证金余额不足}")  
83 private String publishMoneyTip = "保证金余额不足 ¥"; 82 private String publishMoneyTip = "保证金余额不足 ¥";
84 83
85 - //@Value("${order.seller.tip.publishFunctionTip:请充值后进行正常上架/下架}")  
86 private String publishFunctionTip = "请充值后进行正常上架"; 84 private String publishFunctionTip = "请充值后进行正常上架";
87 85
88 - //@Value("${order.seller.tip.canSaleMoneyTip:保证金余额低于}")  
89 private String canSaleMoneyTip = "保证金余额不足 ¥"; 86 private String canSaleMoneyTip = "保证金余额不足 ¥";
90 87
91 - //@Value("${order.seller.tip.canSaleFunctionTip:平台下架您所有出售中的商品}")  
92 private String canSaleFunctionTip = "上架所有商品将会被强制隐藏,不会给用户展示"; 88 private String canSaleFunctionTip = "上架所有商品将会被强制隐藏,不会给用户展示";
93 89
94 - //@Value("${order.seller.tip.recoverTip:充值 ¥{} 恢复超级商家权限}")  
95 private String recoverTip = "充值 ¥{} 恢复超级商家权限"; 90 private String recoverTip = "充值 ¥{} 恢复超级商家权限";
96 91
97 private String saleListLowMoneyTip = "您的保证金余额不足,出售中商品将会被强制隐藏,不会给用户展示"; 92 private String saleListLowMoneyTip = "您的保证金余额不足,出售中商品将会被强制隐藏,不会给用户展示";
@@ -102,7 +97,6 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { @@ -102,7 +97,6 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService {
102 /** 97 /**
103 * 瑕疵确认不通过的情况,卖家的保证金扣掉一部分给平台,暂定0元 98 * 瑕疵确认不通过的情况,卖家的保证金扣掉一部分给平台,暂定0元
104 */ 99 */
105 - //@Value("${order.seller.earnestmoney.miniFaultRejectPunishFee:0}")  
106 private Double miniFaultRejectPunishFee = 0D ; 100 private Double miniFaultRejectPunishFee = 0D ;
107 101
108 102
@@ -520,9 +514,11 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { @@ -520,9 +514,11 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService {
520 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 514 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
521 JSONObject result = new JSONObject(); 515 JSONObject result = new JSONObject();
522 BigDecimal allMoney = sw.getAmount().add(sw.getLockAmount()); 516 BigDecimal allMoney = sw.getAmount().add(sw.getLockAmount());
523 - 517 +
  518 + SellerWrapper sellerWrapper = sellerService.getBaseSellerWrapper(uid);
  519 + SellerBo sellerBo = sellerWrapper.buildSellerBo();
524 Map<EntrySellerType, EntryThreshold> map = sellerService.getEntryThreshold(); 520 Map<EntrySellerType, EntryThreshold> map = sellerService.getEntryThreshold();
525 - EntryThreshold sp = map.get(EntrySellerType.SUPER_ENTRY); 521 + EntryThreshold sp = map.get(sellerBo.getEntrySellerType());
526 // 查配置、超级卖家门槛金额 522 // 查配置、超级卖家门槛金额
527 BigDecimal superMoney = sp.getPrepaymentAmount(); 523 BigDecimal superMoney = sp.getPrepaymentAmount();
528 BigDecimal lackOfMoneyAsSuper = BigDecimal.ZERO; 524 BigDecimal lackOfMoneyAsSuper = BigDecimal.ZERO;
@@ -381,6 +381,17 @@ public class BuyerOrderCancelService { @@ -381,6 +381,17 @@ public class BuyerOrderCancelService {
381 logger.warn("cancelOverseasOrder fail -> buyerOrderMapper.updateStatusByOrderCode, orderCode {}", orderCode); 381 logger.warn("cancelOverseasOrder fail -> buyerOrderMapper.updateStatusByOrderCode, orderCode {}", orderCode);
382 return; 382 return;
383 } 383 }
  384 + int sellerUid = buyerOrder.getSellerUid();
  385 + //clean cache
  386 + cacheCleaner.delete(Arrays.asList(CacheKeyBuilder.orderListKey(sellerUid, TabType.SELL.getValue()),
  387 + CacheKeyBuilder.orderListKey(buyerUid, TabType.BUY.getValue()),
  388 + CacheKeyBuilder.orderDetailKey(sellerUid, TabType.SELL.getValue(), orderCode),
  389 + CacheKeyBuilder.orderDetailKey(buyerUid, TabType.BUY.getValue(), orderCode),
  390 + CacheKeyBuilder.buyerOrderNums(buyerUid)));
  391 +
  392 + ErpBuyerOrderEvent event = new ErpBuyerOrderEvent(buyerUid);
  393 + EventBusPublisher.publishEvent(event);
  394 +
384 BigDecimal leftGoodsMoney = buyerOrder.getAmount(); 395 BigDecimal leftGoodsMoney = buyerOrder.getAmount();
385 396
386 BuyerOrderGoods pbog = buyerOrderGoodsMapper.selectOnlyByOrderCode(orderCode); 397 BuyerOrderGoods pbog = buyerOrderGoodsMapper.selectOnlyByOrderCode(orderCode);