فهرست منبع

Merge remote-tracking branch 'origin/dev_v1.0.0' into dev_v1.0.0

秦国才 1 سال پیش
والد
کامیت
f4947f9cd9
21فایلهای تغییر یافته به همراه174 افزوده شده و 26 حذف شده
  1. 8 1
      ruoyi-system/src/main/java/com/ruoyi/system/domain/SiteInfo.java
  2. 5 2
      ruoyi-system/src/main/java/com/ruoyi/system/dto/SiteRealTimeDTO.java
  3. 1 1
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/BerthingTimeConfigMapper.java
  4. 4 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/SiteInfoMapper.java
  5. 4 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/DirectiveService.java
  6. 1 2
      ruoyi-system/src/main/java/com/ruoyi/system/service/ReportDataService.java
  7. 1 1
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BerthingServiceImpl.java
  8. 30 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DirectiveServiceImpl.java
  9. 1 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ReportDataServiceImpl.java
  10. 10 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SaveDataServiceImpl.java
  11. 1 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SiteServiceImpl.java
  12. 35 0
      ruoyi-system/src/main/java/com/ruoyi/system/task/DeviceStatusTask.java
  13. 1 1
      ruoyi-system/src/main/resources/mapper/BerthingFloatConfigMapper.xml
  14. 1 1
      ruoyi-system/src/main/resources/mapper/BerthingPointConfigMapper.xml
  15. 1 1
      ruoyi-system/src/main/resources/mapper/BerthingTimeConfigMapper.xml
  16. 25 10
      ruoyi-system/src/main/resources/mapper/SiteInfoMapper.xml
  17. 11 0
      ruoyi-ui/src/views/analysis/task/realtime/realtime.vue
  18. 29 0
      ruoyi-ui/src/views/analysis/task/realtime/simulation.vue
  19. 2 1
      ruoyi-ui/src/views/analysis/task/waiting/manual.vue
  20. 1 5
      ruoyi-ui/src/views/site/plain-time/index.vue
  21. 2 0
      waterAffairs-admin/src/main/java/com/ruoyi/RuoYiApplication.java

+ 8 - 1
ruoyi-system/src/main/java/com/ruoyi/system/domain/SiteInfo.java

@@ -97,7 +97,14 @@ public class SiteInfo implements Serializable {
      * 远程摄像头密码
      */
     private String videoPwd;
-    
+
+
+    /**
+     * 远程设备状态 0.离线 1.在线
+     */
+    private Integer deviceStatus;
+
+
 
 }
 

+ 5 - 2
ruoyi-system/src/main/java/com/ruoyi/system/dto/SiteRealTimeDTO.java

@@ -2,8 +2,6 @@ package com.ruoyi.system.dto;
 
 import lombok.Data;
 
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotNull;
 import java.io.Serializable;
 
 /**
@@ -33,6 +31,11 @@ public class SiteRealTimeDTO implements Serializable {
     private String siteStatus;
 
 
+    /**
+     * 设备状态 0.离线 1.在线
+     */
+    private Integer deviceStatus;
+
     /**
      * 下次测流时间
      */

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/mapper/BerthingTimeConfigMapper.java

