Jelajahi Sumber

修改电量(异常用功率算)计算程序

xieshengjie 2 tahun lalu
induk
melakukan
32dcb357bd

+ 19 - 2
realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/CycleCalculationService.java

@@ -56,7 +56,7 @@ public class CycleCalculationService {
         Map<String, Map<String, ProBasicPowerstationPoint>> linepointmap = CacheContext.linepointmap;
         Map<String, Map<String, ProBasicPowerstationPoint>> propointmap = CacheContext.propointmap;
         Map<String, Map<String, ProBasicPowerstationPoint>> wppointmap = CacheContext.wppointmap;
-
+        Map<String, Double> modelpower = CacheContext.modelpower;
         List<PointData> wtResultList = new ArrayList<>();
         wtls.stream().forEach(wt->{
             Map<String,Double> dataMap = new HashMap<>();
@@ -166,7 +166,24 @@ public class CycleCalculationService {
                 double date15agofdl = edosUtil.getSectionData(rssfdlPoint, date15age.getTime()).getPointValueInDouble()*rssfdlPoint.getCoefficient();
 
                 double rfdl = ssfdl - zerofdl;
-                wtResultList.add(PointUtil.createPointData(date,rfdl,rfdlPoint.getNemCode(),rfdlPoint.getName()));
+
+                if (rfdl<0 || rfdl>modelpower.get(wt.getModelId())*24*1.5){
+                    double rfdlnew = 0;
+                    List<PointData> ssglList = edosUtil.getHistoryDatasSnap(ssglPoint, samedayZero.getTime()/1000, currentDate.getTime()/1000, null, 600l);
+                    int glSize = ssglList.size();
+                    long samedayZeroTime = samedayZero.getTime();
+
+                    for (int i = 0;i<ssglList.size();i++){
+                        Long pointTime = ssglList.get(i).getPointTime()*1000;
+                        double hours = (currentDate.getTime() - samedayZeroTime) / 1000 / 60 / 60;
+                        rfdlnew += hours*1/glSize*ssglList.get(i).getPointValueInDouble();
+                    }
+                    wtResultList.add(PointUtil.createPointData(date,rfdlnew,rfdlPoint.getNemCode(),rfdlPoint.getName()));
+                }else {
+                    wtResultList.add(PointUtil.createPointData(date,rfdl,rfdlPoint.getNemCode(),rfdlPoint.getName()));
+                }
+
+
                 double yfdl = ssfdl - monthfirstfdl;
                 wtResultList.add(PointUtil.createPointData(date,yfdl,yfdlPoint.getNemCode(),yfdlPoint.getName()));
                 double nfdl = ssfdl - yearfirstfdl;

+ 26 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/CommonController.java

@@ -192,4 +192,30 @@ public class CommonController {
             return R.error(ResultMsg.error());
         }
     }
+
+    /**
+     * 查询测点值
+     *
+     * @return
+     */
+    @GetMapping("/findPointDatas")
+    @ResponseBody
+    @ApiOperation(value = "查询测点值", notes = "查询测点值")
+    public R findPointDatas(@RequestParam(value = "pointIds", required = true) String pointIds) throws Exception {
+
+
+        List<String> pointList = new ArrayList<>();
+
+        String[] points = pointIds.split(",");
+
+        Arrays.stream(points).forEach(p -> {
+            pointList.add(p);
+        });
+        List<PointData> resultList = edosUtil.getRealData(pointList);
+        if (StringUtils.isNotNull(resultList)) {
+            return R.data(ResultMsg.ok(resultList));
+        } else {
+            return R.error(ResultMsg.error());
+        }
+    }
 }

+ 4 - 4
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/monitor/DeviceDetailsController.java

@@ -8,6 +8,7 @@ import com.gyee.common.vo.monitor.AgcVo;
 import com.gyee.runeconomy.dto.R;
 import com.gyee.runeconomy.dto.ResultMsg;
 import com.gyee.runeconomy.model.auto.ProEconTestingPoint;
+import com.gyee.runeconomy.model.vo.ProTreeVo;
 import com.gyee.runeconomy.service.monitor.DeviceDetailsService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -37,9 +38,9 @@ public class DeviceDetailsController {
     @ApiOperation(value = "左侧树形", notes = "左侧树形")
     public R tree(@RequestParam(value = "wpid",required = true) String wpid) throws Exception {
 
-        Map<String,Object> resultMap = deviceDetailsService.tree(wpid);
-        if (StringUtils.isNotNull(resultMap)) {
-            return R.data(ResultMsg.ok(resultMap));
+        List<ProTreeVo> resultList = deviceDetailsService.tree(wpid);
+        if (StringUtils.isNotNull(resultList)) {
+            return R.data(ResultMsg.ok(resultList));
         }else{
             return R.error(ResultMsg.error());
         }
@@ -81,5 +82,4 @@ public class DeviceDetailsController {
     }
 
 
-
 }

+ 17 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/model/vo/LineTreeVo.java

@@ -0,0 +1,17 @@
+package com.gyee.runeconomy.model.vo;/*
+@author   谢生杰
+@date   2023/4/17-15:25
+*/
+
+import com.gyee.runeconomy.model.auto.ProBasicEquipment;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class LineTreeVo {
+
+    private String lnid;
+    private String lnname;
+    private List<ProBasicEquipment> wts;
+}

+ 16 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/model/vo/ProTreeVo.java

@@ -0,0 +1,16 @@
+package com.gyee.runeconomy.model.vo;/*
+@author   谢生杰
+@date   2023/4/17-15:25
+*/
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class ProTreeVo {
+
+    private String pjid;
+    private String pjname;
+    private List<LineTreeVo> lns;
+}

+ 20 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/model/vo/TreeVo.java

@@ -0,0 +1,20 @@
+package com.gyee.runeconomy.model.vo;/*
+@author   谢生杰
+@date   2023/4/17-15:18
+*/
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class TreeVo {
+    private String wpid;
+    private String wpname;
+    private List<ProTreeVo> pjs;
+}
+
+
+
+
+

+ 18 - 4
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/DeviceDetailsService.java

@@ -9,6 +9,9 @@ import com.gyee.common.model.PointData;
 import com.gyee.common.vo.monitor.AgcVo;
 import com.gyee.runeconomy.init.CacheContext;
 import com.gyee.runeconomy.model.auto.*;
+import com.gyee.runeconomy.model.vo.LineTreeVo;
+import com.gyee.runeconomy.model.vo.ProTreeVo;
+import com.gyee.runeconomy.model.vo.TreeVo;
 import com.gyee.runeconomy.service.auto.IProEconTestingPointService;
 import com.gyee.runeconomy.util.StringUtils;
 import com.gyee.runeconomy.util.realtimesource.IEdosUtil;
@@ -28,22 +31,33 @@ public class DeviceDetailsService {
     @Resource
     private IProEconTestingPointService proEconTestingPointService;
 
-    public Map<String,Object> tree(String wpid) {
+    public List<ProTreeVo> tree(String wpid) {
         Map<String,Object> proMap = new HashMap<>();
         Map<String, List<ProBasicProject>> wppromap = CacheContext.wppromap;
         Map<String, List<ProBasicLine>> prolinemap = CacheContext.prolinemap;
         Map<String, List<ProBasicEquipment>> lnwtmap = CacheContext.lnwtmap;
         List<ProBasicProject> projects = wppromap.get(wpid);
+        TreeVo vo = new TreeVo();
+        List<ProTreeVo> pjvos = new ArrayList<>();
         projects.stream().forEach(p->{
             List<ProBasicLine> lines = prolinemap.get(p.getId());
             Map<String,Object> lineMap = new HashMap<>();
+            List<LineTreeVo> lnvos = new ArrayList<>();
+            ProTreeVo pjvo = new ProTreeVo();
+            pjvo.setPjid(p.getId());
+            pjvo.setPjname(p.getAname());
             lines.stream().forEach(line->{
+                LineTreeVo lnvo = new LineTreeVo();
+                lnvo.setLnid(line.getId());
+                lnvo.setLnname(line.getAname());
                 List<ProBasicEquipment> equipments = lnwtmap.get(line.getId());
-                lineMap.put(line.getAname(),equipments);
+                lnvo.setWts(equipments);
+                lnvos.add(lnvo);
             });
-            proMap.put(p.getAname(),lineMap);
+            pjvo.setLns(lnvos);
+            pjvos.add(pjvo);
         });
-        return proMap;
+        return pjvos;
     }
 
     public Map<String, Double> info(String wtid) throws Exception {