Parcourir la source

修改实时理论功率绑定测点

shilin il y a 1 an
Parent
commit
6e3a6ada89

+ 6 - 0
realtime/failurestatistics-server/pom.xml

@@ -149,6 +149,12 @@
             <scope>system</scope>
             <systemPath>${basedir}/lib/xxl-job-core-2.3.1-SNAPSHOT.jar</systemPath>
         </dependency>
+
+        <dependency>
+            <groupId>com.taosdata.jdbc</groupId>
+            <artifactId>taos-jdbcdriver</artifactId>
+            <version>3.2.2</version>
+        </dependency>
     </dependencies>
     <build>
         <plugins>

+ 5 - 14
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/FailurestatisticsMain.java

@@ -1,8 +1,5 @@
 package com.gyee.failurestatistics;
 
-import com.gyee.failurestatistics.service.ShutdowneventService;
-import com.gyee.failurestatistics.task.SaticScheduleTask;
-import com.gyee.failurestatistics.util.SpringUtils;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -17,17 +14,11 @@ public class FailurestatisticsMain {
         SpringApplication.run(FailurestatisticsMain.class, args);
 
 
-        ShutdowneventService shutdowneventService = SpringUtils.getBean("shutdowneventService");
-
-        System.out.println("开始");
-        SaticScheduleTask saticScheduleTask= SpringUtils.getBean("saticScheduleTask");
-//        saticScheduleTask.configureTasks1();
-//        saticScheduleTask.configureTasks2();
-//        saticScheduleTask.configureTasks3();
-//        saticScheduleTask.configureTasks4();
-//        saticScheduleTask.configureTasks5();
-
-
+//        ParttemperatureService parttemperatureService = SpringUtils.getBean("parttemperatureService");
+//
+//        System.out.println("开始");
+//
+//        parttemperatureService.saveParttemperaturestattics();
         System.out.println("结束");
     }
 }

+ 39 - 25
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/mapper/auto/ProEconEarlyWarningMainMapper.java

@@ -26,38 +26,52 @@ public interface ProEconEarlyWarningMainMapper extends BaseMapper<ProEconEarlyWa
 
     @Delete(" delete from pro_econ_early_warning_main where record_date=#{recorddate} ")
     public int deleteEarlywarningmain(@Param(value = "recorddate") Date recorddate);
