|
@@ -83,9 +83,20 @@ public class CacheContext implements CommandLineRunner {
|
|
|
private IProEconPowerstationInfoDay1Service proEconPowerstationInfoDay1Service;
|
|
|
|
|
|
public static List<ProBasicBranch> bnls = new ArrayList<>();
|
|
|
-
|
|
|
- public static List<ProBasicWeatherStation> weawpls = new ArrayList<>();
|
|
|
- public static List<ProBasicCompany> cpls1 = new ArrayList<>();
|
|
|
+ // public static List<ProBasicEquipment> wtls = new ArrayList<>();
|
|
|
+ // public static List<ProBasicProject> pjls = new ArrayList<>();
|
|
|
+ // public static List<ProBasicLine> lnls = new ArrayList<>();
|
|
|
+ // public static List<ProBasicSubStation> subwpls = new ArrayList<>();
|
|
|
+ public static List<ProBasicWeatherStation> weawpls = new ArrayList<>();
|
|
|
+ // public static List<ProBasicSquare> sqls = 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<ProBasicOrganizeTree> treels = new ArrayList<>();
|
|
|
public static List<ProBasicOrganizeTree> sqls = new ArrayList<>(); //阵区
|
|
@@ -93,6 +104,8 @@ public class CacheContext implements CommandLineRunner {
|
|
|
public static List<ProBasicOrganizeTree> rgls = new ArrayList<>();//区域
|
|
|
public static List<ProBasicOrganizeTree> gpls = new ArrayList<>();//集团
|
|
|
public static List<ProBasicOrganizeTree> wpls = new ArrayList<>();//场站
|
|
|
+ public static List<ProBasicOrganizeTree> gfwpls = new ArrayList<>();//光伏场站
|
|
|
+ public static List<ProBasicOrganizeTree> fdwpls = new ArrayList<>();//风电场站
|
|
|
public static List<ProBasicOrganizeTree> wtls = new ArrayList<>();//设备
|
|
|
public static List<ProBasicOrganizeTree> pjls = new ArrayList<>();//期次
|
|
|
public static List<ProBasicOrganizeTree> lnls = new ArrayList<>();
|
|
@@ -109,8 +122,8 @@ public class CacheContext implements CommandLineRunner {
|
|
|
public static Map<String,ProBasicOrganizeTree> rgmap = new HashMap<>();
|
|
|
public static Map<String,ProBasicOrganizeTree> gpmap = new HashMap<>();
|
|
|
public static Map<String, ProBasicOrganizeTree> wtmap = new HashMap<>();
|
|
|
- public static Map<String,ProBasicOrganizeTree> pjmap = new HashMap<>();
|
|
|
- public static Map<String,ProBasicOrganizeTree> lnmap = new HashMap<>();
|
|
|
+ public static Map<String, ProBasicOrganizeTree> pjmap = new HashMap<>();
|
|
|
+ public static Map<String, ProBasicOrganizeTree> lnmap = new HashMap<>();
|
|
|
public static Map<String, ProBasicOrganizeTree> wpmap = new HashMap<>();
|
|
|
public static Map<Object,List<ProBasicOrganizeTree>> rgcpmap = new HashMap<>();//区域子公司
|
|
|
public static Map<Object,List<ProBasicOrganizeTree>> cpwpmap = new HashMap<>();//公司场站
|
|
@@ -132,70 +145,73 @@ public class CacheContext implements CommandLineRunner {
|
|
|
public static Map<String,ProBasicMeterPoint> meterpointMap = 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, ProBasicPowerstationPoint>> linepointmap =new HashMap<>();
|
|
|
- public static Map<String,Map<String, ProBasicPowerstationPoint>> propointmap =new HashMap<>();
|
|
|
- public static Map<String,Map<String, ProBasicPowerstationPoint>> wppointmap =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<String, ProBasicPowerstationPoint>> linepointmap = new HashMap<>();
|
|
|
+ public static Map<String, Map<String, ProBasicPowerstationPoint>> propointmap = new HashMap<>();
|
|
|
+ public static Map<String, Map<String, ProBasicPowerstationPoint>> wppointmap = 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,ProEconEquipmentmodel> modelMap = new HashMap<>();
|
|
|
public static Map<String,Double> modelpower = new HashMap<>();
|
|
|
|
|
|
public static Map<String,Map<Double,ProBasicModelPower>> modelpowermap = new TreeMap<>();
|
|
|
|
|
|
- public static List<ProBasicModelPower> mpls=new ArrayList<>();
|
|
|
+ public static List<ProBasicModelPower> mpls = new ArrayList<>();
|
|
|
|
|
|
- public static List<ProEconEquipmentmodel> equipmentmodels=new ArrayList<>();
|
|
|
+ public static List<ProEconEquipmentmodel> equipmentmodels = new ArrayList<>();
|
|
|
|
|
|
public static List<ProBasicModelPowerRd> theoreticalPowerList=new ArrayList<>();
|
|
|
public static Map<String, Map<Double,ProBasicModelPowerRd>> theoreticalPowerMap = new HashMap<>(); //理论,保证功率
|
|
|
public static Map<String, Map<Double,ProEconWtPowerCurveFitting>> curveFittingPowerMap = new HashMap<>(); //自算,最优功率
|
|
|
public static Map<String,List<ProBasicStatusPoint>> statusMap = new HashMap<>();
|
|
|
+ public static List<ProBasicOrganizeTree> proBasicOrganizeTrees;
|
|
|
|
|
|
@Override
|
|
|
public void run(String... args) throws Exception {
|
|
|
logger.info("缓存开始------------------------------------------------------------");
|
|
|
-
|
|
|
+ proBasicOrganizeTrees = proBasicOrganizeTreeService.list();
|
|
|
+ proBasicOrganizeTrees = proBasicOrganizeTrees.stream().filter(pbot -> pbot.getIsAble() == 1).collect(Collectors.toList());
|
|
|
+ List<String> pbotids = proBasicOrganizeTrees.stream().map(pbot -> pbot.getId()).collect(Collectors.toList());
|
|
|
+ Map<String, Object> pbotidMap = redisService.batchGetKeys(pbotids);
|
|
|
|
|
|
bnls = proBasicBranchService.list();
|
|
|
- bnls.stream().forEach(bn->{
|
|
|
- String bnString = redisService.get(bn.getId());
|
|
|
+ List<String> bnlids = bnls.stream().map(bnl -> bnl.getId()).collect(Collectors.toList());
|
|
|
+ Map<String, Object> objectMap = redisService.batchGetKeys(bnlids);
|
|
|
+ bnls.stream().forEach(bn -> {
|
|
|
+ String bnString = (String) objectMap.get(bn.getId());
|
|
|
Map<String, ProBasicEquipmentPoint> stringWindturbinetestingpointnewMap = JSONObject.parseObject(bnString, new TypeReference<Map<String, ProBasicEquipmentPoint>>() {
|
|
|
});
|
|
|
- bnAimap.put(bn.getId(),stringWindturbinetestingpointnewMap);
|
|
|
+ bnAimap.put(bn.getId(), stringWindturbinetestingpointnewMap);
|
|
|
|
|
|
- if (wtbnmap.containsKey(bn.getInteverId())){
|
|
|
+ if (wtbnmap.containsKey(bn.getInteverId())) {
|
|
|
wtbnmap.get(bn.getInteverId()).add(bn);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
List<ProBasicBranch> bns = new ArrayList<>();
|
|
|
bns.add(bn);
|
|
|
- wtbnmap.put(bn.getInteverId(),bns);
|
|
|
+ wtbnmap.put(bn.getInteverId(), bns);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
equipmentmodels = proEconEquipmentmodelService.list();
|
|
|
- equipmentmodels.stream().forEach(e->{
|
|
|
- modelMap.put(e.getId(),e);
|
|
|
+ equipmentmodels.stream().forEach(e -> {
|
|
|
+ modelMap.put(e.getId(), e);
|
|
|
});
|
|
|
- mpls=proBasicModelPowerService.list();
|
|
|
+ mpls = proBasicModelPowerService.list();
|
|
|
mpls.sort(Comparator.comparing(ProBasicModelPower::getSpeed));
|
|
|
- if(!mpls.isEmpty())
|
|
|
- {
|
|
|
+ if (!mpls.isEmpty()) {
|
|
|
|
|
|
- for(ProBasicModelPower mp:mpls)
|
|
|
- {
|
|
|
- if(modelpowermap.containsKey(mp.getModelId()))
|
|
|
- {
|
|
|
- Map<Double,ProBasicModelPower> tempmap=modelpowermap.get(mp.getModelId());
|
|
|
- tempmap.put(mp.getSpeed(),mp);
|
|
|
-
|
|
|
- }else {
|
|
|
- Map<Double,ProBasicModelPower> tempmap=new HashMap<>();
|
|
|
- tempmap.put(mp.getSpeed(),mp);
|
|
|
- modelpowermap.put(mp.getModelId(),tempmap);
|
|
|
+ for (ProBasicModelPower mp : mpls) {
|
|
|
+ if (modelpowermap.containsKey(mp.getModelId())) {
|
|
|
+ Map<Double, ProBasicModelPower> tempmap = modelpowermap.get(mp.getModelId());
|
|
|
+ tempmap.put(mp.getSpeed(), mp);
|
|
|
+
|
|
|
+ } else {
|
|
|
+ Map<Double, ProBasicModelPower> tempmap = new HashMap<>();
|
|
|
+ tempmap.put(mp.getSpeed(), mp);
|
|
|
+ modelpowermap.put(mp.getModelId(), tempmap);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -242,23 +258,23 @@ public class CacheContext implements CommandLineRunner {
|
|
|
{
|
|
|
cpmap.put(sq.getId(),sq);
|
|
|
|
|
|
- if (redisService.hasKey(sq.getParentCode()+"0")){
|
|
|
- String cp0String = redisService.get(sq.getParentCode()+"0");
|
|
|
+ if (redisService.hasKey(sq.getParentCode() + "0")) {
|
|
|
+ String cp0String = redisService.get(sq.getParentCode() + "0");
|
|
|
Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(cp0String, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
});
|
|
|
- companypointmap.put(sq.getParentCode()+"0",stringWindpowerstationpointnewMap);
|
|
|
+ companypointmap.put(sq.getParentCode() + "0", stringWindpowerstationpointnewMap);
|
|
|
}
|
|
|
- if (redisService.hasKey(sq.getParentCode()+"-1")){
|
|
|
- String cp1String = redisService.get(sq.getParentCode()+"-1");
|
|
|
+ if (redisService.hasKey(sq.getParentCode() + "-1")) {
|
|
|
+ String cp1String = redisService.get(sq.getParentCode() + "-1");
|
|
|
Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(cp1String, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
});
|
|
|
- companypointmap.put(sq.getParentCode()+"-1",stringWindpowerstationpointnewMap);
|
|
|
+ companypointmap.put(sq.getParentCode() + "-1", stringWindpowerstationpointnewMap);
|
|
|
}
|
|
|
- if (redisService.hasKey(sq.getParentCode()+"-2")){
|
|
|
- String cp2String = redisService.get(sq.getParentCode()+"-2");
|
|
|
+ if (redisService.hasKey(sq.getParentCode() + "-2")) {
|
|
|
+ String cp2String = redisService.get(sq.getParentCode() + "-2");
|
|
|
Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(cp2String, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
});
|
|
|
- companypointmap.put(sq.getParentCode()+"-2",stringWindpowerstationpointnewMap);
|
|
|
+ companypointmap.put(sq.getParentCode() + "-2", stringWindpowerstationpointnewMap);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -266,77 +282,70 @@ public class CacheContext implements CommandLineRunner {
|
|
|
|
|
|
|
|
|
//区域树形
|
|
|
- rgls=proBasicOrganizeTreeService.list().stream().filter(i->i.getIsAble()==1 && i.getOrgType().contains("RGN")).collect(Collectors.toList());
|
|
|
- if (!rgls.isEmpty())
|
|
|
- {
|
|
|
- for(ProBasicOrganizeTree sq:rgls)
|
|
|
- {
|
|
|
- rgmap.put(sq.getId(),sq);
|
|
|
+ rgls = proBasicOrganizeTrees.stream().filter(i -> i.getOrgType().contains("RGN")).collect(Collectors.toList());
|
|
|
+ if (!rgls.isEmpty()) {
|
|
|
+ for (ProBasicOrganizeTree sq : rgls) {
|
|
|
+ rgmap.put(sq.getId(), sq);
|
|
|
|
|
|
- if (redisService.hasKey(sq.getId()+"0")){
|
|
|
- String cp0String = redisService.get(sq.getId()+"0");
|
|
|
+ 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);
|
|
|
+ regionpointmap.put(sq.getId() + "0", stringWindpowerstationpointnewMap);
|
|
|
}
|
|
|
- if (redisService.hasKey(sq.getId()+"-1")){
|
|
|
- String cp1String = redisService.get(sq.getId()+"-1");
|
|
|
+ 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);
|
|
|
+ regionpointmap.put(sq.getId() + "-1", stringWindpowerstationpointnewMap);
|
|
|
}
|
|
|
- if (redisService.hasKey(sq.getId()+"-2")){
|
|
|
- String cp2String = redisService.get(sq.getId()+"-2");
|
|
|
+ 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);
|
|
|
+ regionpointmap.put(sq.getId() + "-2", stringWindpowerstationpointnewMap);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
//集团树形
|
|
|
- List<ProBasicOrganizeTree> energyGroupList = proBasicOrganizeTreeService.list();
|
|
|
- gpls = energyGroupList.stream().filter(e->e.getIsAble()==1 && e.getOrgType().contains("JT")).collect(Collectors.toList());
|
|
|
+ gpls = proBasicOrganizeTrees.stream().filter(e -> e.getOrgType().contains("JT")).collect(Collectors.toList());
|
|
|
|
|
|
- if (!gpls.isEmpty())
|
|
|
- {
|
|
|
- for(ProBasicOrganizeTree gp:gpls)
|
|
|
- {
|
|
|
- gpmap.put(gp.getId(),gp);
|
|
|
+ if (!gpls.isEmpty()) {
|
|
|
+ for (ProBasicOrganizeTree gp : gpls) {
|
|
|
+ gpmap.put(gp.getId(), gp);
|
|
|
|
|
|
- if (redisService.hasKey(gp.getParentCode()+"0")){
|
|
|
- String cp0String = redisService.get(gp.getParentCode()+"0");
|
|
|
+ if (redisService.hasKey(gp.getParentCode() + "0")) {
|
|
|
+ String cp0String = redisService.get(gp.getParentCode() + "0");
|
|
|
Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(cp0String, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
});
|
|
|
- grouppointmap.put(gp.getParentCode()+"0",stringWindpowerstationpointnewMap);
|
|
|
+ grouppointmap.put(gp.getParentCode() + "0", stringWindpowerstationpointnewMap);
|
|
|
}
|
|
|
- if (redisService.hasKey(gp.getParentCode()+"-1")){
|
|
|
- String cp1String = redisService.get(gp.getParentCode()+"-1");
|
|
|
+ if (redisService.hasKey(gp.getParentCode() + "-1")) {
|
|
|
+ String cp1String = redisService.get(gp.getParentCode() + "-1");
|
|
|
Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(cp1String, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
});
|
|
|
- grouppointmap.put(gp.getParentCode()+"-1",stringWindpowerstationpointnewMap);
|
|
|
+ grouppointmap.put(gp.getParentCode() + "-1", stringWindpowerstationpointnewMap);
|
|
|
}
|
|
|
- if (redisService.hasKey(gp.getParentCode()+"-2")){
|
|
|
- String cp2String = redisService.get(gp.getParentCode()+"-2");
|
|
|
+ if (redisService.hasKey(gp.getParentCode() + "-2")) {
|
|
|
+ String cp2String = redisService.get(gp.getParentCode() + "-2");
|
|
|
Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(cp2String, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
});
|
|
|
- grouppointmap.put(gp.getParentCode()+"-2",stringWindpowerstationpointnewMap);
|
|
|
+ grouppointmap.put(gp.getParentCode() + "-2", stringWindpowerstationpointnewMap);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
//区域子公司树形
|
|
|
- for(ProBasicOrganizeTree cp:cpls)
|
|
|
- {
|
|
|
- if (rgcpmap.containsKey(cp.getOrgType().contains("RGN"))){
|
|
|
+ for (ProBasicOrganizeTree cp : cpls) {
|
|
|
+ if (rgcpmap.containsKey(cp.getOrgType().contains("RGN"))) {
|
|
|
rgcpmap.get(cp.getOrgType().contains("RGN")).add(cp);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
List<ProBasicOrganizeTree> wps = new ArrayList<>();
|
|
|
wps.add(cp);
|
|
|
- rgcpmap.put(cp.getOrgType().contains("RGN"),wps);
|
|
|
+ rgcpmap.put(cp.getOrgType().contains("RGN"), wps);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -345,128 +354,119 @@ public class CacheContext implements CommandLineRunner {
|
|
|
{
|
|
|
if (cpwpmap.containsKey(wp.getOrgType().contains("STA"))){
|
|
|
cpwpmap.get(wp.getOrgType().contains("STA")).add(wp);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
List<ProBasicOrganizeTree> wps = new ArrayList<>();
|
|
|
wps.add(wp);
|
|
|
- cpwpmap.put(wp.getOrgType().contains("STA"),wps);
|
|
|
+ cpwpmap.put(wp.getOrgType().contains("STA"), wps);
|
|
|
}
|
|
|
}
|
|
|
+ gfwpls = wpls.stream().filter(wpl -> "G".equals(wpl.getEleType())).collect(Collectors.toList());
|
|
|
+ fdwpls = wpls.stream().filter(wpl -> "F".equals(wpl.getEleType())).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//树形设备
|
|
|
- wtls = proBasicOrganizeTreeService.list().stream().filter(i->i.getIsAble()==1 && i.getId().endsWith("_EQ")).collect(Collectors.toList());
|
|
|
- logger.info(wtls.size()+"");
|
|
|
- wtls.forEach(wt->{
|
|
|
- if(modelMap.containsKey(wt.getModelId()))
|
|
|
- {
|
|
|
+ wtls = proBasicOrganizeTrees.stream().filter(i -> i.getId().endsWith("_EQ")).collect(Collectors.toList());
|
|
|
+ logger.info(wtls.size() + "");
|
|
|
+ wtls.forEach(wt -> {
|
|
|
+ if (modelMap.containsKey(wt.getModelId())) {
|
|
|
ProEconEquipmentmodel equipmentmodel = modelMap.get(wt.getModelId());
|
|
|
- modelpower.put(wt.getId(),equipmentmodel.getPowerProduction().doubleValue());
|
|
|
+ modelpower.put(wt.getId(), equipmentmodel.getPowerProduction().doubleValue());
|
|
|
}
|
|
|
|
|
|
|
|
|
- wtmap.put(wt.getId(),wt);
|
|
|
+ wtmap.put(wt.getId(), wt);
|
|
|
//标杆风机初始化
|
|
|
- wtstandardmap.put(wt.getId(),wt.getId());
|
|
|
- String wtString = redisService.get(wt.getId());
|
|
|
+ wtstandardmap.put(wt.getId(), wt.getId());
|
|
|
+ String wtString = (String) pbotidMap.get(wt.getId());
|
|
|
Map<String, ProBasicEquipmentPoint> stringWindturbinetestingpointnewMap = JSONObject.parseObject(wtString, new TypeReference<Map<String, ProBasicEquipmentPoint>>() {
|
|
|
});
|
|
|
- wtpAimap.put(wt.getId(),stringWindturbinetestingpointnewMap);
|
|
|
+ wtpAimap.put(wt.getId(), stringWindturbinetestingpointnewMap);
|
|
|
|
|
|
|
|
|
- if (wpwtmap.containsKey(wt.getOrgType().contains("STA"))){
|
|
|
+ if (wpwtmap.containsKey(wt.getOrgType().contains("STA"))) {
|
|
|
wpwtmap.get(wt.getOrgType().contains("STA")).add(wt);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
List<ProBasicOrganizeTree> wps = new ArrayList<>();
|
|
|
wps.add(wt);
|
|
|
- wpwtmap.put(wt.getOrgType().contains("STA"),wps);
|
|
|
+ wpwtmap.put(wt.getOrgType().contains("STA"), wps);
|
|
|
}
|
|
|
|
|
|
- if (pjwtmap.containsKey(wt.getOrgType().contains("EG"))){
|
|
|
+ if (pjwtmap.containsKey(wt.getOrgType().contains("EG"))) {
|
|
|
pjwtmap.get(wt.getOrgType().contains("EG")).add(wt);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
List<ProBasicOrganizeTree> pjs = new ArrayList<>();
|
|
|
pjs.add(wt);
|
|
|
- pjwtmap.put(wt.getOrgType().contains("EG"),pjs);
|
|
|
+ pjwtmap.put(wt.getOrgType().contains("EG"), pjs);
|
|
|
}
|
|
|
|
|
|
- if (lnwtmap.containsKey(wt.getOrgType().contains("LN"))){
|
|
|
+ if (lnwtmap.containsKey(wt.getOrgType().contains("LN"))) {
|
|
|
lnwtmap.get(wt.getOrgType().contains("LN")).add(wt);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
List<ProBasicOrganizeTree> lnls = new ArrayList<>();
|
|
|
lnls.add(wt);
|
|
|
- lnwtmap.put(wt.getOrgType().contains("LN"),lnls);
|
|
|
+ lnwtmap.put(wt.getOrgType().contains("LN"), lnls);
|
|
|
}
|
|
|
- if (cmwtlsmap.containsKey(wt.getOrgType().contains("ZGS"))){
|
|
|
+ if (cmwtlsmap.containsKey(wt.getOrgType().contains("ZGS"))) {
|
|
|
cmwtlsmap.get(wt.getOrgType().contains("ZGS")).add(wt);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
List<ProBasicOrganizeTree> cmls = new ArrayList<>();
|
|
|
cmls.add(wt);
|
|
|
- cmwtlsmap.put(wt.getOrgType().contains("ZGS"),cmls);
|
|
|
+ cmwtlsmap.put(wt.getOrgType().contains("ZGS"), cmls);
|
|
|
}
|
|
|
- if (rgwtlsmap.containsKey(wt.getOrgType().contains("RGN"))){
|
|
|
+ if (rgwtlsmap.containsKey(wt.getOrgType().contains("RGN"))) {
|
|
|
rgwtlsmap.get(wt.getOrgType().contains("RGN")).add(wt);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
List<ProBasicOrganizeTree> rgls = new ArrayList<>();
|
|
|
rgls.add(wt);
|
|
|
- rgwtlsmap.put(wt.getOrgType().contains("RGN"),rgls);
|
|
|
+ rgwtlsmap.put(wt.getOrgType().contains("RGN"), rgls);
|
|
|
}
|
|
|
|
|
|
- if (sqwtmap.containsKey(wt.getOrgType().contains("AG"))){
|
|
|
+ if (sqwtmap.containsKey(wt.getOrgType().contains("AG"))) {
|
|
|
sqwtmap.get(wt.getOrgType().contains("AG")).add(wt);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
List<ProBasicOrganizeTree> lnls = new ArrayList<>();
|
|
|
lnls.add(wt);
|
|
|
- sqwtmap.put(wt.getOrgType().contains("AG"),lnls);
|
|
|
+ sqwtmap.put(wt.getOrgType().contains("AG"), lnls);
|
|
|
}
|
|
|
|
|
|
- if (cmwtmap.containsKey(wt.getOrgType().contains("ZGS"))){
|
|
|
- cmwtmap.get(wt.getOrgType().contains("ZGS")).put(wt.getId(),wt);
|
|
|
- }else {
|
|
|
- Map<String,ProBasicOrganizeTree> map=new HashMap<>();
|
|
|
- map.put(wt.getId(),wt);
|
|
|
- cmwtmap.put(wt.getOrgType().contains("ZGS"),map);
|
|
|
+ if (cmwtmap.containsKey(wt.getOrgType().contains("ZGS"))) {
|
|
|
+ cmwtmap.get(wt.getOrgType().contains("ZGS")).put(wt.getId(), wt);
|
|
|
+ } else {
|
|
|
+ Map<String, ProBasicOrganizeTree> map = new HashMap<>();
|
|
|
+ map.put(wt.getId(), wt);
|
|
|
+ cmwtmap.put(wt.getOrgType().contains("ZGS"), map);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
//树形初始化标杆风机
|
|
|
- for(ProBasicOrganizeTree wt : wtls)
|
|
|
- {
|
|
|
- if(wpwtmap.containsKey(wt.getOrgType().contains("LN")))
|
|
|
- {
|
|
|
- List<ProBasicOrganizeTree> wts=wpwtmap.get(wt.getOrgType().contains("LN"));
|
|
|
- for(ProBasicOrganizeTree w:wts)
|
|
|
- {
|
|
|
- if(StringUtils.notEmp(w.getIsStandard()) && w.getIsStandard()!=0)
|
|
|
- {
|
|
|
- wtstandardmap.put(wt.getId(),w.getId());
|
|
|
+ for (ProBasicOrganizeTree wt : wtls) {
|
|
|
+ if (wpwtmap.containsKey(wt.getOrgType().contains("LN"))) {
|
|
|
+ List<ProBasicOrganizeTree> wts = wpwtmap.get(wt.getOrgType().contains("LN"));
|
|
|
+ for (ProBasicOrganizeTree w : wts) {
|
|
|
+ if (StringUtils.notEmp(w.getIsStandard()) && w.getIsStandard() != 0) {
|
|
|
+ wtstandardmap.put(wt.getId(), w.getId());
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if(pjwtmap.containsKey(wt.getOrgType().contains("LN")))
|
|
|
- {
|
|
|
- List<ProBasicOrganizeTree> wts=pjwtmap.get(wt.getOrgType().contains("LN"));
|
|
|
- for(ProBasicOrganizeTree w:wts)
|
|
|
- {
|
|
|
- if(StringUtils.notEmp(w.getIsStandard()) && w.getIsStandard()!=0)
|
|
|
- {
|
|
|
- wtstandardmap.put(wt.getId(),w.getId());
|
|
|
+ if (pjwtmap.containsKey(wt.getOrgType().contains("LN"))) {
|
|
|
+ List<ProBasicOrganizeTree> wts = pjwtmap.get(wt.getOrgType().contains("LN"));
|
|
|
+ for (ProBasicOrganizeTree w : wts) {
|
|
|
+ if (StringUtils.notEmp(w.getIsStandard()) && w.getIsStandard() != 0) {
|
|
|
+ wtstandardmap.put(wt.getId(), w.getId());
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if(lnwtmap.containsKey(wt.getOrgType().contains("LN")))
|
|
|
- {
|
|
|
- List<ProBasicOrganizeTree> wts=lnwtmap.get(wt.getOrgType().contains("LN"));
|
|
|
- for(ProBasicOrganizeTree w:wts)
|
|
|
- {
|
|
|
- if(StringUtils.notEmp(w.getIsStandard()) && w.getIsStandard()!=0)
|
|
|
- {
|
|
|
- wtstandardmap.put(wt.getId(),w.getId());
|
|
|
+ if (lnwtmap.containsKey(wt.getOrgType().contains("LN"))) {
|
|
|
+ List<ProBasicOrganizeTree> wts = lnwtmap.get(wt.getOrgType().contains("LN"));
|
|
|
+ for (ProBasicOrganizeTree w : wts) {
|
|
|
+ if (StringUtils.notEmp(w.getIsStandard()) && w.getIsStandard() != 0) {
|
|
|
+ wtstandardmap.put(wt.getId(), w.getId());
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -476,20 +476,21 @@ public class CacheContext implements CommandLineRunner {
|
|
|
|
|
|
|
|
|
//期次场站树形
|
|
|
- pjls = proBasicOrganizeTreeService.list().stream().filter(i-> i.getIsAble()==1 && i.getOrgType().contains("EG")).collect(Collectors.toList());
|
|
|
- pjls.stream().forEach(p->{
|
|
|
- pjmap.put(p.getId(),p);
|
|
|
- if (wppromap.containsKey(p.getOrgType().contains("STA"))){
|
|
|
+ pjls = proBasicOrganizeTrees.stream().filter(i -> i.getOrgType().contains("EG")).collect(Collectors.toList());
|
|
|
+
|
|
|
+ pjls.stream().forEach(p -> {
|
|
|
+ pjmap.put(p.getId(), p);
|
|
|
+ if (wppromap.containsKey(p.getOrgType().contains("STA"))) {
|
|
|
wppromap.get(p.getOrgType().contains("STA")).add(p);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
List<ProBasicOrganizeTree> prolist = new ArrayList<>();
|
|
|
prolist.add(p);
|
|
|
- wppromap.put(p.getOrgType().contains("STA"),prolist);
|
|
|
+ wppromap.put(p.getOrgType().contains("STA"), prolist);
|
|
|
}
|
|
|
- String pjString = redisService.get(p.getId());
|
|
|
+ String pjString = (String) pbotidMap.get(p.getId());
|
|
|
Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(pjString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
});
|
|
|
- propointmap.put(p.getId(),stringWindpowerstationpointnewMap);
|
|
|
+ propointmap.put(p.getId(), stringWindpowerstationpointnewMap);
|
|
|
|
|
|
});
|
|
|
|
|
@@ -498,21 +499,21 @@ public class CacheContext implements CommandLineRunner {
|
|
|
subwpls = proBasicOrganizeTreeService.list().stream().filter(i-> i.getIsAble()==1 && i.getOrgType().contains("SBS")).collect(Collectors.toList());
|
|
|
subwpls.stream().forEach(sub->{
|
|
|
|
|
|
- String subString = redisService.get(sub.getId());
|
|
|
+ String subString = (String) pbotidMap.get(sub.getId());
|
|
|
Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(subString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
});
|
|
|
- subwppointmap.put(sub.getId(),stringWindpowerstationpointnewMap);
|
|
|
+ subwppointmap.put(sub.getId(), stringWindpowerstationpointnewMap);
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
- weawpls = proBasicWeatherStationService.list().stream().filter(i-> i.getIsAble()==1).collect(Collectors.toList());
|
|
|
- weawpls.stream().forEach(weather->{
|
|
|
+ weawpls = proBasicWeatherStationService.list().stream().filter(i -> i.getIsAble() == 1).collect(Collectors.toList());
|
|
|
+ weawpls.stream().forEach(weather -> {
|
|
|
|
|
|
String subString = redisService.get(weather.getId());
|
|
|
Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(subString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
});
|
|
|
- weatherwppointmap.put(weather.getId(),stringWindpowerstationpointnewMap);
|
|
|
+ weatherwppointmap.put(weather.getId(), stringWindpowerstationpointnewMap);
|
|
|
|
|
|
|
|
|
});
|
|
@@ -520,45 +521,44 @@ public class CacheContext implements CommandLineRunner {
|
|
|
|
|
|
|
|
|
//树形线路
|
|
|
- lnls = proBasicOrganizeTreeService.list().stream().filter(i-> StringUtils.isNotNull(pjmap.get(i.getParentCode())) && i.getIsAble()==1).collect(Collectors.toList());
|
|
|
- lnls.stream().forEach(l->{
|
|
|
- lnmap.put(l.getId(),l);
|
|
|
- if (prolinemap.containsKey(l.getOrgType().contains("EG"))){
|
|
|
+ lnls = proBasicOrganizeTrees.stream().filter(i -> StringUtils.isNotNull(pjmap.get(i.getParentCode()))).collect(Collectors.toList());
|
|
|
+ lnls.stream().forEach(l -> {
|
|
|
+ lnmap.put(l.getId(), l);
|
|
|
+ if (prolinemap.containsKey(l.getOrgType().contains("EG"))) {
|
|
|
prolinemap.get(l.getOrgType().contains("EG")).add(l);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
List<ProBasicOrganizeTree> lineList = new ArrayList<>();
|
|
|
lineList.add(l);
|
|
|
- prolinemap.put(l.getOrgType().contains("EG"),lineList);
|
|
|
+ prolinemap.put(l.getOrgType().contains("EG"), lineList);
|
|
|
}
|
|
|
- String lnString = redisService.get(l.getId());
|
|
|
+ String lnString = (String) pbotidMap.get(l.getId());
|
|
|
Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(lnString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
});
|
|
|
- linepointmap.put(l.getId(),stringWindpowerstationpointnewMap);
|
|
|
+ linepointmap.put(l.getId(), stringWindpowerstationpointnewMap);
|
|
|
});
|
|
|
|
|
|
|
|
|
- for(ProBasicOrganizeTree wp:wpls)
|
|
|
- {
|
|
|
- if (cpwpmap.containsKey(wp.getOrgType().contains("ZGS"))){
|
|
|
+ for (ProBasicOrganizeTree wp : wpls) {
|
|
|
+ if (cpwpmap.containsKey(wp.getOrgType().contains("ZGS"))) {
|
|
|
cpwpmap.get(wp.getOrgType().contains("ZGS")).add(wp);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
List<ProBasicOrganizeTree> wps = new ArrayList<>();
|
|
|
wps.add(wp);
|
|
|
- cpwpmap.put(wp.getOrgType().contains("ZGS"),wps);
|
|
|
+ cpwpmap.put(wp.getOrgType().contains("ZGS"), wps);
|
|
|
}
|
|
|
}
|
|
|
- meterpoints = proBasicMeterPointService.list().stream().filter(i->i.getIsAble()==1).collect(Collectors.toList());
|
|
|
+ meterpoints = proBasicMeterPointService.list().stream().filter(i -> i.getIsAble() == 1).collect(Collectors.toList());
|
|
|
meterpoints.stream().forEach(meterpoint -> {
|
|
|
- meterpointMap.put(meterpoint.getId(),meterpoint);
|
|
|
+ meterpointMap.put(meterpoint.getId(), meterpoint);
|
|
|
});
|
|
|
|
|
|
wpls.stream().forEach(wp->{
|
|
|
|
|
|
- wpmap.put(wp.getId(),wp);
|
|
|
- String wpString = redisService.get(wp.getId());
|
|
|
+ wpmap.put(wp.getId(), wp);
|
|
|
+ String wpString = (String) pbotidMap.get(wp.getId());
|
|
|
Map<String, ProBasicPowerstationPoint> stringMapMap = JSONObject.parseObject(wpString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
});
|
|
|
- wppointmap.put(wp.getId(),stringMapMap);
|
|
|
+ wppointmap.put(wp.getId(), stringMapMap);
|
|
|
});
|
|
|
|
|
|
|
|
@@ -572,36 +572,34 @@ public class CacheContext implements CommandLineRunner {
|
|
|
wplsG.add(wp);
|
|
|
}
|
|
|
|
|
|
- if(wpmapls.containsKey(wp.getId()))
|
|
|
- {
|
|
|
- List<ProBasicOrganizeTree> ls=wpmapls.get(wp.getId());
|
|
|
+ if (wpmapls.containsKey(wp.getId())) {
|
|
|
+ List<ProBasicOrganizeTree> ls = wpmapls.get(wp.getId());
|
|
|
ls.add(wp);
|
|
|
- wpmapls.put(wp.getId(),ls);
|
|
|
- }else {
|
|
|
- List<ProBasicOrganizeTree> ls=new ArrayList<>();
|
|
|
+ wpmapls.put(wp.getId(), ls);
|
|
|
+ } else {
|
|
|
+ List<ProBasicOrganizeTree> ls = new ArrayList<>();
|
|
|
ls.add(wp);
|
|
|
- wpmapls.put(wp.getId(),ls);
|
|
|
+ wpmapls.put(wp.getId(), ls);
|
|
|
}
|
|
|
|
|
|
- wpmap.put(wp.getId(),wp);
|
|
|
+ wpmap.put(wp.getId(), wp);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
String llglString = redisService.get("ZLLGL");
|
|
|
- theoreticalPowerMap = JSONObject.parseObject(llglString, new TypeReference<Map<String, Map<Double,ProBasicModelPowerRd>>>() {
|
|
|
+ theoreticalPowerMap = JSONObject.parseObject(llglString, new TypeReference<Map<String, Map<Double, ProBasicModelPowerRd>>>() {
|
|
|
});
|
|
|
|
|
|
llglString = redisService.get("ZLLGLLS");
|
|
|
- theoreticalPowerList= JSONObject.parseObject(llglString, new TypeReference<List<ProBasicModelPowerRd>>() {
|
|
|
+ theoreticalPowerList = JSONObject.parseObject(llglString, new TypeReference<List<ProBasicModelPowerRd>>() {
|
|
|
});
|
|
|
|
|
|
String sszzt = redisService.get("SSZZT");
|
|
|
- statusMap = JSONObject.parseObject(sszzt, new TypeReference<Map<String,List<ProBasicStatusPoint>>>() {
|
|
|
+ statusMap = JSONObject.parseObject(sszzt, new TypeReference<Map<String, List<ProBasicStatusPoint>>>() {
|
|
|
});
|
|
|
|
|
|
|
|
|
-
|
|
|
logger.info("缓存结束------------------------------------------------------------");
|
|
|
}
|
|
|
}
|