|
@@ -5,9 +5,11 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.alibaba.fastjson.TypeReference;
|
|
|
import com.gyee.common.model.StringUtils;
|
|
|
import com.gyee.runeconomy.model.auto.*;
|
|
|
+import com.gyee.runeconomy.model.fitting.ProBasicEquipmentBranchPoint;
|
|
|
import com.gyee.runeconomy.model.fitting.ProBasicOrganizeEquipment;
|
|
|
import com.gyee.runeconomy.model.fitting.ProEconInPowerCurveFitting;
|
|
|
import com.gyee.runeconomy.service.auto.*;
|
|
|
+import com.gyee.runeconomy.service.fitting.IProBasicEquipmentBranchPointService;
|
|
|
import com.gyee.runeconomy.service.fitting.IProBasicOrganizeEquipmentService;
|
|
|
import com.gyee.runeconomy.service.fitting.IProEconInPowerCurveFittingService;
|
|
|
import com.gyee.runeconomy.service.realtimelibrary.TheoreticalPowerService;
|
|
@@ -94,6 +96,9 @@ public class CacheContext implements CommandLineRunner {
|
|
|
@Resource
|
|
|
private IProEconInPowerCurveFittingService inPowerCurveFittingService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private IProBasicEquipmentBranchPointService proBasicEquipmentBranchPointService;
|
|
|
+
|
|
|
public static List<ProBasicBranch> bnls = new ArrayList<>();
|
|
|
// public static List<ProBasicEquipment> wtls = new ArrayList<>();
|
|
|
// public static List<ProBasicProject> pjls = new ArrayList<>();
|
|
@@ -120,41 +125,41 @@ public class CacheContext implements CommandLineRunner {
|
|
|
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<>();
|
|
|
- public static List<ProBasicOrganizeTree> subwpls = new ArrayList<>(); //变电所
|
|
|
- public static List<ProBasicOrganizeTree> wplsf = new ArrayList<>();
|
|
|
- public static List<ProBasicOrganizeTree> wplsG = new ArrayList<>(); //光电集合
|
|
|
- public static List<ProEconPowerstationInfoDay7> station7ls = new ArrayList<>();
|
|
|
- public static List<ProEconPowerstationInfoDay1> station1ls = new ArrayList<>();
|
|
|
-
|
|
|
- public static Map<String,ProBasicOrganizeTree> sqmap = new HashMap<>();
|
|
|
- public static Map<String,ProEconPowerstationInfoDay7> station7map = new HashMap<>();
|
|
|
- public static Map<String,ProEconPowerstationInfoDay1> station1map = new HashMap<>();
|
|
|
- public static Map<String,ProBasicOrganizeTree> cpmap = new HashMap<>();
|
|
|
- public static Map<String,ProBasicOrganizeTree> rgmap = new HashMap<>();
|
|
|
- public static Map<String,ProBasicOrganizeTree> gpmap = new HashMap<>();
|
|
|
+ public static List<ProBasicOrganizeTree> lnls = new ArrayList<>();
|
|
|
+ public static List<ProBasicOrganizeTree> subwpls = new ArrayList<>(); //变电所
|
|
|
+ public static List<ProBasicOrganizeTree> wplsf = new ArrayList<>();
|
|
|
+ public static List<ProBasicOrganizeTree> wplsG = new ArrayList<>(); //光电集合
|
|
|
+ public static List<ProEconPowerstationInfoDay7> station7ls = new ArrayList<>();
|
|
|
+ public static List<ProEconPowerstationInfoDay1> station1ls = new ArrayList<>();
|
|
|
+
|
|
|
+ public static Map<String, ProBasicOrganizeTree> sqmap = new HashMap<>();
|
|
|
+ public static Map<String, ProEconPowerstationInfoDay7> station7map = new HashMap<>();
|
|
|
+ public static Map<String, ProEconPowerstationInfoDay1> station1map = new HashMap<>();
|
|
|
+ public static Map<String, ProBasicOrganizeTree> cpmap = new HashMap<>();
|
|
|
+ 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> wpmap = new HashMap<>();
|
|
|
- public static Map<Object,List<ProBasicOrganizeTree>> rgcpmap = new HashMap<>();//区域子公司
|
|
|
- public static Map<Object,List<ProBasicOrganizeTree>> cpwpmap = new HashMap<>();//公司场站
|
|
|
- public static Map<Object,List<ProBasicOrganizeTree>> wpwtmap = new HashMap<>();
|
|
|
- public static Map<Object,List<ProBasicOrganizeTree>> pjwtmap = new HashMap<>();
|
|
|
- public static Map<String,List<ProBasicOrganizeTree>> protreejmap = new HashMap<>();
|
|
|
- public static Map<Object,List<ProBasicOrganizeTree>> lnwtmap = new HashMap<>();
|
|
|
- public static Map<Object,List<ProBasicOrganizeTree>> cmwtlsmap = new HashMap<>();
|
|
|
- public static Map<Object,List<ProBasicOrganizeTree>> rgwtlsmap = new HashMap<>();
|
|
|
- public static Map<Object,List<ProBasicOrganizeTree>> sqwtmap = new HashMap<>();
|
|
|
- public static Map<Object,List<ProBasicOrganizeTree>> prolinemap = new HashMap<>();
|
|
|
- public static Map<String,List<ProBasicOrganizeTree>> wpmapls = new HashMap<>();
|
|
|
- public static Map<Object,Map<String,ProBasicOrganizeTree>> cmwtmap = new HashMap<>();
|
|
|
- public static Map<Object,List<ProBasicOrganizeTree>> wppromap = new HashMap<>();
|
|
|
- public static Map<String,String> wtstandardmap = new HashMap<>();//标杆
|
|
|
-
|
|
|
- public static Map<String,List<ProBasicBranch>> wtbnmap = new HashMap<>();
|
|
|
- public static List<ProBasicMeterPoint> meterpoints = new ArrayList<>();
|
|
|
- public static Map<String,ProBasicMeterPoint> meterpointMap = new HashMap<>();
|
|
|
+ public static Map<Object, List<ProBasicOrganizeTree>> rgcpmap = new HashMap<>();//区域子公司
|
|
|
+ public static Map<Object, List<ProBasicOrganizeTree>> cpwpmap = new HashMap<>();//公司场站
|
|
|
+ public static Map<Object, List<ProBasicOrganizeTree>> wpwtmap = new HashMap<>();
|
|
|
+ public static Map<Object, List<ProBasicOrganizeTree>> pjwtmap = new HashMap<>();
|
|
|
+ public static Map<String, List<ProBasicOrganizeTree>> protreejmap = new HashMap<>();
|
|
|
+ public static Map<Object, List<ProBasicOrganizeTree>> lnwtmap = new HashMap<>();
|
|
|
+ public static Map<Object, List<ProBasicOrganizeTree>> cmwtlsmap = new HashMap<>();
|
|
|
+ public static Map<Object, List<ProBasicOrganizeTree>> rgwtlsmap = new HashMap<>();
|
|
|
+ public static Map<Object, List<ProBasicOrganizeTree>> sqwtmap = new HashMap<>();
|
|
|
+ public static Map<Object, List<ProBasicOrganizeTree>> prolinemap = new HashMap<>();
|
|
|
+ public static Map<String, List<ProBasicOrganizeTree>> wpmapls = new HashMap<>();
|
|
|
+ public static Map<Object, Map<String, ProBasicOrganizeTree>> cmwtmap = new HashMap<>();
|
|
|
+ public static Map<Object, List<ProBasicOrganizeTree>> wppromap = new HashMap<>();
|
|
|
+ public static Map<String, String> wtstandardmap = new HashMap<>();//标杆
|
|
|
+
|
|
|
+ public static Map<String, List<ProBasicBranch>> wtbnmap = new HashMap<>();
|
|
|
+ public static List<ProBasicMeterPoint> meterpoints = new ArrayList<>();
|
|
|
+ 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<>();
|
|
@@ -166,19 +171,19 @@ public class CacheContext implements CommandLineRunner {
|
|
|
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, ProEconEquipmentmodel> modelMap = new HashMap<>();
|
|
|
+ public static Map<String, Double> modelpower = new HashMap<>();
|
|
|
|
|
|
- public static Map<String,Map<Double,ProBasicModelPower>> modelpowermap = new TreeMap<>();
|
|
|
+ public static Map<String, Map<Double, ProBasicModelPower>> modelpowermap = new TreeMap<>();
|
|
|
|
|
|
public static List<ProBasicModelPower> mpls = 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<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;
|
|
|
public static Map<String, ProBasicOrganizeTree> proBasicOrganizeTreesMap;
|
|
|
public static List<ProBasicOrganizeEquipment> organizeEquipmentList;//把树形展开的设备列表
|
|
@@ -188,6 +193,7 @@ public class CacheContext implements CommandLineRunner {
|
|
|
public static List<ProBasicEquipmentPoint> proBasicEquipmentPointList;
|
|
|
|
|
|
public static List<ProBasicPowerstationPoint> proBasicPowerstationPoint;
|
|
|
+ public static List<ProBasicEquipmentBranchPoint> proBasicEquipmentBranchPointList;
|
|
|
|
|
|
@Override
|
|
|
public void run(String... args) throws Exception {
|
|
@@ -203,6 +209,8 @@ public class CacheContext implements CommandLineRunner {
|
|
|
|
|
|
proBasicEquipmentPointList = proBasicEquipmentPointService.list();
|
|
|
proBasicPowerstationPoint = proBasicPowerstationPointService.list();
|
|
|
+ proBasicEquipmentBranchPointList = proBasicEquipmentBranchPointService.list();
|
|
|
+
|
|
|
|
|
|
//List<String> pbotids = proBasicOrganizeTrees.stream().map(pbot -> pbot.getId()).collect(Collectors.toList());
|
|
|
//Map<String, Object> pbotidMap = redisService.batchGetKeys(pbotids);
|
|
@@ -246,48 +254,40 @@ public class CacheContext implements CommandLineRunner {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- treels = proBasicOrganizeTreeService.list().stream().filter(i->i.getIsAble()==1).collect(Collectors.toList());
|
|
|
+ treels = proBasicOrganizeTreeService.list().stream().filter(i -> i.getIsAble() == 1).collect(Collectors.toList());
|
|
|
|
|
|
//树形方阵
|
|
|
- sqls = proBasicOrganizeTreeService.list().stream().filter(i->i.getOrgType().equals("AG") && i.getIsAble()==1).collect(Collectors.toList());
|
|
|
- if (!sqls.isEmpty())
|
|
|
- {
|
|
|
- for (ProBasicOrganizeTree sq : sqls)
|
|
|
- {
|
|
|
- sqmap.put(sq.getParentCode(),sq);
|
|
|
+ sqls = proBasicOrganizeTreeService.list().stream().filter(i -> i.getOrgType().equals("AG") && i.getIsAble() == 1).collect(Collectors.toList());
|
|
|
+ if (!sqls.isEmpty()) {
|
|
|
+ for (ProBasicOrganizeTree sq : sqls) {
|
|
|
+ sqmap.put(sq.getParentCode(), sq);
|
|
|
}
|
|
|
}
|
|
|
List<ProBasicOrganizeTree> proBasicOrganizeTrees = proBasicOrganizeTreeService.list();
|
|
|
proBasicOrganizeTrees = proBasicOrganizeTrees.stream().filter(pbot -> pbot.getIsAble() == 1).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
- station7ls = proEconPowerstationInfoDay7Service.list().stream().filter(i->i.getId()!=null).collect(Collectors.toList());
|
|
|
- if (!station7ls.isEmpty())
|
|
|
- {
|
|
|
- for (ProEconPowerstationInfoDay7 sq : station7ls)
|
|
|
- {
|
|
|
- station7map.put(sq.getForeignKeyId(),sq);
|
|
|
+ station7ls = proEconPowerstationInfoDay7Service.list().stream().filter(i -> i.getId() != null).collect(Collectors.toList());
|
|
|
+ if (!station7ls.isEmpty()) {
|
|
|
+ for (ProEconPowerstationInfoDay7 sq : station7ls) {
|
|
|
+ station7map.put(sq.getForeignKeyId(), sq);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
- station1ls = proEconPowerstationInfoDay1Service.list().stream().filter(i->i.getId()!=null).collect(Collectors.toList());
|
|
|
- if (!station1ls.isEmpty())
|
|
|
- {
|
|
|
- for (ProEconPowerstationInfoDay1 sq : station1ls)
|
|
|
- {
|
|
|
- station1map.put(sq.getForeignKeyId(),sq);
|
|
|
+ station1ls = proEconPowerstationInfoDay1Service.list().stream().filter(i -> i.getId() != null).collect(Collectors.toList());
|
|
|
+ if (!station1ls.isEmpty()) {
|
|
|
+ for (ProEconPowerstationInfoDay1 sq : station1ls) {
|
|
|
+ station1map.put(sq.getForeignKeyId(), sq);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
//三级公司
|
|
|
- cpls=proBasicOrganizeTreeService.list().stream().filter(i->i.getIsAble().equals(1) && i.getOrgType().contains("ZGS")).collect(Collectors.toList());
|
|
|
- if (!cpls.isEmpty())
|
|
|
- {
|
|
|
- for(ProBasicOrganizeTree sq:cpls)
|
|
|
- {
|
|
|
- cpmap.put(sq.getId(),sq);
|
|
|
+ cpls = proBasicOrganizeTreeService.list().stream().filter(i -> i.getIsAble().equals(1) && i.getOrgType().contains("ZGS")).collect(Collectors.toList());
|
|
|
+ if (!cpls.isEmpty()) {
|
|
|
+ for (ProBasicOrganizeTree sq : cpls) {
|
|
|
+ cpmap.put(sq.getId(), sq);
|
|
|
|
|
|
if (redisService.hasKey(sq.getParentCode() + "0")) {
|
|
|
String cp0String = redisService.get(sq.getParentCode() + "0");
|
|
@@ -311,7 +311,6 @@ public class CacheContext implements CommandLineRunner {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
//区域树形
|
|
|
rgls = proBasicOrganizeTrees.stream().filter(i -> i.getOrgType().contains("RGN")).collect(Collectors.toList());
|
|
|
if (!rgls.isEmpty()) {
|
|
@@ -380,10 +379,9 @@ public class CacheContext implements CommandLineRunner {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- wpls = proBasicOrganizeTreeService.list().stream().filter(i->i.getIsAble()==1 && i.getOrgType().contains("STA")).collect(Collectors.toList());
|
|
|
- for(ProBasicOrganizeTree wp:wpls)
|
|
|
- {
|
|
|
- if (cpwpmap.containsKey(wp.getOrgType().contains("STA"))){
|
|
|
+ wpls = proBasicOrganizeTreeService.list().stream().filter(i -> i.getIsAble() == 1 && i.getOrgType().contains("STA")).collect(Collectors.toList());
|
|
|
+ for (ProBasicOrganizeTree wp : wpls) {
|
|
|
+ if (cpwpmap.containsKey(wp.getOrgType().contains("STA"))) {
|
|
|
cpwpmap.get(wp.getOrgType().contains("STA")).add(wp);
|
|
|
} else {
|
|
|
List<ProBasicOrganizeTree> wps = new ArrayList<>();
|
|
@@ -395,8 +393,6 @@ public class CacheContext implements CommandLineRunner {
|
|
|
fdwpls = wpls.stream().filter(wpl -> "F".equals(wpl.getEleType())).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
//树形设备
|
|
|
wtls = proBasicOrganizeTrees.stream().filter(i -> i.getId().endsWith("_EQ")).collect(Collectors.toList());
|
|
|
logger.info(wtls.size() + "");
|
|
@@ -472,7 +468,6 @@ public class CacheContext implements CommandLineRunner {
|
|
|
});
|
|
|
|
|
|
|
|
|
-
|
|
|
//树形初始化标杆风机
|
|
|
for (ProBasicOrganizeTree wt : wtls) {
|
|
|
if (wpwtmap.containsKey(wt.getOrgType().contains("LN"))) {
|
|
@@ -505,7 +500,6 @@ public class CacheContext implements CommandLineRunner {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
//期次场站树形
|
|
|
pjls = proBasicOrganizeTrees.stream().filter(i -> i.getOrgType().contains("EG")).collect(Collectors.toList());
|
|
|
|
|
@@ -526,8 +520,7 @@ public class CacheContext implements CommandLineRunner {
|
|
|
});
|
|
|
|
|
|
|
|
|
-
|
|
|
- subwpls = proBasicOrganizeTreeService.list().stream().filter(i-> i.getIsAble()==1 && i.getOrgType().contains("SBS")).collect(Collectors.toList());
|
|
|
+ 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());
|
|
@@ -550,7 +543,6 @@ public class CacheContext implements CommandLineRunner {
|
|
|
});*/
|
|
|
|
|
|
|
|
|
-
|
|
|
//树形线路
|
|
|
lnls = proBasicOrganizeTrees.stream().filter(i -> StringUtils.isNotNull(pjmap.get(i.getParentCode()))).collect(Collectors.toList());
|
|
|
lnls.stream().forEach(l -> {
|
|
@@ -593,7 +585,6 @@ public class CacheContext implements CommandLineRunner {
|
|
|
});*/
|
|
|
|
|
|
|
|
|
-
|
|
|
if (!wpls.isEmpty()) {
|
|
|
for (ProBasicOrganizeTree wp : wpls) {
|
|
|
if (wp.getEleType().contains("F")) {
|