|
@@ -0,0 +1,730 @@
|
|
|
+package com.gyee.frame.common.spring;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.alibaba.fastjson.TypeReference;
|
|
|
+import com.gyee.frame.common.cache.IGlobalCache;
|
|
|
+import com.gyee.frame.model.auto.*;
|
|
|
+import com.gyee.frame.service.*;
|
|
|
+import com.gyee.frame.service.photovolatic.*;
|
|
|
+import org.springframework.boot.CommandLineRunner;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 服务启动前执行,进行全局变量初始化
|
|
|
+ */
|
|
|
+@Component
|
|
|
+public class InitialRunner implements CommandLineRunner {
|
|
|
+
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private SysQuartzJobService sysQuartzJobService;
|
|
|
+ @Resource
|
|
|
+ private WindpowerstationService windpowerstationService;
|
|
|
+ @Resource
|
|
|
+ private ProjectService projectService;
|
|
|
+ @Resource
|
|
|
+ private LineService lineService;
|
|
|
+ @Resource
|
|
|
+ private WindturbineService windturbineService;
|
|
|
+ @Resource
|
|
|
+ private WindPowerstationTestingPoint2Service windPowerstationTestingPoint2Service;
|
|
|
+ @Resource
|
|
|
+ private WindTurbineTestingPointAiService windTurbineTestingPointAiService;
|
|
|
+ @Resource
|
|
|
+ private WindturbinepowercurvefittingService windturbinepowercurvefittingService;
|
|
|
+ @Resource
|
|
|
+ private WarningService warningService;
|
|
|
+ @Resource
|
|
|
+ private ModelpowerRdService modelpowerRdService;
|
|
|
+ @Resource
|
|
|
+ private EquipmentmodelService equipmentmodelService;
|
|
|
+ @Resource
|
|
|
+ private WarningClassifyService warningClassifyService;
|
|
|
+ @Resource
|
|
|
+ private ManufacturerService manufacturerService;
|
|
|
+ @Resource
|
|
|
+ private ModelPowerService modelPowerService;
|
|
|
+ @Resource
|
|
|
+ private IGlobalCache globalCache;
|
|
|
+ @Resource
|
|
|
+ private StoptypeService stoptypeService;
|
|
|
+// @Resource
|
|
|
+// private TaosMapService taosMapService;
|
|
|
+ @Resource
|
|
|
+ private WindTurbineTestingPointaiyjService windTurbineTestingPointaiyjService;
|
|
|
+ @Resource
|
|
|
+ private Alertrule2ervice alertrule2ervice;
|
|
|
+ @Resource
|
|
|
+ private WindturbinepartsService windturbinepartsService;
|
|
|
+ @Resource
|
|
|
+ private SquareService squareService;
|
|
|
+ @Resource
|
|
|
+ private InverterService inverterService;
|
|
|
+ @Resource
|
|
|
+ private BoxChangeService boxChangeService;
|
|
|
+ @Resource
|
|
|
+ private JunctionboxService junctionboxService;
|
|
|
+ @Resource
|
|
|
+ private PhotovoltaicTestingPointNewService photovoltaicTestingPointNewService;
|
|
|
+ public static List<Windpowerstation> wpallls = new ArrayList<Windpowerstation>(); // 风电场LIST集合(包含光电电)
|
|
|
+ public static List<Project> pjallls = new ArrayList<Project>(); //项目LIST集合(包含光电电)
|
|
|
+ public static List<Line> lineallls = new ArrayList<Line>(); // 线路LIST集合(包含光电电)
|
|
|
+ public static List<Windturbine> wtallls = new ArrayList<Windturbine>(); // 风电机LIST集合(包含光电电)
|
|
|
+
|
|
|
+ public static List<Windpowerstation> wpls = new ArrayList<Windpowerstation>(); // 风电场LIST集合
|
|
|
+ public static List<Windpowerstation> spls = new ArrayList<Windpowerstation>(); // 光伏场LIST集合
|
|
|
+
|
|
|
+ public static List<Project> pjls = new ArrayList<Project>(); // 项目LIST集合
|
|
|
+ public static List<Line> linels = new ArrayList<Line>(); // 线路LIST集合
|
|
|
+ public static List<Windturbine> wtls = new ArrayList<Windturbine>(); // 风电机LIST集合
|
|
|
+
|
|
|
+ public static List< Alertrule2> alertrulels = new ArrayList< Alertrule2>(); // 自定义报警规则LIST集合
|
|
|
+
|
|
|
+
|
|
|
+ public static Map<String, Alertrule2> alertrulemap = new HashMap<String, Alertrule2>();//自定义报警规则MAP
|
|
|
+
|
|
|
+ public static Map<String, Windpowerstation> wpmap = new HashMap<String, Windpowerstation>();//风场(包含光电电)
|
|
|
+ public static Map<String, Project> pjmap = new HashMap<String, Project>(); // 项目MAP(包含光电电)
|
|
|
+ public static Map<String, Line> lnmap = new HashMap<String, Line>(); // 线路(包含光电电)
|
|
|
+ public static Map<String, Windturbine> wtmap = new HashMap<String, Windturbine>();//风机(包含光电电)
|
|
|
+ public static Map<String, List<Windpowerstation>> re_wpmap = new HashMap<String, List<Windpowerstation>>();
|
|
|
+ public static Map<String, Stoptype> stoptypemap = new HashMap<String, Stoptype>();//停机类型
|
|
|
+ public static List<Warning2> warnls = new ArrayList<Warning2>(); // 报警LIST集合
|
|
|
+ public static Map<String, Warning2> warningmap = new HashMap<String, Warning2>();// 报警MAP集合
|
|
|
+ public static List<Windturbineparts> windturbinepartsls = new ArrayList<Windturbineparts>();
|
|
|
+ public static Map<String, Windturbineparts> windturbinepartsmap = new HashMap<String, Windturbineparts>();
|
|
|
+ public static Map<String, Map<String, List<Warning2>>> warnmodelmap = new HashMap<>();
|
|
|
+ public static Map<String, List<Warning2>> warnmap = new HashMap<>();// 按照型号划分报警MAP集合 <型号,报警集合>
|
|
|
+ public static List<WarningClassify> warningClassls = new ArrayList<WarningClassify>(); //报警类型列表
|
|
|
+ public static Map<String, WarningClassify> warningClassifymap = new HashMap<String, WarningClassify>();
|
|
|
+ public static Map<String, Manufacturer> manufacturermap = new HashMap<String, Manufacturer>();
|
|
|
+
|
|
|
+ public static Map<String, List<Windturbine>> wp_wtmap = new HashMap<String, List<Windturbine>>();
|
|
|
+ public static Map<String, List<Windturbine>> pj_wtmap = new HashMap<String, List<Windturbine>>();
|
|
|
+ public static Map<String, List<Windturbine>> ln_wtmap = new HashMap<String, List<Windturbine>>();
|
|
|
+ public static Map<String, List<Project>> pjsmap = new HashMap<String, List<Project>>(); // 通过风场编号获得所属项目
|
|
|
+ public static Map<String, List<Line>> lnsmap = new HashMap<String, List<Line>>(); // 通过项目编号获得所属线路
|
|
|
+ public static Map<String, Map<Double, ModelpowerRd>> mprdMap = new HashMap<String, Map<Double, ModelpowerRd>>();
|
|
|
+ public static Map<String, Map<String, Windturbinetestingpointnew>> wtPointmap = new HashMap<String, Map<String, Windturbinetestingpointnew>>();// 风电机测点AI表
|
|
|
+ // public static Map<String, Map<String, Windturbinetestingpointnew>> wtPointmap = new HashMap<String, Map<String, Windturbinetestingpointnew>>();// 风电机测点AI表
|
|
|
+ public static Map<String, Map<String, Windpowerstationpointnew>> wpPointmap = new HashMap<String, Map<String, Windpowerstationpointnew>>();//场站测点
|
|
|
+ public static Map<String, Map<String, Windpowerstationpointnew>> pjPointmap = new HashMap<String, Map<String, Windpowerstationpointnew>>();//项目测点
|
|
|
+ public static Map<String, Map<String, Windpowerstationpointnew>> lnPointmap = new HashMap<String, Map<String, Windpowerstationpointnew>>();//线路测点
|
|
|
+ public static Map<String, SysQuartzJob> jobsmap = new HashMap<String, SysQuartzJob>();
|
|
|
+ public static Map<String, Map<Double, Windturbinepowercurvefitting>> wpcmap = new HashMap<String, Map<Double, Windturbinepowercurvefitting>>();
|
|
|
+ public static Map<String, Equipmentmodel> mlmap = new HashMap<String, Equipmentmodel>();// 风电机模型
|
|
|
+ public static Map<String, Map<String, ModelPower>> modelPowermap = new HashMap<String, Map<String, ModelPower>>();// 风电机类型对应功率表
|
|
|
+ public static Map<String, String> taosmap = new HashMap<String, String>(); // Taos映射
|
|
|
+ public static Map<String, Map<String, WindTurbineTestingPointaiyj>> wtpAiyjmap = new HashMap<String, Map<String, WindTurbineTestingPointaiyj>>();// 风电机测点AI表--针对风机预警
|
|
|
+ public static Map<String, Map<String, Object>> appendYcglMap = new HashMap<String, Map<String, Object>>();// 预测功率追加
|
|
|
+
|
|
|
+
|
|
|
+ public static Map<String,Integer> wppointnummap=new HashMap<>();
|
|
|
+ Map<String, Object> ycmap = new HashMap<>();
|
|
|
+
|
|
|
+ private final String QS = "0";
|
|
|
+ private final String FD = "-1";
|
|
|
+ private final String GF = "-2";
|
|
|
+
|
|
|
+
|
|
|
+ /***********************************************光伏初始化*************************************************************/
|
|
|
+ public static Map<String,Square> sqmap = new HashMap<String, Square>();
|
|
|
+
|
|
|
+
|
|
|
+ public static Map<String, List<BoxChange>> gp_xbmap = new HashMap<String, List<BoxChange>>();
|
|
|
+ public static Map<String,BoxChange> xbmap = new HashMap<String, BoxChange>();
|
|
|
+ public static Map<String, List<Inverter>> gp_nbqmap = new HashMap<String, List<Inverter>>();
|
|
|
+ public static Map<String, List<Inverter>> pj_nbqmap = new HashMap<String, List<Inverter>>();
|
|
|
+ public static Map<String, List<Inverter>> ln_nbqmap = new HashMap<String, List<Inverter>>();
|
|
|
+ public static Map<String, List<Inverter>> sq_nbqmap = new HashMap<String, List<Inverter>>();
|
|
|
+ public static Map<String,Inverter> nbqmap = new HashMap<String, Inverter>();
|
|
|
+ public static Map<String, List<Junctionbox>> gp_hlxmap = new HashMap<String, List<Junctionbox>>();
|
|
|
+ public static Map<String,Junctionbox> hlxmap = new HashMap<String, Junctionbox>();
|
|
|
+ public static Map<String, Map<String, PhotovoltaicTestingPointNew>> phPointmap = new HashMap<String, Map<String, PhotovoltaicTestingPointNew>>();// 逆变器测点
|
|
|
+ /***********************************************光伏初始化*************************************************************/
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void run(String... args) throws Exception {
|
|
|
+ System.out.println(">>>>>>>>>>>>>>>服务启动执行,换成测点关联数据 <<<<<<<<<<<<<");
|
|
|
+
|
|
|
+// List<Square> sqqls=squareService.selectAll();
|
|
|
+// if(!sqqls.isEmpty())
|
|
|
+// {
|
|
|
+// for (Square sq : sqqls) {
|
|
|
+// sqmap.put(sq.getId(),sq);
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// List<Inverter> nbqls=inverterService.selectAll();
|
|
|
+//
|
|
|
+// if(!nbqls.isEmpty())
|
|
|
+// {
|
|
|
+// for (Inverter it : nbqls) {
|
|
|
+// if (gp_nbqmap.containsKey(it.getWindpowerstationid())) {
|
|
|
+// List<Inverter> ls=gp_nbqmap.get(it.getWindpowerstationid());
|
|
|
+// ls.add(it);
|
|
|
+// gp_nbqmap.put(it.getWindpowerstationid(),ls);
|
|
|
+// }else
|
|
|
+// {
|
|
|
+// List<Inverter> ls=new ArrayList<>();
|
|
|
+// ls.add(it);
|
|
|
+// gp_nbqmap.put(it.getWindpowerstationid(),ls);
|
|
|
+// }
|
|
|
+// if (sq_nbqmap.containsKey(it.getSquareid())) {
|
|
|
+// List<Inverter> ls=sq_nbqmap.get(it.getSquareid());
|
|
|
+// ls.add(it);
|
|
|
+// sq_nbqmap.put(it.getSquareid(),ls);
|
|
|
+// }else
|
|
|
+// {
|
|
|
+// List<Inverter> ls=new ArrayList<>();
|
|
|
+// ls.add(it);
|
|
|
+// sq_nbqmap.put(it.getSquareid(),ls);
|
|
|
+// }
|
|
|
+//
|
|
|
+// if (pj_nbqmap.containsKey(it.getProjectid())) {
|
|
|
+// List<Inverter> ls = pj_nbqmap.get(it.getProjectid());
|
|
|
+// ls.add(it);
|
|
|
+// pj_nbqmap.put(it.getProjectid(), ls);
|
|
|
+// } else {
|
|
|
+// List<Inverter> ls = new ArrayList();
|
|
|
+// ls.add(it);
|
|
|
+// pj_nbqmap.put(it.getProjectid(), ls);
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+// if (ln_nbqmap.containsKey(it.getLineid())) {
|
|
|
+// List<Inverter> ls = ln_nbqmap.get(it.getLineid());
|
|
|
+// ls.add(it);
|
|
|
+// ln_nbqmap.put(it.getLineid(), ls);
|
|
|
+// } else {
|
|
|
+// List<Inverter> ls = new ArrayList();
|
|
|
+// ls.add(it);
|
|
|
+// ln_nbqmap.put(it.getLineid(), ls);
|
|
|
+// }
|
|
|
+//
|
|
|
+// nbqmap.put(it.getId(),it);
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+// List<BoxChange> xbls=boxChangeService.selectAll();
|
|
|
+//
|
|
|
+// if(!xbls.isEmpty())
|
|
|
+// {
|
|
|
+// for (BoxChange it : xbls) {
|
|
|
+// if (gp_xbmap.containsKey(it.getWindpowerstationid())) {
|
|
|
+// List<BoxChange> ls=gp_xbmap.get(it.getWindpowerstationid());
|
|
|
+// ls.add(it);
|
|
|
+// gp_xbmap.put(it.getWindpowerstationid(),ls);
|
|
|
+// }else
|
|
|
+// {
|
|
|
+// List<BoxChange> ls=new ArrayList<>();
|
|
|
+// ls.add(it);
|
|
|
+// gp_xbmap.put(it.getWindpowerstationid(),ls);
|
|
|
+// }
|
|
|
+//
|
|
|
+// xbmap.put(it.getId(),it);
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// List<Junctionbox> hlxls=junctionboxService.selectAll();
|
|
|
+//
|
|
|
+// if(!hlxls.isEmpty())
|
|
|
+// {
|
|
|
+// for (Junctionbox it : hlxls) {
|
|
|
+// if (gp_hlxmap.containsKey(it.getWindpowerstationid())) {
|
|
|
+// List<Junctionbox> ls=gp_hlxmap.get(it.getWindpowerstationid());
|
|
|
+// ls.add(it);
|
|
|
+// gp_hlxmap.put(it.getWindpowerstationid(),ls);
|
|
|
+// }else
|
|
|
+// {
|
|
|
+// List<Junctionbox> ls=new ArrayList<>();
|
|
|
+// ls.add(it);
|
|
|
+// gp_hlxmap.put(it.getWindpowerstationid(),ls);
|
|
|
+// }
|
|
|
+// hlxmap.put(it.getId(),it);
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// List<PhotovoltaicTestingPointNew> phls=photovoltaicTestingPointNewService.selectAll();
|
|
|
+//
|
|
|
+// if(!phls.isEmpty())
|
|
|
+// {
|
|
|
+// for(PhotovoltaicTestingPointNew mp : phls){
|
|
|
+//
|
|
|
+// if(mp.getTypes().equals(PhotoVolaticType.XB))
|
|
|
+// {
|
|
|
+//
|
|
|
+// if(phPointmap.containsKey(mp.getBoxchangeid())){
|
|
|
+// Map<String, PhotovoltaicTestingPointNew> map = phPointmap.get(mp.getBoxchangeid());
|
|
|
+// map.put(mp.getUniformcode(), mp);
|
|
|
+// phPointmap.put(mp.getBoxchangeid(), map);
|
|
|
+// }else{
|
|
|
+// Map<String, PhotovoltaicTestingPointNew> map = new HashMap<String, PhotovoltaicTestingPointNew>();
|
|
|
+// map.put(mp.getUniformcode(), mp);
|
|
|
+// phPointmap.put(mp.getBoxchangeid(), map);
|
|
|
+// }
|
|
|
+// }else if(mp.getTypes().equals(PhotoVolaticType.NBQ))
|
|
|
+// {
|
|
|
+//
|
|
|
+// if(phPointmap.containsKey(mp.getInverterid())){
|
|
|
+// Map<String, PhotovoltaicTestingPointNew> map = phPointmap.get(mp.getInverterid());
|
|
|
+// map.put(mp.getUniformcode(), mp);
|
|
|
+// phPointmap.put(mp.getInverterid(), map);
|
|
|
+// }else{
|
|
|
+// Map<String, PhotovoltaicTestingPointNew> map = new HashMap<String, PhotovoltaicTestingPointNew>();
|
|
|
+// map.put(mp.getUniformcode(), mp);
|
|
|
+// phPointmap.put(mp.getInverterid(), map);
|
|
|
+// }
|
|
|
+// }else if(mp.getTypes().equals(PhotoVolaticType.HLX))
|
|
|
+// {
|
|
|
+//
|
|
|
+// if(phPointmap.containsKey(mp.getJunctionboxid())){
|
|
|
+// Map<String, PhotovoltaicTestingPointNew> map = phPointmap.get(mp.getJunctionboxid());
|
|
|
+// map.put(mp.getUniformcode(), mp);
|
|
|
+// phPointmap.put(mp.getJunctionboxid(), map);
|
|
|
+// }else{
|
|
|
+// Map<String, PhotovoltaicTestingPointNew> map = new HashMap<String, PhotovoltaicTestingPointNew>();
|
|
|
+// map.put(mp.getUniformcode(), mp);
|
|
|
+// phPointmap.put(mp.getJunctionboxid(), map);
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
+// }
|
|
|
+ //配置追加功率曲线测点
|
|
|
+ Map<String, Object> ycmap = new HashMap<>();
|
|
|
+
|
|
|
+ String[] ycPoints4 = Constant.TPOINT_QS3_YGCL4.split(",");
|
|
|
+ String[] ycPoints24 = Constant.TPOINT_QS3_YGCL24.split(",");
|
|
|
+ //添加预测风速第一个点,存储到当前的历史值
|
|
|
+ ycmap.put("cdq1", "SLFGL.NX_GD_QSF_YC_P1_L1_001_CDQ001");
|
|
|
+ ycmap.put("dq1","SLFGL.NX_GD_QSF_YC_P1_L1_001_DQ0001");
|
|
|
+ //添加预测功率后续预测点字符串数组,实时数据
|
|
|
+ ycmap.put("cdq2", ycPoints4);
|
|
|
+ ycmap.put("dq2", ycPoints24);
|
|
|
+
|
|
|
+ appendYcglMap.put("QS_FDC", ycmap);
|
|
|
+
|
|
|
+ List< Alertrule2> alertrulels =alertrule2ervice.getAlertruleAllList();
|
|
|
+ if(!alertrulels.isEmpty())
|
|
|
+ {
|
|
|
+ for(Alertrule2 ar:alertrulels)
|
|
|
+ {
|
|
|
+ alertrulemap.put(ar.getName(),ar);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ windturbinepartsls=windturbinepartsService.findAll();
|
|
|
+ if(!windturbinepartsls.isEmpty())
|
|
|
+ {
|
|
|
+ for(Windturbineparts wp:windturbinepartsls)
|
|
|
+ {
|
|
|
+ windturbinepartsmap.put(wp.getId(),wp);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ List<SysQuartzJob> quartzJobs=sysQuartzJobService.selectByExample(new SysQuartzJobExample());
|
|
|
+
|
|
|
+ if(!quartzJobs.isEmpty())
|
|
|
+ {
|
|
|
+ for(SysQuartzJob sysQuartzJob:quartzJobs){
|
|
|
+
|
|
|
+ jobsmap.put(sysQuartzJob.getId(),sysQuartzJob);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ List<WindTurbineTestingPointaiyj> list = windTurbineTestingPointaiyjService.findAll();
|
|
|
+
|
|
|
+ Map<String, WindTurbineTestingPointaiyj> yjmap = null;
|
|
|
+
|
|
|
+ if (list != null && !list.isEmpty()) {
|
|
|
+ for (WindTurbineTestingPointaiyj mp : list) {
|
|
|
+ if (wtpAiyjmap.containsKey(mp.getWindturbineid())) {
|
|
|
+ yjmap = wtpAiyjmap.get(mp.getWindturbineid());
|
|
|
+ yjmap.put(mp.getUniformcode(), mp);
|
|
|
+ } else {
|
|
|
+ yjmap = new HashMap<String, WindTurbineTestingPointaiyj>();
|
|
|
+ yjmap.put(mp.getUniformcode(), mp);
|
|
|
+ wtpAiyjmap.put(mp.getWindturbineid(), yjmap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ String wpString = JSON.toJSONString(globalCache.get("PRODUCT-WP"));
|
|
|
+ wpPointmap = JSONObject.parseObject(wpString, new TypeReference<Map<String, Map<String, Windpowerstationpointnew>>>() {
|
|
|
+ });
|
|
|
+ String pjString = JSON.toJSONString(globalCache.get("PRODUCT-PJ"));
|
|
|
+ pjPointmap = JSONObject.parseObject(pjString, new TypeReference<Map<String, Map<String, Windpowerstationpointnew>>>() {
|
|
|
+ });
|
|
|
+ String lnString = JSON.toJSONString(globalCache.get("PRODUCT-LN"));
|
|
|
+ lnPointmap = JSONObject.parseObject(lnString, new TypeReference<Map<String, Map<String, Windpowerstationpointnew>>>() {
|
|
|
+ });
|
|
|
+
|
|
|
+ String wtString = JSON.toJSONString(globalCache.get("PRODUCT-WT"));
|
|
|
+ wtPointmap = JSONObject.parseObject(wtString, new TypeReference<Map<String, Map<String, Windturbinetestingpointnew>>>() {
|
|
|
+ });
|
|
|
+ String wpcmapString = (String)(globalCache.get("wpcmap"));
|
|
|
+ wpcmap = JSONObject.parseObject(wpcmapString, new TypeReference<Map<String, Map<Double, Windturbinepowercurvefitting>>>() {
|
|
|
+ });
|
|
|
+
|
|
|
+ WindpowerstationExample windpowerstationExample = new WindpowerstationExample();
|
|
|
+ windpowerstationExample.setOrderByClause("ordernum ASC");
|
|
|
+// windpowerstationExample.createCriteria().andIdNotLike("%SY_FDC%");
|
|
|
+ wpallls = windpowerstationService.selectByExample(windpowerstationExample);
|
|
|
+// if (!wpallls.isEmpty()) {
|
|
|
+// for (Windpowerstation wp : wpallls) {
|
|
|
+// if (wp.getId().endsWith("FDC")) {
|
|
|
+// wpls.add(wp);
|
|
|
+// }
|
|
|
+// if (wp.getId().endsWith("GDC")) {
|
|
|
+// spls.add(wp);
|
|
|
+// }
|
|
|
+// wpmap.put(wp.getId(), wp);
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+ if (!wpallls.isEmpty()) {
|
|
|
+ for (Windpowerstation wp : wpallls) {
|
|
|
+ if (wp.getId().endsWith("FDC")) {
|
|
|
+ wpls.add(wp);
|
|
|
+ }
|
|
|
+ if (wp.getId().endsWith("GDC")) {
|
|
|
+ spls.add(wp);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(re_wpmap.containsKey(wp.getCompanyid()+QS))
|
|
|
+ {
|
|
|
+ List<Windpowerstation> ls=re_wpmap.get(wp.getCompanyid()+QS);
|
|
|
+ ls.add(wp);
|
|
|
+ re_wpmap.put(wp.getCompanyid()+QS,ls);
|
|
|
+ }else {
|
|
|
+ List<Windpowerstation> ls=new ArrayList<>();
|
|
|
+ ls.add(wp);
|
|
|
+ re_wpmap.put(wp.getCompanyid()+QS,ls);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if(re_wpmap.containsKey(wp.getCompanyid()+FD))
|
|
|
+ {
|
|
|
+ List<Windpowerstation> ls=re_wpmap.get(wp.getCompanyid()+FD);
|
|
|
+ if(wp.getId().endsWith("FDC"))
|
|
|
+ {
|
|
|
+ ls.add(wp);
|
|
|
+ re_wpmap.put(wp.getCompanyid()+FD,ls);
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ List<Windpowerstation> ls=new ArrayList<>();
|
|
|
+ if(wp.getId().endsWith("FDC"))
|
|
|
+ {
|
|
|
+ ls.add(wp);
|
|
|
+ re_wpmap.put(wp.getCompanyid()+FD,ls);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(re_wpmap.containsKey(wp.getCompanyid()+GF))
|
|
|
+ {
|
|
|
+ List<Windpowerstation> ls=re_wpmap.get(wp.getCompanyid()+GF);
|
|
|
+ if(wp.getId().endsWith("GDC"))
|
|
|
+ {
|
|
|
+ ls.add(wp);
|
|
|
+ re_wpmap.put(wp.getCompanyid()+GF,ls);
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ List<Windpowerstation> ls=new ArrayList<>();
|
|
|
+ if(wp.getId().endsWith("GDC"))
|
|
|
+ {
|
|
|
+ ls.add(wp);
|
|
|
+ re_wpmap.put(wp.getCompanyid()+GF,ls);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ wpmap.put(wp.getId(), wp);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ ProjectExample projectExample = new ProjectExample();
|
|
|
+ projectExample.setOrderByClause("ordernum ASC");
|
|
|
+// projectExample.createCriteria().andWindpowerstationidNotLike("%SY_FDC%");
|
|
|
+ pjallls = projectService.selectByExample(projectExample);
|
|
|
+
|
|
|
+ if (!pjallls.isEmpty()) {
|
|
|
+ for (Project pj : pjallls) {
|
|
|
+ pjmap.put(pj.getId(), pj);
|
|
|
+ if (pj.getWindpowerstationid().endsWith("FDC")) {
|
|
|
+ pjls.add(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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ LineExample lineExample = new LineExample();
|
|
|
+ lineExample.setOrderByClause("ordernum ASC");
|
|
|
+ lineExample.createCriteria().getAllCriteria();
|
|
|
+ lineallls = lineService.selectByExample(lineExample);
|
|
|
+
|
|
|
+ if (!lineallls.isEmpty()) {
|
|
|
+ for (Line ln : lineallls) {
|
|
|
+ lnmap.put(ln.getId(), ln);
|
|
|
+ if (pjmap.containsKey(ln.getProjectid())) {
|
|
|
+ Project pj = pjmap.get(ln.getProjectid());
|
|
|
+ if (pj.getWindpowerstationid().endsWith("FDC")) {
|
|
|
+ linels.add(ln);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (lnsmap.containsKey(ln.getProjectid())) {
|
|
|
+ List<Line> lnls = lnsmap.get(ln.getProjectid());
|
|
|
+ lnls.add(ln);
|
|
|
+ lnsmap.put(ln.getProjectid(), lnls);
|
|
|
+ } else {
|
|
|
+ List<Line> lnls = new ArrayList<Line>();
|
|
|
+ lnls.add(ln);
|
|
|
+ lnsmap.put(ln.getProjectid(), lnls);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ WindturbineExample windturbineExample = new WindturbineExample();
|
|
|
+ windturbineExample.setOrderByClause("ID ASC");
|
|
|
+
|
|
|
+ wtallls = windturbineService.selectByExample(windturbineExample);
|
|
|
+
|
|
|
+ if (!wtallls.isEmpty()) {
|
|
|
+ for (Windturbine wt : wtallls) {
|
|
|
+ if (wpmap.containsKey(wt.getWindpowerstationid())) {
|
|
|
+ if (wt.getWindpowerstationid().endsWith("FDC")) {
|
|
|
+ wtls.add(wt);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ wtmap.put(wt.getId(), wt);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ mprdMap = modelpowerRdService.getModelpowerRdAllMap();
|
|
|
+
|
|
|
+ StoptypeExample stoptypeExample = new StoptypeExample();
|
|
|
+ stoptypeExample.setOrderByClause("name ASC");
|
|
|
+
|
|
|
+ List<Stoptype> stoptypels = stoptypeService.selectByExample(stoptypeExample);
|
|
|
+ if (stoptypels != null && !stoptypels.isEmpty()) {
|
|
|
+ for (int i = 0; i < stoptypels.size(); i++) {
|
|
|
+ stoptypemap.put(stoptypels.get(i).getId(),stoptypels.get(i));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+// WindturbinepowercurvefittingExample windturbinepowercurvefittingExample=new WindturbinepowercurvefittingExample();
|
|
|
+// windturbinepowercurvefittingExample.setOrderByClause("WINDTURBINEID ASC,speed ASC");
|
|
|
+// List<Windturbinepowercurvefitting> wpclist= windturbinepowercurvefittingService.selectByExample(windturbinepowercurvefittingExample);
|
|
|
+//
|
|
|
+// if (!wpclist.isEmpty()) {
|
|
|
+// for (Windturbinepowercurvefitting wc : wpclist) {
|
|
|
+// if (wpcmap.containsKey(wc.getWindturbineid())) {
|
|
|
+// Map<Double, Windturbinepowercurvefitting> map = wpcmap.get(wc.getWindturbineid());
|
|
|
+// map.put(wc.getSpeed(), wc);
|
|
|
+// } else {
|
|
|
+// Map<Double, Windturbinepowercurvefitting> map = new HashMap<Double, Windturbinepowercurvefitting>();
|
|
|
+// map.put(wc.getSpeed(), wc);
|
|
|
+// wpcmap.put(wc.getWindturbineid(), map);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+ Warning2Example warningExample = new Warning2Example();
|
|
|
+ warningExample.setOrderByClause("id ASC");
|
|
|
+
|
|
|
+ Warning2Example.Criteria criteria = warningExample.createCriteria();
|
|
|
+ criteria.andEdnavalueNotEqualTo(0);
|
|
|
+ criteria.andWarningclassifyidIsNotNull();
|
|
|
+ warnls = warningService.selectByExample(warningExample);
|
|
|
+
|
|
|
+ if (warnls != null && !warnls.isEmpty()) {
|
|
|
+ for (int i = 0; i < warnls.size(); i++) {
|
|
|
+ Warning2 warning = warnls.get(i);
|
|
|
+
|
|
|
+ if (warnmodelmap.containsKey(warning.getModelid())) {
|
|
|
+ Map<String, List<Warning2>> map = warnmodelmap.get(warning.getModelid());
|
|
|
+ if(map.containsKey(warning.getWarningclassifyid()))
|
|
|
+ {
|
|
|
+ List<Warning2> ls =map.get(warning.getWarningclassifyid());
|
|
|
+ ls.add(warning);
|
|
|
+ map.put(warning.getWarningclassifyid(), ls);
|
|
|
+ }else
|
|
|
+ {
|
|
|
+ List<Warning2> ls = new ArrayList<>();
|
|
|
+ ls.add(warning);
|
|
|
+ map.put(warning.getWarningclassifyid(), ls);
|
|
|
+ }
|
|
|
+ warnmodelmap.put(warning.getModelid(),map);
|
|
|
+ } else {
|
|
|
+ Map<String, List<Warning2>> map = new HashMap<>();
|
|
|
+ List<Warning2> ls = new ArrayList<>();
|
|
|
+ ls.add(warning);
|
|
|
+ map.put(warning.getWarningclassifyid(), ls);
|
|
|
+ warnmodelmap.put(warning.getModelid(),map);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (warnmap.containsKey(warning.getModelid())) {
|
|
|
+ List<Warning2> ls =warnmap.get(warning.getModelid());
|
|
|
+ ls.add(warning);
|
|
|
+ warnmap.put(warning.getModelid(),ls);
|
|
|
+ } else {
|
|
|
+ List<Warning2> ls =new ArrayList<>();
|
|
|
+ ls.add(warning);
|
|
|
+ warnmap.put(warning.getModelid(),ls);
|
|
|
+ }
|
|
|
+
|
|
|
+ warningmap.put(warning.getId(), warning);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (wtallls != null && !wtallls.isEmpty()) {
|
|
|
+
|
|
|
+ for (int i = 0; i < wtallls.size(); i++) {
|
|
|
+
|
|
|
+ Windturbine point = wtallls.get(i);
|
|
|
+ if (wp_wtmap.containsKey(point.getWindpowerstationid())) {
|
|
|
+ List<Windturbine> ls = wp_wtmap.get(point.getWindpowerstationid());
|
|
|
+ ls.add(point);
|
|
|
+ wp_wtmap.put(point.getWindpowerstationid(), ls);
|
|
|
+ } else {
|
|
|
+ List<Windturbine> ls = new ArrayList();
|
|
|
+ ls.add(point);
|
|
|
+ wp_wtmap.put(point.getWindpowerstationid(), ls);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (pj_wtmap.containsKey(point.getProjectid())) {
|
|
|
+ List<Windturbine> ls = pj_wtmap.get(point.getProjectid());
|
|
|
+ ls.add(point);
|
|
|
+ pj_wtmap.put(point.getProjectid(), ls);
|
|
|
+ } else {
|
|
|
+ List<Windturbine> ls = new ArrayList();
|
|
|
+ ls.add(point);
|
|
|
+ pj_wtmap.put(point.getProjectid(), ls);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (ln_wtmap.containsKey(point.getLineid())) {
|
|
|
+ List<Windturbine> ls = ln_wtmap.get(point.getLineid());
|
|
|
+ ls.add(point);
|
|
|
+ ln_wtmap.put(point.getLineid(), ls);
|
|
|
+ } else {
|
|
|
+ List<Windturbine> ls = new ArrayList();
|
|
|
+ ls.add(point);
|
|
|
+ ln_wtmap.put(point.getLineid(), ls);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+//
|
|
|
+
|
|
|
+// WindPowerStationTestingPoint2Example windPowerstationTestingPointExample=new WindPowerStationTestingPoint2Example();
|
|
|
+// windPowerstationTestingPointExample.createCriteria().getAllCriteria();
|
|
|
+// List<WindPowerStationTestingPoint2> wpPointlist= windPowerstationTestingPoint2Service.selectByExample(windPowerstationTestingPointExample);
|
|
|
+//
|
|
|
+// Map<String,WindPowerStationTestingPoint2> items=null;
|
|
|
+// if(wpPointlist!=null && !wpPointlist.isEmpty()){
|
|
|
+// for(int i=0;i<wpPointlist.size();i++){
|
|
|
+// WindPowerStationTestingPoint2 point=wpPointlist.get(i);
|
|
|
+// if(stationPointmap.containsKey(point.getWindpowerstationid())){
|
|
|
+// items=stationPointmap.get(point.getWindpowerstationid());
|
|
|
+// items.put(point.getUniformcode(), point);
|
|
|
+// }
|
|
|
+// else{
|
|
|
+// items=new HashMap<String,WindPowerStationTestingPoint2>();
|
|
|
+// stationPointmap.put(point.getWindpowerstationid(), items);
|
|
|
+// items.put(point.getUniformcode(), point);
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// WindTurbineTestingPointAi2Example windTurbineTestingPointAiExample=new WindTurbineTestingPointAi2Example();
|
|
|
+// windTurbineTestingPointAiExample.createCriteria().getAllCriteria();
|
|
|
+// List<WindTurbineTestingPointAi2> wtAilist= windTurbineTestingPointAiService.selectByExample(windTurbineTestingPointAiExample);
|
|
|
+//
|
|
|
+// Map<String, WindTurbineTestingPointAi2> map = null;
|
|
|
+//
|
|
|
+// if(wtAilist != null && !wtAilist.isEmpty()){
|
|
|
+// for(WindTurbineTestingPointAi2 mp : wtAilist){
|
|
|
+// if(wtpAimap.containsKey(mp.getWindturbineid())){
|
|
|
+// map = wtpAimap.get(mp.getWindturbineid());
|
|
|
+// map.put(mp.getUniformcode(), mp);
|
|
|
+// }else{
|
|
|
+// map = new HashMap<String, WindTurbineTestingPointAi2>();
|
|
|
+// map.put(mp.getUniformcode(), mp);
|
|
|
+// wtpAimap.put(mp.getWindturbineid(), map);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+ EquipmentmodelExample example = new EquipmentmodelExample();
|
|
|
+ List<Equipmentmodel> mlls = equipmentmodelService.selectByExample(example);
|
|
|
+ if (!mlls.isEmpty()) {
|
|
|
+ for (Equipmentmodel model : mlls) {
|
|
|
+ mlmap.put(model.getId(), model);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ WarningClassifyExample wcexample = new WarningClassifyExample();
|
|
|
+ warningClassls = warningClassifyService.selectByExample(wcexample);
|
|
|
+ if (!warningClassls.isEmpty()) {
|
|
|
+ for (WarningClassify model : warningClassls) {
|
|
|
+ warningClassifymap.put(model.getId(), model);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ ManufacturerExample mfexample = new ManufacturerExample();
|
|
|
+ List<Manufacturer> mfls = manufacturerService.selectByExample(mfexample);
|
|
|
+ if (!mfls.isEmpty()) {
|
|
|
+ for (Manufacturer model : mfls) {
|
|
|
+ manufacturermap.put(model.getId(), model);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ ModelPowerExample mpexample = new ModelPowerExample();
|
|
|
+ List<ModelPower> mpls = modelPowerService.selectByExample(mpexample);
|
|
|
+ if (!mpls.isEmpty()) {
|
|
|
+
|
|
|
+ Map<String, ModelPower> mpmap = null;
|
|
|
+
|
|
|
+ if (mpls != null && !mpls.isEmpty()) {
|
|
|
+ for (ModelPower mp : mpls) {
|
|
|
+ if (modelPowermap.containsKey(mp.getModelid())) {
|
|
|
+ mpmap = modelPowermap.get(mp.getModelid());
|
|
|
+ mpmap.put(String.valueOf(mp.getSpeed().doubleValue()), mp);
|
|
|
+ } else {
|
|
|
+ mpmap = new HashMap<String, ModelPower>();
|
|
|
+ mpmap.put(String.valueOf(mp.getSpeed().doubleValue()), mp);
|
|
|
+ modelPowermap.put(mp.getModelid(), mpmap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ wppointnummap= windPowerstationTestingPoint2Service.getWpPointTotal();
|
|
|
+ }
|
|
|
+
|
|
|
+}
|