+//
+//
+//
+//
+//    @DS("slave")
+//    @Select(" select  t.stationid wpId,t.windturbineid wtId,max(t.num) eventnum from ( " +
+//            " select  stationid,windturbineid,alertvalue,alerttext,SUM(t.num) num from ( " +
+//            " SELECT  a.stationid,a.windturbineid,a.alertvalue,a.alerttext,a.num FROM (select s.stationid,s.windturbineid,s.alertvalue,s.alerttext,count(*) num  from ${alerthistory1} h,alarmsnap s where h.snapid =s.id and s.category1='custom'  and s.category1='custom' and" +
+//            "    h.messagetype='1' and s.windturbineid is not null  and h.alerttime>=#{beginDate}  and h.alerttime<=#{endDate}" +
+//            "       group by  s.stationid,s.alertvalue,s.alerttext,s.windturbineid order by s.windturbineid,num desc ) a " +
+//            "        UNION ALL " +
+//            " SELECT  b.stationid,b.windturbineid,b.alertvalue,b.alerttext,b.num FROM (select s.stationid,s.windturbineid,s.alertvalue,s.alerttext,count(*) num  from ${alerthistory2} h,alarmsnap s where h.snapid =s.id and s.category1='custom'  and s.category1='custom' and" +
+//            "    h.messagetype='1' and s.windturbineid is not null  and h.alerttime>=#{beginDate}  and h.alerttime<=#{endDate}" +
+//            "       group by  s.stationid,s.alertvalue,s.alerttext,s.windturbineid order by s.windturbineid,num desc ) b " +
+//            "             ) t group by t.stationid,t.windturbineid,alertvalue,alerttext order by t.windturbineid,num desc" +
+//            "               ) t group by t.stationid,t.windturbineid order by  t.stationid,eventnum desc,t.windturbineid ")
+//    public List<EventVo> getCountOrderNum(@Param(value = "alerthistory1")String alerthistory1, @Param(value = "alerthistory2")String alerthistory2, @Param(value = "beginDate")Date beginDate, @Param(value = "endDate")Date endDate);
+//
+//    @DS("slave")
+//    @Select("  select  wtId,warnId,warnName,sum(eventnum) eventnum  from ( " +
+//            "  select  a.wtId,a.warnId,a.warnName,a.eventnum  FROM ( select s.windturbineid wtId,s.alertvalue warnId,s.alerttext warnName,count(*) eventnum  from ${alerthistory1} h,alarmsnap s where h.snapid =s.id and s.category1='custom' and h.messagetype='1' and s.windturbineid is not null  and h.alerttime>=#{beginDate}  and h.alerttime<=#{endDate} " +
+//            "       group by  s.stationid,s.alertvalue,s.alerttext,s.windturbineid order by s.windturbineid,eventnum desc ) a " +
+//            "        UNION ALL " +
+//            "    select  b.wtId,b.warnId,b.warnName,b.eventnum  FROM ( select s.windturbineid wtId,s.alertvalue warnId,s.alerttext warnName,count(*) eventnum  from ${alerthistory2} h,alarmsnap s where h.snapid =s.id and s.category1='custom' and h.messagetype='1' and s.windturbineid is not null  and h.alerttime>=#{beginDate}  and h.alerttime<=#{endDate} " +
+//            "       group by  s.stationid,s.alertvalue,s.alerttext,s.windturbineid order by s.windturbineid,eventnum desc ) b " +
+//            "             ) t group by warnId,warnName,wtId order by wtId,eventnum desc")
+//    public List<EventVo> getCountMap(@Param(value = "alerthistory1")String alerthistory1,@Param(value = "alerthistory2")String alerthistory2,@Param(value = "beginDate")Date beginDate, @Param(value = "endDate")Date endDate);
+//    @DS("slave")
+//    @Select("   select a.id,a.windTurbineId,a.warningId, a.warnDesc, a.stopTime FROM ( select h.id id,s.windturbineid windTurbineId,s.alertvalue warningId,s.alerttext warnDesc,h.alerttime stopTime  from  from ${alerthistory1} h,alarmsnap s where h.snapid =s.id and s.category1='custom' and h.messagetype='1' and s.windturbineid is not null  and h.alerttime>=#{beginDate}  and h.alerttime<=#{endDate}  order by s.windturbineid,h.alerttime desc) a" +
+//            "        UNION  " +
+//            " select b.id,b.windTurbineId,b.warningId, b.warnDesc, b.stopTime  FROM ( select h.id id,s.windturbineid windTurbineId,s.alertvalue warningId,s.alerttext warnDesc,h.alerttime stopTime  from  from ${alerthistory2} h,alarmsnap s where h.snapid =s.id and s.category1='custom' and h.messagetype='1' and s.windturbineid is not null  and h.alerttime>=#{beginDate}  and h.alerttime<=#{endDate}  b " +
+//            "      order by s.windturbineid,h.alerttime desc)")
+//    public List<ShutdowneventVo> getEventMap(@Param(value = "alerthistory1")String alerthistory1, @Param(value = "alerthistory2")String alerthistory2, @Param(value = "beginDate")Date beginDate, @Param(value = "endDate")Date endDate);
 
 
 
 
     @DS("slave")
