| | |
| | | // 创建固定大小的线程池,根据需求调整线程数量 |
| | | ExecutorService executor = Executors.newFixedThreadPool(2); |
| | | try { |
| | | executor.submit(() -> sendMoney(EStockType.US.getCode())); |
| | | executor.submit(() -> sendMoney(EStockType.MX.getCode())); |
| | | executor.submit(() -> sendMoney(EStockType.getDefault().getCode())); |
| | | } finally { |
| | | // 关闭线程池 |
| | | executor.shutdown(); |
| | |
| | | } else { |
| | | userAssets.setAvailableBalance(userAssets.getAvailableBalance().add(aml)); |
| | | } |
| | | UserPosition userPosition = userPositionMapper.selectOne(new LambdaQueryWrapper<UserPosition>().gt(UserPosition::getAmountToBeCovered, BigDecimal.ZERO).eq(UserPosition::getUserId,userAssets.getUserId())); |
| | | /*UserPosition userPosition = userPositionMapper.selectOne(new LambdaQueryWrapper<UserPosition>().gt(UserPosition::getAmountToBeCovered, BigDecimal.ZERO).eq(UserPosition::getUserId,userAssets.getUserId())); |
| | | if(null != userPosition){ |
| | | userPosition.setAmountToBeCovered(userAssets.getAmountToBeCovered()); |
| | | userPositionMapper.updateById(userPosition); |
| | | } |
| | | }*/ |
| | | userAssets.setFreezeMoney(userAssets.getFreezeMoney().subtract(money)); |
| | | userAssetsMapper.updateById(userAssets); |
| | | orderEchoBean.setState("2"); |