大屏接口修改

This commit is contained in:
2025-10-13 21:49:27 +08:00
parent 2497527c77
commit 61b39d89de
9 changed files with 52 additions and 57 deletions

View File

@ -21,6 +21,7 @@ import org.dromara.drone.service.IDroProjectDroneService;
import org.dromara.gps.domain.bo.GpsEquipmentBo; import org.dromara.gps.domain.bo.GpsEquipmentBo;
import org.dromara.gps.domain.vo.DeviceVo; import org.dromara.gps.domain.vo.DeviceVo;
import org.dromara.gps.domain.vo.GpsEquipmentSonVo; 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.IDeviceService;
import org.dromara.gps.service.IGpsEquipmentService; import org.dromara.gps.service.IGpsEquipmentService;
import org.dromara.manager.weathermanager.vo.WeatherVo; import org.dromara.manager.weathermanager.vo.WeatherVo;
@ -479,10 +480,10 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
List<GpsEquipmentSonVo> voList = gpsEquipmentService.getClientList(projectId, startOfDay, now); List<GpsEquipmentSonVo> voList = gpsEquipmentService.getClientList(projectId, startOfDay, now);
List<GpsEquipmentSonVo> appList = gpsEquipmentService.getUserListByProjectId(projectId, startOfDay, now); List<GpsEquipmentSonVo> appList = gpsEquipmentService.getUserListByProjectId(projectId, startOfDay, now);
List<DeviceVo> anqmList = deviceService.getUserListByProjectId(projectId, startOfDay, now); List<LocationVo> anqmList = deviceService.getUserListByProjectId(projectId, startOfDay, now);
List<OthYs7Device> othYs7DeviceList = othYs7DeviceService.lambdaQuery() List<OthYs7Device> othYs7DeviceList = othYs7DeviceService.lambdaQuery()
.eq(OthYs7Device::getProjectId, projectId) .eq(OthYs7Device::getProjectId, projectId)
.between(OthYs7Device::getUpdateTime, startOfDay, now) // .between(OthYs7Device::getUpdateTime, startOfDay, now)
.list(); .list();
List<String> wrjKeys = droProjectDroneService.getTopicsByProjectId(projectId); List<String> wrjKeys = droProjectDroneService.getTopicsByProjectId(projectId);
List<Map<String, Object>> maps = new ArrayList<>(); List<Map<String, Object>> maps = new ArrayList<>();
@ -498,26 +499,6 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
List<Map<String, Object>> anqmChildrenMap = new ArrayList<>(); List<Map<String, Object>> anqmChildrenMap = new ArrayList<>();
List<Map<String, Object>> wrjChildrenMap = new ArrayList<>(); List<Map<String, Object>> wrjChildrenMap = new ArrayList<>();
List<Map<String, Object>> sxtChildrenMap = new ArrayList<>(); List<Map<String, Object>> sxtChildrenMap = new ArrayList<>();
Map<String, Object> 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<String, Object> 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()) { if (voList != null && !voList.isEmpty()) {
for (GpsEquipmentSonVo item : voList) { for (GpsEquipmentSonVo item : voList) {
Map<String, Object> gps = new HashMap<>(); Map<String, Object> gps = new HashMap<>();
@ -535,9 +516,9 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
if (appList != null && !appList.isEmpty()) { if (appList != null && !appList.isEmpty()) {
for (GpsEquipmentSonVo item : appList) { for (GpsEquipmentSonVo item : appList) {
Map<String, Object> app = new HashMap<>(); Map<String, Object> app = new HashMap<>();
app.put("id", item.getClientId()); app.put("id", item.getUserId());
app.put("userId", item.getUserId()); app.put("userId", item.getUserId());
app.put("label", item.getClientId()); app.put("label", item.getUserId());
app.put("name", item.getDeviceName()); app.put("name", item.getDeviceName());
app.put("type", "app"); app.put("type", "app");
app.put("lat", item.getLocLatitude()); app.put("lat", item.getLocLatitude());
@ -546,20 +527,35 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
appChildrenMap.add(app); appChildrenMap.add(app);
} }
} }
// if (othYs7DeviceList != null && !othYs7DeviceList.isEmpty()) { if (anqmList != null && !anqmList.isEmpty()) {
// for (OthYs7Device item : othYs7DeviceList) { for (LocationVo item : anqmList) {
// Map<String, Object> sxt = new HashMap<>(); Map<String, Object> anqm = new HashMap<>();
// sxt.put("id", item.getDeviceSerial()); anqm.put("id", item.getDevNum());
// sxt.put("label", item.getDeviceSerial()); anqm.put("userId", item.getUserId());
// sxt.put("name", item.getDeviceName()); anqm.put("label", item.getDevNum());
// sxt.put("type", "shexiangtou"); anqm.put("name", item.getDevNum());
// sxt.put("lat", item.getLatitude()); anqm.put("type", "positioningDevice");
// sxt.put("lng", item.getLongitude()); anqm.put("lat", item.getLatitude());
// sxt.put("alt", item.getAltitude()); anqm.put("lng", item.getLongitude());
// sxt.put("detail", item.getDetail()); anqm.put("alt", item.getElevation());
// sxtChildrenMap.add(sxt); anqmChildrenMap.add(anqm);
// } }
// } }
if (othYs7DeviceList != null && !othYs7DeviceList.isEmpty()) {
for (OthYs7Device item : othYs7DeviceList) {
Map<String, Object> 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()) { if (wrjKeys != null && !wrjKeys.isEmpty()) {
for (String key : wrjKeys) { for (String key : wrjKeys) {
Object object = stringRedisTemplate.opsForValue().get("wrj:osd4:" + key); Object object = stringRedisTemplate.opsForValue().get("wrj:osd4:" + key);

View File

@ -6,6 +6,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.io.Serial; import java.io.Serial;
import java.math.BigDecimal;
/** /**
* 安全帽经纬度数据对象 location * 安全帽经纬度数据对象 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;
/** /**
* 速度 * 速度

View File

@ -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;
/** /**
* 速度 * 速度

View File

@ -11,6 +11,7 @@ import lombok.Data;
import java.io.Serial; import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
@ -76,19 +77,19 @@ public class LocationVo implements Serializable {
* 纬度 * 纬度
*/ */
@ExcelProperty(value = "纬度") @ExcelProperty(value = "纬度")
private Long latitude; private Float latitude;
/** /**
* 经度 * 经度
*/ */
@ExcelProperty(value = "经度") @ExcelProperty(value = "经度")
private Long longitude; private Float longitude;
/** /**
* 海拔 * 海拔
*/ */
@ExcelProperty(value = "海拔") @ExcelProperty(value = "海拔")
private Long elevation; private Float elevation;
/** /**
* 速度 * 速度

View File

@ -35,7 +35,7 @@ public interface LocationMapper extends BaseMapperPlus<Location, LocationVo> {
@Select("WITH RankedData AS (\n" + @Select("WITH RankedData AS (\n" +
" SELECT\n" + " SELECT\n" +
" *,\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" + " FROM\n" +
" anqm_location \n " + " anqm_location \n " +
"WHERE \n" + "WHERE \n" +
@ -48,5 +48,5 @@ public interface LocationMapper extends BaseMapperPlus<Location, LocationVo> {
" RankedData\n" + " RankedData\n" +
"WHERE\n" + "WHERE\n" +
" rn = 1;") " rn = 1;")
List<DeviceVo> getUserListByProjectId(Long projectId, LocalDateTime startOfDay, LocalDateTime now); List<LocationVo> getUserListByProjectId(@Param("projectId") Long projectId, @Param("startOfDay") LocalDateTime startOfDay, @Param("now") LocalDateTime now);
} }

View File

@ -1,16 +1,13 @@
package org.dromara.gps.service; package org.dromara.gps.service;
import org.dromara.gps.domain.bo.GpsEquipmentBo; import org.dromara.gps.domain.bo.GpsEquipmentBo;
import org.dromara.gps.domain.vo.AnqmUserVo; import org.dromara.gps.domain.vo.*;
import org.dromara.gps.domain.vo.DeviceVo;
import org.dromara.gps.domain.bo.DeviceBo; import org.dromara.gps.domain.bo.DeviceBo;
import org.dromara.gps.domain.Device; import org.dromara.gps.domain.Device;
import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.PageQuery;
import com.baomidou.mybatisplus.extension.service.IService; 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.time.LocalDateTime;
import java.util.Collection; import java.util.Collection;
@ -80,7 +77,7 @@ public interface IDeviceService extends IService<Device>{
Boolean unbindManmachine(DeviceBo bo); Boolean unbindManmachine(DeviceBo bo);
List<DeviceVo> getUserListByProjectId(Long projectId, LocalDateTime startOfDay, LocalDateTime now); List<LocationVo> getUserListByProjectId(Long projectId, LocalDateTime startOfDay, LocalDateTime now);
List<AnqmUserVo> getUserList(DeviceBo bo); List<AnqmUserVo> getUserList(DeviceBo bo);
} }

View File

@ -73,5 +73,5 @@ public interface ILocationService extends IService<Location>{
List<LocationVo> getLargerScreenList(LocationBo bo); List<LocationVo> getLargerScreenList(LocationBo bo);
List<DeviceVo> getUserListByProjectId(Long projectId, LocalDateTime startOfDay, LocalDateTime now); List<LocationVo> getUserListByProjectId(Long projectId, LocalDateTime startOfDay, LocalDateTime now);
} }

View File

@ -255,7 +255,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
} }
@Override @Override
public List<DeviceVo> getUserListByProjectId(Long projectId, LocalDateTime startOfDay, LocalDateTime now) { public List<LocationVo> getUserListByProjectId(Long projectId, LocalDateTime startOfDay, LocalDateTime now) {
return locationService.getUserListByProjectId(projectId,startOfDay,now); return locationService.getUserListByProjectId(projectId,startOfDay,now);
} }

View File

@ -156,7 +156,7 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i
} }
@Override @Override
public List<DeviceVo> getUserListByProjectId(Long projectId, LocalDateTime startOfDay, LocalDateTime now) { public List<LocationVo> getUserListByProjectId(Long projectId, LocalDateTime startOfDay, LocalDateTime now) {
return baseMapper.getUserListByProjectId(projectId,startOfDay,now); return baseMapper.getUserListByProjectId(projectId,startOfDay,now);
} }
} }