-    @Select(" select  t.stationid wpId,t.windturbineid wtId,max(t.num) eventnum from ( " +
-            " select  stationid,windturbineid,alertvalue,alerttext,SUM(t.num) num from ( " +
-            " SELECT  a.stationid,a.windturbineid,a.alertvalue,a.alerttext,a.num FROM (select s.stationid,s.windturbineid,s.alertvalue,s.alerttext,count(*) num  from ${alerthistory1} h,alarmsnap s where h.snapid =s.id and s.category1='custom'  and s.category1='custom' and" +
-            "    h.messagetype='1' and s.windturbineid is not null  and h.alerttime>=#{beginDate}  and h.alerttime<=#{endDate}" +
-            "       group by  s.stationid,s.alertvalue,s.alerttext,s.windturbineid order by s.windturbineid,num desc ) a " +
-            "        UNION ALL " +
-            " SELECT  b.stationid,b.windturbineid,b.alertvalue,b.alerttext,b.num FROM (select s.stationid,s.windturbineid,s.alertvalue,s.alerttext,count(*) num  from ${alerthistory2} h,alarmsnap s where h.snapid =s.id and s.category1='custom'  and s.category1='custom' and" +
-            "    h.messagetype='1' and s.windturbineid is not null  and h.alerttime>=#{beginDate}  and h.alerttime<=#{endDate}" +
-            "       group by  s.stationid,s.alertvalue,s.alerttext,s.windturbineid order by s.windturbineid,num desc ) b " +
-            "             ) t group by t.stationid,t.windturbineid,alertvalue,alerttext order by t.windturbineid,num desc" +
-            "               ) t group by t.stationid,t.windturbineid order by  t.stationid,eventnum desc,t.windturbineid ")
-    public List<EventVo> getCountOrderNum(@Param(value = "alerthistory1")String alerthistory1, @Param(value = "alerthistory2")String alerthistory2, @Param(value = "beginDate")Date beginDate, @Param(value = "endDate")Date endDate);
+    @Select("select  stationid as wpId,deviceid as wtId,count(*) as eventnum from alarmWt where ts>=#{begin} and ts<=#{end} group by stationid ,deviceid order by wtId,eventnum desc")
+    public List<EventVo> getCountOrderNum(@Param(value = "begin")long begin, @Param(value = "end")long end);
 
     @DS("slave")
-    @Select("  select  wtId,warnId,warnName,sum(eventnum) eventnum  from ( " +
-            "  select  a.wtId,a.warnId,a.warnName,a.eventnum  FROM ( select s.windturbineid wtId,s.alertvalue warnId,s.alerttext warnName,count(*) eventnum  from ${alerthistory1} h,alarmsnap s where h.snapid =s.id and s.category1='custom' and h.messagetype='1' and s.windturbineid is not null  and h.alerttime>=#{beginDate}  and h.alerttime<=#{endDate} " +
-            "       group by  s.stationid,s.alertvalue,s.alerttext,s.windturbineid order by s.windturbineid,eventnum desc ) a " +
-            "        UNION ALL " +
-            "    select  b.wtId,b.warnId,b.warnName,b.eventnum  FROM ( select s.windturbineid wtId,s.alertvalue warnId,s.alerttext warnName,count(*) eventnum  from ${alerthistory2} h,alarmsnap s where h.snapid =s.id and s.category1='custom' and h.messagetype='1' and s.windturbineid is not null  and h.alerttime>=#{beginDate}  and h.alerttime<=#{endDate} " +
-            "       group by  s.stationid,s.alertvalue,s.alerttext,s.windturbineid order by s.windturbineid,eventnum desc ) b " +
-            "             ) t group by warnId,warnName,wtId order by wtId,eventnum desc")
-    public List<EventVo> getCountMap(@Param(value = "alerthistory1")String alerthistory1,@Param(value = "alerthistory2")String alerthistory2,@Param(value = "beginDate")Date beginDate, @Param(value = "endDate")Date endDate);
+    @Select("select  deviceid as wtId,alarmid as warnId,description as warnName,count(*) as eventnum from alarmWt where ts>=#{begin} and ts<=#{end} group by deviceid,alarmid ,description  order by wtId,eventnum desc")
+    public List<EventVo> getCountMap(@Param(value = "begin")long begin, @Param(value = "end")long end);
     @DS("slave")
