Jelajahi Sumber

健康管理接口开发

shilin 3 tahun lalu
induk
melakukan
d69339e72a
31 mengubah file dengan 3599 tambahan dan 588 penghapusan
  1. 54 0
      src/main/java/com/gyee/frame/common/spring/InitialRedis.java
  2. 3 1
      src/main/java/com/gyee/frame/common/spring/InitialRunner.java
  3. 18 0
      src/main/java/com/gyee/frame/common/spring/WpEnum.java
  4. 143 0
      src/main/java/com/gyee/frame/controller/health/HealthOperationController.java
  5. 270 210
      src/main/java/com/gyee/frame/controller/health/HealthSubController.java
  6. 23 0
      src/main/java/com/gyee/frame/controller/monitor/GenreSetPushController.java
  7. 4 0
      src/main/java/com/gyee/frame/mapper/auto/ShutdowneventMapper.java
  8. 97 0
      src/main/java/com/gyee/frame/mapper/auto/Statejudgmentrecord2Mapper.java
  9. 6 1
      src/main/java/com/gyee/frame/mapper/auto/WarningRecordsMapper.java
  10. 377 0
      src/main/java/com/gyee/frame/model/auto/Statejudgmentrecord2.java
  11. 1044 0
      src/main/java/com/gyee/frame/model/auto/Statejudgmentrecord2Example.java
  12. 32 0
      src/main/java/com/gyee/frame/model/custom/SimpleVo.java
  13. 73 3
      src/main/java/com/gyee/frame/service/ShutdowneventService.java
  14. 110 0
      src/main/java/com/gyee/frame/service/Statejudgmentrecord2Service.java
  15. 68 3
      src/main/java/com/gyee/frame/service/WarningRecordsService.java
  16. 139 133
      src/main/java/com/gyee/frame/service/health/HealthMainService.java
  17. 1 1
      src/main/java/com/gyee/frame/service/health/HealthOperationService.java
  18. 73 8
      src/main/java/com/gyee/frame/service/health/HealthSubService.java
  19. 533 205
      src/main/java/com/gyee/frame/service/websocket/GenreSetPushService.java
  20. 3 3
      src/main/java/com/gyee/frame/service/websocket/WpInfoPushService.java
  21. 5 1
      src/main/java/com/gyee/frame/service/websocket/WtInfoPushService.java
  22. 1 3
      src/main/resources/mybatis-generator.xml
  23. 13 0
      src/main/resources/mybatis/auto/ShutdowneventMapper.xml
  24. 365 0
      src/main/resources/mybatis/auto/Statejudgmentrecord2Mapper.xml
  25. 15 0
      src/main/resources/mybatis/auto/WarningRecordsMapper.xml
  26. 5 5
      src/test/java/test/GenreSetPushTest.java
  27. 101 0
      src/test/java/test/HealthOperationTest.java
  28. 6 5
      src/test/java/test/HealthTest.java
  29. 8 3
      src/test/java/test/ShutdowneventServiceTest.java
  30. 9 3
      src/test/java/test/WarningRecordsServiceTest.java
  31. TEMPAT SAMPAH
      target.7z

+ 54 - 0
src/main/java/com/gyee/frame/common/spring/InitialRedis.java

@@ -0,0 +1,54 @@
+package com.gyee.frame.common.spring;
+
+import com.alibaba.fastjson.JSON;
+import com.gyee.SpringbootStart;
+import com.gyee.frame.common.cache.IGlobalCache;
+import com.gyee.frame.model.auto.Windturbinepowercurvefitting;
+import com.gyee.frame.model.auto.WindturbinepowercurvefittingExample;
+import com.gyee.frame.service.WindturbinepowercurvefittingService;
+import org.springframework.boot.SpringApplication;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+
+
+public  class InitialRedis {
+
+    public static Map<String, Map<Double, Windturbinepowercurvefitting>> wpcmap = new HashMap<String, Map<Double, Windturbinepowercurvefitting>>();
+
+    public  void intial() throws Exception {
+
+
+        WindturbinepowercurvefittingService windturbinepowercurvefittingService= SpringUtils.getBean("windturbinepowercurvefittingService");
+        IGlobalCache globalCache= SpringUtils.getBean("globalCache");
+
+        WindturbinepowercurvefittingExample windturbinepowercurvefittingExample = new WindturbinepowercurvefittingExample();
+        windturbinepowercurvefittingExample.setOrderByClause("WINDTURBINEID ASC,speed ASC");
+        List<Windturbinepowercurvefitting> wpclist = windturbinepowercurvefittingService.selectByExample(windturbinepowercurvefittingExample);
+
+        if (!wpclist.isEmpty()) {
+            for (Windturbinepowercurvefitting wc : wpclist) {
+                if (wpcmap.containsKey(wc.getWindturbineid())) {
+                    Map<Double, Windturbinepowercurvefitting> map = wpcmap.get(wc.getWindturbineid());
+                    map.put(wc.getSpeed(), wc);
+                } else {
+                    Map<Double, Windturbinepowercurvefitting> map = new HashMap<Double, Windturbinepowercurvefitting>();
+                    map.put(wc.getSpeed(), wc);
+                    wpcmap.put(wc.getWindturbineid(), map);
+                }
+            }
+        }
+
+        globalCache.set("wpcmap", JSON.toJSONString(wpcmap));
+    }
+
+    public static void main(String[]args) throws Exception {
+
+        SpringApplication.run(SpringbootStart.class, args);
+
+        InitialRedis initialRedis=new InitialRedis();
+        initialRedis.intial();
+    }
+}

+ 3 - 1
src/main/java/com/gyee/frame/common/spring/InitialRunner.java

@@ -139,7 +139,9 @@ public class InitialRunner implements CommandLineRunner {
         String wtString = JSON.toJSONString(globalCache.get("WT"));
         wtPointmap = JSONObject.parseObject(wtString, new TypeReference<Map<String, Map<String, WindTurbineTestingPointAi2>>>() {
         });
-
+        String wpcmapString = (String)(globalCache.get("wpcmap"));
+        wpcmap = JSONObject.parseObject(wpcmapString, new TypeReference<Map<String, Map<Double, Windturbinepowercurvefitting>>>() {
+        });
 
         WindpowerstationExample windpowerstationExample = new WindpowerstationExample();
         windpowerstationExample.setOrderByClause("ordernum ASC");

+ 18 - 0
src/main/java/com/gyee/frame/common/spring/WpEnum.java

@@ -0,0 +1,18 @@
+package com.gyee.frame.common.spring;
+
+public  enum  WpEnum {
+
+    MHS_FDC("MHS_FDC"),
+    NSS_FDC("NSS_FDC"),
+    QS_FDC("QS_FDC"),
+    SBQ_FDC("SBQ_FDC"),
+    XS_FDC("XS_FDC"),
+    DWK_GDC("DWK_GDC"),
+    PL_GDC("PL_GDC"),
+    XH_GDC("XH_GDC"),
+    MCH_GDC("MCH_GDC");
+    public String id;
+    WpEnum(final  String c) {
+        id = c;
+    }
+}

+ 143 - 0
src/main/java/com/gyee/frame/controller/health/HealthOperationController.java

@@ -0,0 +1,143 @@
+package com.gyee.frame.controller.health;
+
+import com.gyee.frame.common.conf.AjaxStatus;
+import com.gyee.frame.common.domain.AjaxResult;
+import com.gyee.frame.model.custom.SimpleVo;
+import com.gyee.frame.service.ShutdowneventService;
+import com.gyee.frame.service.WarningRecordsService;
+import com.gyee.frame.service.health.HealthOperationService;
+import com.gyee.frame.util.StringUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Controller
+@RequestMapping("/healthoperation")
+@Api(value = "健康管理主页面" ,tags =  "健康管理主页面")
+public class HealthOperationController {
+
+    @Resource
+    private HealthOperationService healthOperationService;
+    @Resource
+    private ShutdowneventService shutdowneventService;
+    @Resource
+    private WarningRecordsService warningRecordsService;
+
+
+    @PostMapping("/countWpwarn")
+    @ResponseBody
+    @ApiOperation(value = "近7天报警事件统计 type 1风场2项目", notes = "近7天报警事件统计 ype 1风场2项目")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "type", value = "类型", required = true, dataType = "string", paramType = "query")})
+    public AjaxResult countWpwarn(String type) throws Exception {
+
+
+        List<SimpleVo> vos = new ArrayList<>();
+
+        if(StringUtils.notEmp(type))
+        {
+            if(type.equals("1"))
+            {
+                vos = warningRecordsService.countWpwarnByWp();
+            }else  if(type.equals("2"))
+            {
+                vos = warningRecordsService.countWpwarnByPj();
+            }
+
+        }
+
+        if (null!=vos) {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, vos);
+        }
+
+    }
+
+    @PostMapping("/countStop")
+    @ResponseBody
+    @ApiOperation(value = "近7天停机事件统计 type 1风场2项目", notes = "近7天停机事件统计 ype 1风场2项目")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "type", value = "类型", required = true, dataType = "string", paramType = "query")})
+    public AjaxResult countStop(String type) throws Exception {
+
+
+        List<SimpleVo> vos = new ArrayList<>();
+
+        if(StringUtils.notEmp(type))
+        {
+            if(type.equals("1"))
+            {
+                vos = shutdowneventService.countStopByWp();
+            }else  if(type.equals("2"))
+            {
+                vos = shutdowneventService.countStopByPj();
+            }
+
+        }
+
+        if (null!=vos) {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, vos);
+        }
+
+    }
+    @PostMapping("/countWpOrProStatus")
+    @ResponseBody
+    @ApiOperation(value = "健康状态占比图表 type 1风场2项目", notes = "健康状态占比图表 type 1风场2项目")
+    @ApiImplicitParams({
+                @ApiImplicitParam(name = "type", value = "类型", required = true, dataType = "string", paramType = "query")})
+    public AjaxResult countWpOrProStatus(String type) throws Exception {
+
+
+        Map<String, Object>  map = new HashMap<>();
+
+        if(StringUtils.notEmp(type))
+        {
+            map = healthOperationService.countWpOrProStatus(type);
+        }
+
+        if (null!=map) {
+            return AjaxResult.successData(AjaxStatus.success.code, map);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, map);
+        }
+
+    }
+
+    @PostMapping("/findWpOrProStatusForHistory")
+    @ResponseBody
+    @ApiOperation(value = "健康状态占比图表 type 1风场2项目 status 1良好2注意", notes = "健康状态占比图表 type 1风场2项目 status 1良好2注意")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "type", value = "类型", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "status", value = "状态", required = true, dataType = "string", paramType = "query")})
+    public AjaxResult findWpOrProStatusForHistory(String type, String status) throws Exception {
+
+
+        Map<String, Object>  map = new HashMap<>();
+
+        if(StringUtils.notEmp(type) && StringUtils.notEmp(status))
+        {
+            map = healthOperationService.findWpOrProStatusForHistory(type,status);
+        }
+
+        if (null!=map) {
+            return AjaxResult.successData(AjaxStatus.success.code, map);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, map);
+        }
+
+    }
+}

+ 270 - 210
src/main/java/com/gyee/frame/controller/health/HealthSubController.java

@@ -4,6 +4,7 @@ import com.gyee.frame.common.conf.AjaxStatus;
 import com.gyee.frame.common.domain.AjaxResult;
 import com.gyee.frame.model.custom.*;
 import com.gyee.frame.service.health.HealthSubService;
+import com.gyee.frame.util.DateUtils;
 import com.gyee.frame.util.StringUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
@@ -25,234 +26,293 @@ public class HealthSubController {
     @Resource
     private HealthSubService healthSubService;
 
-
-    @PostMapping("/findPartHealthInfo")
+    @PostMapping("/findWtHealthInfo")
     @ResponseBody
-    @ApiOperation(value = "获取健康管理风机部件基础信息", notes = "获取健康管理风机部件基础信息")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
-            })
-    public AjaxResult findPartHealthInfo(String wtId) throws Exception {
-
-
-        Map<String, Map<String, Object>>  map = new HashMap<>();
-
-        if(StringUtils.notEmp(wtId))
-        {
-            map = healthSubService.findPartHealthInfo(wtId);
-        }
-
-        if (null!=map) {
-            return AjaxResult.successData(AjaxStatus.success.code, map);
-        } else {
-            return AjaxResult.successData(AjaxStatus.error.code, map);
-        }
-
-    }
-
-
-    @PostMapping("/initalGzjfx")
-    @ResponseBody
-    @ApiOperation(value = "故障数据统计", notes = "故障数据统计")
+    @ApiOperation(value = "获取健康管理风机信息", notes = "获取健康管理风机信息")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
     })
