| | |
| | | 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); |
| | | } |
| | | |
| | |
| | | // 发送平仓消息 |
| | | List<Long> ids = new ArrayList<>(); |
| | | ids.add(wholeCloseOrderDto.getId()); |
| | | // producer.sendCloseTrade(JSONObject.toJSONString(ids)); |
| | | producer.sendCloseTrade(JSONObject.toJSONString(ids)); |
| | | |
| | | // 平仓成功 |
| | | return Result.ok(MessageSourceUtils.getString("order_service_0044")); |