| | |
| | | return Result.fail("可平张数不足"); |
| | | } |
| | | |
| | | log.info("--->{},{}", holdOrderEntity.getSymbolCntSale(), wholeCloseOrderDto.getCount()); |
| | | // 判断当前持仓张数是否等于平仓张数,若等于则直接更新该订单为不可平状态,否则更新可平张数 |
| | | if (wholeCloseOrderDto.getCount() == holdOrderEntity.getSymbolCntSale()) { |
| | | contractHoldOrderDao.updateHoldOrderIsCanClosingById(ContractHoldOrderEntity.ORDER_CAN_CLOSING_N, wholeCloseOrderDto.getId()); |
| | | } else { |
| | | int sub = holdOrderEntity.getSymbolCntSale() - wholeCloseOrderDto.getCount(); |
| | | log.info("剩余张数:{}", sub); |
| | | // 更新可平张数 |
| | | holdOrderEntity.setSymbolCntSale(holdOrderEntity.getSymbolCntSale() - wholeCloseOrderDto.getCount()); |
| | | holdOrderEntity.setSymbolCntSale(sub); |
| | | contractHoldOrderDao.updateById(holdOrderEntity); |
| | | } |
| | | |