@@ -29,7 +29,7 @@ public interface BerthingTimeConfigMapper {
      * @param siteId 站点id
      * @return 实例对象
      */
-    BerthingFloatConfig queryByMaxPlanid(Long siteId);
+    BerthingTimeConfig queryByMaxPlanid(Long siteId);
 
 
     /**

+ 4 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SiteInfoMapper.java

@@ -29,6 +29,10 @@ public interface SiteInfoMapper {
      */
     SiteInfo queryBySiteCode(String siteCode);
 
+
+
+    List<SiteInfo> queryAll();
+
     /**
      * 查询指定行数据
      *

+ 4 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/DirectiveService.java

@@ -3,10 +3,14 @@ package com.ruoyi.system.service;
 
 import com.ruoyi.system.dto.ManualMeasureDTO;
 
+import java.util.Date;
+
 public interface DirectiveService {
 
     boolean manualMeasure(ManualMeasureDTO manualMeasureDTO);
 
     boolean taskStop(Long siteId, Long action);
 
+    void queryHeartbeat(Date data);
+
 }

+ 1 - 2
ruoyi-system/src/main/java/com/ruoyi/system/service/ReportDataService.java

@@ -5,9 +5,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.system.domain.*;
 import com.ruoyi.system.dto.SiteRealTimeDTO;
 
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
+
 
 
 public interface ReportDataService {

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BerthingServiceImpl.java

@@ -348,7 +348,7 @@ public class BerthingServiceImpl implements BerthingService {
                 if (count > 0){
                     throw new BaseException("起测水位已存在");
                 }
-                BerthingFloatConfig maxPlanidTimeConfig = berthingTimeConfigMapper.queryByMaxPlanid(siteInfo.getSiteId());
+                BerthingTimeConfig maxPlanidTimeConfig = berthingTimeConfigMapper.queryByMaxPlanid(siteInfo.getSiteId());
                 if (maxPlanidTimeConfig == null) {
                     berthingTime.setPlanid(1L);
                 } else {

+ 30 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DirectiveServiceImpl.java

@@ -1,12 +1,15 @@
 package com.ruoyi.system.service.impl;
 
 
+import cn.hutool.core.date.DateUtil;
 import cn.hutool.json.JSONUtil;
 import com.ruoyi.common.exception.base.BaseException;
+import com.ruoyi.system.domain.HeartBeat;
 import com.ruoyi.system.domain.SiteInfo;
 import com.ruoyi.system.domain.TaskNotice;
 import com.ruoyi.system.domain.TaskResult;
 import com.ruoyi.system.dto.ManualMeasureDTO;
+import com.ruoyi.system.mapper.HeartBeatMapper;
 import com.ruoyi.system.mapper.SiteInfoMapper;
 import com.ruoyi.system.mapper.TaskNoticeMapper;
 import com.ruoyi.system.mapper.TaskResultMapper;
@@ -18,6 +21,7 @@ import org.springframework.stereotype.Service;
 import javax.annotation.Resource;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.List;
 
 
 /**
@@ -40,6 +44,9 @@ public class DirectiveServiceImpl implements DirectiveService {
     @Resource
     private TaskResultMapper taskResultMapper;
 
+    @Resource
+    private HeartBeatMapper heartBeatMapper;
+
     @Override
     public boolean manualMeasure(ManualMeasureDTO manualMeasureDTO) {
         SiteInfo siteInfo = siteInfoMapper.queryById(manualMeasureDTO.getSiteId());
@@ -131,6 +138,29 @@ public class DirectiveServiceImpl implements DirectiveService {
     }
 
 
+    @Override
+    public void queryHeartbeat(Date data){
+        List<SiteInfo> siteInfoList = siteInfoMapper.queryAll();
+        Date tenMinutesAgo = DateUtil.offsetMinute(data, - 10);  // 减去10分钟
+        String formattedTime = DateUtil.format(tenMinutesAgo, "yyyy-MM-dd HH:mm:ss");
+        for (SiteInfo siteInfo : siteInfoList) {
+            List<HeartBeat> heartBeatList = heartBeatMapper.queryBysiteIdTime(siteInfo.getSiteId(), formattedTime, DateUtil.format(data, "yyyy-MM-dd HH:mm:ss"));
+            if (heartBeatList.isEmpty()) {
+                if (siteInfo.getDeviceStatus() == 1) {
+                    TaskNotice taskNotice = new TaskNotice();
+                    taskNotice.setStartId(0L);
+                    taskNotice.setRemark("设备离线");
+                    taskNotice.setCreateTime(new Date());
+                    taskNotice.setSiteId(siteInfo.getSiteId());
+                    taskNoticeMapper.insert(taskNotice);
+                    siteInfo.setDeviceStatus(0);
+                    siteInfoMapper.update(siteInfo);
+                }
+            }
+        }
+    }
+
+
 
 
 

+ 1 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ReportDataServiceImpl.java

@@ -87,6 +87,7 @@ public class ReportDataServiceImpl implements ReportDataService {
         }
         siteRealTimeDTO.setSiteName(siteInfo.getSiteName());
         siteRealTimeDTO.setSiteId(siteId);
+        siteRealTimeDTO.setDeviceStatus(siteInfo.getDeviceStatus());
         //查询状态
         TaskResult taskResult = taskResultMapper.queryBySiteIdOne(siteId);
         if (taskResult == null){

+ 10 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SaveDataServiceImpl.java

@@ -108,7 +108,17 @@ public class SaveDataServiceImpl implements SaveDataService {
                 log.error("查询站点失败入库失败 站码:{}",heartBeat.getId());
                 return;
             }
+            if (siteInfo.getDeviceStatus() == 0){
+                TaskNotice taskNotice = new TaskNotice();
+                taskNotice.setStartId(0L);
+                taskNotice.setRemark("设备上线");
+                taskNotice.setCreateTime(new Date());
+                taskNotice.setSiteId(siteInfo.getSiteId());
+                taskNoticeMapper.insert(taskNotice);
+            }
+            siteInfo.setDeviceStatus(1);
             heartBeat.setSiteId(siteInfo.getSiteId());
+            siteInfoMapper.update(siteInfo);
             heartBeatMapper.insert(heartBeat);
             log.info("insert heartbeat:{}",heartBeat);
         } catch (Exception e) {

+ 1 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SiteServiceImpl.java

@@ -49,6 +49,7 @@ public class SiteServiceImpl implements SiteService {
             siteInfo.setSiteId(0L);
             siteInfo.setCreatTime(new Date());
             siteInfo.setIsDel(0);
+            siteInfo.setDeviceStatus(0);
             return siteInfoMapper.insert(siteInfo) > 0;
         } catch (Exception e){
             log.error("新增站点错误", e);

+ 35 - 0
ruoyi-system/src/main/java/com/ruoyi/system/task/DeviceStatusTask.java

@@ -0,0 +1,35 @@
+package com.ruoyi.system.task;
+
+import com.ruoyi.system.service.DirectiveService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.util.Date;
+
+@Slf4j
+@Component
+public class DeviceStatusTask {
+
+
+   @Resource
+   private DirectiveService directiveService;
+
+    /**
+     * 每10分钟执行 查询心跳信息
+     */
+    @Async
+    @Scheduled(cron = "0 */1 * * * ?")
+    public void queryHeartBeat() {
+        log.info("开始查询心跳");
+        directiveService.queryHeartbeat(new Date());
+    }
+
+
+
+}
+
+
+

