Browse Source

MTTR和MTBF数据统计

shilin 3 years ago
parent
commit
dbe12a727b

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

@@ -317,7 +317,7 @@ public class Constant {
 	public static final String[] TPOINT_WP_CFT = { "FCCFTFS10", "FCCFTFS30",
 			"FCCFTFS50", "FCCFTFS60", "FCCFTFS70", "FCCFTFS80", "FCCFTFX10", "FCCFTFX30",
 			"FCCFTFX50", "FCCFTFX60", "FCCFTFX70", "FCCFTFX80", "FCCFTWD", "FCCFTSD",
-			"FCCFTYQ", "FCCFTMD" };
+			"FCCFTYQ", "KQMD" };
 	public static final String FCCFTFS10 = "FCCFTFS10";// 测风塔10米风速
 	public static final String FCCFTFS30 = "FCCFTFS30";// 测风塔30米风速
 	public static final String FCCFTFS50 = "FCCFTFS50";// 测风塔50米风速

+ 54 - 0
src/main/java/com/gyee/frame/controller/monitor/MatrixPushController.java

@@ -2,6 +2,9 @@ package com.gyee.frame.controller.monitor;
 
 import com.gyee.frame.common.conf.AjaxStatus;
 import com.gyee.frame.common.domain.AjaxResult;
+import com.gyee.frame.common.spring.InitialRunner;
+import com.gyee.frame.model.auto.Windpowerstation;
+import com.gyee.frame.model.custom.MatrixVo;
 import com.gyee.frame.service.websocket.*;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
@@ -13,7 +16,9 @@ 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
@@ -133,4 +138,53 @@ public class MatrixPushController {
 
     }
 
+    @PostMapping("/findSimpleMatrix")
+    @ResponseBody
+    @ApiOperation(value = "风场简单矩阵", notes = "风场简单矩阵")
+    @ApiImplicitParams({ @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query")})
+    public AjaxResult findSimpleMatrix(String wpId) throws Exception {
+
+
+        Map<String, Object> map=  new HashMap<>();
+
+
+        map=matrixPushByWpService.findSimpleMatrix(wpId);
+
+        if (null!=map) {
+            return AjaxResult.successData(AjaxStatus.success.code, map);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, map);
+        }
+
+    }
+
+
+    @PostMapping("/findSimpleMatrixAll")
+    @ResponseBody
+    @ApiOperation(value = "全风场简单矩阵", notes = "全风场简单矩阵")
+    @ApiImplicitParams({ @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query")})
+    public AjaxResult findSimpleMatrixAll(String wpId) throws Exception {
+
+
+        List<Object> vos=new ArrayList<>();
+
+
+        for(Windpowerstation wp: InitialRunner.wpls)
+        {
+            Map<String, Object> map=  new HashMap<>();
+            map.put("wpName",wp.getName());
+            List<List<MatrixVo>> fjvos=matrixPushByWpService.findSimpleMatrixList(wp.getId());
+            map.put("fjls",fjvos);
+            vos.add(map);
+        }
+
+
+        if (null!=vos) {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, vos);
+        }
+
+    }
+
 }

+ 68 - 0
src/main/java/com/gyee/frame/controller/monitor/MonitorPushController.java

@@ -26,8 +26,33 @@ public class MonitorPushController {
 
     @Resource
     private WpInfoPushService wpInfoPushService;
+    @Resource
+    private PowerFirstPushService powerFirstPushService;
+    @Resource
+    private MatrixPushByWpService matrixPushByWpService;
+    @Resource
+    private CftInfoPushService cftInfoPushService;
+
+    @PostMapping("/findCftInfo")
+    @ResponseBody
+    @ApiOperation(value = "获取测风塔信息", notes = "获取测风塔信息")
+    @ApiImplicitParams({ @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query")})
+
+    public AjaxResult findCftInfo(String wpId) throws Exception {
 
 
+        Map<String, Object> map = new HashMap<String, Object>();
+
+
+        map =cftInfoPushService.findCftInfo(wpId);
+
+        if (null!=map ){
+            return AjaxResult.successData(AjaxStatus.success.code, map );
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, map );
+        }
+
+    }
     @PostMapping("/monitor")
     @ResponseBody
     @ApiOperation(value = "状态监视", notes = "状态监视")
@@ -131,4 +156,47 @@ public class MonitorPushController {
         }
 
     }
+
+
+    @PostMapping("/findPowerFirst")
+    @ResponseBody
+    @ApiOperation(value = "升压站监视", notes = "升压站监视")
+    @ApiImplicitParams({@ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query")
+    })
+    public AjaxResult findPowerFirst(String wpId) throws Exception {
+
+
+        Map<String, Object> map=  new HashMap<>();
+
+
+        map=powerFirstPushService.findPowerFirst(wpId);
+
+        if (null!=map) {
+            return AjaxResult.successData(AjaxStatus.success.code, map);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, map);
+        }
+
+    }
+
+    @PostMapping("/findGeneralAppearance")
+    @ResponseBody
+    @ApiOperation(value = "总貌、地貌监视", notes = "总貌、地貌监视")
+    @ApiImplicitParams({@ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query")
+    })
+    public AjaxResult findGeneralAppearance(String wpId) throws Exception {
+
+
+        Map<String, Object> map=  new HashMap<>();
+
+
+        map=matrixPushByWpService.findGeneralAppearance(wpId);
+
+        if (null!=map) {
+            return AjaxResult.successData(AjaxStatus.success.code, map);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, map);
+        }
+
+    }
 }

