瀏覽代碼

bug修复

xujuanning 2 月之前
父節點
當前提交
d4242b40db

+ 45 - 44
generationXK-service/src/main/java/com/gyee/generation/service/initalcache/CacheService.java

@@ -133,36 +133,37 @@ public class CacheService {
                     redisService.set(i.getId(),s);
                 });
 
-        //        log.info("--------------------------redisSubWP");
-        //        redisService.select(9);
-        //        List<ProBasicSubStation> subStationList = subStationService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
-        //        subStationList.stream().forEach(i->{
-        //            Map<String, ProBasicSubStationTestpoint> codeaimap = new HashMap<>();
-        //            QueryWrapper<ProBasicSubStationTestpoint> qw = new QueryWrapper<>();
-        //            qw.eq("windpowerstation_id",i.getId());
-        //            List<ProBasicSubStationTestpoint> windpowerstationtestingpoint2List = proBasicSubStationTestpointService.list(qw);
-        //            windpowerstationtestingpoint2List.stream().forEach(x->{
-        //                codeaimap.put(x.getUniformCode(),x);
-        //            });
-        //            String s = JSONObject.toJSONString(codeaimap);
-        //            redisService.set(i.getId(),s);
-        //        });
-        //
-        //        log.info("--------------------------redisWeatherWP");
-        //        List<ProBasicWeatherStation> weatherStationList = proBasicWeatherStationService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
-        //        weatherStationList.stream().forEach(i->{
-        //            Map<String, ProBasicPowerstationPoint> codeaimap = new HashMap<>();
-        //            QueryWrapper<ProBasicPowerstationPoint> qw = new QueryWrapper<>();
-        //            qw.eq("windpowerstation_id",i.getId());
-        //            List<ProBasicPowerstationPoint> windpowerstationtestingpoint2List = windpowerstationpointnewService.list(qw);
-        //            windpowerstationtestingpoint2List.stream().forEach(x->{
-        //                codeaimap.put(x.getUniformCode(),x);
-        //            });
-        //            String s = JSONObject.toJSONString(codeaimap);
-        //            redisService.set(i.getId(),s);
-        //        });
-        //
-        //        log.info("--------------------------redisWP");
+                log.info("--------------------------redisSubWP");
+                redisService.select(9);
+                List<ProBasicSubStation> subStationList = subStationService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
+                subStationList.stream().forEach(i->{
+                    Map<String, ProBasicSubStationTestpoint> codeaimap = new HashMap<>();
+                    QueryWrapper<ProBasicSubStationTestpoint> qw = new QueryWrapper<>();
+//                    qw.eq("windpowerstation_id",i.getId());
+                    qw.eq("windpowerstation_id",i.getId());
+                    List<ProBasicSubStationTestpoint> windpowerstationtestingpoint2List = proBasicSubStationTestpointService.list(qw);
+                    windpowerstationtestingpoint2List.stream().forEach(x->{
+                        codeaimap.put(x.getUniformCode(),x);
+                    });
+                    String s = JSONObject.toJSONString(codeaimap);
+                    redisService.set(i.getId(),s);
+                });
+
+                log.info("--------------------------redisWeatherWP");
+                List<ProBasicWeatherStation> weatherStationList = proBasicWeatherStationService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
+                weatherStationList.stream().forEach(i->{
+                    Map<String, ProBasicPowerstationPoint> codeaimap = new HashMap<>();
+                    QueryWrapper<ProBasicPowerstationPoint> qw = new QueryWrapper<>();
+                    qw.eq("windpowerstation_id",i.getId());
+                    List<ProBasicPowerstationPoint> windpowerstationtestingpoint2List = windpowerstationpointnewService.list(qw);
+                    windpowerstationtestingpoint2List.stream().forEach(x->{
+                        codeaimap.put(x.getUniformCode(),x);
+                    });
+                    String s = JSONObject.toJSONString(codeaimap);
+                    redisService.set(i.getId(),s);
+                });
+
+                log.info("--------------------------redisWP");
                 List<ProBasicPowerstation> wpList = windpowerstationService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
 
                 wpList.stream().forEach(i->{
@@ -239,20 +240,20 @@ public class CacheService {
         //            redisService.set(i,s);
         //        });
         //        redisService.select(9);
-        //        log.info("--------------------------redis理论保证功率");
-        //        Map<String, Map<Double, ProBasicModelPowerRd>> powerrdMap = new HashMap<>();
-        //
-        //        List<ProBasicModelPowerRd> proBasicModelPowerRds = proBasicModelPowerRdService.list();
-        //        proBasicModelPowerRds.stream().forEach(powerrd->{
-        //            if (powerrdMap.containsKey(powerrd.getModelId())){
-        //                powerrdMap.get(powerrd.getModelId()).put(powerrd.getSpeed(),powerrd);
-        //            }else {
-        //                Map<Double,ProBasicModelPowerRd> powerMap = new HashMap<>();
-        //                powerMap.put(powerrd.getSpeed(),powerrd);
-        //                powerrdMap.put(powerrd.getModelId(),powerMap);
-        //            }
-        //        });
-        //        redisService.set("ZLLGL", JSONObject.toJSONString(powerrdMap));
+                log.info("--------------------------redis理论保证功率");
+                Map<String, Map<Double, ProBasicModelPowerRd>> powerrdMap = new HashMap<>();
+
+                List<ProBasicModelPowerRd> proBasicModelPowerRds = proBasicModelPowerRdService.list();
+                proBasicModelPowerRds.stream().forEach(powerrd->{
+                    if (powerrdMap.containsKey(powerrd.getModelId())){
+                        powerrdMap.get(powerrd.getModelId()).put(powerrd.getSpeed(),powerrd);
+                    }else {
+                        Map<Double,ProBasicModelPowerRd> powerMap = new HashMap<>();
+                        powerMap.put(powerrd.getSpeed(),powerrd);
+                        powerrdMap.put(powerrd.getModelId(),powerMap);
+                    }
+                });
+                redisService.set("ZLLGL", JSONObject.toJSONString(powerrdMap));
 
                 log.info("--------------------------redis十三种状态");
         Map<String, List<ProBasicStatusPoint>> sszztMap = new HashMap<>();