...
|
...
|
@@ -95,10 +95,13 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { |
|
|
if (orderInfo.getType() == TYPE_FIRST_RECHARGE) {
|
|
|
try {
|
|
|
logger.info("首次充值后回调,调用商家入驻接口,uid={}", orderInfo.getUid());
|
|
|
ufoServiceCaller.call("ufo.user.addUserAsStoredSeller", ApiResponse.class, orderInfo.getUid());
|
|
|
com.yoho.tools.common.beans.ApiResponse<?> resp = ufoServiceCaller.call("ufo.user.addUserAsStoredSeller", ApiResponse.class, orderInfo.getUid());
|
|
|
if (resp == null || resp.getCode() != 200) {
|
|
|
throw new Exception("调用商家入驻接口返回结果code不是200");
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
logger.error("首次充值后回调,商家入驻接口失败,uid={}", orderInfo.getUid());
|
|
|
CommonAlarmEventPublisher.publish("商家入驻失败", "ufo.user.addUserAsStoredSeller", "首次充值后回调,商家入驻接口失败:uid=" + orderInfo.getUid() + ",充值订单号为:" + orderInfo.getOrderCode());
|
|
|
logger.error("首次充值后回调,商家入驻接口失败,uid={}, msg={}", orderInfo.getUid(), e.getMessage());
|
|
|
CommonAlarmEventPublisher.publish("商家入驻失败", "ufo.user.addUserAsStoredSeller", "首次充值后回调,商家入驻接口失败:uid=" + orderInfo.getUid() + ",充值订单号为:" + orderInfo.getOrderCode() + ",err="+ e.getMessage());
|
|
|
return;
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -523,6 +526,7 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { |
|
|
BigDecimal beforeLockAmount = sw.getLockAmount();
|
|
|
BigDecimal availAmount = null;
|
|
|
BigDecimal lockAmount = null;
|
|
|
BigDecimal tradeAmount = null;
|
|
|
|
|
|
// 减去保证金
|
|
|
if (type == SellerWalletDetail.Type.PUBLISH
|
...
|
...
|
@@ -530,6 +534,7 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { |
|
|
|| type == SellerWalletDetail.Type.SUBTRACT_PRICE) {
|
|
|
availAmount = money.multiply(new BigDecimal("-1"));
|
|
|
lockAmount = money;
|
|
|
tradeAmount = availAmount;
|
|
|
} else if (type == SellerWalletDetail.Type.SELLER_OFF
|
|
|
|| type == SellerWalletDetail.Type.SYSTEM_OFF
|
|
|
|| type == SellerWalletDetail.Type.APPRAISE_OK
|
...
|
...
|
@@ -538,20 +543,22 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { |
|
|
// 增加保证金
|
|
|
availAmount = money;
|
|
|
lockAmount = money.multiply(new BigDecimal("-1"));
|
|
|
tradeAmount = money;
|
|
|
} else if (type == SellerWalletDetail.Type.SELLER_CANCEL
|
|
|
|| type == SellerWalletDetail.Type.SELLER_OVER_TIME
|
|
|
|| type == SellerWalletDetail.Type.APPRAISE_FAIL) {
|
|
|
// 处罚保证金
|
|
|
lockAmount = money.multiply(new BigDecimal("-1"));
|
|
|
tradeAmount = lockAmount;
|
|
|
}
|
|
|
|
|
|
sw.setAmount(availAmount);
|
|
|
sw.setLockAmount(lockAmount);
|
|
|
sw.setUpdateTime(TimeUtils.getTimeStampSecond());
|
|
|
logger.info("{}修改钱包表余额,bean={}", sw);
|
|
|
logger.info("{}修改钱包表余额,bean={}", message, sw);
|
|
|
if (sellerWalletMapper.addMoney(sw) == 0) {
|
|
|
logger.error(message + "失败,(并发)更新表返回0,bean={}", sw);
|
|
|
CommonAlarmEventPublisher.publish(message + "失败", "ufo.order.changePrice", "(并发)更新表返回0,uid=" + uid + ", bean为:"+ sw);
|
|
|
logger.error(message + "失败,(余额不足货钱包不可用)更新表返回0,bean={}", sw);
|
|
|
CommonAlarmEventPublisher.publish(message + "失败", "ufo.order.changePrice", "(余额不足货钱包不可用)更新表返回0,uid=" + uid + ", bean为:"+ sw);
|
|
|
return null;
|
|
|
}
|
|
|
logger.info("{}修改钱包表余额成功,bean={}", sw);
|
...
|
...
|
@@ -561,7 +568,7 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { |
|
|
swd.setType(type.getValue());
|
|
|
swd.setUid(uid);
|
|
|
swd.setWalletId(sw.getId());
|
|
|
swd.setAmount(money);
|
|
|
swd.setAmount(tradeAmount);
|
|
|
swd.setIsBatch(0);
|
|
|
swd.setCreateTime(TimeUtils.getTimeStampSecond());
|
|
|
swd.setUpdateTime(0);
|
...
|
...
|
|