|
@@ -0,0 +1,957 @@
|
|
|
+package com.gyee.runeconomy.init;
|
|
|
+
|
|
|
+
|
|
|
+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.service.auto.*;
|
|
|
+import com.gyee.runeconomy.service.realtimelibrary.TheoreticalPowerService;
|
|
|
+import com.gyee.runeconomy.util.redis.RedisService;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.boot.CommandLineRunner;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @ClassName : CacheContext
|
|
|
+ * @Author : xieshengjie
|
|
|
+ * @Date: 2021/5/18 9:35
|
|
|
+ * @Description : 缓存
|
|
|
+ */
|
|
|
+@Component
|
|
|
+public class CacheContext implements CommandLineRunner {
|
|
|
+ Logger logger = LoggerFactory.getLogger(CacheContext.class);
|
|
|
+
|
|
|
+ private final String QS = "0";
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private IProBasicEquipmentService proBasicEquipmentService;
|
|
|
+ @Resource
|
|
|
+ private IProBasicLineService proBasicLineService;
|
|
|
+ @Resource
|
|
|
+ private IProBasicProjectService proBasicProjectService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private IProBasicPowerstationService proBasicWindpowerstationService;
|
|
|
+ @Resource
|
|
|
+ private IProBasicMeterPointService proBasicMeterPointService;
|
|
|
+ @Resource
|
|
|
+ private IProEconEquipmentmodelService proEconEquipmentmodelService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private IProBasicWindturbinePowerService proBasicWindturbinePowerService;
|
|
|
+ @Resource
|
|
|
+ private RedisService redisService;
|
|
|
+ @Resource
|
|
|
+ private IProBasicModelPowerService proBasicModelPowerService;
|
|
|
+ @Resource
|
|
|
+ private IProBasicSubStationService proBasicSubStationService;
|
|
|
+ @Resource
|
|
|
+ private IProBasicWeatherStationService proBasicWeatherStationService;
|
|
|
+ @Resource
|
|
|
+ private IProBasicSquareService proBasicSquareService;
|
|
|
+ @Resource
|
|
|
+ private IProBasicCompanyService proBasicCompanyService;
|
|
|
+ @Resource
|
|
|
+ private IProBasicRegionService proBasicRegionService;
|
|
|
+ @Resource
|
|
|
+ private IProBasicEnergyGroupService proBasicEnergyGroupService;
|
|
|
+ @Resource
|
|
|
+ private IProBasicBranchService proBasicBranchService;
|
|
|
+ @Resource
|
|
|
+ private TheoreticalPowerService theoreticalPowerService;
|
|
|
+ @Resource
|
|
|
+ private IProBasicModelPowerRdService proBasicModelPowerRdService;
|
|
|
+ @Resource
|
|
|
+ private IProBasicPowerstationPointService proBasicPowerstationPointService;
|
|
|
+ @Resource
|
|
|
+ private IProBasicEquipmentPointService proBasicEquipmentPointService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private IProBasicOrganizeTreeService proBasicOrganizeTreeService;
|
|
|
+
|
|
|
+
|
|
|
+ public static List<ProBasicBranch> bnls = 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> sqls = new ArrayList<>(); //阵区
|
|
|
+ public static List<ProBasicOrganizeTree> cpls = new ArrayList<>();//公司
|
|
|
+ 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> 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 Map<String,ProBasicProject> pjmap = new HashMap<>();
|
|
|
+// public static Map<String,ProBasicLine> lnmap = new HashMap<>();
|
|
|
+// 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,ProBasicOrganizeTree> sqmap = 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<Object,List<ProBasicOrganizeTree>> cpwpmap = 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<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<ProBasicBranch>> wtbnmap = new HashMap<>();
|
|
|
+// public static Map<String,List<ProBasicCompany>> rgcpmap = new HashMap<>();
|
|
|
+// public static Map<String,ProBasicSquare> sqmap = new HashMap<>();
|
|
|
+// public static Map<String, ProBasicPowerstation> wpmap = new HashMap<>();
|
|
|
+ public static List<ProBasicMeterPoint> meterpoints = new ArrayList<>();
|
|
|
+ public static Map<String,ProBasicMeterPoint> meterpointMap = new HashMap<>();
|
|
|
+// public static Map<String,List<ProBasicProject>> wppromap = new HashMap<>();
|
|
|
+ public static Map<String,List<ProBasicProject>> projmap = new HashMap<>();
|
|
|
+// public static Map<String,List<ProBasicLine>> prolinemap = 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<>();
|
|
|
+// public static Map<String,List<ProBasicEquipment>> cmwtlsmap = new HashMap<>();
|
|
|
+// 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, 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<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<>();
|
|
|
+// public static Map<String, ProBasicEquipment> wtmap = new HashMap<>();
|
|
|
+
|
|
|
+ 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 Map<String,List<ProBasicEquipment>> subWtsMap = 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<>();
|
|
|
+
|
|
|
+ @Override
|
|
|
+ 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);
|
|
|
+ });
|
|
|
+ mpls=proBasicModelPowerService.list();
|
|
|
+ mpls.sort(Comparator.comparing(ProBasicModelPower::getSpeed));
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+// sqls=proBasicSquareService.list().stream().filter(i->i.getIsAble()==1).collect(Collectors.toList());
|
|
|
+// if (!sqls.isEmpty())
|
|
|
+// {
|
|
|
+// for(ProBasicSquare sq:sqls)
|
|
|
+// {
|
|
|
+// sqmap.put(sq.getId(),sq);
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+ //树形方阵
|
|
|
+ sqls = proBasicOrganizeTreeService.list().stream().filter(i->i.getOrgType().contains("AG") && i.getIsAble()==1).collect(Collectors.toList());
|
|
|
+ if (!sqls.isEmpty())
|
|
|
+ {
|
|
|
+ for (ProBasicOrganizeTree sq : sqls)
|
|
|
+ {
|
|
|
+ sqmap.put(sq.getParentCode(),sq);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+// cpls=proBasicCompanyService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
|
|
|
+//
|
|
|
+// 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);
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
+
|
|
|
+ //三级公司树形
|
|
|
+ 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.getParentCode(),sq);
|
|
|
+
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+// 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);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+ //区域树形
|
|
|
+ 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.getParentCode(),sq);
|
|
|
+
|
|
|
+ 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>>() {
|
|
|
+ });
|
|
|
+ regionpointmap.put(sq.getParentCode()+"0",stringWindpowerstationpointnewMap);
|
|
|
+ }
|
|
|
+ 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>>() {
|
|
|
+ });
|
|
|
+ regionpointmap.put(sq.getParentCode()+"-1",stringWindpowerstationpointnewMap);
|
|
|
+ }
|
|
|
+ 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>>() {
|
|
|
+ });
|
|
|
+ regionpointmap.put(sq.getParentCode()+"-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);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //集团树形
|
|
|
+ List<ProBasicOrganizeTree> energyGroupList = proBasicOrganizeTreeService.list();
|
|
|
+ gpls = energyGroupList.stream().filter(e->e.getIsAble()==1 && e.getOrgType().contains("JT")).collect(Collectors.toList());
|
|
|
+
|
|
|
+ if (!gpls.isEmpty())
|
|
|
+ {
|
|
|
+ for(ProBasicOrganizeTree gp:gpls)
|
|
|
+ {
|
|
|
+ gpmap.put(gp.getParentCode(),gp);
|
|
|
+
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+// 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(ProBasicOrganizeTree cp:cpls)
|
|
|
+ {
|
|
|
+ if (rgcpmap.containsKey(cp.getOrgType().contains("RGN"))){
|
|
|
+ rgcpmap.get(cp.getOrgType().contains("RGN")).add(cp);
|
|
|
+ }else {
|
|
|
+ List<ProBasicOrganizeTree> wps = new ArrayList<>();
|
|
|
+ wps.add(cp);
|
|
|
+ rgcpmap.put(cp.getOrgType().contains("RGN"),wps);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+// 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);
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+ 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<>();
|
|
|
+ wps.add(wp);
|
|
|
+ cpwpmap.put(wp.getOrgType().contains("STA"),wps);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+// wtls = proBasicEquipmentService.list().stream().filter(i->i.getIsable()==1).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());
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+// wtmap.put(wt.getId(),wt);
|
|
|
+// //标杆风机初始化
|
|
|
+// wtstandardmap.put(wt.getId(),wt.getId());
|
|
|
+// String wtString = redisService.get(wt.getId());
|
|
|
+// Map<String, ProBasicEquipmentPoint> stringWindturbinetestingpointnewMap = JSONObject.parseObject(wtString, new TypeReference<Map<String, ProBasicEquipmentPoint>>() {
|
|
|
+// });
|
|
|
+// wtpAimap.put(wt.getId(),stringWindturbinetestingpointnewMap);
|
|
|
+//
|
|
|
+//
|
|
|
+// if (wpwtmap.containsKey(wt.getWindpowerstationId())){
|
|
|
+// wpwtmap.get(wt.getWindpowerstationId()).add(wt);
|
|
|
+// }else {
|
|
|
+// List<ProBasicEquipment> wps = new ArrayList<>();
|
|
|
+// wps.add(wt);
|
|
|
+// wpwtmap.put(wt.getWindpowerstationId(),wps);
|
|
|
+// }
|
|
|
+//
|
|
|
+// if (pjwtmap.containsKey(wt.getProjectId())){
|
|
|
+// pjwtmap.get(wt.getProjectId()).add(wt);
|
|
|
+// }else {
|
|
|
+// List<ProBasicEquipment> pjs = new ArrayList<>();
|
|
|
+// pjs.add(wt);
|
|
|
+// pjwtmap.put(wt.getProjectId(),pjs);
|
|
|
+// }
|
|
|
+// if (lnwtmap.containsKey(wt.getLineId())){
|
|
|
+// lnwtmap.get(wt.getLineId()).add(wt);
|
|
|
+// }else {
|
|
|
+// List<ProBasicEquipment> lnls = new ArrayList<>();
|
|
|
+// lnls.add(wt);
|
|
|
+// lnwtmap.put(wt.getLineId(),lnls);
|
|
|
+// }
|
|
|
+// if (cmwtlsmap.containsKey(wt.getCompanyId())){
|
|
|
+// cmwtlsmap.get(wt.getCompanyId()).add(wt);
|
|
|
+// }else {
|
|
|
+// List<ProBasicEquipment> cmls = new ArrayList<>();
|
|
|
+// cmls.add(wt);
|
|
|
+// cmwtlsmap.put(wt.getCompanyId(),cmls);
|
|
|
+// }
|
|
|
+// if (rgwtlsmap.containsKey(wt.getRegionId())){
|
|
|
+// rgwtlsmap.get(wt.getRegionId()).add(wt);
|
|
|
+// }else {
|
|
|
+// List<ProBasicEquipment> rgls = new ArrayList<>();
|
|
|
+// rgls.add(wt);
|
|
|
+// rgwtlsmap.put(wt.getRegionId(),rgls);
|
|
|
+// }
|
|
|
+//
|
|
|
+// if (sqwtmap.containsKey(wt.getSquareId())){
|
|
|
+// sqwtmap.get(wt.getSquareId()).add(wt);
|
|
|
+// }else {
|
|
|
+// List<ProBasicEquipment> lnls = new ArrayList<>();
|
|
|
+// lnls.add(wt);
|
|
|
+// sqwtmap.put(wt.getSquareId(),lnls);
|
|
|
+// }
|
|
|
+//
|
|
|
+// if (cmwtmap.containsKey(wt.getCompanyId())){
|
|
|
+// cmwtmap.get(wt.getCompanyId()).put(wt.getId(),wt);
|
|
|
+// }else {
|
|
|
+// Map<String,ProBasicEquipment> map=new HashMap<>();
|
|
|
+// map.put(wt.getId(),wt);
|
|
|
+// cmwtmap.put(wt.getCompanyId(),map);
|
|
|
+// }
|
|
|
+// });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //树形设备
|
|
|
+ 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()))
|
|
|
+ {
|
|
|
+ ProEconEquipmentmodel equipmentmodel = modelMap.get(wt.getModelId());
|
|
|
+ modelpower.put(wt.getId(),equipmentmodel.getPowerProduction().doubleValue());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ wtmap.put(wt.getId(),wt);
|
|
|
+ //标杆风机初始化
|
|
|
+ wtstandardmap.put(wt.getId(),wt.getId());
|
|
|
+ String wtString = redisService.get(wt.getId());
|
|
|
+ Map<String, ProBasicEquipmentPoint> stringWindturbinetestingpointnewMap = JSONObject.parseObject(wtString, new TypeReference<Map<String, ProBasicEquipmentPoint>>() {
|
|
|
+ });
|
|
|
+ wtpAimap.put(wt.getId(),stringWindturbinetestingpointnewMap);
|
|
|
+
|
|
|
+
|
|
|
+ if (wpwtmap.containsKey(wt.getOrgType().contains("STA"))){
|
|
|
+ wpwtmap.get(wt.getOrgType().contains("STA")).add(wt);
|
|
|
+ }else {
|
|
|
+ List<ProBasicOrganizeTree> wps = new ArrayList<>();
|
|
|
+ wps.add(wt);
|
|
|
+ wpwtmap.put(wt.getOrgType().contains("STA"),wps);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (pjwtmap.containsKey(wt.getOrgType().contains("EG"))){
|
|
|
+ pjwtmap.get(wt.getOrgType().contains("EG")).add(wt);
|
|
|
+ }else {
|
|
|
+ List<ProBasicOrganizeTree> pjs = new ArrayList<>();
|
|
|
+ pjs.add(wt);
|
|
|
+ pjwtmap.put(wt.getOrgType().contains("EG"),pjs);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (lnwtmap.containsKey(wt.getOrgType().contains("LN"))){
|
|
|
+ lnwtmap.get(wt.getOrgType().contains("LN")).add(wt);
|
|
|
+ }else {
|
|
|
+ List<ProBasicOrganizeTree> lnls = new ArrayList<>();
|
|
|
+ lnls.add(wt);
|
|
|
+ lnwtmap.put(wt.getOrgType().contains("LN"),lnls);
|
|
|
+ }
|
|
|
+ if (cmwtlsmap.containsKey(wt.getOrgType().contains("ZGS"))){
|
|
|
+ cmwtlsmap.get(wt.getOrgType().contains("ZGS")).add(wt);
|
|
|
+ }else {
|
|
|
+ List<ProBasicOrganizeTree> cmls = new ArrayList<>();
|
|
|
+ cmls.add(wt);
|
|
|
+ cmwtlsmap.put(wt.getOrgType().contains("ZGS"),cmls);
|
|
|
+ }
|
|
|
+ if (rgwtlsmap.containsKey(wt.getOrgType().contains("RGN"))){
|
|
|
+ rgwtlsmap.get(wt.getOrgType().contains("RGN")).add(wt);
|
|
|
+ }else {
|
|
|
+ List<ProBasicOrganizeTree> rgls = new ArrayList<>();
|
|
|
+ rgls.add(wt);
|
|
|
+ rgwtlsmap.put(wt.getOrgType().contains("RGN"),rgls);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (sqwtmap.containsKey(wt.getOrgType().contains("AG"))){
|
|
|
+ sqwtmap.get(wt.getOrgType().contains("AG")).add(wt);
|
|
|
+ }else {
|
|
|
+ List<ProBasicOrganizeTree> lnls = new ArrayList<>();
|
|
|
+ lnls.add(wt);
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+//
|
|
|
+// //初始化标杆风机
|
|
|
+// for(ProBasicEquipment wt:wtls)
|
|
|
+// {
|
|
|
+// if(wpwtmap.containsKey(wt.getLineId()))
|
|
|
+// {
|
|
|
+// List<ProBasicEquipment> wts=wpwtmap.get(wt.getLineId());
|
|
|
+// for(ProBasicEquipment w:wts)
|
|
|
+// {
|
|
|
+// if(StringUtils.notEmp(w.getIsStandard()) && w.getIsStandard()!=0)
|
|
|
+// {
|
|
|
+// wtstandardmap.put(wt.getId(),w.getId());
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// if(pjwtmap.containsKey(wt.getLineId()))
|
|
|
+// {
|
|
|
+// List<ProBasicEquipment> wts=pjwtmap.get(wt.getLineId());
|
|
|
+// for(ProBasicEquipment w:wts)
|
|
|
+// {
|
|
|
+// if(StringUtils.notEmp(w.getIsStandard()) && w.getIsStandard()!=0)
|
|
|
+// {
|
|
|
+// wtstandardmap.put(wt.getId(),w.getId());
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// if(lnwtmap.containsKey(wt.getLineId()))
|
|
|
+// {
|
|
|
+// List<ProBasicEquipment> wts=lnwtmap.get(wt.getLineId());
|
|
|
+// for(ProBasicEquipment w:wts)
|
|
|
+// {
|
|
|
+// if(StringUtils.notEmp(w.getIsStandard()) && w.getIsStandard()!=0)
|
|
|
+// {
|
|
|
+// wtstandardmap.put(wt.getId(),w.getId());
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+ //树形初始化标杆风机
|
|
|
+ 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());
|
|
|
+ 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());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+// pjls = proBasicProjectService.list().stream().filter(i-> i.getIsAble()==1).collect(Collectors.toList());
|
|
|
+// pjls.stream().forEach(p->{
|
|
|
+// pjmap.put(p.getId(),p);
|
|
|
+// if (wppromap.containsKey(p.getWindpowerstationId())){
|
|
|
+// wppromap.get(p.getWindpowerstationId()).add(p);
|
|
|
+// }else {
|
|
|
+// List<ProBasicProject> prolist = new ArrayList<>();
|
|
|
+// prolist.add(p);
|
|
|
+// wppromap.put(p.getWindpowerstationId(),prolist);
|
|
|
+// }
|
|
|
+// String pjString = redisService.get(p.getId());
|
|
|
+// Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(pjString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
+// });
|
|
|
+// propointmap.put(p.getId(),stringWindpowerstationpointnewMap);
|
|
|
+//
|
|
|
+// });
|
|
|
+
|
|
|
+
|
|
|
+ //期次场站树形
|
|
|
+ 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"))){
|
|
|
+ wppromap.get(p.getOrgType().contains("STA")).add(p);
|
|
|
+ }else {
|
|
|
+ List<ProBasicOrganizeTree> prolist = new ArrayList<>();
|
|
|
+ prolist.add(p);
|
|
|
+ wppromap.put(p.getOrgType().contains("STA"),prolist);
|
|
|
+ }
|
|
|
+ String pjString = redisService.get(p.getId());
|
|
|
+ Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(pjString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
+ });
|
|
|
+ propointmap.put(p.getId(),stringWindpowerstationpointnewMap);
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+// projmap = pjls.stream().collect(Collectors.groupingBy(ProBasicProject::getWindpowerstationId));
|
|
|
+
|
|
|
+// subwpls = proBasicSubStationService.list().stream().filter(i-> i.getIsAble()==1).collect(Collectors.toList());
|
|
|
+// subwpls.stream().forEach(sub->{
|
|
|
+//
|
|
|
+// String subString = redisService.get(sub.getId());
|
|
|
+// Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(subString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
+// });
|
|
|
+// subwppointmap.put(sub.getId(),stringWindpowerstationpointnewMap);
|
|
|
+//
|
|
|
+// });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ 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());
|
|
|
+ Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(subString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
+ });
|
|
|
+ subwppointmap.put(sub.getId(),stringWindpowerstationpointnewMap);
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ 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);
|
|
|
+
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+//
|
|
|
+// //线路
|
|
|
+// lnls = proBasicLineService.list().stream().filter(i-> StringUtils.isNotNull(pjmap.get(i.getProjectId())) && i.getIsAble()==1).collect(Collectors.toList());
|
|
|
+// lnls.stream().forEach(l->{
|
|
|
+// lnmap.put(l.getId(),l);
|
|
|
+// if (prolinemap.containsKey(l.getProjectId())){
|
|
|
+// prolinemap.get(l.getProjectId()).add(l);
|
|
|
+// }else {
|
|
|
+// List<ProBasicLine> lineList = new ArrayList<>();
|
|
|
+// lineList.add(l);
|
|
|
+// prolinemap.put(l.getProjectId(),lineList);
|
|
|
+// }
|
|
|
+// String lnString = redisService.get(l.getId());
|
|
|
+// Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(lnString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
+// });
|
|
|
+// linepointmap.put(l.getId(),stringWindpowerstationpointnewMap);
|
|
|
+// });
|
|
|
+
|
|
|
+
|
|
|
+ //树形线路
|
|
|
+ lnls = proBasicOrganizeTreeService.list().stream().filter(i-> StringUtils.isNotNull(pjmap.get(i.getOrgType().contains("EG"))) && i.getIsAble()==1).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 {
|
|
|
+ List<ProBasicOrganizeTree> lineList = new ArrayList<>();
|
|
|
+ lineList.add(l);
|
|
|
+ prolinemap.put(l.getOrgType().contains("EG"),lineList);
|
|
|
+ }
|
|
|
+ String lnString = redisService.get(l.getId());
|
|
|
+ Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(lnString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
+ });
|
|
|
+ linepointmap.put(l.getId(),stringWindpowerstationpointnewMap);
|
|
|
+ });
|
|
|
+
|
|
|
+//
|
|
|
+// zwpls = proBasicWindpowerstationService.list().stream().filter(i->i.getIsAble()==1).collect(Collectors.toList());
|
|
|
+// wpls = proBasicWindpowerstationService.list().stream().filter(i->i.getIsAble()==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);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// meterpoints = proBasicMeterPointService.list().stream().filter(i->i.getIsAble()==1).collect(Collectors.toList());
|
|
|
+// meterpoints.stream().forEach(meterpoint -> {
|
|
|
+// meterpointMap.put(meterpoint.getId(),meterpoint);
|
|
|
+// });
|
|
|
+
|
|
|
+
|
|
|
+ for(ProBasicOrganizeTree wp:wpls)
|
|
|
+ {
|
|
|
+ if (cpwpmap.containsKey(wp.getOrgType().contains("ZGS"))){
|
|
|
+ cpwpmap.get(wp.getOrgType().contains("ZGS")).add(wp);
|
|
|
+ }else {
|
|
|
+ List<ProBasicOrganizeTree> wps = new ArrayList<>();
|
|
|
+ wps.add(wp);
|
|
|
+ cpwpmap.put(wp.getOrgType().contains("ZGS"),wps);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ meterpoints = proBasicMeterPointService.list().stream().filter(i->i.getIsAble()==1).collect(Collectors.toList());
|
|
|
+ meterpoints.stream().forEach(meterpoint -> {
|
|
|
+ meterpointMap.put(meterpoint.getId(),meterpoint);
|
|
|
+ });
|
|
|
+
|
|
|
+// wpls.stream().forEach(wp->{
|
|
|
+//
|
|
|
+// wpmap.put(wp.getId(),wp);
|
|
|
+// String wpString = redisService.get(wp.getId());
|
|
|
+// Map<String, ProBasicPowerstationPoint> stringMapMap = JSONObject.parseObject(wpString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
+// });
|
|
|
+// wppointmap.put(wp.getId(),stringMapMap);
|
|
|
+// });
|
|
|
+
|
|
|
+ wpls.stream().forEach(wp->{
|
|
|
+
|
|
|
+ wpmap.put(wp.getId(),wp);
|
|
|
+ String wpString = redisService.get(wp.getId());
|
|
|
+ Map<String, ProBasicPowerstationPoint> stringMapMap = JSONObject.parseObject(wpString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
+ });
|
|
|
+ wppointmap.put(wp.getId(),stringMapMap);
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+// if (!wpls.isEmpty()) {
|
|
|
+// for (ProBasicPowerstation wp : wpls) {
|
|
|
+// if (wp.getId().endsWith("FDC_STA")) {
|
|
|
+// wplsf.add(wp);
|
|
|
+// }
|
|
|
+// if (wp.getId().endsWith("GDC_STA")) {
|
|
|
+// wplsG.add(wp);
|
|
|
+// }
|
|
|
+//
|
|
|
+// if(wpmapls.containsKey(wp.getId()))
|
|
|
+// {
|
|
|
+// List<ProBasicPowerstation> ls=wpmapls.get(wp.getId());
|
|
|
+// ls.add(wp);
|
|
|
+// wpmapls.put(wp.getId(),ls);
|
|
|
+// }else {
|
|
|
+// List<ProBasicPowerstation> ls=new ArrayList<>();
|
|
|
+// ls.add(wp);
|
|
|
+// wpmapls.put(wp.getId(),ls);
|
|
|
+// }
|
|
|
+//
|
|
|
+// wpmap.put(wp.getId(),wp);
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+ if (!wpls.isEmpty()) {
|
|
|
+ for (ProBasicOrganizeTree wp : wpls) {
|
|
|
+ if (wp.getEleType().contains("F")) {
|
|
|
+ wplsf.add(wp);
|
|
|
+ }
|
|
|
+ if (wp.getEleType().contains("G")) {
|
|
|
+ wplsG.add(wp);
|
|
|
+ }
|
|
|
+
|
|
|
+ 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<>();
|
|
|
+ ls.add(wp);
|
|
|
+ wpmapls.put(wp.getId(),ls);
|
|
|
+ }
|
|
|
+
|
|
|
+ wpmap.put(wp.getId(),wp);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ String llglString = redisService.get("ZLLGL");
|
|
|
+ theoreticalPowerMap = JSONObject.parseObject(llglString, new TypeReference<Map<String, Map<Double,ProBasicModelPowerRd>>>() {
|
|
|
+ });
|
|
|
+
|
|
|
+ llglString = redisService.get("ZLLGLLS");
|
|
|
+ theoreticalPowerList= JSONObject.parseObject(llglString, new TypeReference<List<ProBasicModelPowerRd>>() {
|
|
|
+ });
|
|
|
+
|
|
|
+ String sszzt = redisService.get("SSZZT");
|
|
|
+ statusMap = JSONObject.parseObject(sszzt, new TypeReference<Map<String,List<ProBasicStatusPoint>>>() {
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ logger.info("缓存结束------------------------------------------------------------");
|
|
|
+ }
|
|
|
+}
|