|
@@ -27,7 +27,6 @@ import java.util.stream.Collectors;
|
|
|
public class CacheContext implements CommandLineRunner {
|
|
|
Logger logger = LoggerFactory.getLogger(CacheContext.class);
|
|
|
|
|
|
- private final String QS = "0";
|
|
|
|
|
|
@Resource
|
|
|
private ProBasicEquipmentService proBasicEquipmentService;
|
|
@@ -49,20 +48,49 @@ public class CacheContext implements CommandLineRunner {
|
|
|
private ProBasicWeatherStationService proBasicWeatherStationService;
|
|
|
|
|
|
@Resource
|
|
|
+ private IProBasicCompanyService proBasicCompanyService;
|
|
|
+ @Resource
|
|
|
+ private IProBasicRegionService proBasicRegionService;
|
|
|
+ @Resource
|
|
|
+ private IProBasicEnergyGroupService proBasicEnergyGroupService;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private ProBasicPowerstationPointService proBasicPowerstationPointService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private ProBasicEquipmentPointService proBasicEquipmentPointService;
|
|
|
+
|
|
|
+
|
|
|
+ @Resource
|
|
|
private ProBasicPowerstationService windpowerstationService;
|
|
|
|
|
|
- public static List<ProBasicEquipment> wtls = new ArrayList<>();
|
|
|
|
|
|
+ public static List<ProBasicEquipment> wtls = new ArrayList<>();
|
|
|
public static List<ProBasicWeatherStation> weawpls = new ArrayList<>();
|
|
|
public static List<ProBasicPowerstation> wpls = new ArrayList<>();
|
|
|
public static List<ProBasicPowerstation> wplsf = new ArrayList<>();
|
|
|
public static List<ProBasicPowerstation> wplsG = new ArrayList<>(); //光电集合
|
|
|
public static List<ProBasicPowerstation> zwpls = new ArrayList<>();
|
|
|
+ public static List<ProBasicCompany> cpls = new ArrayList<>();
|
|
|
+ public static List<ProBasicCompany> cpls1 = new ArrayList<>();
|
|
|
+ public static List<ProBasicRegion> rgls = new ArrayList<>();
|
|
|
+ public static List<ProBasicEnergyGroup> gpls = new ArrayList<>();
|
|
|
+ public static List<ProBasicPowerstationPoint> powerpointls = new ArrayList<>();
|
|
|
+ public static List<ProBasicEquipmentPoint> Equipmentpointls = new ArrayList<>();
|
|
|
+
|
|
|
+ public static Map<String, ProBasicRegion> rgmap = new HashMap<>();
|
|
|
+ public static Map<String, ProBasicCompany> cpmap = new HashMap<>();
|
|
|
+ public static Map<String, ProBasicEnergyGroup> gpmap = new HashMap<>();
|
|
|
|
|
|
- public static Map<String, List<ProBasicPowerstation>> rgwpmap = new HashMap<>();
|
|
|
public static Map<String, List<ProBasicPowerstation>> cpwpmap = new HashMap<>();
|
|
|
public static Map<String, List<ProBasicPowerstation>> wpmapls = new HashMap<>();
|
|
|
+ public static Map<String, List<ProBasicPowerstation>> stationls = new HashMap<>();
|
|
|
+ public static Map<String, List<ProBasicCompany>> rgcpmap = new HashMap<>();
|
|
|
public static Map<String, ProBasicPowerstation> wpmap = new HashMap<>();
|
|
|
+
|
|
|
public static Map<String, List<ProBasicEquipment>> wpwtmap = new HashMap<>();
|
|
|
public static Map<String, List<ProBasicEquipment>> pjwtmap = new HashMap<>();
|
|
|
public static Map<String, List<ProBasicEquipment>> lnwtmap = new HashMap<>();
|
|
@@ -70,11 +98,24 @@ public class CacheContext implements CommandLineRunner {
|
|
|
public static Map<String, List<ProBasicEquipment>> rgwtlsmap = new HashMap<>();
|
|
|
public static Map<String, Map<String, ProBasicEquipment>> cmwtmap = new HashMap<>();
|
|
|
public static Map<String, List<ProBasicEquipment>> sqwtmap = new HashMap<>();
|
|
|
+ public static Map<String, Map<String, ProBasicEquipmentPoint>> bnAimap = new HashMap<>();
|
|
|
public static Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = new HashMap<>();// 风电机测点AI表
|
|
|
+ public static Map<String, Map<String, ProBasicEquipmentPoint>> wtpointmap = new HashMap<>();//风机测点
|
|
|
+ public static Map<String, Map<String, ProBasicPowerstationPoint>> linepointmap = new HashMap<>();
|
|
|
+ // public static Map<String,Map<String, ProBasicPowerstationPoint>> lnPointmap =new HashMap<>();//线路测点
|
|
|
+ public static Map<String, Map<String, ProBasicPowerstationPoint>> propointmap = new HashMap<>();
|
|
|
+ // public static Map<String,Map<String, ProBasicPowerstationPoint>> pjPointmap =new HashMap<>(); //期次测点
|
|
|
public static Map<String, Map<String, ProBasicPowerstationPoint>> wppointmap = new HashMap<>();
|
|
|
+ // public static Map<String,Map<String, ProBasicPowerstationPoint>> pointwpmap =new HashMap<>();
|
|
|
+ public static Map<String, Map<String, ProBasicPowerstationPoint>> subwppointmap = new HashMap<>();
|
|
|
public static Map<String, Map<String, ProBasicPowerstationPoint>> weatherwppointmap = new HashMap<>();
|
|
|
+ public static Map<String, Map<String, ProBasicPowerstationPoint>> companypointmap = new HashMap<>();
|
|
|
+ public static Map<String, Map<String, ProBasicPowerstationPoint>> regionpointmap = new HashMap<>();
|
|
|
+ public static Map<String, Map<String, ProBasicPowerstationPoint>> grouppointmap = new HashMap<>();
|
|
|
|
|
|
+ public static Map<String, Map<Double, Double>> zbzglMap = new HashMap<>();
|
|
|
public static Map<String, ProEconEquipmentmodel> modelMap = new HashMap<>();
|
|
|
+ public static Map<String, Map<Double, Double>> zzsglMap = new HashMap<>();
|
|
|
public static Map<String, Double> modelpower = new HashMap<>();
|
|
|
|
|
|
public static Map<String, String> wtstandardmap = new HashMap<>();
|
|
@@ -89,6 +130,7 @@ public class CacheContext implements CommandLineRunner {
|
|
|
public static Map<String, List<ProBasicEquipment>> subWtsMap = new HashMap<>();
|
|
|
|
|
|
|
|
|
+
|
|
|
public static List<ProBasicPowerstation> stations = new ArrayList<>();
|
|
|
public static Map<String,ProBasicPowerstation> wpmaps = new HashMap<>();
|
|
|
public static Map<String,String> wppmap = new HashMap<>();
|
|
@@ -97,6 +139,26 @@ public class CacheContext implements CommandLineRunner {
|
|
|
public void run(String... args) throws Exception {
|
|
|
logger.info("缓存开始------------------------------------------------------------");
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+// bnls = proBasicBranchService.list();
|
|
|
+// bnls.stream().forEach(bn->{
|
|
|
+// String bnString = redisService.get(bn.getId());
|
|
|
+// Map<String, ProBasicEquipmentPoint> stringWindturbinetestingpointnewMap = JSONObject.parseObject(bnString, new TypeReference<Map<String, ProBasicEquipmentPoint>>() {
|
|
|
+// });
|
|
|
+// bnAimap.put(bn.getId(),stringWindturbinetestingpointnewMap);
|
|
|
+//
|
|
|
+// if (wtbnmap.containsKey(bn.getInteverId())){
|
|
|
+// wtbnmap.get(bn.getInteverId()).add(bn);
|
|
|
+// }else {
|
|
|
+// List<ProBasicBranch> bns = new ArrayList<>();
|
|
|
+// bns.add(bn);
|
|
|
+// wtbnmap.put(bn.getInteverId(),bns);
|
|
|
+// }
|
|
|
+// });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
equipmentmodels = proEconEquipmentmodelService.list();
|
|
|
equipmentmodels.stream().forEach(e -> {
|
|
|
modelMap.put(e.getId(), e);
|
|
@@ -119,25 +181,112 @@ public class CacheContext implements CommandLineRunner {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ cpls = proBasicCompanyService.list().stream().filter(i -> i.getIsAble().equals(1)).collect(Collectors.toList());
|
|
|
|
|
|
- for (ProBasicPowerstation wp : wpls) {
|
|
|
- if (cpwpmap.containsKey(wp.getCompanyId())) {
|
|
|
- cpwpmap.get(wp.getCompanyId()).add(wp);
|
|
|
- } else {
|
|
|
- List<ProBasicPowerstation> wps = new ArrayList<>();
|
|
|
- wps.add(wp);
|
|
|
- cpwpmap.put(wp.getCompanyId(), wps);
|
|
|
+ cpls1 = proBasicCompanyService.list().stream().filter(i -> i.getSpare2().equals("1")).collect(Collectors.toList());
|
|
|
+ if (!cpls.isEmpty()) {
|
|
|
+ for (ProBasicCompany sq : cpls) {
|
|
|
+ cpmap.put(sq.getId(), sq);
|
|
|
+
|
|
|
+ if (redisService.hasKey(sq.getId() + "0")) {
|
|
|
+ String cp0String = redisService.get(sq.getId() + "0");
|
|
|
+ Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(cp0String, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
+ });
|
|
|
+ companypointmap.put(sq.getId() + "0", stringWindpowerstationpointnewMap);
|
|
|
+ }
|
|
|
+ if (redisService.hasKey(sq.getId() + "-1")) {
|
|
|
+ String cp1String = redisService.get(sq.getId() + "-1");
|
|
|
+ Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(cp1String, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
+ });
|
|
|
+ companypointmap.put(sq.getId() + "-1", stringWindpowerstationpointnewMap);
|
|
|
+ }
|
|
|
+ if (redisService.hasKey(sq.getId() + "-2")) {
|
|
|
+ String cp2String = redisService.get(sq.getId() + "-2");
|
|
|
+ Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(cp2String, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
+ });
|
|
|
+ companypointmap.put(sq.getId() + "-2", stringWindpowerstationpointnewMap);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ rgls = proBasicRegionService.list().stream().filter(i -> i.getIsAble() == 1).collect(Collectors.toList());
|
|
|
+
|
|
|
+
|
|
|
+ if (!rgls.isEmpty()) {
|
|
|
+ for (ProBasicRegion sq : rgls) {
|
|
|
+ rgmap.put(sq.getId(), sq);
|
|
|
+
|
|
|
+ if (redisService.hasKey(sq.getId() + "0")) {
|
|
|
+ String cp0String = redisService.get(sq.getId() + "0");
|
|
|
+ Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(cp0String, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
+ });
|
|
|
+ regionpointmap.put(sq.getId() + "0", stringWindpowerstationpointnewMap);
|
|
|
+ }
|
|
|
+ if (redisService.hasKey(sq.getId() + "-1")) {
|
|
|
+ String cp1String = redisService.get(sq.getId() + "-1");
|
|
|
+ Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(cp1String, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
+ });
|
|
|
+ regionpointmap.put(sq.getId() + "-1", stringWindpowerstationpointnewMap);
|
|
|
+ }
|
|
|
+ if (redisService.hasKey(sq.getId() + "-2")) {
|
|
|
+ String cp2String = redisService.get(sq.getId() + "-2");
|
|
|
+ Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(cp2String, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
+ });
|
|
|
+ regionpointmap.put(sq.getId() + "-2", stringWindpowerstationpointnewMap);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ List<ProBasicEnergyGroup> energyGroups = proBasicEnergyGroupService.list();
|
|
|
+ gpls = energyGroups.stream().filter(e -> e.getIsAble() == 1 && e.getId().endsWith("FGS")).collect(Collectors.toList());
|
|
|
+
|
|
|
+ if (!gpls.isEmpty()) {
|
|
|
+ for (ProBasicEnergyGroup gp : gpls) {
|
|
|
+ gpmap.put(gp.getId(), gp);
|
|
|
+
|
|
|
+ if (redisService.hasKey(gp.getId() + "0")) {
|
|
|
+ String cp0String = redisService.get(gp.getId() + "0");
|
|
|
+ Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(cp0String, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
+ });
|
|
|
+ grouppointmap.put(gp.getId() + "0", stringWindpowerstationpointnewMap);
|
|
|
+ }
|
|
|
+ if (redisService.hasKey(gp.getId() + "-1")) {
|
|
|
+ String cp1String = redisService.get(gp.getId() + "-1");
|
|
|
+ Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(cp1String, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
+ });
|
|
|
+ grouppointmap.put(gp.getId() + "-1", stringWindpowerstationpointnewMap);
|
|
|
+ }
|
|
|
+ if (redisService.hasKey(gp.getId() + "-2")) {
|
|
|
+ String cp2String = redisService.get(gp.getId() + "-2");
|
|
|
+ Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(cp2String, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
+ });
|
|
|
+ grouppointmap.put(gp.getId() + "-2", stringWindpowerstationpointnewMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ for (ProBasicCompany cp : cpls) {
|
|
|
+ if (rgcpmap.containsKey(cp.getRegionId())) {
|
|
|
+ rgcpmap.get(cp.getRegionId()).add(cp);
|
|
|
+ } else {
|
|
|
+ List<ProBasicCompany> wps = new ArrayList<>();
|
|
|
+ wps.add(cp);
|
|
|
+ rgcpmap.put(cp.getRegionId(), wps);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
for (ProBasicPowerstation wp : wpls) {
|
|
|
- if (rgwpmap.containsKey(wp.getRegionId())) {
|
|
|
- rgwpmap.get(wp.getRegionId()).add(wp);
|
|
|
+ if (cpwpmap.containsKey(wp.getCompanyId())) {
|
|
|
+ cpwpmap.get(wp.getCompanyId()).add(wp);
|
|
|
} else {
|
|
|
List<ProBasicPowerstation> wps = new ArrayList<>();
|
|
|
wps.add(wp);
|
|
|
- rgwpmap.put(wp.getRegionId(), wps);
|
|
|
+ cpwpmap.put(wp.getCompanyId(), wps);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -256,6 +405,9 @@ public class CacheContext implements CommandLineRunner {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
weawpls = proBasicWeatherStationService.list().stream().filter(i -> i.getIsAble() == 1).collect(Collectors.toList());
|
|
|
weawpls.stream().forEach(weather -> {
|
|
|
|
|
@@ -266,6 +418,9 @@ public class CacheContext implements CommandLineRunner {
|
|
|
|
|
|
|
|
|
});
|
|
|
+ //线路
|
|
|
+
|
|
|
+
|
|
|
|
|
|
zwpls = proBasicWindpowerstationService.list().stream().filter(i -> i.getIsAble() == 1).collect(Collectors.toList());
|
|
|
QueryWrapper<ProBasicPowerstation> queryWpWrapper = new QueryWrapper<>();
|
|
@@ -284,6 +439,7 @@ public class CacheContext implements CommandLineRunner {
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
wpls.stream().forEach(wp -> {
|
|
|
|
|
|
wpmap.put(wp.getId(), wp);
|
|
@@ -312,15 +468,70 @@ public class CacheContext implements CommandLineRunner {
|
|
|
wpmapls.put(wp.getId(), ls);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+// if(wp.getWindType().equals(-1) && wp.getWindType().equals(-2)){
|
|
|
+// List<ProBasicPowerstation> ls = stationls.get(wp.getWindType());
|
|
|
+// stationls.put(wp.getWindType()+QS,ls);
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
wpmap.put(wp.getId(), wp);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+// Map<String,ProBasicPowerstationPoint> items=null;
|
|
|
+// powerpointls = proBasicPowerstationPointService.list().stream().filter(i ->i.getId() != null).collect(Collectors.toList());
|
|
|
+// if(powerpointls!=null && !powerpointls.isEmpty()){
|
|
|
+// for(int i=0;i<powerpointls.size();i++){
|
|
|
+//
|
|
|
+// if(pjmap.containsKey(powerpointls.get(i).getWindpowerstationId()))
|
|
|
+// {
|
|
|
+// ProBasicPowerstationPoint point=powerpointls.get(i);
|
|
|
+// if(pjPointmap.containsKey(point.getWindpowerstationId())){
|
|
|
+// items=pjPointmap.get(point.getWindpowerstationId());
|
|
|
+// items.put(point.getUniformCode(), point);
|
|
|
+// }
|
|
|
+// else{
|
|
|
+// items=new HashMap<String,ProBasicPowerstationPoint>();
|
|
|
+// pjPointmap.put(point.getWindpowerstationId(), items);
|
|
|
+// items.put(point.getUniformCode(), point);
|
|
|
+// }
|
|
|
+// }else if(lnmap.containsKey(powerpointls.get(i).getWindpowerstationId()))
|
|
|
+// {
|
|
|
+// ProBasicPowerstationPoint point=powerpointls.get(i);
|
|
|
+// if(lnPointmap.containsKey(point.getWindpowerstationId())){
|
|
|
+// items=lnPointmap.get(point.getWindpowerstationId());
|
|
|
+// items.put(point.getUniformCode(), point);
|
|
|
+// }
|
|
|
+// else{
|
|
|
+// items=new HashMap<String,ProBasicPowerstationPoint>();
|
|
|
+// lnPointmap.put(point.getWindpowerstationId(), items);
|
|
|
+// items.put(point.getUniformCode(), point);
|
|
|
+// }
|
|
|
+// }else
|
|
|
+// {
|
|
|
+// ProBasicPowerstationPoint point = powerpointls.get(i);
|
|
|
+// if(pointwpmap.containsKey(point.getWindpowerstationId())){
|
|
|
+// items=pointwpmap.get(point.getWindpowerstationId());
|
|
|
+// items.put(point.getUniformCode(), point);
|
|
|
+// }
|
|
|
+// else{
|
|
|
+// items=new HashMap<String,ProBasicPowerstationPoint>();
|
|
|
+// pointwpmap.put(point.getWindpowerstationId(), items);
|
|
|
+// items.put(point.getUniformCode(), point);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
stations = windpowerstationService.list();
|
|
|
for (ProBasicPowerstation station : stations) {
|
|
|
wppmap.put(station.getId(),station.getName());
|
|
|
wpmaps.put(station.getId(),station);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
logger.info("缓存结束------------------------------------------------------------");
|
|
|
}
|
|
|
}
|