Commit 6d90e989 authored by hezhuozhi's avatar hezhuozhi

优化电站监控

parent b01b5b18
...@@ -244,34 +244,52 @@ public class SunlightServiceImpl implements SunlightService { ...@@ -244,34 +244,52 @@ public class SunlightServiceImpl implements SunlightService {
jpStation.setSnCode(sunlightDto.getPs_id().toString());// sncode jpStation.setSnCode(sunlightDto.getPs_id().toString());// sncode
try { try {
try {
Map<String, String> map = sunlightDto.getTotal_capcity(); Map<String, String> map = sunlightDto.getTotal_capcity();
if (map != null && map.get("unit") != null && !map.get("unit").isEmpty() if (map != null && map.get("unit") != null && !map.get("unit").isEmpty()
&& !"--".equals(map.get("value"))) { && !"--".equals(map.get("value"))) {
jpStation.setCapacity(SunlightUtil.zj.get(String.valueOf(map.get("unit"))) jpStation.setCapacity(SunlightUtil.zj.get(String.valueOf(map.get("unit")))
* Double.valueOf(String.valueOf(map.get("value"))));// 装机容量 * Double.valueOf(String.valueOf(map.get("value"))));// 装机容量
} }
}catch (Exception e){
jpStation.setCapacity(0.0);
}
try {
Map<String, String> map1 = sunlightDto.getCurr_power(); Map<String, String> map1 = sunlightDto.getCurr_power();
if (map1 != null && map1.get("unit") != null && !map1.get("unit").isEmpty() if (map1 != null && map1.get("unit") != null && !map1.get("unit").isEmpty()
&& !"--".equals(map1.get("value"))) { && !"--".equals(map1.get("value"))) {
jpStation.setRealTimePower(SunlightUtil.GL.get(String.valueOf(map1.get("unit"))) jpStation.setRealTimePower(SunlightUtil.GL.get(String.valueOf(map1.get("unit")))
* Double.valueOf(String.valueOf(map1.get("value"))));// 实时功率 * Double.valueOf(String.valueOf(map1.get("value"))));// 实时功率
} }
}catch (Exception e){
jpStation.setRealTimePower(0.0);
}
try {
Map<String, String> map2 = sunlightDto.getToday_energy(); Map<String, String> map2 = sunlightDto.getToday_energy();
if (map2 != null && map2.get("unit") != null && !map2.get("unit").isEmpty() if (map2 != null && map2.get("unit") != null && !map2.get("unit").isEmpty()
&& !"--".equals(map2.get("value"))) { && !"--".equals(map2.get("value"))) {
jpStation.setDayGenerate(SunlightUtil.fd.get(String.valueOf(map2.get("unit"))) jpStation.setDayGenerate(SunlightUtil.fd.get(String.valueOf(map2.get("unit")))
* Double.valueOf(String.valueOf(map2.get("value"))));// 日发电量 * Double.valueOf(String.valueOf(map2.get("value"))));// 日发电量
} }
}catch (Exception e){
jpStation.setDayGenerate(0.0);
}
try {
Map<String, String> map3 = sunlightDto.getTotal_energy(); Map<String, String> map3 = sunlightDto.getTotal_energy();
if (map3 != null && map3.get("unit") != null && !map3.get("unit").isEmpty() if (map3 != null && map3.get("unit") != null && !map3.get("unit").isEmpty()
&& !"--".equals(map3.get("value"))) { && !"--".equals(map3.get("value"))) {
jpStation.setAccumulatedPower(SunlightUtil.fd.get(String.valueOf(map3.get("unit"))) jpStation.setAccumulatedPower(SunlightUtil.fd.get(String.valueOf(map3.get("unit")))
* Double.valueOf(String.valueOf(map3.get("value"))));// 累计发电量 * Double.valueOf(String.valueOf(map3.get("value"))));// 累计发电量
} }
}catch (Exception e){
jpStation.setAccumulatedPower(0.0);
}
try {
Map<String, String> map4 = sunlightDto.getToday_income(); Map<String, String> map4 = sunlightDto.getToday_income();
if (map4 != null && map4.get("unit") != null && !map4.get("unit").isEmpty() if (map4 != null && map4.get("unit") != null && !map4.get("unit").isEmpty()
&& !"--".equals(map4.get("value"))) { && !"--".equals(map4.get("value"))) {
...@@ -279,6 +297,10 @@ public class SunlightServiceImpl implements SunlightService { ...@@ -279,6 +297,10 @@ public class SunlightServiceImpl implements SunlightService {
* Double.valueOf(String.valueOf(map4.get("value"))));// 日收益 * Double.valueOf(String.valueOf(map4.get("value"))));// 日收益
} }
}catch (Exception e){
jpStation.setDayIncome(0.0);
}
Map<String, String> map5 = sunlightDto.getTotal_income(); Map<String, String> map5 = sunlightDto.getTotal_income();
if (map5 != null && map5.get("unit") != null && !map5.get("unit").isEmpty() if (map5 != null && map5.get("unit") != null && !map5.get("unit").isEmpty()
&& !"--".equals(map5.get("value"))) { && !"--".equals(map5.get("value"))) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment