zhengjie 1 rok pred
rodič
commit
d65916be3a

+ 12 - 25
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TDataDisplayController.java

@@ -20,10 +20,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
 import java.text.NumberFormat;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * 数据大屏Controller
@@ -71,18 +68,12 @@ public class TDataDisplayController extends BaseController
         return getDataTable1(alarmListDtoList,tShouhuanAlarmListService.selectTShouhuanAlarmListCount());
     }
 
-    /**
-     * 总数
-     */
     @GetMapping("/count")
     public AjaxResult count()
     {
         return success(tShouhuanAlarmListService.selectTShouhuanAlarmListCount());
     }
 
-    /**
-     * 总数
-     */
     @GetMapping("/alarm")
     public AjaxResult alarm()
     {
@@ -102,9 +93,6 @@ public class TDataDisplayController extends BaseController
         return success(dto);
     }
 
-    /**
-     * 总数
-     */
     @GetMapping("/percent")
     public AjaxResult percent()
     {
@@ -119,9 +107,6 @@ public class TDataDisplayController extends BaseController
         return success(dto);
     }
 
-    /**
-     * 总数
-     */
     @GetMapping("/deviceView")
     public AjaxResult deviceView()
     {
@@ -133,9 +118,6 @@ public class TDataDisplayController extends BaseController
         return success(dto);
     }
 
-    /**
-     * 总数
-     */
     @GetMapping("/deviceType")
     public AjaxResult deviceType()
     {
@@ -151,9 +133,6 @@ public class TDataDisplayController extends BaseController
         return AjaxResult.success("操作成功",ajax);
     }
 
-    /**
-     * 总数
-     */
     @GetMapping("/userAgeAll")
     public AjaxResult userAgeAll()
     {
@@ -165,6 +144,17 @@ public class TDataDisplayController extends BaseController
         return AjaxResult.success("操作成功",ajax);
     }
 
+    @GetMapping("/mapGpsView")
+    public AjaxResult mapGpsView()
+    {
+        List<MapGpsDto> dtoList = itShouhuanInfoService.selectMapGpsView();
+        AjaxResult ajax = new AjaxResult();
+        ajax.put("lnglat", dtoList);
+        AjaxResult ajax1 = new AjaxResult();
+        ajax1.put("pointList",ajax);
+        return AjaxResult.success("操作成功",ajax1);
+    }
+
     /**
      * 用户新增
      */
@@ -185,9 +175,6 @@ public class TDataDisplayController extends BaseController
         return success(dtoList);
     }
 
-    /**
-     * 设备新增
-     */
     @GetMapping("/alarmStatusList")
     public AjaxResult alarmStatusList()
     {

+ 0 - 1
ruoyi-common/src/main/java/com/ruoyi/common/utils/LocationUtils.java

@@ -10,7 +10,6 @@ import org.apache.http.impl.client.HttpClients;
 import org.apache.http.util.EntityUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
 import java.net.URI;

+ 0 - 1
ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/LocationDto.java

@@ -7,7 +7,6 @@ public class LocationDto {
     private static final long serialVersionUID = 1L;
 
     /** 地址 */
-    @Excel(name = "地址")
     private String formatted_address;
 
     public String getFormatted_address() {

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

@@ -0,0 +1,32 @@
+package com.ruoyi.system.domain.dto;
+
+import com.ruoyi.common.annotation.Excel;
+
+import java.util.List;
+
+public class MapGpsDto {
+
+    private static final long serialVersionUID = 1L;
+
+    /** 经度 */
+    private float gps_long;
+
+    /** 纬度 */
+    private float gps_lat;
+
+    public float getGps_long() {
+        return gps_long;
+    }
+
+    public void setGps_long(float gps_long) {
+        this.gps_long = gps_long;
+    }
+
+    public float getGps_lat() {
+        return gps_lat;
+    }
+
+    public void setGps_lat(float gps_lat) {
+        this.gps_lat = gps_lat;
+    }
+}

+ 8 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TShouhuanInfoMapper.java

@@ -2,6 +2,7 @@ package com.ruoyi.system.mapper;
 
 import java.util.List;
 import com.ruoyi.system.domain.TShouhuanInfo;
+import com.ruoyi.system.domain.dto.MapGpsDto;
 
 /**
  * 手环信息 实时数据Mapper接口
@@ -65,4 +66,11 @@ public interface TShouhuanInfoMapper
      * @return 结果
      */
     public int deleteTShouhuanInfoByIds(Long[] ids);
+
+    /**
+     * 数据大屏地图
+     *
+     * @return 结果
+     */
+    public List<MapGpsDto> selectMapGpsView();
 }

+ 8 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/ITShouhuanInfoService.java

@@ -2,6 +2,7 @@ package com.ruoyi.system.service;
 
 import java.util.List;
 import com.ruoyi.system.domain.TShouhuanInfo;
+import com.ruoyi.system.domain.dto.MapGpsDto;
 
 /**
  * 手环信息 实时数据Service接口
@@ -58,4 +59,11 @@ public interface ITShouhuanInfoService
      * @return 结果
      */
     public int deleteTShouhuanInfoById(Long id);
+
+    /**
+     * 数据大屏地图
+     *
+     * @return 结果
+     */
+    public List<MapGpsDto> selectMapGpsView();
 }

+ 7 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TShouhuanInfoServiceImpl.java

@@ -1,6 +1,8 @@
 package com.ruoyi.system.service.impl;
 
 import java.util.List;
+
+import com.ruoyi.system.domain.dto.MapGpsDto;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.system.mapper.TShouhuanInfoMapper;
@@ -90,4 +92,9 @@ public class TShouhuanInfoServiceImpl implements ITShouhuanInfoService
     {
         return tShouhuanInfoMapper.deleteTShouhuanInfoById(id);
     }
+
+    @Override
+    public List<MapGpsDto> selectMapGpsView() {
+        return tShouhuanInfoMapper.selectMapGpsView();
+    }
 }

+ 3 - 0
ruoyi-system/src/main/resources/mapper/system/TShouhuanInfoMapper.xml

@@ -99,6 +99,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectTShouhuanInfo" parameterType="TShouhuanInfo" resultMap="TShouhuanInfoResult">
         <include refid="selectTShouhuanInfoVo"/>
     </select>
+    <select id="selectMapGpsView" resultType="com.ruoyi.system.domain.dto.MapGpsDto">
+        SELECT gps_long,gps_lat FROM `t_shouhuan_info`
+    </select>
     <insert id="insertTShouhuanInfo" parameterType="TShouhuanInfo" useGeneratedKeys="true" keyProperty="id">
         insert into t_shouhuan_info
         <trim prefix="(" suffix=")" suffixOverrides=",">