+ 32 - 1
src/main/java/com/gyee/frame/service/WarningRecordsService.java

@@ -12,9 +12,9 @@ import com.gyee.frame.model.auto.WarningRecordsExample;
 import com.gyee.frame.model.custom.SawVo;
 import com.gyee.frame.model.custom.Tablepar;
 import com.gyee.frame.util.StringUtils;
-import javax.annotation.Resource;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import java.util.*;
 
 
@@ -322,4 +322,35 @@ public class WarningRecordsService implements BaseService<WarningRecords, Warnin
 		return ls;
 	}
 
+
+	public WarningRecords getWarningRecords(String wtId) {
+
+		WarningRecords vo=new WarningRecords();
+		WarningRecordsExample example = new WarningRecordsExample();
+
+		example.setOrderByClause("warningtime desc");
+
+
+		PageHelper.startPage(0, 1);
+
+		WarningRecordsExample.Criteria criteria = example.createCriteria();
+
+
+		if (StringUtils.notEmp(wtId)) {
+			criteria.andWindturbineidEqualTo(wtId);
+		}
+
+		List<WarningRecords> list = warningRecordsMapper.selectByExample(example);
+
+
+		PageInfo<WarningRecords> pageInfo = new PageInfo<WarningRecords>(list);
+
+		if(null!=pageInfo && !pageInfo.getList().isEmpty())
+		{
+			vo=pageInfo.getList().get(0);
+		}
+
+		return vo;
+	}
+
 }

+ 7 - 7
src/main/java/com/gyee/frame/service/websocket/CftInfoPushService.java

@@ -3,6 +3,7 @@ package com.gyee.frame.service.websocket;
 
 import com.gyee.frame.common.spring.Constant;
 import com.gyee.frame.model.auto.WindPowerStationTestingPoint2;
+import com.gyee.frame.model.custom.DataVo;
 import com.gyee.frame.model.custom.PointData;
 import com.gyee.frame.service.ProjectPlanService;
 import com.gyee.frame.service.WindPowerstationTestingPointService;
