Pārlūkot izejas kodu

阵区矩阵提交

wangb@gyee-china.com 1 gadu atpakaļ
vecāks
revīzija
6928ffe8c4

+ 7 - 3
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/monitor/PhotovoltaicmatrixController.java

@@ -36,13 +36,17 @@ public class PhotovoltaicmatrixController {
     @ResponseBody
     @ApiOperation(value = "首页", notes = "首页")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "wpId", value = "场站编号", required = true, dataType = "string", paramType = "query")})
+            @ApiImplicitParam(name = "wpId", value = "场站编号", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "type", value = "类型", required = true, dataType = "string", paramType = "query")
+//            @ApiImplicitParam(name = "pageNum", value = "场站编号", required = true, dataType = "string", paramType = "query"),
+//            @ApiImplicitParam(name = "pageSize", value = "场站编号", required = true, dataType = "string", paramType = "query"),
+    })
 
-    public AjaxResult getinformation(String wpId) throws Exception {
+    public AjaxResult getinformation(String wpId,String type) throws Exception {
 
         Map<String, String> map = new HashMap<>();
         if (!wpId.isEmpty()) {
-            map = photovoltaicmatrixService.getcockpit(wpId);
+            map = photovoltaicmatrixService.getcockpit(wpId,type);
         }
         if (null != map) {
             return AjaxResult.successData(200, map);

+ 219 - 59
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/PhotovoltaicmatrixService.java

@@ -1,12 +1,18 @@
 package com.gyee.runeconomy.service.monitor;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.gyee.common.contant.ContantXk;
+import com.gyee.common.model.PointData;
 import com.gyee.runeconomy.dto.EquipmentJzVo;
 import com.gyee.runeconomy.dto.EquipmentZcVo;
 import com.gyee.runeconomy.init.CacheContext;
 import com.gyee.runeconomy.model.auto.*;
 import com.gyee.runeconomy.service.auto.impl.ProBasicEquipmentPointServiceImpl;
+import com.gyee.runeconomy.service.auto.impl.ProBasicPowerstationPointServiceImpl;
+import com.gyee.runeconomy.service.auto.impl.ProBasicSquareServiceImpl;
 import com.gyee.runeconomy.util.MathUtil;
+import com.gyee.runeconomy.util.StringUtils;
 import com.gyee.runeconomy.util.realtimesource.IEdosUtil;
 import org.springframework.stereotype.Service;
 
@@ -22,87 +28,241 @@ public class PhotovoltaicmatrixService {
     @Resource
     private ProBasicEquipmentPointServiceImpl proBasicEquipmentPointService;
 
-    Map<String, Object> map = new HashMap<>();
-
+    @Resource
+    private ProBasicPowerstationPointServiceImpl proBasicPowerstationPointService;
+    @Resource
+    private ProBasicSquareServiceImpl proBasicSquareService;
 
-    public Map getcockpit(String wpId) throws Exception {
 
-        List<ProBasicPowerstation> wpls = CacheContext.wpls;
+    public Map getcockpit(String wpId,String type) throws Exception {
+        Map<String, Object> map = new HashMap<>();
+        List<ProBasicPowerstation> wpls = CacheContext.wplsG;
         List<ProBasicEquipment> wtls = CacheContext.wtls;
-        List<ProBasicSquare> sqls = CacheContext.sqls;
+//        List<ProBasicSquare> sqls = CacheContext.sqls;
+
+//        Page<ProBasicSquare> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
+        Page<ProBasicSquare> page = new Page<>();
+        QueryWrapper<ProBasicSquare> qw = new QueryWrapper<>();
+        if (type.equals("JZ")) {
+            qw.lambda().eq(ProBasicSquare::getTypes, "JZ");
+        }else {
+            qw.lambda().eq(ProBasicSquare::getTypes, "ZC");
+        }
+        qw.lambda().eq(ProBasicSquare::getWindpowerstationId, wpId);
+        List<ProBasicSquare> sqls = proBasicSquareService.getBaseMapper().selectList(qw);
+
+//        List<ProBasicSquare> sqls = ProBasicLine.getRecords();
+
+        List<String> gfztls = new ArrayList<>();
+        Map<String, Double> mxztmap = new LinkedHashMap<>();
+        Map<String, Object> qtsjmap = new LinkedHashMap<>();
 
-        Map<String, List> jzmap = new LinkedHashMap<>();
-        List<EquipmentJzVo> jzlist;
 
         Map<String, List> zcmap = new LinkedHashMap<>();
         List<EquipmentZcVo> zclist;
 
-        double zcrfdl = 0.0;
-        double jzrfdl = 0.0;
+        double jzjldl = 0.0;
+        double jzjldy = 0.0;
         double jzmxzt = 0.0;
+
+        double ssgl = 0.0;
+
+        double zcjldl = 0.0;
+        double zcjldy = 0.0;
         double zcmxzt = 0.0;
-        double yggl = 0.0;
-        double zfdl = 0.0;
 
+
+        double gzqd = 0.0;
+        double ycgl = 0.0;
+        double bzgl = 0.0;
+        double sjgl = 0.0;
+
+        double totalRfdl = 0;
+        double totalZfdl = 0;
+
+        //待风
+        double gf_dfnum = 0;
+        //手动停机
+        double gf_sdtjnum = 0;
+        //正常发电
+        double gf_zcfdnum = 0;
+        //降出力运行
+        double gf_jclyxnum = 0;
+        //限电降出力
+        double gf_xdjclnum = 0;
+        //停机
+        double gf_tjnum = 0;
+        //故障停机
+        double gf_gztjnum = 0;
+        //故障场内受累
+        double gf_gzcnslnum = 0;
+        //检修停机
+        double gf_jxtjnum = 0;
+        //检修场内受累
+        double gf_jxclslnum = 0;
+        //受累电网
+        double gf_sldwnum = 0;
+        //受累环境
+        double gf_slhjnum = 0;
+        //离线
+        double gf_lxnum = 0;
+        //未知
+        double gf_wznum = 0;
+        Map<Object, Object> jzmap = new LinkedHashMap<>();
         for (ProBasicPowerstation wp : wpls) {
             if (wp.getId().contains(wpId)) {
-                //查询场站下集中、组串方阵
-                List<ProBasicSquare> zcls = sqls.stream().filter(c -> c.getTypes().equals("ZC") && c.getWindpowerstationId().equals(wpId)).collect(Collectors.toList());
-                List<ProBasicSquare> jzls = sqls.stream().filter(c -> c.getTypes().equals("JZ") && c.getWindpowerstationId().equals(wpId)).collect(Collectors.toList());
-                List<ProBasicEquipment> sbls = wtls.stream().filter(w -> w.getWindpowerstationId().equals(wpId)).collect(Collectors.toList());
-
-                jzmap = new LinkedHashMap<>();
-                for (ProBasicSquare jz : jzls) {
-                    jzlist = new ArrayList<>();
-                    for (ProBasicEquipment wt : sbls) {
-                        if (wt.getSquareId().equals(jz.getId())) {
-                            EquipmentJzVo vo = new EquipmentJzVo();
-                            ProBasicEquipmentPoint rfdlvalue = proBasicEquipmentPointService.getEquipmentPoint(wt.getId(), ContantXk.RFDL);
-                            jzrfdl = edosUtil.getRealData(rfdlvalue).getPointValueInDouble();
-                            ProBasicEquipmentPoint ygglvalue = proBasicEquipmentPointService.getEquipmentPoint(wt.getId(), ContantXk.RPJGL);
-                            yggl = edosUtil.getRealData(ygglvalue).getPointValueInDouble();
-                            ProBasicEquipmentPoint mxztvalue = proBasicEquipmentPointService.getEquipmentPoint(wt.getId(), ContantXk.MXZT);
-                            jzmxzt = edosUtil.getRealData(mxztvalue).getPointValueInDouble();
-
-                            vo.setName(wt.getName());
-                            vo.setId(wt.getId());
-                            vo.setRfdl(MathUtil.twoBit(jzrfdl));
-                            vo.setYggl(MathUtil.twoBit(yggl));
-                            vo.setYxzt(MathUtil.twoBit(jzmxzt));
-                            jzlist.add(vo);
+            List<ProBasicEquipment> sbls = wtls.stream().filter(w -> w.getWindpowerstationId().equals(wpId)).collect(Collectors.toList());
+
+                if (type.equals("JZ")) {
+
+
+                    for (ProBasicSquare jz : sqls) {
+                        List<EquipmentJzVo> jzlisttemp = new ArrayList<>();
+                        for (ProBasicEquipment wt : sbls) {
+                            if (jz.getId().equals(wt.getSquareId())) {
+                                EquipmentJzVo vo = new EquipmentJzVo();
+                                ProBasicEquipmentPoint jldlvalue = proBasicEquipmentPointService.getEquipmentPoint(wt.getId(), ContantXk.JLDL);
+                                jzjldl= edosUtil.getRealData(jldlvalue).getPointValueInDouble();
+                                ProBasicEquipmentPoint jldyvalue = proBasicEquipmentPointService.getEquipmentPoint(wt.getId(), ContantXk.JLDY);
+                                jzjldy = edosUtil.getRealData(jldyvalue).getPointValueInDouble();
+                                ProBasicEquipmentPoint ssglvalue = proBasicEquipmentPointService.getEquipmentPoint(wt.getId(), ContantXk.CJ_SSGL);
+                                ssgl = edosUtil.getRealData(ssglvalue).getPointValueInDouble();
+                                ProBasicEquipmentPoint mxztvalue = proBasicEquipmentPointService.getEquipmentPoint(wt.getId(), ContantXk.MXZT);
+                                jzmxzt = edosUtil.getRealData(mxztvalue).getPointValueInDouble();
+
+                                vo.setName(wt.getAname());
+                                vo.setId(wt.getId());
+                                vo.setJldl(MathUtil.twoBit(jzjldl));
+                                vo.setJldy(MathUtil.twoBit(jzjldy));
+                                vo.setSsgl(MathUtil.twoBit(ssgl));
+                                vo.setYxzt(MathUtil.twoBit(jzmxzt));
+                                jzlisttemp.add(vo);
+                            }
                         }
+                        jzmap.put(jz.getAname(), jzlisttemp);
                     }
-                    jzmap.put(jz.getId(), jzlist);
+
+                    qtsjmap.put("zjsl",wp.getJrquantityJz());
+                    qtsjmap.put("czmc",wp.getName());
+                    qtsjmap.put("czid",wp.getId());
+                    map.put("jzzqsl", sqls.size());
+                    map.put("ZQ", jzmap);
                 }
-                map.put("jz", jzmap);
-
-                zcmap = new LinkedHashMap<>();
-                for (ProBasicSquare zc : zcls) {
-                    zclist = new ArrayList<>();
-                    for (ProBasicEquipment wt : sbls) {
-                        if (wt.getSquareId().equals(zc.getId())) {
-                            EquipmentZcVo vo = new EquipmentZcVo();
-                            ProBasicEquipmentPoint zcrfdlvalue = proBasicEquipmentPointService.getEquipmentPoint(wt.getId(), ContantXk.RFDL);
-                            zcrfdl = edosUtil.getRealData(zcrfdlvalue).getPointValueInDouble();
-                            ProBasicEquipmentPoint zfdlvalue = proBasicEquipmentPointService.getEquipmentPoint(wt.getId(), ContantXk.RZFDL);
-                            zfdl = edosUtil.getRealData(zfdlvalue).getPointValueInDouble();
-                            ProBasicEquipmentPoint mxztvalue = proBasicEquipmentPointService.getEquipmentPoint(wt.getId(), ContantXk.MXZT);
-                            zcmxzt = edosUtil.getRealData(mxztvalue).getPointValueInDouble();
-
-                            vo.setName(wt.getName());
-                            vo.setId(wt.getId());
-                            vo.setRfdl(MathUtil.twoBit(zcrfdl));
-                            vo.setZfdl(MathUtil.twoBit(zfdl));
-                            vo.setYxzt(MathUtil.twoBit(zcmxzt));
-                            zclist.add(vo);
+                if (type.equals("ZC")) {
+                    zcmap = new LinkedHashMap<>();
+                    for (ProBasicSquare zc : sqls) {
+                        zclist = new ArrayList<>();
+                        for (ProBasicEquipment wt : sbls) {
+                            if (wt.getSquareId().equals(zc.getId())) {
+                                EquipmentZcVo vo = new EquipmentZcVo();
+                                ProBasicEquipmentPoint zcjldlvalue = proBasicEquipmentPointService.getEquipmentPoint(wt.getId(), ContantXk.JLDL);
+                                zcjldl = edosUtil.getRealData(zcjldlvalue).getPointValueInDouble();
+
+                                ProBasicEquipmentPoint zcjldyvalue = proBasicEquipmentPointService.getEquipmentPoint(wt.getId(), ContantXk.JLDY);
+                                zcjldy = edosUtil.getRealData(zcjldyvalue).getPointValueInDouble();
+
+                                ProBasicEquipmentPoint ssglvalue = proBasicEquipmentPointService.getEquipmentPoint(wt.getId(), ContantXk.CJ_SSGL);
+                                ssgl = edosUtil.getRealData(ssglvalue).getPointValueInDouble();
+
+                                ProBasicEquipmentPoint mxztvalue = proBasicEquipmentPointService.getEquipmentPoint(wt.getId(), ContantXk.MXZT);
+                                zcmxzt = edosUtil.getRealData(mxztvalue).getPointValueInDouble();
+
+                                vo.setName(wt.getAname());
+                                vo.setId(wt.getId());
+                                vo.setJldl(MathUtil.twoBit(zcjldl));
+                                vo.setJldy(MathUtil.twoBit(zcjldy));
+                                vo.setSsgl(MathUtil.twoBit(ssgl));
+                                vo.setYxzt(MathUtil.twoBit(zcmxzt));
+                                zclist.add(vo);
+//                                totalRfdl += zcrfdl;
+//                                totalZfdl += zfdl;
+                                map.put("model",wt.getModelId());
+                            }
                         }
+                        zcmap.put(zc.getAname(), zclist);
                     }
-                    zcmap.put(zc.getId(), zclist);
+                    qtsjmap.put("zjsl",wp.getJrquantityJz());
+                    qtsjmap.put("czmc",wp.getName());
+                    qtsjmap.put("czid",wp.getId());
+                    map.put("zczqsl", sqls.size());
+//                    map.put("rfdlzs", totalRfdl);
+//                    map.put("zfdlzs", totalZfdl);
+                    map.put("ZQ", zcmap);
                 }
-                map.put("zc", zcmap);
             }
         }
+        gfztls.add(proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.GZTSMX).getNemCode());    //故障台数
+        gfztls.add(proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.CNSLGZTSMX).getNemCode()); //场内受累故障台数
+        gfztls.add(proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.JXTSMX).getNemCode());    //检修台数
+        gfztls.add(proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.CNSLJXTSMX).getNemCode());//场内受累检修台数
+        gfztls.add(proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.DJTSMX).getNemCode());//待机台数
+        gfztls.add(proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.QXJCLTSMX).getNemCode());//缺陷降出力台数
+        gfztls.add(proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.SDTJTSMX).getNemCode());//手动停机台数
+        gfztls.add(proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.XNTSMX).getNemCode());//性能台数
+        gfztls.add(proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.XDTJTSMX).getNemCode());//限电停机台数
+        gfztls.add(proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.XDJCLTSMX).getNemCode());//限电降出力台数
+        gfztls.add(proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.CWSLDWTSMX).getNemCode());//场外受累电网台数
+        gfztls.add(proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.CWSLTQTSMX).getNemCode());//场外受累天气台数
+        gfztls.add(proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.LXTSMX).getNemCode());//离线台数
+        gfztls.add(proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.TXZDTSMX).getNemCode());//通讯中断台数
+
+        ProBasicPowerstationPoint gzqdvalue = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.SSPJGZD);
+        gzqd = edosUtil.getRealData(gzqdvalue).getPointValueInDouble();
+        ProBasicPowerstationPoint bzglvalue = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.SSZBZGL);
+        bzgl = edosUtil.getRealData(bzglvalue).getPointValueInDouble();
+        ProBasicPowerstationPoint ycglvalue = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.SSZNHGLZS);
+        ycgl = edosUtil.getRealData(ycglvalue).getPointValueInDouble();
+        ProBasicPowerstationPoint sjglvalue = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.SSZGL);
+        sjgl = edosUtil.getRealData(sjglvalue).getPointValueInDouble();
+
+        qtsjmap.put("gzqd",MathUtil.twoBit(gzqd));
+        qtsjmap.put("bzgl",MathUtil.twoBit(bzgl));
+        qtsjmap.put("ycgl",MathUtil.twoBit(ycgl));
+        qtsjmap.put("sjgl",MathUtil.twoBit(sjgl/1000));
+        map.put("qtsj",qtsjmap);
+        gfztls = gfztls.stream().filter(a -> a != null).collect(Collectors.toList());
+        if (StringUtils.isNotEmpty(gfztls)) {
+            List<PointData> gfztlist = edosUtil.getRealData(gfztls);
+
+            gf_gztjnum += gfztlist.get(0).getPointValueInDouble();
+            gf_gzcnslnum += gfztlist.get(1).getPointValueInDouble();
+            gf_jxtjnum += gfztlist.get(2).getPointValueInDouble();
+            gf_jxclslnum += gfztlist.get(3).getPointValueInDouble();
+            gf_dfnum += gfztlist.get(4).getPointValueInDouble();
+            gf_jclyxnum += gfztlist.get(5).getPointValueInDouble();
+            gf_sdtjnum += gfztlist.get(6).getPointValueInDouble();
+            gf_zcfdnum += gfztlist.get(7).getPointValueInDouble();
+            gf_tjnum += gfztlist.get(8).getPointValueInDouble();
+            gf_xdjclnum += gfztlist.get(9).getPointValueInDouble();
+            gf_sldwnum += gfztlist.get(10).getPointValueInDouble();
+            gf_slhjnum += gfztlist.get(11).getPointValueInDouble();
+            gf_lxnum += gfztlist.get(12).getPointValueInDouble();
+            gf_wznum += gfztlist.get(13).getPointValueInDouble();
+        }
+        mxztmap.put("gf_dfnum", gf_dfnum);
+        mxztmap.put("gf_sdtjnum", gf_sdtjnum);
+        mxztmap.put("gf_zcfdnum", gf_zcfdnum);
+        mxztmap.put("gf_jclyxnum", gf_jclyxnum);
+        mxztmap.put("gf_gztjnum", gf_gztjnum);
+        mxztmap.put("gf_gzcnslnum", gf_gzcnslnum);
+        mxztmap.put("gf_jxtjnum", gf_jxtjnum);
+        mxztmap.put("gf_jxclslnum", gf_jxclslnum);
+        mxztmap.put("gf_xdjclnum", gf_xdjclnum);
+        mxztmap.put("gf_tjnum", gf_tjnum);
+        mxztmap.put("gf_sldwnum", gf_sldwnum);
+        mxztmap.put("gf_slhjnum", gf_slhjnum);
+        mxztmap.put("gf_wznum", gf_wznum);
+        mxztmap.put("gf_lxnum", gf_lxnum);
+
+        mxztmap.put("gf_djnum", gf_dfnum + gf_sdtjnum);
+        mxztmap.put("gf_yxnum", gf_zcfdnum + gf_jclyxnum);
+        mxztmap.put("gf_gznum", gf_gzcnslnum + gf_gztjnum);
+        mxztmap.put("gf_jxnum", gf_jxtjnum + gf_jxclslnum);
+        mxztmap.put("gf_xdnum", gf_xdjclnum + gf_tjnum);
+        mxztmap.put("gf_slnum", gf_slhjnum + gf_sldwnum);
+        mxztmap.put("gf_lxyznum",gf_wznum + gf_lxnum);
 
+        map.put("mxzt",mxztmap);
         return map;
     }
 }