Parcourir la source

提交被覆盖的问题件

15928045575 il y a 2 ans
Parent
commit
9faaac88fa

+ 0 - 65
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/MessageLogEnum.java

@@ -90,71 +90,6 @@ public enum MessageLogEnum {
     DELETE_DEVICE_THRESHOLD("slope_manage", "PROJECT_LOG", "删除设备阈值", "13",
             "设备【${deviceName}】已删除了【${element}】监测要素阈值,所属边坡【${projectName}】", "删除设备阈值"),
 
-    /**
-     * 新增集成分析方案
-     */
-    INTEGRATION_ADD("slope_manage", "PROJECT_LOG", "新增集成分析方案", "14",
-            "集成要素【${name}】已被新增,【${type}】所有设备", "新增集成分析方案"),
-    /**
-     * 修改集成分析方案
-     */
-    INTEGRATION_UPDATE("slope_manage", "PROJECT_LOG", "修改集成分析方案", "15",
-            "集成要素【${name}】已被修改,【${type}】所有设备", "修改集成分析方案"),
-
-    /**
-     * 新增设备型号
-     */
-    MODEL_ADD("slope_manage", "PROJECT_LOG", "新增设备型号", "16",
-            "型号【${name}】已被新增", "新增设备型号"),
-
-    /**
-     * 修改设备型号
-     */
-    MODEL_UPDATE("slope_manage", "PROJECT_LOG", "修改设备型号", "17",
-            "型号【${name}】已被修改", "修改设备型号"),
-
-    /**
-     * 删除设备型号
-     */
-    MODEL_DELETE("slope_manage", "PROJECT_LOG", "删除设备型号", "18",
-            "型号【${name}】已被删除", "删除设备型号"),
-    /**
-     * 新增设备
-     */
-    DEVICE_ADD("slope_manage", "PROJECT_LOG", "新增设备", "19",
-            "设备【${name}】已被新增,所属型号【${type}】", "新增设备"),
-    /**
-     * 修改设备
-     */
-    DEVICE_UPDATE("slope_manage", "PROJECT_LOG", "修改设备", "20",
-            "设备【${name}】已被修改,所属型号【${type}】", "修改设备"),
-    /**
-     * 删除设备
-     */
-    DEVICE_DELETE("slope_manage", "PROJECT_LOG", "删除设备", "21",
-            "设备【${name}】已被删除,所属型号【${type}】", "删除设备"),
-    /**
-     * 禁用设备
-     */
-    DEVICE_DISABLED("slope_manage", "PROJECT_LOG", "禁用设备", "22",
-            "设备【${name}】已被禁用,所属型号【${type}】", "禁用设备"),
-
-    /**
-     * 启用设备
-     */
-    DEVICE_ABLED("slope_manage", "PROJECT_LOG", "启用设备", "23",
-            "设备【${name}】已被启用,所属型号【${type}】", "启用设备"),
-    /**
-     * 设备基准值设置
-     */
-    DEVICE_SETBASE("slope_manage", "PROJECT_LOG", "设备基准值设置", "24",
-            "设备【${name}】已被设置阈值,相关要素【${type}】,所属边坡【${desc}】", "设备基准值设置"),
-    /**
-     * 设备基准值调整
-     */
-    DEVICE_SETVALUE("slope_manage", "PROJECT_LOG", "设备基准值调整", "25",
-            "设备【${name}】已被调整阈值,相关要素【${type}】,所属边坡【${desc}】", "设备基准值调整"),
-
     ;
 
 

+ 0 - 4
slope-common/slope-common-core/src/main/java/com/sckw/core/web/constant/HttpStatus.java

@@ -148,10 +148,6 @@ public class HttpStatus {
     public static final String CONTRACT_NOT_EXISTS = "未查询到合同或已失效";
     public static final String BANNER_NOT_EXISTS = "未查询到banner数据或已失效";
 
-    public static final String INTEGRATION_NOT_EXISTS = "未查询到集成元素或已失效";
-    public static final String MODEL_NOT_EXISTS = "未查询到设备型号或已失效";
-    public static final String DEVICE_NOT_EXISTS = "未查询到设备或已失效";
-
 
     /**自定义提示消息*/
     public static final String PASSWD_ERROR = "密码不正确";

+ 3 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/BackTrackService.java

@@ -5,7 +5,10 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.constant.NumberConstant;
+import com.sckw.core.model.enums.DeviceEnum;
+import com.sckw.core.model.enums.DictEnum;
 import com.sckw.core.model.enums.DictItemEnum;
+import com.sckw.core.model.enums.MessageLogEnum;
 import com.sckw.core.model.page.PageRes;
 import com.sckw.core.utils.IdWorker;
 import com.sckw.core.web.constant.HttpStatus;

+ 67 - 67
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsAlarmMapper.xml

@@ -40,16 +40,16 @@
 
     <select id="selectByDevicesId" parameterType="java.lang.String" resultType="java.util.Map">
         <!--@mbg.generated-->
-        select count(id) as count,pid,type
+        select count(id) as count,device_id,type
         from kws_alarm
         where 1 = 1
         <if test="devicesId != null and devicesId.size() > 0">
-            AND pid IN
+            AND device_id IN
             <foreach collection="devicesId" open="(" close=")" item="item" separator=",">
                 #{item}
             </foreach>
         </if>
-        group by pid, type
+        group by device_id, type
     </select>
 
     <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
@@ -191,39 +191,39 @@
         <!--@mbg.generated-->
         update kws_alarm
         set pid           = #{pid,jdbcType=BIGINT},
-            title         = #{title,jdbcType=VARCHAR},
-            val           = #{val,jdbcType=VARCHAR},
-            content       = #{content,jdbcType=VARCHAR},
-            `level`       = #{level,jdbcType=INTEGER},
-            `type`        = #{type,jdbcType=INTEGER},
-            lat           = #{lat,jdbcType=VARCHAR},
-            lng           = #{lng,jdbcType=VARCHAR},
-            alt           = #{alt,jdbcType=VARCHAR},
-            create_time   = #{createTime,jdbcType=TIMESTAMP},
-            trigger_times = #{triggerTimes,jdbcType=INTEGER},
-            `status`      = #{status,jdbcType=TINYINT}
+        title         = #{title,jdbcType=VARCHAR},
+        val           = #{val,jdbcType=VARCHAR},
+        content       = #{content,jdbcType=VARCHAR},
+        `level`       = #{level,jdbcType=INTEGER},
+        `type`        = #{type,jdbcType=INTEGER},
+        lat           = #{lat,jdbcType=VARCHAR},
+        lng           = #{lng,jdbcType=VARCHAR},
+        alt           = #{alt,jdbcType=VARCHAR},
+        create_time   = #{createTime,jdbcType=TIMESTAMP},
+        trigger_times = #{triggerTimes,jdbcType=INTEGER},
+        `status`      = #{status,jdbcType=TINYINT}
         where id = #{id,jdbcType=BIGINT}
     </update>
 
     <select id="getDataAlarmToDay" resultType="java.util.Map">
         SELECT DATE_FORMAT(h.h, '%Y-%m-%d %H:00:00') AS dateTime, COUNT(t.id) AS number
         FROM (SELECT #{startTime} + INTERVAL n HOUR AS h
-              FROM (
-                  SELECT 0 AS n
-                  UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5
-                  UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL SELECT 10
-                  UNION ALL SELECT 11 UNION ALL SELECT 12 UNION ALL SELECT 13 UNION ALL SELECT 14 UNION ALL SELECT 15
-                  UNION ALL SELECT 16 UNION ALL SELECT 17 UNION ALL SELECT 18 UNION ALL SELECT 19 UNION ALL SELECT 20
-                  UNION ALL SELECT 21 UNION ALL SELECT 22 UNION ALL SELECT 23
-                  ) hours) h
-            LEFT JOIN
+        FROM (
+        SELECT 0 AS n
+        UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5
+        UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL SELECT 10
+        UNION ALL SELECT 11 UNION ALL SELECT 12 UNION ALL SELECT 13 UNION ALL SELECT 14 UNION ALL SELECT 15
+        UNION ALL SELECT 16 UNION ALL SELECT 17 UNION ALL SELECT 18 UNION ALL SELECT 19 UNION ALL SELECT 20
+        UNION ALL SELECT 21 UNION ALL SELECT 22 UNION ALL SELECT 23
+        ) hours) h
+        LEFT JOIN
         (SELECT a.id,
-                a.create_time,
-                b.project_id  as projectId,
-                b.company_id  as companyId,
-                b.mountain_id as mountainId
-         FROM kws_alarm_detail a
-                  LEFT JOIN kws_alarm b ON a.alarm_id = b.id
+        a.create_time,
+        b.project_id  as projectId,
+        b.company_id  as companyId,
+        b.mountain_id as mountainId
+        FROM kws_alarm_detail a
+        LEFT JOIN kws_alarm b ON a.alarm_id = b.id
         <where>
             <if test="type != null and type != ''">
                 and b.type =#{type}
@@ -238,7 +238,7 @@
         ) t
         ON DATE_FORMAT(t.create_time, '%Y-%m-%d %H') = DATE_FORMAT(h.h, '%Y-%m-%d %H')
         WHERE h.h BETWEEN #{startTime}
-                  AND #{endTime}
+        AND #{endTime}
         GROUP BY dateTime
         ORDER BY dateTime ASC;
     </select>
@@ -246,27 +246,27 @@
     <select id="getDataAlarmToWeek" resultType="java.util.Map">
         SELECT a.date as dateTime, COALESCE(b.number, 0) as number
         from (select date_add(#{startTime}, interval row1 DAY) date
-              from
-                  (
-                  SELECT @row := @row + 1 as row1 FROM
-                  (select 0 union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union
-                  all select 6 union all select 7 union all select 8 union all select 9) t, (select 0 union all select 1 union all
-                  select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union
-                  all select 8 union all select 9) t2, (select 0 union all select 1 union all select 2 union all select 3 union
-                  all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) t3, (select 0 union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union
-                  all select 6 union all select 7 union all select 8 union all select 9) t4, (SELECT @row := -1) r
-                  ) se
-              where date_add(#{startTime}
-                  , interval row1 DAY) &lt;= #{endTime}) a
-            LEFT JOIN
+        from
+        (
+        SELECT @row := @row + 1 as row1 FROM
+        (select 0 union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union
+        all select 6 union all select 7 union all select 8 union all select 9) t, (select 0 union all select 1 union all
+        select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union
+        all select 8 union all select 9) t2, (select 0 union all select 1 union all select 2 union all select 3 union
+        all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) t3, (select 0 union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union
+        all select 6 union all select 7 union all select 8 union all select 9) t4, (SELECT @row := -1) r
+        ) se
+        where date_add(#{startTime}
+        , interval row1 DAY) &lt;= #{endTime}) a
+        LEFT JOIN
         (SELECT count(b.id)   as                       number,
-                DATE_FORMAT(b.create_time, '%Y-%m-%d') date_time,
-                a.project_id  as                       projectId,
-                a.company_id  as                       companyId,
-                a.mountain_id as                       mountainId
-         FROM kws_alarm a
-                  LEFT JOIN
-              kws_alarm_detail b on a.id = b.alarm_id
+        DATE_FORMAT(b.create_time, '%Y-%m-%d') date_time,
+        a.project_id  as                       projectId,
+        a.company_id  as                       companyId,
+        a.mountain_id as                       mountainId
+        FROM kws_alarm a
+        LEFT JOIN
+        kws_alarm_detail b on a.id = b.alarm_id
         <where>
             <if test="type != null and type != ''">
                 and a.type =#{type}
@@ -286,16 +286,16 @@
 
     <select id="getDataAlarmToYear" resultType="java.util.Map">
         SELECT a.dateTime            AS dateTime,
-               COALESCE(b.number, 0) AS num
+        COALESCE(b.number, 0) AS num
         FROM (SELECT DATE_FORMAT(DATE_ADD(#{startTime}, INTERVAL ROW1 MONTH ), '%Y-%m') dateTime
-              FROM (SELECT @ROW := @ROW + 1 AS row1
-                    FROM
-                        (select 0 union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) t, (select 0 union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) t2, (select 0 union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) t3, (select 0 union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) t4, ( SELECT @ROW := - 1 ) r) se
-              WHERE date_add(#{startTime}, INTERVAL row1 MONTH ) &lt;= #{endTime}) a
-            LEFT JOIN (SELECT count(b.id) AS                      number,
-                              DATE_FORMAT(b.create_time, '%Y-%m') dateTime
-                       FROM kws_alarm a
-                                LEFT JOIN kws_alarm_detail b ON a.id = b.alarm_id
+        FROM (SELECT @ROW := @ROW + 1 AS row1
+        FROM
+        (select 0 union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) t, (select 0 union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) t2, (select 0 union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) t3, (select 0 union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) t4, ( SELECT @ROW := - 1 ) r) se
+        WHERE date_add(#{startTime}, INTERVAL row1 MONTH ) &lt;= #{endTime}) a
+        LEFT JOIN (SELECT count(b.id) AS                      number,
+        DATE_FORMAT(b.create_time, '%Y-%m') dateTime
+        FROM kws_alarm a
+        LEFT JOIN kws_alarm_detail b ON a.id = b.alarm_id
         <where>
             <if test="type != null and type != ''">
                 and a.type =#{type}
@@ -315,15 +315,15 @@
 
     <select id="getProjectAlarmList" resultType="java.util.Map">
         SELECT
-            project_id as projectId,COUNT(DISTINCT a.id) as alarmTotal
+        project_id as projectId,COUNT(DISTINCT a.id) as alarmTotal
         FROM
-            kws_alarm a
-                LEFT JOIN kws_alarm_detail b ON a.id = b.alarm_id
-            <where>
-               <if test="type != null and type != ''">
-                   and a.type =#{type}
-               </if>
-            </where>
+        kws_alarm a
+        LEFT JOIN kws_alarm_detail b ON a.id = b.alarm_id
+        <where>
+            <if test="type != null and type != ''">
+                and a.type =#{type}
+            </if>
+        </where>
         GROUP BY a.project_id
     </select>
 

+ 1 - 1
slope-modules/slope-detection/src/main/resources/mapper/tdengine/SlopeDataMapper.xml

@@ -42,7 +42,7 @@
         SELECT
         <include refid="Base_List">
         </include>
-        FROM devicesv2.device_#{snCode}
+        FROM devices.slope_data_#{snCode}
         where line = #{item}
         order by ts desc limit 1
     </select>