Browse Source

修改报警后台接口

shilin 2 years ago
parent
commit
08dd6ca63d

+ 2 - 2
web/health-hb/src/main/java/com/gyee/frame/common/spring/InitialRunner.java

@@ -237,8 +237,8 @@ public class InitialRunner implements CommandLineRunner {
         ProjectExample projectExample = new ProjectExample();
         projectExample.setOrderByClause("ordernum ASC");
 
-        projectExample.createCriteria().andWindpowerstationidEqualTo("FS_FDC");
-//        projectExample.createCriteria().andWindpowerstationidNotLike("%SY_FDC%");
+       projectExample.createCriteria().andWindpowerstationidEqualTo("FS_FDC");
+
         pjallls = projectService.selectByExample(projectExample);
 
         if (!pjallls.isEmpty()) {

+ 61 - 58
web/health-hb/src/main/java/com/gyee/frame/service/health/HealthMainService.java

@@ -337,55 +337,55 @@ public class HealthMainService {
                 int lsl = 0;// 良数量
                 int csl = 0;// 差数量
                 double jkd = 0.0;
-//                List<Weatherfh> wfhls = weatherfhService.findWeatherfh(beginDate, endDate, wp.getId());
-//                if (!wfhls.isEmpty()) {
-//
-//                    Weatherfh wth = wfhls.get(wfhls.size() - 1);
-//
-//                    String temp = wth.getWeather();
-//                    if (StringUtils.notEmp(temp)) {
-//                        String strtemp = temp.substring(temp.length() - 6, temp.length() - 4);
-//                        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;
-//                    }
-//
-//
-//
-//                    ycfs = wth.getSpeed();
-//
-//                    ycfs = new BigDecimal(ycfs).multiply(new BigDecimal(XZNUM)).divide(new BigDecimal(NUM), 2, RoundingMode.HALF_EVEN).doubleValue();
-//                    wpmap.put("ycfs", ycfs);
-//                    wpmap.put("tqyb", tqyb);
-//
-//                } else {
-//                    wpmap.put("ycfs", 6.0);
-//                    wpmap.put("tqyb", 1.0);
-//                }
+                List<Weatherfh> wfhls = weatherfhService.findWeatherfh(beginDate, endDate, wp.getId());
+                if (!wfhls.isEmpty()) {
 
-//                Map<String,Object> weathermap=weatherService.getWeatherRealInfo(wp.getId());
-//                if(null!=weathermap && !weathermap.isEmpty())
-//                {
-//                    if(weathermap.containsKey("tqtp"))
-//                    {
-//                        wpmap.put("tqyb", Double.valueOf(String.valueOf(weathermap.get("tqtp"))));
-//                    }
-//                    if(weathermap.containsKey("fs"))
-//                    {
-//                        wpmap.put("ycfs", weathermap.get("fs"));
-//                    }
-//                }
+                    Weatherfh wth = wfhls.get(wfhls.size() - 1);
+
+                    String temp = wth.getWeather();
+                    if (StringUtils.notEmp(temp)) {
+                        String strtemp = temp.substring(temp.length() - 6, temp.length() - 4);
+                        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;
+                    }
+
+
+
+                    ycfs = wth.getSpeed();
+
+                    ycfs = new BigDecimal(ycfs).multiply(new BigDecimal(XZNUM)).divide(new BigDecimal(NUM), 2, RoundingMode.HALF_EVEN).doubleValue();
+                    wpmap.put("ycfs", ycfs);
+                    wpmap.put("tqyb", tqyb);
+
+                } else {
+                    wpmap.put("ycfs", 6.0);
+                    wpmap.put("tqyb", 1.0);
+                }
+
+                Map<String,Object> weathermap=weatherService.getWeatherRealInfo(wp.getId());
+                if(null!=weathermap && !weathermap.isEmpty())
+                {
+                    if(weathermap.containsKey("tqtp"))
+                    {
+                        wpmap.put("tqyb", Double.valueOf(String.valueOf(weathermap.get("tqtp"))));
+                    }
+                    if(weathermap.containsKey("fs"))
+                    {
+                        wpmap.put("ycfs", weathermap.get("fs"));
+                    }
+                }
                 // 获得实时风速测点编号
 
                 Windpowerstationpointnew point = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(wp.getId(), Constant.TPOINT_WP_SSFS);
@@ -477,11 +477,12 @@ public class HealthMainService {
                                 stoptypemap.put("windTurbineId", vo.getWindTurbineId());
                                 stoptypemap.put("stopTime", DateUtils.formatDateTime(vo.getStopTime()));
 
-                                if (StringUtils.notEmp(vo.getWarningId()) && InitialRunner.warningmap.containsKey(vo.getWarningId())) {
-                                    stoptypemap.put("warningId", InitialRunner.warningmap.get(vo.getWarningId()).getChinesetext());
-                                } else {
-                                    stoptypemap.put("warningId", " ");
-                                }
+//                                stoptypemap.put("warningId", vo.getWarnDesc());
+//                                if (StringUtils.notEmp(vo.getWarningId()) && InitialRunner.warningmap.containsKey(vo.getWarningId())) {
+//                                    stoptypemap.put("warningId", InitialRunner.warningmap.get(vo.getWarningId()).getChinesetext());
+//                                } else {
+//                                    stoptypemap.put("warningId", " ");
+//                                }
                                 stoptypels.add(stoptypemap);
                             }
                         }
@@ -821,11 +822,13 @@ public class HealthMainService {
                                 stoptypemap.put("windTurbineId", vo.getWindTurbineId());
                                 stoptypemap.put("stopTime", DateUtils.formatDateTime(vo.getStopTime()));
 
-                                if (StringUtils.notEmp(vo.getWarningId()) && InitialRunner.warningmap.containsKey(vo.getWarningId())) {
-                                    stoptypemap.put("warningId", InitialRunner.warningmap.get(vo.getWarningId()).getChinesetext());
-                                } else {
-                                    stoptypemap.put("warningId", " ");
-                                }
+//                                if (StringUtils.notEmp(vo.getWarningId()) && InitialRunner.warningmap.containsKey(vo.getWarningId())) {
+//                                    stoptypemap.put("warningId", InitialRunner.warningmap.get(vo.getWarningId()).getChinesetext());
+//                                } else {
+//                                    stoptypemap.put("warningId", " ");
+//                                }
+
+                                stoptypemap.put("warningId", vo.getWarnDesc());
                                 gzls.add(stoptypemap);
                             }
                         }

+ 33 - 0
web/health-hb/src/main/java/com/gyee/frame/service/health/HealthSubService.java

@@ -887,6 +887,39 @@ public class HealthSubService {
         String[] jcstrs = new String[8];
         String[] bpqstrs = new String[8];
 
+
+        Calendar c = Calendar.getInstance();
+        int days=c.get(Calendar.DAY_OF_YEAR);
+        double yearhours=24*days;
+
+
+        clxstrs[4] = String.valueOf(yearhours);
+        fdjstrs[4] = String.valueOf(yearhours);
+        bjstrs[4] = String.valueOf(yearhours);
+        zkstrs[4] = String.valueOf(yearhours);
+        zzstrs[4] = String.valueOf(yearhours);
+        phstrs[4] = String.valueOf(yearhours);
+        jcstrs[4] = String.valueOf(yearhours);
+        bpqstrs[4] =String.valueOf(yearhours);
+
+        clxstrs[5] = String.valueOf(0.0);
+        fdjstrs[5] = String.valueOf(0.0);
+        bjstrs[5] = String.valueOf(0.0);
+        zkstrs[5] = String.valueOf(0.0);
+        zzstrs[5] = String.valueOf(0.0);
+        phstrs[5] = String.valueOf(0.0);
+        jcstrs[5] = String.valueOf(0.0);
+        bpqstrs[5] =String.valueOf(0.0);
+
+
+        clxstrs[6] = String.valueOf(0.0);
+        fdjstrs[6] = String.valueOf(0.0);
+        bjstrs[6] = String.valueOf(0.0);
+        zkstrs[6] = String.valueOf(0.0);
+        zzstrs[6] = String.valueOf(0.0);
+        phstrs[6] = String.valueOf(0.0);
+        jcstrs[6] = String.valueOf(0.0);
+        bpqstrs[6] =String.valueOf(0.0);
         // 获得风机健康状态结果数组
         String[] jkpoints = new String[4];
 

+ 1 - 1
web/health-hb/src/main/java/com/gyee/frame/service/weather/WeatherService.java

@@ -74,7 +74,7 @@ public class WeatherService  {
 
                 StringBuilder sb=new StringBuilder();
                 sb.append(V2Config.getWeatherurl()).append("/meteorological/datas?");
-                if(id.equals("0") || id.equals("-1")  || id.equals("-2"))
+                if(id.endsWith("0") || id.endsWith("-1")  || id.endsWith("-2"))
                 {
                     sb.append("&wpid=").append(V2Config.getWeatherqygs());
                 }else {

+ 1 - 1
web/health-hb/src/main/resources/application-hf.yml

@@ -39,7 +39,7 @@ gyee:
   #weatherurl: http://123.60.213.70:7011
   weatherurl: http://10.0.118.73:7011
   #weatherurl: http://10.83.68.97:7011
-  weatherqygs: hb_qygs
+  weatherqygs: ln_qygs
   hbmaps: {CL_FDC_KEY: 2003,KB_FDC_KEY: 1460,DX_FDC_KEY: 2186,SY_FDC_KEY: 1366}
   initialcode: INITIAL
 #tomcat config

+ 1 - 1
web/health-hb/src/main/resources/application.yml

@@ -1,6 +1,6 @@
 spring:
   profiles:
-    active: hb
+    active: hf
 #    active: jn
 
 asyncThreadPool:

+ 1 - 1
web/health-hb/src/main/resources/mybatis/auto/ShutdowneventMapper.xml

@@ -517,7 +517,7 @@
   </select>
 
     <select id="queryEvents"  resultType="com.gyee.frame.model.custom.ShutdowneventVo">
-        select t.id,t.windPowerStationId,t.windTurbineId,t.warningId,w.chinesetext warnDesc,t.stopTime,t.startTime,t.stopHours,t.lossPower,t.statusCode
+        select t.id,t.windPowerStationId,t.windTurbineId,t.warningId,w.chinesetext warnDesc,t.stopTime,t.startTime,t.stopHours,t.lossPower,t.statusCode,t.stopTypeId
         from shutdownevent t ,warning2 w,windturbine b WHERE
         t.warningid=w.ednavalue and t.windturbineid=b.id  and b.modelid=w.modelid
           and t.stopTime>=#{beginDate}