大屏接口修改
This commit is contained in:
@ -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<GpsEquipmentSonVo> voList = gpsEquipmentService.getClientList(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()
|
||||
.eq(OthYs7Device::getProjectId, projectId)
|
||||
.between(OthYs7Device::getUpdateTime, startOfDay, now)
|
||||
// .between(OthYs7Device::getUpdateTime, startOfDay, now)
|
||||
.list();
|
||||
List<String> wrjKeys = droProjectDroneService.getTopicsByProjectId(projectId);
|
||||
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>> wrjChildrenMap = 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()) {
|
||||
for (GpsEquipmentSonVo item : voList) {
|
||||
Map<String, Object> gps = new HashMap<>();
|
||||
@ -535,9 +516,9 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
||||
if (appList != null && !appList.isEmpty()) {
|
||||
for (GpsEquipmentSonVo item : appList) {
|
||||
Map<String, Object> 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<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("detail", item.getDetail());
|
||||
// sxtChildrenMap.add(sxt);
|
||||
// }
|
||||
// }
|
||||
if (anqmList != null && !anqmList.isEmpty()) {
|
||||
for (LocationVo item : anqmList) {
|
||||
Map<String, Object> 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<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()) {
|
||||
for (String key : wrjKeys) {
|
||||
Object object = stringRedisTemplate.opsForValue().get("wrj:osd4:" + key);
|
||||
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* 速度
|
||||
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* 速度
|
||||
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* 速度
|
||||
|
||||
@ -35,7 +35,7 @@ public interface LocationMapper extends BaseMapperPlus<Location, LocationVo> {
|
||||
@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<Location, LocationVo> {
|
||||
" RankedData\n" +
|
||||
"WHERE\n" +
|
||||
" 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);
|
||||
}
|
||||
|
||||
@ -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<Device>{
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@ -73,5 +73,5 @@ public interface ILocationService extends IService<Location>{
|
||||
|
||||
List<LocationVo> getLargerScreenList(LocationBo bo);
|
||||
|
||||
List<DeviceVo> getUserListByProjectId(Long projectId, LocalDateTime startOfDay, LocalDateTime now);
|
||||
List<LocationVo> getUserListByProjectId(Long projectId, LocalDateTime startOfDay, LocalDateTime now);
|
||||
}
|
||||
|
||||
@ -255,7 +255,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
|
||||
@ -156,7 +156,7 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user