From 61b39d89de684b0be5b505d302456e38adb356e7 Mon Sep 17 00:00:00 2001 From: dfdg <2710245601@qq.com> Date: Mon, 13 Oct 2025 21:49:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ProjectBigScreenServiceImpl.java | 72 +++++++++---------- .../java/org/dromara/gps/domain/Location.java | 7 +- .../org/dromara/gps/domain/bo/LocationBo.java | 6 +- .../org/dromara/gps/domain/vo/LocationVo.java | 7 +- .../dromara/gps/mapper/LocationMapper.java | 4 +- .../dromara/gps/service/IDeviceService.java | 7 +- .../dromara/gps/service/ILocationService.java | 2 +- .../gps/service/impl/DeviceServiceImpl.java | 2 +- .../gps/service/impl/LocationServiceImpl.java | 2 +- 9 files changed, 52 insertions(+), 57 deletions(-) diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/service/impl/ProjectBigScreenServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/service/impl/ProjectBigScreenServiceImpl.java index c3305554..814be24a 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/service/impl/ProjectBigScreenServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/service/impl/ProjectBigScreenServiceImpl.java @@ -21,6 +21,7 @@ import org.dromara.drone.service.IDroProjectDroneService; import org.dromara.gps.domain.bo.GpsEquipmentBo; import org.dromara.gps.domain.vo.DeviceVo; import org.dromara.gps.domain.vo.GpsEquipmentSonVo; +import org.dromara.gps.domain.vo.LocationVo; import org.dromara.gps.service.IDeviceService; import org.dromara.gps.service.IGpsEquipmentService; import org.dromara.manager.weathermanager.vo.WeatherVo; @@ -479,10 +480,10 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService { LocalDateTime now = LocalDateTime.now(); List voList = gpsEquipmentService.getClientList(projectId, startOfDay, now); List appList = gpsEquipmentService.getUserListByProjectId(projectId, startOfDay, now); - List anqmList = deviceService.getUserListByProjectId(projectId, startOfDay, now); + List anqmList = deviceService.getUserListByProjectId(projectId, startOfDay, now); List othYs7DeviceList = othYs7DeviceService.lambdaQuery() .eq(OthYs7Device::getProjectId, projectId) - .between(OthYs7Device::getUpdateTime, startOfDay, now) +// .between(OthYs7Device::getUpdateTime, startOfDay, now) .list(); List wrjKeys = droProjectDroneService.getTopicsByProjectId(projectId); List> maps = new ArrayList<>(); @@ -498,26 +499,6 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService { List> anqmChildrenMap = new ArrayList<>(); List> wrjChildrenMap = new ArrayList<>(); List> sxtChildrenMap = new ArrayList<>(); - - Map sxt = new HashMap<>(); - sxt.put("id", 4545555); - sxt.put("label", ""); - sxt.put("name", "摄像头"); - sxt.put("type", "shexiangtou"); - sxt.put("lat", 23.81524718); - sxt.put("lng", 107.13038137); - sxt.put("alt", 0); - sxtChildrenMap.add(sxt); - Map anqm = new HashMap<>(); - anqm.put("id", 45454455154L); - anqm.put("label", ""); - anqm.put("name", "安全帽"); - anqm.put("type", "positioningDevice"); - anqm.put("lat", 23.81488041); - anqm.put("lng", 107.12917371); - anqm.put("alt", 0); - - anqmChildrenMap.add(anqm); if (voList != null && !voList.isEmpty()) { for (GpsEquipmentSonVo item : voList) { Map gps = new HashMap<>(); @@ -535,9 +516,9 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService { if (appList != null && !appList.isEmpty()) { for (GpsEquipmentSonVo item : appList) { Map app = new HashMap<>(); - app.put("id", item.getClientId()); + app.put("id", item.getUserId()); app.put("userId", item.getUserId()); - app.put("label", item.getClientId()); + app.put("label", item.getUserId()); app.put("name", item.getDeviceName()); app.put("type", "app"); app.put("lat", item.getLocLatitude()); @@ -546,20 +527,35 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService { appChildrenMap.add(app); } } -// if (othYs7DeviceList != null && !othYs7DeviceList.isEmpty()) { -// for (OthYs7Device item : othYs7DeviceList) { -// Map sxt = new HashMap<>(); -// sxt.put("id", item.getDeviceSerial()); -// sxt.put("label", item.getDeviceSerial()); -// sxt.put("name", item.getDeviceName()); -// sxt.put("type", "shexiangtou"); -// sxt.put("lat", item.getLatitude()); -// sxt.put("lng", item.getLongitude()); -// sxt.put("alt", item.getAltitude()); -// sxt.put("detail", item.getDetail()); -// sxtChildrenMap.add(sxt); -// } -// } + if (anqmList != null && !anqmList.isEmpty()) { + for (LocationVo item : anqmList) { + Map anqm = new HashMap<>(); + anqm.put("id", item.getDevNum()); + anqm.put("userId", item.getUserId()); + anqm.put("label", item.getDevNum()); + anqm.put("name", item.getDevNum()); + anqm.put("type", "positioningDevice"); + anqm.put("lat", item.getLatitude()); + anqm.put("lng", item.getLongitude()); + anqm.put("alt", item.getElevation()); + anqmChildrenMap.add(anqm); + } + } + if (othYs7DeviceList != null && !othYs7DeviceList.isEmpty()) { + for (OthYs7Device item : othYs7DeviceList) { + Map sxt = new HashMap<>(); + sxt.put("id", item.getDeviceSerial()); + sxt.put("label", item.getDeviceSerial()); + sxt.put("name", item.getDeviceName()); + sxt.put("type", "shexiangtou"); + sxt.put("lat", item.getLatitude()); + sxt.put("lng", item.getLongitude()); + sxt.put("alt", item.getAltitude()); + sxt.put("status", item.getStatus()); + sxt.put("detail", item.getDetail()); + sxtChildrenMap.add(sxt); + } + } if (wrjKeys != null && !wrjKeys.isEmpty()) { for (String key : wrjKeys) { Object object = stringRedisTemplate.opsForValue().get("wrj:osd4:" + key); diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/Location.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/Location.java index e208d49b..11c62c74 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/Location.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/Location.java @@ -6,6 +6,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import java.io.Serial; +import java.math.BigDecimal; /** * 安全帽经纬度数据对象 location @@ -60,17 +61,17 @@ public class Location extends BaseEntity { /** * 纬度 */ - private Long latitude; + private Float latitude; /** * 经度 */ - private Long longitude; + private Float longitude; /** * 海拔 */ - private Long elevation; + private Float elevation; /** * 速度 diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/bo/LocationBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/bo/LocationBo.java index 25b082bc..7e87935e 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/bo/LocationBo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/bo/LocationBo.java @@ -63,17 +63,17 @@ public class LocationBo extends BaseEntity { /** * 纬度 */ - private Long latitude; + private Float latitude; /** * 经度 */ - private Long longitude; + private Float longitude; /** * 海拔 */ - private Long elevation; + private Float elevation; /** * 速度 diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/vo/LocationVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/vo/LocationVo.java index 6eb3ea99..4835b1d3 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/vo/LocationVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/domain/vo/LocationVo.java @@ -11,6 +11,7 @@ import lombok.Data; import java.io.Serial; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; @@ -76,19 +77,19 @@ public class LocationVo implements Serializable { * 纬度 */ @ExcelProperty(value = "纬度") - private Long latitude; + private Float latitude; /** * 经度 */ @ExcelProperty(value = "经度") - private Long longitude; + private Float longitude; /** * 海拔 */ @ExcelProperty(value = "海拔") - private Long elevation; + private Float elevation; /** * 速度 diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/mapper/LocationMapper.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/mapper/LocationMapper.java index e312a555..7dd51fa8 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/mapper/LocationMapper.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/mapper/LocationMapper.java @@ -35,7 +35,7 @@ public interface LocationMapper extends BaseMapperPlus { @Select("WITH RankedData AS (\n" + " SELECT\n" + " *,\n" + - " ROW_NUMBER() OVER (PARTITION BY user_id ORDER BY create_time DESC) AS rn\n" + + " ROW_NUMBER() OVER (PARTITION BY dev_num ORDER BY create_time DESC) AS rn\n" + " FROM\n" + " anqm_location \n " + "WHERE \n" + @@ -48,5 +48,5 @@ public interface LocationMapper extends BaseMapperPlus { " RankedData\n" + "WHERE\n" + " rn = 1;") - List getUserListByProjectId(Long projectId, LocalDateTime startOfDay, LocalDateTime now); + List getUserListByProjectId(@Param("projectId") Long projectId, @Param("startOfDay") LocalDateTime startOfDay, @Param("now") LocalDateTime now); } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/service/IDeviceService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/service/IDeviceService.java index 12276448..efd8890f 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/service/IDeviceService.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/service/IDeviceService.java @@ -1,16 +1,13 @@ package org.dromara.gps.service; import org.dromara.gps.domain.bo.GpsEquipmentBo; -import org.dromara.gps.domain.vo.AnqmUserVo; -import org.dromara.gps.domain.vo.DeviceVo; +import org.dromara.gps.domain.vo.*; import org.dromara.gps.domain.bo.DeviceBo; import org.dromara.gps.domain.Device; import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.common.mybatis.core.page.PageQuery; import com.baomidou.mybatisplus.extension.service.IService; -import org.dromara.gps.domain.vo.GpsProjectVo; -import org.dromara.gps.domain.vo.GpsUserVo; import java.time.LocalDateTime; import java.util.Collection; @@ -80,7 +77,7 @@ public interface IDeviceService extends IService{ Boolean unbindManmachine(DeviceBo bo); - List getUserListByProjectId(Long projectId, LocalDateTime startOfDay, LocalDateTime now); + List getUserListByProjectId(Long projectId, LocalDateTime startOfDay, LocalDateTime now); List getUserList(DeviceBo bo); } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/service/ILocationService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/service/ILocationService.java index ed06d6f6..cdc8f6a1 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/service/ILocationService.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/service/ILocationService.java @@ -73,5 +73,5 @@ public interface ILocationService extends IService{ List getLargerScreenList(LocationBo bo); - List getUserListByProjectId(Long projectId, LocalDateTime startOfDay, LocalDateTime now); + List getUserListByProjectId(Long projectId, LocalDateTime startOfDay, LocalDateTime now); } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/service/impl/DeviceServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/service/impl/DeviceServiceImpl.java index 052e064d..c7f4f2dd 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/service/impl/DeviceServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/service/impl/DeviceServiceImpl.java @@ -255,7 +255,7 @@ public class DeviceServiceImpl extends ServiceImpl impleme } @Override - public List getUserListByProjectId(Long projectId, LocalDateTime startOfDay, LocalDateTime now) { + public List getUserListByProjectId(Long projectId, LocalDateTime startOfDay, LocalDateTime now) { return locationService.getUserListByProjectId(projectId,startOfDay,now); } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/service/impl/LocationServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/service/impl/LocationServiceImpl.java index 79dfd8e1..c90f234a 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/service/impl/LocationServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/gps/service/impl/LocationServiceImpl.java @@ -156,7 +156,7 @@ public class LocationServiceImpl extends ServiceImpl i } @Override - public List getUserListByProjectId(Long projectId, LocalDateTime startOfDay, LocalDateTime now) { + public List getUserListByProjectId(Long projectId, LocalDateTime startOfDay, LocalDateTime now) { return baseMapper.getUserListByProjectId(projectId,startOfDay,now); } }