From 5b6a4a679d05b198be4730f6f10620be330c2861 Mon Sep 17 00:00:00 2001
From: zyy <zyy@email.com>
Date: Thu, 22 Jan 2026 17:18:43 +0800
Subject: [PATCH] 新闻弹窗
---
trading-order-admin/src/main/java/com/yami/trading/admin/task/RealtimeWebsocketServer.java | 32 +++++++++++++++++---------------
1 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/trading-order-admin/src/main/java/com/yami/trading/admin/task/RealtimeWebsocketServer.java b/trading-order-admin/src/main/java/com/yami/trading/admin/task/RealtimeWebsocketServer.java
index 8e798ce..8a0250d 100644
--- a/trading-order-admin/src/main/java/com/yami/trading/admin/task/RealtimeWebsocketServer.java
+++ b/trading-order-admin/src/main/java/com/yami/trading/admin/task/RealtimeWebsocketServer.java
@@ -112,20 +112,22 @@
realtime.setAmount(new BigDecimal(amount));
if (currentValue != null && currentValue != 0) {
- realtime.setClose(new BigDecimal(Arith.add(close, currentValue.doubleValue())));
- realtime.setVolume(new BigDecimal(Arith.add(vol, Arith.mul(Arith.div(currentValue, close), vol))));
- realtime.setAmount(new BigDecimal(Arith.add(amount, Arith.mul(Arith.div(currentValue, close), amount))));
+ realtime.setClose(new BigDecimal(Arith.add(close, currentValue)));
+ //realtime.setVolume(new BigDecimal(Arith.add(vol, Arith.mul(Arith.div(currentValue, close), vol))));
+ //realtime.setAmount(new BigDecimal(Arith.add(amount, Arith.mul(Arith.div(currentValue, close), amount))));
+
+ Double high = DataCache.getRealtimeHigh().get(symbol);
+ Double low = DataCache.getRealtimeLow().get(symbol);
+
+ if (high != null) {
+ realtime.setHigh(BigDecimal.valueOf(high));
+ }
+ if (low != null) {
+ realtime.setLow(BigDecimal.valueOf(low));
+ }
}
- Double high = DataCache.getRealtimeHigh().get(symbol);
- Double low = DataCache.getRealtimeLow().get(symbol);
- if (high == null || realtime.getClose().doubleValue() > high) {
- DataCache.getRealtimeHigh().put(symbol, close);
- }
- if ((low == null || realtime.getClose().doubleValue() < low) && realtime.getClose().doubleValue() > 0) {
- DataCache.getRealtimeLow().put(symbol, close);
- }
Realtime current = DataCache.getRealtime(symbol);
if (current == null || current.getTs() != event.getTs()) {
@@ -135,21 +137,21 @@
realtime.setAmount(realtime.getAmount().multiply(item.getMultiple()));
}
- if (high != null && high >= realtime.getClose().doubleValue()) {
+ /*if (high != null && high >= realtime.getClose().doubleValue()) {
realtime.setHigh(new BigDecimal(high));
}
if (low != null && low <= realtime.getClose().doubleValue()) {
realtime.setLow(new BigDecimal(low));
- }
+ }*/
/*ouble h24Before = DataCache.getRealtime24HBeforeOpen().get(symbol);
if (h24Before != null) {
realtime.setOpen(new BigDecimal(h24Before));
}*/
- /*if (realtime.getSymbol().equals("axsusdt")) {
- System.out.println("axsusdt2" + realtime);
+ /*if (realtime.getSymbol().equals("galausdt")) {
+ System.out.println("galausdt222" + realtime);
}*/
DataCache.putRealtime(symbol, realtime);
// System.out.println(JSONObject.toJSONString(realtime));
--
Gitblit v1.9.3