|
@@ -95,10 +95,13 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { |
|
@@ -95,10 +95,13 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { |
95
|
if (orderInfo.getType() == TYPE_FIRST_RECHARGE) {
|
95
|
if (orderInfo.getType() == TYPE_FIRST_RECHARGE) {
|
96
|
try {
|
96
|
try {
|
97
|
logger.info("首次充值后回调,调用商家入驻接口,uid={}", orderInfo.getUid());
|
97
|
logger.info("首次充值后回调,调用商家入驻接口,uid={}", orderInfo.getUid());
|
98
|
- ufoServiceCaller.call("ufo.user.addUserAsStoredSeller", ApiResponse.class, orderInfo.getUid());
|
98
|
+ com.yoho.tools.common.beans.ApiResponse<?> resp = ufoServiceCaller.call("ufo.user.addUserAsStoredSeller", ApiResponse.class, orderInfo.getUid());
|
|
|
99
|
+ if (resp == null || resp.getCode() != 200) {
|
|
|
100
|
+ throw new Exception("调用商家入驻接口返回结果code不是200");
|
|
|
101
|
+ }
|
99
|
} catch (Exception e) {
|
102
|
} catch (Exception e) {
|
100
|
- logger.error("首次充值后回调,商家入驻接口失败,uid={}", orderInfo.getUid());
|
|
|
101
|
- CommonAlarmEventPublisher.publish("商家入驻失败", "ufo.user.addUserAsStoredSeller", "首次充值后回调,商家入驻接口失败:uid=" + orderInfo.getUid() + ",充值订单号为:" + orderInfo.getOrderCode());
|
103
|
+ logger.error("首次充值后回调,商家入驻接口失败,uid={}, msg={}", orderInfo.getUid(), e.getMessage());
|
|
|
104
|
+ CommonAlarmEventPublisher.publish("商家入驻失败", "ufo.user.addUserAsStoredSeller", "首次充值后回调,商家入驻接口失败:uid=" + orderInfo.getUid() + ",充值订单号为:" + orderInfo.getOrderCode() + ",err="+ e.getMessage());
|
102
|
return;
|
105
|
return;
|
103
|
}
|
106
|
}
|
104
|
}
|
107
|
}
|
|
@@ -523,6 +526,7 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { |
|
@@ -523,6 +526,7 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { |
523
|
BigDecimal beforeLockAmount = sw.getLockAmount();
|
526
|
BigDecimal beforeLockAmount = sw.getLockAmount();
|
524
|
BigDecimal availAmount = null;
|
527
|
BigDecimal availAmount = null;
|
525
|
BigDecimal lockAmount = null;
|
528
|
BigDecimal lockAmount = null;
|
|
|
529
|
+ BigDecimal tradeAmount = null;
|
526
|
|
530
|
|
527
|
// 减去保证金
|
531
|
// 减去保证金
|
528
|
if (type == SellerWalletDetail.Type.PUBLISH
|
532
|
if (type == SellerWalletDetail.Type.PUBLISH
|
|
@@ -530,6 +534,7 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { |
|
@@ -530,6 +534,7 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { |
530
|
|| type == SellerWalletDetail.Type.SUBTRACT_PRICE) {
|
534
|
|| type == SellerWalletDetail.Type.SUBTRACT_PRICE) {
|
531
|
availAmount = money.multiply(new BigDecimal("-1"));
|
535
|
availAmount = money.multiply(new BigDecimal("-1"));
|
532
|
lockAmount = money;
|
536
|
lockAmount = money;
|
|
|
537
|
+ tradeAmount = availAmount;
|
533
|
} else if (type == SellerWalletDetail.Type.SELLER_OFF
|
538
|
} else if (type == SellerWalletDetail.Type.SELLER_OFF
|
534
|
|| type == SellerWalletDetail.Type.SYSTEM_OFF
|
539
|
|| type == SellerWalletDetail.Type.SYSTEM_OFF
|
535
|
|| type == SellerWalletDetail.Type.APPRAISE_OK
|
540
|
|| type == SellerWalletDetail.Type.APPRAISE_OK
|
|
@@ -538,20 +543,22 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { |
|
@@ -538,20 +543,22 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { |
538
|
// 增加保证金
|
543
|
// 增加保证金
|
539
|
availAmount = money;
|
544
|
availAmount = money;
|
540
|
lockAmount = money.multiply(new BigDecimal("-1"));
|
545
|
lockAmount = money.multiply(new BigDecimal("-1"));
|
|
|
546
|
+ tradeAmount = money;
|
541
|
} else if (type == SellerWalletDetail.Type.SELLER_CANCEL
|
547
|
} else if (type == SellerWalletDetail.Type.SELLER_CANCEL
|
542
|
|| type == SellerWalletDetail.Type.SELLER_OVER_TIME
|
548
|
|| type == SellerWalletDetail.Type.SELLER_OVER_TIME
|
543
|
|| type == SellerWalletDetail.Type.APPRAISE_FAIL) {
|
549
|
|| type == SellerWalletDetail.Type.APPRAISE_FAIL) {
|
544
|
// 处罚保证金
|
550
|
// 处罚保证金
|
545
|
lockAmount = money.multiply(new BigDecimal("-1"));
|
551
|
lockAmount = money.multiply(new BigDecimal("-1"));
|
|
|
552
|
+ tradeAmount = lockAmount;
|
546
|
}
|
553
|
}
|
547
|
|
554
|
|
548
|
sw.setAmount(availAmount);
|
555
|
sw.setAmount(availAmount);
|
549
|
sw.setLockAmount(lockAmount);
|
556
|
sw.setLockAmount(lockAmount);
|
550
|
sw.setUpdateTime(TimeUtils.getTimeStampSecond());
|
557
|
sw.setUpdateTime(TimeUtils.getTimeStampSecond());
|
551
|
- logger.info("{}修改钱包表余额,bean={}", sw);
|
558
|
+ logger.info("{}修改钱包表余额,bean={}", message, sw);
|
552
|
if (sellerWalletMapper.addMoney(sw) == 0) {
|
559
|
if (sellerWalletMapper.addMoney(sw) == 0) {
|
553
|
- logger.error(message + "失败,(并发)更新表返回0,bean={}", sw);
|
|
|
554
|
- CommonAlarmEventPublisher.publish(message + "失败", "ufo.order.changePrice", "(并发)更新表返回0,uid=" + uid + ", bean为:"+ sw);
|
560
|
+ logger.error(message + "失败,(余额不足货钱包不可用)更新表返回0,bean={}", sw);
|
|
|
561
|
+ CommonAlarmEventPublisher.publish(message + "失败", "ufo.order.changePrice", "(余额不足货钱包不可用)更新表返回0,uid=" + uid + ", bean为:"+ sw);
|
555
|
return null;
|
562
|
return null;
|
556
|
}
|
563
|
}
|
557
|
logger.info("{}修改钱包表余额成功,bean={}", sw);
|
564
|
logger.info("{}修改钱包表余额成功,bean={}", sw);
|
|
@@ -561,7 +568,7 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { |
|
@@ -561,7 +568,7 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { |
561
|
swd.setType(type.getValue());
|
568
|
swd.setType(type.getValue());
|
562
|
swd.setUid(uid);
|
569
|
swd.setUid(uid);
|
563
|
swd.setWalletId(sw.getId());
|
570
|
swd.setWalletId(sw.getId());
|
564
|
- swd.setAmount(money);
|
571
|
+ swd.setAmount(tradeAmount);
|
565
|
swd.setIsBatch(0);
|
572
|
swd.setIsBatch(0);
|
566
|
swd.setCreateTime(TimeUtils.getTimeStampSecond());
|
573
|
swd.setCreateTime(TimeUtils.getTimeStampSecond());
|
567
|
swd.setUpdateTime(0);
|
574
|
swd.setUpdateTime(0);
|