xieshengjie 2 years ago
parent
commit
5356bed05c

+ 38 - 0
histroy/healthmanagement-histroy-hb/src/main/java/com/gyee/healthmanagementhistroy/service/healthreport/HealthReportNewService.java

@@ -6,8 +6,10 @@ import com.gyee.common.util.CommonUtils;
 import com.gyee.common.util.DateUtils;
 import com.gyee.healthmanagementhistroy.init.CacheContext;
 import com.gyee.healthmanagementhistroy.mapper.healthreport.PartDangerMapper;
+import com.gyee.healthmanagementhistroy.mapper.healthreport.PartPowerMapper;
 import com.gyee.healthmanagementhistroy.model.auto.*;
 import com.gyee.healthmanagementhistroy.model.healthreport.PartDanger;
+import com.gyee.healthmanagementhistroy.model.healthreport.PartPower;
 import com.gyee.healthmanagementhistroy.service.auto.*;
 import com.sun.org.apache.bcel.internal.generic.LLOAD;
 import lombok.experimental.Helper;
@@ -57,6 +59,10 @@ public class HealthReportNewService {
     private PartDangerMapper partDangerMapper;
     @Resource
     private IWindturbineinfodayService windturbineinfodayService;
+    @Resource
+    private IReportpowerpartweatherService reportpowerpartweatherService;
+    @Resource
+    private PartPowerMapper partPowerMapper;
     /**
      * 保存性能描述表
      * @param stringdate
@@ -419,6 +425,35 @@ public class HealthReportNewService {
         healthwtreport8Service.saveBatch(resultList);
     }
 
+
+    /**
+     * 保存部件功率
+     * @param stringdate
+     */
+    public void savePartpower(String stringdate){
+        reportpowerpartweatherService.clear();
+        List<Reportpowerpartweather> resultList = new ArrayList<>();
+        Date date = DateUtils.parseDate1(stringdate);
+        if (date ==null){
+            date = new Date();
+        }
+        Date monthFirst = DateUtils.getMonthFirst(date);
+        Date monthLast = DateUtils.getMonthLast(date);
+        List<PartPower> partpowers = partPowerMapper.getPartpowers(monthFirst, monthLast);
+        partpowers.stream().forEach(i->{
+            Reportpowerpartweather reportpowerpartweather = new Reportpowerpartweather();
+            reportpowerpartweather.setId(CommonUtils.getUUID());
+            reportpowerpartweather.setWtid(i.getWtid());
+            reportpowerpartweather.setPartname(i.getPartname());
+            reportpowerpartweather.setName(i.getName());
+            reportpowerpartweather.setPower(i.getPower());
+            reportpowerpartweather.setDatavalue(i.getDatavalue());
+            reportpowerpartweather.setEarlywarningvalue(i.getEarlywarningvalue());
+            resultList.add(reportpowerpartweather);
+        });
+        reportpowerpartweatherService.saveBatch(resultList);
+    }
+
     private List<Healthwtreport8> getH8(List<Windturbineinfoday> windturbineinfodays) {
         List<Healthwtreport8> resultList = new ArrayList<>();
         CacheContext.wtls.stream().forEach(wt->{
@@ -453,4 +488,7 @@ public class HealthReportNewService {
         return resultList;
     }
 
+
+
+
 }

+ 2 - 2
histroy/healthmanagement-histroy-hb/src/main/java/com/gyee/healthmanagementhistroy/service/healthreport/ReportService.java

@@ -424,7 +424,7 @@ public class ReportService {
         List<Winddeviationrate> winddeviationrates = winddeviationrateService.list(winddeviationrateQueryWrapper);
         if (winddeviationrates!=null){
             List<NippleVo> nippleVos = new ArrayList<>();
-            winddeviationrates.stream().forEach(i->{
+            winddeviationrates.stream().filter(f->f.getType().equals("qualified") && f.getType().equals("unqualified")).forEach(i->{
                 NippleVo vo = new NippleVo();
                 vo.setPcl(Integer.parseInt(i.getType().substring(i.getType().indexOf("R")+1)));
                 vo.setCount(i.getCount());
@@ -780,7 +780,7 @@ public class ReportService {
             List<SbklylVo> sbklyls = new ArrayList<>();
             healthwtreport8s.stream().forEach(h->{
                 FnlylVo vo = new FnlylVo();
-                vo.setDate(h.getRecorddate().substring(0,6));
+                vo.setDate(h.getRecorddate().substring(0,7));
                 vo.setFdl(DoubleUtils.keepPrecision(h.getFdl()/10000,2));
                 vo.setFnlyl(h.getFnlyl()*100);
                 vo.setGzdl(DoubleUtils.keepPrecision(h.getGzdl(),2));

+ 23 - 2
histroy/healthmanagement-histroy-hb/src/main/java/com/gyee/healthmanagementhistroy/task/HealthreportTask.java

@@ -4,6 +4,7 @@ package com.gyee.healthmanagementhistroy.task;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.gyee.common.util.DateUtils;
 import com.gyee.healthmanagementhistroy.service.evaluate.EvaluateService;
+import com.gyee.healthmanagementhistroy.service.healthreport.HealthReportNewService;
 import com.gyee.healthmanagementhistroy.service.healthreport.HealthReportService;
 import com.gyee.healthmanagementhistroy.service.healthreport.ReportService;
 import com.gyee.healthmanagementhistroy.service.mttrmtbf.MTTRMTBFTaskService;
@@ -27,6 +28,8 @@ public class HealthreportTask {
     @Resource
     private HealthReportService healthReportService;
     @Resource
+    private HealthReportNewService healthReportNewService;
+    @Resource
     private EvaluateService evaluateService;
 
     @Resource
@@ -39,7 +42,7 @@ public class HealthreportTask {
     /**
      * 健康报告调度
      */
-    @Scheduled(cron = "0 0 8 * * ?")
+//    @Scheduled(cron = "0 0 8 * * ?")
 //    或直接指定时间间隔,例如:5秒
 //    @Scheduled(fixedRate=5000)
     private void configureTasks1() {
@@ -54,6 +57,24 @@ public class HealthreportTask {
 
     }
 
+    @Scheduled(cron = "0 30 7 * * ?")
+//    或直接指定时间间隔,例如:5秒
+//    @Scheduled(fixedRate=5000)
+    private void configureTasks44() {
+        Date yestday = DateUtils.getYestday(new Date());
+        String date = DateUtils.toDate1(yestday);
+        healthReportNewService.saveHealthwtreport1(date);
+        healthReportNewService.saveHealthwtreport2(date);
+        healthReportNewService.saveHealthwtreport3(date);
+        healthReportNewService.saveHealthwtreport456(date);
+        healthReportNewService.saveHealthwtreport7(date);
+        healthReportNewService.saveHealthwtreport8(date);
+        healthReportNewService.saveDfpcl(date);
+        healthReportNewService.savePartdanger(date);
+        healthReportNewService.savePartpower(date);
+
+    }
+
     //@Scheduled(cron = "0 0 5 * * ?")
     //或直接指定时间间隔,例如:5秒
     //@Scheduled(fixedRate=5000)
@@ -117,7 +138,7 @@ public class HealthreportTask {
     /**
      * 健康报告
      */
-    @Scheduled(cron = "0 33 9 * * ?")
+    @Scheduled(cron = "0 33 10 * * ?")
     //或直接指定时间间隔,例如:5秒
     //@Scheduled(fixedRate=5000)
     private void configureTasks7() throws UnsupportedEncodingException, JsonProcessingException {

+ 14 - 3
web/healthmanagement-web-hb/src/main/java/com/gyee/healthmanagement/vo/HealthReportVo.java

@@ -39,6 +39,16 @@ public class HealthReportVo implements Serializable {
     private Integer yygzgzcs;
     private Integer dwjcgzcs;
 
+    private Double dyfnlyl;
+    private Double syfnlyl;
+    private Double ssyfnlyl;
+    private Double dysbklyl;
+    private Double sysbklyl;
+    private Double ssysbklyl;
+    private Double dyxnpj;
+    private Double syxnpj;
+    private Double ssyxnpj;
+
 
     //------------------------------------------------------------------------性能开始------------------------------------------------------------------------
     //曲线拟合及偏差率
@@ -46,15 +56,16 @@ public class HealthReportVo implements Serializable {
     private Double threeqxpcl;   //3-5
     private Double fiveqxpcl;    //5-8
     private Double elevenqxpcl;   //11-25
+    private String compareqxpclname; //高于或者低于
     private Double compareqxpcl;   //与型号平均值相比
-    private String descriptionqxpcl;  //曲线偏差率说明
+    //private String descriptionqxpcl;  //曲线偏差率说明
     private List<NhglVo> nhglqxs;    //拟合功率曲线(风速,拟合功率,保证功率,点值)
     private List<QxpclVo>  qxpcls;   //曲线偏差率曲线(日期,曲线偏差率,基准值)
     //对风偏差
     private Integer withincount;   //15以内频次
     private Integer beyondcount;   //15以外频次
     private Double dfpcl;   //对风偏差率
-    private Double comparedfpcl;  //与型号平均值对比
+    //private Double comparedfpcl;  //与型号平均值对比
     private Double threedfpcl;   //3-5
     private Double fivedfpcl;    //5-11
     private Double elevendfpcl; //11-25
@@ -119,7 +130,7 @@ public class HealthReportVo implements Serializable {
     private Integer bjlh;  //变桨
     private Integer zzlh;  //主轴
     private List<PartLhVo> partLhs;  //部件劣化频次总览(时间周期	发电机	齿轮箱	变桨	主轴	总计)
-//    //发电机
+    //    //发电机
 //    List<FdljkzsVo> fdljkzs;   //发电机健康走势
 //    //齿轮箱
 //    List<ClxjkzsVo> clxjkzs;   //齿轮箱健康走势