|
@@ -97,12 +97,13 @@ public class WtInfoPushService {
|
|
|
if(!wtcmap.isEmpty())
|
|
|
{
|
|
|
|
|
|
- List<String> codels=new ArrayList<>();
|
|
|
+
|
|
|
for (Map.Entry<String, List<WtTargetConfig>> entry : wtcmap.entrySet()) {
|
|
|
List<WtTargetConfig> wtcls=entry.getValue();
|
|
|
List<WtTargetConfigVo> vos=new ArrayList<>();
|
|
|
if(!wtcls.isEmpty())
|
|
|
{
|
|
|
+ List<String> codels=new ArrayList<>();
|
|
|
for(WtTargetConfig wtc:wtcls)
|
|
|
{
|
|
|
|
|
@@ -464,13 +465,13 @@ public class WtInfoPushService {
|
|
|
msls.add("YYYW");//液压油温
|
|
|
msls.add("PCS_WD");//PSC温度
|
|
|
|
|
|
- uids.add(Constant.TPOINT_WT_U1YZWD);//U1绕组温度
|
|
|
- uids.add(Constant.TPOINT_WT_V1YZWD);//V1绕组温度
|
|
|
- uids.add(Constant.TPOINT_WT_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绕组温度
|
|
|
+ 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绕组温度
|
|
@@ -496,8 +497,8 @@ public class WtInfoPushService {
|
|
|
msls.add("JCWD");//机舱温度
|
|
|
msls.add("JCWWD");//机舱外温度
|
|
|
msls.add("FDJHHWD");//发电机滑环温度
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
initialpoint(id, zbls, keyls, namemap,uids,msls);
|
|
|
|
|
|
|
|
@@ -642,13 +643,13 @@ public class WtInfoPushService {
|
|
|
return vos;
|
|
|
}
|
|
|
|
|
|
- public List<JunctionboxVo> findInverterInfoList(String wpId) throws Exception {
|
|
|
+ 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) {
|
|
|
+ if (StringUtils.notEmp(wpId) && InitialRunner.gp_nbqmap.containsKey(wpId)) {
|
|
|
+ List<Inverter> wtls = InitialRunner.gp_nbqmap.get(wpId);
|
|
|
+ for (Inverter wt : wtls) {
|
|
|
|
|
|
- if(StringUtils.notEmp(wt.getSquareid()) && InitialRunner.sqmap.containsKey(wt.getSquareid()))
|
|
|
+ if(StringUtils.notEmp(wt.getSquareid()) && InitialRunner.sqmap.containsKey(wt.getSquareid()))
|
|
|
{
|
|
|
Square square=InitialRunner.sqmap.get(wt.getSquareid());
|
|
|
|
|
@@ -707,10 +708,10 @@ public class WtInfoPushService {
|
|
|
|
|
|
}
|
|
|
|
|
|
- }
|
|
|
- }
|
|
|
- return vos;
|
|
|
- }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return vos;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
@@ -746,7 +747,7 @@ public class WtInfoPushService {
|
|
|
{
|
|
|
zt=Double.valueOf(ptlist.get(0).getPointValueInDouble()).intValue();
|
|
|
gl=StringUtils.round(ptlist.get(1).getPointValueInDouble(),2);
|
|
|
- dl=StringUtils.round(ptlist.get(2).getPointValueInDouble(),2);
|
|
|
+ dl=StringUtils.round(ptlist.get(2).getPointValueInDouble(),2);
|
|
|
fdl=StringUtils.round(ptlist.get(3).getPointValueInDouble(),2);
|
|
|
}
|
|
|
|
|
@@ -978,40 +979,40 @@ public class WtInfoPushService {
|
|
|
|
|
|
return matrixmap;
|
|
|
}
|
|
|
- public Object findInverterDI(String id) throws Exception {
|
|
|
- List<PhotovoltaicTestingPointNew> pointList = photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNewDiList(id);
|
|
|
- Map<String, String> idName = Maps.newHashMap();
|
|
|
- List<String> pointids = Lists.newArrayList();
|
|
|
- for (PhotovoltaicTestingPointNew point : pointList) {
|
|
|
- idName.put(point.getCode(), point.getName());
|
|
|
- pointids.add(point.getCode());
|
|
|
- }
|
|
|
- List<PointData> realData = realApiUtil.getRealData(pointids);
|
|
|
- List<Object> onList = Lists.newArrayList();
|
|
|
- List<Object> allList = Lists.newArrayList();
|
|
|
- for (PointData p : realData) {
|
|
|
- Map<String, Object> row = Maps.newHashMap();
|
|
|
- row.put("id", p.getEdnaId());
|
|
|
- row.put("name", idName.get(p.getEdnaId()));
|
|
|
- row.put("value", p.getPointValueInDouble());
|
|
|
- allList.add(row);
|
|
|
- if (1 == p.getPointValueInDouble()) {
|
|
|
- onList.add(row);
|
|
|
- }
|
|
|
- }
|
|
|
- Map<String, Object> map = Maps.newHashMap();
|
|
|
- map.put("allList", allList);
|
|
|
- map.put("onList", onList);
|
|
|
- return map;
|
|
|
- }
|
|
|
-
|
|
|
- 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;
|
|
|
+ public Object findInverterDI(String id) throws Exception {
|
|
|
+ List<PhotovoltaicTestingPointNew> pointList = photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNewDiList(id);
|
|
|
+ Map<String, String> idName = Maps.newHashMap();
|
|
|
+ List<String> pointids = Lists.newArrayList();
|
|
|
+ for (PhotovoltaicTestingPointNew point : pointList) {
|
|
|
+ idName.put(point.getCode(), point.getName());
|
|
|
+ pointids.add(point.getCode());
|
|
|
+ }
|
|
|
+ List<PointData> realData = realApiUtil.getRealData(pointids);
|
|
|
+ List<Object> onList = Lists.newArrayList();
|
|
|
+ List<Object> allList = Lists.newArrayList();
|
|
|
+ for (PointData p : realData) {
|
|
|
+ Map<String, Object> row = Maps.newHashMap();
|
|
|
+ row.put("id", p.getEdnaId());
|
|
|
+ row.put("name", idName.get(p.getEdnaId()));
|
|
|
+ row.put("value", p.getPointValueInDouble());
|
|
|
+ allList.add(row);
|
|
|
+ if (1 == p.getPointValueInDouble()) {
|
|
|
+ onList.add(row);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Map<String, Object> map = Maps.newHashMap();
|
|
|
+ map.put("allList", allList);
|
|
|
+ map.put("onList", onList);
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+ 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++) {
|
|
@@ -1019,7 +1020,7 @@ public class WtInfoPushService {
|
|
|
vo.setSjgl(0.0);
|
|
|
vos.add(vo);
|
|
|
}
|
|
|
- String pointid = photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(id, Constant.TPOINT_NBQ_GL).getCode();
|
|
|
+ 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;
|
|
@@ -1028,74 +1029,74 @@ public class WtInfoPushService {
|
|
|
vos.get(i).setTime(sjglls.get(i).getPointTime()*1000);
|
|
|
vos.get(i).setSjgl(StringUtils.round(temp, 2));// 实际功率
|
|
|
}
|
|
|
- return vos;
|
|
|
- }
|
|
|
+ return vos;
|
|
|
+ }
|
|
|
|
|
|
- public List<Object> findInverterInfo(String id) throws Exception {
|
|
|
- Map<String, Object> map = new HashMap<String, Object>();
|
|
|
- if (StringUtils.notEmp(id)) {
|
|
|
- if (InitialRunner.nbqmap.containsKey(id)) {
|
|
|
+ public List<Object> findInverterInfo(String id) throws Exception {
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+ if (StringUtils.notEmp(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());
|
|
|
- map.put("lnid", wt.getLineid());
|
|
|
- map.put("code", wt.getCode());
|
|
|
- Line ln = InitialRunner.lnmap.get(wt.getLineid());
|
|
|
- map.put("lnname", ln.getName());
|
|
|
- List<String> zbls = new ArrayList<>();
|
|
|
-
|
|
|
-
|
|
|
- String[] codeName[] = {
|
|
|
- {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 = photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(id, str1[0]).getCode();
|
|
|
- zbls.add(pointid);
|
|
|
- pointUniformMap.put(pointid, str1[0]);
|
|
|
- }
|
|
|
- // 获取测点值,与定义码绑定
|
|
|
- List<PointData> zblist = realApiUtil.getRealData(zbls);
|
|
|
- Map<String, Object> uniformValueMap = Maps.newHashMap();
|
|
|
- for (PointData p : zblist) {
|
|
|
- String ednaId = p.getEdnaId();
|
|
|
- Double val = MathUtil.twoBit(p.getPointValueInDouble());
|
|
|
- String uniformCode = pointUniformMap.get(ednaId);
|
|
|
- uniformValueMap.put(uniformCode, val);
|
|
|
- }
|
|
|
- // 遍历定义码,添加测点值、单位、名称
|
|
|
- List<Object> list = Lists.newArrayList();
|
|
|
- for (String[] str1 : codeName) {
|
|
|
- list.add(buildResult(str1[0], str1[1], uniformValueMap.get(str1[0]), str1[2]));
|
|
|
- }
|
|
|
- return list;
|
|
|
- }
|
|
|
- }
|
|
|
- return Lists.newArrayList();
|
|
|
- }
|
|
|
-
|
|
|
- private Map<String, Object> buildResult(String uniCode, String name, Object value, String unit) {
|
|
|
- Map<String, Object> map = Maps.newHashMap();
|
|
|
- map.put("uniCode", uniCode);
|
|
|
- map.put("name", name);
|
|
|
- map.put("value", value);
|
|
|
- map.put("unit", unit);
|
|
|
- return map;
|
|
|
- }
|
|
|
+ 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());
|
|
|
+ Line ln = InitialRunner.lnmap.get(wt.getLineid());
|
|
|
+ map.put("lnname", ln.getName());
|
|
|
+ List<String> zbls = new ArrayList<>();
|
|
|
+
|
|
|
+
|
|
|
+ String[] codeName[] = {
|
|
|
+ {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 = photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(id, str1[0]).getCode();
|
|
|
+ zbls.add(pointid);
|
|
|
+ pointUniformMap.put(pointid, str1[0]);
|
|
|
+ }
|
|
|
+ // 获取测点值,与定义码绑定
|
|
|
+ List<PointData> zblist = realApiUtil.getRealData(zbls);
|
|
|
+ Map<String, Object> uniformValueMap = Maps.newHashMap();
|
|
|
+ for (PointData p : zblist) {
|
|
|
+ String ednaId = p.getEdnaId();
|
|
|
+ Double val = MathUtil.twoBit(p.getPointValueInDouble());
|
|
|
+ String uniformCode = pointUniformMap.get(ednaId);
|
|
|
+ uniformValueMap.put(uniformCode, val);
|
|
|
+ }
|
|
|
+ // 遍历定义码,添加测点值、单位、名称
|
|
|
+ List<Object> list = Lists.newArrayList();
|
|
|
+ for (String[] str1 : codeName) {
|
|
|
+ list.add(buildResult(str1[0], str1[1], uniformValueMap.get(str1[0]), str1[2]));
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return Lists.newArrayList();
|
|
|
+ }
|
|
|
+
|
|
|
+ private Map<String, Object> buildResult(String uniCode, String name, Object value, String unit) {
|
|
|
+ Map<String, Object> map = Maps.newHashMap();
|
|
|
+ map.put("uniCode", uniCode);
|
|
|
+ map.put("name", name);
|
|
|
+ map.put("value", value);
|
|
|
+ map.put("unit", unit);
|
|
|
+ return map;
|
|
|
+ }
|
|
|
|
|
|
}
|