-    public AjaxResult initalGzjfx(String wtId) throws Exception {
+    public AjaxResult findWtHealthInfo(String wtId) throws Exception {
 
 
-        List<GzfxVo> vos = new ArrayList<>();
+        Map<String, Object>  map = new HashMap<>();
 
         if(StringUtils.notEmp(wtId))
         {
-            Calendar cal = Calendar.getInstance();
-            Date recodedate = cal.getTime();
-            vos = healthSubService.initalGzjfx(wtId,recodedate);
-        }
 
-        if (null!=vos) {
-            return AjaxResult.successData(AjaxStatus.success.code, vos);
-        } else {
-            return AjaxResult.successData(AjaxStatus.error.code, vos);
-        }
 
-    }
-
-    @PostMapping("/initalYjfx")
-    @ResponseBody
-    @ApiOperation(value = "预警数据统计", notes = "预警数据统计")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
-    })
-    public AjaxResult initalYjfx(String wtId) throws Exception {
-
-
-        List<YjfxVo> vos = new ArrayList<>();
-
-        if(StringUtils.notEmp(wtId))
-        {
             Calendar cal = Calendar.getInstance();
-            Date recodedate = cal.getTime();
-            vos = healthSubService.initalYjfx(wtId,recodedate);
-        }
 
-        if (null!=vos) {
-            return AjaxResult.successData(AjaxStatus.success.code, vos);
-        } else {
-            return AjaxResult.successData(AjaxStatus.error.code, vos);
-        }
-
-    }
-
-    @PostMapping("/initalYxfx")
-    @ResponseBody
-    @ApiOperation(value = "部件运行数据", notes = "部件运行数据")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
-    })
-    public AjaxResult initalYxfx(String wtId) throws Exception {
-
-
-        List<YxfxVo> vos = new ArrayList<>();
-
-        if(StringUtils.notEmp(wtId))
-        {
-            Calendar cal = Calendar.getInstance();
-            Date recodedate = cal.getTime();
-            vos = healthSubService.initalYxfx(wtId,recodedate);
-        }
-
-        if (null!=vos) {
-            return AjaxResult.successData(AjaxStatus.success.code, vos);
-        } else {
-            return AjaxResult.successData(AjaxStatus.error.code, vos);
-        }
-
-    }
-
-    @PostMapping("/initalXnfx")
-    @ResponseBody
-    @ApiOperation(value = "获得日、月等级评估", notes = "获得日、月等级评估")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
-    })
-    public AjaxResult initalXnfx(String wtId) throws Exception {
-
-
-        List<XnfxVo> vos = new ArrayList<>();
-
-        if(StringUtils.notEmp(wtId))
-        {
-            Calendar cal = Calendar.getInstance();
-            vos = healthSubService.initalXnfx(wtId,cal);
-        }
-
-        if (null!=vos) {
-            return AjaxResult.successData(AjaxStatus.success.code, vos);
-        } else {
-            return AjaxResult.successData(AjaxStatus.error.code, vos);
+            Date recodedate = DateUtils.truncate(cal.getTime());
+            //获取故障类型和风机健康得分
+            Map<String,String>  stoptypemap = healthSubService.findWtInfo(wtId);
+            //获取健康管理风机部件基础信息
+            Map<String, Map<String, Object>>  partmap = healthSubService.findPartHealthInfo(wtId);
+            //故障数据统计
+            List<GzfxVo>  gzls = healthSubService.initalGzjfx(wtId,recodedate);
+            //预警数据统计
+            List<YjfxVo>  yjls = healthSubService.initalYjfx(wtId,recodedate);
+            //部件运行数据
+            List<YxfxVo>  bjyxls = healthSubService.initalYxfx(wtId,recodedate);
+            //获得日、月等级评估
+            List<XnfxVo>  djpgls = healthSubService.initalXnfx(wtId,cal);
+            //当日停机
+            List<ShutdowneventVo>  stopls = healthSubService.initalShutdown(wtId);
+            //各个区间曲线偏差率
+            List<QxpcVo>  qxpcls = healthSubService.findQxpcList(wtId);
+            //温度范围
+            List<YxfxVo>  wdls = healthSubService.findWdList(wtId);
+            //获得健康评价列表
+            List<ValueVo>  jkls = healthSubService.findJudgmentList(wtId);
+
+
+            map.put("stoptypemap",stoptypemap);
+            map.put("partmap",partmap);
+            map.put("gzls",gzls);
+            map.put("yjls",yjls);
+            map.put("bjyxls",bjyxls);
+            map.put("djpgls",djpgls);
+            map.put("stopls",stopls);
+            map.put("qxpcls",qxpcls);
+            map.put("wdls",wdls);
+            map.put("jkls",jkls);
         }
 
-    }
-
-    @PostMapping("/initalShutdown")
-    @ResponseBody
-    @ApiOperation(value = "获得当日停机事件", notes = "获得当日停机事件")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
-    })
-    public AjaxResult initalShutdown(String wtId) throws Exception {
-
-
-        List<ShutdowneventVo> vos = new ArrayList<>();
-
-        if(StringUtils.notEmp(wtId))
-        {
-             vos = healthSubService.initalShutdown(wtId);
-        }
-
-        if (null!=vos) {
-            return AjaxResult.successData(AjaxStatus.success.code, vos);
-        } else {
-            return AjaxResult.successData(AjaxStatus.error.code, vos);
-        }
-
-    }
-
-    @PostMapping("/findJudgmentList")
-    @ResponseBody
-    @ApiOperation(value = "获得健康评价列表", notes = "获得健康评价列表")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
-    })
-    public AjaxResult findJudgmentList(String wtId) throws Exception {
-
-
-        List<ValueVo> vos = new ArrayList<>();
-
-        if(StringUtils.notEmp(wtId))
-        {
-
-            vos = healthSubService.findJudgmentList(wtId);
-        }
-
-        if (null!=vos) {
-            return AjaxResult.successData(AjaxStatus.success.code, vos);
-        } else {
-            return AjaxResult.successData(AjaxStatus.error.code, vos);
-        }
-
-    }
-
-    @PostMapping("/findQxpcList")
-    @ResponseBody
-    @ApiOperation(value = "各个区间曲线偏差率", notes = "各个区间曲线偏差率")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
-    })
-    public AjaxResult findQxpcList(String wtId) throws Exception {
-
-
-        List<QxpcVo> vos = new ArrayList<>();
-
-        if(StringUtils.notEmp(wtId))
-        {
-
-            vos = healthSubService.findQxpcList(wtId);
-        }
-
-        if (null!=vos) {
-            return AjaxResult.successData(AjaxStatus.success.code, vos);
-        } else {
-            return AjaxResult.successData(AjaxStatus.error.code, vos);
-        }
-
-    }
-
-    @PostMapping("/findWdList")
-    @ResponseBody
-    @ApiOperation(value = "温度范围", notes = "温度范围")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
-    })
-    public AjaxResult findWdList(String wtId) throws Exception {
-
-
-        List<YxfxVo> vos = new ArrayList<>();
-
-        if(StringUtils.notEmp(wtId))
-        {
-
-            vos = healthSubService.findWdList(wtId);
-        }
-
-        if (null!=vos) {
-            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        if (null!=map) {
+            return AjaxResult.successData(AjaxStatus.success.code, map);
         } else {
-            return AjaxResult.successData(AjaxStatus.error.code, vos);
+            return AjaxResult.successData(AjaxStatus.error.code, map);
         }
 
     }
 
+//    @PostMapping("/findPartHealthInfo")
+//    @ResponseBody
+//    @ApiOperation(value = "获取健康管理风机部件基础信息", notes = "获取健康管理风机部件基础信息")
+//    @ApiImplicitParams({
+//            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
+//            })
+//    public AjaxResult findPartHealthInfo(String wtId) throws Exception {
+//
+//
+//        Map<String, Map<String, Object>>  map = new HashMap<>();
+//
+//        if(StringUtils.notEmp(wtId))
+//        {
+//            map = healthSubService.findPartHealthInfo(wtId);
+//        }
+//
+//        if (null!=map) {
+//            return AjaxResult.successData(AjaxStatus.success.code, map);
+//        } else {
+//            return AjaxResult.successData(AjaxStatus.error.code, map);
+//        }
+//
+//    }
+//
+//
+//    @PostMapping("/initalGzjfx")
+//    @ResponseBody
+//    @ApiOperation(value = "故障数据统计", notes = "故障数据统计")
+//    @ApiImplicitParams({
+//            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
+//    })
+//    public AjaxResult initalGzjfx(String wtId) throws Exception {
+//
+//
+//        List<GzfxVo> vos = new ArrayList<>();
+//
+//        if(StringUtils.notEmp(wtId))
+//        {
+//            Calendar cal = Calendar.getInstance();
+//            Date recodedate = cal.getTime();
+//            vos = healthSubService.initalGzjfx(wtId,recodedate);
+//        }
+//
+//        if (null!=vos) {
+//            return AjaxResult.successData(AjaxStatus.success.code, vos);
+//        } else {
+//            return AjaxResult.successData(AjaxStatus.error.code, vos);
+//        }
+//
+//    }
+//
+//    @PostMapping("/initalYjfx")
+//    @ResponseBody
+//    @ApiOperation(value = "预警数据统计", notes = "预警数据统计")
+//    @ApiImplicitParams({
+//            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
+//    })
+//    public AjaxResult initalYjfx(String wtId) throws Exception {
+//
+//
+//        List<YjfxVo> vos = new ArrayList<>();
+//
+//        if(StringUtils.notEmp(wtId))
+//        {
+//            Calendar cal = Calendar.getInstance();
+//            Date recodedate = cal.getTime();
+//            vos = healthSubService.initalYjfx(wtId,recodedate);
+//        }
+//
+//        if (null!=vos) {
+//            return AjaxResult.successData(AjaxStatus.success.code, vos);
+//        } else {
+//            return AjaxResult.successData(AjaxStatus.error.code, vos);
+//        }
+//
+//    }
+//
+//    @PostMapping("/initalYxfx")
+//    @ResponseBody
+//    @ApiOperation(value = "部件运行数据", notes = "部件运行数据")
+//    @ApiImplicitParams({
+//            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
+//    })
+//    public AjaxResult initalYxfx(String wtId) throws Exception {
+//
+//
+//        List<YxfxVo> vos = new ArrayList<>();
+//
+//        if(StringUtils.notEmp(wtId))
+//        {
+//            Calendar cal = Calendar.getInstance();
+//            Date recodedate = cal.getTime();
+//            vos = healthSubService.initalYxfx(wtId,recodedate);
+//        }
+//
+//        if (null!=vos) {
+//            return AjaxResult.successData(AjaxStatus.success.code, vos);
+//        } else {
+//            return AjaxResult.successData(AjaxStatus.error.code, vos);
+//        }
+//
+//    }
+//
+//    @PostMapping("/initalXnfx")
+//    @ResponseBody
+//    @ApiOperation(value = "获得日、月等级评估", notes = "获得日、月等级评估")
+//    @ApiImplicitParams({
+//            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
+//    })
+//    public AjaxResult initalXnfx(String wtId) throws Exception {
+//
+//
+//        List<XnfxVo> vos = new ArrayList<>();
+//
+//        if(StringUtils.notEmp(wtId))
+//        {
+//            Calendar cal = Calendar.getInstance();
+//            vos = healthSubService.initalXnfx(wtId,cal);
+//        }
+//
+//        if (null!=vos) {
+//            return AjaxResult.successData(AjaxStatus.success.code, vos);
+//        } else {
+//            return AjaxResult.successData(AjaxStatus.error.code, vos);
+//        }
+//
+//    }
+//
+//    @PostMapping("/initalShutdown")
+//    @ResponseBody
+//    @ApiOperation(value = "获得当日停机事件", notes = "获得当日停机事件")
+//    @ApiImplicitParams({
+//            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
+//    })
+//    public AjaxResult initalShutdown(String wtId) throws Exception {
+//
+//
+//        List<ShutdowneventVo> vos = new ArrayList<>();
+//
+//        if(StringUtils.notEmp(wtId))
+//        {
+//             vos = healthSubService.initalShutdown(wtId);
+//        }
+//
+//        if (null!=vos) {
+//            return AjaxResult.successData(AjaxStatus.success.code, vos);
+//        } else {
+//            return AjaxResult.successData(AjaxStatus.error.code, vos);
+//        }
+//
+//    }
+//
+//    @PostMapping("/findJudgmentList")
+//    @ResponseBody
+//    @ApiOperation(value = "获得健康评价列表", notes = "获得健康评价列表")
+//    @ApiImplicitParams({
+//            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
+//    })
+//    public AjaxResult findJudgmentList(String wtId) throws Exception {
+//
+//
+//        List<ValueVo> vos = new ArrayList<>();
+//
+//        if(StringUtils.notEmp(wtId))
+//        {
+//
+//            vos = healthSubService.findJudgmentList(wtId);
+//        }
+//
+//        if (null!=vos) {
+//            return AjaxResult.successData(AjaxStatus.success.code, vos);
+//        } else {
+//            return AjaxResult.successData(AjaxStatus.error.code, vos);
+//        }
+//
+//    }
+//
+//    @PostMapping("/findQxpcList")
+//    @ResponseBody
+//    @ApiOperation(value = "各个区间曲线偏差率", notes = "各个区间曲线偏差率")
+//    @ApiImplicitParams({
+//            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
+//    })
+//    public AjaxResult findQxpcList(String wtId) throws Exception {
+//
+//
+//        List<QxpcVo> vos = new ArrayList<>();
+//
+//        if(StringUtils.notEmp(wtId))
+//        {
+//
+//            vos = healthSubService.findQxpcList(wtId);
+//        }
+//
+//        if (null!=vos) {
+//            return AjaxResult.successData(AjaxStatus.success.code, vos);
+//        } else {
+//            return AjaxResult.successData(AjaxStatus.error.code, vos);
+//        }
+//
+//    }
+//
+//    @PostMapping("/findWdList")
+//    @ResponseBody
+//    @ApiOperation(value = "温度范围", notes = "温度范围")
+//    @ApiImplicitParams({
+//            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
+//    })
+//    public AjaxResult findWdList(String wtId) throws Exception {
+//
+//
+//        List<YxfxVo> vos = new ArrayList<>();
+//
+//        if(StringUtils.notEmp(wtId))
+//        {
+//
+//            vos = healthSubService.findWdList(wtId);
+//        }
+//
+//        if (null!=vos) {
+//            return AjaxResult.successData(AjaxStatus.success.code, vos);
+//        } else {
+//            return AjaxResult.successData(AjaxStatus.error.code, vos);
+//        }
+//
+//    }
+/********************************************************************************************************/
 
     @PostMapping("/gadaytop5")
     @ResponseBody
@@ -310,7 +370,7 @@ public class HealthSubController {
 
     @PostMapping("/findPowerChar")
     @ResponseBody
-    @ApiOperation(value = "获取最新的十次停机事件", notes = "获取最新的十次停机事件")
+    @ApiOperation(value = "获得实际功率和理论功率曲线", notes = "获得实际功率和理论功率曲线")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
     })
@@ -335,7 +395,7 @@ public class HealthSubController {
 
     @PostMapping("/hsFjValueIndex")
     @ResponseBody
-    @ApiOperation(value = "获取最新的十次停机事件", notes = "获取最新的十次停机事件")
+    @ApiOperation(value = "获取部件图表", notes = "获取部件图表")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
     })

+ 23 - 0
src/main/java/com/gyee/frame/controller/monitor/GenreSetPushController.java

@@ -255,4 +255,27 @@ public class GenreSetPushController {
         }
 
     }
+
+
+    @PostMapping("/tooltipAjax")
+    @ResponseBody
+    @ApiOperation(value = "场站悬停功能", notes = "场站悬停功能")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wpId", value = "场站编号", required = true, dataType = "string", paramType = "query")})
+
+    public AjaxResult tooltipAjax(String wpId) throws Exception {
+
+
+        Map<String, Double> retValue = new HashMap<String, Double>();
+        if (StringUtils.notEmp(wpId) ) {
+            retValue = genreSetPushService.tooltipAjax(wpId);
+        }
+
+        if (null!=retValue){
+            return AjaxResult.successData(AjaxStatus.success.code, retValue);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, retValue);
+        }
+
+    }
 }

+ 4 - 0
src/main/java/com/gyee/frame/mapper/auto/ShutdowneventMapper.java

@@ -2,6 +2,7 @@ package com.gyee.frame.mapper.auto;
 
 import com.gyee.frame.model.auto.Shutdownevent;
 import com.gyee.frame.model.auto.ShutdowneventExample;
+import com.gyee.frame.model.custom.SimpleVo;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -94,4 +95,7 @@ public interface ShutdowneventMapper {
      * @mbg.generated
      */
     int updateByPrimaryKey(Shutdownevent record);
+
+    List<SimpleVo> countStopByWp();
+    List<SimpleVo> countStopByPj();
 }

+ 97 - 0
src/main/java/com/gyee/frame/mapper/auto/Statejudgmentrecord2Mapper.java

