Selaa lähdekoodia

添加地貌图场站、项目、风机接口

shilin 2 vuotta sitten
vanhempi
commit
540929da9e

+ 162 - 2
web/monitor-web-sxjn/src/main/java/com/gyee/frame/controller/powercompare/PowerCompareController.java

@@ -2,13 +2,17 @@ package com.gyee.frame.controller.powercompare;
 
 import com.gyee.frame.common.conf.AjaxStatus;
 import com.gyee.frame.common.domain.AjaxResult;
+import com.gyee.frame.common.spring.Constant;
 import com.gyee.frame.common.spring.InitialRunner;
 import com.gyee.frame.model.auto.*;
+import com.gyee.frame.model.custom.MatrixVo;
+import com.gyee.frame.model.custom.PointData;
 import com.gyee.frame.model.custom.StopTypeTreeVo;
+import com.gyee.frame.service.WindTurbineTestingPointAiService;
 import com.gyee.frame.service.Windpowerinfoday3Service;
 import com.gyee.frame.service.Windturbineinfoday3Service;
-import com.gyee.frame.util.DateUtils;
-import com.gyee.frame.util.StringUtils;
+import com.gyee.frame.service.photovolatic.PhotovoltaicTestingPointNewService;
+import com.gyee.frame.util.*;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -32,7 +36,12 @@ public class PowerCompareController {
     private Windpowerinfoday3Service windpowerinfoday3Service;
     @Resource
     private Windturbineinfoday3Service windturbineinfoday3Service;
+    @Resource
+    private WindTurbineTestingPointAiService windTurbineTestingPointAiService;
+    @Resource
+    private PhotovoltaicTestingPointNewService photovoltaicTestingPointNewService;
 
+    IRealTimeDataBaseUtil realApiUtil = RealTimeDataBaseFactory.createRealTimeDataBase();
     /**
      * 报警类型列表
      * @return
@@ -98,6 +107,20 @@ public class PowerCompareController {
         for (Windpowerstation station : InitialRunner.wpallls) {
             StopTypeTreeVo vo = new StopTypeTreeVo();
             vo.setId(station.getId());
+            List<StopTypeTreeVo> pjls = new ArrayList<StopTypeTreeVo>();
+
+            for(Project pj:InitialRunner.pjallls)
+            {
+                if(pj.getWindpowerstationid().equals(station.getId()))
+                {
+                    StopTypeTreeVo pjvo = new StopTypeTreeVo();
+                    pjvo.setId(pj.getId());
+                    pjvo.setName(pj.getName());
+                    pjls.add(pjvo);
+                }
+
+            }
+            vo.setPjls(pjls);
             vo.setName(station.getName());
             vo.setpId("0");
             vos.add(vo);
@@ -176,6 +199,7 @@ public class PowerCompareController {
         }
     }
 
+
     /**
      * 线路下拉接口
      * @return
@@ -321,6 +345,142 @@ public class PowerCompareController {
         }
     }
 
+
+    /**
+     * 通过项目D获取风机下拉接口
+     * @return
+     */
+    @GetMapping("/windturbineByPjIdAjax")
+    @ResponseBody
+    @CrossOrigin
+    @ApiOperation(value = "通过风场编号查询风机数据列表", notes = "通过风场编号查询风机数据列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pjId", value = "项目编号", required = true, dataType = "string", paramType = "query")})
+
+    public AjaxResult windturbineByPjIdAjax(String pjId) throws Exception {
+
+        List<MatrixVo>  mvos = new ArrayList<>();
+
+        if (StringUtils.isNotEmpty(pjId)){
+
+
+            if (InitialRunner.pj_wtmap.containsKey(pjId)){
+                List<Windturbine> wtls=InitialRunner.pj_wtmap.get(pjId);
+
+                List<String> fjzbls = new ArrayList<>();
+
+                for (Windturbine wt : wtls) {
+                    //风机状态
+                    fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.ZTMX).getCode());
+                    //风速
+                    fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.TPOINT_WT_FJSSFS).getCode());
+                    //功率
+                    fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.TPOINT_WT_FJGL).getCode());
+
+                    fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.TPOINT_WT_FDJZS).getCode());
+
+                }
+
+                List<PointData> fjzblist = realApiUtil.getRealData(fjzbls);
+
+                if (!fjzblist.isEmpty() && fjzblist.size() == fjzbls.size()) {
+
+
+                    int step = 4;
+
+                    for (int i = 0; i < wtls.size(); i++) {
+                        Windturbine wt = wtls.get(i);
+
+                        MatrixVo vo = new MatrixVo();
+                        vo.setWtId(wt.getId());
+                        String num = wt.getId().substring(wt.getId().indexOf("_") + 1);
+                        vo.setWtnum(num);
+
+                        vo.setFjzt(MathUtil.twoBit(fjzblist.get(i * step).getPointValueInDouble()));
+                        vo.setFs(MathUtil.twoBit(fjzblist.get(i * step + 1).getPointValueInDouble()));
+                        vo.setGl(MathUtil.twoBit(fjzblist.get(i * step + 2).getPointValueInDouble()));
+
+                        //风机转数
+                        double fdjzs = MathUtil.twoBit(fjzblist.get(i * step + 3).getPointValueInDouble());
+                        vo.setFdjzs(fdjzs);
+                        vo.setWtCode(wt.getCode());
+                        vo.setWpId(wt.getWindpowerstationid());
+                        mvos.add(vo);
+
+                    }
+                }
+            }else   if (InitialRunner.pj_nbqmap.containsKey(pjId))
+            {
+                List<Inverter> wtls=InitialRunner.pj_nbqmap.get(pjId);
+                List<String> fjzbls = new ArrayList<>();
+
+                for (Inverter wt : wtls) {
+                    //风机状态
+                    fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.ZTMX).getCode());
+                    //风速
+                    fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.TPOINT_WT_FJSSFS).getCode());
+                    //功率
+                    fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.TPOINT_WT_FJGL).getCode());
+
+                    fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.TPOINT_WT_FDJZS).getCode());
+
+                }
+
+                List<PointData> fjzblist = realApiUtil.getRealData(fjzbls);
+
+                if (!fjzblist.isEmpty() && fjzblist.size() == fjzbls.size()) {
+
+
+                    int step = 4;
+
+                        for (int i = 0; i < wtls.size(); i++) {
+                            Inverter wt = wtls.get(i);
+
+                            MatrixVo vo = new MatrixVo();
+                            vo.setWtId(wt.getId());
+                            String num = wt.getId().substring(wt.getId().indexOf("_")+1);
+                            vo.setWtnum(num);
+
+                            vo.setFjzt(MathUtil.twoBit(fjzblist.get(i * step).getPointValueInDouble()));
+                            vo.setFs(MathUtil.twoBit(fjzblist.get(i * step + 1).getPointValueInDouble()));
+                            vo.setGl(MathUtil.twoBit(fjzblist.get(i * step + 2).getPointValueInDouble()));
+
+                            //风机转数
+
+                            double fdjzs = MathUtil.twoBit(fjzblist.get(i * step + 3).getPointValueInDouble());
+                            Equipmentmodel model = InitialRunner.mlmap.get(wt.getModelid());
+//                    if (model.getPowerproduction() == 2000) {
+//                        vo.setFdjzs(fdjzs * 9.55);
+//                    } else {
+//                        vo.setFdjzs(fdjzs);
+//                    }
+                            vo.setFdjzs(fdjzs);
+
+                            vo.setWtCode(wt.getCode());
+                            vo.setWpId(wt.getWindpowerstationid());
+                            mvos.add(vo);
+
+                        }
+                    }
+
+
+            }
+
+        }
+
+
+
+
+
+        if(mvos !=null && !mvos.isEmpty())
+        {
+            return	AjaxResult.successData(AjaxStatus.success.code,mvos);
+        }else
+        {
+            return	AjaxResult.successData(AjaxStatus.success.code,mvos);
+        }
+    }
+
     /**
      * 获得所有风电场风机下拉接口
      * @return

+ 10 - 0
web/monitor-web-sxjn/src/main/java/com/gyee/frame/model/custom/StopTypeTreeVo.java

@@ -1,9 +1,12 @@
 package com.gyee.frame.model.custom;
 
+import java.util.List;
+
 public class StopTypeTreeVo {
 	private String id;
 	private String pId;
 	private String name;
+	private List<StopTypeTreeVo> pjls;
 	public String getId() {
 		return id;
 	}
@@ -23,4 +26,11 @@ public class StopTypeTreeVo {
 		this.name = name;
 	}
 
+    public List<StopTypeTreeVo> getPjls() {
+        return pjls;
+    }
+
+    public void setPjls(List<StopTypeTreeVo> pjls) {
+        this.pjls = pjls;
+    }
 }

+ 0 - 84
web/monitor-web-sxjn/src/test/java/test/EarlyWarnKnowledgeTest.java

@@ -1,84 +0,0 @@
-package test;
-
-import com.github.pagehelper.PageInfo;
-import com.gyee.SpringbootStart;
-import com.gyee.frame.common.domain.AjaxResult;
-import com.gyee.frame.common.spring.SpringUtils;
-import com.gyee.frame.controller.health.EarlyWarnKnowledgeController;
-import com.gyee.frame.model.auto.Alertrule2;
-import com.gyee.frame.model.custom.Tablepar;
-import com.gyee.frame.util.StringUtils;
-import lombok.SneakyThrows;
-import org.springframework.boot.SpringApplication;
-
-public class EarlyWarnKnowledgeTest {
-
-    @SneakyThrows
-    public static void main(String[] args) {
-
-        SpringApplication.run(SpringbootStart.class, args);
-
-
-
-        String wtId="MG01_03";
-        String wpId="MHS_FDC";
-        String year="2021";
-        String month="1";
-        String category="bbb";
-        String name="故障";
-
-        String expression="";
-        Integer enabled=0;
-
-
-        EarlyWarnKnowledgeController earlyWarnKnowledgeController= SpringUtils.getBean("earlyWarnKnowledgeController");
-
-        Tablepar tablepar=new Tablepar();
-        tablepar.setPageNum(1);
-        tablepar.setPageSize(10);
-        tablepar.setOrderByColumn("name");
-        tablepar.setIsAsc("asc");
-
-
-        Alertrule2 po=new Alertrule2();
-
-        po.setId(StringUtils.getUUID());
-        po.setCategory("ccc");
-        po.setRank("3");
-        po.setName("test1");
-        po.setExpression("111");
-        po.setEnabled(0);
-
-
-        earlyWarnKnowledgeController.insertFaultknowledge(po);
-
-
-        AjaxResult result=earlyWarnKnowledgeController.findFaultknowledge(po.getId());
-
-        Alertrule2 po2=(Alertrule2)result.get("data");
-
-        if(StringUtils.notEmp(po2))
-        {
-            po.setCategory("bbb");
-            po.setRank("6");
-            po.setName("test2");
-            po.setExpression("222");
-            po.setEnabled(1);
-            earlyWarnKnowledgeController.updateFaultknowledge(po2);
-        }
-        AjaxResult ar = earlyWarnKnowledgeController.earlyWarnKnowledgeList(tablepar,null,category,null);
-
-        PageInfo<Alertrule2> vos=(PageInfo<Alertrule2>)ar.get("data");
-
-
-        for(Alertrule2 wtd:vos.getList())
-        {
-            System.out.println(wtd.getName()+"----------------"+wtd.getCategory()
-                   +"----------------"+wtd.getRank()+"----------------"+wtd.getExpression()+"----------------"+wtd.getEnabled());
-        }
-
-
-        earlyWarnKnowledgeController.deleteFaultknowledge(po2.getId());
-
-    }
-}