Parcourir la source

健康管理接口开发修正

shilin il y a 3 ans
Parent
commit
91dea9865a

+ 29 - 7
src/main/java/com/gyee/frame/controller/monitor/MonitorPushController.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.DataVo;
 import com.gyee.frame.service.websocket.*;
+import com.gyee.frame.util.StringUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -43,8 +44,11 @@ public class MonitorPushController {
 
         Map<String, Object> map = new HashMap<String, Object>();
 
+        if(StringUtils.notEmp(wpId))
+        {
+            map =cftInfoPushService.findCftInfo(wpId);
+        }
 
-        map =cftInfoPushService.findCftInfo(wpId);
 
         if (null!=map ){
             return AjaxResult.successData(AjaxStatus.success.code, map );
@@ -83,8 +87,11 @@ public class MonitorPushController {
 
         Map<String, Object> map=  new HashMap<>();
 
+        if(StringUtils.notEmp(wpId))
+        {
+            map=wpInfoPushService.findWpInfoBy(wpId);
+        }
 
-        map=wpInfoPushService.findWpInfoBy(wpId);
 
         if (null!=map) {
             return AjaxResult.successData(AjaxStatus.success.code, map);
@@ -104,8 +111,11 @@ public class MonitorPushController {
 
         List<DataVo> vos=  new ArrayList<>();
 
+        if(StringUtils.notEmp(wpId))
+        {
+            vos=wpInfoPushService.findLossWpBar(wpId);
+        }
 
-        vos=wpInfoPushService.findLossWpBar(wpId);
 
         if (null!=vos) {
             return AjaxResult.successData(AjaxStatus.success.code, vos);
@@ -125,8 +135,11 @@ public class MonitorPushController {
 
         List<DataVo> vos=  new ArrayList<>();
 
+        if(StringUtils.notEmp(wpId))
+        {
+            vos=wpInfoPushService.findPowerWpBar(wpId);
+        }
 
-        vos=wpInfoPushService.findPowerWpBar(wpId);
 
         if (null!=vos) {
             return AjaxResult.successData(AjaxStatus.success.code, vos);
@@ -146,8 +159,11 @@ public class MonitorPushController {
 
         List<DataVo> vos=  new ArrayList<>();
 
+        if(StringUtils.notEmp(wpId))
+        {
+            vos=wpInfoPushService.findMonthPowerWpBar(wpId);
+        }
 
-        vos=wpInfoPushService.findMonthPowerWpBar(wpId);
 
         if (null!=vos) {
             return AjaxResult.successData(AjaxStatus.success.code, vos);
@@ -168,8 +184,11 @@ public class MonitorPushController {
 
         Map<String, Object> map=  new HashMap<>();
 
+        if(StringUtils.notEmp(wpId))
+        {
+            map=powerFirstPushService.findPowerFirst(wpId);
+        }
 
-        map=powerFirstPushService.findPowerFirst(wpId);
 
         if (null!=map) {
             return AjaxResult.successData(AjaxStatus.success.code, map);
@@ -189,8 +208,11 @@ public class MonitorPushController {
 
         Map<String, Object> map=  new HashMap<>();
 
+        if(StringUtils.notEmp(wpId))
+        {
+            map=matrixPushByWpService.findGeneralAppearance(wpId);
+        }
 
-        map=matrixPushByWpService.findGeneralAppearance(wpId);
 
         if (null!=map) {
             return AjaxResult.successData(AjaxStatus.success.code, map);

+ 1 - 0
src/main/java/com/gyee/frame/model/auto/Windturbinegoodness.java

@@ -130,6 +130,7 @@ public class Windturbinegoodness implements Serializable {
      */
     private Double yearspeed;
 
+
     /**
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database table windturbinegoodness

+ 9 - 0
src/main/java/com/gyee/frame/model/custom/TemperatureVo.java

@@ -2,6 +2,7 @@ package com.gyee.frame.model.custom;
 
 public class TemperatureVo {
 	private String id;
+	private String wtId;
 	private String name;
 	private Double value;
 	private Double maxValue;
@@ -18,6 +19,14 @@ public class TemperatureVo {
 		this.name = name;
 	}
 
+	public String getWtId() {
+		return wtId;
+	}
+
+	public void setWtId(String wtId) {
+		this.wtId = wtId;
+	}
+
 	public String getColor() {
 		return color;
 	}

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

@@ -138,7 +138,7 @@ public class Brownoutsevent2Service implements BaseService<Brownoutsevent2, Brow
 	}
 
 
-	public PageInfo<Brownoutsevent2> getBrownoutsevent2List(Tablepar tablepar, String wpId, Date beginDate, Date endDate) {
+	public PageInfo<Brownoutsevent2> getBrownoutsevent2List(Tablepar tablepar, String wtId, Date beginDate, Date endDate) {
 
 		Brownoutsevent2Example example = new Brownoutsevent2Example();
 
@@ -167,8 +167,8 @@ public class Brownoutsevent2Service implements BaseService<Brownoutsevent2, Brow
 			criteria.andStoptimeGreaterThanOrEqualTo(beginDate).andStoptimeLessThan(endDate);
 		}
 
-		if (StringUtils.notEmp(wpId)) {
-			criteria.andWindpowerstationidEqualTo(wpId);
+		if (StringUtils.notEmp(wtId)) {
+			criteria.andWindturbineidEqualTo(wtId);
 		}
 
 		List<Brownoutsevent2> list = brownoutsevent2Mapper.selectByExample(example);

+ 1 - 0
src/main/java/com/gyee/frame/service/warn/TemperatureService.java

@@ -73,6 +73,7 @@ public class TemperatureService {
 							vo.setValue(Double.parseDouble(new DecimalFormat("#.000").format(fs.getPointValueInDouble())));
 						}
 
+						vo.setWtId(wb.getId());
 						vo.setName(ai.getName());
 						vo.setMaxValue(ai.getMaxval());
 						vo.setMiValue(ai.getMinval());

+ 22 - 22
src/test/java/test/GoodnessTest.java

@@ -1,17 +1,17 @@
 package test;
 
+import com.github.pagehelper.PageInfo;
 import com.gyee.SpringbootStart;
 import com.gyee.frame.common.domain.AjaxResult;
 import com.gyee.frame.common.spring.SpringUtils;
 import com.gyee.frame.controller.goodness.WindturbineDetailLineChartController;
-import com.gyee.frame.model.custom.EchartDataVo;
+import com.gyee.frame.model.auto.Brownoutsevent2;
 import com.gyee.frame.model.custom.Tablepar;
 import lombok.SneakyThrows;
 import org.springframework.boot.SpringApplication;
 
 import java.util.Calendar;
 import java.util.Date;
-import java.util.List;
 
 public class GoodnessTest {
 
@@ -95,14 +95,14 @@ public class GoodnessTest {
 //            System.out.println(wtd.getWarnDesc()+"----------------"+wtd.getStartTime()+"----------------"+wtd.getStopTime());
 //        }
 //
-//        AjaxResult ajaxResult3 =windturbineDetailLineChartController.xdjllist(tablepar,wtid,"2021-01-01","2021-01-04");
-//
-//        PageInfo<Brownoutsevent2> test3=(PageInfo<Brownoutsevent2>)ajaxResult3.get("data");
-//
-//        for(Brownoutsevent2 wtd:test3.getList())
-//        {
-//            System.out.println(wtd.getLimitload()+"----------------"+wtd.getStoptime()+"----------------"+wtd.getLosspower());
-//        }
+        AjaxResult ajaxResult3 =windturbineDetailLineChartController.xdjllist(tablepar,"MG01_07","2021-07-10");
+
+        PageInfo<Brownoutsevent2> test3=(PageInfo<Brownoutsevent2>)ajaxResult3.get("data");
+
+        for(Brownoutsevent2 wtd:test3.getList())
+        {
+            System.out.println(wtd.getLimitload()+"----------------"+wtd.getStoptime()+"----------------"+wtd.getLosspower());
+        }
 //
 //
 //
@@ -163,18 +163,18 @@ public class GoodnessTest {
 //
 //
 //        WindturbineDetailLineChartController windturbineDetailLineChartController= SpringUtils.getBean("windturbineDetailLineChartController");
-
-        AjaxResult ajaxResult = windturbineDetailLineChartController.getplotBands(wtid, "2021-01-02");
-
-        List<List<EchartDataVo>> test3 = (List<List<EchartDataVo>>) ajaxResult.get("data");
-
-        for (List<EchartDataVo> ls : test3) {
-            for (EchartDataVo wtd : ls) {
-                System.out.println(wtd.getName() + "----------------" + wtd.getxAxis());
-            }
-
-        }
-        System.out.println("***************************************************************************************");
+//
+//        AjaxResult ajaxResult = windturbineDetailLineChartController.getplotBands(wtid, "2021-01-02");
+//
+//        List<List<EchartDataVo>> test3 = (List<List<EchartDataVo>>) ajaxResult.get("data");
+//
+//        for (List<EchartDataVo> ls : test3) {
+//            for (EchartDataVo wtd : ls) {
+//                System.out.println(wtd.getName() + "----------------" + wtd.getxAxis());
+//            }
+//
+//        }
+//        System.out.println("***************************************************************************************");
 
 //        AjaxResult ajaxResult2 =windturbineDetailLineChartController.plotBandAjax(wtid,"2021-01-02 00:01" ,"2021-01-02 03:22");
 //

+ 49 - 46
src/test/java/test/LeaderboardTest.java

@@ -4,7 +4,9 @@ import com.gyee.SpringbootStart;
 import com.gyee.frame.common.domain.AjaxResult;
 import com.gyee.frame.common.spring.SpringUtils;
 import com.gyee.frame.controller.leaderboard.LeaderboardController;
-import com.gyee.frame.model.custom.StatisticalAnalysisTopVo;
+import com.gyee.frame.model.auto.Curvefittingmain;
+import com.gyee.frame.model.auto.Curvefittingmonthmain;
+import com.gyee.frame.model.custom.DataVo;
 import com.gyee.frame.model.custom.Tablepar;
 import lombok.SneakyThrows;
 import org.springframework.boot.SpringApplication;
@@ -12,6 +14,7 @@ import org.springframework.boot.SpringApplication;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 public class LeaderboardTest {
 
@@ -59,15 +62,15 @@ public class LeaderboardTest {
 
 //        AjaxResult ajaxResult =leaderboardController.loadfactortoplist(tablepar,"-1","MHS_FDC","2021-01-01","2021-01-03");
 //        AjaxResult ajaxResult =leaderboardController.querywarningStatistical(tablepar,"1","2021-01-01","2021-01-03");
-
-        AjaxResult ajaxResult1 =leaderboardController.querywarningStatistical(tablepar,"2","2021-01-01","2021-01-03");
-//        AjaxResult ajaxResult2 =leaderboardController.querywarningStatistical(tablepar,"3","2021-01-01","2021-01-03");
-
-        List<StatisticalAnalysisTopVo> test2=(List<StatisticalAnalysisTopVo>)ajaxResult1.get("data");
-        for(StatisticalAnalysisTopVo wtd:test2)
-        {
-            System.out.println(wtd.getWindfarm()+"----------------"+wtd.getPower()+"----------------"+wtd.getSpeed());
-        }
+//
+//        AjaxResult ajaxResult1 =leaderboardController.querywarningStatistical(tablepar,"2","2021-01-01","2021-01-03");
+////        AjaxResult ajaxResult2 =leaderboardController.querywarningStatistical(tablepar,"3","2021-01-01","2021-01-03");
+//
+//        List<StatisticalAnalysisTopVo> test2=(List<StatisticalAnalysisTopVo>)ajaxResult1.get("data");
+//        for(StatisticalAnalysisTopVo wtd:test2)
+//        {
+//            System.out.println(wtd.getWindfarm()+"----------------"+wtd.getPower()+"----------------"+wtd.getSpeed());
+//        }
 
 //        AjaxResult ajaxResult =leaderboardController.utilizationList(tablepar,null,"2021-01-01","2021-01-03","0");
 //
@@ -96,45 +99,45 @@ public class LeaderboardTest {
 //        }
 //
 //
-//        AjaxResult ajaxResult =leaderboardController.curvefittingmainList(tablepar,wpid,"2021-01-01");
-//
-//        List<Curvefittingmain> test=(List<Curvefittingmain>)ajaxResult.get("data");
-//        for(Curvefittingmain wtd:test)
-//        {
-//            System.out.println(wtd.getDeviationrate1()+"----------------"+wtd.getDeviationrate2()+"----------------"+wtd.getDeviationrate3());
-//        }
-//
-//
-//        AjaxResult  ajaxResult2 =leaderboardController.getCurvechatAjax("sjbz","MG01_01",beginDate);
-//
-//
-//        Map<String, Object> map=(Map<String, Object>)ajaxResult2.get("data");
-//        List<DataVo> datavos =(List<DataVo>)map.get("datas");
-//        for(DataVo wtd:datavos)
-//        {
-//            System.out.println(wtd.getValue1()+"----------------"+wtd.getValue2()+"----------------"+wtd.getValue3());
-//        }
+        AjaxResult ajaxResult =leaderboardController.curvefittingmainList(tablepar,wpid,"2021-01-01");
 
+        List<Curvefittingmain> test=(List<Curvefittingmain>)ajaxResult.get("data");
+        for(Curvefittingmain wtd:test)
+        {
+            System.out.println(wtd.getDeviationrate1()+"----------------"+wtd.getDeviationrate2()+"----------------"+wtd.getDeviationrate3());
+        }
 
-//        AjaxResult ajaxResult2 =leaderboardController.curvefittingmonthmainList(tablepar,  "MHS_FDC",  "2021", "1");
-//
-//
-//        List<Curvefittingmonthmain> list=(List<Curvefittingmonthmain>)ajaxResult2.get("data");
-//
-//        for(Curvefittingmonthmain wtd:list)
-//        {
-//            System.out.println(wtd.getDeviationrate1()+"----------------"+wtd.getDeviationrate2()+"----------------"+wtd.getDeviationrate3());
-//        }
 
-//                AjaxResult ajaxResult2 =leaderboardController.curveMonthchatAjax("sjzy",  "MG01_01",  "2021", "1");
-//
-//
-//        List<Curvefittingmonthmain> list=(List<Curvefittingmonthmain>)ajaxResult2.get("data");
-//
-//        for(Curvefittingmonthmain wtd:list)
-//        {
-//            System.out.println(wtd.getDeviationrate1()+"----------------"+wtd.getDeviationrate2()+"----------------"+wtd.getDeviationrate3());
-//        }
+        AjaxResult  ajaxResult2 =leaderboardController.getCurvechatAjax("sjbz","MG01_01","2021-01-01");
+
+
+        Map<String, Object> map=(Map<String, Object>)ajaxResult2.get("data");
+        List<DataVo> datavos =(List<DataVo>)map.get("datas");
+        for(DataVo wtd:datavos)
+        {
+            System.out.println(wtd.getValue1()+"----------------"+wtd.getValue2()+"----------------"+wtd.getValue3());
+        }
+
+
+        AjaxResult ajaxResult3 =leaderboardController.curvefittingmonthmainList(tablepar,  "MHS_FDC",  "2021", "1");
+
+
+        List<Curvefittingmonthmain> list=(List<Curvefittingmonthmain>)ajaxResult3.get("data");
+
+        for(Curvefittingmonthmain wtd:list)
+        {
+            System.out.println(wtd.getDeviationrate1()+"----------------"+wtd.getDeviationrate2()+"----------------"+wtd.getDeviationrate3());
+        }
+
+       AjaxResult ajaxResult4 =leaderboardController.curveMonthchatAjax("sjzy",  "MG01_01",  "2021", "1");
+
+
+        List<Curvefittingmonthmain> list2=(List<Curvefittingmonthmain>)ajaxResult4.get("data");
+
+        for(Curvefittingmonthmain wtd:list2)
+        {
+            System.out.println(wtd.getDeviationrate1()+"----------------"+wtd.getDeviationrate2()+"----------------"+wtd.getDeviationrate3());
+        }
 
     }