@@ -15,10 +16,7 @@ import com.gyee.frame.util.golden.EdosUtil;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.*;
 
 @Service
 public class CftInfoPushService {
@@ -32,7 +30,8 @@ public class CftInfoPushService {
     private ProjectPlanService projectPlanService;
     @Resource
     private WindpowerstationthewindinfoService windpowerstationthewindinfoService;
-
+    @Resource
+    private RealPowerPushService realPowerPushService;
     IRealTimeDataBaseUtil realApiUtil = new EdosUtil();
 
 
@@ -51,7 +50,7 @@ public class CftInfoPushService {
 
     }
 
-    private Map<String, Object> findCftInfo(String id) throws Exception {
+    public Map<String, Object> findCftInfo(String id) throws Exception {
         Map<String, Object> map = new HashMap<String, Object>();
         if (StringUtils.notEmp(id)) {
 
@@ -78,7 +77,8 @@ public class CftInfoPushService {
 /*************************************************测风塔*************************************************************/
 
 
-
+            List<DataVo> glvos =realPowerPushService.findRealPower(id);
+            map.put("glvos", glvos);
 
 /*************************************************关系库指标**************************************************************/
 

+ 12 - 10
src/main/java/com/gyee/frame/service/websocket/GenreSetPushService.java

@@ -533,12 +533,12 @@ public class GenreSetPushService {
                 // 年场内受累故障
                 Double ngzzsl = MathUtil.twoBit(wxsslist.get(5).getPointValueInDouble());
 
-                wxssmap.put("rjxsl", rjxsl);
-                wxssmap.put("rgzzsl", rgzzsl);
-                wxssmap.put("yjxsl", yjxsl);
-                wxssmap.put("ygzzsl", ygzzsl);
-                wxssmap.put("njxsl", njxsl);
-                wxssmap.put("ngzzsl", ngzzsl);
+//                wxssmap.put("rjxsl", rjxsl);
+//                wxssmap.put("rgzzsl", rgzzsl);
+//                wxssmap.put("yjxsl", yjxsl);
+//                wxssmap.put("ygzzsl", ygzzsl);
+//                wxssmap.put("njxsl", njxsl);
+//                wxssmap.put("ngzzsl", ngzzsl);
 
                 //日待机损失
                 Double rdjss = MathUtil.twoBit(wxsslist.get(6).getPointValueInDouble());
@@ -776,15 +776,17 @@ 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()) {
+        if (!rfdls.isEmpty() && !swdls.isEmpty() && !gwdls.isEmpty()
+         && rfdls.size()==swdls.size() && rfdls.size()==gwdls.size()
+        ) {
             Calendar cal = Calendar.getInstance();
             int today = c.get(Calendar.DAY_OF_MONTH);
             // int today = 30;
@@ -801,7 +803,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);// 日发电量

+ 65 - 2
src/main/java/com/gyee/frame/service/websocket/MatrixPushByWpService.java

@@ -337,7 +337,7 @@ public class MatrixPushByWpService {
      * @return
      * @throws Exception
      */
-    private Map<String, Object> findGeneralAppearance(String wpId) throws Exception {
+    public Map<String, Object> findGeneralAppearance(String wpId) throws Exception {
 
         Map<String, Object> map = new HashMap<String, Object>();
 
@@ -831,7 +831,7 @@ public class MatrixPushByWpService {
     }
 
 
-    private Map<String, Object> findSimpleMatrix(String wpId) throws Exception {
+    public Map<String, Object> findSimpleMatrix(String wpId) throws Exception {
 
         Map<String, Object> map = new HashMap<String, Object>();
 
@@ -898,6 +898,69 @@ public class MatrixPushByWpService {
 
         return map;
     }
+
+
+    public List< List<MatrixVo>> findSimpleMatrixList(String wpId) throws Exception {
+
+            List< List<MatrixVo>> fjvos=new ArrayList<>();
+            if(InitialRunner.wpmap.containsKey(wpId))
+            {
+
+
+
+/*************************************************风机指标统计*************************************************************/
+                List<String> fjzbls = new ArrayList<>();
+
+                List<Windturbine> wtls=InitialRunner.wp_wtmap.get(wpId);
+
+                // Map<String, MatrixVo> vomap = new HashMap<>();
+                List<MatrixVo> vos = 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);
+
+                        MatrixVo vo=new MatrixVo();
+                        vo.setWtId(wt.getId());
+
+                        if(StringUtils.notEmp(wt.getStatus()))
+                        {
+                            String num=wt.getStatus().substring(wt.getStatus().length()-3);
+                            vo.setWtnum(num);
+
+                        }
+
+                        vo.setWpId(wt.getWindpowerstationid());
+                        double fjzt = MathUtil.twoBit(fjzblist.get(i).getPointValueInDouble());
+                        vo.setFjzt(fjzt);
+                        vo.setWtCode(wt.getCode());
+
+                        vos.add(vo);
+
+                    }
+
+                }
+                //fjmap.put(wpId,vomap);
+                fjvos.add(vos);
+/*************************************************风机指标统计*************************************************************/
+
+
+            }
+
+
+
+            return fjvos;
+    }
 }
 
 

+ 9 - 10
src/main/java/com/gyee/frame/service/websocket/RealPowerPushService.java

@@ -177,7 +177,7 @@ public class RealPowerPushService {
                                     if (ycmap.containsKey("cdq1")) {
                                         String qs3_ycgl1 = (String) ycmap.get("cdq1");
 
-                                        List<PointData> qs3_datas = realApiUtil.getHistoryDatasSnap(qs3_ycgl1, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, 1800L);
+                                        List<PointData> qs3_datas = realApiUtil.getHistoryDatasSnap(qs3_ycgl1, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, pried);
 
                                         for (int j = 0; j < datas.size(); j++) {
 
@@ -218,7 +218,7 @@ public class RealPowerPushService {
                                         if (ycmap.containsKey("cdq2")) {
                                             String[] ycPoints3 = (String[]) ycmap.get("cdq2");
                                             for (int i = 0; i < subresult; i++) {
-                                                cal.add(Calendar.HOUR_OF_DAY, 1);
+                                                cal.add(Calendar.MINUTE, 30);
                                                 vos.get(datas.size() + i).setTime(cal.getTime().getTime());
                                                 String qs3_ycgl = ycPoints3[i];
                                                 WindPowerStationTestingPoint2 ycglpoint = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(station.getId(), ycPoints2[i]);
@@ -229,8 +229,7 @@ public class RealPowerPushService {
 
                                     } else {
                                         for (int i = 0; i < subresult; i++) {
-                                            cal.add(Calendar.HOUR_OF_DAY, 1);
-
+                                            cal.add(Calendar.MINUTE, 30);
                                             vos.get(datas.size() + i).setTime(cal.getTime().getTime());
 
                                             WindPowerStationTestingPoint2 ycglpoint = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(station.getId(), ycPoints2[i]);
@@ -249,7 +248,7 @@ public class RealPowerPushService {
 
                                     if (subresult > 0)
                                         for (int i = 0; i < subresult; i++) {
-                                            cal.add(Calendar.HOUR_OF_DAY, 1);
+                                            cal.add(Calendar.MINUTE, 30);
                                             vos.get(total + i).setTime(cal.getTime().getTime());
                                             vos.get(total + i).setValue4(null);
                                         }
@@ -490,7 +489,7 @@ public class RealPowerPushService {
                                     if (ycmap.containsKey("cdq1")) {
                                         String qs3_ycgl1 = (String) ycmap.get("cdq1");
 
-                                        List<PointData> qs3_datas = realApiUtil.getHistoryDatasSnap(qs3_ycgl1, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, 1800L);
+                                        List<PointData> qs3_datas = realApiUtil.getHistoryDatasSnap(qs3_ycgl1, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, pried);
 
                                         for (int j = 0; j < datas.size(); j++) {
 
@@ -531,7 +530,7 @@ public class RealPowerPushService {
                                         if (ycmap.containsKey("cdq2")) {
                                             String[] ycPoints3 = (String[]) ycmap.get("cdq2");
                                             for (int i = 0; i < subresult; i++) {
-                                                cal.add(Calendar.HOUR_OF_DAY, 1);
+                                                cal.add(Calendar.MINUTE, 30);
                                                 vos.get(datas.size() + i).setTime(cal.getTime().getTime());
                                                 String qs3_ycgl = ycPoints3[i];
                                                 WindPowerStationTestingPoint2 ycglpoint = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, ycPoints2[i]);
@@ -542,7 +541,7 @@ public class RealPowerPushService {
 
                                     } else {
                                         for (int i = 0; i < subresult; i++) {
-                                            cal.add(Calendar.HOUR_OF_DAY, 1);
+                                            cal.add(Calendar.MINUTE, 30);
 
                                             vos.get(datas.size() + i).setTime(cal.getTime().getTime());
 
@@ -562,7 +561,7 @@ public class RealPowerPushService {
 
                                     if (subresult > 0)
                                         for (int i = 0; i < subresult; i++) {
-                                            cal.add(Calendar.HOUR_OF_DAY, 1);
+                                            cal.add(Calendar.MINUTE, 30);
                                             vos.get(total + i).setTime(cal.getTime().getTime());
                                             vos.get(total + i).setValue4(null);
                                         }
@@ -624,7 +623,7 @@ public class RealPowerPushService {
                             }
 
                             if (!InitialRunner.wpmap.containsKey(id)) {
-                                cal.add(Calendar.HOUR_OF_DAY, 1);
+                                cal.add(Calendar.MINUTE, 30);
                             }
                         }
 

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

@@ -6,6 +6,7 @@ import com.gyee.frame.common.spring.InitialRunner;
 import com.gyee.frame.model.auto.WindPowerStationTestingPoint2;
 import com.gyee.frame.model.auto.Windpowerstation;
 import com.gyee.frame.model.auto.WpMttrAndMtbMonth;
+import com.gyee.frame.model.custom.DNAVal;
 import com.gyee.frame.model.custom.DataVo;
 import com.gyee.frame.model.custom.PointData;
 import com.gyee.frame.model.custom.ZtjsVo;
@@ -231,20 +232,18 @@ public class WpInfoPushService {
 
             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();
 
                 }
 
@@ -1288,20 +1287,18 @@ public class WpInfoPushService {
 
             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();
 
                 }
 
@@ -1684,7 +1681,13 @@ public class WpInfoPushService {
 
         if (!gzslls.isEmpty() && !jxslls.isEmpty() && !gzssls.isEmpty()
                 && !jxssls.isEmpty() && !djssls.isEmpty() && !sdtjls.isEmpty() && !xnssls.isEmpty()
-                && !qxjclls.isEmpty() && !xdssls.isEmpty() && !dwslls.isEmpty() && !tqslls.isEmpty()) {
+                && !qxjclls.isEmpty() && !xdssls.isEmpty() && !dwslls.isEmpty() && !tqslls.isEmpty()
+
+                && gzslls.size()==jxslls.size() &&  gzslls.size()==gzssls.size()
+                &&  gzslls.size()==jxssls.size() &&  gzslls.size()==djssls.size() &&  gzslls.size()==sdtjls.size() &&  gzslls.size()==xnssls.size()
+                &&  gzslls.size()==qxjclls.size() &&  gzslls.size()==xdssls.size() &&  gzslls.size()==dwslls.size() &&  gzslls.size()==tqslls.size()
+
+        ) {
             Calendar cal = Calendar.getInstance();
             int today = c.get(Calendar.DAY_OF_MONTH);
             // int today = 30;
@@ -1730,8 +1733,7 @@ public class WpInfoPushService {
                     double ssdl = MathUtil.twoBit(xnss + gzss + jxss + xdxss + slss);
                     vo.setValue1(ssdl);// 损失电量
 
-                }
-                else {
+                } else {
                     vo.setTimestr("");
                     vo.setValue1(0.0);// 损失电量
 
@@ -1841,56 +1843,43 @@ public class WpInfoPushService {
             wpId = "0";
         }
 
-        Calendar c = Calendar.getInstance();
-
-        // c.add(Calendar.MONTH, -1);
-        c.set(Calendar.HOUR_OF_DAY, 0);
-        c.set(Calendar.MINUTE, 0);
-        c.set(Calendar.SECOND, 0);
-        Date endDate = c.getTime();
 
+        WindPowerStationTestingPoint2 yfdlai = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(wpId, Constant.TPOINT_WP_YFDL);
+        String[] fdlpoints = new String[1];
+        fdlpoints[0] = yfdlai.getCode();
 
-        c = Calendar.getInstance();
-        c.add(Calendar.DAY_OF_MONTH, -7);
+        Calendar c = Calendar.getInstance();
+        int month = c.get(Calendar.MONTH) + 1;
+        c.set(Calendar.MONTH, 1);
+        c.set(Calendar.DAY_OF_MONTH, 1);
         c.set(Calendar.HOUR_OF_DAY, 0);
         c.set(Calendar.MINUTE, 0);
         c.set(Calendar.SECOND, 0);
-        Date beginDate = c.getTime();
-        c = Calendar.getInstance();
-        long num = 7;
-        // long num = 30;
-
-
-        WindPowerStationTestingPoint2 rfdlai = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(wpId, Constant.TPOINT_WP_YFDL);
+        c.set(Calendar.MILLISECOND, 0);
 
 
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        for (int i = 0; i < month; i++) {
+            int current = new BigDecimal(c.getTime().getTime()).divide(new BigDecimal(1000), 0, RoundingMode.HALF_EVEN).intValue();
 
-        List<PointData> rfdlls = realApiUtil.getHistoryDatasSnap(rfdlai, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, 86400L);
+            // 获得发电量本月数据
+            DNAVal[] currentfdlarr = realApiUtil.getHistMatrix(fdlpoints, current);
 
-        if (!rfdlls.isEmpty()) {
-            Calendar cal = Calendar.getInstance();
-            int today = c.get(Calendar.DAY_OF_MONTH);
-            // int today = 30;
-            for (int i = 0; i < rfdlls.size(); i++) {
-                DataVo vo = new DataVo();
+            DataVo vo = new DataVo();
 
-                Date date = new Date(rfdlls.get(i).getPointTime() * 1000);
-                cal.setTime(date);
+            // vo.setTime(dateformat.parse(entry.getKey()).getTime());
 
-                // vo.setTime(dateformat.parse(entry.getKey()).getTime());
+            vo.setTimestr(c.get(Calendar.MONTH)  + "月");
+            //日发电量
+            Double rfdl = MathUtil.twoBit(currentfdlarr[0].DValue);
+            //日预测发电量
+            Double ycrfdl = MathUtil.twoBit(rfdl * 1.06);
 
-                vo.setTimestr(cal.get(Calendar.DAY_OF_MONTH) + "日");
-                //日发电量
-                Double rfdl = MathUtil.twoBit(rfdlls.get(i).getPointValueInDouble());
-                //日预测发电量
-                Double ycrfdl = MathUtil.twoBit(rfdl * 1.06);
+            vo.setValue1(rfdl);// 日发电量
+            vo.setValue2(ycrfdl);// 日预测发电量
 
-                vo.setValue1(rfdl);// 日发电量
-                vo.setValue2(ycrfdl);// 日预测发电量
+            vos.add(vo);
 
-                vos.add(vo);
-            }
+            c.add(Calendar.MONTH, 1);
         }
 
 

+ 63 - 28
src/main/java/com/gyee/frame/service/websocket/WtInfoPushService.java

@@ -5,6 +5,7 @@ import com.gyee.frame.common.spring.Constant;
 import com.gyee.frame.common.spring.InitialRunner;
 import com.gyee.frame.model.auto.*;
 import com.gyee.frame.model.custom.PointData;
+import com.gyee.frame.service.WarningRecordsService;
 import com.gyee.frame.service.WindTurbineTestingPointAiService;
 import com.gyee.frame.service.WindTurbineTestingPointDiService;
 import com.gyee.frame.service.WindturbineinfodayService;
@@ -28,7 +29,8 @@ public class WtInfoPushService {
 
     @Resource
     private WindturbineinfodayService windturbineinfodayService;
-
+    @Resource
+    private WarningRecordsService warningRecordsService;
     IRealTimeDataBaseUtil realApiUtil = new EdosUtil();
 
     String QS_FDC = "QS_FDC";
@@ -68,6 +70,9 @@ public class WtInfoPushService {
                 map.put("wpid", wt.getWindpowerstationid());
                 map.put("pjid", wt.getProjectid());
                 map.put("lnid", wt.getLineid());
+                map.put("code", wt.getCode());
+                Line ln= InitialRunner.lnmap.get(wt.getLineid());
+                map.put("lnname", ln.getName());
 
                 Double sjgl = 0.0;
                 Double bzgl = 0.0;
@@ -83,7 +88,9 @@ public class WtInfoPushService {
                 Map<String, Integer> phnamemap = new HashMap<>();
                 Map<String, Integer> yynamemap = new HashMap<>();
                 Map<String, Integer> jcnamemap = new HashMap<>();
-                Map<String, Integer> jczbnamemap = new HashMap<>();
+
+
+
 
                 zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_FJKYL).getId());// 可利用率
                 zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_RFDL).getId());// 日发电量
@@ -92,7 +99,6 @@ public class WtInfoPushService {
                 zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_RFDLBZ).getId());// 日理论发电量
                 zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_RFDLZS).getId());//  日应发电量
                 zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.FJZT).getId());// 风机状态
-                zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_PJGL).getId());// 平均风速功率
                 zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RGZSSDL).getId());// 风机日故障损失电量
                 zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RJXSSDL).getId());// 风机日检修损失电量
                 zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RQFSSDL).getId());// 风机日欠发损失电量
@@ -102,24 +108,36 @@ public class WtInfoPushService {
                 zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RQFSSDL).getId());// 日场外受累电网
                 zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RXDSSDL).getId());// 日场外受累天气
 
+                zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_FJSSFS).getId());// 风速
+                zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_FJGL).getId());// 风机功率
+                if (wt.getWindpowerstationid().equals(QS_FDC)) {
+                    zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.QSTPOINT_WT_FDJZS).getId());// 风机转数
+
+                }else
+                {
+                    zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_FDJZS).getId());// 风机转数
+                }
+                zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_JCWWD).getId());//环境温度
+
                 keyls.add("FJKYL");// 可利用率
                 keyls.add("RFDL");// 日发电量
                 keyls.add("LLGL");// 风机理论功率
                 keyls.add("YFGL");// 风机应发功率
-                keyls.add("RFDLBZ");// 日理论发电量
-                keyls.add("RFDLZS");//  日应发电量
+                keyls.add("LLFDL");// 日理论发电量
+                keyls.add("YFDL");//  日应发电量
                 keyls.add("FJZT");// 风机状态
-                keyls.add("PJGL");// 平均风速功率
-                keyls.add("RGZSSDL");// 风机日故障损失电量
-                keyls.add("RJXSSDL");// 风机日检修损失电量
-                keyls.add("RQFSSDL");// 风机日欠发损失电量
-                keyls.add("RXDSSDL");// 风机日限电损失电量
-                keyls.add("RGZSSDL");// 日场内受累检修
+                keyls.add("GZSS");// 风机日故障损失电量
+                keyls.add("JXSS");// 风机日检修损失电量
+                keyls.add("XNSS");// 风机日欠发损失电量
+                keyls.add("XDSS");// 风机日限电损失电量
+                keyls.add("SLSS");// 日场内受累检修
                 keyls.add("RJXSSDL");// 日场内受累故障
                 keyls.add("RQFSSDL");// 日场外受累电网
                 keyls.add("RXDSSDL");// 日场外受累天气
-
-
+                keyls.add("FS");// 风速
+                keyls.add("GL");// 平均风速功率
+                keyls.add("FDJZS");//风机转数
+                keyls.add("HJWD");////环境温度
 /*********************************************************************变桨*********************************************************************************/
 
                 List<String> uids = new ArrayList<>();
@@ -536,30 +554,35 @@ public class WtInfoPushService {
                     jczbmap.put(keyls.get(4), MathUtil.twoBit(zblist.get(4).getPointValueInDouble()));// 日理论发电量
                     jczbmap.put(keyls.get(5), MathUtil.twoBit(zblist.get(5).getPointValueInDouble()));// 日应发电量
                     jczbmap.put(keyls.get(6), MathUtil.twoBit(zblist.get(6).getPointValueInDouble()));// 风机状态
-                    jczbmap.put(keyls.get(7), MathUtil.twoBit(zblist.get(7).getPointValueInDouble()));// 平均风速功率
+
                     double rssdl = 0.0;
-                    double rgzss = MathUtil.twoBit(zblist.get(8).getPointValueInDouble());
-                    double rjxss = MathUtil.twoBit(zblist.get(9).getPointValueInDouble());
-                    double rxnss = MathUtil.twoBit(zblist.get(10).getPointValueInDouble());
-                    double rxdss = MathUtil.twoBit(zblist.get(11).getPointValueInDouble());
+                    double rgzss = MathUtil.twoBit(zblist.get(7).getPointValueInDouble());
+                    double rjxss = MathUtil.twoBit(zblist.get(8).getPointValueInDouble());
+                    double rxnss = MathUtil.twoBit(zblist.get(9).getPointValueInDouble());
+                    double rxdss = MathUtil.twoBit(zblist.get(10).getPointValueInDouble());
 
-                    double rlzssdl = MathUtil.twoBit(zblist.get(12).getPointValueInDouble()); // 日场内受累检修
-                    double rszssdl = MathUtil.twoBit(zblist.get(13).getPointValueInDouble()); // 日场内受累故障
-                    double rwzssdl = MathUtil.twoBit(zblist.get(14).getPointValueInDouble()); // 日场外受累电网
-                    double rtzssdl = MathUtil.twoBit(zblist.get(15).getPointValueInDouble()); // 日场外受累天气
+                    double rlzssdl = MathUtil.twoBit(zblist.get(11).getPointValueInDouble()); // 日场内受累检修
+                    double rszssdl = MathUtil.twoBit(zblist.get(12).getPointValueInDouble()); // 日场内受累故障
+                    double rwzssdl = MathUtil.twoBit(zblist.get(13).getPointValueInDouble()); // 日场外受累电网
+                    double rtzssdl = MathUtil.twoBit(zblist.get(14).getPointValueInDouble()); // 日场外受累天气
 
-                    jczbmap.put(keyls.get(8), StringUtils.round(rgzss + rlzssdl, 2));// 日故障损失电量
-                    jczbmap.put(keyls.get(9), StringUtils.round(rjxss + rszssdl, 2));// 日维护损失电量
-                    jczbmap.put(keyls.get(10), rxnss);// 日欠发损失电量
+                    jczbmap.put(keyls.get(7), StringUtils.round(rgzss + rlzssdl, 2));// 日故障损失电量
+                    jczbmap.put(keyls.get(8), StringUtils.round(rjxss + rszssdl, 2));// 日维护损失电量
+                    jczbmap.put(keyls.get(9), rxnss);// 日欠发损失电量
 
-                    jczbmap.put(keyls.get(11), rxdss);// 日限电损失电量
-                    jczbmap.put(keyls.get(12), StringUtils.round(rwzssdl + rtzssdl, 2));// 日受累损失电量
+                    jczbmap.put(keyls.get(10), rxdss);// 日限电损失电量
+                    jczbmap.put(keyls.get(11), StringUtils.round(rwzssdl + rtzssdl, 2));// 日受累损失电量
 
                     rssdl = rgzss + rjxss + rxnss + rxdss + rwzssdl + rtzssdl + rszssdl + rlzssdl;
 
                     jczbmap.put("RSSDL", StringUtils.round(rssdl, 2));// 风机日损失电量
 
                     jczbmap.put("RLLFDL", StringUtils.round(rssdl + rfdl, 2));// 风机日理论电量
+
+                    jczbmap.put(keyls.get(15), MathUtil.twoBit(zblist.get(15).getPointValueInDouble()));// 风速
+                    jczbmap.put(keyls.get(16), MathUtil.twoBit(zblist.get(16).getPointValueInDouble()));//功率
+                    jczbmap.put(keyls.get(17), MathUtil.twoBit(zblist.get(17).getPointValueInDouble()));//发电机转数
+                    jczbmap.put(keyls.get(18), MathUtil.twoBit(zblist.get(18).getPointValueInDouble()));//环境温度
 /**************************************************************基础指标***********************************************************************************/
 
 /**************************************************************变桨***********************************************************************************/
@@ -656,7 +679,7 @@ public class WtInfoPushService {
 
 /*************************************************关系库指标**************************************************************/
 
-            Map<String, Double> gxkmap = new HashMap<>();
+            Map<String, Object> gxkmap = new HashMap<>();
             Date date = DateUtils.truncate(new Date());
             List<WindTurbineInfoDay> wtdls = windturbineinfodayService.getWindturbineinfo(id, date);
             if (!wtdls.isEmpty()) {
@@ -671,6 +694,10 @@ public class WtInfoPushService {
                 gxkmap.put("yjxxs", wd.getMonthmaintaintime());
                 gxkmap.put("ytjxs", wd.getMonhtstoptime());
 
+                Map<String, Object> jczbmap =(Map<String, Object>)map.get("jczbmap");
+                jczbmap.put("FJKYL", wd.getDaysbklyl());
+                map.put("jczbmap", jczbmap);
+
             } else {
                 gxkmap.put("ndxkyss", 0.0);
                 gxkmap.put("nsbklyl", 0.0);
@@ -683,6 +710,14 @@ public class WtInfoPushService {
                 gxkmap.put("ytjxs", 0.0);
             }
 
+            WarningRecords warningRecords= warningRecordsService.getWarningRecords(id);
+
+            if(null !=warningRecords && null !=warningRecords.getWarningid() && InitialRunner.warningmap.containsKey(warningRecords.getWarningid()))
+            {
+                Warning2 warning2=InitialRunner.warningmap.get(warningRecords.getWarningid());
+                gxkmap.put("bjmc", warning2.getChinesetext());
+                gxkmap.put("bjsj", DateUtils.formatDateTime(warningRecords.getWarningtime()));
+            }
             map.put("gxkmap", gxkmap);
 
 /*************************************************关系库指标**************************************************************/

+ 23 - 5
src/main/java/com/gyee/frame/service/websocket/WtWarnPushService.java

@@ -3,6 +3,7 @@ package com.gyee.frame.service.websocket;
 
 import com.gyee.frame.common.spring.InitialRunner;
 import com.gyee.frame.model.auto.Warning2;
+import com.gyee.frame.model.auto.WarningClassify;
 import com.gyee.frame.model.auto.WindTurbineTestingPointDi2;
 import com.gyee.frame.model.auto.Windturbine;
 import com.gyee.frame.model.custom.PointData;
@@ -14,10 +15,7 @@ import com.gyee.frame.util.golden.EdosUtil;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 @Service
 public class WtWarnPushService {
@@ -91,6 +89,9 @@ public class WtWarnPushService {
                                         {
                                             Warning2 wr=wmap.get(di.getUniformcode());
                                             vo.setTypeId(wr.getWarningclassifyid());
+                                            vo.setName(wr.getChinesetext());
+                                            vo.setValue(wr.getEnglishtext());
+                                            vo.setWarningId(String.valueOf(wr.getEdnavalue()));
                                         }
                                         vos.add(vo);
                                     }
@@ -122,7 +123,24 @@ public class WtWarnPushService {
                                         typemap.put(vo.getTypeId(), ls);
                                     }
                                 }
-                                map.put(id,typemap);
+
+
+                                Set<Map.Entry<String, List<ValueVo>>> set = typemap.entrySet();
+                                for (Iterator<Map.Entry<String, List<ValueVo>>> it = set.iterator(); it.hasNext();) {
+                                    Map.Entry<String, List<ValueVo>> entry = (Map.Entry<String, List<ValueVo>>) it.next();
+
+                                    if(InitialRunner.warningClassifymap.containsKey(entry.getKey()))
+                                    {
+                                        WarningClassify classify=InitialRunner.warningClassifymap.get(entry.getKey());
+                                        Map<String,Object> tempmap=new HashMap<>();
+                                        tempmap.put("id",entry.getKey());
+                                        tempmap.put("name",classify.getName());
+                                        tempmap.put("vos",entry.getValue());
+                                        map.put(entry.getKey(),tempmap);
+                                    }
+                                  // System.out.println(entry.getKey() + "--->" + entry.getValue());
+                                }
+
                             }
 
                         }

+ 9 - 8
src/test/java/test/GenreSetPushTest.java

@@ -2,11 +2,10 @@ package test;
 
 import com.gyee.SpringbootStart;
 import com.gyee.frame.common.spring.SpringUtils;
-import com.gyee.frame.service.websocket.GenreSetPushService;
+import com.gyee.frame.controller.monitor.GenreSetPushController;
 import lombok.SneakyThrows;
 import org.springframework.boot.SpringApplication;
 
-import java.util.HashMap;
 import java.util.Map;
 
 public class GenreSetPushTest {
@@ -25,16 +24,18 @@ public class GenreSetPushTest {
         String year="2021";
         String month="1";
 
-        GenreSetPushService genreSetPushService= SpringUtils.getBean("genreSetPushService");
+        GenreSetPushController genreSetPushController= SpringUtils.getBean("genreSetPushController");
 
 
 
-        Map<String, Object> map = new HashMap<>();
+        Map<String, Object> map =genreSetPushController.findBasicDataInfo("MHS_FDC");
 
-
-        map.put(QS, genreSetPushService.findBasicDataInfo(QS));
-        map.put(FD, genreSetPushService.findBasicDataInfo(FD));
-        map.put(GF, genreSetPushService.findBasicDataInfo(GF));
+//        Map<String, Object> map = new HashMap<>();
+//
+//
+//        map.put(QS, genreSetPushService.findBasicDataInfo(QS));
+//        map.put(FD, genreSetPushService.findBasicDataInfo(FD));
+//        map.put(GF, genreSetPushService.findBasicDataInfo(GF));
 
 
 

+ 64 - 0
src/test/java/test/LambdaTest.java

@@ -0,0 +1,64 @@
+package test;
+
+import com.google.common.collect.Lists;
+
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+public class LambdaTest {
+
+    public static void main(String[] args) {
+        List<User> userList = Lists.newArrayList();//存放user对象集合
+
+        LambdaTest.User user1 = new LambdaTest.User(1L, "张三", 24);
+        LambdaTest.User user2 = new LambdaTest.User(2L, "李四", 27);
+        LambdaTest.User user3 = new LambdaTest.User(3L, "王五", 21);
+
+        userList.add(user1);
+        userList.add(user2);
+        userList.add(user3);
+
+        //ID为key,转为Map
+        Map<Long,User> userMap = userList.stream().collect(Collectors.toMap(User::getId, a -> a,(k1, k2)->k1));
+        System.out.println(userMap);
+
+    }
+
+    public static class User{
+        private Long id;
+        private String name;
+        private int age;
+
+        public User(Long id, String name, int age) {
+            this.id = id;
+            this.name = name;
+            this.age = age;
+        }
+
+        public Long getId() {
+            return id;
+        }
+
+        public void setId(Long id) {
+            this.id = id;
+        }
+
+        public String getName() {
+            return name;
+        }
+
+        public void setName(String name) {
+            this.name = name;
+        }
+
+        public int getAge() {
+            return age;
+        }
+
+        public void setAge(int age) {
+            this.age = age;
+        }
+    }
+}

+ 41 - 0
src/test/java/test/WarningRecordsServiceTest.java

@@ -0,0 +1,41 @@
+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.Tablepar;
+import com.gyee.frame.service.WarningRecordsService;
+import lombok.SneakyThrows;
+import org.springframework.boot.SpringApplication;
+
+public class WarningRecordsServiceTest {
+
+    @SneakyThrows
+    public static void main(String[] args) {
+
+        SpringApplication.run(SpringbootStart.class, args);
+
+
+
+        String wtId="MG01_03";
+        String wpId="MHS_FDC";
+        String year="2021";
+        String month="1";
+
+        WarningRecordsService warningRecordsService= SpringUtils.getBean("warningRecordsService");
+
+        Tablepar tablepar=new Tablepar();
+        tablepar.setPageNum(1);
+        tablepar.setPageSize(10);
+        tablepar.setOrderByColumn("deviationrate2");
+        tablepar.setIsAsc("asc");
+
+
+
+        WarningRecords wtd = warningRecordsService.getWarningRecords(wtId);
+
+        System.out.println(wtd.getWarningid());
+
+
+    }
+}

+ 1 - 1
src/test/java/test/WpInfoPushTest.java

@@ -41,7 +41,7 @@ public class WpInfoPushTest {
 //        System.out.println((end.getTime()-begin.getTime())/1000);
 //         System.out.println(vos.size());
 
-        List<DataVo> vos=wpInfoPushService.findMonthPowerWpBar("MHS_FDC");
+        List<DataVo> vos=wpInfoPushService.findLossWpBar("SBQ_FDC");
 
         Date end=new Date();
         System.out.println((end.getTime()-begin.getTime())/1000);