Explorar el Código

修改矩阵监视功能

shilin hace 3 años
padre
commit
6ba82b31d2

+ 53 - 2
web/monitor-hb/src/main/java/com/gyee/frame/controller/monitor/MonitorPushController.java

@@ -3,7 +3,11 @@ package com.gyee.frame.controller.monitor;
 import com.gyee.frame.common.conf.AjaxStatus;
 import com.gyee.frame.common.domain.AjaxResult;
 import com.gyee.frame.model.custom.DataVo;
-import com.gyee.frame.service.websocket.*;
+import com.gyee.frame.model.custom.SimpleVo;
+import com.gyee.frame.service.websocket.CftInfoPushService;
+import com.gyee.frame.service.websocket.MatrixPushByWpService;
+import com.gyee.frame.service.websocket.PowerFirstPushService;
+import com.gyee.frame.service.websocket.WpInfoPushService;
 import com.gyee.frame.util.StringUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
@@ -11,7 +15,6 @@ import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 
@@ -222,4 +225,52 @@ public class MonitorPushController {
         }
 
     }
+
+
+    @GetMapping("/findSameIndexList")
+    @ResponseBody
+    @ApiOperation(value = "获得风机共同指标", notes = "获得风机共同指标")
+    @ApiImplicitParams({@ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
+    })
+    public AjaxResult findSameIndexList(String wtId) throws Exception {
+
+
+        List<SimpleVo> list = new ArrayList<>();
+
+        if (StringUtils.notEmp(wtId)) {
+            list = matrixPushByWpService.findSameIndexList(wtId);
+        }
+
+
+        if (null != list) {
+            return AjaxResult.successData(AjaxStatus.success.code, list);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, list);
+        }
+
+    }
+
+    @GetMapping("/findSameIndexValueList")
+    @ResponseBody
+    @ApiOperation(value = "获得对应风机相关指标Map集合", notes = "获得对应风机相关指标Map集合")
+    @ApiImplicitParams({@ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "code", value = "指标编号", required = true, dataType = "string", paramType = "query")
+    })
+    public AjaxResult findSameIndexValueList(String wtId, String code) throws Exception {
+
+
+        Map<String, List<SimpleVo>> map = new HashMap<>();
+
+        if (StringUtils.notEmp(wtId) && StringUtils.notEmp(code)) {
+            map = matrixPushByWpService.findSameIndexValueList(wtId, code);
+        }
+
+
+        if (null != map) {
+            return AjaxResult.successData(AjaxStatus.success.code, map);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, map);
+        }
+
+    }
 }

+ 9 - 0
web/monitor-hb/src/main/java/com/gyee/frame/model/custom/SimpleVo.java

