| | |
| | | package com.xcong.excoin.modules.contract.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xcong.excoin.common.LoginUserUtils; |
| | |
| | | return Result.fail("可平张数不足"); |
| | | } |
| | | |
| | | List<ContractEntrustOrderEntity> entrustOrders = contractEntrustOrderDao.selectEntrustOrderByOrderNo(holdOrderEntity.getOrderNo()); |
| | | if (CollUtil.isNotEmpty(entrustOrders)) { |
| | | int entrustCnt = 0; |
| | | for (ContractEntrustOrderEntity entrustOrder : entrustOrders) { |
| | | entrustCnt += entrustOrder.getSymbolCnt(); |
| | | } |
| | | |
| | | |
| | | if (submitCloseEntrustDto.getSymbolCnt() > holdOrderEntity.getSymbolCntSale() - entrustCnt) { |
| | | return Result.fail("当前存在多个委托,无法提交该数量委托"); |
| | | } |
| | | } |
| | | |
| | | |
| | | // 获取最新价 |
| | | BigDecimal newPrice = new BigDecimal(redisUtils.getString(CoinTypeConvert.convertToKey(holdOrderEntity.getSymbol()))); |
| | | |