Bläddra i källkod

优化后台计算算法

shilin 1 år sedan
förälder
incheckning
c2f946dfb7

+ 8 - 3
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/init/CacheContext.java

@@ -1,6 +1,7 @@
 package com.gyee.failurestatistics.init;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.failurestatistics.model.auto.*;
 import com.gyee.failurestatistics.service.auto.*;
 import org.slf4j.Logger;
@@ -151,7 +152,10 @@ public class CacheContext implements CommandLineRunner {
                 }
             }
         }
-        List<ProBasicEquipmentPoint> WindturbinetestingpointaiList = proBasicEquipmentPointService.list();
+
+        QueryWrapper<ProBasicEquipmentPoint> queryWrapper = new QueryWrapper<>();
+        queryWrapper.like("windpowerstation_id","FDC");
+        List<ProBasicEquipmentPoint> WindturbinetestingpointaiList = proBasicEquipmentPointService.list(queryWrapper);
         Map<String, ProBasicEquipmentPoint> map = null;
 
         if(WindturbinetestingpointaiList != null && !WindturbinetestingpointaiList.isEmpty()){
@@ -167,8 +171,9 @@ public class CacheContext implements CommandLineRunner {
             }
         }
 
-
-        List<ProBasicPowerstationPoint> wplist = proBasicPowerstationPointService.list();
+        QueryWrapper<ProBasicPowerstationPoint> queryWrapper2 = new QueryWrapper<>();
+        queryWrapper2.like("windpowerstation_id","FDC");
+        List<ProBasicPowerstationPoint> wplist = proBasicPowerstationPointService.list(queryWrapper2);
         for (ProBasicPowerstationPoint ProBasicPowerstationPoint : wplist) {
             if (wppointmap.containsKey(ProBasicPowerstationPoint.getWindpowerstationId())){
                 wppointmap.get(ProBasicPowerstationPoint.getWindpowerstationId()).put(ProBasicPowerstationPoint.getUniformCode(),ProBasicPowerstationPoint);

+ 2 - 2
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/mapper/auto/ProEconShutdownEventMapper.java

@@ -55,8 +55,8 @@ public interface ProEconShutdownEventMapper extends BaseMapper<ProEconShutdownEv
     @DS("slave")
     @Select(" select h.id id,s.windturbineid windTurbineId,s.alertvalue warningId,s.alerttext warnDesc,h.alerttime stopTime,s.category2 stopTypeId " +
             "  from ${alerthistory} h,alarmsnap s" +
-            "  where to_NUMBER(h.snapid) =to_NUMBER(s.id) and s.category1='windturbine' " +
-            " and h.messagetype=1 and s.windturbineid is not null " +
+            "  where h.snapid =s.id and s.category1='windturbine' " +
+            " and h.messagetype='1' and s.windturbineid is not null " +
             " and s.windturbineid=#{windturbineid} " +
 
             "    and h.alerttime>=#{beginDate} " +

+ 7 - 1
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/ParttemperatureService.java

@@ -291,7 +291,13 @@ public class ParttemperatureService {
         int num =0;
         int WDSTEP = 20;
         num = (int) value / WDSTEP;
-        sb.append(num * WDSTEP).append("-").append((num + 1) * WDSTEP);
+        if(num==0)
+        {
+            sb.append(num * WDSTEP).append("-").append((num + 1) * WDSTEP);
+        }else {
+            sb.append(num * WDSTEP+1).append("-").append((num + 1) * WDSTEP);
+        }
+
         return String.valueOf(sb);
     }
 

+ 4 - 1
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/auto/impl/ProEconFailureStatisticMainServiceImpl.java

@@ -39,7 +39,7 @@ public class ProEconFailureStatisticMainServiceImpl extends ServiceImpl<ProEconF
             Date endDate= DateUtils.addDays(recorddate,1);
             QueryWrapper<ProEconFailureStatisticMain> qw = new QueryWrapper<>();
             qw.eq("wt_id",wtId);
-            qw.ge("record_date",recorddate).le("record_date",endDate);
+            qw.ge("record_date",recorddate).lt("record_date",endDate);
 
             qw.orderByDesc("record_date");
             list = proEconFailureStatisticMainMapper.selectList(qw);
@@ -74,4 +74,7 @@ public class ProEconFailureStatisticMainServiceImpl extends ServiceImpl<ProEconF
     public List<ShutdowneventVo> getEventMap(Date beginDate, Date endDate) {
         return proEconFailureStatisticMainMapper.getEventMap(beginDate, endDate);
     }
+
+
+
 }