| | |
| | | if (accountType == 1 && moneyRevise.compareTo(BigDecimal.ZERO) <= 0) { //充值 |
| | | throw new YamiShopBindException("请输入大于0的数量"); |
| | | } |
| | | if (accountType == 2 && moneyRevise.compareTo(BigDecimal.ZERO) >= 0) { |
| | | throw new YamiShopBindException("请输入小于0的数量"); |
| | | if (accountType == 2) { |
| | | moneyRevise = moneyRevise.negate(); |
| | | } |
| | | if ("usdt".equals(coinType)) { |
| | | double amount1 = moneyRevise.doubleValue(); |
| | | CapitaltWallet capitaltWallet = getOne(new LambdaQueryWrapper<>(CapitaltWallet.class) |
| | | .eq(CapitaltWallet::getUserId, userId).last(" limit 1 ")); |
| | | double amount_before = capitaltWallet.getMoney().doubleValue(); |
| | | if (accountType == 2 && capitaltWallet.getMoney().subtract(moneyRevise).compareTo(BigDecimal.ZERO) < 0) { |
| | | throw new YamiShopBindException("账号资金不足"); |
| | | } |
| | | update(capitaltWallet, amount1); |
| | | |
| | | // 保存资金日志 |
| | |
| | | |
| | | double amount_before = walletExtend.getAmount(); |
| | | |
| | | if (accountType == 2 && Arith.sub(amount_before, volume) < 0) { |
| | | throw new YamiShopBindException("账号资金不足"); |
| | | } |
| | | |
| | | // walletExtend = walletService.saveWalletExtendByParaAndUpdate(String.valueOf(recharge.getPartyId()), recharge.getSymbol(), volume); |
| | | walletService.updateExtend(walletExtend.getPartyId().toString(), walletExtend.getWallettype(), volume); |
| | | |