Ver código fonte

报警处理bug再修复

zhengjie 1 ano atrás
pai
commit
722ee42660

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

@@ -25,7 +25,7 @@ public interface TFallSolveMapper {
      * @param aid 跌倒告警主键
      * @return 跌倒告警
      */
-    public List<TFallSolve> selectTFallSolveByAid(Integer aid);
+    public TFallSolve selectTFallSolveByAid(Integer aid);
 
     /**
      * 查询跌倒告警列表

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

@@ -25,7 +25,7 @@ public interface ITFallSolveService {
      * @param aid 跌倒告警主键
      * @return 跌倒告警
      */
-    public List<TFallSolve> selectTFallSolveByAid(Integer aid);
+    public TFallSolve selectTFallSolveByAid(Integer aid);
 
     /**
      * 查询跌倒告警列表

+ 4 - 7
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TFallSolveServiceImpl.java

@@ -33,7 +33,7 @@ public class TFallSolveServiceImpl implements ITFallSolveService {
     }
 
     @Override
-    public List<TFallSolve> selectTFallSolveByAid(Integer aid) {
+    public TFallSolve selectTFallSolveByAid(Integer aid) {
         return tFallSolveMapper.selectTFallSolveByAid(aid);
     }
 
@@ -56,14 +56,11 @@ public class TFallSolveServiceImpl implements ITFallSolveService {
      */
     @Override
     public int insertTFallSolve(TFallSolve tFallSolve) {
-        //TODO 还有问题
-        List<TFallSolve> tFallSolves = this.selectTFallSolveByAid(tFallSolve.getAid());
-        if (tFallSolves != null && !tFallSolves.isEmpty()) {
-            tFallSolve.setUpdateTime(DateUtils.getNowDate());
-            return tFallSolveMapper.updateTFallSolve(tFallSolve);
-        } else {
+        if (StringUtils.isNull(this.selectTFallSolveByAid(tFallSolve.getAid()))){
             tFallSolve.setCreateTime(DateUtils.getNowDate());
             return tFallSolveMapper.insertTFallSolve(tFallSolve);
+        }else{
+            return tFallSolveMapper.updateTFallSolve(tFallSolve);
         }
     }
 

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

@@ -47,7 +47,7 @@
         left join t_device_list c on a.id=c.userid
         left join t_shouhuan_alarm_list d on d.device_id_code=c.device_id
         left join t_shouhuan_info e on e.id=d.shinfo_id
-        left join t_sos_solve f on f.alarmid=d.id
+        left join t_fall_solve f on f.alarmid=d.id
         <where>
             <if test="name != null  and name != ''">and a.name = #{name}</if>
             <if test="solve_status != null">and f.solve_status = #{solve_status}</if>

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

@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         left join t_device_list c on a.id=c.userid
         left join t_shouhuan_alarm_list d on d.device_id_code=c.device_id
         left join t_shouhuan_info e on e.id=d.shinfo_id
-        left join t_sos_solve f on f.alarmid=d.id
+        left join t_health_solve f on f.alarmid=d.id
         <where>
             <if test="name != null  and name != ''"> and a.name = #{name}</if>
             <if test="solve_status != null"> and f.solve_status = #{solve_status}</if>

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

@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         left join t_device_list c on a.id=c.userid
         left join t_shouhuan_alarm_list d on d.device_id_code=c.device_id
         left join t_shouhuan_info e on e.id=d.shinfo_id
-        left join t_sos_solve f on f.alarmid=d.id
+        left join t_other_solve f on f.alarmid=d.id
         <where>
             <if test="name != null  and name != ''"> and a.name = #{name}</if>
             <if test="solve_status != null"> and f.solve_status = #{solve_status}</if>

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

@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         left join t_device_list c on a.id=c.userid
         left join t_shouhuan_alarm_list d on d.device_id_code=c.device_id
         left join t_shouhuan_info e on e.id=d.shinfo_id
-        left join t_sos_solve f on f.alarmid=d.id
+        left join t_rail_solve f on f.alarmid=d.id
         <where>
             <if test="name != null  and name != ''"> and a.name = #{name}</if>
             <if test="solve_status != null"> and f.solve_status = #{solve_status}</if>