123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649 |
- package com.gyee.intial;
- import java.util.ArrayList;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- import org.apache.log4j.Logger;
- import org.springframework.beans.factory.InitializingBean;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Component;
- import com.gyee.model.Electricaltestingpointai;
- import com.gyee.model.Electricaltestingpointdi;
- import com.gyee.model.Equipmentmodel;
- import com.gyee.model.Line;
- import com.gyee.model.Meterpoint;
- import com.gyee.model.Mismap;
- import com.gyee.model.Project;
- import com.gyee.model.Stoptype;
- import com.gyee.model.Warning2;
- import com.gyee.model.WindPowerStationTestingPoint2;
- import com.gyee.model.WindTurbineTestingPointAi2;
- import com.gyee.model.WindTurbineTestingPointDi2;
- import com.gyee.model.Windpowerstation;
- import com.gyee.model.Windturbine;
- import com.gyee.model.WindturbineParts;
- import com.gyee.model.Windturbinepowercurvefitting;
- import com.gyee.service.ElectricaltestingpointaiService;
- import com.gyee.service.ElectricaltestingpointdiService;
- import com.gyee.service.EquipmentmodelService;
- import com.gyee.service.LineService;
- import com.gyee.service.MismapService;
- import com.gyee.service.ProjectService;
- import com.gyee.service.StopTypeService;
- import com.gyee.service.WarningBaseService;
- import com.gyee.service.WindPowerStationService;
- import com.gyee.service.WindPowerStationTestingPointService;
- import com.gyee.service.WindTurbineService;
- import com.gyee.service.WindTurbineTestingPointAIService;
- import com.gyee.service.WindTurbineTestingPointDIService;
- import com.gyee.service.WindturbinePartsService;
- import com.gyee.service.YjIdTransformService;
- import com.gyee.util.QueryOrder;
- @Component
- // public class CacheContext {
- public class CacheContext implements InitializingBean {
- private Logger logger = Logger.getLogger(this.getClass().getName());
- @Autowired
- private QueryCacheServcie queryCacheServcie;
- @Autowired
- private WindPowerStationService windPowerStationService;
- @Autowired
- private WindTurbineService windTurbineService;
- @Autowired
- private WindPowerStationTestingPointService windPowerStationTestingPointService;
- @Autowired
- private ElectricaltestingpointaiService electricaltestingpointaiService;
- @Autowired
- private ElectricaltestingpointdiService electricaltestingpointdiService;
- @Autowired
- private WindTurbineTestingPointAIService windTurbineTestingPointAIService;
- @Autowired
- private WindTurbineTestingPointDIService windTurbineTestingPointDIService;
- @Autowired
- private YjIdTransformService yjIdTransformService;
- @Autowired
- private EquipmentmodelService windturbinemodelService;
- @Autowired
- private WarningBaseService warningBaseService;
- @Autowired
- private ProjectService projectService;
- @Autowired
- private LineService lineService;
- @Autowired
- private StopTypeService stopTypeService;
- @Autowired
- private MismapService mismapService;
- @Autowired
- private WindturbinePartsService windturbinePartsService;
- public static Map<String, String> mismap = new HashMap<String, String>(); // 停机类型
- public static Map<String, Stoptype> stmap = new HashMap<String, Stoptype>(); // 停机类型
- public static Map<String, WindturbineParts> sttmap = new HashMap<String, WindturbineParts>(); // 停机类型
- public static Map<String, Windpowerstation> wpmap = new HashMap<String, Windpowerstation>(); // 风电场MAP
- public static Map<String, Windturbine> wtmap = new HashMap<String, Windturbine>(); // 风电机MAP
- public static Map<String, List<Windturbine>> wtsmap = new HashMap<String, List<Windturbine>>(); // 风电场MAP风电机LIST集合
- public static Map<String, Map<String, WindPowerStationTestingPoint2>> stationPointmap = new HashMap<String, Map<String, WindPowerStationTestingPoint2>>();// 场站测点
- public static Map<String, Map<String, WindTurbineTestingPointAi2>> wtpAimap = new HashMap<String, Map<String, WindTurbineTestingPointAi2>>();// 风电机测点AI表
- public static Map<String, Map<String, WindTurbineTestingPointDi2>> wtpDimap = new HashMap<String, Map<String, WindTurbineTestingPointDi2>>();// 风电机测点AI表
- public static Map<String, List<WindPowerStationTestingPoint2>> wppointsmap = new HashMap<String, List<WindPowerStationTestingPoint2>>(); // 风电场MAP风电机LIST集合
- public static Map<String, List<WindTurbineTestingPointAi2>> wtaipointsmap = new HashMap<String, List<WindTurbineTestingPointAi2>>(); // 风电场MAP风电机LIST集合
- public static Map<String, List<WindTurbineTestingPointDi2>> wtdipointsmap = new HashMap<String, List<WindTurbineTestingPointDi2>>(); // 风电场MAP风电机LIST集合
- public static Map<String, List<Electricaltestingpointai>> eleaipointsmap = new HashMap<String, List<Electricaltestingpointai>>(); // 风电场MAP风电机LIST集合
- public static Map<String, List<Electricaltestingpointdi>> eledipointsmap = new HashMap<String, List<Electricaltestingpointdi>>(); // 风电场MAP风电机LIST集合
- public static Map<String, Project> pjmap = new HashMap<String, Project>(); // 项目MAP
- public static Map<String, List<Project>> pjsmap = new HashMap<String, List<Project>>(); // 通过风场编号获得所属项目
- public static Map<String, Equipmentmodel> mlmap = new HashMap<String, Equipmentmodel>();// 风电机模型
- public static List<Equipmentmodel> mlls = new ArrayList<Equipmentmodel>();// 风电机模型LIST集合\
- public static List<Stoptype> stls = new ArrayList<Stoptype>();; // 停机类型
- public static List<WindturbineParts> sttls = new ArrayList<WindturbineParts>();; // 停机类型
- public static List<Windpowerstation> wpls = new ArrayList<Windpowerstation>(); // 风电场LIST集合
- public static List<Windturbine> wtls = new ArrayList<Windturbine>(); // 风电机LIST集合
- public static Map<String, String> gyeeidmap = new HashMap<String, String>();
- public static Map<String, String> yjidmap = new HashMap<String, String>();
- public static Map<String, Line> linemap = new HashMap<String, Line>(); // 线路MAP
- public static List<WindPowerStationTestingPoint2> wppointls = new ArrayList<WindPowerStationTestingPoint2>();
- public static List<WindPowerStationTestingPoint2> wpjsls = new ArrayList<WindPowerStationTestingPoint2>();
- public static List<WindPowerStationTestingPoint2> wppowerls = new ArrayList<WindPowerStationTestingPoint2>();
- public static List<Electricaltestingpointai> etails = new ArrayList<Electricaltestingpointai>();
- public static List<Electricaltestingpointdi> etdils = new ArrayList<Electricaltestingpointdi>();
- public static List<WindTurbineTestingPointAi2> wtails = new ArrayList<WindTurbineTestingPointAi2>();
- public static List<WindTurbineTestingPointDi2> wtdils = new ArrayList<WindTurbineTestingPointDi2>();
- public static List<Meterpoint> mpls = new ArrayList<Meterpoint>();
- public static List<Project> pjls = new ArrayList<Project>(); // 项目LIST集合
- public static Map<String, Warning2> warnnamemap = new HashMap<String, Warning2>(); // 报警按中文描述map
- public static Map<String, Warning2> warnmap = new HashMap<String, Warning2>(); // 报警
- public static List<Warning2> warnls = new ArrayList<Warning2>(); // 报警LIST集合
- public static List<Line> linels = new ArrayList<Line>(); // 线路LIST集合
-
- public static Map<String, Map<Double, Windturbinepowercurvefitting>> wtfitmap = new HashMap<>();
- @Override
- public void afterPropertiesSet() throws Exception {
- logger.info("初始化关系型数据库基础数据开始!......");
-
- List<Mismap> misls=mismapService.findAll();
-
- if (!misls.isEmpty()) {
- for (Mismap st : misls) {
- mismap.put(st.getSiskey(), st.getMiskey());
- }
- }
- stls = stopTypeService.findAll();
- if (!stls.isEmpty()) {
- for (Stoptype st : stls) {
- stmap.put(st.getId(), st);
- }
- }
- sttls = windturbinePartsService.getWindturbinePartsList();
- if (!sttls.isEmpty()) {
- for (WindturbineParts wp : sttls) {
- sttmap.put(wp.getId(), wp);
- }
- }
- // long startStamp = System.currentTimeMillis();
- wpls = windPowerStationService.findAll(QueryOrder.asc("ordernum"));
- for (Windpowerstation wp : wpls) {
- wpmap.put(wp.getId(), wp);
- }
- wtls = windTurbineService.findAll(QueryOrder.asc("id"));
- if (!wtls.isEmpty()) {
- List<Windturbine> list = null;
- for (Windturbine wt : wtls) {
- wtmap.put(wt.getId(), wt);
- if (wtsmap.containsKey(wt.getWindpowerstationid())) {
- list = wtsmap.get(wt.getWindpowerstationid());
- list.add(wt);
- } else {
- list = new ArrayList<Windturbine>();
- list.add(wt);
- wtsmap.put(wt.getWindpowerstationid(), list);
- }
- }
- }
- // wppointls = queryCacheServcie.findWpPointALL();
- // etails=queryCacheServcie.findEtAiPointALL();
- // etdils = queryCacheServcie.findEtDiPointALL();
- // wtails = queryCacheServcie.findWtAiPointALL();
- // wtdils = queryCacheServcie.findWtDiPointALL();
- // mpls = queryCacheServcie.findMeterpointALL();
- // for(WindPowerStationTestingPoint2 wppoint:wppointls)
- // {
- // if(wppoint.getRealtimeid().equals("GDNX.JSFW"))
- // {
- // wpjsls.add(wppoint);
- // }else {
- // wppowerls.add(wppoint);
- // }
- //
- // }
- // stationPointmap = queryCacheServcie.findWpPointMap();
- wtpAimap = queryCacheServcie.findWtAiPointMap();
- wtpDimap = queryCacheServcie.findWtDiPointMap();
- //
- //// wppointsmap = queryCacheServcie.findWpPointList();
- //// wtaipointsmap = queryCacheServcie.findWtAiPointList();
- //// wtdipointsmap= queryCacheServcie.findWtDiPointList();
- ////
- //// eleaipointsmap =
- // queryCacheServcie.findElectricaltestingpointAiList();
- //// eledipointsmap =
- // queryCacheServcie.findElectricaltestingpointDiList();
- //
- // gyeeidmap=yjIdTransformService.getGyeeMapInfo();
- // yjidmap=yjIdTransformService.getYjMapInfo();
- mlls = windturbinemodelService.findAll();
- if (!mlls.isEmpty()) {
- for (Equipmentmodel model : mlls) {
- mlmap.put(model.getId(), model);
- }
- }
- warnls = warningBaseService.findAll();
- if (!warnls.isEmpty()) {
- for (Warning2 warn : warnls) {
- warnmap.put(warn.getId(), warn);
- warnnamemap.put(warn.getChinesetext(), warn);
- }
- }
- pjls = projectService.findAll(QueryOrder.asc("code"));
- if (!pjls.isEmpty()) {
- for (Project pj : pjls) {
- pjmap.put(pj.getId(), pj);
- if (pjsmap.containsKey(pj.getWindpowerstationid())) {
- List<Project> pjls = pjsmap.get(pj.getWindpowerstationid());
- pjls.add(pj);
- pjsmap.put(pj.getWindpowerstationid(), pjls);
- } else {
- List<Project> pjls = new ArrayList<Project>();
- pjls.add(pj);
- pjsmap.put(pj.getWindpowerstationid(), pjls);
- }
- }
- }
- linels = lineService.findAll( QueryOrder.asc("id"));
- if (!linels.isEmpty()) {
- for (Line line : linels) {
- linemap.put(line.getId(), line);
- }
- }
-
- // wtfitmap=queryCacheServcie.getCurveFitMap();
- // 风机比武所用的数据封装结束
- logger.info("初始化关系型数据库基础数据完毕!......");
- }
- public Logger getLogger() {
- return logger;
- }
- public void setLogger(Logger logger) {
- this.logger = logger;
- }
- public QueryCacheServcie getQueryCacheServcie() {
- return queryCacheServcie;
- }
- public void setQueryCacheServcie(QueryCacheServcie queryCacheServcie) {
- this.queryCacheServcie = queryCacheServcie;
- }
- public WindPowerStationService getWindPowerStationService() {
- return windPowerStationService;
- }
- public void setWindPowerStationService(WindPowerStationService windPowerStationService) {
- this.windPowerStationService = windPowerStationService;
- }
- public WindTurbineService getWindTurbineService() {
- return windTurbineService;
- }
- public void setWindTurbineService(WindTurbineService windTurbineService) {
- this.windTurbineService = windTurbineService;
- }
- public WindPowerStationTestingPointService getWindPowerStationTestingPointService() {
- return windPowerStationTestingPointService;
- }
- public void setWindPowerStationTestingPointService(WindPowerStationTestingPointService windPowerStationTestingPointService) {
- this.windPowerStationTestingPointService = windPowerStationTestingPointService;
- }
- public ElectricaltestingpointaiService getElectricaltestingpointaiService() {
- return electricaltestingpointaiService;
- }
- public void setElectricaltestingpointaiService(ElectricaltestingpointaiService electricaltestingpointaiService) {
- this.electricaltestingpointaiService = electricaltestingpointaiService;
- }
- public ElectricaltestingpointdiService getElectricaltestingpointdiService() {
- return electricaltestingpointdiService;
- }
- public void setElectricaltestingpointdiService(ElectricaltestingpointdiService electricaltestingpointdiService) {
- this.electricaltestingpointdiService = electricaltestingpointdiService;
- }
- public WindTurbineTestingPointAIService getWindTurbineTestingPointAIService() {
- return windTurbineTestingPointAIService;
- }
- public void setWindTurbineTestingPointAIService(WindTurbineTestingPointAIService windTurbineTestingPointAIService) {
- this.windTurbineTestingPointAIService = windTurbineTestingPointAIService;
- }
- public WindTurbineTestingPointDIService getWindTurbineTestingPointDIService() {
- return windTurbineTestingPointDIService;
- }
- public void setWindTurbineTestingPointDIService(WindTurbineTestingPointDIService windTurbineTestingPointDIService) {
- this.windTurbineTestingPointDIService = windTurbineTestingPointDIService;
- }
- public YjIdTransformService getYjIdTransformService() {
- return yjIdTransformService;
- }
- public void setYjIdTransformService(YjIdTransformService yjIdTransformService) {
- this.yjIdTransformService = yjIdTransformService;
- }
- public static Map<String, Windpowerstation> getWpmap() {
- return wpmap;
- }
- public static void setWpmap(Map<String, Windpowerstation> wpmap) {
- CacheContext.wpmap = wpmap;
- }
- public static Map<String, Windturbine> getWtmap() {
- return wtmap;
- }
- public static void setWtmap(Map<String, Windturbine> wtmap) {
- CacheContext.wtmap = wtmap;
- }
- public static Map<String, List<Windturbine>> getWtsmap() {
- return wtsmap;
- }
- public static void setWtsmap(Map<String, List<Windturbine>> wtsmap) {
- CacheContext.wtsmap = wtsmap;
- }
- public static Map<String, Map<String, WindPowerStationTestingPoint2>> getStationPointmap() {
- return stationPointmap;
- }
- public static void setStationPointmap(Map<String, Map<String, WindPowerStationTestingPoint2>> stationPointmap) {
- CacheContext.stationPointmap = stationPointmap;
- }
- public static Map<String, Map<String, WindTurbineTestingPointAi2>> getWtpAimap() {
- return wtpAimap;
- }
- public static void setWtpAimap(Map<String, Map<String, WindTurbineTestingPointAi2>> wtpAimap) {
- CacheContext.wtpAimap = wtpAimap;
- }
- public static Map<String, Map<String, WindTurbineTestingPointDi2>> getWtpDimap() {
- return wtpDimap;
- }
- public static void setWtpDimap(Map<String, Map<String, WindTurbineTestingPointDi2>> wtpDimap) {
- CacheContext.wtpDimap = wtpDimap;
- }
- public static Map<String, List<WindPowerStationTestingPoint2>> getWppointsmap() {
- return wppointsmap;
- }
- public static void setWppointsmap(Map<String, List<WindPowerStationTestingPoint2>> wppointsmap) {
- CacheContext.wppointsmap = wppointsmap;
- }
- public static Map<String, List<WindTurbineTestingPointAi2>> getWtaipointsmap() {
- return wtaipointsmap;
- }
- public static void setWtaipointsmap(Map<String, List<WindTurbineTestingPointAi2>> wtaipointsmap) {
- CacheContext.wtaipointsmap = wtaipointsmap;
- }
- public static Map<String, List<WindTurbineTestingPointDi2>> getWtdipointsmap() {
- return wtdipointsmap;
- }
- public static void setWtdipointsmap(Map<String, List<WindTurbineTestingPointDi2>> wtdipointsmap) {
- CacheContext.wtdipointsmap = wtdipointsmap;
- }
- public static Map<String, List<Electricaltestingpointai>> getEleaipointsmap() {
- return eleaipointsmap;
- }
- public static void setEleaipointsmap(Map<String, List<Electricaltestingpointai>> eleaipointsmap) {
- CacheContext.eleaipointsmap = eleaipointsmap;
- }
- public static Map<String, List<Electricaltestingpointdi>> getEledipointsmap() {
- return eledipointsmap;
- }
- public static void setEledipointsmap(Map<String, List<Electricaltestingpointdi>> eledipointsmap) {
- CacheContext.eledipointsmap = eledipointsmap;
- }
- public static List<Windpowerstation> getWpls() {
- return wpls;
- }
- public static void setWpls(List<Windpowerstation> wpls) {
- CacheContext.wpls = wpls;
- }
- public static List<Windturbine> getWtls() {
- return wtls;
- }
- public static void setWtls(List<Windturbine> wtls) {
- CacheContext.wtls = wtls;
- }
- public static Map<String, String> getGyeeidmap() {
- return gyeeidmap;
- }
- public static void setGyeeidmap(Map<String, String> gyeeidmap) {
- CacheContext.gyeeidmap = gyeeidmap;
- }
- public static Map<String, String> getYjidmap() {
- return yjidmap;
- }
- public static void setYjidmap(Map<String, String> yjidmap) {
- CacheContext.yjidmap = yjidmap;
- }
- public static List<WindPowerStationTestingPoint2> getWppointls() {
- return wppointls;
- }
- public static void setWppointls(List<WindPowerStationTestingPoint2> wppointls) {
- CacheContext.wppointls = wppointls;
- }
- public static List<Electricaltestingpointai> getEtails() {
- return etails;
- }
- public static void setEtails(List<Electricaltestingpointai> etails) {
- CacheContext.etails = etails;
- }
- public static List<Electricaltestingpointdi> getEtdils() {
- return etdils;
- }
- public static void setEtdils(List<Electricaltestingpointdi> etdils) {
- CacheContext.etdils = etdils;
- }
- public static List<WindTurbineTestingPointAi2> getWtails() {
- return wtails;
- }
- public static void setWtails(List<WindTurbineTestingPointAi2> wtails) {
- CacheContext.wtails = wtails;
- }
- public static List<WindTurbineTestingPointDi2> getWtdils() {
- return wtdils;
- }
- public static void setWtdils(List<WindTurbineTestingPointDi2> wtdils) {
- CacheContext.wtdils = wtdils;
- }
- public EquipmentmodelService getWindturbinemodelService() {
- return windturbinemodelService;
- }
- public void setWindturbinemodelService(EquipmentmodelService windturbinemodelService) {
- this.windturbinemodelService = windturbinemodelService;
- }
- public WarningBaseService getWarningBaseService() {
- return warningBaseService;
- }
- public void setWarningBaseService(WarningBaseService warningBaseService) {
- this.warningBaseService = warningBaseService;
- }
- public ProjectService getProjectService() {
- return projectService;
- }
- public void setProjectService(ProjectService projectService) {
- this.projectService = projectService;
- }
- public LineService getLineService() {
- return lineService;
- }
- public void setLineService(LineService lineService) {
- this.lineService = lineService;
- }
- public static Map<String, Project> getPjmap() {
- return pjmap;
- }
- public static void setPjmap(Map<String, Project> pjmap) {
- CacheContext.pjmap = pjmap;
- }
- public static Map<String, List<Project>> getPjsmap() {
- return pjsmap;
- }
- public static void setPjsmap(Map<String, List<Project>> pjsmap) {
- CacheContext.pjsmap = pjsmap;
- }
- public static Map<String, Equipmentmodel> getMlmap() {
- return mlmap;
- }
- public static void setMlmap(Map<String, Equipmentmodel> mlmap) {
- CacheContext.mlmap = mlmap;
- }
- public static List<Equipmentmodel> getMlls() {
- return mlls;
- }
- public static void setMlls(List<Equipmentmodel> mlls) {
- CacheContext.mlls = mlls;
- }
- public static Map<String, Line> getLinemap() {
- return linemap;
- }
- public static void setLinemap(Map<String, Line> linemap) {
- CacheContext.linemap = linemap;
- }
- public static List<WindPowerStationTestingPoint2> getWpjsls() {
- return wpjsls;
- }
- public static void setWpjsls(List<WindPowerStationTestingPoint2> wpjsls) {
- CacheContext.wpjsls = wpjsls;
- }
- public static List<WindPowerStationTestingPoint2> getWppowerls() {
- return wppowerls;
- }
- public static void setWppowerls(List<WindPowerStationTestingPoint2> wppowerls) {
- CacheContext.wppowerls = wppowerls;
- }
- public static List<Meterpoint> getMpls() {
- return mpls;
- }
- public static void setMpls(List<Meterpoint> mpls) {
- CacheContext.mpls = mpls;
- }
- public static List<Project> getPjls() {
- return pjls;
- }
- public static void setPjls(List<Project> pjls) {
- CacheContext.pjls = pjls;
- }
- public static Map<String, Warning2> getWarnnamemap() {
- return warnnamemap;
- }
- public static void setWarnnamemap(Map<String, Warning2> warnnamemap) {
- CacheContext.warnnamemap = warnnamemap;
- }
- public static Map<String, Warning2> getWarnmap() {
- return warnmap;
- }
- public static void setWarnmap(Map<String, Warning2> warnmap) {
- CacheContext.warnmap = warnmap;
- }
- public static List<Warning2> getWarnls() {
- return warnls;
- }
- public static void setWarnls(List<Warning2> warnls) {
- CacheContext.warnls = warnls;
- }
- public static List<Line> getLinels() {
- return linels;
- }
- public static void setLinels(List<Line> linels) {
- CacheContext.linels = linels;
- }
- public StopTypeService getStopTypeService() {
- return stopTypeService;
- }
- public void setStopTypeService(StopTypeService stopTypeService) {
- this.stopTypeService = stopTypeService;
- }
- public MismapService getMismapService() {
- return mismapService;
- }
- public void setMismapService(MismapService mismapService) {
- this.mismapService = mismapService;
- }
- }
|