Helius
2020-07-07 58d0a3db8752ecf509813a3ee4a17c27e2361256
src/main/java/com/xcong/excoin/modules/contract/service/impl/ContractHoldOrderServiceImpl.java
@@ -385,22 +385,25 @@
                // 开多止盈
                if (stopProfitPrice != null) {
                    model = new OrderModel(holdOrderEntity.getId(), RabbitPriceTypeEnum.CLOSE_MORE_STOP_PROFIT.getValue(), stopProfitPrice.setScale(8, RoundingMode.HALF_UP).toPlainString(), holdOrderEntity.getSymbol());
                    producer.sendPriceOperate(JSONObject.toJSONString(model));
                }
                // 开多止损
                if (stopLessPrice != null) {
                    model = new OrderModel(holdOrderEntity.getId(), RabbitPriceTypeEnum.CLOSE_MORE_STOP_LESS.getValue(), stopLessPrice.setScale(8, RoundingMode.HALF_UP).toPlainString(), holdOrderEntity.getSymbol());
                    producer.sendPriceOperate(JSONObject.toJSONString(model));
                }
            } else {
                // 开空止盈
                if (stopProfitPrice != null) {
                    model = new OrderModel(holdOrderEntity.getId(), RabbitPriceTypeEnum.CLOSE_LESS_STOP_PROFIT.getValue(), stopProfitPrice.setScale(8, RoundingMode.HALF_UP).toPlainString(), holdOrderEntity.getSymbol());
                    producer.sendPriceOperate(JSONObject.toJSONString(model));
                }
                // 开空止损
                if (stopLessPrice != null) {
                    model = new OrderModel(holdOrderEntity.getId(), RabbitPriceTypeEnum.CLOSE_LESS_STOP_LESS.getValue(), stopLessPrice.setScale(8, RoundingMode.HALF_UP).toPlainString(), holdOrderEntity.getSymbol());
                    producer.sendPriceOperate(JSONObject.toJSONString(model));
                }
            }
            producer.sendPriceOperate(JSONObject.toJSONString(model));
            return Result.ok("设置成功");
        }
        return Result.fail("设置失败");