新版仿ok交易所-后端
zyy
2025-10-20 b1e9cbcebcc1f8e396da285d8ae93bd6523be128
trading-order-admin/src/main/java/com/yami/trading/admin/task/RealtimeWebsocketServer.java
@@ -4,6 +4,7 @@
import com.yami.trading.bean.data.domain.Realtime;
import com.yami.trading.bean.data.domain.Trade;
import com.yami.trading.bean.item.domain.Item;
import com.yami.trading.common.exception.YamiShopBindException;
import com.yami.trading.common.util.Arith;
import com.yami.trading.huobi.data.AdjustmentValueCache;
import com.yami.trading.huobi.data.DataCache;
@@ -91,6 +92,10 @@
         Item item = itemService.findBySymbol(symbol);
         symbol = item.getSymbol();
         item = this.itemService.findBySymbol(symbol);
         //停牌时不更新
         if (itemService.isSuspended(symbol)) {
            return;
         }
         Double currentValue = AdjustmentValueCache.getCurrentValue().get(symbol).doubleValue();
         double close = event.getTicker().getClose().doubleValue();
         double vol = event.getTicker().getVol().doubleValue();
@@ -108,8 +113,8 @@
         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.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);
@@ -138,11 +143,14 @@
               realtime.setLow(new BigDecimal(low));
            }
            Double h24Before = DataCache.getRealtime24HBeforeOpen().get(symbol);
            /*ouble h24Before = DataCache.getRealtime24HBeforeOpen().get(symbol);
            if (h24Before != null) {
               realtime.setOpen(new BigDecimal(h24Before));
            }
            }*/
            /*if (realtime.getSymbol().equals("galausdt")) {
               System.out.println("galausdt222" + realtime);
            }*/
            DataCache.putRealtime(symbol, realtime);
            // System.out.println(JSONObject.toJSONString(realtime));
         }