Simon преди 1 година
родител
ревизия
8632b5d44d
променени са 22 файла, в които са добавени 2190 реда и са изтрити 765 реда
  1. 17 10
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TDataDisplayController.java
  2. 98 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TEarlyWarningController.java
  3. 13 13
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TFallSolveController.java
  4. 20 31
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/THealthSolveController.java
  5. 20 27
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TOtherSolveController.java
  6. 10 16
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TSettingController.java
  7. 21 27
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TSosSolveController.java
  8. 20 16
      ruoyi-common/src/main/java/com/ruoyi/common/utils/LocationUtils.java
  9. 376 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/TEarlyWarning.java
  10. 182 121
      ruoyi-system/src/main/java/com/ruoyi/system/domain/TShouhuanAlarmList.java
  11. 260 221
      ruoyi-system/src/main/java/com/ruoyi/system/domain/TShouhuanInfo.java
  12. 77 5
      ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/AlarmStatusListDto.java
  13. 63 7
      ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/DataAlarmListDto.java
  14. 21 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/MapGpsDto.java
  15. 75 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/TEarlyWarningMapper.java
  16. 101 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/ITEarlyWarningService.java
  17. 124 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TEarlyWarningServiceImpl.java
  18. 17 23
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TSosSolveServiceImpl.java
  19. 149 89
      ruoyi-system/src/main/java/com/ruoyi/system/timing/CallPoliceTiming.java
  20. 252 0
      ruoyi-system/src/main/resources/mapper/system/TEarlyWarningMapper.xml
  21. 140 71
      ruoyi-system/src/main/resources/mapper/system/TShouhuanAlarmListMapper.xml
  22. 134 88
      ruoyi-system/src/main/resources/mapper/system/TShouhuanInfoMapper.xml

+ 17 - 10
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TDataDisplayController.java

@@ -12,6 +12,7 @@ import com.ruoyi.system.service.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.math.BigDecimal;
 import java.text.NumberFormat;
 import java.time.LocalDate;
 import java.util.*;
