4 Revize 1fae5c51ec ... 9debecd459

Autor SHA1 Zpráva Datum
  Simon 9debecd459 优化sosmapper搜索异常 před 1 rokem
  zhengjie 05065ebba4 最大阈值回显 před 1 rokem
  zhengjie 5dece83939 Merge branch 'master' of http://app.tjzhxx.cn:3001/chaos/yyky_vue před 1 rokem
  zhengjie 722ee42660 报警处理bug再修复 před 1 rokem

+ 103 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TSettingController.java

@@ -0,0 +1,103 @@
+package com.ruoyi.web.controller.system;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.domain.TSetting;
+import com.ruoyi.system.service.ITSettingService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 手环系统设置Controller
+ * 
+ * @author zhengjie
+ * @date 2023-09-22
+ */
+@RestController
+@RequestMapping("/system/setting")
+public class TSettingController extends BaseController
+{
+    @Autowired
+    private ITSettingService tSettingService;
+
+    /**
+     * 查询手环系统设置列表
+     */
+    @GetMapping("/list")
+    public AjaxResult list(TSetting tSetting)
+    {
+        startPage();
+        List<TSetting> list = tSettingService.selectTSettingList(tSetting);
+        return success(list);
+    }
+
+    /**
+     * 导出手环系统设置列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:setting:export')")
+    @Log(title = "手环系统设置", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TSetting tSetting)
+    {
+        List<TSetting> list = tSettingService.selectTSettingList(tSetting);
+        ExcelUtil<TSetting> util = new ExcelUtil<TSetting>(TSetting.class);
+        util.exportExcel(response, list, "手环系统设置数据");
+    }
+
+    /**
+     * 获取手环系统设置详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:setting:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Integer id)
+    {
+        return success(tSettingService.selectTSettingById(id));
+    }
+
+    /**
+     * 新增手环系统设置
+     */
+    @PreAuthorize("@ss.hasPermi('system:setting:add')")
+    @Log(title = "手环系统设置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TSetting tSetting)
+    {
+        return toAjax(tSettingService.insertTSetting(tSetting));
+    }
+
+    /**
+     * 修改手环系统设置
+     */
+    @PreAuthorize("@ss.hasPermi('system:setting:edit')")
+    @Log(title = "手环系统设置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TSetting tSetting)
+    {
+        return toAjax(tSettingService.updateTSetting(tSetting));
+    }
+
+    /**
+     * 删除手环系统设置
+     */
+    @PreAuthorize("@ss.hasPermi('system:setting:remove')")
+    @Log(title = "手环系统设置", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Integer[] ids)
+    {
+        return toAjax(tSettingService.deleteTSettingByIds(ids));
+    }
+}

+ 44 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/TSetting.java

@@ -0,0 +1,44 @@
+package com.ruoyi.system.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 手环系统设置对象 t_setting
+ * 
+ * @author zhengjie
+ * @date 2023-09-22
+ */
+public class TSetting
+{
+    private static final long serialVersionUID = 1L;
+
+    /** usekey */
+    @Excel(name = "usekey")
+    private String useKey;
+
+    /** usevalue */
+    @Excel(name = "usevalue")
+    private String useValue;
+
+    public void setUseKey(String useKey) 
+    {
+        this.useKey = useKey;
+    }
+
+    public String getUseKey() 
+    {
+        return useKey;
+    }
+    public void setUseValue(String useValue) 
+    {
+        this.useValue = useValue;
+    }
+
+    public String getUseValue() 
+    {
+        return useValue;
+    }
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TSettingMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.mapper;
+
+import java.util.List;
+import com.ruoyi.system.domain.TSetting;
+
+/**
+ * 手环系统设置Mapper接口
+ * 
+ * @author zhengjie
+ * @date 2023-09-22
+ */
+public interface TSettingMapper 
+{
+    /**
+     * 查询手环系统设置
+     * 
+     * @param id 手环系统设置主键
+     * @return 手环系统设置
+     */
+    public TSetting selectTSettingById(Integer id);
+
+    /**
+     * 查询手环系统设置列表
+     * 
+     * @param tSetting 手环系统设置
+     * @return 手环系统设置集合
+     */
+    public List<TSetting> selectTSettingList(TSetting tSetting);
+
+    /**
+     * 新增手环系统设置
+     * 
+     * @param tSetting 手环系统设置
+     * @return 结果
+     */
+    public int insertTSetting(TSetting tSetting);
+
+    /**
+     * 修改手环系统设置
+     * 
+     * @param tSetting 手环系统设置
+     * @return 结果
+     */
+    public int updateTSetting(TSetting tSetting);
+
+    /**
+     * 删除手环系统设置
+     * 
+     * @param id 手环系统设置主键
+     * @return 结果
+     */
+    public int deleteTSettingById(Integer id);
+
+    /**
+     * 批量删除手环系统设置
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTSettingByIds(Integer[] ids);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/ITSettingService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.service;
+
+import java.util.List;
+import com.ruoyi.system.domain.TSetting;
+
+/**
+ * 手环系统设置Service接口
+ * 
+ * @author zhengjie
+ * @date 2023-09-22
+ */
+public interface ITSettingService 
+{
+    /**
+     * 查询手环系统设置
+     * 
+     * @param id 手环系统设置主键
+     * @return 手环系统设置
+     */
+    public TSetting selectTSettingById(Integer id);
+
+    /**
+     * 查询手环系统设置列表
+     * 
+     * @param tSetting 手环系统设置
+     * @return 手环系统设置集合
+     */
+    public List<TSetting> selectTSettingList(TSetting tSetting);
+
+    /**
+     * 新增手环系统设置
+     * 
+     * @param tSetting 手环系统设置
+     * @return 结果
+     */
+    public int insertTSetting(TSetting tSetting);
+
+    /**
+     * 修改手环系统设置
+     * 
+     * @param tSetting 手环系统设置
+     * @return 结果
+     */
+    public int updateTSetting(TSetting tSetting);
+
+    /**
+     * 批量删除手环系统设置
+     * 
+     * @param ids 需要删除的手环系统设置主键集合
+     * @return 结果
+     */
+    public int deleteTSettingByIds(Integer[] ids);
+
+    /**
+     * 删除手环系统设置信息
+     * 
+     * @param id 手环系统设置主键
+     * @return 结果
+     */
+    public int deleteTSettingById(Integer id);
+}

+ 8 - 11
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TDeviceListServiceImpl.java

@@ -266,18 +266,15 @@ public class TDeviceListServiceImpl implements ITDeviceListService {
      * @return 结果
      */
     @Override
+    @Transactional
     public int deleteTDeviceListByIds(Integer[] ids) {
-        List<TDeviceList> tDeviceLists = tDeviceListMapper.selectTDeviceList();
-        if (StringUtils.isNotEmpty(ids)) {
-            for (Integer id : ids) {
-                for (TDeviceList tDevice : tDeviceLists) {
-                    if (tDevice.getId().equals(id)) {
-                        TFacility tFacility = tFacilityMapper.selectTFacilityByCode(tDevice.getDeviceId());
-                        if (StringUtils.isNotNull(tFacility)) {
-                            tFacilityMapper.deleteTFacilityById(tFacility.getId());
-                        }
-                    }
-                }
+        if (ids == null) {
+            return 0;
+        }
+        for (Integer id : ids) {
+            TDeviceList deviceList = tDeviceListMapper.selectTDeviceListById(id);
+            if (deviceList != null && deviceList.getDeviceId() != null && !StringUtils.isEmpty(deviceList.getDeviceId())) {
+                tFacilityMapper.deleteTFacilityByCode(deviceList.getDeviceId());
             }
         }
         return tDeviceListMapper.deleteTDeviceListByIds(ids);

+ 93 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TSettingServiceImpl.java

@@ -0,0 +1,93 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.TSettingMapper;
+import com.ruoyi.system.domain.TSetting;
+import com.ruoyi.system.service.ITSettingService;
+
+/**
+ * 手环系统设置Service业务层处理
+ * 
+ * @author zhengjie
+ * @date 2023-09-22
+ */
+@Service
+public class TSettingServiceImpl implements ITSettingService 
+{
+    @Autowired
+    private TSettingMapper tSettingMapper;
+
+    /**
+     * 查询手环系统设置
+     * 
+     * @param id 手环系统设置主键
+     * @return 手环系统设置
+     */
+    @Override
+    public TSetting selectTSettingById(Integer id)
+    {
+        return tSettingMapper.selectTSettingById(id);
+    }
+
+    /**
+     * 查询手环系统设置列表
+     * 
+     * @param tSetting 手环系统设置
+     * @return 手环系统设置
+     */
+    @Override
+    public List<TSetting> selectTSettingList(TSetting tSetting)
+    {
+        return tSettingMapper.selectTSettingList(tSetting);
+    }
+
+    /**
+     * 新增手环系统设置
+     * 
+     * @param tSetting 手环系统设置
+     * @return 结果
+     */
+    @Override
+    public int insertTSetting(TSetting tSetting)
+    {
+        return tSettingMapper.insertTSetting(tSetting);
+    }
+
+    /**
+     * 修改手环系统设置
+     * 
+     * @param tSetting 手环系统设置
+     * @return 结果
+     */
+    @Override
+    public int updateTSetting(TSetting tSetting)
+    {
+        return tSettingMapper.updateTSetting(tSetting);
+    }
+
+    /**
+     * 批量删除手环系统设置
+     * 
+     * @param ids 需要删除的手环系统设置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTSettingByIds(Integer[] ids)
+    {
+        return tSettingMapper.deleteTSettingByIds(ids);
+    }
+
+    /**
+     * 删除手环系统设置信息
+     * 
+     * @param id 手环系统设置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTSettingById(Integer id)
+    {
+        return tSettingMapper.deleteTSettingById(id);
+    }
+}

+ 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>

+ 72 - 0
ruoyi-system/src/main/resources/mapper/system/TSettingMapper.xml

@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.system.mapper.TSettingMapper">
+    
+    <resultMap type="TSetting" id="TSettingResult">
+        <result property="id"    column="id"    />
+        <result property="useKey"    column="use_key"    />
+        <result property="useValue"    column="use_value"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectTSettingVo">
+        select id, use_key, use_value, remark from t_setting
+    </sql>
+
+    <select id="selectTSettingList" parameterType="TSetting" resultMap="TSettingResult">
+        SELECT use_key,use_value FROM `t_setting`
+        where use_key in
+              ("shouhuan_heart_max",
+               "shouhuan_heart_min",
+               "shouhuan_blood_high_max",
+               "shouhuan_blood_high_min",
+               "shouhuan_blood_low_max",
+               "shouhuan_blood_low_min",
+               "shouhuan_oxygen_max",
+               "shouhuan_oxygen_min",
+               "shouhuan_body_max",
+               "shouhuan_body_min")
+    </select>
+    
+    <select id="selectTSettingById" parameterType="Integer" resultMap="TSettingResult">
+        <include refid="selectTSettingVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertTSetting" parameterType="TSetting" useGeneratedKeys="true" keyProperty="id">
+        insert into t_setting
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="useKey != null">use_key,</if>
+            <if test="useValue != null">use_value,</if>
+            <if test="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="useKey != null">#{useKey},</if>
+            <if test="useValue != null">#{useValue},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTSetting" parameterType="TSetting">
+        update t_setting
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="useKey != null">use_key = #{useKey},</if>
+            <if test="useValue != null">use_value = #{useValue},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteTSettingById" parameterType="Integer">
+        delete from t_setting where id = #{id}
+    </delete>
+
+    <delete id="deleteTSettingByIds" parameterType="String">
+        delete from t_setting where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>