From ebb754075f9fd70e214b2938d8ef90acf8d6f747 Mon Sep 17 00:00:00 2001 From: Helius <wangdoubleone@gmail.com> Date: Wed, 26 Aug 2020 15:13:33 +0800 Subject: [PATCH] modify --- src/main/java/com/xcong/excoin/rabbit/pricequeue/WebsocketPriceService.java | 19 +++++++++++++++++-- 1 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/xcong/excoin/rabbit/pricequeue/WebsocketPriceService.java b/src/main/java/com/xcong/excoin/rabbit/pricequeue/WebsocketPriceService.java index 233e84b..1aab16d 100644 --- a/src/main/java/com/xcong/excoin/rabbit/pricequeue/WebsocketPriceService.java +++ b/src/main/java/com/xcong/excoin/rabbit/pricequeue/WebsocketPriceService.java @@ -37,7 +37,6 @@ // 可以操作 System.out.println("当前价格:" + price + "---正序---" + "队列价格:" + b.getValue().toPlainString() + " time:" + new Date()); while (queue.peek() != null && queue.peek().compareTo(now) <= 0) { - log.info("------->"); // 可以发送消息操作 list.add(queue.remove()); } @@ -87,6 +86,7 @@ for (AscBigDecimal asc : list) { String key = asc.getValue().toPlainString(); assert orderMap != null; + log.info("----->->{}, --> {}", JSONObject.toJSONString(orderMap), key); if (orderMap.containsKey(key)) { orderModelList.addAll(orderMap.get(key)); orderMap.remove(key); @@ -111,9 +111,14 @@ List<OrderModel> bcList = new ArrayList<OrderModel>(); // 开空 List<OrderModel> wtkkList = new ArrayList<OrderModel>(); + // 委托平多 + List<OrderModel> wtpdList = new ArrayList<>(); switch (model.getType()) { case 3: wtkkList.add(model); + break; + case 4: + wtpdList.add(model); break; case 7: bcList.add(model); @@ -143,6 +148,9 @@ } if (CollectionUtils.isNotEmpty(wtkkList)) { orderProducer.sendLimit(JSONObject.toJSONString(wtkkList)); + } + if (CollectionUtils.isNotEmpty(wtpdList)) { + orderProducer.sendLimitClose(JSONObject.toJSONString(wtpdList)); } } } @@ -184,9 +192,14 @@ List<OrderModel> bcList = new ArrayList<OrderModel>(); // 开多委托 List<OrderModel> wtkdList = new ArrayList<OrderModel>(); + // 委托平空 + List<OrderModel> wtpkList = new ArrayList<>(); switch (model.getType()) { case 2: wtkdList.add(model); + break; + case 5: + wtpkList.add(model); break; case 6: bcList.add(model); @@ -215,7 +228,9 @@ } if (CollectionUtils.isNotEmpty(wtkdList)) { orderProducer.sendLimit(JSONObject.toJSONString(wtkdList)); - + } + if (CollectionUtils.isNotEmpty(wtpkList)) { + orderProducer.sendLimitClose(JSONObject.toJSONString(wtpkList)); } } } -- Gitblit v1.9.1