feat: 计费规则
This commit is contained in:
1 parent
9b902bfd84
commit
3b2ae3c597
7 files changed
+168
-2
No files matched your search
+2
-2
@@ -248,9 +248,9 @@ public class UAccountServiceImpl extends ServiceImpl<UAccountMapper, UAccount> i
|
||||
BigDecimal balanceUsed = Optional.of(account.getBalanceUsed()).orElse(BigDecimal.ZERO);
|
||||
BigDecimal balance = Optional.of(dashboardVo.getBalance()).orElse(BigDecimal.ZERO);
|
||||
if (balance.compareTo(balanceUsed) >= 0) {
|
||||
dashboardVo.setBalance(BigDecimal.ZERO);
|
||||
} else {
|
||||
dashboardVo.setBalance(balance.subtract(balanceUsed));
|
||||
} else {
|
||||
dashboardVo.setBalance(BigDecimal.ZERO);
|
||||
}
|
||||
}
|
||||
return dashboardVo;
|
||||
|
||||
Reference in new issue
Block a user