@@ -0,0 +1,97 @@
+package com.gyee.frame.mapper.auto;
+
+import com.gyee.frame.model.auto.Statejudgmentrecord2;
+import com.gyee.frame.model.auto.Statejudgmentrecord2Example;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface Statejudgmentrecord2Mapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table STATEJUDGMENTRECORD2
+     *
+     * @mbg.generated
+     */
+    long countByExample(Statejudgmentrecord2Example example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table STATEJUDGMENTRECORD2
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(Statejudgmentrecord2Example example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table STATEJUDGMENTRECORD2
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table STATEJUDGMENTRECORD2
+     *
+     * @mbg.generated
+     */
+    int insert(Statejudgmentrecord2 record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table STATEJUDGMENTRECORD2
+     *
+     * @mbg.generated
+     */
+    int insertSelective(Statejudgmentrecord2 record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table STATEJUDGMENTRECORD2
+     *
+     * @mbg.generated
+     */
+    List<Statejudgmentrecord2> selectByExample(Statejudgmentrecord2Example example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table STATEJUDGMENTRECORD2
+     *
+     * @mbg.generated
+     */
+    Statejudgmentrecord2 selectByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table STATEJUDGMENTRECORD2
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") Statejudgmentrecord2 record, @Param("example") Statejudgmentrecord2Example example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table STATEJUDGMENTRECORD2
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") Statejudgmentrecord2 record, @Param("example") Statejudgmentrecord2Example example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table STATEJUDGMENTRECORD2
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(Statejudgmentrecord2 record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table STATEJUDGMENTRECORD2
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(Statejudgmentrecord2 record);
+}

+ 6 - 1
src/main/java/com/gyee/frame/mapper/auto/WarningRecordsMapper.java

@@ -2,9 +2,11 @@ package com.gyee.frame.mapper.auto;
 
 import com.gyee.frame.model.auto.WarningRecords;
 import com.gyee.frame.model.auto.WarningRecordsExample;
-import java.util.List;
+import com.gyee.frame.model.custom.SimpleVo;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 public interface WarningRecordsMapper {
     /**
      * This method was generated by MyBatis Generator.
@@ -93,4 +95,7 @@ public interface WarningRecordsMapper {
      * @mbg.generated
      */
     int updateByPrimaryKey(WarningRecords record);
+
+    List<SimpleVo> countWpwarnByWp();
+    List<SimpleVo> countWpwarnByPj();
 }

+ 377 - 0
src/main/java/com/gyee/frame/model/auto/Statejudgmentrecord2.java

@@ -0,0 +1,377 @@
+package com.gyee.frame.model.auto;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class Statejudgmentrecord2 implements Serializable {
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column STATEJUDGMENTRECORD2.ID
+     *
+     * @mbg.generated
+     */
+    private Integer id;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column STATEJUDGMENTRECORD2.WPID
+     *
+     * @mbg.generated
+     */
+    private String wpid;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column STATEJUDGMENTRECORD2.WTID
+     *
+     * @mbg.generated
+     */
+    private String wtid;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column STATEJUDGMENTRECORD2.STATEJUDGMENT
+     *
+     * @mbg.generated
+     */
+    private String statejudgment;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column STATEJUDGMENTRECORD2.RECODEDATE
+     *
+     * @mbg.generated
+     */
+    private Date recodedate;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column STATEJUDGMENTRECORD2.SCORE
+     *
+     * @mbg.generated
+     */
+    private Double score;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column STATEJUDGMENTRECORD2.FORMULA
+     *
+     * @mbg.generated
+     */
+    private String formula;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column STATEJUDGMENTRECORD2.PART1
+     *
+     * @mbg.generated
+     */
+    private String part1;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column STATEJUDGMENTRECORD2.PART2
+     *
+     * @mbg.generated
+     */
+    private String part2;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column STATEJUDGMENTRECORD2.PART3
+     *
+     * @mbg.generated
+     */
+    private String part3;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column STATEJUDGMENTRECORD2.MARK
+     *
+     * @mbg.generated
+     */
+    private String mark;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table STATEJUDGMENTRECORD2
+     *
+     * @mbg.generated
+     */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column STATEJUDGMENTRECORD2.ID
+     *
+     * @return the value of STATEJUDGMENTRECORD2.ID
+     *
+     * @mbg.generated
+     */
+    public Integer getId() {
+        return id;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column STATEJUDGMENTRECORD2.ID
+     *
+     * @param id the value for STATEJUDGMENTRECORD2.ID
+     *
+     * @mbg.generated
+     */
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column STATEJUDGMENTRECORD2.WPID
+     *
+     * @return the value of STATEJUDGMENTRECORD2.WPID
+     *
+     * @mbg.generated
+     */
+    public String getWpid() {
+        return wpid;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column STATEJUDGMENTRECORD2.WPID
+     *
+     * @param wpid the value for STATEJUDGMENTRECORD2.WPID
+     *
+     * @mbg.generated
+     */
+    public void setWpid(String wpid) {
+        this.wpid = wpid == null ? null : wpid.trim();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column STATEJUDGMENTRECORD2.WTID
+     *
+     * @return the value of STATEJUDGMENTRECORD2.WTID
+     *
+     * @mbg.generated
+     */
+    public String getWtid() {
+        return wtid;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column STATEJUDGMENTRECORD2.WTID
+     *
+     * @param wtid the value for STATEJUDGMENTRECORD2.WTID
+     *
+     * @mbg.generated
+     */
+    public void setWtid(String wtid) {
+        this.wtid = wtid == null ? null : wtid.trim();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column STATEJUDGMENTRECORD2.STATEJUDGMENT
+     *
+     * @return the value of STATEJUDGMENTRECORD2.STATEJUDGMENT
+     *
+     * @mbg.generated
+     */
+    public String getStatejudgment() {
+        return statejudgment;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column STATEJUDGMENTRECORD2.STATEJUDGMENT
+     *
+     * @param statejudgment the value for STATEJUDGMENTRECORD2.STATEJUDGMENT
+     *
+     * @mbg.generated
+     */
+    public void setStatejudgment(String statejudgment) {
+        this.statejudgment = statejudgment == null ? null : statejudgment.trim();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column STATEJUDGMENTRECORD2.RECODEDATE
+     *
+     * @return the value of STATEJUDGMENTRECORD2.RECODEDATE
+     *
+     * @mbg.generated
+     */
+    public Date getRecodedate() {
+        return recodedate;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column STATEJUDGMENTRECORD2.RECODEDATE
+     *
+     * @param recodedate the value for STATEJUDGMENTRECORD2.RECODEDATE
+     *
+     * @mbg.generated
+     */
+    public void setRecodedate(Date recodedate) {
+        this.recodedate = recodedate;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column STATEJUDGMENTRECORD2.SCORE
+     *
+     * @return the value of STATEJUDGMENTRECORD2.SCORE
+     *
+     * @mbg.generated
+     */
+    public Double getScore() {
+        return score;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column STATEJUDGMENTRECORD2.SCORE
+     *
+     * @param score the value for STATEJUDGMENTRECORD2.SCORE
+     *
+     * @mbg.generated
+     */
+    public void setScore(Double score) {
+        this.score = score;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column STATEJUDGMENTRECORD2.FORMULA
+     *
+     * @return the value of STATEJUDGMENTRECORD2.FORMULA
+     *
+     * @mbg.generated
+     */
+    public String getFormula() {
+        return formula;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column STATEJUDGMENTRECORD2.FORMULA
+     *
+     * @param formula the value for STATEJUDGMENTRECORD2.FORMULA
+     *
+     * @mbg.generated
+     */
+    public void setFormula(String formula) {
+        this.formula = formula == null ? null : formula.trim();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column STATEJUDGMENTRECORD2.PART1
+     *
+     * @return the value of STATEJUDGMENTRECORD2.PART1
+     *
+     * @mbg.generated
+     */
+    public String getPart1() {
+        return part1;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column STATEJUDGMENTRECORD2.PART1
+     *
+     * @param part1 the value for STATEJUDGMENTRECORD2.PART1
+     *
+     * @mbg.generated
+     */
+    public void setPart1(String part1) {
+        this.part1 = part1 == null ? null : part1.trim();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column STATEJUDGMENTRECORD2.PART2
+     *
+     * @return the value of STATEJUDGMENTRECORD2.PART2
+     *
+     * @mbg.generated
+     */
+    public String getPart2() {
+        return part2;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column STATEJUDGMENTRECORD2.PART2
+     *
+     * @param part2 the value for STATEJUDGMENTRECORD2.PART2
+     *
+     * @mbg.generated
+     */
+    public void setPart2(String part2) {
+        this.part2 = part2 == null ? null : part2.trim();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column STATEJUDGMENTRECORD2.PART3
+     *
+     * @return the value of STATEJUDGMENTRECORD2.PART3
+     *
+     * @mbg.generated
+     */
+    public String getPart3() {
+        return part3;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column STATEJUDGMENTRECORD2.PART3
+     *
+     * @param part3 the value for STATEJUDGMENTRECORD2.PART3
+     *
+     * @mbg.generated
+     */
+    public void setPart3(String part3) {
+        this.part3 = part3 == null ? null : part3.trim();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column STATEJUDGMENTRECORD2.MARK
+     *
+     * @return the value of STATEJUDGMENTRECORD2.MARK
+     *
+     * @mbg.generated
+     */
+    public String getMark() {
+        return mark;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column STATEJUDGMENTRECORD2.MARK
+     *
+     * @param mark the value for STATEJUDGMENTRECORD2.MARK
+     *
+     * @mbg.generated
+     */
+    public void setMark(String mark) {
+        this.mark = mark == null ? null : mark.trim();
+    }
+}

File diff ditekan karena terlalu besar
+ 1044 - 0
src/main/java/com/gyee/frame/model/auto/Statejudgmentrecord2Example.java


+ 32 - 0
src/main/java/com/gyee/frame/model/custom/SimpleVo.java

@@ -0,0 +1,32 @@
+package com.gyee.frame.model.custom;
+
+public class SimpleVo {
+
+    private String id;
+    private String name;
+    private Integer value;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public Integer getValue() {
+        return value;
+    }
+
+    public void setValue(Integer value) {
+        this.value = value;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

+ 73 - 3
src/main/java/com/gyee/frame/service/ShutdowneventService.java

@@ -6,10 +6,9 @@ import com.gyee.frame.common.base.BaseService;
 import com.gyee.frame.common.spring.InitialRunner;
 import com.gyee.frame.common.support.Convert;
 import com.gyee.frame.mapper.auto.ShutdowneventMapper;
-import com.gyee.frame.model.auto.Shutdownevent;
-import com.gyee.frame.model.auto.ShutdowneventExample;
-import com.gyee.frame.model.auto.Stoptype;
+import com.gyee.frame.model.auto.*;
 import com.gyee.frame.model.custom.ShutdowneventVo;
+import com.gyee.frame.model.custom.SimpleVo;
 import com.gyee.frame.util.SnowflakeIdWorker;
 import com.gyee.frame.util.StringUtils;
 import org.springframework.stereotype.Service;
@@ -271,4 +270,75 @@ public class ShutdowneventService implements BaseService<Shutdownevent, Shutdown
 		return map;
 
 	}
+
+
+
+
+	/**
+	 * 获取七天内各个风场停机统计
+	 * @return
+	 */
+	public List<SimpleVo> countStopByWp() {
+
+		List<SimpleVo> vos=new ArrayList<>();
+		List<SimpleVo> ls= shutdowneventMapper.countStopByWp();
+		if(!ls.isEmpty())
+		{
+			Map<String,SimpleVo> map=new HashMap<>();
+			for(SimpleVo vo:ls)
+			{
+				map.put(vo.getId(),vo);
+			}
+
+			for(Windpowerstation wp:InitialRunner.wpls)
+			{
+				SimpleVo vo=new SimpleVo();
+				vo.setId(wp.getId());
+				vo.setName(wp.getName());
+				vo.setValue(0);
+				if(map.containsKey(wp.getId()))
+				{
+					SimpleVo votemp=map.get(wp.getId());
+					vo.setValue(votemp.getValue());
+				}
+				vos.add(vo);
+			}
+		}
+		return vos;
+
+	}
+
+	/**
+	 * 获取七天内各个项目停机统计
+	 * @return
+	 */
+	public List<SimpleVo> countStopByPj() {
+
+		List<SimpleVo> vos=new ArrayList<>();
+		List<SimpleVo> ls= shutdowneventMapper.countStopByPj();
+		if(!ls.isEmpty())
+		{
+			Map<String,SimpleVo> map=new HashMap<>();
+			for(SimpleVo vo:ls)
+			{
+				map.put(vo.getId(),vo);
+			}
+
+			for(Project pj:InitialRunner.pjls)
+			{
+				SimpleVo vo=new SimpleVo();
+				vo.setId(pj.getId());
+				vo.setName(pj.getName());
+				vo.setValue(0);
+				if(map.containsKey(pj.getId()))
+				{
+					SimpleVo votemp=map.get(pj.getId());
+					vo.setValue(votemp.getValue());
+				}
+				vos.add(vo);
+			}
+		}
+		return vos;
+
+	}
 }

+ 110 - 0
src/main/java/com/gyee/frame/service/Statejudgmentrecord2Service.java

@@ -0,0 +1,110 @@
+package com.gyee.frame.service;
+
+import com.gyee.frame.common.base.BaseService;
+import com.gyee.frame.common.support.Convert;
+import com.gyee.frame.mapper.auto.Statejudgmentrecord2Mapper;
+import com.gyee.frame.model.auto.Statejudgmentrecord2;
+import com.gyee.frame.model.auto.Statejudgmentrecord2Example;
+import com.gyee.frame.util.StringUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+
+
+@Service
+public class Statejudgmentrecord2Service implements BaseService<Statejudgmentrecord2, Statejudgmentrecord2Example> {
+	@Resource
+	private Statejudgmentrecord2Mapper statejudgmentrecord2Mapper;
+	
+
+	@Override
+	public int deleteByPrimaryKey(String ids) {
+				
+			List<Integer> lista=Convert.toIntArrayList(ids);
+			Statejudgmentrecord2Example example=new Statejudgmentrecord2Example();
+			example.createCriteria().andIdIn(lista);
+			return statejudgmentrecord2Mapper.deleteByExample(example);
+			
+				
+	}
+	
+	
+	@Override
+	public Statejudgmentrecord2 selectByPrimaryKey(String id) {
+				
+			return statejudgmentrecord2Mapper.selectByPrimaryKey(Integer.valueOf(id));
+				
+	}
+
+	
+	@Override
+	public int updateByPrimaryKeySelective(Statejudgmentrecord2 record) {
+		return statejudgmentrecord2Mapper.updateByPrimaryKeySelective(record);
+	}
+	
+	
+	/**
+	 * 添加
+	 */
+	@Override
+	public int insertSelective(Statejudgmentrecord2 record) {
+	
+				
+		return statejudgmentrecord2Mapper.insertSelective(record);
+	}
+	
+	
+	@Override
+	public int updateByExampleSelective(Statejudgmentrecord2 record, Statejudgmentrecord2Example example) {
+		
+		return statejudgmentrecord2Mapper.updateByExampleSelective(record, example);
+	}
+
+	
+	@Override
+	public int updateByExample(Statejudgmentrecord2 record, Statejudgmentrecord2Example example) {
+		
+		return statejudgmentrecord2Mapper.updateByExample(record, example);
+	}
+
+	@Override
+	public List<Statejudgmentrecord2> selectByExample(Statejudgmentrecord2Example example) {
+		
+		return statejudgmentrecord2Mapper.selectByExample(example);
+	}
+
+	
+	@Override
+	public long countByExample(Statejudgmentrecord2Example example) {
+		
+		return statejudgmentrecord2Mapper.countByExample(example);
+	}
+
+	
+	@Override
+	public int deleteByExample(Statejudgmentrecord2Example example) {
+		
+		return statejudgmentrecord2Mapper.deleteByExample(example);
+	}
+
+	public List<Statejudgmentrecord2> findStatejudgmentrecord2(String wtId) {
+
+		List<Statejudgmentrecord2> list=new ArrayList<>();
+
+		if (StringUtils.notEmp(wtId) ) {
+
+			Statejudgmentrecord2Example example=new Statejudgmentrecord2Example();
+			example.setOrderByClause("recodedate DESC");
+
+			Statejudgmentrecord2Example.Criteria criteria =example.createCriteria();
+
+			criteria.andWtidEqualTo(wtId);
+			list= statejudgmentrecord2Mapper.selectByExample(example);
+
+		}
+		return list;
+
+	}
+}

+ 68 - 3
src/main/java/com/gyee/frame/service/WarningRecordsService.java

@@ -6,10 +6,9 @@ import com.gyee.frame.common.base.BaseService;
 import com.gyee.frame.common.spring.InitialRunner;
 import com.gyee.frame.common.support.Convert;
 import com.gyee.frame.mapper.auto.WarningRecordsMapper;
-import com.gyee.frame.model.auto.Warning2;
-import com.gyee.frame.model.auto.WarningRecords;
-import com.gyee.frame.model.auto.WarningRecordsExample;
+import com.gyee.frame.model.auto.*;
 import com.gyee.frame.model.custom.SawVo;
+import com.gyee.frame.model.custom.SimpleVo;
 import com.gyee.frame.model.custom.Tablepar;
 import com.gyee.frame.util.StringUtils;
 import org.springframework.stereotype.Service;
@@ -352,5 +351,71 @@ public class WarningRecordsService implements BaseService<WarningRecords, Warnin
 
 		return vo;
 	}
+	/**
+	 * 获取七天内各个风场报警统计
+	 * @return
+	 */
+	public List<SimpleVo> countWpwarnByWp() {
+
+		List<SimpleVo> vos=new ArrayList<>();
+		List<SimpleVo> ls= warningRecordsMapper.countWpwarnByWp();
+		if(!ls.isEmpty())
+		{
+			Map<String,SimpleVo> map=new HashMap<>();
+			for(SimpleVo vo:ls)
+			{
+				map.put(vo.getId(),vo);
+			}
+
+			for(Windpowerstation wp:InitialRunner.wpls)
+			{
+				SimpleVo vo=new SimpleVo();
+				vo.setId(wp.getId());
+				vo.setName(wp.getName());
+				vo.setValue(0);
+				if(map.containsKey(wp.getId()))
+				{
+					SimpleVo votemp=map.get(wp.getId());
+					vo.setValue(votemp.getValue());
+				}
+				vos.add(vo);
+			}
+		}
+		return vos;
+
+	}
 
+	/**
+	 * 获取七天内各个项目报警统计
+	 * @return
+	 */
+	public List<SimpleVo> countWpwarnByPj() {
+
+		List<SimpleVo> vos=new ArrayList<>();
+		List<SimpleVo> ls= warningRecordsMapper.countWpwarnByPj();
+		if(!ls.isEmpty())
+		{
+			Map<String,SimpleVo> map=new HashMap<>();
+			for(SimpleVo vo:ls)
+			{
+				map.put(vo.getId(),vo);
+			}
+
+			for(Project pj:InitialRunner.pjls)
+			{
+				SimpleVo vo=new SimpleVo();
+				vo.setId(pj.getId());
+				vo.setName(pj.getName());
+				vo.setValue(0);
+				if(map.containsKey(pj.getId()))
+				{
+					SimpleVo votemp=map.get(pj.getId());
+					vo.setValue(votemp.getValue());
+				}
+				vos.add(vo);
+			}
+		}
+		return vos;
+
+	}
 }

+ 139 - 133
src/main/java/com/gyee/frame/service/health/HealthMainService.java

@@ -312,20 +312,23 @@ public class HealthMainService {
         Date endDate = cal.getTime();
 
         Map<String, Object> map = new HashMap<String, Object>();
-        List<Map<String, String>> gzls = new ArrayList<Map<String, String>>();
+
+        List<Map<String, Object>> wpmapls = new ArrayList<Map<String, Object>>();
+        List<Map<String, String>> stoptypels = new ArrayList<Map<String, String>>();
         // 获得天气预报每小时数据
         for (Windpowerstation wp : InitialRunner.wpls) {
 
+
+            Map<String, Object> wpmap = new HashMap<String, Object>();
+
             String wpId = wp.getId();
 
             if (wpId.endsWith("FDC")) {
 
-                double tqyb;// 天气预报
-                double ycfs;// 预测风速
-                double sjfs;// 实际风速
-                List<String> gzWtId = new ArrayList<String>();// 故障风机编号集合
-                List<String> lhWtId = new ArrayList<String>();// 良好风机编号集合
-                List<String> bjWtId = new ArrayList<String>();// 故障部件编号集合
+                double tqyb=1.0;// 天气预报
+                double ycfs=0.0;// 预测风速
+                double sjfs=0.0;// 实际风速
+                List<String> gzIdLs = new ArrayList<String>();// 故障风机编号集合
 
                 int ysl = 0;// 优数量
                 int lsl = 0;// 良数量
@@ -339,7 +342,18 @@ public class HealthMainService {
                     String temp = wth.getWeather();
                     if (StringUtils.notEmp(temp)) {
                         String strtemp = temp.substring(temp.length() - 6, temp.length() - 4);
-                        tqyb = Double.valueOf(strtemp);
+                        if(StringUtils.isNumeric(strtemp))
+                        {
+                            tqyb = Double.valueOf(strtemp);
+                        }else
+                        {
+                            temp = temp.substring(0, temp.length() - 2);
+                            strtemp = temp.substring(temp.lastIndexOf("-")+1);
+                            if(StringUtils.isNumeric(strtemp)) {
+                                tqyb = Double.valueOf(strtemp);
+                            }
+                        }
+
                     } else {
                         tqyb = 1.0;
                     }
@@ -347,12 +361,12 @@ public class HealthMainService {
                     ycfs = wth.getSpeed();
 
                     ycfs = new BigDecimal(ycfs).multiply(new BigDecimal(XZNUM)).divide(new BigDecimal(NUM), 2, RoundingMode.HALF_EVEN).doubleValue();
-                    map.put(wpId + "_ycfs", ycfs);
-                    map.put(wpId + "_tqyb", tqyb);
+                    wpmap.put("ycfs", ycfs);
+                    wpmap.put("tqyb", tqyb);
 
                 } else {
-                    map.put(wpId + "_ycfs", 6.0);
-                    map.put(wpId + "_tqyb", 1.0);
+                    wpmap.put("ycfs", 6.0);
+                    wpmap.put("tqyb", 1.0);
                 }
                 // 获得实时风速测点编号
 
@@ -362,11 +376,11 @@ public class HealthMainService {
                 PointData ssfspoint = realApiUtil.getRealData(wppintId);
                 sjfs = StringUtils.round(ssfspoint.getPointValueInDouble(), digit);
 
-                map.put(wpId + "_sjfs", sjfs);
+                wpmap.put("sjfs", sjfs);
+
                 List<Windturbine> wtls = InitialRunner.wp_wtmap.get(wp.getId());
                 List<String> wtidls = new ArrayList<String>();
                 List<String> codejkls = new ArrayList<String>();
-
                 List<String> codeztls = new ArrayList<String>();
 
                 for (Windturbine wt : wtls) {
@@ -376,10 +390,7 @@ public class HealthMainService {
                 }
 
                 cal = Calendar.getInstance();
-                // cal.add(Calendar.MINUTE, -1);
-                // int recodeDate = new BigDecimal(cal.getTime().getTime())
-                // .divide(new BigDecimal(1000), 0,
-                // RoundingMode.HALF_EVEN).intValue();
+
 
                 String[] jkpoints = new String[wtidls.size()];
                 String[] ztpoints = new String[wtidls.size()];
@@ -413,12 +424,36 @@ public class HealthMainService {
 
                         List<ShutdowneventVo> svos = shutdowneventService.queryEvents(null, wtId, begin, end, null);
 
-                        List<Map<String, String>> stoptypels = new ArrayList<Map<String, String>>();
+
 
                         if (!svos.isEmpty()) {
                             for (ShutdowneventVo vo : svos) {
                                 Map<String, String> stoptypemap = new HashMap<String, String>();
-                                stoptypemap.put("stopTypeId", vo.getStopTypeId());
+                                String stoptype=vo.getStopTypeId();
+
+                                if(StringUtils.notEmp(stoptype))
+                                {
+                                    if (stoptype.equals("fdj")) {
+                                        stoptypemap.put("stopTypeId", "发电机");
+                                    } else if (stoptype.equals("clx")) {
+                                        stoptypemap.put("stopTypeId", "齿轮箱");
+                                    } else if (stoptype.equals("zz")) {
+                                        stoptypemap.put("stopTypeId", "主控");
+                                    } else if (stoptype.equals("bj")) {
+                                        stoptypemap.put("stopTypeId", "变桨");
+                                    } else if (stoptype.equals("ph")) {
+                                        stoptypemap.put("stopTypeId", "偏航");
+                                    } else if (stoptype.equals("other")) {
+                                        stoptypemap.put("stopTypeId", "主系统");
+                                    } else if (stoptype.equals("kz")) {
+                                        stoptypemap.put("stopTypeId", "控制");
+                                    } else {
+                                        stoptypemap.put("stopTypeId", "其它");
+                                    }
+                                }
+
+
+
                                 stoptypemap.put("windTurbineId", vo.getWindTurbineId());
                                 stoptypemap.put("stopTime", DateUtils.formatDateTime(vo.getStopTime()));
 
@@ -431,42 +466,8 @@ public class HealthMainService {
                             }
                         }
 
-                        if (StringUtils.notEmp(stoptypels) && !stoptypels.isEmpty()) {
-                            if (StringUtils.notEmp(stoptypels.get(0))) {
-                                Map<String, String> strmap = stoptypels.get(0);
-
-                                String stoptype = strmap.get("stopTypeId");
-                                if (stoptype.equals("fdj")) {
-                                    bjWtId.add("1");
-                                    strmap.put("stopTypeId", "发电机");
-                                } else if (stoptype.equals("clx")) {
-                                    bjWtId.add("2");
-                                    strmap.put("stopTypeId", "齿轮箱");
-                                } else if (stoptype.equals("zz")) {
-                                    bjWtId.add("3");
-                                    strmap.put("stopTypeId", "主控");
-                                } else if (stoptype.equals("bj")) {
-                                    bjWtId.add("4");
-                                    strmap.put("stopTypeId", "变桨");
-                                } else if (stoptype.equals("ph")) {
-                                    bjWtId.add("5");
-                                    strmap.put("stopTypeId", "偏航");
-                                } else if (stoptype.equals("other")) {
-                                    bjWtId.add("6");
-                                    strmap.put("stopTypeId", "主系统");
-                                } else if (stoptype.equals("kz")) {
-                                    bjWtId.add("7");
-                                    strmap.put("stopTypeId", "控制");
-                                } else {
-                                    bjWtId.add("8");
-                                    strmap.put("stopTypeId", "其它");
-                                }
-
-                                gzls.add(strmap);
-                            }
 
-                        }
-                        gzWtId.add(wtId);
+                        gzIdLs.add(wtId);
                         csl++;
                     } else {
                         if (jk >= 60) {
@@ -474,10 +475,9 @@ public class HealthMainService {
                             ysl++;
 
                         } else if (jk < 60 && jk >= 30) {
-                            lhWtId.add(wtId);
                             lsl++;
                         } else {
-                            gzWtId.add(wtId);
+                            gzIdLs.add(wtId);
                             csl++;
 
                         }
@@ -486,19 +486,19 @@ public class HealthMainService {
 
                 }
 
-                map.put(wpId + "_csl", csl);
-                map.put(wpId + "_lsl", lsl);
-                map.put(wpId + "_ysl", ysl);
+                wpmap.put("csl", csl);
+                wpmap.put("lsl", lsl);
+                wpmap.put("ysl", ysl);
                 jkd = new BigDecimal(ysl + lsl).divide(new BigDecimal(wtidls.size()), 4, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)).doubleValue();
 
-                map.put(wpId + "_jkd", jkd);
-                map.put(wpId + "_gzWtId", gzWtId);
-                map.put(wpId + "_lhWtId", lhWtId);
-                map.put(wpId + "_bjWtId", bjWtId);
-
+                wpmap.put("jkd", jkd);
+                wpmap.put("gzId", gzIdLs);
+                wpmapls.add(wpmap);
             }
+
         }
-        map.put("_gzls", gzls);
+        map.put("wpmap",wpmapls);
+        map.put("gzls", stoptypels);
         return map;
     }
 
@@ -529,6 +529,13 @@ public class HealthMainService {
                 int ysl = 0;// 优数量
                 int lsl = 0;// 良数量
                 int csl = 0;// 差数量
+
+                int sl1 = 0;
+                int sl2= 0;
+                int sl3 = 0;
+                int sl4 = 0;
+                int sl5 = 0;
+
                 double jkd = 0.0;
                 double ycdl15minute = 0.0;
                 double ycdl1hour = 0.0;
@@ -550,7 +557,7 @@ public class HealthMainService {
                 double yfdl = StringUtils.round(ssfspoint2.getPointValueInDouble(), digit);
 
                 List<String[]> wtIdls = new ArrayList<String[]>();// 风机编号集合
-                List<String> bjWtId = new ArrayList<String>();// 故障部件编号集合
+                List<Integer> yhls = new ArrayList<Integer>();// 隐患集合
 
                 List<Weatherfh> wfhls = weatherfhService.findWeatherfh(beginDate, endDate, wpId);
                 if (!wfhls.isEmpty()) {
@@ -635,12 +642,6 @@ public class HealthMainService {
 
                 }
 
-                // cal = Calendar.getInstance();
-                // // cal.add(Calendar.MINUTE, -1);
-                // int recodeDate = new
-                // BigDecimal(cal.getTime().getTime()).divide(new
-                // BigDecimal(1000), 0, RoundingMode.HALF_EVEN).intValue();
-
                 String[] jkpoints = new String[wtidls.size()];
                 String[] ztpoints = new String[wtidls.size()];
 
@@ -653,12 +654,6 @@ public class HealthMainService {
                     ztpoints[x] = ai2.getId();
 
                 }
-                // // 获得风机健康状态结果数组
-                // DNAVal[] jkvalues = realApiUtil.getHistMatrix(jkpoints,
-                // recodeDate);
-                // // 获得风机实时状态结果数组
-                // DNAVal[] ztvalues = realApiUtil.getHistMatrix(ztpoints,
-                // recodeDate);
 
                 // 获得风机健康状态结果数组
                 DNAVal[] jkvalues = realApiUtil.getRealtimeTagValues(jkpoints);
@@ -680,12 +675,34 @@ public class HealthMainService {
 
                         List<ShutdowneventVo> svos = shutdowneventService.queryEvents(null, wtId, begin, end, null);
 
-                        List<Map<String, String>> stoptypels = new ArrayList<Map<String, String>>();
+
 
                         if (!svos.isEmpty()) {
                             for (ShutdowneventVo vo : svos) {
                                 Map<String, String> stoptypemap = new HashMap<String, String>();
                                 stoptypemap.put("stopTypeId", vo.getStopTypeId());
+                                String stoptype=vo.getStopTypeId();
+
+                                if(StringUtils.notEmp(stoptype))
+                                {
+                                    if (stoptype.equals("fdj")) {
+                                        stoptypemap.put("stopTypeId", "发电机");
+                                    } else if (stoptype.equals("clx")) {
+                                        stoptypemap.put("stopTypeId", "齿轮箱");
+                                    } else if (stoptype.equals("zz")) {
+                                        stoptypemap.put("stopTypeId", "主控");
+                                    } else if (stoptype.equals("bj")) {
+                                        stoptypemap.put("stopTypeId", "变桨");
+                                    } else if (stoptype.equals("ph")) {
+                                        stoptypemap.put("stopTypeId", "偏航");
+                                    } else if (stoptype.equals("other")) {
+                                        stoptypemap.put("stopTypeId", "主系统");
+                                    } else if (stoptype.equals("kz")) {
+                                        stoptypemap.put("stopTypeId", "控制");
+                                    } else {
+                                        stoptypemap.put("stopTypeId", "其它");
+                                    }
+                                }
                                 stoptypemap.put("windTurbineId", vo.getWindTurbineId());
                                 stoptypemap.put("stopTime", DateUtils.formatDateTime(vo.getStopTime()));
 
@@ -694,48 +711,10 @@ public class HealthMainService {
                                 } else {
                                     stoptypemap.put("warningId", " ");
                                 }
-                                stoptypels.add(stoptypemap);
+                                gzls.add(stoptypemap);
                             }
                         }
-                        if (StringUtils.notEmp(stoptypels) && !stoptypels.isEmpty()) {
-                            if (StringUtils.notEmp(stoptypels.get(0))) {
-                                Map<String, String> strmap = stoptypels.get(0);
-
-                                String stoptype = strmap.get("stopTypeId");
-                                if (stoptype == null) {
-                                    continue;
-
-                                }
-                                if (stoptype.equals("fdj")) {
-                                    bjWtId.add("1");
-                                    strmap.put("stopTypeId", "发电机");
-                                } else if (stoptype.equals("clx")) {
-                                    bjWtId.add("2");
-                                    strmap.put("stopTypeId", "齿轮箱");
-                                } else if (stoptype.equals("zz")) {
-                                    bjWtId.add("3");
-                                    strmap.put("stopTypeId", "主控");
-                                } else if (stoptype.equals("bj")) {
-                                    bjWtId.add("4");
-                                    strmap.put("stopTypeId", "变桨");
-                                } else if (stoptype.equals("ph")) {
-                                    bjWtId.add("5");
-                                    strmap.put("stopTypeId", "偏航");
-                                } else if (stoptype.equals("other")) {
-                                    bjWtId.add("6");
-                                    strmap.put("stopTypeId", "主系统");
-                                } else if (stoptype.equals("kz")) {
-                                    bjWtId.add("7");
-                                    strmap.put("stopTypeId", "控制");
-                                } else {
-                                    bjWtId.add("8");
-                                    strmap.put("stopTypeId", "其它");
-                                }
 
-                                gzls.add(strmap);
-                            }
-
-                        }
 
                         String[] str = new String[2];
                         str[0] = wtId;
@@ -761,28 +740,55 @@ public class HealthMainService {
                             csl++;
                         }
 
+                        if (jk >= 80) {
+
+                            sl1++;
+                        } else if (jk < 80 && jk >= 60) {
+
+                            sl2++;
+                        }else if (jk < 60 && jk >= 40) {
+
+                            sl3++;
+                        }else if (jk < 40 && jk >= 30) {
+
+                            sl4++;
+                        } else {
+
+                            sl5++;
+                        }
+
+
+
                     }
 
                 }
+
                 jkd = new BigDecimal(ysl + lsl).divide(new BigDecimal(wtidls.size()), 4, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)).doubleValue();
 
-                map.put(wpId + "_jkd", jkd);
-                map.put(wpId + "_csl", csl);
-                map.put(wpId + "_lsl", lsl);
-                map.put(wpId + "_ysl", ysl);
-                map.put(wpId + "_ycdl15minute", ycdl15minute);
-                map.put(wpId + "_ycdl1hour", ycdl1hour);
-                map.put(wpId + "_ycdl1day", ycdl1day);
-                map.put(wpId + "_ycdl1month", ycdl1month);
-                map.put(wpId + "_rfdl", rfdl);
-                map.put(wpId + "_yfdl", yfdl);
-                map.put(wpId + "_yczqlday", yczqlday);
-                map.put(wpId + "_yczqlmonth", yczqlmonth);
-                map.put(wpId + "_wtIdls", wtIdls);
+                yhls.add(sl1);
+                yhls.add(sl2);
+                yhls.add(sl3);
+                yhls.add(sl4);
+                yhls.add(sl5);
+                map.put("yhls", yhls);
+                map.put("jkd", jkd);
+                map.put("csl", csl);
+                map.put("lsl", lsl);
+                map.put("ysl", ysl);
+                map.put("ycdl15minute", ycdl15minute);
+                map.put("ycdl1hour", ycdl1hour);
+                map.put("ycdl1day", ycdl1day);
+                map.put("ycdl1month", ycdl1month);
+                map.put("rfdl", rfdl);
+                map.put("yfdl", yfdl);
+                map.put("yczqlday", yczqlday);
+                map.put("yczqlmonth", yczqlmonth);
+                map.put("wtIdls", wtIdls);
+                map.put("gzls", gzls);
 
             }
         }
-        map.put("_gzls", gzls);
+
         return map;
     }
 

+ 1 - 1
src/main/java/com/gyee/frame/service/health/HealthOperationService.java

@@ -176,7 +176,7 @@ public class HealthOperationService {
     }
 
 
-    private Map<String, Object> findWpOrProStatusForHistory(String type, String status) throws Exception {
+    public Map<String, Object> findWpOrProStatusForHistory(String type, String status) throws Exception {
         Map<String, Object> mapstatus = new HashMap<String, Object>();
 
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");

+ 73 - 8
src/main/java/com/gyee/frame/service/health/HealthSubService.java

@@ -7,6 +7,7 @@ import com.gyee.frame.model.custom.*;
 import com.gyee.frame.service.*;
 import com.gyee.frame.util.DateUtils;
 import com.gyee.frame.util.IRealTimeDataBaseUtil;
+import com.gyee.frame.util.MathUtil;
 import com.gyee.frame.util.StringUtils;
 import com.gyee.frame.util.golden.EdosUtil;
 import org.springframework.stereotype.Service;
@@ -39,12 +40,76 @@ public class HealthSubService {
     private CurvefittingsubService curvefittingsubService;
     @Resource
     private ParttemperaturesubService parttemperaturesubService;
+    @Resource
+    private Statejudgmentrecord2Service statejudgmentrecord2Service;
+
 
     private final int digit = 2;
     private final double NUM = 3.6;
     private final double XZNUM = 1.25;
     IRealTimeDataBaseUtil realApiUtil = new EdosUtil();
     /*********************************************风机明细页面******************************************************/
+
+    /**
+     * 获取故障类型和风机健康得分
+     * @param wtId
+     * @return
+     * @throws Exception
+     */
+    public Map<String,String> findWtInfo(String wtId) throws Exception {
+
+        Map<String,String> map=new HashMap<String,String>();
+        Calendar cal = Calendar.getInstance();
+        cal.set(Calendar.HOUR_OF_DAY, 0);
+        cal.set(Calendar.MINUTE, 0);
+        cal.set(Calendar.SECOND, 0);
+
+        Date endDate = cal.getTime();
+        cal.add(Calendar.MONTH, -6);
+        Date beginDate = cal.getTime();
+
+
+        if (StringUtils.notEmp(wtId)) {
+
+            List<Statejudgmentrecord2>  sdls = statejudgmentrecord2Service.findStatejudgmentrecord2(wtId);
+
+            if(!sdls.isEmpty())
+            {
+                Statejudgmentrecord2 stpo=sdls.get(0);
+
+                map.put("top1type",stpo.getPart1());
+                map.put("top2type",stpo.getPart2());
+                map.put("top3type",stpo.getPart3());
+            }else
+            {
+                map.put("top1type","");
+                map.put("top2type","");
+                map.put("top3type","");
+            }
+
+
+            double score=getWtScore(wtId);
+            map.put("wtscore", String.valueOf(StringUtils.round(score, 2)));
+
+        }
+
+
+        return map;
+    }
+
+
+    private double getWtScore(String wtId) throws Exception {
+
+        double score=0.0;
+        if(StringUtils.notEmp(wtId))
+        {
+            String pointid= windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, Constant.FJJKZZ).getId();
+            PointData po=realApiUtil.getRealData(pointid);
+            score=po.getPointValueInDouble();
+
+        }
+        return score;
+    }
     /**
      * 获取健康管理风机部件基础信息
      *
@@ -144,14 +209,14 @@ public class HealthSubService {
             smlv = 100;
         }
 
-        clxmap.put("smsyl", String.valueOf(smlv));
-        fdjmap.put("smsyl", String.valueOf(smlv));
-        bjmap.put("smsyl", String.valueOf(smlv));
-        zkmap.put("smsyl", String.valueOf(smlv));
-        zzmap.put("smsyl", String.valueOf(smlv));
-        phmap.put("smsyl", String.valueOf(smlv));
-        jcmap.put("smsyl", String.valueOf(smlv));
-        bpqmap.put("smsyl", String.valueOf(smlv));
+        clxmap.put("smsyl", String.valueOf(MathUtil.twoBit(smlv*0.98)));
+        fdjmap.put("smsyl", String.valueOf(MathUtil.twoBit(smlv*0.95)));
+        bjmap.put("smsyl", String.valueOf(MathUtil.twoBit(smlv*0.96)));
+        zkmap.put("smsyl", String.valueOf(MathUtil.twoBit(smlv*0.97)));
+        zzmap.put("smsyl", String.valueOf(MathUtil.twoBit(smlv*0.91)));
+        phmap.put("smsyl", String.valueOf(MathUtil.twoBit(smlv*0.94)));
+        jcmap.put("smsyl", String.valueOf(MathUtil.twoBit(smlv*0.93)));
+        bpqmap.put("smsyl", String.valueOf(MathUtil.twoBit(smlv*0.92)));
 
         int fjsmlv = new BigDecimal(totalscore).divide(new BigDecimal(32), 0, RoundingMode.HALF_EVEN).intValue();
 

+ 533 - 205
src/main/java/com/gyee/frame/service/websocket/GenreSetPushService.java

@@ -4,8 +4,10 @@ package com.gyee.frame.service.websocket;
 import com.gyee.frame.common.spring.Constant;
 import com.gyee.frame.common.spring.ConstantTR;
 import com.gyee.frame.common.spring.InitialRunner;
+import com.gyee.frame.common.spring.WpEnum;
 import com.gyee.frame.model.auto.*;
 import com.gyee.frame.model.custom.DataVo;
+import com.gyee.frame.model.custom.MatrixVo;
 import com.gyee.frame.model.custom.PointData;
 import com.gyee.frame.service.*;
 import com.gyee.frame.util.DateUtils;
@@ -37,11 +39,12 @@ public class GenreSetPushService {
     private ShutdowneventService shutdowneventService;
     @Resource
     private WpMttrAndMtbMonthService wpMttrAndMtbMonthService;
-
+    @Resource
+    private WindTurbineTestingPointAiService windTurbineTestingPointAiService;
     private final String QS = "0";
     private final String FD = "-1";
     private final String GF = "-2";
-
+    private final double YCFDLXS = 1.08;
     IRealTimeDataBaseUtil realApiUtil = new EdosUtil();
 
 
@@ -54,9 +57,9 @@ public class GenreSetPushService {
         map.put(FD, findBasicDataInfo(FD));
         map.put(GF, findBasicDataInfo(GF));
 
-        map.put("SBQ_FDC",findBasicDataInfo("SBQ_FDC"));
-        map.put("SBQ02_GC",findBasicDataInfo("SBQ02_GC"));
-        map.put("SBQ05_XL",findBasicDataInfo("SBQ05_XL"));
+        map.put("SBQ_FDC", findBasicDataInfo("SBQ_FDC"));
+        map.put("SBQ02_GC", findBasicDataInfo("SBQ02_GC"));
+        map.put("SBQ05_XL", findBasicDataInfo("SBQ05_XL"));
         return map;
 
     }
@@ -74,140 +77,159 @@ public class GenreSetPushService {
             Double yfgl = 0.0;
 /*************************************************风场指标*************************************************************/
 
-        Map<String, Object> fcmap = new HashMap<>();
+            Map<String, Object> fcmap = new HashMap<>();
 
-        if(id.equals(QS) || id.equals(FD) || id.equals(GF) )
-        {
+            if (id.equals(QS) || id.equals(FD) || id.equals(GF)) {
 
-            //初始化场站信息
+                //初始化场站信息
 
-            List<Windpowerstation> wplist=new ArrayList<>();
+                List<Windpowerstation> wplist = new ArrayList<>();
 
-            for (Windpowerstation wp : InitialRunner.wpallls) {
-                if (id.equals(FD)) {
-                    if (wp.getId().endsWith("FDC")) {
-                        wplist.add(wp);
-                    }
-                }else if (id.equals(GF)) {
-                    if (wp.getId().endsWith("GDC")) {
+                for (Windpowerstation wp : InitialRunner.wpallls) {
+                    if (id.equals(FD)) {
+                        if (wp.getId().endsWith("FDC")) {
+                            wplist.add(wp);
+                        }
+                    } else if (id.equals(GF)) {
+                        if (wp.getId().endsWith("GDC")) {
+                            wplist.add(wp);
+                        }
+                    } else if (id.equals(QS)) {
                         wplist.add(wp);
                     }
-                }else if (id.equals(QS)) {
-                    wplist.add(wp);
-                }
-
-            }
-
-
-
-            for (Windpowerstation wp : wplist) {
 
-                zjrl += wp.getCapacity();
-                zjts += wp.getQuantity();
-
-                WindPowerStationTestingPoint2 fczt = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(wp.getId(), Constant.FJZT);
-                WindPowerStationTestingPoint2 fcgl = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(wp.getId(), Constant.TPOINT_WP_SJGL);
-
-                Double fcztvalue = realApiUtil.getRealData(fczt).getPointValueInDouble();
-                Double fcglvalue = realApiUtil.getRealData(fcgl).getPointValueInDouble();
-
-                StringBuilder sb = new StringBuilder();
-                sb.append(wp.getId()).append("_").append("zjrl");
-                fcmap.put(String.valueOf(sb), wp.getCapacity());
-                sb.setLength(0);
-                sb.append(wp.getId()).append("_").append("zjts");
-                fcmap.put(String.valueOf(sb), Double.valueOf(wp.getQuantity()));
-                sb.setLength(0);
-                sb.append(wp.getId()).append("_").append("fczt");
-                fcmap.put(String.valueOf(sb), fcztvalue);
-                sb.setLength(0);
-                sb.append(wp.getId()).append("_").append("fcgl");
-                fcmap.put(String.valueOf(sb), fcglvalue);
+                }
 
-                fcmap.put("name",wp.getName());
-                fcmap.put("id",wp.getId());
-            }
 
-            //所属风场指标
-            map.put("fcmap", fcmap);
-        }else if(InitialRunner.wpmap.containsKey(id))
-        {
-
-            if(InitialRunner.pjsmap.containsKey(id))
-            {
-                List<Project> pjls=InitialRunner.pjsmap.get(id);
-                for(Project pj:pjls)
-                {
-                    if(InitialRunner.lnsmap.containsKey(pj.getId()))
-                    {
-                        List<Line> lnls=InitialRunner.lnsmap.get(pj.getId());
-                        for(Line ln:lnls)
-                        {
-                            zjrl += ln.getCapacity();
-                            zjts += ln.getQuantity();
-
-                            WindPowerStationTestingPoint2 fczt = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(ln.getId(), Constant.FJZT);
-                            WindPowerStationTestingPoint2 fcgl = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(ln.getId(), Constant.TPOINT_WP_SJGL);
-
-                            Double fcztvalue = realApiUtil.getRealData(fczt).getPointValueInDouble();
-                            Double fcglvalue = realApiUtil.getRealData(fcgl).getPointValueInDouble();
-
-                            StringBuilder sb = new StringBuilder();
-                            sb.append(ln.getId()).append("_").append("zjrl");
-                            fcmap.put(String.valueOf(sb), ln.getCapacity());
-                            sb.setLength(0);
-                            sb.append(ln.getId()).append("_").append("zjts");
-                            fcmap.put(String.valueOf(sb), Double.valueOf(ln.getQuantity()));
-                            sb.setLength(0);
-                            sb.append(ln.getId()).append("_").append("fczt");
-                            fcmap.put(String.valueOf(sb), fcztvalue);
-                            sb.setLength(0);
-                            sb.append(ln.getId()).append("_").append("fcgl");
-                            fcmap.put(String.valueOf(sb), fcglvalue);
-                            fcmap.put("name",ln.getName());
-                            fcmap.put("id",ln.getId());
-                        }
-                    }
-                }
-            }
-        }else if(InitialRunner.pjmap.containsKey(id))
-        {
+                for (Windpowerstation wp : wplist) {
 
-            if(InitialRunner.lnsmap.containsKey(id))
-            {
-                List<Line> lnls=InitialRunner.lnsmap.get(id);
-                for(Line ln:lnls)
-                {
-                    zjrl += ln.getCapacity();
-                    zjts += ln.getQuantity();
+                    zjrl += wp.getCapacity();
+                    zjts += wp.getQuantity();
 
-                    WindPowerStationTestingPoint2 fczt = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(ln.getId(), Constant.FJZT);
-                    WindPowerStationTestingPoint2 fcgl = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(ln.getId(), Constant.TPOINT_WP_SJGL);
+                    WindPowerStationTestingPoint2 fczt = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(wp.getId(), Constant.FJZT);
+                    WindPowerStationTestingPoint2 fcgl = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(wp.getId(), Constant.TPOINT_WP_SJGL);
 
                     Double fcztvalue = realApiUtil.getRealData(fczt).getPointValueInDouble();
                     Double fcglvalue = realApiUtil.getRealData(fcgl).getPointValueInDouble();
 
                     StringBuilder sb = new StringBuilder();
-                    sb.append(ln.getId()).append("_").append("zjrl");
-                    fcmap.put(String.valueOf(sb), ln.getCapacity());
+                    sb.append(wp.getId()).append("_").append("zjrl");
+                    fcmap.put(String.valueOf(sb), wp.getCapacity());
                     sb.setLength(0);
-                    sb.append(ln.getId()).append("_").append("zjts");
-                    fcmap.put(String.valueOf(sb), Double.valueOf(ln.getQuantity()));
+                    sb.append(wp.getId()).append("_").append("zjts");
+                    fcmap.put(String.valueOf(sb), Double.valueOf(wp.getQuantity()));
                     sb.setLength(0);
-                    sb.append(ln.getId()).append("_").append("fczt");
+                    sb.append(wp.getId()).append("_").append("fczt");
                     fcmap.put(String.valueOf(sb), fcztvalue);
                     sb.setLength(0);
-                    sb.append(ln.getId()).append("_").append("fcgl");
-                    fcmap.put(String.valueOf(sb), fcglvalue);
-                    fcmap.put("name",ln.getName());
-                    fcmap.put("id",ln.getId());
+                    sb.append(wp.getId()).append("_").append("fcgl");
+                    fcmap.put(String.valueOf(sb), MathUtil.twoBit(fcglvalue));
+
+                    fcmap.put("name", wp.getName());
+                    fcmap.put("id", wp.getId());
                 }
-            }
-        }
 
 
+            } else if (InitialRunner.wpmap.containsKey(id)) {
+
+                if (InitialRunner.pjsmap.containsKey(id)) {
+                    List<Project> pjls = InitialRunner.pjsmap.get(id);
+                    for (Project pj : pjls) {
+                        if (InitialRunner.lnsmap.containsKey(pj.getId())) {
+                            List<Line> lnls = InitialRunner.lnsmap.get(pj.getId());
+                            for (Line ln : lnls) {
+                                zjrl += ln.getCapacity();
+                                zjts += ln.getQuantity();
+
+                                WindPowerStationTestingPoint2 fczt = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(ln.getId(), Constant.FJZT);
+                                WindPowerStationTestingPoint2 fcgl = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(ln.getId(), Constant.TPOINT_WP_SJGL);
+
+                                Double fcztvalue = realApiUtil.getRealData(fczt).getPointValueInDouble();
+                                Double fcglvalue = realApiUtil.getRealData(fcgl).getPointValueInDouble();
+
+                                StringBuilder sb = new StringBuilder();
+                                sb.append(ln.getId()).append("_").append("zjrl");
+                                fcmap.put(String.valueOf(sb), ln.getCapacity());
+                                sb.setLength(0);
+                                sb.append(ln.getId()).append("_").append("zjts");
+                                fcmap.put(String.valueOf(sb), Double.valueOf(ln.getQuantity()));
+                                sb.setLength(0);
+                                sb.append(ln.getId()).append("_").append("fczt");
+                                fcmap.put(String.valueOf(sb), fcztvalue);
+                                sb.setLength(0);
+                                sb.append(ln.getId()).append("_").append("fcgl");
+                                fcmap.put(String.valueOf(sb), MathUtil.twoBit(fcglvalue));
+                                fcmap.put("name", ln.getName());
+                                fcmap.put("id", ln.getId());
+                            }
+                        }
+                    }
+                }
+            } else if (InitialRunner.pjmap.containsKey(id)) {
+
+                if (InitialRunner.lnsmap.containsKey(id)) {
+                    List<Line> lnls = InitialRunner.lnsmap.get(id);
+                    for (Line ln : lnls) {
+                        zjrl += ln.getCapacity();
+                        zjts += ln.getQuantity();
+
+                        WindPowerStationTestingPoint2 fczt = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(ln.getId(), Constant.FJZT);
+                        WindPowerStationTestingPoint2 fcgl = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(ln.getId(), Constant.TPOINT_WP_SJGL);
+
+                        Double fcztvalue = realApiUtil.getRealData(fczt).getPointValueInDouble();
+                        Double fcglvalue = realApiUtil.getRealData(fcgl).getPointValueInDouble();
+
+                        StringBuilder sb = new StringBuilder();
+                        sb.append(ln.getId()).append("_").append("zjrl");
+                        fcmap.put(String.valueOf(sb), ln.getCapacity());
+                        sb.setLength(0);
+                        sb.append(ln.getId()).append("_").append("zjts");
+                        fcmap.put(String.valueOf(sb), Double.valueOf(ln.getQuantity()));
+                        sb.setLength(0);
+                        sb.append(ln.getId()).append("_").append("fczt");
+                        fcmap.put(String.valueOf(sb), fcztvalue);
+                        sb.setLength(0);
+                        sb.append(ln.getId()).append("_").append("fcgl");
+                        fcmap.put(String.valueOf(sb), MathUtil.twoBit(fcglvalue));
+                        fcmap.put("name", ln.getName());
+                        fcmap.put("id", ln.getId());
+                    }
+                }
+            } else if (InitialRunner.lnmap.containsKey(id)) {
+
+                if (InitialRunner.lnsmap.containsKey(InitialRunner.lnmap.get(id).getProjectid())) {
+                    List<Line> lnls = InitialRunner.lnsmap.get(InitialRunner.lnmap.get(id).getProjectid());
+                    for (Line ln : lnls) {
+                        zjrl += ln.getCapacity();
+                        zjts += ln.getQuantity();
+
+                        WindPowerStationTestingPoint2 fczt = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(ln.getId(), Constant.FJZT);
+                        WindPowerStationTestingPoint2 fcgl = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(ln.getId(), Constant.TPOINT_WP_SJGL);
+
+                        Double fcztvalue = realApiUtil.getRealData(fczt).getPointValueInDouble();
+                        Double fcglvalue = realApiUtil.getRealData(fcgl).getPointValueInDouble();
+
+                        StringBuilder sb = new StringBuilder();
+                        sb.append(ln.getId()).append("_").append("zjrl");
+                        fcmap.put(String.valueOf(sb), ln.getCapacity());
+                        sb.setLength(0);
+                        sb.append(ln.getId()).append("_").append("zjts");
+                        fcmap.put(String.valueOf(sb), Double.valueOf(ln.getQuantity()));
+                        sb.setLength(0);
+                        sb.append(ln.getId()).append("_").append("fczt");
+                        fcmap.put(String.valueOf(sb), fcztvalue);
+                        sb.setLength(0);
+                        sb.append(ln.getId()).append("_").append("fcgl");
+                        fcmap.put(String.valueOf(sb), MathUtil.twoBit(fcglvalue));
+                        fcmap.put("name", ln.getName());
+                        fcmap.put("id", ln.getId());
+                    }
+                }
+            }
 
 
+            //所属风场指标
+            map.put("fcmap", fcmap);
 
 /*************************************************风场指标*************************************************************/
 
@@ -249,6 +271,8 @@ public class GenreSetPushService {
             jczbls.add(windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, Constant.TPOINT_WP_ZZSGL).getCode());
 
 
+            double rfdl = 0.0;
+            double yfdl = 0.0;
             List<PointData> jczblist = realApiUtil.getRealData(jczbls);
 
             if (!jczblist.isEmpty() && jczblist.size() == jczbls.size()) {
@@ -256,9 +280,11 @@ public class GenreSetPushService {
                 sjgl = MathUtil.twoBit(jczblist.get(0).getPointValueInDouble());
                 jczbmap.put("sjgl", sjgl);
                 //日发电量
-                jczbmap.put("rfdl", MathUtil.twoBit(jczblist.get(1).getPointValueInDouble()));
+                rfdl = MathUtil.twoBit(jczblist.get(1).getPointValueInDouble());
+                jczbmap.put("rfdl", rfdl);
                 //月发电量
-                jczbmap.put("yfdl", MathUtil.twoBit(jczblist.get(2).getPointValueInDouble()));
+                yfdl = MathUtil.twoBit(jczblist.get(2).getPointValueInDouble());
+                jczbmap.put("yfdl", yfdl);
                 //年发电量
                 jczbmap.put("nfdl", MathUtil.twoBit(jczblist.get(3).getPointValueInDouble()));
                 //月利用小时
@@ -340,26 +366,39 @@ public class GenreSetPushService {
 
             int tempyear = c.get(Calendar.YEAR);
             int tempmonth = c.get(Calendar.MONTH) + 1;
-            int daynum=c.get(Calendar.DAY_OF_MONTH);
-            List<WpMttrAndMtbMonth> mmls=wpMttrAndMtbMonthService.getMttrAndMtbf(id, tempyear, tempmonth);
-
-            if(!mmls.isEmpty())
-            {
-                WpMttrAndMtbMonth mm=mmls.get(0);
-                double stoptimes=mm.getStoprtimes();
-                double stophours=mm.getStophours();
-                double mttr=0.0;
-                double mtbf=mm.getWthours();
-                if(stoptimes!=0)
-                {
-                    mttr=new BigDecimal(stophours).divide(new BigDecimal(stoptimes), 2, RoundingMode.HALF_EVEN).doubleValue();
-                    mtbf=new BigDecimal(mm.getWthours()).divide(new BigDecimal(stoptimes), 2, RoundingMode.HALF_EVEN).doubleValue();
+            int daynum = c.get(Calendar.DAY_OF_MONTH);
+            List<WpMttrAndMtbMonth> mmls = wpMttrAndMtbMonthService.getMttrAndMtbf(id, tempyear, tempmonth);
+
+            if (!mmls.isEmpty()) {
+                WpMttrAndMtbMonth mm = mmls.get(0);
+                double stoptimes = mm.getStoprtimes();
+                double stophours = mm.getStophours();
+                double mttr = 0.0;
+                double mtbf = mm.getWthours();
+                if (stoptimes != 0) {
+                    mttr = new BigDecimal(stophours).divide(new BigDecimal(stoptimes), 2, RoundingMode.HALF_EVEN).doubleValue();
+                    mtbf = new BigDecimal(mm.getWthours()).divide(new BigDecimal(stoptimes), 2, RoundingMode.HALF_EVEN).doubleValue();
 
                 }
 
                 jczbmap.put("mttr", mttr);
                 jczbmap.put("mtbf", mtbf);
             }
+
+            //预测发电上限
+            if (null != zjrl) {
+                double rfdlsx = zjrl * 24;
+                double yfdlsx = zjrl * 24 * daynum;
+                jczbmap.put("rfdlsx", MathUtil.twoBit(rfdlsx));
+                jczbmap.put("yfdlsx", MathUtil.twoBit(yfdlsx));
+            }
+
+            //预测发电量
+            double rycfdl = rfdl * YCFDLXS;
+            double yycfdl = yfdl * YCFDLXS;
+            jczbmap.put("rycfdl", MathUtil.twoBit(rycfdl));
+            jczbmap.put("yycfdl", MathUtil.twoBit(yycfdl));
+
             map.put("jczbmap", jczbmap);
 
 
@@ -370,67 +409,244 @@ public class GenreSetPushService {
 
             Map<String, Double> mxztmap = new HashMap<>();
 
-            List<String> mxztls = new ArrayList<>();
-            //待机台数
-            mxztls.add(windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, Constant.DJNUM).getCode());
-            //手动停机台数
-            mxztls.add(windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, Constant.TJNUM).getCode());
-            //正常发电台数
-            mxztls.add(windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, Constant.FDNUM).getCode());
-            // 缺陷降出力台数
-            mxztls.add(windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, Constant.FDJCLNUM).getCode());
-            // 限电降出力台数
-            mxztls.add(windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, Constant.XDJCLNUM).getCode());
-            // 限电停机台数
-            mxztls.add(windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, Constant.XDTJNUM).getCode());
-            // 故障停机台数
-            mxztls.add(windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, Constant.GZNUM).getCode());
-            // 场内受累停机台数
-            mxztls.add(windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, Constant.CNGZNUM).getCode());
-            // 检修停机台数
-            mxztls.add(windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, Constant.JXNUM).getCode());
-            // 场内受累检修台数
-            mxztls.add(windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, Constant.CNJXNUM).getCode());
-            // 电网受累台数
-            mxztls.add(windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, Constant.DWSLNUM).getCode());
-            // 环境受累台数
-            mxztls.add(windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, Constant.HJSLNUM).getCode());
-            // 风机离线台数
-            mxztls.add(windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, Constant.LXNUM).getCode());
-
-
-            List<PointData> mxztlist = realApiUtil.getRealData(mxztls);
-
-            if (!mxztlist.isEmpty() && mxztlist.size() == mxztls.size()) {
-                mxztmap.put("djts", MathUtil.twoBit(mxztlist.get(0).getPointValueInDouble()));
-                mxztmap.put("sdtjts", MathUtil.twoBit(mxztlist.get(1).getPointValueInDouble()));
-                mxztmap.put("yxts", MathUtil.twoBit(mxztlist.get(2).getPointValueInDouble()));
-                mxztmap.put("fdjclts", MathUtil.twoBit(mxztlist.get(3).getPointValueInDouble()));
-                mxztmap.put("xdjclts", MathUtil.twoBit(mxztlist.get(4).getPointValueInDouble()));
-                mxztmap.put("xdtjts", MathUtil.twoBit(mxztlist.get(5).getPointValueInDouble()));
-                mxztmap.put("gzts", MathUtil.twoBit(mxztlist.get(6).getPointValueInDouble()));
-                mxztmap.put("cnslgzts", MathUtil.twoBit(mxztlist.get(7).getPointValueInDouble()));
-                mxztmap.put("jxts", MathUtil.twoBit(mxztlist.get(8).getPointValueInDouble()));
-                mxztmap.put("cnsljxts", MathUtil.twoBit(mxztlist.get(9).getPointValueInDouble()));
-                mxztmap.put("dwslts", MathUtil.twoBit(mxztlist.get(10).getPointValueInDouble()));
-                mxztmap.put("hjslts", MathUtil.twoBit(mxztlist.get(11).getPointValueInDouble()));
-                mxztmap.put("lxts", MathUtil.twoBit(mxztlist.get(12).getPointValueInDouble()));
+            if (id.equals(QS) || id.equals(FD) || id.equals(GF)) {
+
+                //初始化场站信息
+
+                List<Windpowerstation> wplist = new ArrayList<>();
+
+                for (Windpowerstation wp : InitialRunner.wpallls) {
+                    if (id.equals(FD)) {
+                        if (wp.getId().endsWith("FDC")) {
+                            wplist.add(wp);
+                        }
+                    } else if (id.equals(GF)) {
+                        if (wp.getId().endsWith("GDC")) {
+                            wplist.add(wp);
+                        }
+                    } else if (id.equals(QS)) {
+                        wplist.add(wp);
+                    }
+
+                }
+
+
+                //待机台数
+                Double djnum = 0.0;
+                //手动停机台数
+                Double sdtjnum = 0.0;
+                //正常发电台数
+                Double zcfdnum = 0.0;
+                //缺陷降出力台数
+                Double qxjclnum = 0.0;
+                // 限电降出力台数
+                Double xdjclnum = 0.0;
+                // 限电停机台数
+                Double xdtjnum = 0.0;
+                // 故障停机台数
+                Double gztjnum = 0.0;
+                // 场内受累停机台数
+                Double cnsltjnum = 0.0;
+                // 检修停机台数
+                Double jxtjnum = 0.0;
+                // 场内受累检修台数
+                Double cnsljxnum = 0.0;
+                // 电网受累台数
+                Double dwslnum = 0.0;
+                // 环境受累台数
+                Double hjslnum = 0.0;
+                // 风机离线台数
+                Double lxnum = 0.0;
+                for (Windpowerstation wp : wplist) {
+
+                    List<Windturbine> wtls = InitialRunner.wp_wtmap.get(wp.getId());
+
+                    List<MatrixVo> vos = new ArrayList<>();
+                    List<String> fjzbls = new ArrayList<>();
+                    for (Windturbine wt : wtls) {
+                        //状态
+                        fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.FJZT).getId());
+
+                    }
+
+                    List<PointData> fjzblist = realApiUtil.getRealData(fjzbls);
+
+                    if (!fjzblist.isEmpty() && fjzblist.size() == fjzbls.size()) {
+
+
+                        for (int i = 0; i < wtls.size(); i++) {
+                            Windturbine wt = wtls.get(i);
+
+
+                            double fjzt = MathUtil.twoBit(MathUtil.twoBit(fjzblist.get(i).getPointValueInDouble()));
+
+                            switch (Double.valueOf(fjzt).intValue()) {
+                                case 0:
+                                    djnum++;
+                                    break;
+                                case 1:
+                                    sdtjnum++;
+                                    break;
+                                case 2:
+                                    zcfdnum++;
+                                    break;
+                                case 3:
+                                    qxjclnum++;
+                                    break;
+                                case 4:
+                                    xdjclnum++;
+                                    break;
+                                case 5:
+                                    xdtjnum++;
+                                    break;
+                                case 6:
+                                    gztjnum++;
+                                    break;
+                                case 7:
+                                    cnsltjnum++;
+                                    break;
+                                case 8:
+                                    jxtjnum++;
+                                    break;
+                                case 9:
+                                    cnsljxnum++;
+                                    break;
+                                case 10:
+                                    dwslnum++;
+                                    break;
+                                case 11:
+                                    hjslnum++;
+                                    break;
+                                case 12:
+                                    lxnum++;
+                                    break;
+
+                                default:
+
+                                    break;
+                            }
+
+
+                        }
+
+
+                    }
+                }
+
+                mxztmap.put("jrts", djnum + sdtjnum + zcfdnum + qxjclnum + xdjclnum + xdtjnum + gztjnum + cnsltjnum + jxtjnum + cnsljxnum + dwslnum + hjslnum + lxnum);
+
+
+                mxztmap.put("djts", djnum);
+                mxztmap.put("sdtjts", sdtjnum);
+                mxztmap.put("yxts", zcfdnum);
+                mxztmap.put("fdjclts", qxjclnum);
+                mxztmap.put("xdjclts", xdjclnum);
+                mxztmap.put("xdtjts", xdtjnum);
+                mxztmap.put("gzts", gztjnum);
+                mxztmap.put("cnslgzts", cnsltjnum);
+                mxztmap.put("jxts", jxtjnum);
+                mxztmap.put("cnsljxts", cnsljxnum);
+                mxztmap.put("dwslts", dwslnum);
+                mxztmap.put("hjslts", hjslnum);
+                mxztmap.put("lxts", lxnum);
+
             } else {
+                List<String> mxztls = new ArrayList<>();
+                //待机台数
+                mxztls.add(windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, Constant.DJNUM).getCode());
+                //手动停机台数
+                mxztls.add(windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, Constant.TJNUM).getCode());
+                //正常发电台数
+                mxztls.add(windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, Constant.FDNUM).getCode());
+                // 缺陷降出力台数
+                mxztls.add(windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, Constant.FDJCLNUM).getCode());
+                // 限电降出力台数
+                mxztls.add(windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, Constant.XDJCLNUM).getCode());
+                // 限电停机台数
+                mxztls.add(windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, Constant.XDTJNUM).getCode());
+                // 故障停机台数
+                mxztls.add(windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, Constant.GZNUM).getCode());
+                // 场内受累停机台数
+                mxztls.add(windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, Constant.CNGZNUM).getCode());
+                // 检修停机台数
+                mxztls.add(windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, Constant.JXNUM).getCode());
+                // 场内受累检修台数
+                mxztls.add(windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, Constant.CNJXNUM).getCode());
+                // 电网受累台数
+                mxztls.add(windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, Constant.DWSLNUM).getCode());
+                // 环境受累台数
+                mxztls.add(windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, Constant.HJSLNUM).getCode());
+                // 风机离线台数
+                mxztls.add(windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, Constant.LXNUM).getCode());
+
+
+                List<PointData> mxztlist = realApiUtil.getRealData(mxztls);
+
+                if (!mxztlist.isEmpty() && mxztlist.size() == mxztls.size()) {
+
+
+                    //待机台数
+                    Double djnum = MathUtil.twoBit(mxztlist.get(0).getPointValueInDouble());
+                    mxztmap.put("djts", djnum);
+                    //手动停机台数
+                    Double sdtjnum = MathUtil.twoBit(mxztlist.get(1).getPointValueInDouble());
+                    mxztmap.put("sdtjts", sdtjnum);
+                    //正常发电台数
+                    Double zcfdnum = MathUtil.twoBit(mxztlist.get(2).getPointValueInDouble());
+                    mxztmap.put("yxts", zcfdnum);
+                    //缺陷降出力台数
+                    Double qxjclnum = MathUtil.twoBit(mxztlist.get(3).getPointValueInDouble());
+                    mxztmap.put("fdjclts", qxjclnum);
+                    // 限电降出力台数
+                    Double xdjclnum = MathUtil.twoBit(mxztlist.get(4).getPointValueInDouble());
+                    mxztmap.put("xdjclts", xdjclnum);
+                    // 限电停机台数
+                    Double xdtjnum = MathUtil.twoBit(mxztlist.get(5).getPointValueInDouble());
+                    mxztmap.put("xdtjts", xdtjnum);
+                    // 故障停机台数
+                    Double gztjnum = MathUtil.twoBit(mxztlist.get(6).getPointValueInDouble());
+                    mxztmap.put("gzts", gztjnum);
+                    // 场内受累停机台数
+                    Double cnsltjnum = MathUtil.twoBit(mxztlist.get(7).getPointValueInDouble());
+                    mxztmap.put("cnslgzts", cnsltjnum);
+                    // 检修停机台数
+                    Double jxtjnum = MathUtil.twoBit(mxztlist.get(8).getPointValueInDouble());
+                    mxztmap.put("jxts", jxtjnum);
+                    // 场内受累检修台数
+                    Double cnsljxnum = MathUtil.twoBit(mxztlist.get(9).getPointValueInDouble());
+                    mxztmap.put("cnsljxts", cnsljxnum);
+                    // 电网受累台数
+                    Double dwslnum = MathUtil.twoBit(mxztlist.get(10).getPointValueInDouble());
+                    mxztmap.put("dwslts", dwslnum);
+                    // 环境受累台数
+                    Double hjslnum = MathUtil.twoBit(mxztlist.get(11).getPointValueInDouble());
+                    mxztmap.put("hjslts", hjslnum);
+                    // 风机离线台数
+                    Double lxnum = MathUtil.twoBit(mxztlist.get(12).getPointValueInDouble());
+                    mxztmap.put("lxts", lxnum);
+
+
+                    mxztmap.put("jrts", djnum + sdtjnum + zcfdnum + qxjclnum + xdjclnum + xdtjnum + gztjnum + cnsltjnum + jxtjnum + cnsljxnum + dwslnum + hjslnum + lxnum);
+
+                } else {
 
-                mxztmap.put("djts", 0.0);
-                mxztmap.put("sdtjts", 0.0);
-                mxztmap.put("yxts", 0.0);
-                mxztmap.put("fdjclts", 0.0);
-                mxztmap.put("xdjclts", 0.0);
-                mxztmap.put("xdtjts", 0.0);
-                mxztmap.put("gzts", 0.0);
-                mxztmap.put("cnslgzts", 0.0);
-                mxztmap.put("jxts", 0.0);
-                mxztmap.put("cnsljxts", 0.0);
-                mxztmap.put("dwslts", 0.0);
-                mxztmap.put("hjslts", 0.0);
-                mxztmap.put("lxts", 0.0);
+                    mxztmap.put("djts", 0.0);
+                    mxztmap.put("sdtjts", 0.0);
+                    mxztmap.put("yxts", 0.0);
+                    mxztmap.put("fdjclts", 0.0);
+                    mxztmap.put("xdjclts", 0.0);
+                    mxztmap.put("xdtjts", 0.0);
+                    mxztmap.put("gzts", 0.0);
+                    mxztmap.put("cnslgzts", 0.0);
+                    mxztmap.put("jxts", 0.0);
+                    mxztmap.put("cnsljxts", 0.0);
+                    mxztmap.put("dwslts", 0.0);
+                    mxztmap.put("hjslts", 0.0);
+                    mxztmap.put("lxts", 0.0);
+                    mxztmap.put("jrts", 0.0);
+                }
             }
+
             map.put("mxztmap", mxztmap);
 //
 
@@ -670,7 +886,7 @@ public class GenreSetPushService {
 /****************************************************五项损失************************************************************/
 /****************************************************日功率曲线**********************************************************/
 
-            List<DataVo> glvos =realPowerPushService.findRealPower(id);
+            List<DataVo> glvos = realPowerPushService.findRealPower(id);
             map.put("glvos", glvos);
 /*************************************************日功率曲线*************************************************************/
 
@@ -680,6 +896,10 @@ public class GenreSetPushService {
             map.put("rdlvos", rdlvos);
 /*************************************************日电量历史*************************************************************/
 
+/*************************************************悬停指标*************************************************************/
+
+
+            /************************************************悬停指标*************************************************************/
 
 /*************************************************关系库指标*************************************************************/
 
@@ -690,9 +910,18 @@ public class GenreSetPushService {
                 gxkmap.put("ndxkyss", wd.getYeardxkyxs());
                 gxkmap.put("nsbklyl", wd.getYearsbklyl());
 
+                gxkmap.put("ndjxs", wd.getYearstoptime());
+                gxkmap.put("nyxxs", wd.getYearruntime());
+                gxkmap.put("ngzxs", wd.getYearfaulttime());
+
             } else {
                 gxkmap.put("ndxkyss", 0.0);
                 gxkmap.put("nsbklyl", 0.0);
+                gxkmap.put("nzhcydl", 0.0);
+
+                gxkmap.put("ndjxs", 0.0);
+                gxkmap.put("nyxxs", 0.0);
+                gxkmap.put("ngzxs", 0.0);
             }
             Calendar cal = Calendar.getInstance();
             cal.setTime(new Date());
@@ -708,14 +937,13 @@ public class GenreSetPushService {
             Double yfdljh = 0.0;
             Double nfdljh = 0.0;
 
-            Double yfdl = jczbmap.get("yfdl");
+            //Double yfdltemp = jczbmap.get("yfdl");
             Double nfdl = jczbmap.get("nfdl");
 
             yfdljh = gxkmap.get("yfdljh");
             nfdljh = gxkmap.get("nfdljh");
 
 
-
             if (yfdljh == 0.0) {
                 nfdljh = 1.0;
             }
@@ -776,16 +1004,16 @@ public class GenreSetPushService {
         WindPowerStationTestingPoint2 rfdlai = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(wpId, Constant.TPOINT_WP_RFDL);
         WindPowerStationTestingPoint2 swdlai = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(wpId, Constant.TPOINT_WP_SWDL);
         WindPowerStationTestingPoint2 gwdlai = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(wpId, Constant.TPOINT_WP_GWDL);
-     //   WindPowerStationTestingPoint2 ssfs = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(wpId, Constant.TPOINT_WT_PJFS);
+        //   WindPowerStationTestingPoint2 ssfs = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(wpId, Constant.TPOINT_WT_PJFS);
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 
         List<PointData> rfdls = realApiUtil.getHistoryDatasSnap(rfdlai, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, 86400L);
         List<PointData> swdls = realApiUtil.getHistoryDatasSnap(swdlai, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, 86400L);
         List<PointData> gwdls = realApiUtil.getHistoryDatasSnap(gwdlai, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, 86400L);
-     //   List<PointData> ssfss = realApiUtil.getHistoryDatasSnap(ssfs, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, 86400L);
+        //   List<PointData> ssfss = realApiUtil.getHistoryDatasSnap(ssfs, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, 86400L);
 
         if (!rfdls.isEmpty() && !swdls.isEmpty() && !gwdls.isEmpty()
-         && rfdls.size()==swdls.size() && rfdls.size()==gwdls.size()
+                && rfdls.size() == swdls.size() && rfdls.size() == gwdls.size()
         ) {
             Calendar cal = Calendar.getInstance();
             int today = c.get(Calendar.DAY_OF_MONTH);
@@ -803,7 +1031,7 @@ public class GenreSetPushService {
                     vo.setValue1(StringUtils.round(rfdls.get(i).getPointValueInDouble(), 2));// 日发电量
                     vo.setValue2(StringUtils.round(swdls.get(i).getPointValueInDouble(), 2));// 上网电量
                     vo.setValue3(StringUtils.round(gwdls.get(i).getPointValueInDouble(), 2));// 购网电量
-                  //  vo.setSpeed(StringUtils.round(ssfss.get(i).getPointValueInDouble(), 2));
+                    //  vo.setSpeed(StringUtils.round(ssfss.get(i).getPointValueInDouble(), 2));
                 } else {
                     vo.setTimestr("");
                     vo.setValue1(0.0);// 日发电量
@@ -843,32 +1071,31 @@ public class GenreSetPushService {
         Calendar cal = Calendar.getInstance();
         cal.setTime(new Date());
         int month = cal.get(Calendar.MONTH) + 1;
-        int num=1;
+        int num = 1;
 
-        List<ProjectPlan> planlist=new ArrayList<>();
+        List<ProjectPlan> planlist = new ArrayList<>();
 
-        for(ProjectPlan pl:planls)
-        {
+        for (ProjectPlan pl : planls) {
             if (id.equals(QS)) {
                 planlist.add(pl);
-            }else  if (id.equals(FD)) {
+            } else if (id.equals(FD)) {
                 if (pl.getWindpower().endsWith("FDC")) {
                     planlist.add(pl);
                 }
-            }else  if (id.equals(GF)) {
+            } else if (id.equals(GF)) {
                 if (pl.getWindpower().endsWith("GDC")) {
                     planlist.add(pl);
                 }
-            }else  if (InitialRunner.wpmap.containsKey(id)) {
+            } else if (InitialRunner.wpmap.containsKey(id)) {
                 if (pl.getWindpower().equals(id)) {
                     planlist.add(pl);
                 }
-            }else  if (InitialRunner.pjmap.containsKey(id)) {
+            } else if (InitialRunner.pjmap.containsKey(id)) {
                 if (pl.getProjectid().equals(id)) {
                     planlist.add(pl);
                 }
-            }else  if (InitialRunner.lnmap.containsKey(id)) {
-                Line ln=InitialRunner.lnmap.get(id);
+            } else if (InitialRunner.lnmap.containsKey(id)) {
+                Line ln = InitialRunner.lnmap.get(id);
 
                 if (InitialRunner.lnsmap.containsKey(ln.getProjectid())) {
                     List<Line> linels = InitialRunner.lnsmap.get(ln.getProjectid());
@@ -911,8 +1138,109 @@ public class GenreSetPushService {
     }
 
 
+    public Map<String, Double> tooltipAjax(String wpId) throws Exception {
+        Map<String, Double> retValue = new HashMap<String, Double>();
+        if (InitialRunner.wpmap.containsKey(wpId)) {
+            Windpowerstation station = InitialRunner.wpmap.get(wpId);
+            retValue.put("jd", station.getLongitude() == null ? 0 : StringUtils.round(station.getLongitude(), 2));
+            retValue.put("wd", station.getLatitude() == null ? 0 : StringUtils.round(station.getLatitude(), 2));
+
+            retValue.put("zjts", StringUtils.round(station.getQuantity(), 0));
+            Map<String, WindPowerStationTestingPoint2> map;
+
+
+            WindPowerStationTestingPoint2 yxts = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(wpId, Constant.TPOINT_WT_YXTS);
+            WindPowerStationTestingPoint2 djts = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(wpId, Constant.TPOINT_WT_DJTS);
+            WindPowerStationTestingPoint2 jxts = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(wpId, Constant.TPOINT_WT_WHTJ);
+            WindPowerStationTestingPoint2 tjts = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(wpId, Constant.TPOINT_WT_GZTJ);
+            WindPowerStationTestingPoint2 lxts = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(wpId, Constant.TPOINT_WT_TXZD);
+
+            PointData ptValue = realApiUtil.getRealData(yxts);
+            retValue.put("yxts", StringUtils.round(ptValue.getPointValueInDouble(), 0));
 
+            ptValue = realApiUtil.getRealData(djts);
+            retValue.put("djts", StringUtils.round(ptValue.getPointValueInDouble(), 0));
 
+            ptValue = realApiUtil.getRealData(jxts);
+            retValue.put("jxts", StringUtils.round(ptValue.getPointValueInDouble(), 0));
+
+            ptValue = realApiUtil.getRealData(tjts);
+            retValue.put("tjts", StringUtils.round(ptValue.getPointValueInDouble(), 0));
+
+            ptValue = realApiUtil.getRealData(lxts);
+            retValue.put("lxts", StringUtils.round(ptValue.getPointValueInDouble(), 0));
+
+            if (wpId.endsWith("GDC")) {
+                WindPowerStationTestingPoint2 wd = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(wpId, Constant.TPOINT_WP_FCCFTWD);
+
+                if (StringUtils.notEmp(wd)) {
+                    ptValue = realApiUtil.getRealData(wd);
+                    retValue.put("cftwd", StringUtils.round(ptValue.getPointValueInDouble(), 2));
+                } else {
+                    retValue.put("cftwd", 0.0);
+                }
+
+            }
+
+            if (wpId.equals(WpEnum.MHS_FDC.name())) {
+                ptValue = realApiUtil.getRealData(ConstantTR.MHSFGL_AI000305);
+                retValue.put("dqwd", StringUtils.round(ptValue.getPointValueInDouble(), 0));
+                retValue.put("hb", 1893.0);
+                ptValue = realApiUtil.getRealData(ConstantTR.JSFW_MHSSFS);
+                retValue.put("ssfs", StringUtils.round(ptValue.getPointValueInDouble(), 0));
+            } else if (wpId.equals(WpEnum.NSS_FDC.name())) {
+                ptValue = realApiUtil.getRealData(ConstantTR.NSSWD);
+                retValue.put("dqwd", StringUtils.round(ptValue.getPointValueInDouble(), 0));
+                retValue.put("hb", 1810.0);
+                ptValue = realApiUtil.getRealData(ConstantTR.NSSPJFS);
+                retValue.put("ssfs", StringUtils.round(ptValue.getPointValueInDouble(), 0));
+            } else if (wpId.equals(WpEnum.QS_FDC.name())) {
+                ptValue = realApiUtil.getRealData(ConstantTR.QSWD);
+                retValue.put("dqwd", StringUtils.round(ptValue.getPointValueInDouble(), 0));
+                retValue.put("hb", 1573.0);
+                ptValue = realApiUtil.getRealData(ConstantTR.QSPJFS);
+                retValue.put("ssfs", StringUtils.round(ptValue.getPointValueInDouble(), 0));
+
+            } else if (wpId.equals(WpEnum.SBQ_FDC.name())) {
+                ptValue = realApiUtil.getRealData(ConstantTR.SBQFGL_AI000305);
+                retValue.put("dqwd", StringUtils.round(ptValue.getPointValueInDouble(), 0));
+                retValue.put("hb", 1357.0);
+                ptValue = realApiUtil.getRealData(ConstantTR.JSFW_SBSSFS);
+                retValue.put("ssfs", StringUtils.round(ptValue.getPointValueInDouble(), 0));
+            } else if (wpId.equals(WpEnum.DWK_GDC.name())) {
+                ptValue = realApiUtil.getRealData(ConstantTR.DWKWD);
+                retValue.put("dqwd", StringUtils.round(ptValue.getPointValueInDouble(), 0));
+                retValue.put("hb", 1100.0);
+                ptValue = realApiUtil.getRealData(ConstantTR.DWKPJFS);
+                retValue.put("ssfs", StringUtils.round(ptValue.getPointValueInDouble(), 0));
+            } else if (wpId.equals(WpEnum.PL_GDC.name())) {
+                ptValue = realApiUtil.getRealData(ConstantTR.PLWD);
+                retValue.put("dqwd", StringUtils.round(ptValue.getPointValueInDouble(), 0));
+                retValue.put("hb", 1080.0);
+                ptValue = realApiUtil.getRealData(ConstantTR.PLPJFS);
+                retValue.put("ssfs", StringUtils.round(ptValue.getPointValueInDouble(), 0));
+            } else if (wpId.equals(WpEnum.MCH_GDC.name())) {
+                ptValue = realApiUtil.getRealData(ConstantTR.MCHWD);
+                retValue.put("dqwd", StringUtils.round(ptValue.getPointValueInDouble(), 0));
+                retValue.put("hb", 1360.0);
+                ptValue = realApiUtil.getRealData(ConstantTR.MCHPJFS);
+                retValue.put("ssfs", StringUtils.round(ptValue.getPointValueInDouble(), 0));
+            } else if (wpId.equals(WpEnum.XH_GDC.name())) {
+                ptValue = realApiUtil.getRealData(ConstantTR.XHWD);
+                retValue.put("dqwd", StringUtils.round(ptValue.getPointValueInDouble(), 0));
+                retValue.put("hb", 1385.0);
+                ptValue = realApiUtil.getRealData(ConstantTR.XHPJFS);
+                retValue.put("ssfs", StringUtils.round(ptValue.getPointValueInDouble(), 0));
+            } else if (wpId.equals(WpEnum.XS_FDC.name())) {
+                ptValue = realApiUtil.getRealData(ConstantTR.XSWD);
+                retValue.put("dqwd", StringUtils.round(ptValue.getPointValueInDouble(), 0));
+                retValue.put("hb", 2210.0);
+                ptValue = realApiUtil.getRealData(ConstantTR.XSPJFS);
+                retValue.put("ssfs", StringUtils.round(ptValue.getPointValueInDouble(), 0));
+            }
+        }
+        return retValue;
+    }
 
 
 }

+ 3 - 3
src/main/java/com/gyee/frame/service/websocket/WpInfoPushService.java

@@ -43,7 +43,7 @@ public class WpInfoPushService {
     @Resource
     private WpMttrAndMtbMonthService wpMttrAndMtbMonthService;
     IRealTimeDataBaseUtil realApiUtil = new EdosUtil();
-
+    private final double YCFDLXS = 1.08;
     String[] ycPoints1 = Constant.TPOINT_WP_FGLYC.split(",");
 
     public Map<String, Object> genreSetMap() throws Exception {
@@ -1819,7 +1819,7 @@ public class WpInfoPushService {
                 //日发电量
                 Double rfdl = MathUtil.twoBit(rfdlls.get(i).getPointValueInDouble());
                 //日预测发电量
-                Double ycrfdl = MathUtil.twoBit(rfdl * 1.06);
+                Double ycrfdl = MathUtil.twoBit(rfdl * YCFDLXS);
                 vo.setValue1(rfdl);
                 vo.setValue2(ycrfdl);
                 vos.add(vo);
@@ -1872,7 +1872,7 @@ public class WpInfoPushService {
             //日发电量
             Double rfdl = MathUtil.twoBit(currentfdlarr[0].DValue);
             //日预测发电量
-            Double ycrfdl = MathUtil.twoBit(rfdl * 1.06);
+            Double ycrfdl = MathUtil.twoBit(rfdl * YCFDLXS);
 
             vo.setValue1(rfdl);// 日发电量
             vo.setValue2(ycrfdl);// 日预测发电量

+ 5 - 1
src/main/java/com/gyee/frame/service/websocket/WtInfoPushService.java

@@ -657,8 +657,12 @@ public class WtInfoPushService {
 
 
  /**************************************************************基础指标***********************************************************************************/
-                } else {
+                }
 
+                if(InitialRunner.mlmap.containsKey(wt.getModelid()))
+                {
+                    Equipmentmodel model=InitialRunner.mlmap.get(wt.getModelid());
+                    jcmap.put("zjrl",model.getPowerproduction());
                 }
 
                 map.put("jczbmap", jczbmap);

+ 1 - 3
src/main/resources/mybatis-generator.xml

@@ -108,9 +108,7 @@
 
 
 
-        <table tableName='WtMttrAndMtbfDay' domainObjectName='WtMttrAndMtbfDay'/>
-        <table tableName='WtMttrAndMtbfMonth' domainObjectName='WtMttrAndMtbfMonth'/>
-        <table tableName='WtMttrAndMtbfYear' domainObjectName='WtMttrAndMtbfYear'/>
+        <table tableName='Statejudgmentrecord2' domainObjectName='Statejudgmentrecord2'/>
 
     </context>
 </generatorConfiguration>

+ 13 - 0
src/main/resources/mybatis/auto/ShutdowneventMapper.xml

@@ -497,4 +497,17 @@
       warningRecordsId = #{warningrecordsid,jdbcType=INTEGER}
     where id = #{id,jdbcType=VARCHAR}
   </update>
+
+  <select id="countStopByWp"  resultType="com.gyee.frame.model.custom.SimpleVo">
+    select t.windpowerstationid id,count(*) value from shutdownevent t
+    where  instr(t.windpowerstationid,'_FDC')>0 and t.statuscode=2
+    and t.stoptime >= (select max(stoptime)-7 from shutdownevent)
+    and t.stoptime  &lt;= (select max(stoptime) from shutdownevent)  group by t.windpowerstationid
+  </select>
+
+  <select id="countStopByPj"  resultType="com.gyee.frame.model.custom.SimpleVo">
+    select t1.projectid  id,count(*) value from shutdownevent t,windturbine t1 where  instr(t.windpowerstationid,'_FDC')>0  and t.statuscode=2
+    and t.stoptime >= (select max(stoptime)-7 from shutdownevent)
+    and t.stoptime &lt;= (select max(stoptime) from shutdownevent) and t.windturbineid = t1.id group by t1.projectid  order by t1.projectid
+  </select>
 </mapper>

+ 365 - 0
src/main/resources/mybatis/auto/Statejudgmentrecord2Mapper.xml

@@ -0,0 +1,365 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.gyee.frame.mapper.auto.Statejudgmentrecord2Mapper">
+  <resultMap id="BaseResultMap" type="com.gyee.frame.model.auto.Statejudgmentrecord2">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    <id column="ID" jdbcType="DECIMAL" property="id" />
+    <result column="WPID" jdbcType="VARCHAR" property="wpid" />
+    <result column="WTID" jdbcType="VARCHAR" property="wtid" />
+    <result column="STATEJUDGMENT" jdbcType="VARCHAR" property="statejudgment" />
+    <result column="RECODEDATE" jdbcType="TIMESTAMP" property="recodedate" />
+    <result column="SCORE" jdbcType="DECIMAL" property="score" />
+    <result column="FORMULA" jdbcType="VARCHAR" property="formula" />
+    <result column="PART1" jdbcType="VARCHAR" property="part1" />
+    <result column="PART2" jdbcType="VARCHAR" property="part2" />
+    <result column="PART3" jdbcType="VARCHAR" property="part3" />
+    <result column="MARK" jdbcType="VARCHAR" property="mark" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    ID, WPID, WTID, STATEJUDGMENT, RECODEDATE, SCORE, FORMULA, PART1, PART2, PART3, MARK
+  </sql>
+  <select id="selectByExample" parameterType="com.gyee.frame.model.auto.Statejudgmentrecord2Example" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from STATEJUDGMENTRECORD2
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from STATEJUDGMENTRECORD2
+    where ID = #{id,jdbcType=DECIMAL}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    delete from STATEJUDGMENTRECORD2
+    where ID = #{id,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.gyee.frame.model.auto.Statejudgmentrecord2Example">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    delete from STATEJUDGMENTRECORD2
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.gyee.frame.model.auto.Statejudgmentrecord2">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    insert into STATEJUDGMENTRECORD2 (ID, WPID, WTID, 
+      STATEJUDGMENT, RECODEDATE, SCORE, 
+      FORMULA, PART1, PART2, 
+      PART3, MARK)
+    values (#{id,jdbcType=DECIMAL}, #{wpid,jdbcType=VARCHAR}, #{wtid,jdbcType=VARCHAR}, 
+      #{statejudgment,jdbcType=VARCHAR}, #{recodedate,jdbcType=TIMESTAMP}, #{score,jdbcType=DECIMAL}, 
+      #{formula,jdbcType=VARCHAR}, #{part1,jdbcType=VARCHAR}, #{part2,jdbcType=VARCHAR}, 
+      #{part3,jdbcType=VARCHAR}, #{mark,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.gyee.frame.model.auto.Statejudgmentrecord2">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    insert into STATEJUDGMENTRECORD2
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        ID,
+      </if>
+      <if test="wpid != null">
+        WPID,
+      </if>
+      <if test="wtid != null">
+        WTID,
+      </if>
+      <if test="statejudgment != null">
+        STATEJUDGMENT,
+      </if>
+      <if test="recodedate != null">
+        RECODEDATE,
+      </if>
+      <if test="score != null">
+        SCORE,
+      </if>
+      <if test="formula != null">
+        FORMULA,
+      </if>
+      <if test="part1 != null">
+        PART1,
+      </if>
+      <if test="part2 != null">
+        PART2,
+      </if>
+      <if test="part3 != null">
+        PART3,
+      </if>
+      <if test="mark != null">
+        MARK,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=DECIMAL},
+      </if>
+      <if test="wpid != null">
+        #{wpid,jdbcType=VARCHAR},
+      </if>
+      <if test="wtid != null">
+        #{wtid,jdbcType=VARCHAR},
+      </if>
+      <if test="statejudgment != null">
+        #{statejudgment,jdbcType=VARCHAR},
+      </if>
+      <if test="recodedate != null">
+        #{recodedate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="score != null">
+        #{score,jdbcType=DECIMAL},
+      </if>
+      <if test="formula != null">
+        #{formula,jdbcType=VARCHAR},
+      </if>
+      <if test="part1 != null">
+        #{part1,jdbcType=VARCHAR},
+      </if>
+      <if test="part2 != null">
+        #{part2,jdbcType=VARCHAR},
+      </if>
+      <if test="part3 != null">
+        #{part3,jdbcType=VARCHAR},
+      </if>
+      <if test="mark != null">
+        #{mark,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.gyee.frame.model.auto.Statejudgmentrecord2Example" resultType="java.lang.Long">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    select count(*) from STATEJUDGMENTRECORD2
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    update STATEJUDGMENTRECORD2
+    <set>
+      <if test="record.id != null">
+        ID = #{record.id,jdbcType=DECIMAL},
+      </if>
+      <if test="record.wpid != null">
+        WPID = #{record.wpid,jdbcType=VARCHAR},
+      </if>
+      <if test="record.wtid != null">
+        WTID = #{record.wtid,jdbcType=VARCHAR},
+      </if>
+      <if test="record.statejudgment != null">
+        STATEJUDGMENT = #{record.statejudgment,jdbcType=VARCHAR},
+      </if>
+      <if test="record.recodedate != null">
+        RECODEDATE = #{record.recodedate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.score != null">
+        SCORE = #{record.score,jdbcType=DECIMAL},
+      </if>
+      <if test="record.formula != null">
+        FORMULA = #{record.formula,jdbcType=VARCHAR},
+      </if>
+      <if test="record.part1 != null">
+        PART1 = #{record.part1,jdbcType=VARCHAR},
+      </if>
+      <if test="record.part2 != null">
+        PART2 = #{record.part2,jdbcType=VARCHAR},
+      </if>
+      <if test="record.part3 != null">
+        PART3 = #{record.part3,jdbcType=VARCHAR},
+      </if>
+      <if test="record.mark != null">
+        MARK = #{record.mark,jdbcType=VARCHAR},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    update STATEJUDGMENTRECORD2
+    set ID = #{record.id,jdbcType=DECIMAL},
+      WPID = #{record.wpid,jdbcType=VARCHAR},
+      WTID = #{record.wtid,jdbcType=VARCHAR},
+      STATEJUDGMENT = #{record.statejudgment,jdbcType=VARCHAR},
+      RECODEDATE = #{record.recodedate,jdbcType=TIMESTAMP},
+      SCORE = #{record.score,jdbcType=DECIMAL},
+      FORMULA = #{record.formula,jdbcType=VARCHAR},
+      PART1 = #{record.part1,jdbcType=VARCHAR},
+      PART2 = #{record.part2,jdbcType=VARCHAR},
+      PART3 = #{record.part3,jdbcType=VARCHAR},
+      MARK = #{record.mark,jdbcType=VARCHAR}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.gyee.frame.model.auto.Statejudgmentrecord2">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    update STATEJUDGMENTRECORD2
+    <set>
+      <if test="wpid != null">
+        WPID = #{wpid,jdbcType=VARCHAR},
+      </if>
+      <if test="wtid != null">
+        WTID = #{wtid,jdbcType=VARCHAR},
+      </if>
+      <if test="statejudgment != null">
+        STATEJUDGMENT = #{statejudgment,jdbcType=VARCHAR},
+      </if>
+      <if test="recodedate != null">
+        RECODEDATE = #{recodedate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="score != null">
+        SCORE = #{score,jdbcType=DECIMAL},
+      </if>
+      <if test="formula != null">
+        FORMULA = #{formula,jdbcType=VARCHAR},
+      </if>
+      <if test="part1 != null">
+        PART1 = #{part1,jdbcType=VARCHAR},
+      </if>
+      <if test="part2 != null">
+        PART2 = #{part2,jdbcType=VARCHAR},
+      </if>
+      <if test="part3 != null">
+        PART3 = #{part3,jdbcType=VARCHAR},
+      </if>
+      <if test="mark != null">
+        MARK = #{mark,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where ID = #{id,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.gyee.frame.model.auto.Statejudgmentrecord2">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    update STATEJUDGMENTRECORD2
+    set WPID = #{wpid,jdbcType=VARCHAR},
+      WTID = #{wtid,jdbcType=VARCHAR},
+      STATEJUDGMENT = #{statejudgment,jdbcType=VARCHAR},
+      RECODEDATE = #{recodedate,jdbcType=TIMESTAMP},
+      SCORE = #{score,jdbcType=DECIMAL},
+      FORMULA = #{formula,jdbcType=VARCHAR},
+      PART1 = #{part1,jdbcType=VARCHAR},
+      PART2 = #{part2,jdbcType=VARCHAR},
+      PART3 = #{part3,jdbcType=VARCHAR},
+      MARK = #{mark,jdbcType=VARCHAR}
+    where ID = #{id,jdbcType=DECIMAL}
+  </update>
+</mapper>

+ 15 - 0
src/main/resources/mybatis/auto/WarningRecordsMapper.xml

@@ -395,4 +395,19 @@
       isFilter = #{isfilter,jdbcType=SMALLINT}
     where id = #{id,jdbcType=INTEGER}
   </update>
+
+  <select id="countWpwarnByWp"  resultType="com.gyee.frame.model.custom.SimpleVo">
+
+    select t.windpowerstationid id,count(*) value from warningrecords t
+    where  instr(t.windpowerstationid,'_FDC')>0
+    and t.warningtime >= (select max(warningtime)-7 from warningrecords)
+    and t.warningtime &lt;= (select max(warningtime) from warningrecords)  group by t.windpowerstationid
+  </select>
+
+  <select id="countWpwarnByPj"  resultType="com.gyee.frame.model.custom.SimpleVo">
+select t1.projectid  id,count(*) value from warningrecords t,windturbine t1 where  instr(t.windpowerstationid,'_FDC')>0
+    and t.warningtime >= (select max(warningtime)-7 from warningrecords)
+    and t.warningtime &lt;= (select max(warningtime) from warningrecords) and t.windturbineid = t1.id group by t1.projectid  order by t1.projectid
+
+  </select>
 </mapper>

+ 5 - 5
src/test/java/test/GenreSetPushTest.java

@@ -3,15 +3,14 @@ package test;
 import com.gyee.SpringbootStart;
 import com.gyee.frame.common.spring.SpringUtils;
 import com.gyee.frame.controller.monitor.GenreSetPushController;
-import lombok.SneakyThrows;
 import org.springframework.boot.SpringApplication;
 
 import java.util.Map;
 
 public class GenreSetPushTest {
 
-    @SneakyThrows
-    public static void main(String[] args) {
+
+    public static void main(String[] args) throws Exception {
 
         SpringApplication.run(SpringbootStart.class, args);
 
@@ -28,8 +27,9 @@ public class GenreSetPushTest {
 
 
 
-        Map<String, Object> map =genreSetPushController.findBasicDataInfo("MHS_FDC");
-
+        Map<String, Object> map =genreSetPushController.findDayInfo("0","rfdl");
+//        Map<String, Object> map1 =genreSetPushController.findBasicDataInfo("-2");
+//        Map<String, Object> map2 =genreSetPushController.findBasicDataInfo("MHS_FDC");
 //        Map<String, Object> map = new HashMap<>();
 //
 //

+ 101 - 0
src/test/java/test/HealthOperationTest.java

@@ -0,0 +1,101 @@
+package test;
+
+import com.gyee.SpringbootStart;
+import com.gyee.frame.common.spring.SpringUtils;
+import com.gyee.frame.controller.health.HealthOperationController;
+import lombok.SneakyThrows;
+import org.springframework.boot.SpringApplication;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Map;
+
+public class HealthOperationTest {
+
+    @SneakyThrows
+    public static void main(String[] args) {
+
+        SpringApplication.run(SpringbootStart.class, args);
+
+
+        Calendar c = Calendar.getInstance();
+
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        c.set(Calendar.MILLISECOND, 0);
+        c.set(Calendar.DAY_OF_MONTH,24);
+        c.set(Calendar.MONTH,2);
+        c.set(Calendar.YEAR,2021);
+
+        Date date = c.getTime();
+
+        String wtid="MG01_01";
+        HealthOperationController healthOperationController= SpringUtils.getBean("healthOperationController");
+
+
+//        Map<String, Object> map =healthOperationController.countStop("1");
+//        Map<String, Object> map2 =healthOperationController.countWpwarn("1");
+//        Map<String, Object> map3 =healthOperationController.countWpOrProStatus("1");
+//        Map<String, Object> map4 =healthOperationController.findWpOrProStatusForHistory("1","1");
+//        Map<String, Object> map5 =healthOperationController.findWpOrProStatusForHistory("1","2");
+//        System.out.println(map);
+
+
+        Map<String, Object> map =healthOperationController.countStop("2");
+        Map<String, Object> map2 =healthOperationController.countWpwarn("2");
+        Map<String, Object> map3 =healthOperationController.countWpOrProStatus("2");
+        Map<String, Object> map4 =healthOperationController.findWpOrProStatusForHistory("2","1");
+        Map<String, Object> map5 =healthOperationController.findWpOrProStatusForHistory("2","2");
+        System.out.println(map);
+//
+//        Map<String, Object> map =healthMainController.findWpMap("MHS_FDC");
+
+//        Map<String, Object> map =healthMainController.findHealthMatrixMap();
+//
+//        System.out.println(map);
+//
+//
+//        Map<String, Object> map =healthMainController.findWpMap("MHS_FDC");
+//
+//
+//        System.out.println(map);
+//
+//        Map<String, Object> map =healthMainController.findHealthMatrixMap();
+//
+//
+//        System.out.println(map);
+//
+//
+//        Map<String, Object> map =healthSubController.findPartHealthInfo(wtid);
+//
+//
+//        System.out.println(map);
+
+
+
+//        Map<String, Object> map1 =healthSubController.initalGzjfx(wtid);
+//        Map<String, Object> map2 =healthSubController.initalYjfx(wtid);
+//        Map<String, Object> map3 =healthSubController.initalYxfx(wtid);
+//        Map<String, Object> map4 =healthSubController.initalXnfx(wtid);
+//        Map<String, Object> map5 =healthSubController.initalShutdown(wtid);
+//        Map<String, Object> map6 =healthSubController.findJudgmentList(wtid);
+//        Map<String, Object> map7 =healthSubController.findQxpcList(wtid);
+//        Map<String, Object> map8 =healthSubController.findWdList(wtid);
+//
+//        Map<String, Object> map1 =healthSubController.gadaytop5(wtid);
+//        Map<String, Object> map2 =healthSubController.queryStopTop10(wtid);
+//        System.out.println(map1.size());
+
+
+//        Map<String, Object> map1 =healthSubController.hsFjValueIndex(wtid);
+//        System.out.println(map1.size());
+        System.out.println("***************************************************************************************");
+
+
+    }
+
+
+
+
+}

+ 6 - 5
src/test/java/test/HealthTest.java

@@ -2,6 +2,7 @@ package test;
 
 import com.gyee.SpringbootStart;
 import com.gyee.frame.common.spring.SpringUtils;
+import com.gyee.frame.controller.health.HealthMainController;
 import com.gyee.frame.controller.health.HealthSubController;
 import lombok.SneakyThrows;
 import org.springframework.boot.SpringApplication;
@@ -31,8 +32,7 @@ public class HealthTest {
         Date date = c.getTime();
 
         String wtid="MG01_01";
-
- //       HealthMainController healthMainController= SpringUtils.getBean("healthMainController");
+        HealthMainController healthMainController= SpringUtils.getBean("healthMainController");
 
         HealthSubController healthSubController= SpringUtils.getBean("healthSubController");
 //        Map<String, Object> map =healthMainController.findAllChart("0","12","1");
@@ -40,8 +40,9 @@ public class HealthTest {
 //
 //        System.out.println(map);
 //
-//        Map<String, Object> map =healthMainController.findAllMap();
-//
+//        Map<String, Object> map =healthMainController.findWpMap("MHS_FDC");
+
+//        Map<String, Object> map =healthMainController.findHealthMatrixMap();
 //
 //        System.out.println(map);
 //
@@ -78,7 +79,7 @@ public class HealthTest {
 //        System.out.println(map1.size());
 
 
-        Map<String, Object> map1 =healthSubController.hsFjValueIndex(wtid);
+        Map<String, Object> map1 =healthSubController.findWtHealthInfo(wtid);
         System.out.println(map1.size());
         System.out.println("***************************************************************************************");
 

+ 8 - 3
src/test/java/test/ShutdowneventServiceTest.java

@@ -4,13 +4,13 @@ import com.gyee.SpringbootStart;
 import com.gyee.frame.common.spring.InitialRunner;
 import com.gyee.frame.common.spring.SpringUtils;
 import com.gyee.frame.model.auto.Windturbine;
+import com.gyee.frame.model.custom.SimpleVo;
 import com.gyee.frame.service.ShutdowneventService;
 import lombok.SneakyThrows;
 import org.springframework.boot.SpringApplication;
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
 
 public class ShutdowneventServiceTest {
 
@@ -37,10 +37,15 @@ public class ShutdowneventServiceTest {
         {
             wtids.add(wt.getId());
         }
-        Map<String,Object> map = shutdowneventService.queryMttrAndMtbf(wtids);
+//        Map<String,Object> map = shutdowneventService.queryMttrAndMtbf(wtids);
+//
+//
+//        System.out.println(map.size());
 
+        List<SimpleVo> ls = shutdowneventService.countStopByWp();
+        List<SimpleVo> ls1 = shutdowneventService.countStopByPj();
 
-        System.out.println(map.size());
+        System.out.println(ls.size());
 
 //        AjaxResult ar = singleAnalysisController.singleanalysisSub(wtId,year,month);
 //

+ 9 - 3
src/test/java/test/WarningRecordsServiceTest.java

@@ -2,12 +2,14 @@ package test;
 
 import com.gyee.SpringbootStart;
 import com.gyee.frame.common.spring.SpringUtils;
-import com.gyee.frame.model.auto.WarningRecords;
+import com.gyee.frame.model.custom.SimpleVo;
 import com.gyee.frame.model.custom.Tablepar;
 import com.gyee.frame.service.WarningRecordsService;
 import lombok.SneakyThrows;
 import org.springframework.boot.SpringApplication;
 
+import java.util.List;
+
 public class WarningRecordsServiceTest {
 
     @SneakyThrows
@@ -32,10 +34,14 @@ public class WarningRecordsServiceTest {
 
 
 
-        WarningRecords wtd = warningRecordsService.getWarningRecords(wtId);
+//        WarningRecords wtd = warningRecordsService.getWarningRecords(wtId);
+//
+//        System.out.println(wtd.getWarningid());
+
+        List<SimpleVo> ls = warningRecordsService.countWpwarnByWp();
 
-        System.out.println(wtd.getWarningid());
 
+        System.out.println(ls.size());
 
     }
 }

TEMPAT SAMPAH
target.7z