+ 1 - 1
ruoyi-system/src/main/resources/mapper/BerthingFloatConfigMapper.xml

@@ -80,7 +80,7 @@
                 and is_del = #{isDel}
             </if>
             <if test="wlevel != null">
-                and wlevel = #{wlevel}
+                and ROUND(wlevel,2) = #{wlevel}
             </if>
             <if test="timespan != null">
                 and timespan = #{timespan}

+ 1 - 1
ruoyi-system/src/main/resources/mapper/BerthingPointConfigMapper.xml

@@ -93,7 +93,7 @@
                 and is_del = #{isDel}
             </if>
             <if test="wlevel != null">
-                and wlevel = #{wlevel}
+                and  ROUND(wlevel,2) = #{wlevel}
             </if>
             <if test="factors != null and factors != ''">
                 and factors = #{factors}

+ 1 - 1
ruoyi-system/src/main/resources/mapper/BerthingTimeConfigMapper.xml

@@ -93,7 +93,7 @@
                 and is_del = #{isDel}
             </if>
             <if test="wlevel != null">
-                and wlevel = #{wlevel}
+                and ROUND(wlevel, 2) = #{wlevel}
             </if>
             <if test="times != null and times != ''">
                 and times = #{times}

+ 25 - 10
ruoyi-system/src/main/resources/mapper/SiteInfoMapper.xml

@@ -22,12 +22,13 @@
         <result property="videoUser" column="video_user" jdbcType="VARCHAR"/>
         <result property="videoPwd" column="video_pwd" jdbcType="VARCHAR"/>
         <result property="videoPort" column="video_port" jdbcType="VARCHAR"/>
+        <result property="deviceStatus" column="device_status" jdbcType="INTEGER"/>
     </resultMap>
 
     <!--查询单个-->
     <select id="queryById" resultMap="SiteInfoMap">
         select
