| | |
| | | @Autowired |
| | | ItemService itemService; |
| | | |
| | | @Autowired |
| | | CapitaltWalletMapper capitaltWalletMapper; |
| | | |
| | | @Override |
| | | public CapitaltWallet getUserIdWallet(String userId) { |
| | | return getOne(new LambdaQueryWrapper<>(CapitaltWallet.class) |
| | | CapitaltWallet capitaltWallet = getOne(new LambdaQueryWrapper<>(CapitaltWallet.class) |
| | | .eq(CapitaltWallet::getUserId,userId).last(" limit 1")); |
| | | if (capitaltWallet != null) { |
| | | return capitaltWallet; |
| | | } else { |
| | | capitaltWallet = new CapitaltWallet(); |
| | | capitaltWallet.setUserId(userId); |
| | | save(capitaltWallet); |
| | | return capitaltWallet; |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | if ("usdt".equals(coinType)) { |
| | | double amount1 = moneyRevise.doubleValue(); |
| | | CapitaltWallet capitaltWallet = getOne(new LambdaQueryWrapper<>(CapitaltWallet.class) |
| | | .eq(CapitaltWallet::getUserId, userId).last(" limit 1 ")); |
| | | CapitaltWallet capitaltWallet = getUserIdWallet(userId); |
| | | if (capitaltWallet == null) { |
| | | throw new YamiShopBindException("账号缺少资金数据"); |
| | | } |
| | | double amount_before = capitaltWallet.getMoney().doubleValue(); |
| | | if (accountType == 2 && capitaltWallet.getMoney().subtract(moneyRevise).compareTo(BigDecimal.ZERO) < 0) { |
| | | throw new YamiShopBindException("账号资金不足"); |