From 513e5442723f501525bf9ca6210b16561e5d3a2b Mon Sep 17 00:00:00 2001
From: zyy <zyy@email.com>
Date: Tue, 24 Mar 2026 11:41:07 +0800
Subject: [PATCH] 1

---
 trading-order-admin/src/main/java/com/yami/trading/admin/task/RealtimePushJob.java |   26 ++++++++++++++++++++------
 1 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/trading-order-admin/src/main/java/com/yami/trading/admin/task/RealtimePushJob.java b/trading-order-admin/src/main/java/com/yami/trading/admin/task/RealtimePushJob.java
index 8d21502..cea8c1d 100644
--- a/trading-order-admin/src/main/java/com/yami/trading/admin/task/RealtimePushJob.java
+++ b/trading-order-admin/src/main/java/com/yami/trading/admin/task/RealtimePushJob.java
@@ -12,6 +12,7 @@
 import com.yami.trading.common.web.ResultObject;
 import com.yami.trading.huobi.data.AdjustmentValueCache;
 import com.yami.trading.huobi.data.DataCache;
+import com.yami.trading.huobi.data.internal.DataDBService;
 import com.yami.trading.service.item.ItemService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -30,6 +31,8 @@
 public class RealtimePushJob implements Runnable {
     @Autowired
     private ItemService itemService;
+    @Autowired
+    DataDBService dataDBService;
 
     public void start() {
         new Thread(this, "realtimePushJob").start();
@@ -114,7 +117,7 @@
         map.put("timestamp", realtime.getTs());
         map.put("current_time", realtime.getCurrentTime());
         map.put("name", realtime.getName());
-        map.put("change_ratio", realtime.getChangeRatio());
+        map.put("change_ratio", dataDBService.getChangeRatio(realtime, symbol));
         map.put("netChange", realtime.getNetChange());
         map.put("open", realtime.getOpen());
         map.put("close", realtime.getClose());
@@ -122,9 +125,16 @@
         map.put("low", realtime.getLow());
 
         BigDecimal currentValue = AdjustmentValueCache.getCurrentValue().get(symbol);
-        if (currentValue != null) {
+        /*if (currentValue != null) {
             map.put("low", realtime.getLow().add(currentValue));
         }
+        if (currentValue != null) {
+            BigDecimal newLow = realtime.getLow().add(currentValue);
+            if (newLow.compareTo(realtime.getHigh()) > 0) {
+                map.put("high", realtime.getHigh().add(currentValue));
+            }
+            map.put("low", newLow);
+        }*/
 
         if( realtime.getVolume() != null){
             map.put("volume", realtime.getVolume().setScale(2, RoundingMode.HALF_UP));
@@ -146,7 +156,7 @@
         }
         if(Item.forex.equalsIgnoreCase(bySymbol.getType())){
              market = new StockMarket();
-             market.setTime_zone( "Asia/Shanghai");
+             market.setTime_zone( "Asia/Tokyo");
              if(MarketOpenChecker.isMarketOpenByItemCloseType(bySymbol.getOpenCloseType())){
                  market.setStatus("交易中");
              }else{
@@ -171,9 +181,13 @@
                 map.put("high", high != null ? high.setScale(decimal, RoundingMode.HALF_UP) : null);
                 BigDecimal low = realtime.getLow();
                 map.put("low", low != null ? low.setScale(decimal, RoundingMode.HALF_UP) : null);
-                if (currentValue != null) {
-                    map.put("low", low != null ? low.add(currentValue).setScale(decimal, RoundingMode.HALF_UP) : null);
-                }
+                /*if (currentValue != null) {
+                    BigDecimal newLow = low != null ? low.add(currentValue).setScale(decimal, RoundingMode.HALF_UP) : BigDecimal.ZERO;
+                    if (newLow.compareTo(high) > 0) {
+                        map.put("high", high.add(currentValue).setScale(decimal, RoundingMode.HALF_UP));
+                    }
+                    map.put("low", newLow);
+                }*/
 
             }
         }

--
Gitblit v1.9.3