@@ -5,6 +5,15 @@ public class SimpleVo {
     private String id;
     private String name;
     private Integer value;
+    private Double doubleValue;
+
+    public Double getDoubleValue() {
+        return doubleValue;
+    }
+
+    public void setDoubleValue(Double doubleValue) {
+        this.doubleValue = doubleValue;
+    }
 
     public String getId() {
         return id;

+ 69 - 69
web/monitor-hb/src/main/java/com/gyee/frame/service/goodness/WindturbinegoodnessService.java

@@ -116,7 +116,7 @@ public class WindturbinegoodnessService {
         Windturbinetestingpointnew pjfs = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId,Constant.TPOINT_WT_FJSSFS);
 
 
-       // WindTurbineTestingPointAi2 fs = map.get(Constant.TPOINT_WT_PJFS);
+        // WindTurbineTestingPointAi2 fs = map.get(Constant.TPOINT_WT_PJFS);
 
         if (null != sjgl) {
             List<PointData> sjglls = realApiUtil.getHistoryDatasSnap(sjgl, beginDate.getTime() / 1000, endDate.getTime() / 1000, (long) length, 3600L);
@@ -125,10 +125,10 @@ public class WindturbinegoodnessService {
                 int count = 0;
                 double temp = 0;
                 for (int i = 0; i < vos.size(); i++) {
-                    vos.get(i).setTime(sjglls.get(i ).getPointTime() * 1000);
 
-                    if (i < sjglls.size() && StringUtils.notEmp(sjglls.get(i ).getPointTime())) {
 
+                    if (i < sjglls.size() && StringUtils.notEmp(sjglls.get(i ).getPointTime())) {
+                        vos.get(i).setTime(sjglls.get(i ).getPointTime() * 1000);
                         if (vos.get(i).getTime() <= DateUtils.now().getTime()) {
                             temp = sjglls.get(i ).getPointValueInDouble();
                             if (Math.abs(temp) < 10000) {
@@ -156,7 +156,7 @@ public class WindturbinegoodnessService {
                 for (int i = 0; i < vos.size(); i++) {
                     // vos.get(i).setTime(bzglls.get(i).getPointTime() * 1000);
                     if (i < bzglls.size() && StringUtils.notEmp(bzglls.get(i ).getPointTime())) {
-
+                        vos.get(i).setTime(bzglls.get(i ).getPointTime() * 1000);
                         if (vos.get(i).getTime() <= DateUtils.now().getTime()) {
                             temp = bzglls.get(i ).getPointValueInDouble();
                             if (Math.abs(temp) < 10000) {
@@ -182,9 +182,9 @@ public class WindturbinegoodnessService {
                 int count = 0;
                 double temp = 0;
                 for (int i = 0; i < vos.size(); i++) {
-                    vos.get(i).setTime(pjfsls.get(i ).getPointTime() * 1000);
-                    if (i < pjfsls.size() && StringUtils.notEmp(pjfsls.get(i ).getPointTime())) {
 
+                    if (i < pjfsls.size() && StringUtils.notEmp(pjfsls.get(i ).getPointTime())) {
+                        vos.get(i).setTime(pjfsls.get(i ).getPointTime() * 1000);
                         if (vos.get(i).getTime() <= DateUtils.now().getTime()) {
                             temp = pjfsls.get(i ).getPointValueInDouble();
                             vos.get(i).setValue3(StringUtils.round(temp, 2));// 风速
@@ -263,81 +263,81 @@ public class WindturbinegoodnessService {
         String endTime=null;
         String time=null;
 
-            if (null != fjzt) {
-                List<PointData> fjztls = realApiUtil.getHistoryDatasSnap(fjzt, beginDate.getTime() / 1000, endDate.getTime() / 1000, (long) length, 360L);
-
-
-                int zt = 0;
-                for (int i = 0; i < fjztls.size(); i++) {
-                    if (i < fjztls.size()) {
-
-                        PointData pd=fjztls.get(i);
-                        int zttemp = Double.valueOf(pd.getPointValueInDouble()).intValue();
-                        Date resultDate = new Date(pd.getPointTime() * 1000);
-                        beginTime = sdf.format(resultDate);
-                        time=sdf2.format(resultDate);
-                        xtime.add(beginTime);
-                        if (i == 0) {
+        if (null != fjzt) {
+            List<PointData> fjztls = realApiUtil.getHistoryDatasSnap(fjzt, beginDate.getTime() / 1000, endDate.getTime() / 1000, (long) length, 360L);
+
+
+            int zt = 0;
+            for (int i = 0; i < fjztls.size(); i++) {
+                if (i < fjztls.size()) {
+
+                    PointData pd=fjztls.get(i);
+                    int zttemp = Double.valueOf(pd.getPointValueInDouble()).intValue();
+                    Date resultDate = new Date(pd.getPointTime() * 1000);
+                    beginTime = sdf.format(resultDate);
+                    time=sdf2.format(resultDate);
+                    xtime.add(beginTime);
+                    if (i == 0) {
+                        zt = zttemp;
+                        EchartDataVo vo = new EchartDataVo();
+                        vo.setxAxis(beginTime);
+                        vo.setTime1(time);
+                        vo.setName(judgeSatte(zttemp));
+
+                        EchartDataVo.ItemStyle item= vo.new ItemStyle();
+                        item.setColor(judgeColor(zttemp));
+                        vo.setItemStyle(item);
+
+                        vos.add(vo);
+                    } else {
+                        if (zt != zttemp) {
                             zt = zttemp;
-                            EchartDataVo vo = new EchartDataVo();
-                            vo.setxAxis(beginTime);
-                            vo.setTime1(time);
-                            vo.setName(judgeSatte(zttemp));
-
-                            EchartDataVo.ItemStyle item= vo.new ItemStyle();
-                            item.setColor(judgeColor(zttemp));
-                            vo.setItemStyle(item);
-
-                            vos.add(vo);
-                        } else {
-                            if (zt != zttemp) {
-                                zt = zttemp;
-                                c = Calendar.getInstance();
-                                c.setTime(resultDate);
+                            c = Calendar.getInstance();
+                            c.setTime(resultDate);
 //                                c.add(Calendar.MINUTE, -6);
-                                endTime = sdf.format(c.getTime());
-                                time=sdf2.format(c.getTime());
+                            endTime = sdf.format(c.getTime());
+                            time=sdf2.format(c.getTime());
 
-                                vos.get(0).setTime2(time);
-                                EchartDataVo vo = new EchartDataVo();
-                                vo.setxAxis(endTime);
-                                vos.add(vo);
+                            vos.get(0).setTime2(time);
+                            EchartDataVo vo = new EchartDataVo();
+                            vo.setxAxis(endTime);
+                            vos.add(vo);
 
 
-                                if (vos.size() == 2) {
-                                    resultvos.add(vos);
-                                    vos = new ArrayList<>();
-                                    vo = new EchartDataVo();
-                                    vo.setxAxis(beginTime);
-                                    vo.setTime1(sdf2.format(resultDate));
-                                    vo.setName(judgeSatte(zttemp));
-                                    EchartDataVo.ItemStyle item= vo.new ItemStyle();
-                                    item.setColor(judgeColor(zttemp));
-                                    vo.setItemStyle(item);
-                                    vos.add(vo);
-                                }
-                            }else if(i==fjztls.size()-1)
-                            {
-                                zt = zttemp;
-                                c = Calendar.getInstance();
-                                c.setTime(resultDate);
-//                                c.add(Calendar.MINUTE, -6);
-                                endTime = sdf.format(c.getTime());
-                                time=sdf2.format(c.getTime());
-
-                                vos.get(0).setTime2(time);
-                                EchartDataVo vo = new EchartDataVo();
-                                vo.setxAxis(endTime);
-                                vos.add(vo);
+                            if (vos.size() == 2) {
                                 resultvos.add(vos);
+                                vos = new ArrayList<>();
+                                vo = new EchartDataVo();
+                                vo.setxAxis(beginTime);
+                                vo.setTime1(sdf2.format(resultDate));
+                                vo.setName(judgeSatte(zttemp));
+                                EchartDataVo.ItemStyle item= vo.new ItemStyle();
+                                item.setColor(judgeColor(zttemp));
+                                vo.setItemStyle(item);
+                                vos.add(vo);
                             }
+                        }else if(i==fjztls.size()-1)
+                        {
+                            zt = zttemp;
+                            c = Calendar.getInstance();
+                            c.setTime(resultDate);
+//                                c.add(Calendar.MINUTE, -6);
+                            endTime = sdf.format(c.getTime());
+                            time=sdf2.format(c.getTime());
 
+                            vos.get(0).setTime2(time);
+                            EchartDataVo vo = new EchartDataVo();
+                            vo.setxAxis(endTime);
+                            vos.add(vo);
+                            resultvos.add(vos);
                         }
 
                     }
 
                 }
+
             }
+        }
         return resultvos;
     }
 
@@ -371,7 +371,7 @@ public class WindturbinegoodnessService {
         }
         return ztname;
     }
-//    运行 #08FCF0 待机 #34A90A  维护 #FD7D1C 故障 #FD0100 限电 #D201D8 离线 #A6A6A6
+    //    运行 #08FCF0 待机 #34A90A  维护 #FD7D1C 故障 #FD0100 限电 #D201D8 离线 #A6A6A6
     private  String judgeColor(int zt)
     {
         String ztname=null;
@@ -409,7 +409,7 @@ public class WindturbinegoodnessService {
         Windturbinetestingpointnew llfdlAi =windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId,Constant.TPOINT_WT_RFDLBZ);
         Windturbinetestingpointnew glAi = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId,Constant.TPOINT_WT_FJGL);
         Windturbinetestingpointnew fjztAi =windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId,Constant.FJZT);
-         String sdf = "yyyy-MM-dd HH:mm";
+        String sdf = "yyyy-MM-dd HH:mm";
         Date begindate=DateUtils.parseStrtoDate(begin,sdf);
         Date enddate=DateUtils.parseStrtoDate(end,sdf);
         Map<String, String> tempmap = new HashMap<String, String>();

+ 33 - 24
web/monitor-hb/src/main/java/com/gyee/frame/service/singleanalysis/SingleAnalysisService.java

@@ -288,13 +288,20 @@ public class SingleAnalysisService {
             vo.setYxxs(StringUtils.round(yxfss, 2));
             vo.setGlyzxxs(StringUtils.round(glyzxxs, 2));
 
-            double gzss = vos.stream().mapToDouble(SingleAnalysisVo::getGzss).sum();//风机故障损失合计
-            double jxss = vos.stream().mapToDouble(SingleAnalysisVo::getJxss).sum();//风机检修损失合计
-            double xdss = vos.stream().mapToDouble(SingleAnalysisVo::getXdss).sum();//风机限电损失合计
-            double xnss = vos.stream().mapToDouble(SingleAnalysisVo::getXnss).sum();//风机性能损失时合计
-            double slss = vos.stream().mapToDouble(SingleAnalysisVo::getSlss).sum();//风机受累损失合计
+            double gzss =0.0;//风机故障损失合计
+            double jxss =0.0;//风机检修损失合计
+            double xdss =0.0;//风机限电损失合计
+            double xnss =0.0;//风机性能损失时合计
+            double slss =0.0;//风机受累损失合计
             double llfdl = fdl + gzss + jxss + xdss + xnss + slss;
 
+            gzss = vos.stream().filter(x -> x!=null).filter(x -> x.getGzss()!=null).mapToDouble(SingleAnalysisVo::getGzss).sum();//风机故障损失合计
+            jxss = vos.stream().filter(x -> x!=null).filter(x -> x.getJxss()!=null).mapToDouble(SingleAnalysisVo::getJxss).sum();//风机检修损失合计
+            xdss = vos.stream().filter(x -> x!=null).filter(x -> x.getXdss()!=null).mapToDouble(SingleAnalysisVo::getXdss).sum();//风机限电损失合计
+            xnss = vos.stream().filter(x -> x!=null).filter(x -> x.getXnss()!=null).mapToDouble(SingleAnalysisVo::getXnss).sum();//风机性能损失时合计
+            slss = vos.stream().filter(x -> x!=null).filter(x -> x.getSlss()!=null).mapToDouble(SingleAnalysisVo::getSlss).sum();//风机受累损失合计
+            llfdl = fdl + gzss + jxss + xdss + xnss + slss;
+
             vo.setGzss(StringUtils.round(gzss, 2));
             vo.setJxss(StringUtils.round(jxss, 2));
             vo.setXdss(StringUtils.round(xdss, 2));
@@ -303,6 +310,8 @@ public class SingleAnalysisService {
             vo.setLlfdl(StringUtils.round(llfdl, 2));
 
 
+
+
             if (xfqrnum != 0) {
                 double temp = new BigDecimal(xfqr).divide(new BigDecimal(xfqrnum), 2, RoundingMode.HALF_UP).doubleValue();
                 vo.setXfqr(temp);
@@ -410,38 +419,38 @@ public class SingleAnalysisService {
             }
 
             fdl = new BigDecimal(fdl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue();
-                vo.setFdl(StringUtils.round(fdl, 2));
-                vo.setYxxs(StringUtils.round(yxxs, 2));
-                vo.setGzxs(StringUtils.round(gzxs, 2));
-                vo.setJxxs(StringUtils.round(jxxs, 2));
-                vo.setTjxs(StringUtils.round(tjxs, 2));
-                vo.setZdxs(StringUtils.round(zdxs, 2));
-                vo.setRlxs(StringUtils.round(rlxs, 2));
-                vo.setFs(StringUtils.round(fs, 2));
-                vo.setSbklyl(StringUtils.round(sbklyl, 2));
-                vo.setDxklyxs(StringUtils.round(dxklyxs, 2));
-                vo.setLyxs(StringUtils.round(lyxs, 2));
-                vo.setYxfss(StringUtils.round(yxfss, 2));
+            vo.setFdl(StringUtils.round(fdl, 2));
+            vo.setYxxs(StringUtils.round(yxxs, 2));
+            vo.setGzxs(StringUtils.round(gzxs, 2));
+            vo.setJxxs(StringUtils.round(jxxs, 2));
+            vo.setTjxs(StringUtils.round(tjxs, 2));
+            vo.setZdxs(StringUtils.round(zdxs, 2));
+            vo.setRlxs(StringUtils.round(rlxs, 2));
+            vo.setFs(StringUtils.round(fs, 2));
+            vo.setSbklyl(StringUtils.round(sbklyl, 2));
+            vo.setDxklyxs(StringUtils.round(dxklyxs, 2));
+            vo.setLyxs(StringUtils.round(lyxs, 2));
+            vo.setYxfss(StringUtils.round(yxfss, 2));
 
 
 
 
             if (StringUtils.notEmp(wtday2ls) && !wtday2ls.isEmpty() && StringUtils.notEmp(wtday2ls.get(0)) ) {
                 SingleAnalysisVo wtd = wtday2ls.get(0);
-                 glyzxxs = null != wtd.getGlyzxxs() ? wtd.getGlyzxxs() : 0.0;//风机平均功率一致性系数
+                glyzxxs = null != wtd.getGlyzxxs() ? wtd.getGlyzxxs() : 0.0;//风机平均功率一致性系数
             }
             vo.setGlyzxxs(StringUtils.round(glyzxxs, 2));
             if (StringUtils.notEmp(wtday3ls) && !wtday3ls.isEmpty() && StringUtils.notEmp(wtday3ls.get(0)) ) {
                 SingleAnalysisVo wtd = wtday3ls.get(0);
-                 gzss = null != wtd.getGzss() ? wtd.getGzss() : 0.0;//风机故障损失合计
-                 jxss = null != wtd.getJxss() ? wtd.getJxss() : 0.0;//风机检修损失合计
-                 xdss = null != wtd.getXdss() ? wtd.getXdss() : 0.0;//风机限电损失合计
-                 xnss = null != wtd.getXnss() ? wtd.getXnss() : 0.0;//风机性能损失时合计
-                 slss = null != wtd.getSlss() ? wtd.getSlss() : 0.0;//风机受累损失合计
+                gzss = null != wtd.getGzss() ? wtd.getGzss() : 0.0;//风机故障损失合计
+                jxss = null != wtd.getJxss() ? wtd.getJxss() : 0.0;//风机检修损失合计
+                xdss = null != wtd.getXdss() ? wtd.getXdss() : 0.0;//风机限电损失合计
+                xnss = null != wtd.getXnss() ? wtd.getXnss() : 0.0;//风机性能损失时合计
+                slss = null != wtd.getSlss() ? wtd.getSlss() : 0.0;//风机受累损失合计
 
 
 
-                 llfdl = fdl + gzss + jxss + xdss + xnss + slss;
+                llfdl = fdl + gzss + jxss + xdss + xnss + slss;
             }
 
             vo.setGzss(StringUtils.round(gzss, 2));

+ 148 - 1
web/monitor-hb/src/main/java/com/gyee/frame/service/websocket/MatrixPushByWpService.java

@@ -1,13 +1,18 @@
 package com.gyee.frame.service.websocket;
 
 
+import com.gyee.frame.common.conf.V2Config;
 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.SimpleVo;
 import com.gyee.frame.service.*;
-import com.gyee.frame.util.*;
+import com.gyee.frame.util.IRealTimeDataBaseUtil;
+import com.gyee.frame.util.MathUtil;
+import com.gyee.frame.util.RealTimeDataBaseFactory;
+import com.gyee.frame.util.StringUtils;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -31,6 +36,8 @@ public class MatrixPushByWpService {
     private GeneralAppearancePushService generalAppearancePushService;
     @Resource
     private WpMttrAndMtbMonthService wpMttrAndMtbMonthService;
+    @Resource
+    private WindturbinestandardpointService windturbinestandardpointService;
     IRealTimeDataBaseUtil realApiUtil = RealTimeDataBaseFactory.createRealTimeDataBase();
 
 
@@ -988,6 +995,146 @@ public class MatrixPushByWpService {
 
             return fjvos;
     }
+
+
+
+    public List<SimpleVo> findSameIndexList(String wtId) throws Exception {
+
+
+
+        List<SimpleVo> vos=new ArrayList<>();
+        Map<Integer, Map<String,String>>smap=new HashMap<>();
+        if(StringUtils.notEmp(wtId))
+        {
+
+            String[] ids=wtId.split(",");
+
+            if(ids.length>=2)
+            {
+
+                List<Windturbinestandardpoint>  stpointls=windturbinestandardpointService.findAllList();
+                for(int i=0;i<ids.length;i++)
+                {
+                    Map<String,String> map=new HashMap<>();
+                    if(InitialRunner.wtPointmap.containsKey(ids[i]))
+                    {
+                        Map<String, Windturbinetestingpointnew> pointmap=InitialRunner.wtPointmap.get(ids[i]);
+
+                        if(StringUtils.notEmp(stpointls) && !stpointls.isEmpty())
+                        {
+                            for(Windturbinestandardpoint st:stpointls)
+                            {
+                                if(pointmap.containsKey(st.getUniformcode()))
+                                {
+                                    Windturbinetestingpointnew wtpoint=pointmap.get(st.getUniformcode());
+                                    if(StringUtils.notEmp(wtpoint.getCode()) && !V2Config.getInitialcode().equals(wtpoint.getCode()))
+                                    {
+                                        map.put(wtpoint.getUniformcode(),wtpoint.getUniformcode());
+                                    }
+                                }
+                            }
+                        }
+                    }
+                    smap.put(i,map);
+                }
+
+
+
+                for(Windturbinestandardpoint st:stpointls)
+                {
+                    boolean total=true;
+                    for(int i=0;i<ids.length;i++)
+                    {
+                        if(smap.containsKey(i))
+                        {
+                            Map<String,String> map=smap.get(i);
+                            if(!map.containsKey(st.getUniformcode()))
+                            {
+                                total=false;
+                            }
+                        }
+                    }
+
+
+                    if(total)
+                    {
+                        SimpleVo vo=new SimpleVo();
+                        vo.setId(st.getUniformcode());
+                        vo.setName(st.getName());
+                        vos.add(vo);
+                    }
+
+                }
+            }
+
+
+        }
+
+        return vos;
+    }
+
+
+    public Map<String,List<SimpleVo>> findSameIndexValueList(String wtId,String code) throws Exception {
+
+
+
+
+        Map<String,  List<SimpleVo> >smap=new HashMap<>();
+
+        if(StringUtils.notEmp(wtId) && StringUtils.notEmp(code))
+        {
+
+            String[] ids=wtId.split(",");
+            String[] codes=code.split(",");
+            if(ids.length>0 && codes.length>0)
+            {
+
+
+                for(int i=0;i<ids.length;i++)
+                {
+                    List<String> list=new ArrayList<>();
+                    List<SimpleVo> vos=new ArrayList<>();
+                    if(InitialRunner.wtPointmap.containsKey(ids[i]))
+                    {
+                        Map<String, Windturbinetestingpointnew> pointmap=InitialRunner.wtPointmap.get(ids[i]);
+
+                        for(int j=0;j<codes.length;j++)
+                        {
+                            if(pointmap.containsKey(codes[j]))
+                            {
+                                Windturbinetestingpointnew wtpoint=pointmap.get(codes[j]);
+                                if(StringUtils.notEmp(wtpoint.getCode()) && !V2Config.getInitialcode().equals(wtpoint.getCode()))
+                                {
+                                    SimpleVo vo=new SimpleVo();
+                                    vo.setId(wtpoint.getUniformcode());
+                                    vo.setName(wtpoint.getName());
+                                    vos.add(vo);
+                                    list.add(wtpoint.getCode());
+                                }
+                            }
+                        }
+
+                        List<PointData> values=realApiUtil.getRealData(list);
+                        if(StringUtils.notEmp(values) && !values.isEmpty() && vos.size()==values.size())
+                        {
+                            for(int x=0;x<values.size();x++)
+                            {
+                                vos.get(x).setDoubleValue(values.get(x).getPointValueInDouble());
+                            }
+                        }
+
+                    }
+                    smap.put(ids[i],vos);
+                }
+
+
+            }
+
+
+        }
+
+        return smap;
+    }
 }
 
 

+ 163 - 172
web/monitor-hb/src/main/java/com/gyee/frame/util/golden/EdosUtil.java

@@ -136,50 +136,52 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
                         getHistsnapSameTiem(point.getCode(), beginDate, pried, resultList);
                     }else
                     {
-                        for (PointData snapItem : snapList) {
-
-                            long subTime = snapItem.getPointTime() - pried;
-                            //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
-                            // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
-                            // 则代表该时间节点快照有效,否则为0
-                            String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getCode() + "&ts=" + snapItem.getPointTime() + "000";
-                            ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
-                            JSONObject jsonObjectSection = sectionResp.getBody();
-
-                            if (jsonObjectSection != null) {
-                                List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
-                                if (sectionlist.size() > 0) {
-                                    if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
-                                        resultList.add(snapItem);
-                                    }
-                                    else{
-                                        PointData data = new PointData();
-                                        data.setEdnaId(point.getCode());
-                                        data.setPointTime(0L);
-                                        data.setPointValue("0");
-                                        data.setPointName("1");
-                                        data.setPointValueInDouble(0.0);
-                                        resultList.add(data);
-                                    }
-                                } else {
-                                    PointData data = new PointData();
-                                    data.setEdnaId(point.getCode());
-                                    data.setPointTime(0l);
-                                    data.setPointValue("0");
-                                    data.setPointName("1");
-                                    data.setPointValueInDouble(0.0);
-                                    resultList.add(data);
-                                }
-                            } else {
-                                PointData data = new PointData();
-                                data.setEdnaId(point.getCode());
-                                data.setPointTime(0l);
-                                data.setPointValue("0");
-                                data.setPointName("1");
-                                data.setPointValueInDouble(0.0);
-                                resultList.add(data);
-                            }
-                        }
+                        resultList=snapList;
+//                        resultList=snapList;
+//                        for (PointData snapItem : snapList) {
+//
+//                            long subTime = snapItem.getPointTime() - pried;
+//                            //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
+//                            // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
+//                            // 则代表该时间节点快照有效,否则为0
+//                            String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getCode() + "&ts=" + snapItem.getPointTime() + "000";
+//                            ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
+//                            JSONObject jsonObjectSection = sectionResp.getBody();
+//
+//                            if (jsonObjectSection != null) {
+//                                List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
+//                                if (sectionlist.size() > 0) {
+//                                    if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
+//                                        resultList.add(snapItem);
+//                                    }
+//                                    else{
+//                                        PointData data = new PointData();
+//                                        data.setEdnaId(point.getCode());
+//                                        data.setPointTime(0L);
+//                                        data.setPointValue("0");
+//                                        data.setPointName("1");
+//                                        data.setPointValueInDouble(0.0);
+//                                        resultList.add(data);
+//                                    }
+//                                } else {
+//                                    PointData data = new PointData();
+//                                    data.setEdnaId(point.getCode());
+//                                    data.setPointTime(0l);
+//                                    data.setPointValue("0");
+//                                    data.setPointName("1");
+//                                    data.setPointValueInDouble(0.0);
+//                                    resultList.add(data);
+//                                }
+//                            } else {
+//                                PointData data = new PointData();
+//                                data.setEdnaId(point.getCode());
+//                                data.setPointTime(0l);
+//                                data.setPointValue("0");
+//                                data.setPointName("1");
+//                                data.setPointValueInDouble(0.0);
+//                                resultList.add(data);
+//                            }
+//                        }
                     }
 
 
@@ -424,49 +426,51 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
                         getHistsnapSameTiem(point.getCode(), beginDate, pried, resultList);
                     }else
                     {
-                        for (PointData snapItem : snapList) {
-                            long subTime = snapItem.getPointTime() - pried;
-                            //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
-                            // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
-                            // 则代表该时间节点快照有效,否则为0
-                            String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getCode() + "&ts=" + snapItem.getPointTime() + "000";
-                            ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
-                            JSONObject jsonObjectSection = sectionResp.getBody();
-
-                            if (jsonObjectSection != null) {
-                                List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
-                                if (sectionlist.size() > 0) {
-                                    if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
-                                        resultList.add(snapItem);
-                                    }
-                                    else{
-                                        PointData data = new PointData();
-                                        data.setEdnaId(point.getCode());
-                                        data.setPointTime(0L);
-                                        data.setPointValue("0");
-                                        data.setPointName("1");
-                                        data.setPointValueInDouble(0.0);
-                                        resultList.add(data);
-                                    }
-                                } else {
-                                    PointData data = new PointData();
-                                    data.setEdnaId(point.getCode());
-                                    data.setPointTime(0l);
-                                    data.setPointValue("0");
-                                    data.setPointName("1");
-                                    data.setPointValueInDouble(0.0);
-                                    resultList.add(data);
-                                }
-                            } else {
-                                PointData data = new PointData();
-                                data.setEdnaId(point.getCode());
-                                data.setPointTime(0l);
-                                data.setPointValue("0");
-                                data.setPointName("1");
-                                data.setPointValueInDouble(0.0);
-                                resultList.add(data);
-                            }
-                        }
+
+                        resultList=snapList;
+//                        for (PointData snapItem : snapList) {
+//                            long subTime = snapItem.getPointTime() - pried;
+//                            //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
+//                            // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
+//                            // 则代表该时间节点快照有效,否则为0
+//                            String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getCode() + "&ts=" + snapItem.getPointTime() + "000";
+//                            ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
+//                            JSONObject jsonObjectSection = sectionResp.getBody();
+//
+//                            if (jsonObjectSection != null) {
+//                                List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
+//                                if (sectionlist.size() > 0) {
+//                                    if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
+//                                        resultList.add(snapItem);
+//                                    }
+//                                    else{
+//                                        PointData data = new PointData();
+//                                        data.setEdnaId(point.getCode());
+//                                        data.setPointTime(0L);
+//                                        data.setPointValue("0");
+//                                        data.setPointName("1");
+//                                        data.setPointValueInDouble(0.0);
+//                                        resultList.add(data);
+//                                    }
+//                                } else {
+//                                    PointData data = new PointData();
+//                                    data.setEdnaId(point.getCode());
+//                                    data.setPointTime(0l);
+//                                    data.setPointValue("0");
+//                                    data.setPointName("1");
+//                                    data.setPointValueInDouble(0.0);
+//                                    resultList.add(data);
+//                                }
+//                            } else {
+//                                PointData data = new PointData();
+//                                data.setEdnaId(point.getCode());
+//                                data.setPointTime(0l);
+//                                data.setPointValue("0");
+//                                data.setPointName("1");
+//                                data.setPointValueInDouble(0.0);
+//                                resultList.add(data);
+//                            }
+//                        }
                     }
 
 
@@ -611,7 +615,7 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
                     idls.add(str);
                 }
             }
-            if(!idls.isEmpty()  )
+            if(!idls.isEmpty() )
             {
                 String pointIdString = StringUtil.join(idls.toArray(), ",");
                 Optional<String> keys = Optional.ofNullable(pointIdString);
@@ -626,32 +630,25 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
                     JSONObject jsonObject = resp.getBody();
                     if (jsonObject != null) {
                         //对结果进行有序返回
-                        int len = idls.size();
+                        int len = pointids.length;
                         List<PointData> result = new ArrayList<>();
                         HashMap<String, PointData> pointDataHashMap = new HashMap<>();
                         for (int i = 0; i < len; i++) {
 
 
-                            PointData pd = new PointData();
-                            pd.setPointName(pointids[i]);
-                            pd.setEdnaId(pointids[i]);
-                            pd.setPointValueInDouble(0.0);
-                            pd.setPointTime(0l);
-                            result.add(pd);
-
-                            pointDataHashMap.put(pd.getPointName(), pd);
+                            if (pointDataHashMap.containsKey(pointids[i]) == false){
+                                PointData pd = new PointData();
+                                pd.setPointName(pointids[i]);
+                                pd.setEdnaId(pointids[i]);
+                                pd.setPointValueInDouble(0.0);
+                                pd.setPointTime(0l);
+                                result.add(pd);
 
-//                            if (pointDataHashMap.containsKey(idls.get(i)) == false){
-//                                PointData pd = new PointData();
-//                                pd.setPointName(idls.get(i));
-//                                pd.setEdnaId(idls.get(i));
-//                                result.add(pd);
-//
-//                                pointDataHashMap.put(pd.getPointName(), pd);
-//                            }
-//                            else{
-//                                result.add(pointDataHashMap.get(idls.get(i)));
-//                            }
+                                pointDataHashMap.put(pd.getPointName(), pd);
+                            }
+                            else{
+                                result.add(pointDataHashMap.get(pointids[i]));
+                            }
 
                         }
                         Iterator<String> sIterator = jsonObject.keySet().iterator();
@@ -780,27 +777,19 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
                         HashMap<String, PointData> pointDataHashMap = new HashMap<>();
                         for (int i = 0; i < len; i++) {
 
-                            PointData pd = new PointData();
-                            pd.setPointName(pointids.get(i));
-                            pd.setEdnaId(pointids.get(i));
-                            pd.setPointValueInDouble(0.0);
-                            pd.setPointTime(0l);
-                            result.add(pd);
-
-                            pointDataHashMap.put(pd.getPointName(), pd);
-
+                            if (pointDataHashMap.containsKey(pointids.get(i)) == false){
+                                PointData pd = new PointData();
+                                pd.setPointName(pointids.get(i));
+                                pd.setEdnaId(pointids.get(i));
+                                pd.setPointValueInDouble(0.0);
+                                pd.setPointTime(0l);
+                                result.add(pd);
 
-//                            if (pointDataHashMap.containsKey(idls.get(i)) == false){
-//                                PointData pd = new PointData();
-//                                pd.setPointName(idls.get(i));
-//                                pd.setEdnaId(idls.get(i));
-//                                result.add(pd);
-//
-//                                pointDataHashMap.put(pd.getPointName(), pd);
-//                            }
-//                            else{
-//                                result.add(pointDataHashMap.get(idls.get(i)));
-//                            }
+                                pointDataHashMap.put(pd.getPointName(), pd);
+                            }
+                            else{
+                                result.add(pointDataHashMap.get(pointids.get(i)));
+                            }
                         }
                         Iterator<String> sIterator = jsonObject.keySet().iterator();
                         while (sIterator.hasNext()) {
@@ -1018,49 +1007,51 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
                         getHistsnapSameTiem(pointid, beginDate, pried, resultList);
                     }else
                     {
-                        for (PointData snapItem : list) {
-                            long subTime = snapItem.getPointTime() - pried;
-                            //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
-                            // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
-                            // 则代表该时间节点快照有效,否则为0
-                            String rawUrl = baseURL + "/history/section?null=0&tagNames=" +pointid+ "&ts=" + snapItem.getPointTime() + "000";
-                            ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
-                            JSONObject jsonObjectSection = sectionResp.getBody();
-
-                            if (jsonObjectSection != null) {
-                                List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
-                                if (sectionlist.size() > 0) {
-                                    if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
-                                        resultList.add(snapItem);
-                                    }
-                                    else{
-                                        PointData data = new PointData();
-                                        data.setEdnaId(pointid);
-                                        data.setPointTime(0L);
-                                        data.setPointValue("0");
-                                        data.setPointName("1");
-                                        data.setPointValueInDouble(0.0);
-                                        resultList.add(data);
-                                    }
-                                } else {
-                                    PointData data = new PointData();
-                                    data.setEdnaId(pointid);
-                                    data.setPointTime(0l);
-                                    data.setPointValue("0");
-                                    data.setPointName("1");
-                                    data.setPointValueInDouble(0.0);
-                                    resultList.add(data);
-                                }
-                            } else {
-                                PointData data = new PointData();
-                                data.setEdnaId(pointid);
-                                data.setPointTime(0l);
-                                data.setPointValue("0");
-                                data.setPointName("1");
-                                data.setPointValueInDouble(0.0);
-                                resultList.add(data);
-                            }
-                        }
+
+                        resultList=list;
+//                        for (PointData snapItem : list) {
+//                            long subTime = snapItem.getPointTime() - pried;
+//                            //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
+//                            // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
+//                            // 则代表该时间节点快照有效,否则为0
+//                            String rawUrl = baseURL + "/history/section?null=0&tagNames=" +pointid+ "&ts=" + snapItem.getPointTime() + "000";
+//                            ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
+//                            JSONObject jsonObjectSection = sectionResp.getBody();
+//
+//                            if (jsonObjectSection != null) {
+//                                List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
+//                                if (sectionlist.size() > 0) {
+//                                    if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
+//                                        resultList.add(snapItem);
+//                                    }
+//                                    else{
+//                                        PointData data = new PointData();
+//                                        data.setEdnaId(pointid);
+//                                        data.setPointTime(0L);
+//                                        data.setPointValue("0");
+//                                        data.setPointName("1");
+//                                        data.setPointValueInDouble(0.0);
+//                                        resultList.add(data);
+//                                    }
+//                                } else {
+//                                    PointData data = new PointData();
+//                                    data.setEdnaId(pointid);
+//                                    data.setPointTime(0l);
+//                                    data.setPointValue("0");
+//                                    data.setPointName("1");
+//                                    data.setPointValueInDouble(0.0);
+//                                    resultList.add(data);
+//                                }
+//                            } else {
+//                                PointData data = new PointData();
+//                                data.setEdnaId(pointid);
+//                                data.setPointTime(0l);
+//                                data.setPointValue("0");
+//                                data.setPointName("1");
+//                                data.setPointValueInDouble(0.0);
+//                                resultList.add(data);
+//                            }
+//                        }
                     }
 
                     return resultList;
@@ -1660,4 +1651,4 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
     }
 
 
-}
+}