skyline 1 anno fa
parent
commit
ed0004f1e3

+ 5 - 3
service/src/main/java/com/kym/service/cache/KymCache.java

@@ -15,7 +15,6 @@ import com.kym.service.admin.StationService;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.context.event.ApplicationStartedEvent;
 import org.springframework.context.ApplicationListener;
-import org.springframework.data.redis.core.SetOperations;
 import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.stereotype.Component;
 
@@ -184,7 +183,6 @@ public enum KymCache {
         private final ConnectorInfoService connectorInfoService;
 
 
-
         @Value("${spring.profiles.active}")
         public String env;
 
@@ -222,7 +220,11 @@ public enum KymCache {
             // 缓存平台数据
             PlatformCache.INSTANCE.putPlatformName2Config(platformService.lambdaQuery().eq(Platform::getEnv, env).list().stream().collect(Collectors.toMap(Platform::getPlatformName, platform -> platform)));
             PlatformCache.INSTANCE.putConnectorId2PlatformName(equipmentRelations.stream().collect(Collectors.toMap(EquipmentRelation::getConnectorId, EquipmentRelation::getPlatformName)));
-            PlatformCache.INSTANCE.putStationId2PlatformName(equipmentRelations.stream().collect(Collectors.toMap(EquipmentRelation::getStationId, EquipmentRelation::getPlatformName)));
+//            PlatformCache.INSTANCE.putStationId2PlatformName(equipmentRelations.stream().collect(Collectors.toMap(EquipmentRelation::getStationId, EquipmentRelation::getPlatformName)));
+            var stationList = List.of("1657", "1889", "1897", "1959", "1966", "1997", "2042", "2064", "2144", "2156", "2191", "2041");
+            stationList.forEach(stationId -> {
+                PlatformCache.INSTANCE.putStationId2PlatformName(Map.of(stationId, "EN_PLUS"));
+            });
 
             DynamicDataSourceContextHolder.poll();
         }