| | |
| | | import com.nq.dao.EChoMapper; |
| | | import com.nq.dao.OrderEchoMapper; |
| | | import com.nq.dao.UserAssetsMapper; |
| | | import com.nq.dao.UserPositionMapper; |
| | | import com.nq.enums.EStockType; |
| | | import com.nq.enums.EUserAssets; |
| | | import com.nq.pojo.*; |
| | |
| | | |
| | | @Autowired |
| | | private UserAssetsMapper userAssetsMapper; |
| | | |
| | | @Autowired |
| | | private UserPositionMapper userPositionMapper; |
| | | |
| | | @Override |
| | | public List<EChoBean> queryList() { |
| | |
| | | } else { |
| | | userAssets.setAvailableBalance(userAssets.getAvailableBalance().add(aml)); |
| | | } |
| | | 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"); |