-    @Select("   select a.id,a.windTurbineId,a.warningId, a.warnDesc, a.stopTime FROM ( select h.id id,s.windturbineid windTurbineId,s.alertvalue warningId,s.alerttext warnDesc,h.alerttime stopTime  from  from ${alerthistory1} h,alarmsnap s where h.snapid =s.id and s.category1='custom' and h.messagetype='1' and s.windturbineid is not null  and h.alerttime>=#{beginDate}  and h.alerttime<=#{endDate}  order by s.windturbineid,h.alerttime desc) a" +
-            "        UNION  " +
-            " select b.id,b.windTurbineId,b.warningId, b.warnDesc, b.stopTime  FROM ( select h.id id,s.windturbineid windTurbineId,s.alertvalue warningId,s.alerttext warnDesc,h.alerttime stopTime  from  from ${alerthistory2} h,alarmsnap s where h.snapid =s.id and s.category1='custom' and h.messagetype='1' and s.windturbineid is not null  and h.alerttime>=#{beginDate}  and h.alerttime<=#{endDate}  b " +
-            "      order by s.windturbineid,h.alerttime desc)")
-    public List<ShutdowneventVo> getEventMap(@Param(value = "alerthistory1")String alerthistory1, @Param(value = "alerthistory2")String alerthistory2, @Param(value = "beginDate")Date beginDate, @Param(value = "endDate")Date endDate);
+    @Select("select  deviceid as windTurbineId,alarmid as warningId,description as warnDesc,ts from alarmWt where ts>=#{begin} and ts<=#{end}   order by windTurbineId,ts desc")
+    public List<ShutdowneventVo> getEventMap( @Param(value = "begin")long begin, @Param(value = "end")long end);
 
 }

+ 23 - 12
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/mapper/auto/ProEconFailureStatisticMainMapper.java

@@ -26,25 +26,36 @@ public interface ProEconFailureStatisticMainMapper extends BaseMapper<ProEconFai
 
 
 
-    @Select(" select  s.windpowerstation_id wpId,s.windturbine_id wtId,max(s.num) eventnum " +
-            "            from (select t.windpowerstation_id,t.windturbine_id,w.id,w.chinese_text,count(*) num " +
-            "            from pro_econ_shutdown_event t ,pro_econ_warning w,pro_basic_equipment b WHERE " +
-            "               cast(t.warning_id as integer )=w.edna_value and t.windturbine_id=b.id   and  t.stop_time>=#{beginDate} " +
-            "            and t.stop_time<=#{endDate}  group by t.windpowerstation_id,w.id,w.chinese_text,t.windturbine_id order by t.windturbine_id,num desc) s " +
-            "             group by s.windpowerstation_id,s.windturbine_id order by  s.windpowerstation_id,eventnum desc,s.windturbine_id ")
-
+//    @Select(" select  s.windpowerstation_id wpId,s.windturbine_id wtId,max(s.num) eventnum " +
+//            "            from (select t.windpowerstation_id,t.windturbine_id,w.id,w.chinese_text,count(*) num " +
+//            "            from pro_econ_shutdown_event t ,pro_econ_warning w,pro_basic_equipment b WHERE " +
+//            "               cast(t.warning_id as integer )=w.edna_value and t.windturbine_id=b.id   and  t.stop_time>=#{beginDate} " +
+//            "            and t.stop_time<=#{endDate}  group by t.windpowerstation_id,w.id,w.chinese_text,t.windturbine_id order by t.windturbine_id,num desc) s " +
+//            "             group by s.windpowerstation_id,s.windturbine_id order by  s.windpowerstation_id,eventnum desc,s.windturbine_id ")
+@Select(" select  s.windpowerstation_id wpId,s.windturbine_id wtId,max(s.num) eventnum " +
+        "            from (select t.windpowerstation_id,t.windturbine_id,w.id,w.description,count(*) num " +
+        "            from pro_econ_shutdown_event t ,pro_econ_alarm_configuration w,pro_basic_equipment b WHERE " +
+        "               t.warning_id =w.id and t.windturbine_id=b.id   and  t.stop_time>=#{beginDate} " +
+        "            and t.stop_time<=#{endDate}  group by t.windpowerstation_id,w.id,w.description,t.windturbine_id order by t.windturbine_id,num desc) s " +
+        "             group by s.windpowerstation_id,s.windturbine_id order by  s.windpowerstation_id,eventnum desc,s.windturbine_id ")
     public List<EventVo> getCountOrderNum(@Param(value = "beginDate")Date beginDate, @Param(value = "endDate")Date endDate);
 
 
