|
@@ -30,6 +30,7 @@ public class InitialRunner implements CommandLineRunner {
|
|
GyeeConfig config;
|
|
GyeeConfig config;
|
|
@Resource
|
|
@Resource
|
|
private WindturbineService windturbineService;
|
|
private WindturbineService windturbineService;
|
|
|
|
+
|
|
@Resource
|
|
@Resource
|
|
private WindpowerstationService windpowerstationService;
|
|
private WindpowerstationService windpowerstationService;
|
|
@Resource
|
|
@Resource
|
|
@@ -46,6 +47,8 @@ public class InitialRunner implements CommandLineRunner {
|
|
* 场站所有信息
|
|
* 场站所有信息
|
|
**/
|
|
**/
|
|
public static List<Windpowerstation> wpList = new ArrayList<>();
|
|
public static List<Windpowerstation> wpList = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* <MHS_FDC, 麻黄山风电场>
|
|
* <MHS_FDC, 麻黄山风电场>
|
|
**/
|
|
**/
|
|
@@ -102,22 +105,115 @@ public class InitialRunner implements CommandLineRunner {
|
|
/** key: NG01_01, speed, power**/
|
|
/** key: NG01_01, speed, power**/
|
|
public static Map<String, Map<Double, Double>> zsllglMap = new HashMap<>();
|
|
public static Map<String, Map<Double, Double>> zsllglMap = new HashMap<>();
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //--------------------------------------new-------------------------------------------
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private ProBasicEquipmentService proBasicEquipmentService;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private ProBasicPowerstationService proBasicPowerstationService ;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private ProBasicEquipmentPointService proBasicEquipmentPointService;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private ProEconEquipmentmodelService proEconEquipmentmodelService;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private ProBasicModelPowerService proBasicModelPowerService;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 场站所有信息
|
|
|
|
+ **/
|
|
|
|
+ public static List<ProBasicPowerstation> wpNewList = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * <MHS_FDC, 麻黄山风电场>
|
|
|
|
+ **/
|
|
|
|
+ public static Map<String, String> stationNewMap = new HashMap<>();
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 所有的风机
|
|
|
|
+ **/
|
|
|
|
+ public static List<ProBasicEquipment> wtNewList = new ArrayList<>();
|
|
|
|
+ /**
|
|
|
|
+ * key:wtId NG01_01
|
|
|
|
+ **/
|
|
|
|
+ public static Map<String, ProBasicEquipment> wtNewMap = new HashMap<>();
|
|
|
|
+
|
|
|
|
+ /**场站的风机 key:NSS_FDC**/
|
|
|
|
+ public static Map<String, List<ProBasicEquipment>> wpNewMap = new HashMap<>();
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 光伏
|
|
|
|
+ */
|
|
|
|
+ public static List<ProBasicPowerstation> gfwpNewList = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ public static Map<String, String> gfstationNewMap = new HashMap<>();
|
|
|
|
+ public static List<ProBasicEquipment> gfwtNewList = new ArrayList<>();
|
|
|
|
+ public static Map<String, ProBasicEquipment> gfwtNewMap = new HashMap<>();
|
|
|
|
+ public static Map<String, List<ProBasicEquipment>> gfwpNewMap = new HashMap<>();
|
|
|
|
+ /**
|
|
|
|
+ * 光照强度-场站
|
|
|
|
+ */
|
|
|
|
+ public static Map<String, ProBasicPowerstationPoint> zfsNewMap = new HashMap<>();
|
|
|
|
+ /**
|
|
|
|
+ * 组件温度-场站
|
|
|
|
+ */
|
|
|
|
+ public static Map<String, ProBasicPowerstationPoint> zjwdNewMap = new HashMap<>();
|
|
|
|
+ /**
|
|
|
|
+ * 功率-场站
|
|
|
|
+ */
|
|
|
|
+ public static Map<String, List<ProBasicEquipmentPoint>> zglNewMap = new HashMap<>();
|
|
|
|
+ /**
|
|
|
|
+ * 所有设备型号
|
|
|
|
+ **/
|
|
|
|
+ public static List<ProEconEquipmentmodel> equipmentNewList = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * key: NG01_01
|
|
|
|
+ **/
|
|
|
|
+ public static Map<String, List<ProBasicEquipmentPoint>> pointNewMap = new HashMap<>();
|
|
|
|
+ @Resource
|
|
|
|
+ public static Map<String, ProEconEquipmentmodel> equipmentNewMap = new HashMap<>();
|
|
|
|
+
|
|
|
|
+ /** key: NG01_01, speed, power**/
|
|
|
|
+ public static Map<String, Map<Double, Double>> zsllglNewMap = new HashMap<>();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //---------------------------------------------------------------------------------
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public void run(String... args) {
|
|
public void run(String... args) {
|
|
System.out.println(">>>>>>>>>>>>>>>服务启动,正在缓存数据<<<<<<<<<<<<<<");
|
|
System.out.println(">>>>>>>>>>>>>>>服务启动,正在缓存数据<<<<<<<<<<<<<<");
|
|
|
|
|
|
- cacheStation();
|
|
|
|
- cachePoints();
|
|
|
|
- cacheEquipment();
|
|
|
|
- // 耗时缓存
|
|
|
|
- new Thread(){
|
|
|
|
- @Override
|
|
|
|
- public void run() {
|
|
|
|
- super.run();
|
|
|
|
- cacheModelPower();
|
|
|
|
- cacheZSLLGL(null);
|
|
|
|
- }
|
|
|
|
- }.start();
|
|
|
|
|
|
+// cacheStation();
|
|
|
|
+// cachePoints();
|
|
|
|
+// cacheEquipment();
|
|
|
|
+// // 耗时缓存
|
|
|
|
+// new Thread(){
|
|
|
|
+// @Override
|
|
|
|
+// public void run() {
|
|
|
|
+// super.run();
|
|
|
|
+// cacheModelPower();
|
|
|
|
+// cacheZSLLGL(null);
|
|
|
|
+// }
|
|
|
|
+// }.start();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ cacheNewStation();
|
|
|
|
+ cacheNewPoints();
|
|
|
|
+ cacheNewEquipment();
|
|
|
|
|
|
System.out.println(">>>>>>>>>>>>>>>数据缓存完成<<<<<<<<<<<<<<");
|
|
System.out.println(">>>>>>>>>>>>>>>数据缓存完成<<<<<<<<<<<<<<");
|
|
}
|
|
}
|
|
@@ -149,6 +245,28 @@ public class InitialRunner implements CommandLineRunner {
|
|
log.info("场站数据缓存完成");
|
|
log.info("场站数据缓存完成");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 缓存场站、风机数据
|
|
|
|
+ * 数据新增或删除后需要更新,故每次清空
|
|
|
|
+ */
|
|
|
|
+ public void cacheNewStation() {
|
|
|
|
+ List<ProBasicPowerstation> stations = proBasicPowerstationService.list();
|
|
|
|
+ wpNewList = stations.stream().filter(f -> f.getId().contains("FDC")).collect(Collectors.toList());
|
|
|
|
+ wpNewList.forEach(obj -> {
|
|
|
|
+ List<ProBasicEquipment> wts =proBasicEquipmentService.list().stream().filter(w -> w.getWindpowerstationId().equals(obj.getId())).collect(Collectors.toList());;
|
|
|
|
+ stationNewMap.put(obj.getId(), obj.getName());
|
|
|
|
+ wpNewMap.put(obj.getId(), wts);
|
|
|
|
+ wtNewList.addAll(wts);
|
|
|
|
+
|
|
|
|
+ wts.forEach(u -> wtNewMap.put(u.getId(), u));
|
|
|
|
+ });
|
|
|
|
+ log.info("场站数据缓存完成");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 缓存测点数据
|
|
* 缓存测点数据
|
|
*/
|
|
*/
|
|
@@ -161,6 +279,20 @@ public class InitialRunner implements CommandLineRunner {
|
|
log.error("cachePoints", "测点数据缓存失败");
|
|
log.error("cachePoints", "测点数据缓存失败");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 缓存测点数据
|
|
|
|
+ */
|
|
|
|
+ private void cacheNewPoints() {
|
|
|
|
+ List<ProBasicEquipmentPoint> list = new ArrayList<>();
|
|
|
|
+ wpNewList.stream().forEach(d -> list.addAll(proBasicEquipmentPointService.selectList(d.getId(), config.getPoints())));
|
|
|
|
+ pointNewMap.putAll(list.stream().collect(Collectors.groupingBy(u -> u.getWindturbineId())));
|
|
|
|
+ log.info("cachePoints: " + pointMap.size());
|
|
|
|
+ if (pointMap.size() == 0)
|
|
|
|
+ log.error("cachePoints", "测点数据缓存失败");
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 缓存设备型号
|
|
* 缓存设备型号
|
|
*/
|
|
*/
|
|
@@ -171,6 +303,17 @@ public class InitialRunner implements CommandLineRunner {
|
|
log.info("设备型号数据缓存完成");
|
|
log.info("设备型号数据缓存完成");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 缓存设备型号
|
|
|
|
+ */
|
|
|
|
+ private void cacheNewEquipment() {
|
|
|
|
+ equipmentNewList.addAll(proEconEquipmentmodelService.list());
|
|
|
|
+ for (ProEconEquipmentmodel eq : equipmentNewList)
|
|
|
|
+ equipmentNewMap.put(eq.getId(), eq);
|
|
|
|
+ log.info("设备型号数据缓存完成");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
private void cacheModelPower() {
|
|
private void cacheModelPower() {
|
|
List<Modelpowerdetails> lsMPD = modelpowerdetailsService.selectList();
|
|
List<Modelpowerdetails> lsMPD = modelpowerdetailsService.selectList();
|
|
modelPowerDetailMap.putAll(lsMPD.stream().collect(Collectors.groupingBy(u -> u.getModelid())));
|
|
modelPowerDetailMap.putAll(lsMPD.stream().collect(Collectors.groupingBy(u -> u.getModelid())));
|
|
@@ -193,4 +336,7 @@ public class InitialRunner implements CommandLineRunner {
|
|
log.info("自算功率数据缓存完成");
|
|
log.info("自算功率数据缓存完成");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|