| | |
| | | holdOrderEntity.setOpeningPrice(openingPrice); |
| | | holdOrderEntity.setOpeningType(submitOrderDto.getOrderType()); |
| | | holdOrderEntity.setMarkPrice(newPrice); |
| | | holdOrderEntity.setIsCanClosing(ContractHoldOrderEntity.ORDER_CAN_CLOSING_Y); |
| | | holdOrderEntity.setIsCanClosing(ContractHoldOrderEntity.ORDER_CAN_CLOSING_N); |
| | | holdOrderEntity.setPrePaymentAmount(prePaymentAmount); |
| | | holdOrderEntity.setBondAmount(bondAmount.add(openFeePrice)); |
| | | holdOrderEntity.setOperateNo(1); |
| | |
| | | return Result.fail("可平张数不足"); |
| | | } |
| | | |
| | | log.info("--->{},{}", holdOrderEntity.getSymbolCntSale(), wholeCloseOrderDto.getCount()); |
| | | // 判断当前持仓张数是否等于平仓张数,若等于则直接更新该订单为不可平状态,否则更新可平张数 |
| | | if (wholeCloseOrderDto.getCount() == holdOrderEntity.getSymbolCntSale()) { |
| | | contractHoldOrderDao.updateHoldOrderIsCanClosingById(ContractHoldOrderEntity.ORDER_CAN_CLOSING_N, wholeCloseOrderDto.getId()); |
| | |
| | | // 发送平仓消息 |
| | | 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")); |