From d61072f997839b4564ce35132d5902a1b6f7d54f Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Mon, 03 Aug 2020 17:39:10 +0800
Subject: [PATCH] modify
---
src/main/java/com/xcong/excoin/rabbit/pricequeue/WebsocketPriceService.java | 17 ++++-------------
1 files changed, 4 insertions(+), 13 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 a81854c..af91983 100644
--- a/src/main/java/com/xcong/excoin/rabbit/pricequeue/WebsocketPriceService.java
+++ b/src/main/java/com/xcong/excoin/rabbit/pricequeue/WebsocketPriceService.java
@@ -34,10 +34,8 @@
List<AscBigDecimal> list = new ArrayList<AscBigDecimal>();
// 找到所有比当前价格大的 是需要操作的
if (b != null && b.compareTo(now) <= 0) {
- log.info("--->{}", b.getValue());
// 可以操作
System.out.println("当前价格:" + price + "---正序---" + "队列价格:" + b.getValue().toPlainString() + " time:" + new Date());
- log.info("--->>>>{}", queue.peek().getValue());
while (queue.peek() != null && queue.peek().compareTo(now) <= 0) {
// 可以发送消息操作
list.add(queue.remove());
@@ -61,11 +59,9 @@
// 找到比当前价格还大的就是需要操作的 开多止损
// 即最大的币当前价大 那么需要开多止损
if (b != null && b.compareTo(now) <= 0) {
- log.info("--->{}", b.getValue());
// 可以操作
System.out.println("当前价格:" + price + "---倒序操作---" + "队列:" + b.getValue().toPlainString() + " time:" + new Date());
- log.info("--->>>>{}", queue.peek().getValue());
while (queue.peek() != null && queue.peek().compareTo(now) <= 0) {
// 可以发送消息操作
list.add(queue.remove());
@@ -86,20 +82,18 @@
List<OrderModel> orderModelList = new ArrayList<OrderModel>();
// 3 正序
Map<String, List<OrderModel>> orderMap = PricePriorityQueue.getOrderMap(symbol, 3);
- log.info("--->{}", JSONObject.toJSONString(orderMap));
// 根据价格查询到对应的订单
for (AscBigDecimal asc : list) {
String key = asc.getValue().toPlainString();
- log.info("------>>>>>{}", key);
assert orderMap != null;
- log.info("======={}", orderMap.containsKey(key));
+ log.info("----->->{}, --> {}", JSONObject.toJSONString(orderMap), key);
if (orderMap.containsKey(key)) {
orderModelList.addAll(orderMap.get(key));
orderMap.remove(key);
}
}
- log.info("{}", orderModelList);
+ log.info("------>{}", JSONObject.toJSONString(orderModelList));
if (CollectionUtils.isEmpty(orderModelList)) {
return;
}
@@ -131,7 +125,7 @@
kkzsList.add(model);
break;
default:
- log.info("#price-service unknow type#");
+ log.info("#price-service unknown type#");
break;
}
@@ -161,13 +155,11 @@
// 根据不同类型发送不同消息 1 倒序 2 正序
List<OrderModel> orderModelList = new ArrayList<OrderModel>();
Map<String, List<OrderModel>> orderMap = PricePriorityQueue.getOrderMap(symbol, 2);
- log.info("--->{}", JSONObject.toJSONString(orderMap));
// 根据价格查询到对应的订单
for (DescBigDecimal desc : list) {
String key = desc.getValue().toPlainString();
- log.info("------>>>>>{}", key);
assert orderMap != null;
- log.info("======={}", orderMap.containsKey(key));
+ log.info("----->->{}, --> {}", JSONObject.toJSONString(orderMap), key);
if (orderMap.containsKey(key)) {
orderModelList.addAll(orderMap.get(key));
orderMap.remove(key);
@@ -175,7 +167,6 @@
}
- log.info("{}", orderModelList);
if (CollectionUtils.isEmpty(orderModelList)) {
return;
}
--
Gitblit v1.9.1