|
@@ -3,6 +3,7 @@ package com.gyee.runeconomy.service.monitor;
|
|
|
|
|
|
import com.gyee.common.contant.ContantXk;
|
|
|
import com.gyee.common.model.PointData;
|
|
|
+import com.gyee.runeconomy.dto.PowercurveVo;
|
|
|
import com.gyee.runeconomy.init.CacheContext;
|
|
|
import com.gyee.runeconomy.model.auto.*;
|
|
|
import com.gyee.runeconomy.service.auto.IProBasicEquipmentPointService;
|
|
@@ -16,6 +17,7 @@ import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -319,6 +321,7 @@ public class MonitorService {
|
|
|
double llgl = 0.0;
|
|
|
double ssfs = 0.0;
|
|
|
double gzzs = 0.0;
|
|
|
+ double fnlyl = 0.0;
|
|
|
double yfdl = 0.0;
|
|
|
double nfdl = 0.0;
|
|
|
double jys = 0.0;
|
|
@@ -384,6 +387,10 @@ public class MonitorService {
|
|
|
ProBasicPowerstationPoint gzzsvalue = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.RPJGZD);
|
|
|
gzzs = edosUtil.getRealData(gzzsvalue).getPointValueInDouble();
|
|
|
|
|
|
+ //风能利用率
|
|
|
+ ProBasicPowerstationPoint fnlylvalue = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.FNLYL);
|
|
|
+ fnlyl = edosUtil.getRealData(fnlylvalue).getPointValueInDouble();
|
|
|
+
|
|
|
//理论功率
|
|
|
ProBasicPowerstationPoint llglvalue = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.SSZLLGL);
|
|
|
llgl = edosUtil.getRealData(llglvalue).getPointValueInDouble();
|
|
@@ -406,7 +413,7 @@ public class MonitorService {
|
|
|
|
|
|
|
|
|
for (ProBasicPowerstation wp : wplist) {
|
|
|
- if (wp.getId().contains("F")) {
|
|
|
+ if (wp.getSpare4().equals("1")) {
|
|
|
//实时功率
|
|
|
ProBasicPowerstationPoint fdglvalue = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.SSZGL);
|
|
|
fdsjgl += edosUtil.getRealData(fdglvalue).getPointValueInDouble();
|
|
@@ -426,16 +433,16 @@ public class MonitorService {
|
|
|
ProBasicPowerstationPoint sjglvalue = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.SSZGL);
|
|
|
sjgl = edosUtil.getRealData(sjglvalue).getPointValueInDouble();
|
|
|
|
|
|
+ //实时风速
|
|
|
+ ProBasicPowerstationPoint ssfsvalue = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.SSPJFS);
|
|
|
+ ssfs = edosUtil.getRealData(ssfsvalue).getPointValueInDouble();
|
|
|
|
|
|
- if (wpId.contains("F")) {
|
|
|
- //实时风速
|
|
|
- ProBasicPowerstationPoint ssfsvalue = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.SSPJFS);
|
|
|
- ssfs = edosUtil.getRealData(ssfsvalue).getPointValueInDouble();
|
|
|
- } else if (wpId.contains("G")) {
|
|
|
- //光照指数
|
|
|
- ProBasicPowerstationPoint gzzsvalue = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.RPJGZD);
|
|
|
- gzzs = edosUtil.getRealData(gzzsvalue).getPointValueInDouble();
|
|
|
- }
|
|
|
+ //光照指数
|
|
|
+ ProBasicPowerstationPoint gzzsvalue = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.RPJGZD);
|
|
|
+ gzzs = edosUtil.getRealData(gzzsvalue).getPointValueInDouble();
|
|
|
+ //风能利用率
|
|
|
+ ProBasicPowerstationPoint fnlylvalue = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.FNLYL);
|
|
|
+ fnlyl = edosUtil.getRealData(fnlylvalue).getPointValueInDouble();
|
|
|
|
|
|
//月发电量
|
|
|
ProBasicPowerstationPoint yfdlvalue = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.YFDL);
|
|
@@ -473,6 +480,7 @@ public class MonitorService {
|
|
|
qt.put("nfdl", MathUtil.twoBit(nfdl));
|
|
|
qt.put("llgl", MathUtil.twoBit(llgl));
|
|
|
qt.put("gzzs", MathUtil.twoBit(gzzs));
|
|
|
+ qt.put("fnlyl", MathUtil.twoBit(fnlyl));
|
|
|
qt.put("ssfs", MathUtil.twoBit(ssfs));
|
|
|
qt.put("jys", MathUtil.twoBit(jys));
|
|
|
qt.put("jym", MathUtil.twoBit(jym));
|
|
@@ -1032,6 +1040,72 @@ public class MonitorService {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ //24小时功率曲线
|
|
|
+ public List<PowercurveVo> Powercurve24(String wpId) throws Exception {
|
|
|
+
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+
|
|
|
+ Date beginDate = com.gyee.common.util.DateUtils.getSamedayZero(); //当日零点
|
|
|
+ Date endDate = com.gyee.common.util.DateUtils.getCurrentDate(); //当前时间
|
|
|
+ List<PowercurveVo> vos = new ArrayList<PowercurveVo>();
|
|
|
+
|
|
|
+// //初始化场站信息
|
|
|
+// List<ProBasicPowerstation> wplist = new ArrayList<>();
|
|
|
+// List<ProBasicProject> projects = new ArrayList<>();
|
|
|
+// List<ProBasicLine> lines = new ArrayList<>();
|
|
|
+//
|
|
|
+// if (CacheContext.wpmapls.containsKey(wpId)) {
|
|
|
+// wplist = CacheContext.wpmapls.get(wpId);
|
|
|
+// } else {
|
|
|
+// if (CacheContext.projmap.containsKey(wpId)){
|
|
|
+// projects = CacheContext.projmap.get(wpId);
|
|
|
+// }else {
|
|
|
+// if (CacheContext.prolinemap.containsKey(wpId)){
|
|
|
+// lines = CacheContext.prolinemap.get(wpId);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+ for (int i = 0; i < 24; i++) {
|
|
|
+ PowercurveVo vo = new PowercurveVo();
|
|
|
+ vo.setLlgl(0.0); //理论功率
|
|
|
+ vo.setSjgl(0.0); //实际功率
|
|
|
+ vo.setSsfs(0.0); //实时风速
|
|
|
+ vo.setBzgl(0.0); //保证功率
|
|
|
+ vo.setHours(i); //时间戳
|
|
|
+ vo.setName(wpId);
|
|
|
+ vos.add(vo);
|
|
|
+ }
|
|
|
+
|
|
|
+ ProBasicPowerstationPoint bzgl = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.BZGL);
|
|
|
+ ProBasicPowerstationPoint llgl = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.LLGL);
|
|
|
+ ProBasicPowerstationPoint sjgl = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.SSZGL);
|
|
|
+
|
|
|
+ List<PointData> bzglls = edosUtil.getHistoryDatasSnap(bzgl, beginDate.getTime() / 1000, endDate.getTime() / 1000, null, 3600L);
|
|
|
+ double temp1 = 0;
|
|
|
+ for (int i = 0; i < bzglls.size(); i++) {
|
|
|
+ temp1 = bzglls.get(i).getPointValueInDouble();
|
|
|
+ vos.get(i).setBzgl(StringUtils.round(temp1, 2));
|
|
|
+ }
|
|
|
+
|
|
|
+ List<PointData> llglls = edosUtil.getHistoryDatasSnap(llgl, beginDate.getTime() / 1000, endDate.getTime() / 1000, null, 3600L);
|
|
|
+ double temp2 = 0;
|
|
|
+ for (int i = 0; i < llglls.size(); i++) {
|
|
|
+ temp2 = llglls.get(i).getPointValueInDouble();
|
|
|
+ vos.get(i).setLlgl(StringUtils.round(temp2, 2));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ List<PointData> sjglls = edosUtil.getHistoryDatasSnap(sjgl, beginDate.getTime() / 1000, endDate.getTime() / 1000, null, 3600L);
|
|
|
+ double temp4 = 0;
|
|
|
+ for (int i = 0; i < sjglls.size(); i++) {
|
|
|
+ temp4 = sjglls.get(i).getPointValueInDouble();
|
|
|
+ vos.get(i).setSjgl(StringUtils.round(temp4, 2));
|
|
|
+
|
|
|
+ }
|
|
|
+ return vos;
|
|
|
+ }
|
|
|
+
|
|
|
/**********************************************计划电量统计**********************************************************/
|
|
|
private void setPlanInfoByType
|
|
|
(Map<String, Map<String, Double>> gxkmap, List<ProBasicProjectPlan> planls, String wpId) {
|