-            site_id, id, site_name, site_type, lon, lat, site_time, admin_region, manage_unit, affiliated_unit, contact_name, contact_phone, creat_time, is_del, device_id, video_url, video_user, video_pwd, video_port
+            site_id, id, site_name, site_type, lon, lat, site_time, admin_region, manage_unit, affiliated_unit, contact_name, contact_phone, creat_time, is_del, device_id, video_url, video_user, video_pwd, video_port, device_status
         from site_info
         where site_id = #{siteId}
     </select>
@@ -35,15 +36,25 @@
     <!--查询单个-->
     <select id="queryBySiteCode" resultMap="SiteInfoMap">
         select
-            site_id, id, site_name, site_type, lon, lat, site_time, admin_region, manage_unit, affiliated_unit, contact_name, contact_phone, creat_time, is_del, device_id, video_url, video_user, video_pwd, video_port
+            site_id, id, site_name, site_type, lon, lat, site_time, admin_region, manage_unit, affiliated_unit, contact_name, contact_phone, creat_time, is_del, device_id, video_url, video_user, video_pwd, video_port, device_status
         from site_info
         where id = #{siteCode} and is_del = 0
     </select>
 
+
+
+    <!--查询单个-->
+    <select id="queryAll" resultMap="SiteInfoMap">
+        select
+            site_id, id, site_name, site_type, lon, lat, site_time, admin_region, manage_unit, affiliated_unit, contact_name, contact_phone, creat_time, is_del, device_id, video_url, video_user, video_pwd, video_port, device_status
+        from site_info
+        where is_del = 0
+    </select>
+
     <!--查询指定行数据-->
     <select id="queryAllByLimit" resultMap="SiteInfoMap">
         select
-            site_id, id, site_name, site_type, lon, lat, site_time, admin_region, manage_unit, affiliated_unit, contact_name, contact_phone, creat_time, is_del, device_id, video_url, video_user, video_pwd, video_port
+            site_id, id, site_name, site_type, lon, lat, site_time, admin_region, manage_unit, affiliated_unit, contact_name, contact_phone, creat_time, is_del, device_id, video_url, video_user, video_pwd, video_port, device_status
         from site_info
         <where>
             <if test="siteInfoQuery.siteId != null">
@@ -120,23 +131,23 @@
 
     <!--新增所有列-->
     <insert id="insert" keyProperty="siteId" useGeneratedKeys="true">