@@ -155,9 +156,9 @@ public class TDataDisplayController extends BaseController {
                     .map(mapGpsDto -> {
                         AjaxResult ajax = new AjaxResult();
                         List<Float> list = new ArrayList<>();
-                        if (mapGpsDto != null && mapGpsDto.getGps_long() != null && mapGpsDto.getGps_lat() != null) {
-                            list.add(mapGpsDto.getGps_long());
-                            list.add(mapGpsDto.getGps_lat());
+                        if (mapGpsDto != null && mapGpsDto.getUse_gps_long() != null && mapGpsDto.getUse_gps_lat() != null) {
+                            list.add(mapGpsDto.getUse_gps_long());
+                            list.add(mapGpsDto.getUse_gps_lat());
                         }
                         ajax.put("lnglat", list);
                         return ajax;
@@ -250,9 +251,9 @@ public class TDataDisplayController extends BaseController {
                         alarmListDto.setName(mapper.getName());
                         alarmListDto.setAlarm_msg(tDeviceListService.checkMessage(mapper.getAlarm_type()));
                         alarmListDto.setTelno(mapper.getTel_one());
-                        alarmListDto.setGps_long(mapper.getGps_long());
-                        alarmListDto.setGps_lat(mapper.getGps_lat());
-                        alarmListDto.setAddress(getCounterLocation(mapper.getGps_long() + "," + mapper.getGps_lat()));
+                        alarmListDto.setGps_long(mapper.getUse_gps_long());
+                        alarmListDto.setGps_lat(mapper.getUse_gps_lat());
+                        alarmListDto.setAddress(mapper.getLocation());
                         alarmListDto.setAlarm_type(mapper.getAlarm_type());
                         alarmListDto.setCreatetime(mapper.getCreatetime());
                         return alarmListDto;
@@ -284,10 +285,16 @@ public class TDataDisplayController extends BaseController {
      * 计算百分比
      */
     public String checkPercent(int num1, int num2) {
-        NumberFormat numberFormat = NumberFormat.getInstance();
-        numberFormat.setMaximumFractionDigits(2);
-        String result = numberFormat.format((float) num1 / (float) num2 * 100);
-        return result;
+        if (num1 == 0 || num2 == 0) {
+            return "0.00";
+        }
+        // 将整数转换为BigDecimal类型
+        BigDecimal bdNum1 = new BigDecimal(num1);
+        BigDecimal bdNum2 = new BigDecimal(num2);
+        // 计算百分比
+        BigDecimal percentage = bdNum1.divide(bdNum2, 2, BigDecimal.ROUND_HALF_UP)
+                .multiply(new BigDecimal(100));
+        return percentage.toPlainString();
     }
 
     public String checkDeviceType(Integer device_model) {

+ 98 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TEarlyWarningController.java

@@ -0,0 +1,98 @@
+package com.ruoyi.system.controller;
+
+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.TEarlyWarning;
+import com.ruoyi.system.service.ITEarlyWarningService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 【请填写功能名称】Controller
+ *
+ * @author ruoyi
+ * @date 2023-09-27
+ */
+@RestController
+@RequestMapping("/system/warning")
+public class TEarlyWarningController extends BaseController {
+    @Autowired
+    private ITEarlyWarningService tEarlyWarningService;
+
+    /**
+     * 查询【请填写功能名称】列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:warning:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TEarlyWarning tEarlyWarning) {
+        startPage();
+        List<TEarlyWarning> list = tEarlyWarningService.selectTEarlyWarningList(tEarlyWarning);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出【请填写功能名称】列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:warning:export')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TEarlyWarning tEarlyWarning) {
+        List<TEarlyWarning> list = tEarlyWarningService.selectTEarlyWarningList(tEarlyWarning);
+        ExcelUtil<TEarlyWarning> util = new ExcelUtil<TEarlyWarning>(TEarlyWarning.class);
+        util.exportExcel(response, list, "【请填写功能名称】数据");
+    }
+
+    /**
+     * 获取【请填写功能名称】详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:warning:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(tEarlyWarningService.selectTEarlyWarningById(id));
+    }
+
+    /**
+     * 新增【请填写功能名称】
+     */
+    @PreAuthorize("@ss.hasPermi('system:warning:add')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TEarlyWarning tEarlyWarning) {
+        return toAjax(tEarlyWarningService.insertTEarlyWarning(tEarlyWarning));
+    }
+
+    /**
+     * 修改【请填写功能名称】
+     */
+    @PreAuthorize("@ss.hasPermi('system:warning:edit')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TEarlyWarning tEarlyWarning) {
+        return toAjax(tEarlyWarningService.updateTEarlyWarning(tEarlyWarning));
+    }
+
+    /**
+     * 删除【请填写功能名称】
+     */
+    @PreAuthorize("@ss.hasPermi('system:warning:remove')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(tEarlyWarningService.deleteTEarlyWarningByIds(ids));
+    }
+}

+ 13 - 13
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TFallSolveController.java

@@ -9,8 +9,10 @@ import javax.servlet.http.HttpServletResponse;
 
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.system.domain.TEarlyWarning;
 import com.ruoyi.system.domain.TRailSolve;
 import com.ruoyi.system.domain.TSosSolve;
+import com.ruoyi.system.service.ITEarlyWarningService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -41,24 +43,18 @@ import com.ruoyi.common.core.page.TableDataInfo;
 public class TFallSolveController extends BaseController {
     @Autowired
     private ITFallSolveService tFallSolveService;
+    @Autowired
+    private ITEarlyWarningService itEarlyWarningService;
 
     /**
      * 查询跌倒告警列表
      */
     @PreAuthorize("@ss.hasPermi('system:fallsolve:list')")
     @GetMapping("/list")
-    public TableDataInfo list(TFallSolve tFallSolve) {
+    public TableDataInfo list(TEarlyWarning earlyWarning) {
         startPage();
-        List<TFallSolve> list = tFallSolveService.selectTFallSolveList(tFallSolve);
-        for (TFallSolve salve : list) {
-            if (StringUtils.isNull(salve.getSolve_status())) {
-                salve.setSolve_status(0);
-            }
-            salve.setAlarmMsg("跌倒告警求助:" + salve.getName() + "于" + DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, salve.getCreatetime()) + "发起跌倒告警求助");
-        }
-        List<TFallSolve> collect = list.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<TFallSolve>(Comparator.comparing(TFallSolve::getAid))), ArrayList::new));
-        collect = collect.stream().sorted(Comparator.comparing(TFallSolve::getCreatetime).reversed()).collect(Collectors.toList());
-        return getDataTable(collect);
+        List<TEarlyWarning> tEarlyWarnings = itEarlyWarningService.selectTEarlyWarningList_FALLSOLVE(earlyWarning);
+        return getDataTable(tEarlyWarnings);
     }
 
     /**
@@ -88,8 +84,12 @@ public class TFallSolveController extends BaseController {
     @PreAuthorize("@ss.hasPermi('system:fallsolve:add')")
     @Log(title = "跌倒告警", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody TFallSolve tFallSolve) {
-        return toAjax(tFallSolveService.insertTFallSolve(tFallSolve));
+    public AjaxResult add(@RequestBody TEarlyWarning earlyWarning) {
+        if (earlyWarning != null && earlyWarning.getId() != null) {
+            return toAjax(itEarlyWarningService.updateTEarlyWarning(earlyWarning));
+        } else {
+            return toAjax(itEarlyWarningService.insertTEarlyWarning(earlyWarning));
+        }
     }
 
     /**

+ 20 - 31
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/THealthSolveController.java

@@ -9,9 +9,8 @@ import javax.servlet.http.HttpServletResponse;
 
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.StringUtils;
-import com.ruoyi.system.domain.TFallSolve;
-import com.ruoyi.system.domain.TRailSolve;
-import com.ruoyi.system.domain.TSosSolve;
+import com.ruoyi.system.domain.*;
+import com.ruoyi.system.service.ITEarlyWarningService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -26,42 +25,33 @@ 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.THealthSolve;
 import com.ruoyi.system.service.ITHealthSolveService;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.common.core.page.TableDataInfo;
 
 /**
  * 健康告警处理Controller
- * 
+ *
  * @author zhengjie
  * @date 2023-09-09
  */
 @RestController
 @RequestMapping("/system/healthsolve")
-public class THealthSolveController extends BaseController
-{
+public class THealthSolveController extends BaseController {
     @Autowired
     private ITHealthSolveService tHealthSolveService;
+    @Autowired
+    private ITEarlyWarningService itEarlyWarningService;
 
     /**
      * 查询健康告警处理列表
      */
     @PreAuthorize("@ss.hasPermi('system:healthsolve:list')")
     @GetMapping("/list")
-    public TableDataInfo list(THealthSolve tHealthSolve)
-    {
+    public TableDataInfo list(TEarlyWarning earlyWarning) {
         startPage();
-        List<THealthSolve> list = tHealthSolveService.selectTHealthSolveList(tHealthSolve);
-        for (THealthSolve salve : list){
-            if (StringUtils.isNull(salve.getSolve_status())){
-                salve.setSolve_status(0);
-            }
-            salve.setAlarmMsg("健康告警求助:" + salve.getName() + "于" + DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,salve.getCreatetime()) + "发起健康告警求助");
-        }
-        List<THealthSolve> collect=list.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(()->new TreeSet<THealthSolve>(Comparator.comparing(THealthSolve::getAid))), ArrayList::new));
-        collect = collect.stream().sorted(Comparator.comparing(THealthSolve::getCreatetime).reversed()).collect(Collectors.toList());
-        return getDataTable(collect);
+        List<TEarlyWarning> tEarlyWarnings = itEarlyWarningService.selectTEarlyWarningList_HEALTHSOLVE(earlyWarning);
+        return getDataTable(tEarlyWarnings);
     }
 
     /**
@@ -70,8 +60,7 @@ public class THealthSolveController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:healthsolve:export')")
     @Log(title = "健康告警处理", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, THealthSolve tHealthSolve)
-    {
+    public void export(HttpServletResponse response, THealthSolve tHealthSolve) {
         List<THealthSolve> list = tHealthSolveService.selectTHealthSolveList(tHealthSolve);
         ExcelUtil<THealthSolve> util = new ExcelUtil<THealthSolve>(THealthSolve.class);
         util.exportExcel(response, list, "健康告警处理数据");
@@ -82,8 +71,7 @@ public class THealthSolveController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:healthsolve:query')")
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Integer id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Integer id) {
         return success(tHealthSolveService.selectTHealthSolveById(id));
     }
 
@@ -93,9 +81,12 @@ public class THealthSolveController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:healthsolve:add')")
     @Log(title = "健康告警处理", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody THealthSolve tHealthSolve)
-    {
-        return toAjax(tHealthSolveService.insertTHealthSolve(tHealthSolve));
+    public AjaxResult add(@RequestBody TEarlyWarning earlyWarning) {
+        if (earlyWarning != null && earlyWarning.getId() != null) {
+            return toAjax(itEarlyWarningService.updateTEarlyWarning(earlyWarning));
+        } else {
+            return toAjax(itEarlyWarningService.insertTEarlyWarning(earlyWarning));
+        }
     }
 
     /**
@@ -104,8 +95,7 @@ public class THealthSolveController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:healthsolve:edit')")
     @Log(title = "健康告警处理", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody THealthSolve tHealthSolve)
-    {
+    public AjaxResult edit(@RequestBody THealthSolve tHealthSolve) {
         return toAjax(tHealthSolveService.updateTHealthSolve(tHealthSolve));
     }
 
@@ -114,9 +104,8 @@ public class THealthSolveController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:healthsolve:remove')")
     @Log(title = "健康告警处理", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Integer[] ids)
-    {
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Integer[] ids) {
         return toAjax(tHealthSolveService.deleteTHealthSolveByIds(ids));
     }
 }

+ 20 - 27
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TOtherSolveController.java

@@ -9,7 +9,9 @@ import javax.servlet.http.HttpServletResponse;
 
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.system.domain.TEarlyWarning;
 import com.ruoyi.system.domain.THealthSolve;
+import com.ruoyi.system.service.ITEarlyWarningService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -31,35 +33,27 @@ import com.ruoyi.common.core.page.TableDataInfo;
 
 /**
  * 其他告警处理Controller
- * 
+ *
  * @author zhengjie
  * @date 2023-09-09
  */
 @RestController
 @RequestMapping("/system/othersolve")
-public class TOtherSolveController extends BaseController
-{
+public class TOtherSolveController extends BaseController {
     @Autowired
     private ITOtherSolveService tOtherSolveService;
+    @Autowired
+    private ITEarlyWarningService itEarlyWarningService;
 
     /**
      * 查询其他告警处理列表
      */
     @PreAuthorize("@ss.hasPermi('system:othersolve:list')")
     @GetMapping("/list")
-    public TableDataInfo list(TOtherSolve tOtherSolve)
-    {
+    public TableDataInfo list(TEarlyWarning earlyWarning) {
         startPage();
-        List<TOtherSolve> list = tOtherSolveService.selectTOtherSolveList(tOtherSolve);
-        for (TOtherSolve salve : list){
-            if (StringUtils.isNull(salve.getSolve_status())){
-                salve.setSolve_status(0);
-            }
-            salve.setAlarmMsg("其他告警求助:" + salve.getName() + "于" + DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,salve.getCreatetime()) + "发起其他告警求助");
-        }
-        List<TOtherSolve> collect=list.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(()->new TreeSet<TOtherSolve>(Comparator.comparing(TOtherSolve::getAid))), ArrayList::new));
-        collect = collect.stream().sorted(Comparator.comparing(TOtherSolve::getCreatetime).reversed()).collect(Collectors.toList());
-        return getDataTable(collect);
+        List<TEarlyWarning> tEarlyWarnings = itEarlyWarningService.selectTEarlyWarningList_OTHERSOLVE(earlyWarning);
+        return getDataTable(tEarlyWarnings);
     }
 
     /**
@@ -68,8 +62,7 @@ public class TOtherSolveController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:othersolve:export')")
     @Log(title = "其他告警处理", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, TOtherSolve tOtherSolve)
-    {
+    public void export(HttpServletResponse response, TOtherSolve tOtherSolve) {
         List<TOtherSolve> list = tOtherSolveService.selectTOtherSolveList(tOtherSolve);
         ExcelUtil<TOtherSolve> util = new ExcelUtil<TOtherSolve>(TOtherSolve.class);
         util.exportExcel(response, list, "其他告警处理数据");
@@ -80,8 +73,7 @@ public class TOtherSolveController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:othersolve:query')")
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Integer id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Integer id) {
         return success(tOtherSolveService.selectTOtherSolveById(id));
     }
 
@@ -91,9 +83,12 @@ public class TOtherSolveController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:othersolve:add')")
     @Log(title = "其他告警处理", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody TOtherSolve tOtherSolve)
-    {
-        return toAjax(tOtherSolveService.insertTOtherSolve(tOtherSolve));
+    public AjaxResult add(@RequestBody TEarlyWarning earlyWarning) {
+        if (earlyWarning != null && earlyWarning.getId() != null) {
+            return toAjax(itEarlyWarningService.updateTEarlyWarning(earlyWarning));
+        } else {
+            return toAjax(itEarlyWarningService.insertTEarlyWarning(earlyWarning));
+        }
     }
 
     /**
@@ -102,8 +97,7 @@ public class TOtherSolveController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:othersolve:edit')")
     @Log(title = "其他告警处理", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody TOtherSolve tOtherSolve)
-    {
+    public AjaxResult edit(@RequestBody TOtherSolve tOtherSolve) {
         return toAjax(tOtherSolveService.updateTOtherSolve(tOtherSolve));
     }
 
@@ -112,9 +106,8 @@ public class TOtherSolveController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:othersolve:remove')")
     @Log(title = "其他告警处理", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Integer[] ids)
-    {
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Integer[] ids) {
         return toAjax(tOtherSolveService.deleteTOtherSolveByIds(ids));
     }
 }

+ 10 - 16
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TSettingController.java

@@ -2,6 +2,7 @@ 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;
@@ -23,14 +24,13 @@ import com.ruoyi.common.core.page.TableDataInfo;
 
 /**
  * 手环系统设置Controller
- * 
+ *
  * @author zhengjie
  * @date 2023-09-22
  */
 @RestController
 @RequestMapping("/system/setting")
-public class TSettingController extends BaseController
-{
+public class TSettingController extends BaseController {
     @Autowired
     private ITSettingService tSettingService;
 
@@ -38,8 +38,7 @@ public class TSettingController extends BaseController
      * 查询手环系统设置列表
      */
     @GetMapping("/list")
-    public AjaxResult list(TSetting tSetting)
-    {
+    public AjaxResult list(TSetting tSetting) {
         startPage();
         List<TSetting> list = tSettingService.selectTSettingList(tSetting);
         return success(list);
@@ -51,8 +50,7 @@ public class TSettingController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:setting:export')")
     @Log(title = "手环系统设置", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, TSetting tSetting)
-    {
+    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, "手环系统设置数据");
@@ -63,8 +61,7 @@ public class TSettingController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:setting:query')")
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Integer id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Integer id) {
         return success(tSettingService.selectTSettingById(id));
     }
 
@@ -74,8 +71,7 @@ public class TSettingController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:setting:add')")
     @Log(title = "手环系统设置", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody TSetting tSetting)
-    {
+    public AjaxResult add(@RequestBody TSetting tSetting) {
         return toAjax(tSettingService.insertTSetting(tSetting));
     }
 
@@ -85,8 +81,7 @@ public class TSettingController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:setting:edit')")
     @Log(title = "手环系统设置", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody TSetting tSetting)
-    {
+    public AjaxResult edit(@RequestBody TSetting tSetting) {
         return toAjax(tSettingService.updateTSetting(tSetting));
     }
 
@@ -95,9 +90,8 @@ public class TSettingController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:setting:remove')")
     @Log(title = "手环系统设置", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Integer[] ids)
-    {
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Integer[] ids) {
         return toAjax(tSettingService.deleteTSettingByIds(ids));
     }
 }

+ 21 - 27
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TSosSolveController.java

@@ -6,7 +6,10 @@ import javax.servlet.http.HttpServletResponse;
 
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.bean.BeanUtils;
+import com.ruoyi.system.domain.TEarlyWarning;
 import com.ruoyi.system.domain.dto.AddDeviceDto;
+import com.ruoyi.system.service.ITEarlyWarningService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -28,35 +31,27 @@ import com.ruoyi.common.core.page.TableDataInfo;
 
 /**
  * SOS预警处理Controller
- * 
+ *
  * @author zhengjie
  * @date 2023-09-08
  */
 @RestController
 @RequestMapping("/system/solve")
-public class TSosSolveController extends BaseController
-{
+public class TSosSolveController extends BaseController {
     @Autowired
     private ITSosSolveService tSosSolveService;
+    @Autowired
+    private ITEarlyWarningService itEarlyWarningService;
 
     /**
      * 查询SOS预警处理列表
      */
     @PreAuthorize("@ss.hasPermi('system:solve:list')")
     @GetMapping("/list")
-    public TableDataInfo list(TSosSolve tSosSolve)
-    {
+    public TableDataInfo list(TEarlyWarning earlyWarning) {
         startPage();
-        List<TSosSolve> list = tSosSolveService.selectTSosSolveList(tSosSolve);
-        for (TSosSolve salve : list){
-            if (StringUtils.isNull(salve.getSolve_status())){
-                salve.setSolve_status(0);
-            }
-            salve.setAlarmMsg("SOS紧急求助:" + salve.getName() + "于" + DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,salve.getCreatetime()) + "发起SOS紧急求助");
-        }
-        List<TSosSolve> collect=list.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(()->new TreeSet<TSosSolve>(Comparator.comparing(TSosSolve::getAid))), ArrayList::new));
-        collect = collect.stream().sorted(Comparator.comparing(TSosSolve::getCreatetime).reversed()).collect(Collectors.toList());
-        return getDataTable(collect);
+        List<TEarlyWarning> tEarlyWarnings = itEarlyWarningService.selectTEarlyWarningList_SOS(earlyWarning);
+        return getDataTable(tEarlyWarnings);
     }
 
     /**
@@ -65,8 +60,7 @@ public class TSosSolveController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:solve:export')")
     @Log(title = "SOS预警处理", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, TSosSolve tSosSolve)
-    {
+    public void export(HttpServletResponse response, TSosSolve tSosSolve) {
         List<TSosSolve> list = tSosSolveService.selectTSosSolveList(tSosSolve);
         ExcelUtil<TSosSolve> util = new ExcelUtil<TSosSolve>(TSosSolve.class);
         util.exportExcel(response, list, "SOS预警处理数据");
@@ -77,8 +71,7 @@ public class TSosSolveController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:solve:query')")
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Integer id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Integer id) {
         return success(tSosSolveService.selectTSosSolveById(id));
     }
 
@@ -88,9 +81,12 @@ public class TSosSolveController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:solve:add')")
     @Log(title = "SOS预警处理", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody TSosSolve tSosSolve)
-    {
-        return toAjax(tSosSolveService.insertTSosSolve(tSosSolve));
+    public AjaxResult add(@RequestBody TEarlyWarning earlyWarning) {
+        if (earlyWarning != null && earlyWarning.getId() != null) {
+            return toAjax(itEarlyWarningService.updateTEarlyWarning(earlyWarning));
+        } else {
+            return toAjax(itEarlyWarningService.insertTEarlyWarning(earlyWarning));
+        }
     }
 
     /**
@@ -99,8 +95,7 @@ public class TSosSolveController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:solve:edit')")
     @Log(title = "SOS预警处理", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody TSosSolve tSosSolve)
-    {
+    public AjaxResult edit(@RequestBody TSosSolve tSosSolve) {
         return toAjax(tSosSolveService.updateTSosSolve(tSosSolve));
     }
 
@@ -109,9 +104,8 @@ public class TSosSolveController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:solve:remove')")
     @Log(title = "SOS预警处理", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Integer[] ids)
-    {
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Integer[] ids) {
         return toAjax(tSosSolveService.deleteTSosSolveByIds(ids));
     }
 }

+ 20 - 16
ruoyi-common/src/main/java/com/ruoyi/common/utils/LocationUtils.java

@@ -18,7 +18,9 @@ import java.util.Map;
 @Component
 public class LocationUtils {
 
-    /**日志对象*/
+    /**
+     * 日志对象
+     */
     private static final Logger logger = LoggerFactory.getLogger(LocationUtils.class);
 
     private String KEY = "67019de565fb4aa2a0e101b70ae3fd91";
@@ -35,9 +37,10 @@ public class LocationUtils {
 
     /**
      * 发送get请求
+     *
      * @return
      */
-    public JSONObject getLocation(Map<String, String> params){
+    public JSONObject getLocation(Map<String, String> params) {
 
         JSONObject jsonObject = null;
         CloseableHttpClient httpclient = HttpClients.createDefault();
@@ -61,32 +64,34 @@ public class LocationUtils {
 
     /**
      * 根据地址获取到经纬度
+     *
      * @param response
      * @return
      */
-    private static JSONObject getLocation(CloseableHttpResponse response) throws Exception{
+    private static JSONObject getLocation(CloseableHttpResponse response) throws Exception {
         JSONObject geocode = null;
         // 判断返回状态是否为200
         if (response.getStatusLine().getStatusCode() == 200) {
             String content = EntityUtils.toString(response.getEntity(), "UTF-8");
-            logger.info("调用高德地图接口返回的结果为:{}",content);
+            logger.info("调用高德地图接口返回的结果为:{}", content);
             JSONObject jsonObject = (JSONObject) JSONObject.parse(content);
             JSONArray geocodes = (JSONArray) jsonObject.get("geocodes");
             geocode = (JSONObject) geocodes.get(0);
 
-            logger.info("返回的结果为:{}",JSONObject.toJSONString(geocode));
+            logger.info("返回的结果为:{}", JSONObject.toJSONString(geocode));
         }
         return geocode;
     }
 
     /**
      * 地理编码封装URI
+     *
      * @param url
      * @param params
      * @return
      * @throws Exception
      */
-    private URI getBuilderLocation(String url, Map<String, String> params) throws Exception{
+    private URI getBuilderLocation(String url, Map<String, String> params) throws Exception {
         // 详细地址
         String address = params.get("address");
         String city = params.get("city");
@@ -104,38 +109,36 @@ public class LocationUtils {
 
     /**
      * 逆地理编码
+     *
      * @return
      */
-    public JSONObject getCounterLocation(Map<String, String> params){
-
+    public JSONObject getCounterLocation(Map<String, String> params) {
         JSONObject jsonObject = null;
         CloseableHttpClient httpclient = HttpClients.createDefault();
-
         // 创建URI对象,并且设置请求参数
         try {
             URI uri = getBuilderCounterLocation(COUNTER_LOCATION_URL, params);
             // 创建http GET请求
             HttpGet httpGet = new HttpGet(uri);
             CloseableHttpResponse response = httpclient.execute(httpGet);
-
             // 判断返回状态是否为200
             jsonObject = getCounterLocation(response);
             httpclient.close();
         } catch (Exception e) {
             e.printStackTrace();
         }
-
         return jsonObject;
     }
 
     /**
      * 逆地理编码封装URI
+     *
      * @param url
      * @param params
      * @return
      * @throws Exception
      */
-    private URI getBuilderCounterLocation(String url, Map<String, String> params) throws Exception{
+    private URI getBuilderCounterLocation(String url, Map<String, String> params) throws Exception {
         // 详细地址
         String location = params.get("location");
 
@@ -151,19 +154,20 @@ public class LocationUtils {
 
     /**
      * 根据地址获取到经纬度
+     *
      * @param response
      * @return
      */
-    private static JSONObject getCounterLocation(CloseableHttpResponse response) throws Exception{
+    private static JSONObject getCounterLocation(CloseableHttpResponse response) throws Exception {
         JSONObject regeocode = null;
         // 判断返回状态是否为200
         if (response.getStatusLine().getStatusCode() == 200) {
             String content = EntityUtils.toString(response.getEntity(), "UTF-8");
-            logger.info("调用高德地图接口返回的结果为:{}",content);
+            logger.info("调用高德地图接口返回的结果为:{}", content);
             JSONObject jsonObject = (JSONObject) JSONObject.parse(content);
-            regeocode =  (JSONObject)jsonObject.get("regeocode");
+            regeocode = (JSONObject) jsonObject.get("regeocode");
 
-            logger.info("返回的结果为:{}",JSONObject.toJSONString(regeocode));
+            logger.info("返回的结果为:{}", JSONObject.toJSONString(regeocode));
         }
         return regeocode;
     }

+ 376 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/TEarlyWarning.java

@@ -0,0 +1,376 @@
+package com.ruoyi.system.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+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;
+
+import java.util.Date;
+import java.util.StringJoiner;
+
+/**
+ * 【请填写功能名称】对象 t_early_warning
+ *
+ * @author ruoyi
+ * @date 2023-09-27
+ */
+public class TEarlyWarning extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 预警id
+     */
+    private Long id;
+
+    /**
+     * 用户id
+     */
+    @Excel(name = "用户id")
+    private Long userId;
+
+    /**
+     * 状态:0-未处理;1-已处理;2-处理中
+     */
+    @Excel(name = "状态:0-未处理;1-已处理;2-处理中")
+    private Integer state;
+    /**
+     * 状态:0-未处理;1-处理中;2-已处理
+     */
+    @Excel(name = "状态:0-未处理;1-处理中;2-已处理")
+    private Integer solve_status;
+
+    /**
+     * 报警类型:0 无效16:SOS报警;17:低电报警;20:手环拆除报警;21:跌倒报警;22:心率异常报警,23:血压异常报警,24:体温异常报警,25:血氧异常报警
+     */
+    @Excel(name = "报警类型:0 无效16:SOS报警;17:低电报警;20:手环拆除报警;21:跌倒报警;22:心率异常报警,23:血压异常报警,24:体温异常报警,25:血氧异常报警")
+    private Integer type;
+
+    /**
+     * 告警内容
+     */
+    @Excel(name = "告警内容")
+    private String content;
+    /**
+     * 告警内容
+     */
+    @Excel(name = "告警内容")
+    private String alarmMsg;
+
+    /**
+     * 事件记录
+     */
+    @Excel(name = "事件记录")
+    private String eventRecord;
+
+    /**
+     * 事件记录
+     */
+    @Excel(name = "事件记录")
+    private String msg;
+
+    /**
+     * 预警定位
+     */
+    @Excel(name = "预警定位")
+    private String location;
+
+    /**
+     * 告警地址
+     */
+    @Excel(name = "告警地址")
+    private String address_desc;
+
+    /**
+     * 经度
+     */
+    @Excel(name = "经度")
+    private Double lng;
+
+    /**
+     * 维度
+     */
+    @Excel(name = "维度")
+    private Double lat;
+    /**
+     * 经度
+     */
+    @Excel(name = "经度")
+    private Double gps_long;
+
+    /**
+     * 维度
+     */
+    @Excel(name = "维度")
+    private Double gps_lat;
+
+    /**
+     * 设备ID
+     */
+    @Excel(name = "设备ID")
+    private Long facilityId;
+
+    /**
+     * 设置id编码
+     */
+    @Excel(name = "设置id编码")
+    private String deviceIdCode;
+
+    /**
+     * 预警表ID
+     */
+    @Excel(name = "预警表ID")
+    private Long alarmId;
+    /**
+     * 用户名
+     */
+    @Excel(name = "用户名")
+    private String name;
+    /**
+     * 手机号
+     */
+    @Excel(name = "手机号")
+    private String tel_one;
+    /**
+     * 所属机构ID
+     */
+    @Excel(name = "所属机构ID")
+    private Long service_id;
+    /**
+     * 所属机构名称
+     */
+    @Excel(name = "所属机构名称")
+    private String store_name;
+    /**
+     * 设备型号
+     */
+    @Excel(name = "设备型号")
+    private String device_model;
+    /**
+     * 事件类型
+     */
+    @Excel(name = "事件类型")
+    private Integer alarm_type;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public Integer getState() {
+        return state;
+    }
+
+    public void setState(Integer state) {
+        this.state = state;
+    }
+
+    public Integer getSolve_status() {
+        return solve_status;
+    }
+
+    public void setSolve_status(Integer solve_status) {
+        this.solve_status = solve_status;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public String getAlarmMsg() {
+        return alarmMsg;
+    }
+
+    public void setAlarmMsg(String alarmMsg) {
+        this.alarmMsg = alarmMsg;
+    }
+
+    public String getEventRecord() {
+        return eventRecord;
+    }
+
+    public void setEventRecord(String eventRecord) {
+        this.eventRecord = eventRecord;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    public String getLocation() {
+        return location;
+    }
+
+    public void setLocation(String location) {
+        this.location = location;
+    }
+
+    public String getAddress_desc() {
+        return address_desc;
+    }
+
+    public void setAddress_desc(String address_desc) {
+        this.address_desc = address_desc;
+    }
+
+    public Double getLng() {
+        return lng;
+    }
+
+    public void setLng(Double lng) {
+        this.lng = lng;
+    }
+
+    public Double getLat() {
+        return lat;
+    }
+
+    public void setLat(Double lat) {
+        this.lat = lat;
+    }
+
+    public Double getGps_long() {
+        return gps_long;
+    }
+
+    public void setGps_long(Double gps_long) {
+        this.gps_long = gps_long;
+    }
+
+    public Double getGps_lat() {
+        return gps_lat;
+    }
+
+    public void setGps_lat(Double gps_lat) {
+        this.gps_lat = gps_lat;
+    }
+
+    public Long getFacilityId() {
+        return facilityId;
+    }
+
+    public void setFacilityId(Long facilityId) {
+        this.facilityId = facilityId;
+    }
+
+    public String getDeviceIdCode() {
+        return deviceIdCode;
+    }
+
+    public void setDeviceIdCode(String deviceIdCode) {
+        this.deviceIdCode = deviceIdCode;
+    }
+
+    public Long getAlarmId() {
+        return alarmId;
+    }
+
+    public void setAlarmId(Long alarmId) {
+        this.alarmId = alarmId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getTel_one() {
+        return tel_one;
+    }
+
+    public void setTel_one(String tel_one) {
+        this.tel_one = tel_one;
+    }
+
+    public Long getService_id() {
+        return service_id;
+    }
+
+    public void setService_id(Long service_id) {
+        this.service_id = service_id;
+    }
+
+    public String getStore_name() {
+        return store_name;
+    }
+
+    public void setStore_name(String store_name) {
+        this.store_name = store_name;
+    }
+
+    public String getDevice_model() {
+        return device_model;
+    }
+
+    public void setDevice_model(String device_model) {
+        this.device_model = device_model;
+    }
+
+    public Integer getAlarm_type() {
+        return alarm_type;
+    }
+
+    public void setAlarm_type(Integer alarm_type) {
+        this.alarm_type = alarm_type;
+    }
+
+    @Override
+    public String toString() {
+        return new StringJoiner(", ", TEarlyWarning.class.getSimpleName() + "[", "]")
+                .add("id=" + id)
+                .add("userId=" + userId)
+                .add("state=" + state)
+                .add("solve_status=" + solve_status)
+                .add("type=" + type)
+                .add("content='" + content + "'")
+                .add("alarmMsg='" + alarmMsg + "'")
+                .add("eventRecord='" + eventRecord + "'")
+                .add("msg='" + msg + "'")
+                .add("location='" + location + "'")
+                .add("address_desc='" + address_desc + "'")
+                .add("lng=" + lng)
+                .add("lat=" + lat)
+                .add("gps_long=" + gps_long)
+                .add("gps_lat=" + gps_lat)
+                .add("facilityId=" + facilityId)
+                .add("deviceIdCode='" + deviceIdCode + "'")
+                .add("alarmId=" + alarmId)
+                .add("name='" + name + "'")
+                .add("tel_one='" + tel_one + "'")
+                .add("service_id=" + service_id)
+                .add("store_name='" + store_name + "'")
+                .add("device_model='" + device_model + "'")
+                .add("alarm_type=" + alarm_type)
+                .toString();
+    }
+}

+ 182 - 121
ruoyi-system/src/main/java/com/ruoyi/system/domain/TShouhuanAlarmList.java

@@ -2,6 +2,8 @@ package com.ruoyi.system.domain;
 
 import java.math.BigDecimal;
 import java.util.Date;
+import java.util.StringJoiner;
+
 import com.fasterxml.jackson.annotation.JsonFormat;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
@@ -10,285 +12,344 @@ import com.ruoyi.common.core.domain.BaseEntity;
 
 /**
  * 手环报警列信息对象 t_shouhuan_alarm_list
- * 
+ *
  * @author ruoyi
  * @date 2023-09-07
  */
-public class TShouhuanAlarmList extends BaseEntity
-{
+public class TShouhuanAlarmList extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** $column.columnComment */
+    /**
+     * $column.columnComment
+     */
     private Integer id;
 
-    /** 设备id */
+    /**
+     * 设备id
+     */
     @Excel(name = "设备id")
     private Integer facilityId;
 
-    /** 手环信息id */
+    /**
+     * 手环信息id
+     */
     @Excel(name = "手环信息id")
     private Integer shinfoId;
 
-    /** 设置id编码 */
+    /**
+     * 设置id编码
+     */
     @Excel(name = "设置id编码")
     private String deviceIdCode;
 
-    /** 经度 */
+    /**
+     * 经度
+     */
     @Excel(name = "经度")
     private BigDecimal gpsLong;
 
-    /** 纬度 */
+    /**
+     * 纬度
+     */
     @Excel(name = "纬度")
     private BigDecimal gpsLat;
+    /**
+     * 经度
+     */
+    @Excel(name = "经度")
+    private BigDecimal useGpsLong;
 
-    /** 速度 公里/小时 */
+    /**
+     * 纬度
+     */
+    @Excel(name = "纬度")
+    private BigDecimal useGpsLat;
+
+    /**
+     * 速度 公里/小时
+     */
     @Excel(name = "速度 公里/小时")
     private BigDecimal speed;
 
-    /** 方向 度 */
+    /**
+     * 方向 度
+     */
     @Excel(name = "方向 度")
     private Integer direction;
 
-    /** 海拔 */
+    /**
+     * 海拔
+     */
     @Excel(name = "海拔")
     private Integer poster;
 
-    /** 电量 */
+    /**
+     * 电量
+     */
     @Excel(name = "电量")
     private Integer electricQuantity;
 
-    /** 计步数 */
+    /**
+     * 计步数
+     */
     @Excel(name = "计步数")
     private Integer stepNumber;
 
-    /** 翻滚数 */
+    /**
+     * 翻滚数
+     */
     @Excel(name = "翻滚数")
     private Integer rollNumber;
 
-    /** 状态类型 0 无效 1:低电状态;2:出围栏状态;3:进围栏状态;4:手环戴上取下状态;5:手表运行静止状态 */
+    /**
+     * 状态类型 0 无效 1:低电状态;2:出围栏状态;3:进围栏状态;4:手环戴上取下状态;5:手表运行静止状态
+     */
     @Excel(name = "状态类型 0 无效 1:低电状态;2:出围栏状态;3:进围栏状态;4:手环戴上取下状态;5:手表运行静止状态")
     private Integer statusType;
 
-    /** 报警类型 0 无效 16:SOS报警;17:低电报警;20:手环拆除报警;21:跌倒报警;22:心率异常报警 */
+    /**
+     * 报警类型 0 无效 16:SOS报警;17:低电报警;20:手环拆除报警;21:跌倒报警;22:心率异常报警
+     */
     @Excel(name = "报警类型 0 无效 16:SOS报警;17:低电报警;20:手环拆除报警;21:跌倒报警;22:心率异常报警")
     private Integer alarmType;
 
-    /** 终端状态 */
+    /**
+     * 终端状态
+     */
     @Excel(name = "终端状态")
     private String terminalStatus;
-
-    /** 来源类型 1终端主动发 0平台记录 */
+    /**
+     * 位置
+     */
+    @Excel(name = "位置")
+    private String location;
+
+    /**
+     * 来源类型 1终端主动发 0平台记录
+     */
     @Excel(name = "来源类型 1终端主动发 0平台记录")
     private Integer alarmFromType;
 
-    /** 报警信息 平台记录使用 */
+    /**
+     * 报警信息 平台记录使用
+     */
     @Excel(name = "报警信息 平台记录使用")
     private String msg;
 
-    /** 是否发送 1是 0否 */
+    /**
+     * 是否发送 1是 0否
+     */
     @Excel(name = "是否发送 1是 0否")
     private Integer isSend;
 
-    /** 发送时间 */
+    /**
+     * 发送时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "发送时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date sendTime;
 
-    public void setId(Integer id) 
-    {
+    public void setId(Integer id) {
         this.id = id;
     }
 
-    public Integer getId() 
-    {
+    public Integer getId() {
         return id;
     }
-    public void setFacilityId(Integer facilityId) 
-    {
+
+    public void setFacilityId(Integer facilityId) {
         this.facilityId = facilityId;
     }
 
-    public Integer getFacilityId() 
-    {
+    public Integer getFacilityId() {
         return facilityId;
     }
-    public void setShinfoId(Integer shinfoId) 
-    {
+
+    public void setShinfoId(Integer shinfoId) {
         this.shinfoId = shinfoId;
     }
 
-    public Integer getShinfoId() 
-    {
+    public Integer getShinfoId() {
         return shinfoId;
     }
-    public void setDeviceIdCode(String deviceIdCode) 
-    {
+
+    public void setDeviceIdCode(String deviceIdCode) {
         this.deviceIdCode = deviceIdCode;
     }
 
-    public String getDeviceIdCode() 
-    {
+    public String getDeviceIdCode() {
         return deviceIdCode;
     }
-    public void setGpsLong(BigDecimal gpsLong) 
-    {
+
+    public void setGpsLong(BigDecimal gpsLong) {
         this.gpsLong = gpsLong;
     }
 
-    public BigDecimal getGpsLong() 
-    {
+    public BigDecimal getGpsLong() {
         return gpsLong;
     }
-    public void setGpsLat(BigDecimal gpsLat) 
-    {
+
+    public void setGpsLat(BigDecimal gpsLat) {
         this.gpsLat = gpsLat;
     }
 
-    public BigDecimal getGpsLat() 
-    {
+    public BigDecimal getGpsLat() {
         return gpsLat;
     }
-    public void setSpeed(BigDecimal speed) 
-    {
+
+    public BigDecimal getUseGpsLong() {
+        return useGpsLong;
+    }
+
+    public void setUseGpsLong(BigDecimal useGpsLong) {
+        this.useGpsLong = useGpsLong;
+    }
+
+    public BigDecimal getUseGpsLat() {
+        return useGpsLat;
+    }
+
+    public void setUseGpsLat(BigDecimal useGpsLat) {
+        this.useGpsLat = useGpsLat;
+    }
+
+    public void setSpeed(BigDecimal speed) {
         this.speed = speed;
     }
 
-    public BigDecimal getSpeed() 
-    {
+    public BigDecimal getSpeed() {
         return speed;
     }
-    public void setDirection(Integer direction) 
-    {
+
+    public void setDirection(Integer direction) {
         this.direction = direction;
     }
 
-    public Integer getDirection() 
-    {
+    public Integer getDirection() {
         return direction;
     }
-    public void setPoster(Integer poster) 
-    {
+
+    public void setPoster(Integer poster) {
         this.poster = poster;
     }
 
-    public Integer getPoster() 
-    {
+    public Integer getPoster() {
         return poster;
     }
-    public void setElectricQuantity(Integer electricQuantity) 
-    {
+
+    public void setElectricQuantity(Integer electricQuantity) {
         this.electricQuantity = electricQuantity;
     }
 
-    public Integer getElectricQuantity() 
-    {
+    public Integer getElectricQuantity() {
         return electricQuantity;
     }
-    public void setStepNumber(Integer stepNumber) 
-    {
+
+    public void setStepNumber(Integer stepNumber) {
         this.stepNumber = stepNumber;
     }
 
-    public Integer getStepNumber() 
-    {
+    public Integer getStepNumber() {
         return stepNumber;
     }
-    public void setRollNumber(Integer rollNumber) 
-    {
+
+    public void setRollNumber(Integer rollNumber) {
         this.rollNumber = rollNumber;
     }
 
-    public Integer getRollNumber() 
-    {
+    public Integer getRollNumber() {
         return rollNumber;
     }
-    public void setStatusType(Integer statusType) 
-    {
+
+    public void setStatusType(Integer statusType) {
         this.statusType = statusType;
     }
 
-    public Integer getStatusType() 
-    {
+    public Integer getStatusType() {
         return statusType;
     }
-    public void setAlarmType(Integer alarmType) 
-    {
+
+    public void setAlarmType(Integer alarmType) {
         this.alarmType = alarmType;
     }
 
-    public Integer getAlarmType() 
-    {
+    public Integer getAlarmType() {
         return alarmType;
     }
-    public void setTerminalStatus(String terminalStatus) 
-    {
+
+    public void setTerminalStatus(String terminalStatus) {
         this.terminalStatus = terminalStatus;
     }
 
-    public String getTerminalStatus() 
-    {
+    public String getTerminalStatus() {
         return terminalStatus;
     }
-    public void setAlarmFromType(Integer alarmFromType) 
-    {
+
+    public String getLocation() {
+        return location;
+    }
+
+    public void setLocation(String location) {
+        this.location = location;
+    }
+
+    public void setAlarmFromType(Integer alarmFromType) {
         this.alarmFromType = alarmFromType;
     }
 
-    public Integer getAlarmFromType() 
-    {
+    public Integer getAlarmFromType() {
         return alarmFromType;
     }
-    public void setMsg(String msg) 
-    {
+
+    public void setMsg(String msg) {
         this.msg = msg;
     }
 
-    public String getMsg() 
-    {
+    public String getMsg() {
         return msg;
     }
-    public void setIsSend(Integer isSend) 
-    {
+
+    public void setIsSend(Integer isSend) {
         this.isSend = isSend;
     }
 
-    public Integer getIsSend() 
-    {
+    public Integer getIsSend() {
         return isSend;
     }
-    public void setSendTime(Date sendTime) 
-    {
+
+    public void setSendTime(Date sendTime) {
         this.sendTime = sendTime;
     }
 
-    public Date getSendTime() 
-    {
+    public Date getSendTime() {
         return sendTime;
     }
 
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("id", getId())
-            .append("facilityId", getFacilityId())
-            .append("shinfoId", getShinfoId())
-            .append("deviceIdCode", getDeviceIdCode())
-            .append("gpsLong", getGpsLong())
-            .append("gpsLat", getGpsLat())
-            .append("speed", getSpeed())
-            .append("direction", getDirection())
-            .append("poster", getPoster())
-            .append("electricQuantity", getElectricQuantity())
-            .append("stepNumber", getStepNumber())
-            .append("rollNumber", getRollNumber())
-            .append("statusType", getStatusType())
-            .append("alarmType", getAlarmType())
-            .append("terminalStatus", getTerminalStatus())
-            .append("createTime", getCreateTime())
-            .append("alarmFromType", getAlarmFromType())
-            .append("msg", getMsg())
-            .append("isSend", getIsSend())
-            .append("sendTime", getSendTime())
-            .toString();
+        return new StringJoiner(", ", TShouhuanAlarmList.class.getSimpleName() + "[", "]")
+                .add("id=" + id)
+                .add("facilityId=" + facilityId)
+                .add("shinfoId=" + shinfoId)
+                .add("deviceIdCode='" + deviceIdCode + "'")
+                .add("gpsLong=" + gpsLong)
+                .add("gpsLat=" + gpsLat)
+                .add("useGgpsLong=" + useGpsLong)
+                .add("useGpsLat=" + useGpsLat)
+                .add("speed=" + speed)
+                .add("direction=" + direction)
+                .add("poster=" + poster)
+                .add("electricQuantity=" + electricQuantity)
+                .add("stepNumber=" + stepNumber)
+                .add("rollNumber=" + rollNumber)
+                .add("statusType=" + statusType)
+                .add("alarmType=" + alarmType)
+                .add("terminalStatus='" + terminalStatus + "'")
+                .add("location='" + location + "'")
+                .add("alarmFromType=" + alarmFromType)
+                .add("msg='" + msg + "'")
+                .add("isSend=" + isSend)
+                .add("sendTime=" + sendTime)
+                .toString();
     }
 }

+ 260 - 221
ruoyi-system/src/main/java/com/ruoyi/system/domain/TShouhuanInfo.java

@@ -2,6 +2,7 @@ package com.ruoyi.system.domain;
 
 import java.math.BigDecimal;
 import java.util.Date;
+
 import com.fasterxml.jackson.annotation.JsonFormat;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
@@ -10,329 +11,386 @@ import com.ruoyi.common.core.domain.BaseEntity;
 
 /**
  * 手环信息 实时数据对象 t_shouhuan_info
- * 
+ *
  * @author ruoyi
  * @date 2023-09-07
  */
-public class TShouhuanInfo extends BaseEntity
-{
+public class TShouhuanInfo extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** $column.columnComment */
+    /**
+     * $column.columnComment
+     */
     private Integer id;
 
-    /** 设备id */
+    /**
+     * 设备id
+     */
     @Excel(name = "设备id")
     private Integer facilityId;
 
-    /** 设置id编码 */
+    /**
+     * 设置id编码
+     */
     @Excel(name = "设置id编码")
     private String deviceIdCode;
 
-    /** 版本 */
+    /**
+     * 版本
+     */
     @Excel(name = "版本")
     private String version;
 
-    /** 经度 */
+    /**
+     * 经度
+     */
     @Excel(name = "经度")
     private BigDecimal gpsLong;
 
-    /** 纬度 */
+    /**
+     * 纬度
+     */
     @Excel(name = "纬度")
     private BigDecimal gpsLat;
 
-    /** 使用经度 */
+    /**
+     * 使用经度
+     */
     @Excel(name = "使用经度")
     private BigDecimal useGpsLong;
 
-    /** 使用纬度 */
+    /**
+     * 使用纬度
+     */
     @Excel(name = "使用纬度")
     private BigDecimal useGpsLat;
 
-    /** 使用mac */
+    /**
+     * 使用mac
+     */
     @Excel(name = "使用mac")
     private String useMac;
 
-    /** 速度 公里/小时 */
+    /**
+     * 速度 公里/小时
+     */
     @Excel(name = "速度 公里/小时")
     private BigDecimal speed;
 
-    /** 方向 度 */
+    /**
+     * 方向 度
+     */
     @Excel(name = "方向 度")
     private Integer direction;
 
-    /** 海拔 */
+    /**
+     * 海拔
+     */
     @Excel(name = "海拔")
     private Integer poster;
 
-    /** 电量 */
+    /**
+     * 电量
+     */
     @Excel(name = "电量")
     private Integer electricQuantity;
 
-    /** 计步数 */
+    /**
+     * 计步数
+     */
     @Excel(name = "计步数")
     private Integer stepNumber;
 
-    /** 翻滚数 */
+    /**
+     * 翻滚数
+     */
     @Excel(name = "翻滚数")
     private Integer rollNumber;
 
-    /** 终端状态 */
+    /**
+     * 终端状态
+     */
     @Excel(name = "终端状态")
     private String terminalStatus;
 
-    /** 在线状态 1在线 0离线 */
+    /**
+     * 在线状态 1在线 0离线
+     */
     @Excel(name = "在线状态 1在线 0离线")
     private Integer onlineStatis;
 
-    /** 体温 */
+    /**
+     * 体温
+     */
     @Excel(name = "体温")
     private Integer temp;
 
-    /** 血压 高压 0无效 */
+    /**
+     * 血压 高压 0无效
+     */
     @Excel(name = "血压 高压 0无效")
     private Integer bloodHeightPressure;
 
-    /** 血压 低压 0无效 */
+    /**
+     * 血压 低压 0无效
+     */
     @Excel(name = "血压 低压 0无效")
     private Integer bloodLowPressure;
 
-    /** 心率 0无效 */
+    /**
+     * 心率 0无效
+     */
     @Excel(name = "心率 0无效")
     private Integer heartRate;
 
-    /** 血养饱和度 */
+    /**
+     * 血养饱和度
+     */
     @Excel(name = "血养饱和度")
     private Integer oxygen;
 
-    /** 时间 */
+    /**
+     * 时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Excel(name = "时间")
     private Date createtime;
 
-    /** 时间 */
+    /**
+     * 时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Excel(name = "时间")
     private Date updatetime;
 
-    /** 离线时间 */
+    /**
+     * 离线时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "离线时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date offlinetime;
 
-    /** 上线时间 */
+    /**
+     * 上线时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "上线时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date onlinetime;
 
-    /** gps更新时间 */
+    /**
+     * gps更新时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "gps更新时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date gpsUpdateTime;
 
-    /** 血压更新时间 */
+    /**
+     * 血压更新时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "血压更新时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date bloodUpdateTime;
 
-    /** 心率更新时间 */
+    /**
+     * 心率更新时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "心率更新时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date heartUpdateTime;
 
-    /** 体温更新时间 */
+    /**
+     * 体温更新时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "体温更新时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date tempUpdateTime;
 
-    /** 血氧更新时间 */
+    /**
+     * 血氧更新时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "血氧更新时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date oxygenUpdateTime;
 
-    /** 电量更新时间 */
+    /**
+     * 电量更新时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "电量更新时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date electricQuantityUpdateTime;
 
-    /** 步数更新时间 */
+    /**
+     * 步数更新时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "步数更新时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date stepNumberUpdateTime;
 
-    /** 翻滚数更新时间 */
+    /**
+     * 翻滚数更新时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "翻滚数更新时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date rollNumberUpdateTime;
 
-    /** 终端状态更新时间 */
+    /**
+     * 终端状态更新时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "终端状态更新时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date terminalStatusUpdateTime;
 
-    /** 0非接口获取坐标 1移动接入 2wifi接入 -2 查询失败 */
+    /**
+     * 0非接口获取坐标 1移动接入 2wifi接入 -2 查询失败
+     */
     @Excel(name = "0非接口获取坐标 1移动接入 2wifi接入 -2 查询失败")
     private Integer accesstype;
 
-    /** 详细地址 */
+    /**
+     * 详细地址
+     */
     @Excel(name = "详细地址")
     private String addressDesc;
 
-    /** 手环是否定位 1 是 0 否 */
+    /**
+     * 手环是否定位 1 是 0 否
+     */
     @Excel(name = "手环是否定位 1 是 0 否")
     private Integer isGps;
 
-    public void setId(Integer id)
-    {
+    public void setId(Integer id) {
         this.id = id;
     }
 
-    public Integer getId()
-    {
+    public Integer getId() {
         return id;
     }
-    public void setFacilityId(Integer facilityId)
-    {
+
+    public void setFacilityId(Integer facilityId) {
         this.facilityId = facilityId;
     }
 
-    public Integer getFacilityId()
-    {
+    public Integer getFacilityId() {
         return facilityId;
     }
-    public void setDeviceIdCode(String deviceIdCode) 
-    {
+
+    public void setDeviceIdCode(String deviceIdCode) {
         this.deviceIdCode = deviceIdCode;
     }
 
-    public String getDeviceIdCode() 
-    {
+    public String getDeviceIdCode() {
         return deviceIdCode;
     }
-    public void setVersion(String version) 
-    {
+
+    public void setVersion(String version) {
         this.version = version;
     }
 
-    public String getVersion() 
-    {
+    public String getVersion() {
         return version;
     }
-    public void setGpsLong(BigDecimal gpsLong) 
-    {
+
+    public void setGpsLong(BigDecimal gpsLong) {
         this.gpsLong = gpsLong;
     }
 
-    public BigDecimal getGpsLong() 
-    {
+    public BigDecimal getGpsLong() {
         return gpsLong;
     }
-    public void setGpsLat(BigDecimal gpsLat) 
-    {
+
+    public void setGpsLat(BigDecimal gpsLat) {
         this.gpsLat = gpsLat;
     }
 
-    public BigDecimal getGpsLat() 
-    {
+    public BigDecimal getGpsLat() {
         return gpsLat;
     }
-    public void setUseGpsLong(BigDecimal useGpsLong) 
-    {
+
+    public void setUseGpsLong(BigDecimal useGpsLong) {
         this.useGpsLong = useGpsLong;
     }
 
-    public BigDecimal getUseGpsLong() 
-    {
+    public BigDecimal getUseGpsLong() {
         return useGpsLong;
     }
-    public void setUseGpsLat(BigDecimal useGpsLat) 
-    {
+
+    public void setUseGpsLat(BigDecimal useGpsLat) {
         this.useGpsLat = useGpsLat;
     }
 
-    public BigDecimal getUseGpsLat() 
-    {
+    public BigDecimal getUseGpsLat() {
         return useGpsLat;
     }
-    public void setUseMac(String useMac) 
-    {
+
+    public void setUseMac(String useMac) {
         this.useMac = useMac;
     }
 
-    public String getUseMac() 
-    {
+    public String getUseMac() {
         return useMac;
     }
-    public void setSpeed(BigDecimal speed) 
-    {
+
+    public void setSpeed(BigDecimal speed) {
         this.speed = speed;
     }
 
-    public BigDecimal getSpeed() 
-    {
+    public BigDecimal getSpeed() {
         return speed;
     }
-    public void setDirection(Integer direction) 
-    {
+
+    public void setDirection(Integer direction) {
         this.direction = direction;
     }
 
-    public Integer getDirection() 
-    {
+    public Integer getDirection() {
         return direction;
     }
-    public void setPoster(Integer poster) 
-    {
+
+    public void setPoster(Integer poster) {
         this.poster = poster;
     }
 
-    public Integer getPoster() 
-    {
+    public Integer getPoster() {
         return poster;
     }
-    public void setElectricQuantity(Integer electricQuantity) 
-    {
+
+    public void setElectricQuantity(Integer electricQuantity) {
         this.electricQuantity = electricQuantity;
     }
 
-    public Integer getElectricQuantity() 
-    {
+    public Integer getElectricQuantity() {
         return electricQuantity;
     }
-    public void setStepNumber(Integer stepNumber) 
-    {
+
+    public void setStepNumber(Integer stepNumber) {
         this.stepNumber = stepNumber;
     }
 
-    public Integer getStepNumber() 
-    {
+    public Integer getStepNumber() {
         return stepNumber;
     }
-    public void setRollNumber(Integer rollNumber) 
-    {
+
+    public void setRollNumber(Integer rollNumber) {
         this.rollNumber = rollNumber;
     }
 
-    public Integer getRollNumber() 
-    {
+    public Integer getRollNumber() {
         return rollNumber;
     }
-    public void setTerminalStatus(String terminalStatus) 
-    {
+
+    public void setTerminalStatus(String terminalStatus) {
         this.terminalStatus = terminalStatus;
     }
 
-    public String getTerminalStatus() 
-    {
+    public String getTerminalStatus() {
         return terminalStatus;
     }
-    public void setOnlineStatis(Integer onlineStatis) 
-    {
+
+    public void setOnlineStatis(Integer onlineStatis) {
         this.onlineStatis = onlineStatis;
     }
 
-    public Integer getOnlineStatis() 
-    {
+    public Integer getOnlineStatis() {
         return onlineStatis;
     }
 
@@ -344,166 +402,147 @@ public class TShouhuanInfo extends BaseEntity
         this.temp = temp;
     }
 
-    public void setBloodHeightPressure(Integer bloodHeightPressure)
-    {
+    public void setBloodHeightPressure(Integer bloodHeightPressure) {
         this.bloodHeightPressure = bloodHeightPressure;
     }
 
-    public Integer getBloodHeightPressure() 
-    {
+    public Integer getBloodHeightPressure() {
         return bloodHeightPressure;
     }
-    public void setBloodLowPressure(Integer bloodLowPressure) 
-    {
+
+    public void setBloodLowPressure(Integer bloodLowPressure) {
         this.bloodLowPressure = bloodLowPressure;
     }
 
-    public Integer getBloodLowPressure() 
-    {
+    public Integer getBloodLowPressure() {
         return bloodLowPressure;
     }
-    public void setHeartRate(Integer heartRate) 
-    {
+
+    public void setHeartRate(Integer heartRate) {
         this.heartRate = heartRate;
     }
 
-    public Integer getHeartRate() 
-    {
+    public Integer getHeartRate() {
         return heartRate;
     }
-    public void setOxygen(Integer oxygen) 
-    {
+
+    public void setOxygen(Integer oxygen) {
         this.oxygen = oxygen;
     }
 
-    public Integer getOxygen() 
-    {
+    public Integer getOxygen() {
         return oxygen;
     }
-    public void setOfflinetime(Date offlinetime) 
-    {
+
+    public void setOfflinetime(Date offlinetime) {
         this.offlinetime = offlinetime;
     }
 
-    public Date getOfflinetime() 
-    {
+    public Date getOfflinetime() {
         return offlinetime;
     }
-    public void setOnlinetime(Date onlinetime) 
-    {
+
+    public void setOnlinetime(Date onlinetime) {
         this.onlinetime = onlinetime;
     }
 
-    public Date getOnlinetime() 
-    {
+    public Date getOnlinetime() {
         return onlinetime;
     }
-    public void setGpsUpdateTime(Date gpsUpdateTime) 
-    {
+
+    public void setGpsUpdateTime(Date gpsUpdateTime) {
         this.gpsUpdateTime = gpsUpdateTime;
     }
 
-    public Date getGpsUpdateTime() 
-    {
+    public Date getGpsUpdateTime() {
         return gpsUpdateTime;
     }
-    public void setBloodUpdateTime(Date bloodUpdateTime) 
-    {
+
+    public void setBloodUpdateTime(Date bloodUpdateTime) {
         this.bloodUpdateTime = bloodUpdateTime;
     }
 
-    public Date getBloodUpdateTime() 
-    {
+    public Date getBloodUpdateTime() {
         return bloodUpdateTime;
     }
-    public void setHeartUpdateTime(Date heartUpdateTime) 
-    {
+
+    public void setHeartUpdateTime(Date heartUpdateTime) {
         this.heartUpdateTime = heartUpdateTime;
     }
 
-    public Date getHeartUpdateTime() 
-    {
+    public Date getHeartUpdateTime() {
         return heartUpdateTime;
     }
-    public void setTempUpdateTime(Date tempUpdateTime) 
-    {
+
+    public void setTempUpdateTime(Date tempUpdateTime) {
         this.tempUpdateTime = tempUpdateTime;
     }
 
-    public Date getTempUpdateTime() 
-    {
+    public Date getTempUpdateTime() {
         return tempUpdateTime;
     }
-    public void setOxygenUpdateTime(Date oxygenUpdateTime) 
-    {
+
+    public void setOxygenUpdateTime(Date oxygenUpdateTime) {
         this.oxygenUpdateTime = oxygenUpdateTime;
     }
 
-    public Date getOxygenUpdateTime() 
-    {
+    public Date getOxygenUpdateTime() {
         return oxygenUpdateTime;
     }
-    public void setElectricQuantityUpdateTime(Date electricQuantityUpdateTime) 
-    {
+
+    public void setElectricQuantityUpdateTime(Date electricQuantityUpdateTime) {
         this.electricQuantityUpdateTime = electricQuantityUpdateTime;
     }
 
-    public Date getElectricQuantityUpdateTime() 
-    {
+    public Date getElectricQuantityUpdateTime() {
         return electricQuantityUpdateTime;
     }
-    public void setStepNumberUpdateTime(Date stepNumberUpdateTime) 
-    {
+
+    public void setStepNumberUpdateTime(Date stepNumberUpdateTime) {
         this.stepNumberUpdateTime = stepNumberUpdateTime;
     }
 
-    public Date getStepNumberUpdateTime() 
-    {
+    public Date getStepNumberUpdateTime() {
         return stepNumberUpdateTime;
     }
-    public void setRollNumberUpdateTime(Date rollNumberUpdateTime) 
-    {
+
+    public void setRollNumberUpdateTime(Date rollNumberUpdateTime) {
         this.rollNumberUpdateTime = rollNumberUpdateTime;
     }
 
-    public Date getRollNumberUpdateTime() 
-    {
+    public Date getRollNumberUpdateTime() {
         return rollNumberUpdateTime;
     }
-    public void setTerminalStatusUpdateTime(Date terminalStatusUpdateTime) 
-    {
+
+    public void setTerminalStatusUpdateTime(Date terminalStatusUpdateTime) {
         this.terminalStatusUpdateTime = terminalStatusUpdateTime;
     }
 
-    public Date getTerminalStatusUpdateTime() 
-    {
+    public Date getTerminalStatusUpdateTime() {
         return terminalStatusUpdateTime;
     }
-    public void setAccesstype(Integer accesstype) 
-    {
+
+    public void setAccesstype(Integer accesstype) {
         this.accesstype = accesstype;
     }
 
-    public Integer getAccesstype() 
-    {
+    public Integer getAccesstype() {
         return accesstype;
     }
-    public void setAddressDesc(String addressDesc) 
-    {
+
+    public void setAddressDesc(String addressDesc) {
         this.addressDesc = addressDesc;
     }
 
-    public String getAddressDesc() 
-    {
+    public String getAddressDesc() {
         return addressDesc;
     }
-    public void setIsGps(Integer isGps) 
-    {
+
+    public void setIsGps(Integer isGps) {
         this.isGps = isGps;
     }
 
-    public Integer getIsGps() 
-    {
+    public Integer getIsGps() {
         return isGps;
     }
 
@@ -525,45 +564,45 @@ public class TShouhuanInfo extends BaseEntity
 
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("id", getId())
-            .append("facilityId", getFacilityId())
-            .append("deviceIdCode", getDeviceIdCode())
-            .append("version", getVersion())
-            .append("gpsLong", getGpsLong())
-            .append("gpsLat", getGpsLat())
-            .append("useGpsLong", getUseGpsLong())
-            .append("useGpsLat", getUseGpsLat())
-            .append("useMac", getUseMac())
-            .append("speed", getSpeed())
-            .append("direction", getDirection())
-            .append("poster", getPoster())
-            .append("electricQuantity", getElectricQuantity())
-            .append("stepNumber", getStepNumber())
-            .append("rollNumber", getRollNumber())
-            .append("terminalStatus", getTerminalStatus())
-            .append("onlineStatis", getOnlineStatis())
-            .append("temp", getTemp())
-            .append("bloodHeightPressure", getBloodHeightPressure())
-            .append("bloodLowPressure", getBloodLowPressure())
-            .append("heartRate", getHeartRate())
-            .append("oxygen", getOxygen())
-            .append("offlinetime", getOfflinetime())
-            .append("onlinetime", getOnlinetime())
-            .append("gpsUpdateTime", getGpsUpdateTime())
-            .append("bloodUpdateTime", getBloodUpdateTime())
-            .append("heartUpdateTime", getHeartUpdateTime())
-            .append("tempUpdateTime", getTempUpdateTime())
-            .append("oxygenUpdateTime", getOxygenUpdateTime())
-            .append("electricQuantityUpdateTime", getElectricQuantityUpdateTime())
-            .append("stepNumberUpdateTime", getStepNumberUpdateTime())
-            .append("rollNumberUpdateTime", getRollNumberUpdateTime())
-            .append("terminalStatusUpdateTime", getTerminalStatusUpdateTime())
-            .append("createtime", getCreatetime())
-            .append("updatetime", getUpdatetime())
-            .append("accesstype", getAccesstype())
-            .append("addressDesc", getAddressDesc())
-            .append("isGps", getIsGps())
-            .toString();
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("facilityId", getFacilityId())
+                .append("deviceIdCode", getDeviceIdCode())
+                .append("version", getVersion())
+                .append("gpsLong", getGpsLong())
+                .append("gpsLat", getGpsLat())
+                .append("useGpsLong", getUseGpsLong())
+                .append("useGpsLat", getUseGpsLat())
+                .append("useMac", getUseMac())
+                .append("speed", getSpeed())
+                .append("direction", getDirection())
+                .append("poster", getPoster())
+                .append("electricQuantity", getElectricQuantity())
+                .append("stepNumber", getStepNumber())
+                .append("rollNumber", getRollNumber())
+                .append("terminalStatus", getTerminalStatus())
+                .append("onlineStatis", getOnlineStatis())
+                .append("temp", getTemp())
+                .append("bloodHeightPressure", getBloodHeightPressure())
+                .append("bloodLowPressure", getBloodLowPressure())
+                .append("heartRate", getHeartRate())
+                .append("oxygen", getOxygen())
+                .append("offlinetime", getOfflinetime())
+                .append("onlinetime", getOnlinetime())
+                .append("gpsUpdateTime", getGpsUpdateTime())
+                .append("bloodUpdateTime", getBloodUpdateTime())
+                .append("heartUpdateTime", getHeartUpdateTime())
+                .append("tempUpdateTime", getTempUpdateTime())
+                .append("oxygenUpdateTime", getOxygenUpdateTime())
+                .append("electricQuantityUpdateTime", getElectricQuantityUpdateTime())
+                .append("stepNumberUpdateTime", getStepNumberUpdateTime())
+                .append("rollNumberUpdateTime", getRollNumberUpdateTime())
+                .append("terminalStatusUpdateTime", getTerminalStatusUpdateTime())
+                .append("createtime", getCreatetime())
+                .append("updatetime", getUpdatetime())
+                .append("accesstype", getAccesstype())
+                .append("addressDesc", getAddressDesc())
+                .append("isGps", getIsGps())
+                .toString();
     }
 }

+ 77 - 5
ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/AlarmStatusListDto.java

@@ -1,6 +1,7 @@
 package com.ruoyi.system.domain.dto;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
 
 import java.util.Date;
 
@@ -8,21 +9,60 @@ public class AlarmStatusListDto {
 
     private static final long serialVersionUID = 1L;
 
-    /** 姓名 */
+    /**
+     * ID
+     */
+    private Long id;
+    /**
+     * 姓名
+     */
     private String name;
 
-    /** ID */
+    /**
+     * 设备id
+     */
+    @Excel(name = "设备id")
+    private Integer facilityId;
+    /**
+     * ID
+     */
     private String device_id_code;
 
-    /** 时间 */
+    /**
+     * 时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date createtime;
 
-    /** 类型 */
+    /**
+     * 类型
+     */
     private Integer alarm_type;
 
-    /** 类型 */
+    /**
+     * 类型
+     */
     private String alarm_msg;
+    /**
+     * 位置
+     */
+    private String location;
+    /**
+     * 精度
+     */
+    private Double use_gps_long;
+    /**
+     * 维度
+     */
+    private Double use_gps_lat;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
 
     public String getName() {
         return name;
@@ -40,6 +80,14 @@ public class AlarmStatusListDto {
         this.device_id_code = device_id_code;
     }
 
+    public Integer getFacilityId() {
+        return facilityId;
+    }
+
+    public void setFacilityId(Integer facilityId) {
+        this.facilityId = facilityId;
+    }
+
     public Date getCreatetime() {
         return createtime;
     }
@@ -63,4 +111,28 @@ public class AlarmStatusListDto {
     public void setAlarm_msg(String alarm_msg) {
         this.alarm_msg = alarm_msg;
     }
+
+    public String getLocation() {
+        return location;
+    }
+
+    public void setLocation(String location) {
+        this.location = location;
+    }
+
+    public Double getUse_gps_long() {
+        return use_gps_long;
+    }
+
+    public void setUse_gps_long(Double use_gps_long) {
+        this.use_gps_long = use_gps_long;
+    }
+
+    public Double getUse_gps_lat() {
+        return use_gps_lat;
+    }
+
+    public void setUse_gps_lat(Double use_gps_lat) {
+        this.use_gps_lat = use_gps_lat;
+    }
 }

+ 63 - 7
ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/DataAlarmListDto.java

@@ -9,31 +9,63 @@ public class DataAlarmListDto {
 
     private static final long serialVersionUID = 1L;
 
-    /** 告警内容 */
+    /**
+     * 告警内容
+     */
     @Excel(name = "告警内容")
     private Integer status_type;
 
-    /** 告警内容 */
+    /**
+     * 告警内容
+     */
     @Excel(name = "告警内容")
     private Integer alarm_type;
 
-    /** 姓名 */
+    /**
+     * 姓名
+     */
     @Excel(name = "姓名")
     private String name;
 
-    /** 电话 */
+    /**
+     * 电话
+     */
     @Excel(name = "电话")
     private String tel_one;
 
-    /** 地址 */
+    /**
+     * 地址
+     */
     @Excel(name = "地址")
     private float gps_long;
 
-    /** 地址 */
+    /**
+     * 地址
+     */
     @Excel(name = "地址")
     private float gps_lat;
 
-    /** 时间 */
+    /**
+     * 地址
+     */
+    @Excel(name = "地址")
+    private float use_gps_long;
+
+    /**
+     * 地址
+     */
+    @Excel(name = "地址")
+    private float use_gps_lat;
+
+    /**
+     * 地址
+     */
+    @Excel(name = "地址")
+    private String location;
+
+    /**
+     * 时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Excel(name = "时间")
     private Date createtime;
@@ -86,6 +118,30 @@ public class DataAlarmListDto {
         this.gps_lat = gps_lat;
     }
 
+    public float getUse_gps_long() {
+        return use_gps_long;
+    }
+
+    public void setUse_gps_long(float use_gps_long) {
+        this.use_gps_long = use_gps_long;
+    }
+
+    public float getUse_gps_lat() {
+        return use_gps_lat;
+    }
+
+    public void setUse_gps_lat(float use_gps_lat) {
+        this.use_gps_lat = use_gps_lat;
+    }
+
+    public String getLocation() {
+        return location;
+    }
+
+    public void setLocation(String location) {
+        this.location = location;
+    }
+
     public Date getCreatetime() {
         return createtime;
     }

+ 21 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/MapGpsDto.java

@@ -13,6 +13,11 @@ public class MapGpsDto {
 
     /** 纬度 */
     private Float gps_lat;
+    /** 经度 */
+    private Float use_gps_long;
+
+    /** 纬度 */
+    private Float use_gps_lat;
 
     public Float getGps_long() {
         return gps_long;
@@ -29,4 +34,20 @@ public class MapGpsDto {
     public void setGps_lat(Float gps_lat) {
         this.gps_lat = gps_lat;
     }
+
+    public Float getUse_gps_long() {
+        return use_gps_long;
+    }
+
+    public void setUse_gps_long(Float use_gps_long) {
+        this.use_gps_long = use_gps_long;
+    }
+
+    public Float getUse_gps_lat() {
+        return use_gps_lat;
+    }
+
+    public void setUse_gps_lat(Float use_gps_lat) {
+        this.use_gps_lat = use_gps_lat;
+    }
 }

+ 75 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TEarlyWarningMapper.java

@@ -0,0 +1,75 @@
+package com.ruoyi.system.mapper;
+
+import java.util.List;
+
+import com.ruoyi.system.domain.TEarlyWarning;
+
+/**
+ * 【请填写功能名称】Mapper接口
+ *
+ * @author ruoyi
+ * @date 2023-09-27
+ */
+public interface TEarlyWarningMapper {
+    /**
+     * 查询【请填写功能名称】
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    public TEarlyWarning selectTEarlyWarningById(Long id);
+
+    /**
+     * 查询【请填写功能名称】
+     *
+     * @param alarmId 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    public List<TEarlyWarning> selectTEarlyWarningByAlarmId(Long alarmId);
+
+    /**
+     * 查询【请填写功能名称】列表
+     *
+     * @param tEarlyWarning 【请填写功能名称】
+     * @return 【请填写功能名称】集合
+     */
+    public List<TEarlyWarning> selectTEarlyWarningList(TEarlyWarning tEarlyWarning);
+
+    /**
+     * 新增【请填写功能名称】
+     *
+     * @param tEarlyWarning 【请填写功能名称】
+     * @return 结果
+     */
+    public int insertTEarlyWarning(TEarlyWarning tEarlyWarning);
+
+    /**
+     * 修改【请填写功能名称】
+     *
+     * @param tEarlyWarning 【请填写功能名称】
+     * @return 结果
+     */
+    public int updateTEarlyWarning(TEarlyWarning tEarlyWarning);
+
+    /**
+     * 删除【请填写功能名称】
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    public int deleteTEarlyWarningById(Long id);
+
+    /**
+     * 批量删除【请填写功能名称】
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTEarlyWarningByIds(Long[] ids);
+
+    List<TEarlyWarning> selectTEarlyWarningList_SOS(TEarlyWarning earlyWarning);
+
+    List<TEarlyWarning> selectTEarlyWarningList_HEALTHSOLVE(TEarlyWarning earlyWarning);
+
+    List<TEarlyWarning> selectTEarlyWarningList_OTHERSOLVE(TEarlyWarning earlyWarning);
+}

+ 101 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/ITEarlyWarningService.java

@@ -0,0 +1,101 @@
+package com.ruoyi.system.service;
+
+import java.util.List;
+
+import com.ruoyi.system.domain.TEarlyWarning;
+
+/**
+ * 【请填写功能名称】Service接口
+ *
+ * @author ruoyi
+ * @date 2023-09-27
+ */
+public interface ITEarlyWarningService {
+    /**
+     * 查询【请填写功能名称】
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    public TEarlyWarning selectTEarlyWarningById(Long id);
+
+    /**
+     * 查询【请填写功能名称】
+     *
+     * @param alarmId 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    public List<TEarlyWarning> selectTEarlyWarningByAlarmId(Long alarmId);
+
+    /**
+     * 查询【请填写功能名称】列表
+     *
+     * @param tEarlyWarning 【请填写功能名称】
+     * @return 【请填写功能名称】集合
+     */
+    public List<TEarlyWarning> selectTEarlyWarningList(TEarlyWarning tEarlyWarning);
+
+    /**
+     * 新增【请填写功能名称】
+     *
+     * @param tEarlyWarning 【请填写功能名称】
+     * @return 结果
+     */
+    public int insertTEarlyWarning(TEarlyWarning tEarlyWarning);
+
+    /**
+     * 修改【请填写功能名称】
+     *
+     * @param tEarlyWarning 【请填写功能名称】
+     * @return 结果
+     */
+    public int updateTEarlyWarning(TEarlyWarning tEarlyWarning);
+
+    /**
+     * 批量删除【请填写功能名称】
+     *
+     * @param ids 需要删除的【请填写功能名称】主键集合
+     * @return 结果
+     */
+    public int deleteTEarlyWarningByIds(Long[] ids);
+
+    /**
+     * 删除【请填写功能名称】信息
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    public int deleteTEarlyWarningById(Long id);
+
+    /**
+     * SOS 预警
+     *
+     * @param earlyWarning
+     * @return
+     */
+    List<TEarlyWarning> selectTEarlyWarningList_SOS(TEarlyWarning earlyWarning);
+
+    /**
+     * 跌倒预警
+     *
+     * @param earlyWarning
+     * @return
+     */
+    List<TEarlyWarning> selectTEarlyWarningList_FALLSOLVE(TEarlyWarning earlyWarning);
+
+    /**
+     * 健康预警
+     *
+     * @param earlyWarning
+     * @return
+     */
+    List<TEarlyWarning> selectTEarlyWarningList_HEALTHSOLVE(TEarlyWarning earlyWarning);
+
+    /**
+     * 其他预警
+     *
+     * @param earlyWarning
+     * @return
+     */
+    List<TEarlyWarning> selectTEarlyWarningList_OTHERSOLVE(TEarlyWarning earlyWarning);
+}

+ 124 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TEarlyWarningServiceImpl.java

@@ -0,0 +1,124 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.List;
+
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.TEarlyWarningMapper;
+import com.ruoyi.system.domain.TEarlyWarning;
+import com.ruoyi.system.service.ITEarlyWarningService;
+
+/**
+ * 【请填写功能名称】Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2023-09-27
+ */
+@Service
+public class TEarlyWarningServiceImpl implements ITEarlyWarningService {
+    @Autowired
+    private TEarlyWarningMapper tEarlyWarningMapper;
+
+    /**
+     * 查询【请填写功能名称】
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    @Override
+    public TEarlyWarning selectTEarlyWarningById(Long id) {
+        return tEarlyWarningMapper.selectTEarlyWarningById(id);
+    }
+
+    @Override
+    public List<TEarlyWarning> selectTEarlyWarningByAlarmId(Long alarmId) {
+        return tEarlyWarningMapper.selectTEarlyWarningByAlarmId(alarmId);
+    }
+
+    /**
+     * 查询【请填写功能名称】列表
+     *
+     * @param tEarlyWarning 【请填写功能名称】
+     * @return 【请填写功能名称】
+     */
+    @Override
+    public List<TEarlyWarning> selectTEarlyWarningList(TEarlyWarning tEarlyWarning) {
+        return tEarlyWarningMapper.selectTEarlyWarningList(tEarlyWarning);
+    }
+
+    /**
+     * 新增【请填写功能名称】
+     *
+     * @param tEarlyWarning 【请填写功能名称】
+     * @return 结果
+     */
+    @Override
+    public int insertTEarlyWarning(TEarlyWarning tEarlyWarning) {
+        tEarlyWarning.setCreateTime(DateUtils.getNowDate());
+        return tEarlyWarningMapper.insertTEarlyWarning(tEarlyWarning);
+    }
+
+    /**
+     * 修改【请填写功能名称】
+     *
+     * @param tEarlyWarning 【请填写功能名称】
+     * @return 结果
+     */
+    @Override
+    public int updateTEarlyWarning(TEarlyWarning tEarlyWarning) {
+        tEarlyWarning.setUpdateTime(DateUtils.getNowDate());
+        tEarlyWarning.setEventRecord(tEarlyWarning.getMsg());
+        tEarlyWarning.setState(tEarlyWarning.getSolve_status());
+        return tEarlyWarningMapper.updateTEarlyWarning(tEarlyWarning);
+    }
+
+    /**
+     * 批量删除【请填写功能名称】
+     *
+     * @param ids 需要删除的【请填写功能名称】主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTEarlyWarningByIds(Long[] ids) {
+        return tEarlyWarningMapper.deleteTEarlyWarningByIds(ids);
+    }
+
+    /**
+     * 删除【请填写功能名称】信息
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTEarlyWarningById(Long id) {
+        return tEarlyWarningMapper.deleteTEarlyWarningById(id);
+    }
+
+    @Override
+    public List<TEarlyWarning> selectTEarlyWarningList_SOS(TEarlyWarning earlyWarning) {
+        //SOS 预警类型
+        earlyWarning.setType(16);
+        return tEarlyWarningMapper.selectTEarlyWarningList_SOS(earlyWarning);
+    }
+
+    @Override
+    public List<TEarlyWarning> selectTEarlyWarningList_FALLSOLVE(TEarlyWarning earlyWarning) {
+        //跌倒 预警类型
+        earlyWarning.setType(21);
+        return tEarlyWarningMapper.selectTEarlyWarningList_SOS(earlyWarning);
+    }
+
+    @Override
+    public List<TEarlyWarning> selectTEarlyWarningList_HEALTHSOLVE(TEarlyWarning earlyWarning) {
+        //健康 预警类型
+        //22:心率异常报警,23:血压异常报警,24:体温异常报警,25:血氧异常报警
+        return tEarlyWarningMapper.selectTEarlyWarningList_HEALTHSOLVE(earlyWarning);
+    }
+
+    @Override
+    public List<TEarlyWarning> selectTEarlyWarningList_OTHERSOLVE(TEarlyWarning earlyWarning) {
+        //其他 预警类型
+        return tEarlyWarningMapper.selectTEarlyWarningList_OTHERSOLVE(earlyWarning);
+    }
+}

+ 17 - 23
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TSosSolveServiceImpl.java

@@ -1,6 +1,7 @@
 package com.ruoyi.system.service.impl;
 
 import java.util.List;
+
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -11,25 +12,23 @@ import com.ruoyi.system.service.ITSosSolveService;
 
 /**
  * SOS预警处理Service业务层处理
- * 
+ *
  * @author zhengjie
  * @date 2023-09-08
  */
 @Service
-public class TSosSolveServiceImpl implements ITSosSolveService 
-{
+public class TSosSolveServiceImpl implements ITSosSolveService {
     @Autowired
     private TSosSolveMapper tSosSolveMapper;
 
     /**
      * 查询SOS预警处理
-     * 
+     *
      * @param id SOS预警处理主键
      * @return SOS预警处理
      */
     @Override
-    public TSosSolve selectTSosSolveById(Integer id)
-    {
+    public TSosSolve selectTSosSolveById(Integer id) {
         return tSosSolveMapper.selectTSosSolveById(id);
     }
 
@@ -40,66 +39,61 @@ public class TSosSolveServiceImpl implements ITSosSolveService
 
     /**
      * 查询SOS预警处理列表
-     * 
+     *
      * @param tSosSolve SOS预警处理
      * @return SOS预警处理
      */
     @Override
-    public List<TSosSolve> selectTSosSolveList(TSosSolve tSosSolve)
-    {
+    public List<TSosSolve> selectTSosSolveList(TSosSolve tSosSolve) {
         return tSosSolveMapper.selectTSosSolveList(tSosSolve);
     }
 
     /**
      * 新增SOS预警处理
-     * 
+     *
      * @param tSosSolve SOS预警处理
      * @return 结果
      */
     @Override
-    public int insertTSosSolve(TSosSolve tSosSolve)
-    {
-        if (StringUtils.isNull(this.selectTSosSolveByAid(tSosSolve.getAid()))){
+    public int insertTSosSolve(TSosSolve tSosSolve) {
+        if (StringUtils.isNull(this.selectTSosSolveByAid(tSosSolve.getAid()))) {
             tSosSolve.setCreateTime(DateUtils.getNowDate());
             return tSosSolveMapper.insertTSosSolve(tSosSolve);
-        }else{
+        } else {
             return tSosSolveMapper.updateTSosSolve(tSosSolve);
         }
     }
 
     /**
      * 修改SOS预警处理
-     * 
+     *
      * @param tSosSolve SOS预警处理
      * @return 结果
      */
     @Override
-    public int updateTSosSolve(TSosSolve tSosSolve)
-    {
+    public int updateTSosSolve(TSosSolve tSosSolve) {
         return tSosSolveMapper.updateTSosSolve(tSosSolve);
     }
 
     /**
      * 批量删除SOS预警处理
-     * 
+     *
      * @param ids 需要删除的SOS预警处理主键
      * @return 结果
      */
     @Override
-    public int deleteTSosSolveByIds(Integer[] ids)
-    {
+    public int deleteTSosSolveByIds(Integer[] ids) {
         return tSosSolveMapper.deleteTSosSolveByIds(ids);
     }
 
     /**
      * 删除SOS预警处理信息
-     * 
+     *
      * @param id SOS预警处理主键
      * @return 结果
      */
     @Override
-    public int deleteTSosSolveById(Integer id)
-    {
+    public int deleteTSosSolveById(Integer id) {
         return tSosSolveMapper.deleteTSosSolveById(id);
     }
 }

+ 149 - 89
ruoyi-system/src/main/java/com/ruoyi/system/timing/CallPoliceTiming.java

@@ -1,16 +1,16 @@
 package com.ruoyi.system.timing;
 
-import com.ruoyi.common.utils.DateUtils;
-import com.ruoyi.common.utils.StringUtils;
-import com.ruoyi.system.domain.TShouhuanAlarmList;
-import com.ruoyi.system.domain.TShouhuanInfo;
-import com.ruoyi.system.domain.dto.SettingDto;
+import com.ruoyi.system.domain.*;
+import com.ruoyi.system.domain.dto.*;
 import com.ruoyi.system.mapper.TDeviceListMapper;
 import com.ruoyi.system.mapper.TShouhuanAlarmListMapper;
-import com.ruoyi.system.mapper.TShouhuanInfoMapper;
+import com.ruoyi.system.service.ITEarlyWarningService;
+import com.ruoyi.system.service.ITUserProfileService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.List;
 
 @Component("callPoliceTiming")
@@ -19,98 +19,158 @@ public class CallPoliceTiming {
     @Autowired
     private TDeviceListMapper tDeviceListMapper;
 
-    @Autowired
-    private TShouhuanInfoMapper tShouhuanInfoMapper;
-
     @Autowired
     private TShouhuanAlarmListMapper tShouhuanAlarmListMapper;
 
-    //终端主动发
-    Integer alarmFromType = 1;
-    //平台记录
-    Integer alarmFromTypelog = 0;
-    //心率异常报警
-    Integer heartalarmType = 22;
-    //血压异常报警
-    Integer bloodalarmType = 23;
-    //体温异常报警
-    Integer tempalarmType = 24;
-    //血氧异常报警
-    Integer oxygenalarmType = 25;
-
-    public void checkCallPolice(){
-
-        List<TShouhuanInfo> tShouhuanInfos = tShouhuanInfoMapper.selectTShouhuanInfo();
-        String shouhuan_body_max = tDeviceListMapper.selectshouhuan("shouhuan_body_max");
-        String shouhuan_blood_high_max = tDeviceListMapper.selectshouhuan("shouhuan_blood_high_max");
-        String shouhuan_blood_high_min = tDeviceListMapper.selectshouhuan("shouhuan_blood_high_min");
-        String shouhuan_heart_max = tDeviceListMapper.selectshouhuan("shouhuan_heart_max");
-        String shouhuan_oxygen_max = tDeviceListMapper.selectshouhuan("shouhuan_oxygen_max");
+    @Autowired
+    private ITEarlyWarningService itEarlyWarningService;
+    @Autowired
+    private ITUserProfileService itUserProfileService;
 
-        for (TShouhuanInfo info : tShouhuanInfos){
-            if (info.getTemp()>Integer.parseInt(shouhuan_body_max)){
-                tShouhuanAlarmListMapper.insertTShouhuanAlarmList(saveInfo(info,tempalarmType,alarmFromType));
-            }
-            if(info.getBloodHeightPressure()<Integer.parseInt(shouhuan_blood_high_max)){
-                tShouhuanAlarmListMapper.insertTShouhuanAlarmList(saveInfo(info,bloodalarmType,alarmFromType));
-            }
-            if(info.getBloodLowPressure()>Integer.parseInt(shouhuan_blood_high_min)){
-                tShouhuanAlarmListMapper.insertTShouhuanAlarmList(saveInfo(info,bloodalarmType,alarmFromType));
-            }
-            if(info.getHeartRate()>Integer.parseInt(shouhuan_heart_max)){
-                tShouhuanAlarmListMapper.insertTShouhuanAlarmList(saveInfo(info,heartalarmType,alarmFromType));
-            }
-            if(info.getOxygen()>Integer.parseInt(shouhuan_oxygen_max)){
-                tShouhuanAlarmListMapper.insertTShouhuanAlarmList(saveInfo(info,oxygenalarmType,alarmFromType));
+    public void checkCallPolice() {
+        //获取手环预警信息
+        List<AlarmStatusListDto> alarmStatusListDtos = tShouhuanAlarmListMapper.selectAlarmStatusListDto();
+        //遍历是否进行预警
+        for (AlarmStatusListDto info : alarmStatusListDtos) {
+            //判断是否为空
+            if (info != null) {
+                //已经处理过的不处理
+                List<TEarlyWarning> tEarlyWarnings = itEarlyWarningService.selectTEarlyWarningByAlarmId(info.getId());
+                if (tEarlyWarnings != null && !tEarlyWarnings.isEmpty()) {
+                    return;
+                }
+                TEarlyWarning earlyWarning = new TEarlyWarning();
+                //查找对应的手环绑定用户
+                List<TDeviceList> deviceList = tDeviceListMapper.selectTDeviceByDeviceIdCode(info.getDevice_id_code());
+                //绑定用户ID
+                if (deviceList != null && !deviceList.isEmpty()) {
+                    earlyWarning.setUserId(deviceList.get(0).getUserid().longValue());
+                }
+                //状态:0-未处理;1-处理中;2-已处理
+                earlyWarning.setState(0);
+                // 类型:0-其他;1-SOS;2-跌倒;3-围栏;4-健康
+                earlyWarning.setType(info.getAlarm_type());
+                //告警内容
+                earlyWarning.setContent(getContentByType(info.getAlarm_type(), info.getCreatetime(), earlyWarning.getUserId()));
+                //事件记录
+                earlyWarning.setEventRecord("");
+                //预警定位
+                earlyWarning.setLocation(info.getLocation());
+                //经度
+                earlyWarning.setLng(info.getUse_gps_long());
+                //维度
+                earlyWarning.setLat(info.getUse_gps_lat());
+                //设备ID
+                earlyWarning.setFacilityId(info.getFacilityId().longValue());
+                //设置id编码
+                earlyWarning.setDeviceIdCode(info.getDevice_id_code());
+                //预警表ID
+                earlyWarning.setAlarmId(info.getId());
+                itEarlyWarningService.insertTEarlyWarning(earlyWarning);
             }
         }
     }
 
-    public TShouhuanAlarmList saveInfo(TShouhuanInfo info, Integer heartalarmType, Integer alarmFromType){
-        TShouhuanAlarmList tShouhuanAlarmList = new TShouhuanAlarmList();
-        if(StringUtils.isNotNull(info.getFacilityId())){
-            tShouhuanAlarmList.setFacilityId(info.getFacilityId());
-        }
-        if(StringUtils.isNotNull(info.getId())){
-            tShouhuanAlarmList.setShinfoId(info.getId());
-        }
-        if(StringUtils.isNotNull(info.getDeviceIdCode())){
-            tShouhuanAlarmList.setDeviceIdCode(info.getDeviceIdCode());
-        }
-        if(StringUtils.isNotNull(info.getGpsLong())){
-            tShouhuanAlarmList.setGpsLong(info.getGpsLong());
+    /**
+     * 根据类型获取内容
+     *
+     * @param alarmType
+     * @param createtime
+     * @param userId
+     * @return
+     */
+    private String getContentByType(Integer alarmType, Date createtime, Long userId) {
+        //健康告警求助:成浪平于2023-09-27 15:17:02发起健康告警求助
+        //设备对应的用户
+        TUserProfile tUserProfile = null;
+        if (userId != null && userId > 0) {
+            tUserProfile = itUserProfileService.selectTUserProfileById(userId.intValue());
         }
-        if(StringUtils.isNotNull(info.getGpsLat())){
-            tShouhuanAlarmList.setGpsLat(info.getGpsLat());
-        }
-        if(StringUtils.isNotNull(info.getSpeed())){
-            tShouhuanAlarmList.setSpeed(info.getSpeed());
-        }
-        if(StringUtils.isNotNull(info.getDirection())){
-            tShouhuanAlarmList.setDirection(info.getDirection());
-        }
-        if(StringUtils.isNotNull(info.getPoster())){
-            tShouhuanAlarmList.setPoster(info.getPoster());
-        }
-        if(StringUtils.isNotNull(info.getElectricQuantity())){
-            tShouhuanAlarmList.setElectricQuantity(info.getElectricQuantity());
-        }
-        if(StringUtils.isNotNull(info.getStepNumber())){
-            tShouhuanAlarmList.setStepNumber(info.getStepNumber());
-        }
-        if(StringUtils.isNotNull(info.getRollNumber())){
-            tShouhuanAlarmList.setRollNumber(info.getRollNumber());
-        }
-        if(StringUtils.isNotNull(heartalarmType)){
-            tShouhuanAlarmList.setAlarmType(heartalarmType);
-        }
-        if(StringUtils.isNotNull(info.getTerminalStatus())){
-            tShouhuanAlarmList.setTerminalStatus(info.getTerminalStatus());
-        }
-        tShouhuanAlarmList.setCreateTime(DateUtils.getNowDate());
-        if(StringUtils.isNotNull(alarmFromType)){
-            tShouhuanAlarmList.setAlarmFromType(alarmFromType);
+        // 创建一个SimpleDateFormat对象,指定日期格式
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        // 使用SimpleDateFormat对象将日期格式化为指定格式的字符串
+        String time = dateFormat.format(createtime);
+        StringBuilder stringBuilder = new StringBuilder();
+        if (alarmType != null) {
+            if (alarmType == 0) {
+                stringBuilder.append("无效报警!");
+            } else if (alarmType == 16) {
+                //16:SOS报警;
+                stringBuilder.append("SOS报警求助:");
+                if (tUserProfile != null) {
+                    stringBuilder.append(tUserProfile.getName());
+                } else {
+                    stringBuilder.append("设备");
+                }
+                stringBuilder.append("于").append(time).append("发起SOS报警求助!");
+            } else if (alarmType == 17) {
+                //17:低电报警;
+                stringBuilder.append("低电报警:");
+                if (tUserProfile != null) {
+                    stringBuilder.append(tUserProfile.getName());
+                } else {
+                    stringBuilder.append("设备");
+                }
+                stringBuilder.append("于").append(time).append("发起低电报警!");
+            } else if (alarmType == 20) {
+                //20:手环拆除报警;
+                stringBuilder.append("手环拆除报警:");
+                if (tUserProfile != null) {
+                    stringBuilder.append(tUserProfile.getName());
+                } else {
+                    stringBuilder.append("设备");
+                }
+                stringBuilder.append("于").append(time).append("发起手环拆除报警!");
+            } else if (alarmType == 21) {
+                //21:跌倒报警;
+                stringBuilder.append("跌倒报警:");
+                if (tUserProfile != null) {
+                    stringBuilder.append(tUserProfile.getName());
+                } else {
+                    stringBuilder.append("设备");
+                }
+                stringBuilder.append("于").append(time).append("发起跌倒报警求助!");
+            } else if (alarmType == 22) {
+                //22:心率异常报警,
+                stringBuilder.append("心率异常报警:");
+                if (tUserProfile != null) {
+                    stringBuilder.append(tUserProfile.getName());
+                } else {
+                    stringBuilder.append("设备");
+                }
+                stringBuilder.append("于").append(time).append("发起心率异常报警求助!");
+            } else if (alarmType == 23) {
+                //23:血压异常报警,
+                stringBuilder.append("血压异常报警:");
+                if (tUserProfile != null) {
+                    stringBuilder.append(tUserProfile.getName());
+                } else {
+                    stringBuilder.append("设备");
+                }
+                stringBuilder.append("于").append(time).append("发起血压异常报警求助!");
+            } else if (alarmType == 24) {
+                //24:体温异常报警
+                stringBuilder.append("体温异常报警:");
+                if (tUserProfile != null) {
+                    stringBuilder.append(tUserProfile.getName());
+                } else {
+                    stringBuilder.append("设备");
+                }
+                stringBuilder.append("于").append(time).append("发起体温异常报警求助!");
+            } else if (alarmType == 25) {
+                //25:血氧异常报警
+                stringBuilder.append("血氧异常报警:");
+                if (tUserProfile != null) {
+                    stringBuilder.append(tUserProfile.getName());
+                } else {
+                    stringBuilder.append("设备");
+                }
+                stringBuilder.append("于").append(time).append("发起血氧异常报警求助!");
+            }
+        } else {
+
         }
-        return tShouhuanAlarmList;
+        return stringBuilder.toString();
     }
+
 }

+ 252 - 0
ruoyi-system/src/main/resources/mapper/system/TEarlyWarningMapper.xml

@@ -0,0 +1,252 @@
+<?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.TEarlyWarningMapper">
+
+    <resultMap type="TEarlyWarning" id="TEarlyWarningResult">
+        <result property="id" column="id"/>
+        <result property="userId" column="user_id"/>
+        <result property="state" column="state"/>
+        <result property="type" column="type"/>
+        <result property="content" column="content"/>
+        <result property="eventRecord" column="event_record"/>
+        <result property="location" column="location"/>
+        <result property="lng" column="lng"/>
+        <result property="lat" column="lat"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="facilityId" column="facility_id"/>
+        <result property="deviceIdCode" column="device_id_code"/>
+        <result property="alarmId" column="alarm_id"/>
+    </resultMap>
+
+    <sql id="selectTEarlyWarningVo">
+        select id,
+               user_id,
+               state,
+               type,
+               content,
+               event_record,
+               location,
+               lng,
+               lat,
+               create_time,
+               update_time,
+               facility_id,
+               device_id_code,
+               alarm_id
+        from t_early_warning
+    </sql>
+
+    <select id="selectTEarlyWarningByAlarmId" parameterType="long" resultMap="TEarlyWarningResult">
+        <include refid="selectTEarlyWarningVo"/>
+        where alarm_id = #{alarmId}
+    </select>
+    <select id="selectTEarlyWarningList" parameterType="TEarlyWarning" resultMap="TEarlyWarningResult">
+        <include refid="selectTEarlyWarningVo"/>
+        <where>
+            <if test="userId != null ">and user_id = #{userId}</if>
+            <if test="state != null ">and state = #{state}</if>
+            <if test="type != null ">and type = #{type}</if>
+            <if test="content != null  and content != ''">and content = #{content}</if>
+            <if test="eventRecord != null  and eventRecord != ''">and event_record = #{eventRecord}</if>
+            <if test="location != null  and location != ''">and location = #{location}</if>
+            <if test="lng != null ">and lng = #{lng}</if>
+            <if test="lat != null ">and lat = #{lat}</if>
+            <if test="facilityId != null ">and facility_id = #{facilityId}</if>
+            <if test="deviceIdCode != null  and deviceIdCode != ''">and device_id_code = #{deviceIdCode}</if>
+            <if test="alarmId != null ">and alarm_id = #{alarmId}</if>
+        </where>
+    </select>
+
+    <select id="selectTEarlyWarningById" parameterType="Long" resultMap="TEarlyWarningResult">
+        <include refid="selectTEarlyWarningVo"/>
+        where id = #{id}
+    </select>
+
+    <select id="selectTEarlyWarningList_SOS" resultType="com.ruoyi.system.domain.TEarlyWarning">
+        select a.id,
+        a.user_id,
+        a.state,
+        a.state as solve_status,
+        a.type,
+        a.type as alarm_type,
+        a.content as alarmMsg,
+        a.event_record,
+        a.event_record as msg,
+        a.location,
+        a.location as address_desc,
+        a.lng,
+        a.lat,
+        a.lng as gps_long,
+        a.lat as gps_lat,
+        a.create_time as createTime,
+        a.update_time,
+        a.facility_id,
+        a.device_id_code,
+        a.device_id_code as deviceIdCode,
+        a.alarm_id,
+        b.name,
+        b.tel_one,
+        c.id as service_id,
+        c.store_name,
+        d.device_model
+        from t_early_warning a
+        left join t_user_profile b on a.user_id = b.id
+        left join t_service_manage c on b.serviceid = c.id
+        left join t_device_list d on a.device_id_code = d.device_id
+        <where>
+            <if test="type != null ">and a.type = #{type}</if>
+            <if test="name != null ">and b.name = #{name}</if>
+            <if test="solve_status != null ">and a.state = #{solve_status}</if>
+        </where>
+    </select>
+    <select id="selectTEarlyWarningList_HEALTHSOLVE" resultType="com.ruoyi.system.domain.TEarlyWarning">
+        select a.id,
+        a.user_id,
+        a.state,
+        a.state as solve_status,
+        a.type,
+        a.type as alarm_type,
+        a.content as alarmMsg,
+        a.event_record,
+        a.event_record as msg,
+        a.location,
+        a.location as address_desc,
+        a.lng,
+        a.lat,
+        a.lng as gps_long,
+        a.lat as gps_lat,
+        a.create_time as createTime,
+        a.update_time,
+        a.facility_id,
+        a.device_id_code,
+        a.device_id_code as deviceIdCode,
+        a.alarm_id,
+        b.name,
+        b.tel_one,
+        c.id as service_id,
+        c.store_name,
+        d.device_model
+        from t_early_warning a
+        left join t_user_profile b on a.user_id = b.id
+        left join t_service_manage c on b.serviceid = c.id
+        left join t_device_list d on a.device_id_code = d.device_id
+        <where>
+            and a.type &gt;= 22
+            and a.type &lt;= 25
+            <if test="name != null ">and b.name = #{name}</if>
+            <if test="solve_status != null ">and a.state = #{solve_status}</if>
+        </where>
+    </select>
+    <select id="selectTEarlyWarningList_OTHERSOLVE" resultType="com.ruoyi.system.domain.TEarlyWarning">
+        select a.id,
+        a.user_id,
+        a.state,
+        a.state as solve_status,
+        a.type,
+        a.type as alarm_type,
+        a.content as alarmMsg,
+        a.event_record,
+        a.event_record as msg,
+        a.location,
+        a.location as address_desc,
+        a.lng,
+        a.lat,
+        a.lng as gps_long,
+        a.lat as gps_lat,
+        a.create_time as createTime,
+        a.update_time,
+        a.facility_id,
+        a.device_id_code,
+        a.device_id_code as deviceIdCode,
+        a.alarm_id,
+        b.name,
+        b.tel_one,
+        c.id as service_id,
+        c.store_name,
+        d.device_model
+        from t_early_warning a
+        left join t_user_profile b on a.user_id = b.id
+        left join t_service_manage c on b.serviceid = c.id
+        left join t_device_list d on a.device_id_code = d.device_id
+        <where>
+            and a.type != 16
+            and a.type != 21
+            and a.type != 22
+            and a.type != 23
+            and a.type != 24
+            and a.type != 25
+            <if test="name != null ">and b.name = #{name}</if>
+            <if test="solve_status != null ">and a.state = #{solve_status}</if>
+        </where>
+    </select>
+
+    <insert id="insertTEarlyWarning" parameterType="TEarlyWarning" useGeneratedKeys="true" keyProperty="id">
+        insert into t_early_warning
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="userId != null">user_id,</if>
+            <if test="state != null">state,</if>
+            <if test="type != null">type,</if>
+            <if test="content != null">content,</if>
+            <if test="eventRecord != null">event_record,</if>
+            <if test="location != null">location,</if>
+            <if test="lng != null">lng,</if>
+            <if test="lat != null">lat,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="facilityId != null">facility_id,</if>
+            <if test="deviceIdCode != null">device_id_code,</if>
+            <if test="alarmId != null">alarm_id,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="userId != null">#{userId},</if>
+            <if test="state != null">#{state},</if>
+            <if test="type != null">#{type},</if>
+            <if test="content != null">#{content},</if>
+            <if test="eventRecord != null">#{eventRecord},</if>
+            <if test="location != null">#{location},</if>
+            <if test="lng != null">#{lng},</if>
+            <if test="lat != null">#{lat},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="facilityId != null">#{facilityId},</if>
+            <if test="deviceIdCode != null">#{deviceIdCode},</if>
+            <if test="alarmId != null">#{alarmId},</if>
+        </trim>
+    </insert>
+
+    <update id="updateTEarlyWarning" parameterType="TEarlyWarning">
+        update t_early_warning
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="state != null">state = #{state},</if>
+            <if test="type != null">type = #{type},</if>
+            <if test="content != null">content = #{content},</if>
+            <if test="eventRecord != null">event_record = #{eventRecord},</if>
+            <if test="location != null">location = #{location},</if>
+            <if test="lng != null">lng = #{lng},</if>
+            <if test="lat != null">lat = #{lat},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="facilityId != null">facility_id = #{facilityId},</if>
+            <if test="deviceIdCode != null">device_id_code = #{deviceIdCode},</if>
+            <if test="alarmId != null">alarm_id = #{alarmId},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteTEarlyWarningById" parameterType="Long">
+        delete
+        from t_early_warning
+        where id = #{id}
+    </delete>
+
+    <delete id="deleteTEarlyWarningByIds" parameterType="String">
+        delete from t_early_warning where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 140 - 71
ruoyi-system/src/main/resources/mapper/system/TShouhuanAlarmListMapper.xml

@@ -1,123 +1,184 @@
 <?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">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.system.mapper.TShouhuanAlarmListMapper">
-    
+
     <resultMap type="TShouhuanAlarmList" id="TShouhuanAlarmListResult">
-        <result property="id"    column="id"    />
-        <result property="facilityId"    column="facility_id"    />
-        <result property="shinfoId"    column="shinfo_id"    />
-        <result property="deviceIdCode"    column="device_id_code"    />
-        <result property="gpsLong"    column="gps_long"    />
-        <result property="gpsLat"    column="gps_lat"    />
-        <result property="speed"    column="speed"    />
-        <result property="direction"    column="direction"    />
-        <result property="poster"    column="poster"    />
-        <result property="electricQuantity"    column="electric_quantity"    />
-        <result property="stepNumber"    column="step_number"    />
-        <result property="rollNumber"    column="roll_number"    />
-        <result property="statusType"    column="status_type"    />
-        <result property="alarmType"    column="alarm_type"    />
-        <result property="terminalStatus"    column="terminal_status"    />
-        <result property="createTime"    column="createtime"    />
-        <result property="alarmFromType"    column="alarm_from_type"    />
-        <result property="msg"    column="msg"    />
-        <result property="isSend"    column="is_send"    />
-        <result property="sendTime"    column="send_time"    />
+        <result property="id" column="id"/>
+        <result property="facilityId" column="facility_id"/>
+        <result property="shinfoId" column="shinfo_id"/>
+        <result property="deviceIdCode" column="device_id_code"/>
+        <result property="gpsLong" column="gps_long"/>
+        <result property="gpsLat" column="gps_lat"/>
+        <result property="speed" column="speed"/>
+        <result property="direction" column="direction"/>
+        <result property="poster" column="poster"/>
+        <result property="electricQuantity" column="electric_quantity"/>
+        <result property="stepNumber" column="step_number"/>
+        <result property="rollNumber" column="roll_number"/>
+        <result property="statusType" column="status_type"/>
+        <result property="alarmType" column="alarm_type"/>
+        <result property="terminalStatus" column="terminal_status"/>
+        <result property="createTime" column="createtime"/>
+        <result property="alarmFromType" column="alarm_from_type"/>
+        <result property="msg" column="msg"/>
+        <result property="isSend" column="is_send"/>
+        <result property="sendTime" column="send_time"/>
     </resultMap>
 
     <sql id="selectTShouhuanAlarmListVo">
-        select id, facility_id, shinfo_id, device_id_code, gps_long, gps_lat, speed, direction, poster, electric_quantity, step_number, roll_number, status_type, alarm_type, terminal_status, createtime, alarm_from_type, msg, is_send, send_time from t_shouhuan_alarm_list
+        select id,
+               facility_id,
+               shinfo_id,
+               device_id_code,
+               gps_long,
+               gps_lat,
+               speed,
+               direction,
+               poster,
+               electric_quantity,
+               step_number,
+               roll_number,
+               status_type,
+               alarm_type,
+               terminal_status,
+               createtime,
+               alarm_from_type,
+               msg,
+               is_send,
+               send_time
+        from t_shouhuan_alarm_list
     </sql>
 
     <select id="selectTShouhuanAlarmListList" parameterType="TShouhuanAlarmList" resultMap="TShouhuanAlarmListResult">
         <include refid="selectTShouhuanAlarmListVo"/>
-        <where>  
-            <if test="facilityId != null "> and facility_id = #{facilityId}</if>
-            <if test="shinfoId != null "> and shinfo_id = #{shinfoId}</if>
-            <if test="deviceIdCode != null  and deviceIdCode != ''"> and device_id_code = #{deviceIdCode}</if>
-            <if test="gpsLong != null "> and gps_long = #{gpsLong}</if>
-            <if test="gpsLat != null "> and gps_lat = #{gpsLat}</if>
-            <if test="speed != null "> and speed = #{speed}</if>
-            <if test="direction != null "> and direction = #{direction}</if>
-            <if test="poster != null "> and poster = #{poster}</if>
-            <if test="electricQuantity != null "> and electric_quantity = #{electricQuantity}</if>
-            <if test="stepNumber != null "> and step_number = #{stepNumber}</if>
-            <if test="rollNumber != null "> and roll_number = #{rollNumber}</if>
-            <if test="statusType != null "> and status_type = #{statusType}</if>
-            <if test="alarmType != null "> and alarm_type = #{alarmType}</if>
-            <if test="terminalStatus != null  and terminalStatus != ''"> and terminal_status = #{terminalStatus}</if>
-            <if test="createTime != null "> and createtime = #{createTime}</if>
-            <if test="alarmFromType != null "> and alarm_from_type = #{alarmFromType}</if>
-            <if test="msg != null  and msg != ''"> and msg = #{msg}</if>
-            <if test="isSend != null "> and is_send = #{isSend}</if>
-            <if test="sendTime != null "> and send_time = #{sendTime}</if>
+        <where>
+            <if test="facilityId != null ">and facility_id = #{facilityId}</if>
+            <if test="shinfoId != null ">and shinfo_id = #{shinfoId}</if>
+            <if test="deviceIdCode != null  and deviceIdCode != ''">and device_id_code = #{deviceIdCode}</if>
+            <if test="gpsLong != null ">and gps_long = #{gpsLong}</if>
+            <if test="gpsLat != null ">and gps_lat = #{gpsLat}</if>
+            <if test="speed != null ">and speed = #{speed}</if>
+            <if test="direction != null ">and direction = #{direction}</if>
+            <if test="poster != null ">and poster = #{poster}</if>
+            <if test="electricQuantity != null ">and electric_quantity = #{electricQuantity}</if>
+            <if test="stepNumber != null ">and step_number = #{stepNumber}</if>
+            <if test="rollNumber != null ">and roll_number = #{rollNumber}</if>
+            <if test="statusType != null ">and status_type = #{statusType}</if>
+            <if test="alarmType != null ">and alarm_type = #{alarmType}</if>
+            <if test="terminalStatus != null  and terminalStatus != ''">and terminal_status = #{terminalStatus}</if>
+            <if test="createTime != null ">and createtime = #{createTime}</if>
+            <if test="alarmFromType != null ">and alarm_from_type = #{alarmFromType}</if>
+            <if test="msg != null  and msg != ''">and msg = #{msg}</if>
+            <if test="isSend != null ">and is_send = #{isSend}</if>
+            <if test="sendTime != null ">and send_time = #{sendTime}</if>
         </where>
     </select>
-    
+
     <select id="selectTShouhuanAlarmListById" parameterType="Integer" resultMap="TShouhuanAlarmListResult">
         <include refid="selectTShouhuanAlarmListVo"/>
         where id = #{id}
     </select>
     <select id="selectTShouhuanAlarmList" resultType="com.ruoyi.system.domain.dto.DataAlarmListDto">
-        SELECT c.name,c.tel_one,a.gps_long,a.gps_lat,a.createtime,a.status_type,a.alarm_type FROM `t_shouhuan_alarm_list` a
-        left join t_device_list b on a.device_id_code=b.device_id
-        left join t_user_profile c on c.id=b.userid
+        SELECT c.name,
+               c.tel_one,
+               a.gps_long,
+               a.gps_lat,
+               a.use_gps_long,
+               a.use_gps_lat,
+               a.location,
+               a.createtime,
+               a.status_type,
+               a.alarm_type
+        FROM `t_shouhuan_alarm_list` a
+                 left join t_device_list b on a.device_id_code = b.device_id
+                 left join t_user_profile c on c.id = b.userid
     </select>
     <select id="selectTShouhuanAlarmListCount" resultType="java.lang.Integer">
-        select IFNULL(count(*),0) from t_shouhuan_alarm_list
+        select IFNULL(count(*), 0)
+        from t_shouhuan_alarm_list
     </select>
     <select id="selectTShouhuanAlarmSOS" resultType="java.lang.Integer">
-        SELECT IFNULL(count(*),0) FROM `t_shouhuan_alarm_list` where alarm_type=16
+        SELECT IFNULL(count(*), 0)
+        FROM `t_shouhuan_alarm_list`
+        where alarm_type = 16
     </select>
     <select id="selectTShouhuanAlarmSOSSolve" resultType="java.lang.Integer">
-        SELECT IFNULL(count(*),0) FROM `t_sos_solve`
+        SELECT IFNULL(count(*), 0)
+        FROM `t_sos_solve`
         where solve_status = 1
     </select>
     <select id="selectTShouhuanAlarmRail" resultType="java.lang.Integer">
-        SELECT IFNULL(count(*),0) FROM `t_shouhuan_alarm_list` where status_type=2
+        SELECT IFNULL(count(*), 0)
+        FROM `t_shouhuan_alarm_list`
+        where status_type = 2
     </select>
     <select id="selectTShouhuanAlarmRailSolve" resultType="java.lang.Integer">
-        SELECT IFNULL(count(*),0) FROM `t_rail_solve`
+        SELECT IFNULL(count(*), 0)
+        FROM `t_rail_solve`
         where solve_status = 1
     </select>
     <select id="selectTShouhuanAlarmHeart" resultType="java.lang.Integer">
-        SELECT IFNULL(count(*),0) FROM `t_shouhuan_alarm_list` where alarm_type=22
+        SELECT IFNULL(count(*), 0)
+        FROM `t_shouhuan_alarm_list`
+        where alarm_type = 22
     </select>
     <select id="selectTShouhuanAlarmHeartSolve" resultType="java.lang.Integer">
-        SELECT IFNULL(count(*),0) FROM `t_health_solve`
+        SELECT IFNULL(count(*), 0)
+        FROM `t_health_solve`
         where solve_status = 1
     </select>
     <select id="selectTShouhuanAlarmFall" resultType="java.lang.Integer">
-        SELECT IFNULL(count(*),0) FROM `t_shouhuan_alarm_list` where alarm_type=21
+        SELECT IFNULL(count(*), 0)
+        FROM `t_shouhuan_alarm_list`
+        where alarm_type = 21
     </select>
     <select id="selectTShouhuanAlarmFallSolve" resultType="java.lang.Integer">
-        SELECT IFNULL(count(*),0) FROM `t_fall_solve`
+        SELECT IFNULL(count(*), 0)
+        FROM `t_fall_solve`
         where solve_status = 1
     </select>
     <select id="selectTShouhuanAlarmLow" resultType="java.lang.Integer">
-        SELECT IFNULL(count(*),0) FROM `t_shouhuan_alarm_list` where alarm_type=17
+        SELECT IFNULL(count(*), 0)
+        FROM `t_shouhuan_alarm_list`
+        where alarm_type = 17
     </select>
     <select id="selectTShouhuanAlarmLowSolve" resultType="java.lang.Integer">
-        SELECT IFNULL(count(*),0) FROM `t_other_solve` a left join t_shouhuan_alarm_list b
-        on a.alarmid= b.id
-        where b.alarm_type=17
+        SELECT IFNULL(count(*), 0)
+        FROM `t_other_solve` a
+                 left join t_shouhuan_alarm_list b
+                           on a.alarmid = b.id
+        where b.alarm_type = 17
     </select>
     <select id="selectTShouhuanAlarmStatus" resultType="java.lang.Integer">
-        SELECT IFNULL(count(*),0) FROM `t_shouhuan_info` where online_statis=1
+        SELECT IFNULL(count(*), 0)
+        FROM `t_shouhuan_info`
+        where online_statis = 1
     </select>
     <select id="selectTShouhuanAlarmStatusSolve" resultType="java.lang.Integer">
-        SELECT IFNULL(count(*),0) FROM `t_shouhuan_info` where online_statis=0
+        SELECT IFNULL(count(*), 0)
+        FROM `t_shouhuan_info`
+        where online_statis = 0
     </select>
     <select id="selectTShouhuanAlarmOtherSolve" resultType="java.lang.Integer">
-        SELECT IFNULL(count(*),0) FROM `t_other_solve`
+        SELECT IFNULL(count(*), 0)
+        FROM `t_other_solve`
         where solve_status = 1
     </select>
     <select id="selectAlarmStatusListDto" resultType="com.ruoyi.system.domain.dto.AlarmStatusListDto">
-        SELECT c.name,a.device_id_code,a.createtime,a.alarm_type FROM `t_shouhuan_alarm_list` a
-        left join t_device_list b on a.device_id_code=b.device_id
-        left join t_user_profile c on c.id=b.userid
+        SELECT a.id,
+               c.name,
+               a.location,
+               a.use_gps_long,
+               a.use_gps_lat,
+               a.facility_id as facilityId,
+               a.device_id_code,
+               a.createtime,
+               a.alarm_type
+        FROM `t_shouhuan_alarm_list` a
+                 left join t_device_list b on a.device_id_code = b.device_id
+                 left join t_user_profile c on c.id = b.userid
     </select>
 
     <insert id="insertTShouhuanAlarmList" parameterType="TShouhuanAlarmList" useGeneratedKeys="true" keyProperty="id">
@@ -128,6 +189,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deviceIdCode != null">device_id_code,</if>
             <if test="gpsLong != null">gps_long,</if>
             <if test="gpsLat != null">gps_lat,</if>
+            <if test="useGpsLong != null">use_gps_long,</if>
+            <if test="useGpsLat != null">use_gps_lat,</if>
+            <if test="location != null">location,</if>
             <if test="speed != null">speed,</if>
             <if test="direction != null">direction,</if>
             <if test="poster != null">poster,</if>
@@ -142,13 +206,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="msg != null">msg,</if>
             <if test="isSend != null">is_send,</if>
             <if test="sendTime != null">send_time,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="facilityId != null">#{facilityId},</if>
             <if test="shinfoId != null">#{shinfoId},</if>
             <if test="deviceIdCode != null">#{deviceIdCode},</if>
             <if test="gpsLong != null">#{gpsLong},</if>
             <if test="gpsLat != null">#{gpsLat},</if>
+            <if test="useGpsLong != null">use_gps_long,</if>
+            <if test="useGpsLat != null">use_gps_lat,</if>
+            <if test="location != null">location,</if>
             <if test="speed != null">#{speed},</if>
             <if test="direction != null">#{direction},</if>
             <if test="poster != null">#{poster},</if>
@@ -163,7 +230,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="msg != null">#{msg},</if>
             <if test="isSend != null">#{isSend},</if>
             <if test="sendTime != null">#{sendTime},</if>
-         </trim>
+        </trim>
     </insert>
 
     <update id="updateTShouhuanAlarmList" parameterType="TShouhuanAlarmList">
@@ -193,11 +260,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
 
     <delete id="deleteTShouhuanAlarmListById" parameterType="Integer">
-        delete from t_shouhuan_alarm_list where id = #{id}
+        delete
+        from t_shouhuan_alarm_list
+        where id = #{id}
     </delete>
 
     <delete id="deleteTShouhuanAlarmListByIds" parameterType="String">
-        delete from t_shouhuan_alarm_list where id in 
+        delete from t_shouhuan_alarm_list where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>

+ 134 - 88
ruoyi-system/src/main/resources/mapper/system/TShouhuanInfoMapper.xml

@@ -1,97 +1,138 @@
 <?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">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.system.mapper.TShouhuanInfoMapper">
-    
+
     <resultMap type="TShouhuanInfo" id="TShouhuanInfoResult">
-        <result property="id"    column="id"    />
-        <result property="facilityId"    column="facility_id"    />
-        <result property="deviceIdCode"    column="device_id_code"    />
-        <result property="version"    column="version"    />
-        <result property="gpsLong"    column="gps_long"    />
-        <result property="gpsLat"    column="gps_lat"    />
-        <result property="useGpsLong"    column="use_gps_long"    />
-        <result property="useGpsLat"    column="use_gps_lat"    />
-        <result property="useMac"    column="use_mac"    />
-        <result property="speed"    column="speed"    />
-        <result property="direction"    column="direction"    />
-        <result property="poster"    column="poster"    />
-        <result property="electricQuantity"    column="electric_quantity"    />
-        <result property="stepNumber"    column="step_number"    />
-        <result property="rollNumber"    column="roll_number"    />
-        <result property="terminalStatus"    column="terminal_status"    />
-        <result property="onlineStatis"    column="online_statis"    />
-        <result property="temp"    column="temp"    />
-        <result property="bloodHeightPressure"    column="blood_height_pressure"    />
-        <result property="bloodLowPressure"    column="blood_low_pressure"    />
-        <result property="heartRate"    column="heart_rate"    />
-        <result property="oxygen"    column="oxygen"    />
-        <result property="offlinetime"    column="offlinetime"    />
-        <result property="onlinetime"    column="onlinetime"    />
-        <result property="gpsUpdateTime"    column="gps_update_time"    />
-        <result property="bloodUpdateTime"    column="blood_update_time"    />
-        <result property="heartUpdateTime"    column="heart_update_time"    />
-        <result property="tempUpdateTime"    column="temp_update_time"    />
-        <result property="oxygenUpdateTime"    column="oxygen_update_time"    />
-        <result property="electricQuantityUpdateTime"    column="electric_quantity_update_time"    />
-        <result property="stepNumberUpdateTime"    column="step_number_update_time"    />
-        <result property="rollNumberUpdateTime"    column="roll_number_update_time"    />
-        <result property="terminalStatusUpdateTime"    column="terminal_status_update_time"    />
-        <result property="createtime"    column="createtime"    />
-        <result property="updatetime"    column="updatetime"    />
-        <result property="accesstype"    column="accesstype"    />
-        <result property="addressDesc"    column="address_desc"    />
-        <result property="isGps"    column="is_gps"    />
+        <result property="id" column="id"/>
+        <result property="facilityId" column="facility_id"/>
+        <result property="deviceIdCode" column="device_id_code"/>
+        <result property="version" column="version"/>
+        <result property="gpsLong" column="gps_long"/>
+        <result property="gpsLat" column="gps_lat"/>
+        <result property="useGpsLong" column="use_gps_long"/>
+        <result property="useGpsLat" column="use_gps_lat"/>
+        <result property="useMac" column="use_mac"/>
+        <result property="speed" column="speed"/>
+        <result property="direction" column="direction"/>
+        <result property="poster" column="poster"/>
+        <result property="electricQuantity" column="electric_quantity"/>
+        <result property="stepNumber" column="step_number"/>
+        <result property="rollNumber" column="roll_number"/>
+        <result property="terminalStatus" column="terminal_status"/>
+        <result property="onlineStatis" column="online_statis"/>
+        <result property="temp" column="temp"/>
+        <result property="bloodHeightPressure" column="blood_height_pressure"/>
+        <result property="bloodLowPressure" column="blood_low_pressure"/>
+        <result property="heartRate" column="heart_rate"/>
+        <result property="oxygen" column="oxygen"/>
+        <result property="offlinetime" column="offlinetime"/>
+        <result property="onlinetime" column="onlinetime"/>
+        <result property="gpsUpdateTime" column="gps_update_time"/>
+        <result property="bloodUpdateTime" column="blood_update_time"/>
+        <result property="heartUpdateTime" column="heart_update_time"/>
+        <result property="tempUpdateTime" column="temp_update_time"/>
+        <result property="oxygenUpdateTime" column="oxygen_update_time"/>
+        <result property="electricQuantityUpdateTime" column="electric_quantity_update_time"/>
+        <result property="stepNumberUpdateTime" column="step_number_update_time"/>
+        <result property="rollNumberUpdateTime" column="roll_number_update_time"/>
+        <result property="terminalStatusUpdateTime" column="terminal_status_update_time"/>
+        <result property="createtime" column="createtime"/>
+        <result property="updatetime" column="updatetime"/>
+        <result property="accesstype" column="accesstype"/>
+        <result property="addressDesc" column="address_desc"/>
+        <result property="isGps" column="is_gps"/>
     </resultMap>
 
     <sql id="selectTShouhuanInfoVo">
-        select id, facility_id, device_id_code, version, gps_long, gps_lat, use_gps_long, use_gps_lat, use_mac, speed, direction, poster, electric_quantity, step_number, roll_number, terminal_status, online_statis, temp, blood_height_pressure, blood_low_pressure, heart_rate, oxygen, offlinetime, onlinetime, gps_update_time, blood_update_time, heart_update_time, temp_update_time, oxygen_update_time, electric_quantity_update_time, step_number_update_time, roll_number_update_time, terminal_status_update_time, createtime, updatetime, accesstype, address_desc, is_gps from t_shouhuan_info
+        select id,
+               facility_id,
+               device_id_code,
+               version,
+               gps_long,
+               gps_lat,
+               use_gps_long,
+               use_gps_lat,
+               use_mac,
+               speed,
+               direction,
+               poster,
+               electric_quantity,
+               step_number,
+               roll_number,
+               terminal_status,
+               online_statis,
+               temp,
+               blood_height_pressure,
+               blood_low_pressure,
+               heart_rate,
+               oxygen,
+               offlinetime,
+               onlinetime,
+               gps_update_time,
+               blood_update_time,
+               heart_update_time,
+               temp_update_time,
+               oxygen_update_time,
+               electric_quantity_update_time,
+               step_number_update_time,
+               roll_number_update_time,
+               terminal_status_update_time,
+               createtime,
+               updatetime,
+               accesstype,
+               address_desc,
+               is_gps
+        from t_shouhuan_info
     </sql>
 
     <select id="selectTShouhuanInfoList" parameterType="TShouhuanInfo" resultMap="TShouhuanInfoResult">
         <include refid="selectTShouhuanInfoVo"/>
-        <where>  
-            <if test="facilityId != null "> and facility_id = #{facilityId}</if>
-            <if test="deviceIdCode != null  and deviceIdCode != ''"> and device_id_code = #{deviceIdCode}</if>
-            <if test="version != null  and version != ''"> and version = #{version}</if>
-            <if test="gpsLong != null "> and gps_long = #{gpsLong}</if>
-            <if test="gpsLat != null "> and gps_lat = #{gpsLat}</if>
-            <if test="useGpsLong != null "> and use_gps_long = #{useGpsLong}</if>
-            <if test="useGpsLat != null "> and use_gps_lat = #{useGpsLat}</if>
-            <if test="useMac != null  and useMac != ''"> and use_mac = #{useMac}</if>
-            <if test="speed != null "> and speed = #{speed}</if>
-            <if test="direction != null "> and direction = #{direction}</if>
-            <if test="poster != null "> and poster = #{poster}</if>
-            <if test="electricQuantity != null "> and electric_quantity = #{electricQuantity}</if>
-            <if test="stepNumber != null "> and step_number = #{stepNumber}</if>
-            <if test="rollNumber != null "> and roll_number = #{rollNumber}</if>
-            <if test="terminalStatus != null  and terminalStatus != ''"> and terminal_status = #{terminalStatus}</if>
-            <if test="onlineStatis != null "> and online_statis = #{onlineStatis}</if>
-            <if test="temp != null "> and temp = #{temp}</if>
-            <if test="bloodHeightPressure != null "> and blood_height_pressure = #{bloodHeightPressure}</if>
-            <if test="bloodLowPressure != null "> and blood_low_pressure = #{bloodLowPressure}</if>
-            <if test="heartRate != null "> and heart_rate = #{heartRate}</if>
-            <if test="oxygen != null "> and oxygen = #{oxygen}</if>
-            <if test="offlinetime != null "> and offlinetime = #{offlinetime}</if>
-            <if test="onlinetime != null "> and onlinetime = #{onlinetime}</if>
-            <if test="gpsUpdateTime != null "> and gps_update_time = #{gpsUpdateTime}</if>
-            <if test="bloodUpdateTime != null "> and blood_update_time = #{bloodUpdateTime}</if>
-            <if test="heartUpdateTime != null "> and heart_update_time = #{heartUpdateTime}</if>
-            <if test="tempUpdateTime != null "> and temp_update_time = #{tempUpdateTime}</if>
-            <if test="oxygenUpdateTime != null "> and oxygen_update_time = #{oxygenUpdateTime}</if>
-            <if test="electricQuantityUpdateTime != null "> and electric_quantity_update_time = #{electricQuantityUpdateTime}</if>
-            <if test="stepNumberUpdateTime != null "> and step_number_update_time = #{stepNumberUpdateTime}</if>
-            <if test="rollNumberUpdateTime != null "> and roll_number_update_time = #{rollNumberUpdateTime}</if>
-            <if test="terminalStatusUpdateTime != null "> and terminal_status_update_time = #{terminalStatusUpdateTime}</if>
-            <if test="createtime != null "> and createtime = #{createtime}</if>
-            <if test="updatetime != null "> and updatetime = #{updatetime}</if>
-            <if test="accesstype != null "> and accesstype = #{accesstype}</if>
-            <if test="addressDesc != null  and addressDesc != ''"> and address_desc = #{addressDesc}</if>
-            <if test="isGps != null "> and is_gps = #{isGps}</if>
+        <where>
+            <if test="facilityId != null ">and facility_id = #{facilityId}</if>
+            <if test="deviceIdCode != null  and deviceIdCode != ''">and device_id_code = #{deviceIdCode}</if>
+            <if test="version != null  and version != ''">and version = #{version}</if>
+            <if test="gpsLong != null ">and gps_long = #{gpsLong}</if>
+            <if test="gpsLat != null ">and gps_lat = #{gpsLat}</if>
+            <if test="useGpsLong != null ">and use_gps_long = #{useGpsLong}</if>
+            <if test="useGpsLat != null ">and use_gps_lat = #{useGpsLat}</if>
+            <if test="useMac != null  and useMac != ''">and use_mac = #{useMac}</if>
+            <if test="speed != null ">and speed = #{speed}</if>
+            <if test="direction != null ">and direction = #{direction}</if>
+            <if test="poster != null ">and poster = #{poster}</if>
+            <if test="electricQuantity != null ">and electric_quantity = #{electricQuantity}</if>
+            <if test="stepNumber != null ">and step_number = #{stepNumber}</if>
+            <if test="rollNumber != null ">and roll_number = #{rollNumber}</if>
+            <if test="terminalStatus != null  and terminalStatus != ''">and terminal_status = #{terminalStatus}</if>
+            <if test="onlineStatis != null ">and online_statis = #{onlineStatis}</if>
+            <if test="temp != null ">and temp = #{temp}</if>
+            <if test="bloodHeightPressure != null ">and blood_height_pressure = #{bloodHeightPressure}</if>
+            <if test="bloodLowPressure != null ">and blood_low_pressure = #{bloodLowPressure}</if>
+            <if test="heartRate != null ">and heart_rate = #{heartRate}</if>
+            <if test="oxygen != null ">and oxygen = #{oxygen}</if>
+            <if test="offlinetime != null ">and offlinetime = #{offlinetime}</if>
+            <if test="onlinetime != null ">and onlinetime = #{onlinetime}</if>
+            <if test="gpsUpdateTime != null ">and gps_update_time = #{gpsUpdateTime}</if>
+            <if test="bloodUpdateTime != null ">and blood_update_time = #{bloodUpdateTime}</if>
+            <if test="heartUpdateTime != null ">and heart_update_time = #{heartUpdateTime}</if>
+            <if test="tempUpdateTime != null ">and temp_update_time = #{tempUpdateTime}</if>
+            <if test="oxygenUpdateTime != null ">and oxygen_update_time = #{oxygenUpdateTime}</if>
+            <if test="electricQuantityUpdateTime != null ">and electric_quantity_update_time =
+                #{electricQuantityUpdateTime}
+            </if>
+            <if test="stepNumberUpdateTime != null ">and step_number_update_time = #{stepNumberUpdateTime}</if>
+            <if test="rollNumberUpdateTime != null ">and roll_number_update_time = #{rollNumberUpdateTime}</if>
+            <if test="terminalStatusUpdateTime != null ">and terminal_status_update_time = #{terminalStatusUpdateTime}
+            </if>
+            <if test="createtime != null ">and createtime = #{createtime}</if>
+            <if test="updatetime != null ">and updatetime = #{updatetime}</if>
+            <if test="accesstype != null ">and accesstype = #{accesstype}</if>
+            <if test="addressDesc != null  and addressDesc != ''">and address_desc = #{addressDesc}</if>
+            <if test="isGps != null ">and is_gps = #{isGps}</if>
         </where>
     </select>
-    
+
     <select id="selectTShouhuanInfoById" parameterType="Long" resultMap="TShouhuanInfoResult">
         <include refid="selectTShouhuanInfoVo"/>
         where id = #{id}
@@ -100,10 +141,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectTShouhuanInfoVo"/>
     </select>
     <select id="selectMapGpsView" resultType="com.ruoyi.system.domain.dto.MapGpsDto">
-        SELECT gps_long,gps_lat FROM `t_shouhuan_info`
+        SELECT gps_long, gps_lat, use_gps_long, use_gps_lat
+        FROM `t_shouhuan_info`
     </select>
 
-    <select id="selectTShouhuanInfoListBydeviceIdCode" parameterType="string"  resultMap="TShouhuanInfoResult">
+    <select id="selectTShouhuanInfoListBydeviceIdCode" parameterType="string" resultMap="TShouhuanInfoResult">
         <include refid="selectTShouhuanInfoVo"/>
         where device_id_code = #{device_id_code}
     </select>
@@ -148,7 +190,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="accesstype != null">accesstype,</if>
             <if test="addressDesc != null">address_desc,</if>
             <if test="isGps != null">is_gps,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="facilityId != null">#{facilityId},</if>
             <if test="deviceIdCode != null">#{deviceIdCode},</if>
@@ -187,7 +229,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="accesstype != null">#{accesstype},</if>
             <if test="addressDesc != null">#{addressDesc},</if>
             <if test="isGps != null">#{isGps},</if>
-         </trim>
+        </trim>
     </insert>
 
     <update id="updateTShouhuanInfo" parameterType="TShouhuanInfo">
@@ -221,7 +263,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="heartUpdateTime != null">heart_update_time = #{heartUpdateTime},</if>
             <if test="tempUpdateTime != null">temp_update_time = #{tempUpdateTime},</if>
             <if test="oxygenUpdateTime != null">oxygen_update_time = #{oxygenUpdateTime},</if>
-            <if test="electricQuantityUpdateTime != null">electric_quantity_update_time = #{electricQuantityUpdateTime},</if>
+            <if test="electricQuantityUpdateTime != null">electric_quantity_update_time =
+                #{electricQuantityUpdateTime},
+            </if>
             <if test="stepNumberUpdateTime != null">step_number_update_time = #{stepNumberUpdateTime},</if>
             <if test="rollNumberUpdateTime != null">roll_number_update_time = #{rollNumberUpdateTime},</if>
             <if test="terminalStatusUpdateTime != null">terminal_status_update_time = #{terminalStatusUpdateTime},</if>
@@ -235,11 +279,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
 
     <delete id="deleteTShouhuanInfoById" parameterType="Long">
-        delete from t_shouhuan_info where id = #{id}
+        delete
+        from t_shouhuan_info
+        where id = #{id}
     </delete>
 
     <delete id="deleteTShouhuanInfoByIds" parameterType="String">
-        delete from t_shouhuan_info where id in 
+        delete from t_shouhuan_info where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>