Helius
2020-08-19 3129b41924bf541e5157ee30ceaf70ee5496f30e
src/main/java/com/xcong/excoin/modules/contract/service/impl/ContractHoldOrderServiceImpl.java
@@ -239,7 +239,7 @@
        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);
@@ -556,6 +556,7 @@
            return Result.fail("可平张数不足");
        }
        log.info("--->{},{}", holdOrderEntity.getSymbolCntSale(), wholeCloseOrderDto.getCount());
        // 判断当前持仓张数是否等于平仓张数,若等于则直接更新该订单为不可平状态,否则更新可平张数
        if (wholeCloseOrderDto.getCount() == holdOrderEntity.getSymbolCntSale()) {
            contractHoldOrderDao.updateHoldOrderIsCanClosingById(ContractHoldOrderEntity.ORDER_CAN_CLOSING_N, wholeCloseOrderDto.getId());
@@ -571,7 +572,7 @@
        // 发送平仓消息
        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"));