|
@@ -5,9 +5,14 @@ import cn.hutool.core.date.DateUtil;
|
|
|
import com.google.common.collect.Maps;
|
|
|
import com.gyee.frame.common.spring.Constant;
|
|
|
import com.gyee.frame.common.spring.InitialRunner;
|
|
|
+import com.gyee.frame.model.agc.AgcVo;
|
|
|
import com.gyee.frame.model.auto.*;
|
|
|
+import com.gyee.frame.model.custom.InverterVo;
|
|
|
+import com.gyee.frame.model.custom.JunctionboxVo;
|
|
|
import com.gyee.frame.model.custom.PointData;
|
|
|
import com.gyee.frame.service.*;
|
|
|
+import com.gyee.frame.service.photovolatic.JunctionboxService;
|
|
|
+import com.gyee.frame.service.photovolatic.PhotovoltaicTestingPointNewService;
|
|
|
import com.gyee.frame.util.*;
|
|
|
import org.apache.commons.compress.utils.Lists;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -27,13 +32,17 @@ public class WtInfoPushService {
|
|
|
private WindturbineinfodayService windturbineinfodayService;
|
|
|
@Resource
|
|
|
private WarningRecordsService warningRecordsService;
|
|
|
-
|
|
|
+ @Resource
|
|
|
+ private PhotovoltaicTestingPointNewService photovoltaicTestingPointNewService;
|
|
|
@Resource
|
|
|
private AlarmsnapService alarmsnapService;
|
|
|
+ @Resource
|
|
|
+ private JunctionboxService junctionboxService;
|
|
|
IRealTimeDataBaseUtil realApiUtil = RealTimeDataBaseFactory.createRealTimeDataBase();
|
|
|
|
|
|
String QS_FDC = "QS_FDC";
|
|
|
-
|
|
|
+ String JZ = "JZ";
|
|
|
+ String ZC="ZC";
|
|
|
public Map<String, Object> genreSetMap() throws Exception {
|
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
@@ -107,7 +116,6 @@ public class WtInfoPushService {
|
|
|
zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RSZSSDL).getCode());// 日场内受累故障
|
|
|
zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RQFSSDL).getCode());// 日场外受累电网
|
|
|
zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RXDSSDL).getCode());// 日场外受累天气
|
|
|
-
|
|
|
zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_FJSSFS).getCode());// 风速
|
|
|
zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_FJGL).getCode());// 风机功率
|
|
|
zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_FDJZS).getCode());// 风机转数
|
|
@@ -557,28 +565,8 @@ public class WtInfoPushService {
|
|
|
msls=new ArrayList<>();
|
|
|
uids=new ArrayList<>();
|
|
|
|
|
|
- if (wt.getWindpowerstationid().equals(QS_FDC)) {
|
|
|
-
|
|
|
- uids.add(Constant.TPOINT_WT_YPWZ1);
|
|
|
- uids.add(Constant.TPOINT_WT_YPWZ2);
|
|
|
- uids.add(Constant.TPOINT_WT_YPWZ3);
|
|
|
- uids.add(Constant.TPOINT_WT_FJSSFS);
|
|
|
- uids.add(Constant.TPOINT_WT_FJGL);
|
|
|
- uids.add(Constant.TPOINT_WT_GLYS);
|
|
|
- uids.add(Constant.QSTPOINT_WT_BJJD1);
|
|
|
- uids.add(Constant.TPOINT_WT_FJPL);
|
|
|
- uids.add(Constant.TPOINT_WT_WGGL);
|
|
|
- uids.add(Constant.TPOINT_WT_FJFX);
|
|
|
- uids.add(Constant.TPOINT_WT_YLZS);
|
|
|
- uids.add(Constant.TPOINT_WT_FDJZS);
|
|
|
- uids.add(Constant.TPOINT_WT_JCWWD);
|
|
|
- uids.add(Constant.TPOINT_WT_JCWD);
|
|
|
- uids.add(Constant.TPOINT_WT_TDGWD);
|
|
|
- uids.add(Constant.TPOINT_WT_JCGWD);
|
|
|
|
|
|
|
|
|
- } else {
|
|
|
-
|
|
|
uids.add(Constant.TPOINT_WT_YPWZ1);
|
|
|
uids.add(Constant.TPOINT_WT_YPWZ2);
|
|
|
uids.add(Constant.TPOINT_WT_YPWZ3);
|
|
@@ -598,7 +586,7 @@ public class WtInfoPushService {
|
|
|
|
|
|
|
|
|
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
msls.add("YPWZ1");
|
|
|
msls.add("YPWZ2");
|
|
@@ -1001,6 +989,26 @@ public class WtInfoPushService {
|
|
|
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ private void initialNbqpoint(String id, List<String> zbls, List<String> keyls, Map<String, Integer> bjnamemap,List<String> uids ,List<String> msls) {
|
|
|
+
|
|
|
+ if(msls.size()==uids.size())
|
|
|
+ {
|
|
|
+ for(int i=0;i<uids.size();i++)
|
|
|
+ {
|
|
|
+ PhotovoltaicTestingPointNew point= photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(id, uids.get(i));
|
|
|
+ if(null!=point && null!=point.getCode())
|
|
|
+ {
|
|
|
+ zbls.add(point.getCode());//
|
|
|
+ keyls.add(msls.get(i));//
|
|
|
+ bjnamemap.put(msls.get(i),zbls.size()-1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
// private void initialpoint(String id, List<String> zbls, List<String> keyls, Map<String, Integer> bjnamemap,List<String> uids) {
|
|
|
//
|
|
|
// for(String uid:uids)
|
|
@@ -1049,24 +1057,15 @@ public class WtInfoPushService {
|
|
|
msls.add("FJGL");//有功功率
|
|
|
msls.add("YYYW");//液压油温
|
|
|
msls.add("PCS_WD");//PSC温度
|
|
|
- if (wt.getWindpowerstationid().equals(QS_FDC)) {
|
|
|
- uids.add(Constant.QSTPOINT_WT_U1YZWD);//U1绕组温度
|
|
|
- uids.add(Constant.QSTPOINT_WT_V1YZWD);//V1绕组温度
|
|
|
- uids.add(Constant.QSTPOINT_WT_W1YZWD);//W1绕组温度
|
|
|
-
|
|
|
- msls.add("U1YZWD");//U1绕组温度
|
|
|
- msls.add("V1YZWD");//V1绕组温度
|
|
|
- msls.add("W1YZWD");//W1绕组温度
|
|
|
- }else
|
|
|
- {
|
|
|
- uids.add(Constant.TPOINT_WT_U1YZWD);//U1绕组温度
|
|
|
- uids.add(Constant.TPOINT_WT_V1YZWD);//V1绕组温度
|
|
|
- uids.add(Constant.TPOINT_WT_W1YZWD);//W1绕组温度
|
|
|
|
|
|
- msls.add("U1YZWD");//U1绕组温度
|
|
|
- msls.add("V1YZWD");//V1绕组温度
|
|
|
- msls.add("W1YZWD");//W1绕组温度
|
|
|
- }
|
|
|
+ uids.add(Constant.TPOINT_WT_U1YZWD);//U1绕组温度
|
|
|
+ uids.add(Constant.TPOINT_WT_V1YZWD);//V1绕组温度
|
|
|
+ uids.add(Constant.TPOINT_WT_W1YZWD);//W1绕组温度
|
|
|
+
|
|
|
+ msls.add("U1YZWD");//U1绕组温度
|
|
|
+ msls.add("V1YZWD");//V1绕组温度
|
|
|
+ msls.add("W1YZWD");//W1绕组温度
|
|
|
+
|
|
|
uids.add(Constant.TPOINT_WT_U2YZWD);//U2绕组温度
|
|
|
uids.add(Constant.TPOINT_WT_V2YZWD);//V2绕组温度
|
|
|
uids.add(Constant.TPOINT_WT_W2YZWD);//W2绕组温度
|
|
@@ -1094,7 +1093,7 @@ public class WtInfoPushService {
|
|
|
|
|
|
|
|
|
initialpoint(id, zbls, keyls, namemap,uids,msls);
|
|
|
-/*******************************************************************************************************************************************************/
|
|
|
+
|
|
|
|
|
|
Map<String, Object> zbmap = new HashMap<>();
|
|
|
|
|
@@ -1107,7 +1106,7 @@ public class WtInfoPushService {
|
|
|
|
|
|
|
|
|
if (!zblist.isEmpty() && zblist.size() == zbls.size() && keyls.size() == zbls.size()) {
|
|
|
-/**************************************************************基础指标***********************************************************************************/
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -1122,7 +1121,6 @@ public class WtInfoPushService {
|
|
|
}
|
|
|
|
|
|
|
|
|
-/**************************************************************基础指标***********************************************************************************/
|
|
|
|
|
|
|
|
|
} else {
|
|
@@ -1139,8 +1137,98 @@ public class WtInfoPushService {
|
|
|
vos.add(zbmap);
|
|
|
|
|
|
}
|
|
|
- }
|
|
|
+ }else if (InitialRunner.gp_nbqmap.containsKey(wpId)) {
|
|
|
|
|
|
+ List<Inverter> wtls=InitialRunner.gp_nbqmap.get(wpId);
|
|
|
+
|
|
|
+ for(Inverter wt:wtls)
|
|
|
+ {
|
|
|
+ String id=wt.getId();
|
|
|
+
|
|
|
+
|
|
|
+ List<String> msls = new ArrayList<>();
|
|
|
+ List<String> zbls = new ArrayList<>();
|
|
|
+ List<String> keyls = new ArrayList<>();
|
|
|
+ List<String> uids = new ArrayList<>();
|
|
|
+ Map<String, Integer> namemap = new HashMap<>();
|
|
|
+
|
|
|
+ uids.add(Constant.TPOINT_NBQ_AB_DY);//电网AB线电压
|
|
|
+ uids.add(Constant.TPOINT_NBQ_BC_DY);//电网BC线电压
|
|
|
+ uids.add(Constant.TPOINT_NBQ_CA_DY);//电网CA线电压
|
|
|
+ uids.add(Constant.TPOINT_NBQ_A_DL);//电网A相电流
|
|
|
+ uids.add(Constant.TPOINT_NBQ_B_DL);//电网B相电流
|
|
|
+ uids.add(Constant.TPOINT_NBQ_C_DL);//电网C相电流
|
|
|
+ uids.add(Constant.TPOINT_NBQ_DWPL);//电网频率
|
|
|
+ uids.add(Constant.TPOINT_NBQ_GL);//功率
|
|
|
+ uids.add(Constant.TPOINT_NBQ_WGGL);//无功功率
|
|
|
+ uids.add(Constant.TPOINT_NBQ_GLYS);//功率因数
|
|
|
+ uids.add(Constant.TPOINT_NBQ_WD);//机内温度
|
|
|
+ uids.add(Constant.TPOINT_NBQ_ZLDY);//直流电压
|
|
|
+ uids.add(Constant.TPOINT_NBQ_ZLDL);//直流电流
|
|
|
+ uids.add(Constant.TPOINT_NBQ_RFDL);//日发电量
|
|
|
+ uids.add(Constant.TPOINT_NBQ_ZFDL);//总发电量
|
|
|
+ uids.add(Constant.TPOINT_NBQ_RBWFZ);//日并网分钟
|
|
|
+ uids.add(Constant.TPOINT_NBQ_ZYXSJ);//总运行时间
|
|
|
+
|
|
|
+
|
|
|
+ msls.add("AB_DY");//电网AB线电压
|
|
|
+ msls.add("BC_DY");//电网BC线电压
|
|
|
+ msls.add("CA_DY");//电网CA线电压
|
|
|
+ msls.add("A_DL");//电网A相电流
|
|
|
+ msls.add("B_DL");//电网B相电流
|
|
|
+ msls.add("C_DL");//电网C相电流
|
|
|
+ msls.add("DWPL");//电网频率
|
|
|
+ msls.add("YGGL");//功率
|
|
|
+ msls.add("WGGL");//无功功率
|
|
|
+ msls.add("GLYS");//功率因数
|
|
|
+ msls.add("JNWD");//机内温度
|
|
|
+ msls.add("ZLDY");// 直流电压
|
|
|
+ msls.add("ZLDL");//直流电流
|
|
|
+ msls.add("RFDL");//日发电量
|
|
|
+ msls.add("ZFDL");//总发电量
|
|
|
+ msls.add("RBWFZ");//日并网分钟
|
|
|
+ msls.add("ZYXSJ");//总运行时间
|
|
|
+
|
|
|
+ initialNbqpoint(id, zbls, keyls, namemap,uids,msls);
|
|
|
+
|
|
|
+
|
|
|
+ Map<String, Object> zbmap = new HashMap<>();
|
|
|
+
|
|
|
+ zbmap.put("model", wt.getModelid());
|
|
|
+ zbmap.put("wpid", wt.getWindpowerstationid());
|
|
|
+ zbmap.put("pjid", wt.getProjectid());
|
|
|
+ zbmap.put("lnid", wt.getLineid());
|
|
|
+ zbmap.put("code", wt.getCode());
|
|
|
+ zbmap.put("wtid", wt.getId());
|
|
|
+ List<PointData> zblist = realApiUtil.getRealData(zbls);
|
|
|
+
|
|
|
+
|
|
|
+ if (!zblist.isEmpty() && zblist.size() == zbls.size() && keyls.size() == zbls.size()) {
|
|
|
+
|
|
|
+
|
|
|
+ for(int i=0;i<keyls.size();i++)
|
|
|
+ {
|
|
|
+ if(namemap.containsKey(keyls.get(i)))
|
|
|
+ {
|
|
|
+ int num=namemap.get(keyls.get(i));
|
|
|
+ zbmap.put(keyls.get(i), MathUtil.twoBit(zblist.get(num).getPointValueInDouble()));//
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ for(String str:msls)
|
|
|
+ {
|
|
|
+ if(!zbmap.containsKey(str))
|
|
|
+ {
|
|
|
+ zbmap.put(str,null);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ vos.add(zbmap);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
}
|
|
@@ -1148,64 +1236,266 @@ public class WtInfoPushService {
|
|
|
return vos;
|
|
|
}
|
|
|
|
|
|
- public List<Map<String, Object>> findInverterInfoList(String wpId) throws Exception {
|
|
|
- List<Map<String, Object>> vos = new ArrayList<>();
|
|
|
- if (StringUtils.notEmp(wpId) && InitialRunner.wp_wtmap.containsKey(wpId)) {
|
|
|
- List<Windturbine> wtls = InitialRunner.wp_wtmap.get(wpId);
|
|
|
- for (Windturbine wt : wtls) {
|
|
|
- Map<String, Object> map = new HashMap<String, Object>();
|
|
|
- map.put("model", wt.getModelid());
|
|
|
- map.put("wpid", wt.getWindpowerstationid());
|
|
|
- map.put("pjid", wt.getProjectid());
|
|
|
- map.put("lnid", wt.getLineid());
|
|
|
- map.put("code", wt.getCode());
|
|
|
- map.put("wtId", wt.getId());
|
|
|
+ public List<JunctionboxVo> findInverterInfoList(String wpId) throws Exception {
|
|
|
+ List<JunctionboxVo> vos=new ArrayList<>();
|
|
|
+ if (StringUtils.notEmp(wpId) && InitialRunner.gp_nbqmap.containsKey(wpId)) {
|
|
|
+ List<Inverter> wtls = InitialRunner.gp_nbqmap.get(wpId);
|
|
|
+ for (Inverter wt : wtls) {
|
|
|
|
|
|
- Line ln = InitialRunner.lnmap.get(wt.getLineid());
|
|
|
- map.put("lnname", ln.getName());
|
|
|
- List<String> zbls = new ArrayList<>();
|
|
|
+ if(StringUtils.notEmp(wt.getSquareid()) && InitialRunner.sqmap.containsKey(wt.getSquareid()))
|
|
|
+ {
|
|
|
+ Square square=InitialRunner.sqmap.get(wt.getSquareid());
|
|
|
|
|
|
- String[] codeName[] = {
|
|
|
- { "JSSSFS", "光照强度"},
|
|
|
- { "AI130", "有功功率"},
|
|
|
- { "AI067", "功率因数"},
|
|
|
- { "AIG071", "机内温度"},
|
|
|
- { "AIG072", "逆变效率" },
|
|
|
- { "AI130", "功率"},
|
|
|
- { "AI067", "功率因数" },
|
|
|
- { "RFDL", "日发电量" },
|
|
|
- { "YFDL", "月发电量" },
|
|
|
- { "NFDL", "年发电量" },
|
|
|
- { "AIG064", "累计发电量" }
|
|
|
- };
|
|
|
- // 遍历定义码,获取测点Id集合
|
|
|
- Map<String, String> pointUniformMap = Maps.newHashMap();
|
|
|
- for (String[] str1 : codeName) {
|
|
|
- String pointid = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), str1[0]).getCode();
|
|
|
- zbls.add(pointid);
|
|
|
- pointUniformMap.put(pointid, str1[0]);
|
|
|
+ if(square.getTypes().equals(ZC))
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
}
|
|
|
- // 获取测点值,与定义码绑定
|
|
|
- List<PointData> zblist = realApiUtil.getRealData(zbls);
|
|
|
-// Map<String, Object> uniformValueMap = Maps.newHashMap();
|
|
|
-// uniformValueMap.put("定义码对照", codeName);
|
|
|
- for (PointData p : zblist) {
|
|
|
- String ednaId = p.getEdnaId();
|
|
|
- Double val = MathUtil.twoBit(p.getPointValueInDouble());
|
|
|
- String uniformCode = pointUniformMap.get(ednaId);
|
|
|
- map.put(uniformCode, val);
|
|
|
+
|
|
|
+ List<Junctionbox> jbls=junctionboxService.selectByInverterId(wt.getId());
|
|
|
+
|
|
|
+ if(!jbls.isEmpty())
|
|
|
+ {
|
|
|
+ List<String> pointcodes=new ArrayList<>();
|
|
|
+ for(Junctionbox jb:jbls)
|
|
|
+ {
|
|
|
+ String[] strs=Constant.TPOINT_Inverter_Junctionbox;
|
|
|
+ for(int i=0;i<strs.length;i++)
|
|
|
+ {
|
|
|
+ PhotovoltaicTestingPointNew pt=photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(jb.getId(),strs[i]);
|
|
|
+ if(StringUtils.notEmp(pt) && StringUtils.notEmp(pt.getCode()))
|
|
|
+ {
|
|
|
+ pointcodes.add(pt.getCode());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ List<PointData> ptlist = realApiUtil.getRealData(pointcodes);
|
|
|
+
|
|
|
+ if(!ptlist.isEmpty() && ptlist.size()==pointcodes.size())
|
|
|
+ {
|
|
|
+ JunctionboxVo vo=new JunctionboxVo();
|
|
|
+ vo.setId(jb.getId());
|
|
|
+ vo.setName(jb.getName());
|
|
|
+ vo.setZdy(StringUtils.round(ptlist.get(0).getPointValueInDouble(),2));
|
|
|
+ vo.setDl1(StringUtils.round(ptlist.get(1).getPointValueInDouble(),2));
|
|
|
+ vo.setDl2(StringUtils.round(ptlist.get(2).getPointValueInDouble(),2));
|
|
|
+ vo.setDl3(StringUtils.round(ptlist.get(3).getPointValueInDouble(),2));
|
|
|
+ vo.setDl4(StringUtils.round(ptlist.get(4).getPointValueInDouble(),2));
|
|
|
+ vo.setDl5(StringUtils.round(ptlist.get(5).getPointValueInDouble(),2));
|
|
|
+ vo.setDl6(StringUtils.round(ptlist.get(6).getPointValueInDouble(),2));
|
|
|
+ vo.setDl7(StringUtils.round(ptlist.get(7).getPointValueInDouble(),2));
|
|
|
+ vo.setDl8(StringUtils.round(ptlist.get(8).getPointValueInDouble(),2));
|
|
|
+ vo.setDl9(StringUtils.round(ptlist.get(9).getPointValueInDouble(),2));
|
|
|
+ vo.setDl10(StringUtils.round(ptlist.get(10).getPointValueInDouble(),2));
|
|
|
+ vo.setDl11(StringUtils.round(ptlist.get(11).getPointValueInDouble(),2));
|
|
|
+ vo.setDl12(StringUtils.round(ptlist.get(12).getPointValueInDouble(),2));
|
|
|
+ vo.setDl13(StringUtils.round(ptlist.get(13).getPointValueInDouble(),2));
|
|
|
+ vo.setDl14(StringUtils.round(ptlist.get(14).getPointValueInDouble(),2));
|
|
|
+ vo.setDl15(StringUtils.round(ptlist.get(15).getPointValueInDouble(),2));
|
|
|
+ vo.setDl16(StringUtils.round(ptlist.get(16).getPointValueInDouble(),2));
|
|
|
+ vos.add(vo);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
- vos.add(map);
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
return vos;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ public Map<String,List<InverterVo>> findMatrixByWpId(String wpId) throws Exception {
|
|
|
+ Map<String,List<InverterVo>> map=new HashMap<>();
|
|
|
+
|
|
|
+
|
|
|
+ List<InverterVo> vos=new ArrayList<>();
|
|
|
+ if (StringUtils.notEmp(wpId) && InitialRunner.gp_nbqmap.containsKey(wpId)) {
|
|
|
+ List<Inverter> wtls = InitialRunner.gp_nbqmap.get(wpId);
|
|
|
+ for (Inverter wt : wtls) {
|
|
|
+ double gl=0.0;
|
|
|
+ double fdl=0.0;
|
|
|
+ int zt=0;
|
|
|
+
|
|
|
+ List<String> pointcodes=new ArrayList<>();
|
|
|
+
|
|
|
+ String[] strs=Constant.TPOINT_Inverter_Matrix;
|
|
|
+ for(int i=0;i<strs.length;i++)
|
|
|
+ {
|
|
|
+ PhotovoltaicTestingPointNew pt=photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(),strs[i]);
|
|
|
+ if(StringUtils.notEmp(pt) && StringUtils.notEmp(pt.getCode()))
|
|
|
+ {
|
|
|
+ pointcodes.add(pt.getCode());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ List<PointData> ptlist = realApiUtil.getRealData(pointcodes);
|
|
|
+
|
|
|
+ if(!ptlist.isEmpty() && ptlist.size()==pointcodes.size())
|
|
|
+ {
|
|
|
+ zt=Double.valueOf(ptlist.get(0).getPointValueInDouble()).intValue();
|
|
|
+ gl=StringUtils.round(ptlist.get(1).getPointValueInDouble(),2);
|
|
|
+ fdl=StringUtils.round(ptlist.get(2).getPointValueInDouble(),2);
|
|
|
+ }
|
|
|
+ if (StringUtils.notEmp(wt.getSquareid()) && InitialRunner.sqmap.containsKey(wt.getSquareid())) {
|
|
|
+ Square square = InitialRunner.sqmap.get(wt.getSquareid());
|
|
|
+
|
|
|
+ if (square.getTypes().equals(ZC)) {
|
|
|
+
|
|
|
+ if(map.containsKey(square.getId()))
|
|
|
+ {
|
|
|
+ List<InverterVo> ls=map.get(square.getId());;
|
|
|
+ InverterVo vo=new InverterVo();
|
|
|
+ vo.setId(wt.getId());
|
|
|
+ vo.setName(wt.getName());
|
|
|
+ vo.setFdl(fdl);
|
|
|
+ vo.setGl(gl);
|
|
|
+ vo.setZt(zt);
|
|
|
+ vo.setSqname(square.getName());
|
|
|
+ ls.add(vo);
|
|
|
+ map.put(square.getId(),ls);
|
|
|
+ }else
|
|
|
+ {
|
|
|
+ List<InverterVo> ls=new ArrayList<>();
|
|
|
+ InverterVo vo=new InverterVo();
|
|
|
+ vo.setId(wt.getId());
|
|
|
+ vo.setName(wt.getName());
|
|
|
+ vo.setFdl(fdl);
|
|
|
+ vo.setGl(gl);
|
|
|
+ vo.setZt(zt);
|
|
|
+ vo.setSqname(square.getName());
|
|
|
+ ls.add(vo);
|
|
|
+ map.put(square.getId(),ls);
|
|
|
+
|
|
|
+ }
|
|
|
+ }else
|
|
|
+ {
|
|
|
+ InverterVo vo=new InverterVo();
|
|
|
+ vo.setId(wt.getId());
|
|
|
+ vo.setName(wt.getName());
|
|
|
+ vo.setFdl(fdl);
|
|
|
+ vo.setGl(gl);
|
|
|
+ vo.setZt(zt);
|
|
|
+ vo.setSqname(square.getName());
|
|
|
+ vos.add(vo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ map.put(JZ,vos);
|
|
|
+
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public Map<String,Map<String,List<InverterVo>>> findMatrix() throws Exception {
|
|
|
+
|
|
|
+ Map<String,Map<String,List<InverterVo>>> matrixmap=new HashMap<>();
|
|
|
+
|
|
|
+
|
|
|
+ List<Windpowerstation> wpls=InitialRunner.wpallls;
|
|
|
+
|
|
|
+ if(!wpls.isEmpty())
|
|
|
+ {
|
|
|
+ for(Windpowerstation wp:wpls)
|
|
|
+ {
|
|
|
+ String wpId=wp.getId();
|
|
|
+ Map<String,List<InverterVo>> map=new HashMap<>();
|
|
|
+
|
|
|
+ List<InverterVo> vos=new ArrayList<>();
|
|
|
+ if (StringUtils.notEmp(wpId) && InitialRunner.gp_nbqmap.containsKey(wpId)) {
|
|
|
+ List<Inverter> wtls = InitialRunner.gp_nbqmap.get(wpId);
|
|
|
+ for (Inverter wt : wtls) {
|
|
|
+ double gl=0.0;
|
|
|
+ double fdl=0.0;
|
|
|
+ int zt=0;
|
|
|
+
|
|
|
+ List<String> pointcodes=new ArrayList<>();
|
|
|
+
|
|
|
+ String[] strs=Constant.TPOINT_Inverter_Matrix;
|
|
|
+ for(int i=0;i<strs.length;i++)
|
|
|
+ {
|
|
|
+ PhotovoltaicTestingPointNew pt=photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(),strs[i]);
|
|
|
+ if(StringUtils.notEmp(pt) && StringUtils.notEmp(pt.getCode()))
|
|
|
+ {
|
|
|
+ pointcodes.add(pt.getCode());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ List<PointData> ptlist = realApiUtil.getRealData(pointcodes);
|
|
|
+
|
|
|
+ if(!ptlist.isEmpty() && ptlist.size()==pointcodes.size())
|
|
|
+ {
|
|
|
+ zt=Double.valueOf(ptlist.get(0).getPointValueInDouble()).intValue();
|
|
|
+ gl=StringUtils.round(ptlist.get(1).getPointValueInDouble(),2);
|
|
|
+ fdl=StringUtils.round(ptlist.get(2).getPointValueInDouble(),2);
|
|
|
+ }
|
|
|
+ if (StringUtils.notEmp(wt.getSquareid()) && InitialRunner.sqmap.containsKey(wt.getSquareid())) {
|
|
|
+ Square square = InitialRunner.sqmap.get(wt.getSquareid());
|
|
|
+
|
|
|
+ if (square.getTypes().equals(ZC)) {
|
|
|
+
|
|
|
+ if(map.containsKey(square.getId()))
|
|
|
+ {
|
|
|
+ List<InverterVo> ls=map.get(square.getId());;
|
|
|
+ InverterVo vo=new InverterVo();
|
|
|
+ vo.setId(wt.getId());
|
|
|
+ vo.setName(wt.getName());
|
|
|
+ vo.setFdl(fdl);
|
|
|
+ vo.setGl(gl);
|
|
|
+ vo.setSqname(square.getName());
|
|
|
+ vo.setZt(zt);
|
|
|
+ ls.add(vo);
|
|
|
+ map.put(square.getId(),ls);
|
|
|
+ }else
|
|
|
+ {
|
|
|
+ List<InverterVo> ls=new ArrayList<>();
|
|
|
+ InverterVo vo=new InverterVo();
|
|
|
+ vo.setId(wt.getId());
|
|
|
+ vo.setName(wt.getName());
|
|
|
+ vo.setFdl(fdl);
|
|
|
+ vo.setGl(gl);
|
|
|
+ vo.setZt(zt);
|
|
|
+ vo.setSqname(square.getName());
|
|
|
+ ls.add(vo);
|
|
|
+ map.put(square.getId(),ls);
|
|
|
+
|
|
|
+ }
|
|
|
+ }else
|
|
|
+ {
|
|
|
+ InverterVo vo=new InverterVo();
|
|
|
+ vo.setId(wt.getId());
|
|
|
+ vo.setName(wt.getName());
|
|
|
+ vo.setSqname(square.getName());
|
|
|
+ vo.setFdl(fdl);
|
|
|
+ vo.setGl(gl);
|
|
|
+ vo.setZt(zt);
|
|
|
+ vos.add(vo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ map.put(JZ,vos);
|
|
|
+ }
|
|
|
+
|
|
|
+ matrixmap.put(wpId,map);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return matrixmap;
|
|
|
+ }
|
|
|
public Object findInverterDI(String id) throws Exception {
|
|
|
- List<Windturbinetestingpointnew> pointList = windTurbineTestingPointDiService.getWindTurbineTestingPointDi2List(id);
|
|
|
+ List<PhotovoltaicTestingPointNew> pointList = photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNewDiList(id);
|
|
|
Map<String, String> idName = Maps.newHashMap();
|
|
|
List<String> pointids = Lists.newArrayList();
|
|
|
- for (Windturbinetestingpointnew point : pointList) {
|
|
|
+ for (PhotovoltaicTestingPointNew point : pointList) {
|
|
|
idName.put(point.getCode(), point.getName());
|
|
|
pointids.add(point.getCode());
|
|
|
}
|
|
@@ -1228,30 +1518,37 @@ public class WtInfoPushService {
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
- public List<Object> findInverterPowerCurve(String id) throws Exception {
|
|
|
- List<Object> list = Lists.newArrayList();
|
|
|
- Date now = new Date();
|
|
|
- Date date = DateUtil.beginOfDay(now);
|
|
|
- String pointid = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, "AI130").getCode();
|
|
|
- while (date.before(now)) {
|
|
|
- Date begin = DateUtils.addMinutes(date, -30);
|
|
|
- List<PointData> histStat = realApiUtil.getHistStat(pointid, begin.getTime() / 1000, date.getTime() / 1000, 1L, 30L * 60, 0);
|
|
|
- Double val = 0D;
|
|
|
- if (histStat != null && !histStat.isEmpty() && histStat.get(0) != null) {
|
|
|
- val = histStat.get(0).getPointValueInDouble();
|
|
|
- val = MathUtil.twoBit(val);
|
|
|
- }
|
|
|
- list.add(val);
|
|
|
- date = DateUtils.addMinutes(date, 30);
|
|
|
+ public List<AgcVo> findInverterPowerCurve(String id) throws Exception {
|
|
|
+
|
|
|
+ Map<String,Object> map =new HashMap<>();
|
|
|
+ Date endDate = new Date();
|
|
|
+ Date beginDate = DateUtil.beginOfDay(endDate);
|
|
|
+
|
|
|
+ int length=DateUtils.hoursDiff(beginDate,endDate)*2;
|
|
|
+
|
|
|
+ List<AgcVo> vos = new ArrayList<>();
|
|
|
+ for (int i = 0; i < length; i++) {
|
|
|
+ AgcVo vo = new AgcVo();
|
|
|
+ vo.setSjgl(0.0);
|
|
|
+ vos.add(vo);
|
|
|
+ }
|
|
|
+ String pointid = photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(id, Constant.TPOINT_NBQ_GL).getCode();
|
|
|
+ List<PointData> sjglls = realApiUtil.getHistoryDatasSnap(pointid, beginDate.getTime() / 1000,
|
|
|
+ endDate.getTime() / 1000, (long) length, 1800L);
|
|
|
+ double temp = 0;
|
|
|
+ for (int i = 0; i < vos.size(); i++) {
|
|
|
+ temp = sjglls.get(i).getPointValueInDouble();
|
|
|
+ vos.get(i).setTime(sjglls.get(i).getPointTime()*1000);
|
|
|
+ vos.get(i).setSjgl(StringUtils.round(temp, 2));// 实际功率
|
|
|
}
|
|
|
- return list;
|
|
|
+ return vos;
|
|
|
}
|
|
|
|
|
|
public List<Object> findInverterInfo(String id) throws Exception {
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
|
if (StringUtils.notEmp(id)) {
|
|
|
- if (InitialRunner.wtmap.containsKey(id)) {
|
|
|
- Windturbine wt = InitialRunner.wtmap.get(id);
|
|
|
+ if (InitialRunner.nbqmap.containsKey(id)) {
|
|
|
+ Inverter wt = InitialRunner.nbqmap.get(id);
|
|
|
map.put("model", wt.getModelid());
|
|
|
map.put("wpid", wt.getWindpowerstationid());
|
|
|
map.put("pjid", wt.getProjectid());
|
|
@@ -1260,26 +1557,28 @@ public class WtInfoPushService {
|
|
|
Line ln = InitialRunner.lnmap.get(wt.getLineid());
|
|
|
map.put("lnname", ln.getName());
|
|
|
List<String> zbls = new ArrayList<>();
|
|
|
+
|
|
|
+
|
|
|
String[] codeName[] = {
|
|
|
- {"AIG061", "交流电压","V"},
|
|
|
- {"AIG081", "直流电压","V"},
|
|
|
- {"AIG060", "交流电流","A"},
|
|
|
- {"AIG078", "直流电流","A"},
|
|
|
- {"AI068", "电网频率","Hz"},
|
|
|
- {"AI130", "功率","W"},
|
|
|
- {"AI067", "功率因数",""},
|
|
|
- {"RFDL", "日发电量","kwh"},//TODO 疑似 各厂发电量单位不統一
|
|
|
- {"YFDL", "月发电量","kwh"},
|
|
|
- {"NFDL", "年发电量","kwh"},
|
|
|
- {"AIG064", "累计发电量","kwh"},
|
|
|
- {"AIG071", "逆变器温度","℃"},
|
|
|
- {"AIG072", "效率",""},
|
|
|
- {"AI962", "累计二氧化碳减排量","kg"}
|
|
|
+ {Constant.TPOINT_NBQ_JLDY, "交流电压","V"},
|
|
|
+ {Constant.TPOINT_NBQ_ZLDY, "直流电压","V"},
|
|
|
+ {Constant.TPOINT_NBQ_JLDL, "交流电流","A"},
|
|
|
+ {Constant.TPOINT_NBQ_ZLDL, "直流电流","A"},
|
|
|
+ {Constant.TPOINT_NBQ_DWPL, "电网频率","Hz"},
|
|
|
+ {Constant.TPOINT_NBQ_GL, "功率","W"},
|
|
|
+ {Constant.TPOINT_NBQ_GLYS, "功率因数",""},
|
|
|
+ {Constant.TPOINT_NBQ_RFDL, "日发电量","kwh"},//TODO 疑似 各厂发电量单位不統一
|
|
|
+ {Constant.TPOINT_NBQ_YFDL, "月发电量","kwh"},
|
|
|
+ {Constant.TPOINT_NBQ_NFDL, "年发电量","kwh"},
|
|
|
+ {Constant.TPOINT_NBQ_ZFDL, "累计发电量","kwh"},
|
|
|
+ {Constant.TPOINT_NBQ_WD, "逆变器温度","℃"},
|
|
|
+ {Constant.TPOINT_NBQ_XL, "效率",""},
|
|
|
+ {Constant.TPOINT_NBQ_EYHT, "累计二氧化碳减排量","kg"}
|
|
|
};
|
|
|
// 遍历定义码,获取测点Id集合
|
|
|
Map<String, String> pointUniformMap = Maps.newHashMap();
|
|
|
for (String[] str1 : codeName) {
|
|
|
- String pointid = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, str1[0]).getCode();
|
|
|
+ String pointid = photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(id, str1[0]).getCode();
|
|
|
zbls.add(pointid);
|
|
|
pointUniformMap.put(pointid, str1[0]);
|
|
|
}
|