| | |
| | | import com.yami.trading.huobi.data.TimeZoneConverterService; |
| | | import com.yami.trading.huobi.websocket.WebSocketServer; |
| | | import com.yami.trading.huobi.websocket.WebSocketSession; |
| | | import com.yami.trading.service.item.ItemPreMarketService; |
| | | import com.yami.trading.service.item.ItemService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | public class RealtimePushJob implements Runnable { |
| | | @Autowired |
| | | private ItemService itemService; |
| | | |
| | | @Autowired |
| | | private ItemPreMarketService itemPreMarketService; |
| | | |
| | | @Autowired |
| | | private TimeZoneConverterService timeZoneConverterService; |
| | |
| | | Realtime realtimeData = DataCache.getRealtime(symbol); |
| | | if (realtimeData == null) { |
| | | log.error("realtimeHandle 获取{} 数据为空", symbol); |
| | | } else if (itemPreMarketService != null) { |
| | | try { |
| | | Realtime copy = (Realtime) realtimeData.clone(); |
| | | realtimeData = itemPreMarketService.applyPreMarketPrice(copy); |
| | | } catch (CloneNotSupportedException e) { |
| | | log.warn("clone realtime failed, symbol={}", symbol, e); |
| | | } |
| | | } |
| | | this.realtimeRevise(realtimeResultMap, realtimeData, symbol); |
| | | } |