...
|
...
|
@@ -576,6 +576,7 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { |
|
|
|
|
|
BigDecimal beforeAvailAmount = sw.getAmount();
|
|
|
BigDecimal beforeLockAmount = sw.getLockAmount();
|
|
|
logger.info("{}修改钱包,uid={},金额计算后:beforeAvailAmount={}, beforeLockAmount={}", type.getName(), uid, beforeAvailAmount, beforeLockAmount);
|
|
|
BigDecimal availAmount = null;
|
|
|
BigDecimal lockAmount = null;
|
|
|
BigDecimal tradeAmount = null;
|
...
|
...
|
@@ -587,6 +588,7 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { |
|
|
availAmount = money.multiply(new BigDecimal("-1"));
|
|
|
lockAmount = money;
|
|
|
tradeAmount = availAmount;
|
|
|
logger.info("{}修改钱包,uid={},减去保证金场合:", type.getName(), uid);
|
|
|
} else if (type == SellerWalletDetail.Type.SELLER_OFF
|
|
|
|| type == SellerWalletDetail.Type.SYSTEM_OFF
|
|
|
|| type == SellerWalletDetail.Type.APPRAISE_OK
|
...
|
...
|
@@ -596,24 +598,26 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { |
|
|
availAmount = money;
|
|
|
lockAmount = money.multiply(new BigDecimal("-1"));
|
|
|
tradeAmount = money;
|
|
|
logger.info("{}修改钱包,uid={},增加保证金场合:", type.getName(), uid);
|
|
|
} 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;
|
|
|
logger.info("{}修改钱包,uid={},处罚保证金场合:", type.getName(), uid);
|
|
|
}
|
|
|
|
|
|
logger.info("{}修改钱包,uid={},金额计算后:availAmount={}, lockAmount={}, tradeAmount={}", type.getName(), uid, availAmount, lockAmount, tradeAmount);
|
|
|
sw.setAmount(availAmount);
|
|
|
sw.setLockAmount(lockAmount);
|
|
|
sw.setUpdateTime(TimeUtils.getTimeStampSecond());
|
|
|
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);
|
|
|
logger.info("修改钱包表余额成功,bean={}", sw);
|
|
|
|
|
|
SellerWalletDetail swd = new SellerWalletDetail();
|
|
|
swd.setOrderCode(orderCode);
|
...
|
...
|
@@ -632,6 +636,7 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { |
|
|
swd.setAttachValue(attach==null?"":JSON.toJSONString(attach));
|
|
|
swd.setAvailAmount(availAmount == null ? beforeAvailAmount : beforeAvailAmount.add(availAmount));
|
|
|
swd.setLockAmount(lockAmount == null ? beforeLockAmount : beforeLockAmount.add(lockAmount));
|
|
|
logger.info("{}修改钱包,uid={},明细availAmount={}, beforeAvailAmount={}, beforeLockAmount={}, lockAmount={}", type.getName(), uid, availAmount, beforeAvailAmount, beforeLockAmount, lockAmount);
|
|
|
swd.setIsSet(0);
|
|
|
/////////////////////////
|
|
|
logger.info("增加钱包明细汇总记录,bean={}", swd);
|
...
|
...
|
|