| | |
| | | public Boolean availablebalanceSell(String accetType, Integer userId, EUserAssets eUserAssets, BigDecimal amount, BigDecimal fzAmount) { |
| | | |
| | | UserAssets userAssets = assetsByTypeAndUserId(accetType,userId); |
| | | 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())); |
| | | String before = userAssets.getAvailableBalance().toString(); |
| | | String accectType = userAssets.getAccectType(); |
| | | if(Objects.equals(eUserAssets.getCode(), EUserAssets.CLOSE_POSITION_RETURN_SECURITY_DEPOSIT.getCode())){ |
| | |
| | | } |
| | | } |
| | | |
| | | if(null != userPosition){ |
| | | userPosition.setAmountToBeCovered(userAssets.getAmountToBeCovered().add(userAssets.getHandlingChargeWritten())); |
| | | userPositionMapper.updateById(userPosition); |
| | | } |
| | | // if(null != userPosition){ |
| | | // userPosition.setAmountToBeCovered(userAssets.getAmountToBeCovered().add(userAssets.getHandlingChargeWritten())); |
| | | // userPositionMapper.updateById(userPosition); |
| | | // } |
| | | String after = userAssets.getAvailableBalance().toString(); |
| | | MoneyLog moneyLog = new MoneyLog(); |
| | | moneyLog.setDescs(eUserAssets.getDesc()); |