Showing
1 changed file
with
6 additions
and
2 deletions
@@ -526,6 +526,7 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { | @@ -526,6 +526,7 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { | ||
526 | BigDecimal beforeLockAmount = sw.getLockAmount(); | 526 | BigDecimal beforeLockAmount = sw.getLockAmount(); |
527 | BigDecimal availAmount = null; | 527 | BigDecimal availAmount = null; |
528 | BigDecimal lockAmount = null; | 528 | BigDecimal lockAmount = null; |
529 | + BigDecimal tradeAmount = null; | ||
529 | 530 | ||
530 | // 减去保证金 | 531 | // 减去保证金 |
531 | if (type == SellerWalletDetail.Type.PUBLISH | 532 | if (type == SellerWalletDetail.Type.PUBLISH |
@@ -533,6 +534,7 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { | @@ -533,6 +534,7 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { | ||
533 | || type == SellerWalletDetail.Type.SUBTRACT_PRICE) { | 534 | || type == SellerWalletDetail.Type.SUBTRACT_PRICE) { |
534 | availAmount = money.multiply(new BigDecimal("-1")); | 535 | availAmount = money.multiply(new BigDecimal("-1")); |
535 | lockAmount = money; | 536 | lockAmount = money; |
537 | + tradeAmount = availAmount; | ||
536 | } else if (type == SellerWalletDetail.Type.SELLER_OFF | 538 | } else if (type == SellerWalletDetail.Type.SELLER_OFF |
537 | || type == SellerWalletDetail.Type.SYSTEM_OFF | 539 | || type == SellerWalletDetail.Type.SYSTEM_OFF |
538 | || type == SellerWalletDetail.Type.APPRAISE_OK | 540 | || type == SellerWalletDetail.Type.APPRAISE_OK |
@@ -541,17 +543,19 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { | @@ -541,17 +543,19 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { | ||
541 | // 增加保证金 | 543 | // 增加保证金 |
542 | availAmount = money; | 544 | availAmount = money; |
543 | lockAmount = money.multiply(new BigDecimal("-1")); | 545 | lockAmount = money.multiply(new BigDecimal("-1")); |
546 | + tradeAmount = money; | ||
544 | } else if (type == SellerWalletDetail.Type.SELLER_CANCEL | 547 | } else if (type == SellerWalletDetail.Type.SELLER_CANCEL |
545 | || type == SellerWalletDetail.Type.SELLER_OVER_TIME | 548 | || type == SellerWalletDetail.Type.SELLER_OVER_TIME |
546 | || type == SellerWalletDetail.Type.APPRAISE_FAIL) { | 549 | || type == SellerWalletDetail.Type.APPRAISE_FAIL) { |
547 | // 处罚保证金 | 550 | // 处罚保证金 |
548 | lockAmount = money.multiply(new BigDecimal("-1")); | 551 | lockAmount = money.multiply(new BigDecimal("-1")); |
552 | + tradeAmount = lockAmount; | ||
549 | } | 553 | } |
550 | 554 | ||
551 | sw.setAmount(availAmount); | 555 | sw.setAmount(availAmount); |
552 | sw.setLockAmount(lockAmount); | 556 | sw.setLockAmount(lockAmount); |
553 | sw.setUpdateTime(TimeUtils.getTimeStampSecond()); | 557 | sw.setUpdateTime(TimeUtils.getTimeStampSecond()); |
554 | - logger.info("{}修改钱包表余额,bean={}", sw); | 558 | + logger.info("{}修改钱包表余额,bean={}", message, sw); |
555 | if (sellerWalletMapper.addMoney(sw) == 0) { | 559 | if (sellerWalletMapper.addMoney(sw) == 0) { |
556 | logger.error(message + "失败,(并发)更新表返回0,bean={}", sw); | 560 | logger.error(message + "失败,(并发)更新表返回0,bean={}", sw); |
557 | CommonAlarmEventPublisher.publish(message + "失败", "ufo.order.changePrice", "(并发)更新表返回0,uid=" + uid + ", bean为:"+ sw); | 561 | CommonAlarmEventPublisher.publish(message + "失败", "ufo.order.changePrice", "(并发)更新表返回0,uid=" + uid + ", bean为:"+ sw); |
@@ -564,7 +568,7 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { | @@ -564,7 +568,7 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { | ||
564 | swd.setType(type.getValue()); | 568 | swd.setType(type.getValue()); |
565 | swd.setUid(uid); | 569 | swd.setUid(uid); |
566 | swd.setWalletId(sw.getId()); | 570 | swd.setWalletId(sw.getId()); |
567 | - swd.setAmount(money); | 571 | + swd.setAmount(tradeAmount); |
568 | swd.setIsBatch(0); | 572 | swd.setIsBatch(0); |
569 | swd.setCreateTime(TimeUtils.getTimeStampSecond()); | 573 | swd.setCreateTime(TimeUtils.getTimeStampSecond()); |
570 | swd.setUpdateTime(0); | 574 | swd.setUpdateTime(0); |
-
Please register or login to post a comment