-    @Select("select t.windturbine_id wtId,w.id warnId,w.chinese_text warnName,count(*) eventnum from pro_econ_shutdown_event t ,pro_econ_warning w,pro_basic_equipment b WHERE  " +
-            "               cast(t.warning_id as integer )=w.edna_value and t.windturbine_id=b.id   and t.stop_time>=#{beginDate} and t.stop_time<=#{endDate}  group by w.id,w.chinese_text,t.windturbine_id  " +
+//    @Select("select t.windturbine_id wtId,w.id warnId,w.chinese_text warnName,count(*) eventnum from pro_econ_shutdown_event t ,pro_econ_warning w,pro_basic_equipment b WHERE  " +
+//            "               cast(t.warning_id as integer )=w.edna_value and t.windturbine_id=b.id   and t.stop_time>=#{beginDate} and t.stop_time<=#{endDate}  group by w.id,w.chinese_text,t.windturbine_id  " +
+//            "            order by t.windturbine_id,eventnum desc  ")
+    @Select("select t.windturbine_id wtId,w.id warnId,w.description warnName,count(*) eventnum from pro_econ_shutdown_event t ,pro_econ_alarm_configuration w,pro_basic_equipment b WHERE  " +
+            "               t.warning_id =w.id  and t.windturbine_id=b.id   and t.stop_time>=#{beginDate} and t.stop_time<=#{endDate}  group by w.id,w.description,t.windturbine_id  " +
             "            order by t.windturbine_id,eventnum desc  ")
-
     public List<EventVo> getCountMap(@Param(value = "beginDate")Date beginDate, @Param(value = "endDate")Date endDate);
 
 
-    @Select(" select t.id,t.windturbine_id,t.warning_id,w.chinese_text warnDesc,t.stop_time,t.start_time,t.stop_hours,t.loss_power from pro_econ_shutdown_event t ,pro_econ_warning w,pro_basic_equipment b WHERE  " +
-            "               cast(t.warning_id as integer )=w.edna_value and t.windturbine_id=b.id  and t.stop_time>=#{beginDate} and t.stop_time<=#{endDate}  order by t.windturbine_id,t.start_time desc  ")
+//    @Select(" select t.id,t.windturbine_id,t.warning_id,w.chinese_text warnDesc,t.stop_time,t.start_time,t.stop_hours,t.loss_power from pro_econ_shutdown_event t ,pro_econ_warning w,pro_basic_equipment b WHERE  " +
+//            "               cast(t.warning_id as integer )=w.edna_value and t.windturbine_id=b.id  and t.stop_time>=#{beginDate} and t.stop_time<=#{endDate}  order by t.windturbine_id,t.start_time desc  ")
+//
+
+    @Select(" select t.id,t.windturbine_id,t.warning_id,w.description warnDesc,t.stop_time,t.start_time,t.stop_hours,t.loss_power from pro_econ_shutdown_event t ,pro_econ_alarm_configuration w,pro_basic_equipment b WHERE  " +
+            "               t.warning_id =w.id and t.windturbine_id=b.id  and t.stop_time>=#{beginDate} and t.stop_time<=#{endDate}  order by t.windturbine_id,t.start_time desc  ")
 
     public List<ShutdowneventVo> getEventMap(@Param(value = "beginDate")Date beginDate, @Param(value = "endDate")Date endDate);
 

+ 3 - 3
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/EarlywarningService.java

@@ -415,7 +415,7 @@ public class EarlywarningService {
         if (StringUtils.notEmp(alerthistory1) && StringUtils.notEmp(alerthistory2) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
 
 
-            List<EventVo> list =proEconEarlyWarningMainService.getCountMap(alerthistory1,alerthistory2,beginDate, endDate);
+            List<EventVo> list =proEconEarlyWarningMainService.getCountMap(beginDate.getTime(), endDate.getTime());
 
             if (!list.isEmpty()) {
                 for (EventVo vo : list) {
@@ -452,7 +452,7 @@ public class EarlywarningService {
 
         if (StringUtils.notEmp(alerthistory1) && StringUtils.notEmp(alerthistory2) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
 
-            List<EventVo> list = proEconEarlyWarningMainService.getCountOrderNum(alerthistory1,alerthistory2,beginDate, endDate);
+            List<EventVo> list = proEconEarlyWarningMainService.getCountOrderNum(beginDate.getTime(), endDate.getTime());
 
             if (!list.isEmpty()) {
                 String wpId = list.get(0).getWpId();
@@ -561,7 +561,7 @@ public class EarlywarningService {
         if (StringUtils.notEmp(alerthistory1) && StringUtils.notEmp(alerthistory2) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
 
 
-            List<ShutdowneventVo> list = proEconEarlyWarningMainService.getEventMap(alerthistory1,alerthistory2,beginDate, endDate);
+            List<ShutdowneventVo> list = proEconEarlyWarningMainService.getEventMap(beginDate.getTime(), endDate.getTime());
 
             if (!list.isEmpty()) {
                 for (ShutdowneventVo vo : list) {

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

@@ -204,14 +204,14 @@ public class ParttemperatureService {
                             subls.add(sub);
                         }
 
-                        proEconPartTemperatureSubService.saveOrUpdateBatch(subls);
+                        proEconPartTemperatureSubService.saveBatch(subls);
 
                         po.setTsnumber(num);
                         vos.add(po);
                       //  insertParttemperaturemain(po);
                     }
 
-                    proEconPartTemperatureMainService.saveOrUpdateBatch(vos);
+                    proEconPartTemperatureMainService.saveBatch(vos);
 
                 } else {
                     //System.out.println("初始化当日数据报错!");
@@ -398,14 +398,13 @@ public class ParttemperatureService {
                     for (PointData pd : pointls) {
                         Date date = DateUtils.parseLongToDate(pd.getPointTime() * 1000);
                         double value=pd.getPointValueInDouble();
-                        if(value>max || value<min)
+                        if(pointls.size()>1)
                         {
-                            resultmap.put(df2.format(date), 1.0);
-                        }else
-                        {
-                            resultmap.put(df2.format(date), 0.0);
+                            if(value<=max && value>=min )
+                            {
+                                resultmap.put(df2.format(date), 1.0);
+                            }
                         }
-
                     }
 
                 }

+ 10 - 3
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/auto/IProEconEarlyWarningMainService.java

@@ -27,9 +27,16 @@ public interface IProEconEarlyWarningMainService extends IService<ProEconEarlyWa
 
         public int insertEarlywarningmain(ProEconEarlyWarningMain earlywarningmain);
 
-        public List<EventVo> getCountMap(String alerthistory1,String alerthistory2, Date beginDate, Date endDate);
+//        public List<EventVo> getCountMap(String alerthistory1,String alerthistory2, Date beginDate, Date endDate);
+//
+//        public List<EventVo> getCountOrderNum(String alerthistory1,String alerthistory2,Date beginDate, Date endDate);
+//
+//        public List<ShutdowneventVo> getEventMap(String alerthistory1,String alerthistory2,Date beginDate, Date endDate);
 
-        public List<EventVo> getCountOrderNum(String alerthistory1,String alerthistory2,Date beginDate, Date endDate);
 
-        public List<ShutdowneventVo> getEventMap(String alerthistory1,String alerthistory2,Date beginDate, Date endDate);
+    public List<EventVo> getCountOrderNum(long begin, long end);
+
+    public List<EventVo> getCountMap(long begin, long end);
+
+    public List<ShutdowneventVo> getEventMap(long begin, long end);
 }

+ 6 - 6
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/auto/impl/ProEconEarlyWarningMainServiceImpl.java

@@ -61,17 +61,17 @@ public class ProEconEarlyWarningMainServiceImpl extends ServiceImpl<ProEconEarly
         }
 
         @Override
-        public List<EventVo> getCountMap(String alerthistory1,String alerthistory2,Date beginDate, Date endDate) {
-            return proEconEarlyWarningMainMapper.getCountMap(alerthistory1,alerthistory2,beginDate, endDate);
+        public List<EventVo> getCountMap(long beginDate, long endDate) {
+            return proEconEarlyWarningMainMapper.getCountMap(beginDate, endDate);
         }
 
         @Override
-        public List<EventVo> getCountOrderNum(String alerthistory1,String alerthistory2,Date beginDate, Date endDate) {
-            return proEconEarlyWarningMainMapper.getCountOrderNum(alerthistory1,alerthistory2,beginDate, endDate);
+        public List<EventVo> getCountOrderNum(long beginDate, long endDate) {
+            return proEconEarlyWarningMainMapper.getCountOrderNum(beginDate, endDate);
         }
 
         @Override
-        public List<ShutdowneventVo> getEventMap(String alerthistory1,String alerthistory2,Date beginDate, Date endDate) {
-            return proEconEarlyWarningMainMapper.getEventMap(alerthistory1,alerthistory2,beginDate, endDate);
+        public List<ShutdowneventVo> getEventMap(long beginDate, long endDate) {
+            return proEconEarlyWarningMainMapper.getEventMap(beginDate, endDate);
         }
 }

+ 53 - 53
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/util/realtimesource/EdosUtil.java

@@ -475,59 +475,59 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
                         getHistsnapSameTiem(point.getNemCode(), beginDate, pried, resultList);
                     }else
                     {
-
-                        if(StringUtils.notEmp(pointid) && !pointid.startsWith(JKFC) && !pointid.startsWith(JKFJ))
-                        {
-                            resultList=snapList;
-                        }else
-                        {
-
-                            for (PointData snapItem : snapList) {
-
-                                long subTime = snapItem.getPointTime() - pried;
-                                //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
-                                // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
-                                // 则代表该时间节点快照有效,否则为0
-                                String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getNemCode() + "&ts=" + snapItem.getPointTime() + "000";
-                                ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
-                                JSONObject jsonObjectSection = sectionResp.getBody();
-
-                                if (jsonObjectSection != null) {
-                                    List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
-                                    if (sectionlist.size() > 0) {
-                                        if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
-                                            resultList.add(snapItem);
-                                        }
-                                        else{
-                                            PointData data = new PointData();
-                                            data.setEdnaId(point.getNemCode());
-                                            data.setPointTime(snapItem.getPointTime());
-                                            data.setPointValue("0");
-                                            data.setPointName("1");
-                                            data.setPointValueInDouble(0.0);
-                                            resultList.add(data);
-                                        }
-                                    } else {
-                                        PointData data = new PointData();
-                                        data.setEdnaId(point.getNemCode());
-                                        data.setPointTime(snapItem.getPointTime());
-                                        data.setPointValue("0");
-                                        data.setPointName("1");
-                                        data.setPointValueInDouble(0.0);
-                                        resultList.add(data);
-                                    }
-                                } else {
-                                    PointData data = new PointData();
-                                    data.setEdnaId(point.getNemCode());
-                                    data.setPointTime(snapItem.getPointTime());
-                                    data.setPointValue("0");
-                                    data.setPointName("1");
-                                    data.setPointValueInDouble(0.0);
-                                    resultList.add(data);
-                                }
-                            }
-
-                        }
+                        resultList=snapList;
+//                        if(StringUtils.notEmp(pointid) && !pointid.startsWith(JKFC) && !pointid.startsWith(JKFJ))
+//                        {
+//                            resultList=snapList;
+//                        }else
+//                        {
+//
+//                            for (PointData snapItem : snapList) {
+//
+//                                long subTime = snapItem.getPointTime() - pried;
+//                                //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
+//                                // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
+//                                // 则代表该时间节点快照有效,否则为0
+//                                String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getNemCode() + "&ts=" + snapItem.getPointTime() + "000";
+//                                ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
+//                                JSONObject jsonObjectSection = sectionResp.getBody();
+//
+//                                if (jsonObjectSection != null) {
+//                                    List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
+//                                    if (sectionlist.size() > 0) {
+//                                        if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
+//                                            resultList.add(snapItem);
+//                                        }
+//                                        else{
+//                                            PointData data = new PointData();
+//                                            data.setEdnaId(point.getNemCode());
+//                                            data.setPointTime(snapItem.getPointTime());
+//                                            data.setPointValue("0");
+//                                            data.setPointName("1");
+//                                            data.setPointValueInDouble(0.0);
+//                                            resultList.add(data);
+//                                        }
+//                                    } else {
+//                                        PointData data = new PointData();
+//                                        data.setEdnaId(point.getNemCode());
+//                                        data.setPointTime(snapItem.getPointTime());
+//                                        data.setPointValue("0");
+//                                        data.setPointName("1");
+//                                        data.setPointValueInDouble(0.0);
+//                                        resultList.add(data);
+//                                    }
+//                                } else {
+//                                    PointData data = new PointData();
+//                                    data.setEdnaId(point.getNemCode());
+//                                    data.setPointTime(snapItem.getPointTime());
+//                                    data.setPointValue("0");
+//                                    data.setPointName("1");
+//                                    data.setPointValueInDouble(0.0);
+//                                    resultList.add(data);
+//                                }
+//                            }
+//
+//                        }
                     }
 
 

+ 21 - 1
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/vo/ShutdowneventVo.java

@@ -1,6 +1,8 @@
 
 package com.gyee.failurestatistics.vo;
 
+import oracle.sql.TIMESTAMP;
+
 import java.io.Serializable;
 import java.util.Date;
 
@@ -35,7 +37,25 @@ public class ShutdowneventVo  implements Serializable {
 	private Integer statusCode;
 	private String modelId;
 	private String modelCode;
-	
+
+	private TIMESTAMP ts;
+
+	public Boolean getHandle() {
+		return isHandle;
+	}
+
+	public void setHandle(Boolean handle) {
+		isHandle = handle;
+	}
+
+	public TIMESTAMP getTs() {
+		return ts;
+	}
+
+	public void setTs(TIMESTAMP ts) {
+		this.ts = ts;
+	}
+
 	public String getModelId() {
     	return modelId;
     }

+ 3 - 1
realtime/failurestatistics-server/src/main/resources/application-hf.yml

@@ -59,7 +59,9 @@ mybatis-plus:
   configuration:
     map-underscore-to-camel-case: true
     auto-mapping-behavior: full
-    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+    #关闭sql日志
+    log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
   mapper-locations: classpath*:mapper/**/*Mapper.xml
   global-config:
     # 逻辑删除配置

+ 7 - 5
realtime/failurestatistics-server/src/main/resources/application-jn.yml

@@ -33,10 +33,10 @@ spring:
           password: postgres
           driver-class-name: org.postgresql.Driver
         slave:
-          url: jdbc:postgresql://10.81.3.151:5432/wisdom
-          username: postgres
-          password: gd123
-          driver-class-name: org.postgresql.Driver
+          driver-class-name: com.taosdata.jdbc.TSDBDriver
+          url: jdbc:TAOS://10.81.3.154:6030/nemjn?charset=UTF-8&locale=en_US.UTF-8&timezone=UTC-8
+          username: root
+          password: taosdata
     druid:
       max-active: 20
       initial-size: 1
@@ -62,7 +62,9 @@ mybatis-plus:
   configuration:
     map-underscore-to-camel-case: true
     auto-mapping-behavior: full
-    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+    #关闭sql日志
+    log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
   mapper-locations: classpath*:mapper/**/*Mapper.xml
   global-config:
     # 逻辑删除配置