wangb@gyee-china.com пре 1 година
родитељ
комит
54dbbb3ca0

+ 1 - 4
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/goodness/WindturbinegoodnessService.java

@@ -1,19 +1,16 @@
 package com.gyee.runeconomy.service.goodness;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-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.common.util.DoubleUtils;
 import com.gyee.common.util.SortUtils;
 import com.gyee.common.vo.benchmark.DataVo;
-import com.gyee.common.vo.benchmark.WxsslVo;
 import com.gyee.common.vo.threerate.PvVo;
 import com.gyee.runeconomy.dto.EchartDataVo;
 import com.gyee.runeconomy.init.CacheContext;
 import com.gyee.runeconomy.model.auto.*;
-import com.gyee.runeconomy.service.auto.IProEconEquipmentInfoDay5Service;
 import com.gyee.runeconomy.service.auto.IProEconEquipmentInfoDay6Service;
 import com.gyee.runeconomy.service.auto.IProEconWindturbineGoodnessService;
 import com.gyee.runeconomy.util.DateUtils;
@@ -54,7 +51,7 @@ public class WindturbinegoodnessService {
         //构造分页构造器
         Page<ProEconWindturbineGoodness> pageInfo = new Page<>(pageNum, pageSize);
         if (StringUtils.notEmp(type) && StringUtils.notEmp(recorddate)) {
-            Date date = DateUtils.parseDate(recorddate);
+                Date date = com.gyee.common.util.DateUtils.parseDate(recorddate);
 
             //构造条件构造器
             LambdaQueryWrapper<ProEconWindturbineGoodness> queryWrapper = new LambdaQueryWrapper<>();

+ 114 - 107
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/MonitorService.java

@@ -255,23 +255,25 @@ public class MonitorService {
                 fjztls.add(proBasicPowerstationPointService.getPowerstationPoint(str1, ContantXk.CWSLTQTSMX).getNemCode());//场外受累天气台数
                 fjztls.add(proBasicPowerstationPointService.getPowerstationPoint(str1, ContantXk.LXTSMX).getNemCode());//离线台数
                 fjztls.add(proBasicPowerstationPointService.getPowerstationPoint(str1, ContantXk.TXZDTSMX).getNemCode());//通讯中断台数
-
-                List<PointData> fjztlist = edosUtil.getRealData(fjztls);
-
-                fd_gztjnum += fjztlist.get(0).getPointValueInDouble();
-                fd_gzcnslnum += fjztlist.get(1).getPointValueInDouble();
-                fd_jxtjnum += fjztlist.get(2).getPointValueInDouble();
-                fd_jxclslnum += fjztlist.get(3).getPointValueInDouble();
-                fd_dfnum += fjztlist.get(4).getPointValueInDouble();
-                fd_jclyxnum += fjztlist.get(5).getPointValueInDouble();
-                fd_sdtjnum += fjztlist.get(6).getPointValueInDouble();
-                fd_zcfdnum += fjztlist.get(7).getPointValueInDouble();
-                fd_tjnum += fjztlist.get(8).getPointValueInDouble();
-                fd_xdjclnum += fjztlist.get(9).getPointValueInDouble();
-                fd_sldwnum += fjztlist.get(10).getPointValueInDouble();
-                fd_slhjnum += fjztlist.get(11).getPointValueInDouble();
-                fd_lxnum += fjztlist.get(12).getPointValueInDouble();
-                fd_wznum += fjztlist.get(13).getPointValueInDouble();
+                fjztls=fjztls.stream().filter(a->a!=null).collect(Collectors.toList());
+              if (StringUtils.isNotEmpty(fjztls) ) {
+                  List<PointData> fjztlist = edosUtil.getRealData(fjztls);
+
+                  fd_gztjnum += fjztlist.get(0).getPointValueInDouble();
+                  fd_gzcnslnum += fjztlist.get(1).getPointValueInDouble();
+                  fd_jxtjnum += fjztlist.get(2).getPointValueInDouble();
+                  fd_jxclslnum += fjztlist.get(3).getPointValueInDouble();
+                  fd_dfnum += fjztlist.get(4).getPointValueInDouble();
+                  fd_jclyxnum += fjztlist.get(5).getPointValueInDouble();
+                  fd_sdtjnum += fjztlist.get(6).getPointValueInDouble();
+                  fd_zcfdnum += fjztlist.get(7).getPointValueInDouble();
+                  fd_tjnum += fjztlist.get(8).getPointValueInDouble();
+                  fd_xdjclnum += fjztlist.get(9).getPointValueInDouble();
+                  fd_sldwnum += fjztlist.get(10).getPointValueInDouble();
+                  fd_slhjnum += fjztlist.get(11).getPointValueInDouble();
+                  fd_lxnum += fjztlist.get(12).getPointValueInDouble();
+                  fd_wznum += fjztlist.get(13).getPointValueInDouble();
+              }
                 String str2 = null;
                 if (wpId.endsWith(QS)) {
                     String str = wpId;
@@ -293,24 +295,25 @@ public class MonitorService {
                 gfztls.add(proBasicPowerstationPointService.getPowerstationPoint(str2, ContantXk.CWSLTQTSMX).getNemCode());//场外受累天气台数
                 gfztls.add(proBasicPowerstationPointService.getPowerstationPoint(str2, ContantXk.LXTSMX).getNemCode());//离线台数
                 gfztls.add(proBasicPowerstationPointService.getPowerstationPoint(str2, ContantXk.TXZDTSMX).getNemCode());//通讯中断台数
-
-                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();
-
+                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();
+                }
             } else {
                 for (ProBasicPowerstation wp : wplist) {
 
@@ -334,23 +337,25 @@ public class MonitorService {
                             fjztls.add(proBasicPowerstationPointService.getPowerstationPoint(wt.getId(), ContantXk.CWSLTQTSMX).getNemCode());//场外受累天气台数
                             fjztls.add(proBasicPowerstationPointService.getPowerstationPoint(wt.getId(), ContantXk.LXTSMX).getNemCode());//离线台数
                             fjztls.add(proBasicPowerstationPointService.getPowerstationPoint(wt.getId(), ContantXk.TXZDTSMX).getNemCode());//通讯中断台数
-
-                            List<PointData> fjztlist = edosUtil.getRealData(fjztls);
-
-                            fd_gztjnum += fjztlist.get(0).getPointValueInDouble();
-                            fd_gzcnslnum += fjztlist.get(1).getPointValueInDouble();
-                            fd_jxtjnum += fjztlist.get(2).getPointValueInDouble();
-                            fd_jxclslnum += fjztlist.get(3).getPointValueInDouble();
-                            fd_dfnum += fjztlist.get(4).getPointValueInDouble();
-                            fd_jclyxnum += fjztlist.get(5).getPointValueInDouble();
-                            fd_sdtjnum += fjztlist.get(6).getPointValueInDouble();
-                            fd_zcfdnum += fjztlist.get(7).getPointValueInDouble();
-                            fd_tjnum += fjztlist.get(8).getPointValueInDouble();
-                            fd_xdjclnum += fjztlist.get(9).getPointValueInDouble();
-                            fd_sldwnum += fjztlist.get(10).getPointValueInDouble();
-                            fd_slhjnum += fjztlist.get(11).getPointValueInDouble();
-                            fd_lxnum += fjztlist.get(12).getPointValueInDouble();
-                            fd_wznum += fjztlist.get(13).getPointValueInDouble();
+                            fjztls = fjztls.stream().filter(a -> a != null).collect(Collectors.toList());
+                            if (StringUtils.isNotEmpty(fjztls)) {
+                                List<PointData> fjztlist = edosUtil.getRealData(fjztls);
+
+                                fd_gztjnum += fjztlist.get(0).getPointValueInDouble();
+                                fd_gzcnslnum += fjztlist.get(1).getPointValueInDouble();
+                                fd_jxtjnum += fjztlist.get(2).getPointValueInDouble();
+                                fd_jxclslnum += fjztlist.get(3).getPointValueInDouble();
+                                fd_dfnum += fjztlist.get(4).getPointValueInDouble();
+                                fd_jclyxnum += fjztlist.get(5).getPointValueInDouble();
+                                fd_sdtjnum += fjztlist.get(6).getPointValueInDouble();
+                                fd_zcfdnum += fjztlist.get(7).getPointValueInDouble();
+                                fd_tjnum += fjztlist.get(8).getPointValueInDouble();
+                                fd_xdjclnum += fjztlist.get(9).getPointValueInDouble();
+                                fd_sldwnum += fjztlist.get(10).getPointValueInDouble();
+                                fd_slhjnum += fjztlist.get(11).getPointValueInDouble();
+                                fd_lxnum += fjztlist.get(12).getPointValueInDouble();
+                                fd_wznum += fjztlist.get(13).getPointValueInDouble();
+                            }
                         }
 
                     } else if (wp.getId().endsWith("GDC_STA") && CacheContext.wpmapls.containsKey(wp.getId())) {
@@ -370,23 +375,25 @@ public class MonitorService {
                             gfztls.add(proBasicPowerstationPointService.getPowerstationPoint(wt.getId(), ContantXk.CWSLTQTSMX).getNemCode());//场外受累天气台数
                             gfztls.add(proBasicPowerstationPointService.getPowerstationPoint(wt.getId(), ContantXk.LXTSMX).getNemCode());//离线台数
                             gfztls.add(proBasicPowerstationPointService.getPowerstationPoint(wt.getId(), ContantXk.TXZDTSMX).getNemCode());//通讯中断台数
-
-                            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();
+                            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();
+                            }
                         }
                     }
                 }
@@ -761,56 +768,56 @@ public class MonitorService {
 
             for (ProBasicRegion reg : wpls) {
                 if (reg.getOrderNum().equals(1)) {
-                    sxcyfdcsl = reg.getWindNumber();
-                    sxcyfdzjrl = reg.getWindCapacity();
-                    sxcygfcsl = reg.getNumber();
-                    sxcygfzjrl = reg.getCapacity();
-
-                    sxgsfdcsl = reg.getJrWindNumber();
-                    sxgsfdzjrl = reg.getJrwindCapacity();
-                    sxgsgfcsl = reg.getJrNumber();
-                    sxgsgfzjrl = reg.getJrCapacity();
+                    sxcyfdcsl = reg.getWindNumber()!= null ? reg.getWindNumber() : 0;
+                    sxcyfdzjrl = reg.getWindCapacity() != null ? reg.getWindCapacity() : 0;
+                    sxcygfcsl = reg.getNumber()!= null ? reg.getNumber() : 0;
+                    sxcygfzjrl = reg.getCapacity() != null ? reg.getCapacity() : 0;
+
+                    sxgsfdcsl = reg.getJrWindNumber() != null ? reg.getJrWindNumber() : 0;
+                    sxgsfdzjrl = reg.getJrwindCapacity() != null ? reg.getJrwindCapacity() : 0;
+                    sxgsgfcsl = reg.getJrNumber() != null ? reg.getJrNumber() : 0;
+                    sxgsgfzjrl = reg.getJrCapacity() != null ? reg.getJrCapacity() : 0;
                 }
                 if (reg.getOrderNum().equals(4)) {
-                    hbcyfdcsl = reg.getWindNumber();
-                    hbcyfdzjrl = reg.getWindCapacity();
-                    hbcygfcsl = reg.getNumber();
-                    hbcygfzjrl = reg.getCapacity();
+                    hbcyfdcsl = reg.getWindNumber() != null ? reg.getWindNumber() : 0;
+                    hbcyfdzjrl = reg.getWindCapacity() != null ? reg.getWindCapacity() : 0;
+                    hbcygfcsl = reg.getNumber() != null ? reg.getNumber() : 0;
+                    hbcygfzjrl = reg.getCapacity() != null ? reg.getCapacity() : 0;
                 }
                 if (reg.getOrderNum().equals(3)) {
-                    xscyfdcsl = reg.getWindNumber();
-                    xscyfdzjrl = reg.getWindCapacity();
-                    xscygfcsl = reg.getNumber();
-                    xscygfzjrl = reg.getCapacity();
+                    xscyfdcsl = reg.getWindNumber() != null ? reg.getWindNumber() : 0;
+                    xscyfdzjrl = reg.getWindCapacity() != null ? reg.getWindCapacity() : 0;
+                    xscygfcsl = reg.getNumber() != null ? reg.getNumber() : 0;
+                    xscygfzjrl = reg.getCapacity() != null ? reg.getCapacity() : 0;
                 }
                 if (reg.getOrderNum().equals(5)) {
-                    sdcyfdcsl = reg.getWindNumber();
-                    sdcyfdzjrl = reg.getWindCapacity();
-                    sdcygfcsl = reg.getNumber();
-                    sdcygfzjrl = reg.getCapacity();
+                    sdcyfdcsl = reg.getWindNumber() != null ? reg.getWindNumber() : 0;
+                    sdcyfdzjrl = reg.getWindCapacity() != null ? reg.getWindCapacity() : 0;
+                    sdcygfcsl = reg.getNumber() != null ? reg.getNumber() : 0;
+                    sdcygfzjrl = reg.getCapacity() != null ? reg.getCapacity() : 0;
                 }
                 if (reg.getOrderNum().equals(6)) {
-                    xzcyfdcsl = reg.getWindNumber();
-                    xzcyfdzjrl = reg.getWindCapacity();
-                    xzcygfcsl = reg.getNumber();
-                    xzcygfzjrl = reg.getCapacity();
+                    xzcyfdcsl = reg.getWindNumber() != null ? reg.getWindNumber() : 0;
+                    xzcyfdzjrl = reg.getWindCapacity() != null ? reg.getWindCapacity() : 0;
+                    xzcygfcsl = reg.getNumber() != null ? reg.getNumber() : 0;
+                    xzcygfzjrl = reg.getCapacity() != null ? reg.getCapacity() : 0;
                 }
                 if (reg.getOrderNum().equals(2)) {
-                    nmcyfdcsl = reg.getWindNumber();
-                    nmcyfdzjrl = reg.getWindCapacity();
-                    nmcygfcsl = reg.getNumber();
-                    nmcygfzjrl = reg.getCapacity();
-
-                    nmgsfdcsl = reg.getJrWindNumber();
-                    nmgsfdzjrl = reg.getJrwindCapacity();
-                    nmgsgfcsl = reg.getJrNumber();
-                    nmgsgfzjrl = reg.getJrCapacity();
+                    sxcygfcsl = reg.getNumber() != null ? reg.getNumber() : 0;
+                    nmcyfdzjrl = reg.getWindCapacity() != null ? reg.getWindCapacity() : 0;
+                    nmcygfcsl = reg.getNumber() != null ? reg.getNumber() : 0;
+                    nmcygfzjrl = reg.getCapacity() != null ? reg.getCapacity() : 0;
+
+                    nmgsfdcsl = reg.getJrWindNumber() != null ? reg.getJrWindNumber() : 0;
+                    nmgsfdzjrl = reg.getJrwindCapacity() != null ? reg.getJrwindCapacity() : 0;
+                    nmgsgfcsl = reg.getJrNumber() != null ? reg.getJrNumber() : 0;
+                    nmgsgfzjrl = reg.getJrCapacity() != null ? reg.getJrCapacity() : 0;
                 }
                 if (reg.getOrderNum().equals(7)) {
-                    xjcyfdcsl = reg.getWindNumber();
-                    xjcyfdzjrl = reg.getWindCapacity();
-                    xjcygfcsl = reg.getNumber();
-                    xjcygfzjrl = reg.getCapacity();
+                    xjcyfdcsl = reg.getWindNumber() != null ? reg.getWindNumber() : 0;
+                    xjcyfdzjrl = reg.getWindCapacity() != null ? reg.getWindCapacity() : 0;
+                    xjcygfcsl = reg.getNumber() != null ? reg.getNumber() : 0;
+                    xjcygfzjrl = reg.getCapacity() != null ? reg.getCapacity() : 0;
                 }
 
             }