-        insert into site_info(id, site_name, site_type, lon, lat, site_time, admin_region, manage_unit, affiliated_unit, contact_name, contact_phone, creat_time, is_del, device_id, video_url, video_user, video_pwd, video_port)
-        values (#{id}, #{siteName}, #{siteType}, #{lon}, #{lat}, #{siteTime}, #{adminRegion}, #{manageUnit}, #{affiliatedUnit}, #{contactName}, #{contactPhone}, #{creatTime}, #{isDel}, #{deviceId}, #{videoUrl}, #{videoUser}, #{videoPwd}, #{videoPort})
+        insert into site_info(id, site_name, site_type, lon, lat, site_time, admin_region, manage_unit, affiliated_unit, contact_name, contact_phone, creat_time, is_del, device_id, video_url, video_user, video_pwd, video_port, device_status)
+        values (#{id}, #{siteName}, #{siteType}, #{lon}, #{lat}, #{siteTime}, #{adminRegion}, #{manageUnit}, #{affiliatedUnit}, #{contactName}, #{contactPhone}, #{creatTime}, #{isDel}, #{deviceId}, #{videoUrl}, #{videoUser}, #{videoPwd}, #{videoPort}, #{deviceStatus})
     </insert>
 
     <insert id="insertBatch" keyProperty="siteId" useGeneratedKeys="true">
-        insert into site_info(id, site_name, site_type, lon, lat, site_time, admin_region, manage_unit, affiliated_unit, contact_name, contact_phone, creat_time, is_del, device_id, video_url, video_user, video_pwd, video_port)
+        insert into site_info(id, site_name, site_type, lon, lat, site_time, admin_region, manage_unit, affiliated_unit, contact_name, contact_phone, creat_time, is_del, device_id, video_url, video_user, video_pwd, video_port, device_status)
         values
         <foreach collection="entities" item="entity" separator=",">
-        (#{entity.id}, #{entity.siteName}, #{entity.siteType}, #{entity.lon}, #{entity.lat}, #{entity.siteTime}, #{entity.adminRegion}, #{entity.manageUnit}, #{entity.affiliatedUnit}, #{entity.contactName}, #{entity.contactPhone}, #{entity.creatTime}, #{entity.isDel}, #{entity.deviceId}, #{entity.videoUrl}, #{entity.videoUser}, #{entity.videoPwd}, #{entity.videoPort})
+        (#{entity.id}, #{entity.siteName}, #{entity.siteType}, #{entity.lon}, #{entity.lat}, #{entity.siteTime}, #{entity.adminRegion}, #{entity.manageUnit}, #{entity.affiliatedUnit}, #{entity.contactName}, #{entity.contactPhone}, #{entity.creatTime}, #{entity.isDel}, #{entity.deviceId}, #{entity.videoUrl}, #{entity.videoUser}, #{entity.videoPwd}, #{entity.videoPort}, #{entity.deviceStatus})
         </foreach>
     </insert>
 
     <insert id="insertOrUpdateBatch" keyProperty="siteId" useGeneratedKeys="true">
-        insert into site_info(id, site_name, site_type, lon, lat, site_time, admin_region, manage_unit, affiliated_unit, contact_name, contact_phone, creat_time, is_del, device_id, video_url, video_user, video_pwd, video_port)
+        insert into site_info(id, site_name, site_type, lon, lat, site_time, admin_region, manage_unit, affiliated_unit, contact_name, contact_phone, creat_time, is_del, device_id, video_url, video_user, video_pwd, video_port, device_status)
         values
         <foreach collection="entities" item="entity" separator=",">
-            (#{entity.id}, #{entity.siteName}, #{entity.siteType}, #{entity.lon}, #{entity.lat}, #{entity.siteTime}, #{entity.adminRegion}, #{entity.manageUnit}, #{entity.affiliatedUnit}, #{entity.contactName}, #{entity.contactPhone}, #{entity.creatTime}, #{entity.isDel}, #{entity.deviceId}, #{entity.videoUrl}, #{entity.videoUser}, #{entity.videoPwd}, #{entity.videoPort})
+            (#{entity.id}, #{entity.siteName}, #{entity.siteType}, #{entity.lon}, #{entity.lat}, #{entity.siteTime}, #{entity.adminRegion}, #{entity.manageUnit}, #{entity.affiliatedUnit}, #{entity.contactName}, #{entity.contactPhone}, #{entity.creatTime}, #{entity.isDel}, #{entity.deviceId}, #{entity.videoUrl}, #{entity.videoUser}, #{entity.videoPwd}, #{entity.videoPort}, #{entity.deviceStatus})
         </foreach>
         on duplicate key update
 id = values(id),
@@ -156,7 +167,8 @@ device_id = values(device_id),
 video_url = values(video_url),
 video_user = values(video_user),
 video_pwd = values(video_pwd),
-video_port = values(video_port)
+video_port = values(video_port),
+device_status = values(device_status)
     </insert>
 
     <!--通过主键修改数据-->
@@ -217,6 +229,9 @@ video_port = values(video_port)
             <if test="videoPort != null and videoPort != ''">
                 video_port = #{videoPort},
             </if>
+            <if test="deviceStatus != null">
+                device_status = #{deviceStatus},
+            </if>
         </set>
         where site_id = #{siteId}
     </update>

+ 11 - 0
ruoyi-ui/src/views/analysis/task/realtime/realtime.vue

@@ -48,6 +48,7 @@ import {
   listMeasureLine,
   listWaterLevel,
   getPointConfigByPlanid,
+  getAchievement,
 } from "@/api/analysis/achievement";
 
 export default {
@@ -127,6 +128,14 @@ export default {
       getPointConfigByPlanid(this.siteId, this.task.planid).then((res) => {
         this.positions = JSON.parse(res.data.positions || '[]');
       })
+    },
+    refreshTask() {
+      getAchievement(this.task.taskid).then((res) => {
+        if (res.data.status === 2) {
+          this.$message.success('本次测流已完成');
+          this.$emit('refresh');
+        }
+      })
     }
   },
   mounted() {
@@ -141,6 +150,7 @@ export default {
     this.timer4 = setInterval(() => this.loadSiteRealTime(), 5e3)
     this.loadWaterLevel();
     this.timer5 = setInterval(() => this.loadWaterLevel(), 5e3)
+    this.timer6 = setInterval(() => this.refreshTask(), 5e3)
   },
   beforeDestroy() {
     if (this.timer1) clearTimeout(this.timer1);
@@ -148,6 +158,7 @@ export default {
     if (this.timer3) clearTimeout(this.timer3);
     if (this.timer4) clearTimeout(this.timer4);
     if (this.timer5) clearTimeout(this.timer5);
+    if (this.timer6) clearTimeout(this.timer6);
   }
 }
 </script>

+ 29 - 0
ruoyi-ui/src/views/analysis/task/realtime/simulation.vue

@@ -165,6 +165,9 @@ export default {
           bottom: 0,
           show: false,
         },
+        tooltip: {
+          trigger: 'item',
+        },
         xAxis: {
           type: 'value',
           min: minX,
@@ -191,6 +194,9 @@ export default {
             areaStyle: {
               opacity: 1,
               color: '#ffc27f',
+            },
+            tooltip: {
+              show: false,
             }
           },
           {
@@ -204,6 +210,9 @@ export default {
             areaStyle: {
               opacity: 1,
               color: '#a5cdf7',
+            },
+            tooltip: {
+              show: false,
             }
           },
           {
@@ -215,6 +224,9 @@ export default {
               width: 2,
               color: '#54606C',
             },
+            tooltip: {
+              show: false,
+            }
           },
           {
             data: stopSeries,
@@ -251,6 +263,14 @@ export default {
                 position: 'middle',
                 formatter: '{b}',
                 color: '#FF8500',
+              },
+              tooltip: {
+                show: false
+              }
+            },
+            tooltip: {
+              formatter: (params) => {
+                return `起点距: ${params.value[0]}`;
               }
             }
           },
@@ -261,6 +281,9 @@ export default {
             z: 3,
             itemStyle: {
               color: '#A6B7C7',
+            },
+            tooltip: {
+              show: false
             }
           },
           {
@@ -273,6 +296,9 @@ export default {
             z: 3,
             itemStyle: {
               opacity: 1
+            },
+            tooltip: {
+              show: false
             }
           },
           {
@@ -286,6 +312,9 @@ export default {
             itemStyle: {
               color: '#778CB2',
               opacity: 0.5
+            },
+            tooltip: {
+              show: false
             }
           },
         ]

+ 2 - 1
ruoyi-ui/src/views/analysis/task/waiting/manual.vue

@@ -122,7 +122,7 @@ export default {
         }
         this.notify = this.$notify.success({
           title: '成功',
-          message: '加测指令下发成功,收到测流开始指令后页面会自动跳转',
+          message: '加测指令下发成功,收到测流开始指令后页面会自动刷新',
           showClose: false,
           duration: 0,
         });
@@ -143,6 +143,7 @@ export default {
   },
   beforeDestroy() {
     if(this.timer)clearTimeout(this.timer);
+    if(this.notify)this.notify.close();
   }
 }
 </script>

+ 1 - 5
ruoyi-ui/src/views/site/plain-time/index.vue

@@ -118,11 +118,7 @@ export default {
       this.loadSection();
     },
     handleAdd() {
-      if (this.list.length > 0) {
-        this.$message.warning('只能设置一条时间点策略');
-      } else {
-        this.$router.push(`/site/plain/time/add?siteId=${this.siteId}`);
-      }
+      this.$router.push(`/site/plain/time/add?siteId=${this.siteId}`);
     },
     handleUpdate(plain) {
       this.$router.push(`/site/plain/time/edit/${plain.timeId}`);

+ 2 - 0
waterAffairs-admin/src/main/java/com/ruoyi/RuoYiApplication.java

@@ -3,6 +3,7 @@ package com.ruoyi;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.scheduling.annotation.EnableScheduling;
 
 /**
  * 启动程序
@@ -10,6 +11,7 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
  * @author ruoyi
  */
 @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
+@EnableScheduling
 public class RuoYiApplication
 {
     public static void main(String[] args)