完善接口内容
This commit is contained in:
parent
2bc461334c
commit
4c21f59b71
|
|
@ -1,4 +1,30 @@
|
||||||
package com.ruoyi.device.service.api;
|
package com.ruoyi.device.service.api;
|
||||||
|
|
||||||
public interface IBufferDeviceService {
|
import com.ruoyi.device.service.dto.AircraftDetailDTO;
|
||||||
|
import com.ruoyi.device.service.dto.DockDetailDTO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备缓冲服务接口
|
||||||
|
* 整合数据库数据和ThingsBoard数据
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2026-01-20
|
||||||
|
*/
|
||||||
|
public interface IBufferDeviceService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 通过ID获取机场详情
|
||||||
|
*
|
||||||
|
* @param dockId 机场ID
|
||||||
|
* @return 机场详情DTO
|
||||||
|
*/
|
||||||
|
DockDetailDTO getDockDetailById(Long dockId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过ID获取无人机详情
|
||||||
|
*
|
||||||
|
* @param aircraftId 无人机ID
|
||||||
|
* @return 无人机详情DTO
|
||||||
|
*/
|
||||||
|
AircraftDetailDTO getAircraftDetailById(Long aircraftId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,363 @@
|
||||||
|
package com.ruoyi.device.service.dto;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无人机详情DTO对象
|
||||||
|
* 包含 AircraftVO 和 AircraftDetailVO 的所有字段
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2026-01-20
|
||||||
|
*/
|
||||||
|
public class AircraftDetailDTO implements Serializable
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
// ========== AircraftVO 字段 ==========
|
||||||
|
|
||||||
|
/** 无人机ID */
|
||||||
|
private Long aircraftId;
|
||||||
|
|
||||||
|
/** 无人机IOT ID */
|
||||||
|
private String aircraftIotId;
|
||||||
|
|
||||||
|
/** 无人机名称 */
|
||||||
|
private String aircraftName;
|
||||||
|
|
||||||
|
/** 无人机厂商 */
|
||||||
|
private String aircraftManufacturer;
|
||||||
|
|
||||||
|
/** 无人机型号 */
|
||||||
|
private String aircraftModel;
|
||||||
|
|
||||||
|
/** 无人机状态 */
|
||||||
|
private String aircraftStatus;
|
||||||
|
|
||||||
|
/** 挂载列表 */
|
||||||
|
private List<PayloadDTO> payloadList;
|
||||||
|
|
||||||
|
// ========== AircraftDetailVO 字段 ==========
|
||||||
|
|
||||||
|
/** 厂商名称 */
|
||||||
|
private String manufacturerName;
|
||||||
|
|
||||||
|
/** 无人机版本 */
|
||||||
|
private String aircraftVersion;
|
||||||
|
|
||||||
|
/** 无人机SN号 */
|
||||||
|
private String snNumber;
|
||||||
|
|
||||||
|
/** 电池SN号 */
|
||||||
|
private String batterySn;
|
||||||
|
|
||||||
|
/** 绑定时间 */
|
||||||
|
private Long bindTime;
|
||||||
|
|
||||||
|
/** 运维剩余天数 */
|
||||||
|
private Integer maintenanceDays;
|
||||||
|
|
||||||
|
/** 飞行时长 */
|
||||||
|
private Integer flightDuration;
|
||||||
|
|
||||||
|
/** 作业架次 */
|
||||||
|
private Integer missionCount;
|
||||||
|
|
||||||
|
/** 网络列表 */
|
||||||
|
private List<NetworkDTO> networkList;
|
||||||
|
|
||||||
|
/** RTK信号 */
|
||||||
|
private Double rtkSignal;
|
||||||
|
|
||||||
|
/** 限高 */
|
||||||
|
private Integer maxAltitude;
|
||||||
|
|
||||||
|
/** 限远 */
|
||||||
|
private Integer maxDistance;
|
||||||
|
|
||||||
|
/** 电压 */
|
||||||
|
private Double voltage;
|
||||||
|
|
||||||
|
/** 电量 */
|
||||||
|
private Integer batteryLevel;
|
||||||
|
|
||||||
|
/** 续航 */
|
||||||
|
private Double flightTimeRemaining;
|
||||||
|
|
||||||
|
/** 电池温度 */
|
||||||
|
private Double batteryTemperature;
|
||||||
|
|
||||||
|
/** 循环次数 */
|
||||||
|
private Integer cycleCount;
|
||||||
|
|
||||||
|
public Long getAircraftId()
|
||||||
|
{
|
||||||
|
return aircraftId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAircraftId(Long aircraftId)
|
||||||
|
{
|
||||||
|
this.aircraftId = aircraftId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAircraftIotId()
|
||||||
|
{
|
||||||
|
return aircraftIotId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAircraftIotId(String aircraftIotId)
|
||||||
|
{
|
||||||
|
this.aircraftIotId = aircraftIotId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAircraftName()
|
||||||
|
{
|
||||||
|
return aircraftName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAircraftName(String aircraftName)
|
||||||
|
{
|
||||||
|
this.aircraftName = aircraftName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAircraftManufacturer()
|
||||||
|
{
|
||||||
|
return aircraftManufacturer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAircraftManufacturer(String aircraftManufacturer)
|
||||||
|
{
|
||||||
|
this.aircraftManufacturer = aircraftManufacturer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAircraftModel()
|
||||||
|
{
|
||||||
|
return aircraftModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAircraftModel(String aircraftModel)
|
||||||
|
{
|
||||||
|
this.aircraftModel = aircraftModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAircraftStatus()
|
||||||
|
{
|
||||||
|
return aircraftStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAircraftStatus(String aircraftStatus)
|
||||||
|
{
|
||||||
|
this.aircraftStatus = aircraftStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<PayloadDTO> getPayloadList()
|
||||||
|
{
|
||||||
|
return payloadList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPayloadList(List<PayloadDTO> payloadList)
|
||||||
|
{
|
||||||
|
this.payloadList = payloadList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getManufacturerName()
|
||||||
|
{
|
||||||
|
return manufacturerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setManufacturerName(String manufacturerName)
|
||||||
|
{
|
||||||
|
this.manufacturerName = manufacturerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAircraftVersion()
|
||||||
|
{
|
||||||
|
return aircraftVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAircraftVersion(String aircraftVersion)
|
||||||
|
{
|
||||||
|
this.aircraftVersion = aircraftVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSnNumber()
|
||||||
|
{
|
||||||
|
return snNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSnNumber(String snNumber)
|
||||||
|
{
|
||||||
|
this.snNumber = snNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBatterySn()
|
||||||
|
{
|
||||||
|
return batterySn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBatterySn(String batterySn)
|
||||||
|
{
|
||||||
|
this.batterySn = batterySn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getBindTime()
|
||||||
|
{
|
||||||
|
return bindTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBindTime(Long bindTime)
|
||||||
|
{
|
||||||
|
this.bindTime = bindTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getMaintenanceDays()
|
||||||
|
{
|
||||||
|
return maintenanceDays;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaintenanceDays(Integer maintenanceDays)
|
||||||
|
{
|
||||||
|
this.maintenanceDays = maintenanceDays;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getFlightDuration()
|
||||||
|
{
|
||||||
|
return flightDuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlightDuration(Integer flightDuration)
|
||||||
|
{
|
||||||
|
this.flightDuration = flightDuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getMissionCount()
|
||||||
|
{
|
||||||
|
return missionCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMissionCount(Integer missionCount)
|
||||||
|
{
|
||||||
|
this.missionCount = missionCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<NetworkDTO> getNetworkList()
|
||||||
|
{
|
||||||
|
return networkList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNetworkList(List<NetworkDTO> networkList)
|
||||||
|
{
|
||||||
|
this.networkList = networkList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getRtkSignal()
|
||||||
|
{
|
||||||
|
return rtkSignal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRtkSignal(Double rtkSignal)
|
||||||
|
{
|
||||||
|
this.rtkSignal = rtkSignal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getMaxAltitude()
|
||||||
|
{
|
||||||
|
return maxAltitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxAltitude(Integer maxAltitude)
|
||||||
|
{
|
||||||
|
this.maxAltitude = maxAltitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getMaxDistance()
|
||||||
|
{
|
||||||
|
return maxDistance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxDistance(Integer maxDistance)
|
||||||
|
{
|
||||||
|
this.maxDistance = maxDistance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getVoltage()
|
||||||
|
{
|
||||||
|
return voltage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVoltage(Double voltage)
|
||||||
|
{
|
||||||
|
this.voltage = voltage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getBatteryLevel()
|
||||||
|
{
|
||||||
|
return batteryLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBatteryLevel(Integer batteryLevel)
|
||||||
|
{
|
||||||
|
this.batteryLevel = batteryLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getFlightTimeRemaining()
|
||||||
|
{
|
||||||
|
return flightTimeRemaining;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlightTimeRemaining(Double flightTimeRemaining)
|
||||||
|
{
|
||||||
|
this.flightTimeRemaining = flightTimeRemaining;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getBatteryTemperature()
|
||||||
|
{
|
||||||
|
return batteryTemperature;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBatteryTemperature(Double batteryTemperature)
|
||||||
|
{
|
||||||
|
this.batteryTemperature = batteryTemperature;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getCycleCount()
|
||||||
|
{
|
||||||
|
return cycleCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCycleCount(Integer cycleCount)
|
||||||
|
{
|
||||||
|
this.cycleCount = cycleCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
return "AircraftDetailDTO{" +
|
||||||
|
"aircraftId=" + aircraftId +
|
||||||
|
", aircraftIotId='" + aircraftIotId + '\'' +
|
||||||
|
", aircraftName='" + aircraftName + '\'' +
|
||||||
|
", aircraftManufacturer='" + aircraftManufacturer + '\'' +
|
||||||
|
", aircraftModel='" + aircraftModel + '\'' +
|
||||||
|
", aircraftStatus='" + aircraftStatus + '\'' +
|
||||||
|
", payloadList=" + payloadList +
|
||||||
|
", manufacturerName='" + manufacturerName + '\'' +
|
||||||
|
", aircraftVersion='" + aircraftVersion + '\'' +
|
||||||
|
", snNumber='" + snNumber + '\'' +
|
||||||
|
", batterySn='" + batterySn + '\'' +
|
||||||
|
", bindTime=" + bindTime +
|
||||||
|
", maintenanceDays=" + maintenanceDays +
|
||||||
|
", flightDuration=" + flightDuration +
|
||||||
|
", missionCount=" + missionCount +
|
||||||
|
", networkList=" + networkList +
|
||||||
|
", rtkSignal=" + rtkSignal +
|
||||||
|
", maxAltitude=" + maxAltitude +
|
||||||
|
", maxDistance=" + maxDistance +
|
||||||
|
", voltage=" + voltage +
|
||||||
|
", batteryLevel=" + batteryLevel +
|
||||||
|
", flightTimeRemaining=" + flightTimeRemaining +
|
||||||
|
", batteryTemperature=" + batteryTemperature +
|
||||||
|
", cycleCount=" + cycleCount +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,502 @@
|
||||||
|
package com.ruoyi.device.service.dto;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机场详情DTO对象
|
||||||
|
* 包含 DockVO 和 DockDetailVO 的所有字段
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2026-01-20
|
||||||
|
*/
|
||||||
|
public class DockDetailDTO implements Serializable
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
// ========== DockVO 字段 ==========
|
||||||
|
|
||||||
|
/** 机场ID */
|
||||||
|
private Long dockId;
|
||||||
|
|
||||||
|
/** 机场IOT ID */
|
||||||
|
private String dockIotId;
|
||||||
|
|
||||||
|
/** 机场名称 */
|
||||||
|
private String dockName;
|
||||||
|
|
||||||
|
/** 机场位置 */
|
||||||
|
private String dockLocation;
|
||||||
|
|
||||||
|
/** 机场厂商 */
|
||||||
|
private String dockManufacturer;
|
||||||
|
|
||||||
|
/** 机场型号 */
|
||||||
|
private String dockModel;
|
||||||
|
|
||||||
|
/** 机场状态 */
|
||||||
|
private String dockStatus;
|
||||||
|
|
||||||
|
/** 无人机信息 */
|
||||||
|
private AircraftDTO aircraft;
|
||||||
|
|
||||||
|
// ========== DockDetailVO 字段 ==========
|
||||||
|
|
||||||
|
/** 厂商名称 */
|
||||||
|
private String manufacturerName;
|
||||||
|
|
||||||
|
/** 固件版本 */
|
||||||
|
private String firmwareVersion;
|
||||||
|
|
||||||
|
/** SN号 */
|
||||||
|
private String snNumber;
|
||||||
|
|
||||||
|
/** 绑定时间 */
|
||||||
|
private Long bindTime;
|
||||||
|
|
||||||
|
/** 运维剩余天数 */
|
||||||
|
private Integer maintenanceDays;
|
||||||
|
|
||||||
|
/** 备降点坐标(经度) */
|
||||||
|
private Double backupLongitude;
|
||||||
|
|
||||||
|
/** 备降点坐标(纬度) */
|
||||||
|
private Double backupLatitude;
|
||||||
|
|
||||||
|
/** 运行时长 */
|
||||||
|
private Integer runningDuration;
|
||||||
|
|
||||||
|
/** 作业架次 */
|
||||||
|
private Integer missionCount;
|
||||||
|
|
||||||
|
/** 环境风速 */
|
||||||
|
private Double windSpeed;
|
||||||
|
|
||||||
|
/** 环境雨量 */
|
||||||
|
private Double rainfall;
|
||||||
|
|
||||||
|
/** 环境温度 */
|
||||||
|
private Double environmentTemperature;
|
||||||
|
|
||||||
|
/** 环境湿度 */
|
||||||
|
private Double environmentHumidity;
|
||||||
|
|
||||||
|
/** 网络类型 */
|
||||||
|
private String networkType;
|
||||||
|
|
||||||
|
/** 网络延迟 */
|
||||||
|
private Integer networkDelay;
|
||||||
|
|
||||||
|
/** 空调状态 */
|
||||||
|
private String airConditionerStatus;
|
||||||
|
|
||||||
|
/** 舱门状态 */
|
||||||
|
private String cabinDoorStatus;
|
||||||
|
|
||||||
|
/** 机场运行状态 */
|
||||||
|
private String dockRunStatus;
|
||||||
|
|
||||||
|
/** 舱内摄像头 */
|
||||||
|
private String internalCamera;
|
||||||
|
|
||||||
|
/** 舱外摄像头 */
|
||||||
|
private String externalCamera;
|
||||||
|
|
||||||
|
/** 充放电状态 */
|
||||||
|
private String chargingStatus;
|
||||||
|
|
||||||
|
/** 舱内温度 */
|
||||||
|
private Double cabinTemperature;
|
||||||
|
|
||||||
|
/** 舱内湿度 */
|
||||||
|
private Double cabinHumidity;
|
||||||
|
|
||||||
|
/** 升降架位置 */
|
||||||
|
private String elevatorPosition;
|
||||||
|
|
||||||
|
/** X轴夹状态 */
|
||||||
|
private String xAxisClampStatus;
|
||||||
|
|
||||||
|
/** Y轴夹状态 */
|
||||||
|
private String yAxisClampStatus;
|
||||||
|
|
||||||
|
public Long getDockId()
|
||||||
|
{
|
||||||
|
return dockId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDockId(Long dockId)
|
||||||
|
{
|
||||||
|
this.dockId = dockId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDockIotId()
|
||||||
|
{
|
||||||
|
return dockIotId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDockIotId(String dockIotId)
|
||||||
|
{
|
||||||
|
this.dockIotId = dockIotId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDockName()
|
||||||
|
{
|
||||||
|
return dockName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDockName(String dockName)
|
||||||
|
{
|
||||||
|
this.dockName = dockName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDockLocation()
|
||||||
|
{
|
||||||
|
return dockLocation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDockLocation(String dockLocation)
|
||||||
|
{
|
||||||
|
this.dockLocation = dockLocation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDockManufacturer()
|
||||||
|
{
|
||||||
|
return dockManufacturer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDockManufacturer(String dockManufacturer)
|
||||||
|
{
|
||||||
|
this.dockManufacturer = dockManufacturer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDockModel()
|
||||||
|
{
|
||||||
|
return dockModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDockModel(String dockModel)
|
||||||
|
{
|
||||||
|
this.dockModel = dockModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDockStatus()
|
||||||
|
{
|
||||||
|
return dockStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDockStatus(String dockStatus)
|
||||||
|
{
|
||||||
|
this.dockStatus = dockStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AircraftDTO getAircraft()
|
||||||
|
{
|
||||||
|
return aircraft;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAircraft(AircraftDTO aircraft)
|
||||||
|
{
|
||||||
|
this.aircraft = aircraft;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getManufacturerName()
|
||||||
|
{
|
||||||
|
return manufacturerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setManufacturerName(String manufacturerName)
|
||||||
|
{
|
||||||
|
this.manufacturerName = manufacturerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFirmwareVersion()
|
||||||
|
{
|
||||||
|
return firmwareVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFirmwareVersion(String firmwareVersion)
|
||||||
|
{
|
||||||
|
this.firmwareVersion = firmwareVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSnNumber()
|
||||||
|
{
|
||||||
|
return snNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSnNumber(String snNumber)
|
||||||
|
{
|
||||||
|
this.snNumber = snNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getBindTime()
|
||||||
|
{
|
||||||
|
return bindTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBindTime(Long bindTime)
|
||||||
|
{
|
||||||
|
this.bindTime = bindTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getMaintenanceDays()
|
||||||
|
{
|
||||||
|
return maintenanceDays;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaintenanceDays(Integer maintenanceDays)
|
||||||
|
{
|
||||||
|
this.maintenanceDays = maintenanceDays;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getBackupLongitude()
|
||||||
|
{
|
||||||
|
return backupLongitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBackupLongitude(Double backupLongitude)
|
||||||
|
{
|
||||||
|
this.backupLongitude = backupLongitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getBackupLatitude()
|
||||||
|
{
|
||||||
|
return backupLatitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBackupLatitude(Double backupLatitude)
|
||||||
|
{
|
||||||
|
this.backupLatitude = backupLatitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRunningDuration()
|
||||||
|
{
|
||||||
|
return runningDuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRunningDuration(Integer runningDuration)
|
||||||
|
{
|
||||||
|
this.runningDuration = runningDuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getMissionCount()
|
||||||
|
{
|
||||||
|
return missionCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMissionCount(Integer missionCount)
|
||||||
|
{
|
||||||
|
this.missionCount = missionCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getWindSpeed()
|
||||||
|
{
|
||||||
|
return windSpeed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWindSpeed(Double windSpeed)
|
||||||
|
{
|
||||||
|
this.windSpeed = windSpeed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getRainfall()
|
||||||
|
{
|
||||||
|
return rainfall;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRainfall(Double rainfall)
|
||||||
|
{
|
||||||
|
this.rainfall = rainfall;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getEnvironmentTemperature()
|
||||||
|
{
|
||||||
|
return environmentTemperature;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnvironmentTemperature(Double environmentTemperature)
|
||||||
|
{
|
||||||
|
this.environmentTemperature = environmentTemperature;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getEnvironmentHumidity()
|
||||||
|
{
|
||||||
|
return environmentHumidity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnvironmentHumidity(Double environmentHumidity)
|
||||||
|
{
|
||||||
|
this.environmentHumidity = environmentHumidity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNetworkType()
|
||||||
|
{
|
||||||
|
return networkType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNetworkType(String networkType)
|
||||||
|
{
|
||||||
|
this.networkType = networkType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNetworkDelay()
|
||||||
|
{
|
||||||
|
return networkDelay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNetworkDelay(Integer networkDelay)
|
||||||
|
{
|
||||||
|
this.networkDelay = networkDelay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAirConditionerStatus()
|
||||||
|
{
|
||||||
|
return airConditionerStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAirConditionerStatus(String airConditionerStatus)
|
||||||
|
{
|
||||||
|
this.airConditionerStatus = airConditionerStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCabinDoorStatus()
|
||||||
|
{
|
||||||
|
return cabinDoorStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCabinDoorStatus(String cabinDoorStatus)
|
||||||
|
{
|
||||||
|
this.cabinDoorStatus = cabinDoorStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDockRunStatus()
|
||||||
|
{
|
||||||
|
return dockRunStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDockRunStatus(String dockRunStatus)
|
||||||
|
{
|
||||||
|
this.dockRunStatus = dockRunStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInternalCamera()
|
||||||
|
{
|
||||||
|
return internalCamera;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInternalCamera(String internalCamera)
|
||||||
|
{
|
||||||
|
this.internalCamera = internalCamera;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExternalCamera()
|
||||||
|
{
|
||||||
|
return externalCamera;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExternalCamera(String externalCamera)
|
||||||
|
{
|
||||||
|
this.externalCamera = externalCamera;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getChargingStatus()
|
||||||
|
{
|
||||||
|
return chargingStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChargingStatus(String chargingStatus)
|
||||||
|
{
|
||||||
|
this.chargingStatus = chargingStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getCabinTemperature()
|
||||||
|
{
|
||||||
|
return cabinTemperature;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCabinTemperature(Double cabinTemperature)
|
||||||
|
{
|
||||||
|
this.cabinTemperature = cabinTemperature;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getCabinHumidity()
|
||||||
|
{
|
||||||
|
return cabinHumidity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCabinHumidity(Double cabinHumidity)
|
||||||
|
{
|
||||||
|
this.cabinHumidity = cabinHumidity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getElevatorPosition()
|
||||||
|
{
|
||||||
|
return elevatorPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setElevatorPosition(String elevatorPosition)
|
||||||
|
{
|
||||||
|
this.elevatorPosition = elevatorPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getXAxisClampStatus()
|
||||||
|
{
|
||||||
|
return xAxisClampStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setXAxisClampStatus(String xAxisClampStatus)
|
||||||
|
{
|
||||||
|
this.xAxisClampStatus = xAxisClampStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getYAxisClampStatus()
|
||||||
|
{
|
||||||
|
return yAxisClampStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setYAxisClampStatus(String yAxisClampStatus)
|
||||||
|
{
|
||||||
|
this.yAxisClampStatus = yAxisClampStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
return "DockDetailDTO{" +
|
||||||
|
"dockId=" + dockId +
|
||||||
|
", dockIotId='" + dockIotId + '\'' +
|
||||||
|
", dockName='" + dockName + '\'' +
|
||||||
|
", dockLocation='" + dockLocation + '\'' +
|
||||||
|
", dockManufacturer='" + dockManufacturer + '\'' +
|
||||||
|
", dockModel='" + dockModel + '\'' +
|
||||||
|
", dockStatus='" + dockStatus + '\'' +
|
||||||
|
", aircraft=" + aircraft +
|
||||||
|
", manufacturerName='" + manufacturerName + '\'' +
|
||||||
|
", firmwareVersion='" + firmwareVersion + '\'' +
|
||||||
|
", snNumber='" + snNumber + '\'' +
|
||||||
|
", bindTime=" + bindTime +
|
||||||
|
", maintenanceDays=" + maintenanceDays +
|
||||||
|
", backupLongitude=" + backupLongitude +
|
||||||
|
", backupLatitude=" + backupLatitude +
|
||||||
|
", runningDuration=" + runningDuration +
|
||||||
|
", missionCount=" + missionCount +
|
||||||
|
", windSpeed=" + windSpeed +
|
||||||
|
", rainfall=" + rainfall +
|
||||||
|
", environmentTemperature=" + environmentTemperature +
|
||||||
|
", environmentHumidity=" + environmentHumidity +
|
||||||
|
", networkType='" + networkType + '\'' +
|
||||||
|
", networkDelay=" + networkDelay +
|
||||||
|
", airConditionerStatus='" + airConditionerStatus + '\'' +
|
||||||
|
", cabinDoorStatus='" + cabinDoorStatus + '\'' +
|
||||||
|
", dockRunStatus='" + dockRunStatus + '\'' +
|
||||||
|
", internalCamera='" + internalCamera + '\'' +
|
||||||
|
", externalCamera='" + externalCamera + '\'' +
|
||||||
|
", chargingStatus='" + chargingStatus + '\'' +
|
||||||
|
", cabinTemperature=" + cabinTemperature +
|
||||||
|
", cabinHumidity=" + cabinHumidity +
|
||||||
|
", elevatorPosition='" + elevatorPosition + '\'' +
|
||||||
|
", xAxisClampStatus='" + xAxisClampStatus + '\'' +
|
||||||
|
", yAxisClampStatus='" + yAxisClampStatus + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,49 @@
|
||||||
|
package com.ruoyi.device.service.dto;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网络信息DTO对象
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2026-01-20
|
||||||
|
*/
|
||||||
|
public class NetworkDTO implements Serializable
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 网络类型 */
|
||||||
|
private String networkType;
|
||||||
|
|
||||||
|
/** 网络延迟 */
|
||||||
|
private Integer networkDelay;
|
||||||
|
|
||||||
|
public String getNetworkType()
|
||||||
|
{
|
||||||
|
return networkType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNetworkType(String networkType)
|
||||||
|
{
|
||||||
|
this.networkType = networkType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNetworkDelay()
|
||||||
|
{
|
||||||
|
return networkDelay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNetworkDelay(Integer networkDelay)
|
||||||
|
{
|
||||||
|
this.networkDelay = networkDelay;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
return "NetworkDTO{" +
|
||||||
|
"networkType='" + networkType + '\'' +
|
||||||
|
", networkDelay=" + networkDelay +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,13 +1,756 @@
|
||||||
package com.ruoyi.device.service.impl;
|
package com.ruoyi.device.service.impl;
|
||||||
|
|
||||||
import com.ruoyi.device.service.api.IAircraftService;
|
import com.ruoyi.device.domain.api.IDockDomain;
|
||||||
|
import com.ruoyi.device.domain.api.IAircraftDomain;
|
||||||
|
import com.ruoyi.device.domain.api.IThingsBoardDomain;
|
||||||
|
import com.ruoyi.device.domain.model.Dock;
|
||||||
|
import com.ruoyi.device.domain.model.Aircraft;
|
||||||
|
import com.ruoyi.device.domain.model.thingsboard.AttributeMap;
|
||||||
|
import com.ruoyi.device.domain.model.thingsboard.TelemetryMap;
|
||||||
|
import com.ruoyi.device.domain.model.thingsboard.TelemetryValue;
|
||||||
|
import com.ruoyi.device.domain.model.thingsboard.constants.DeviceAttributes;
|
||||||
|
import com.ruoyi.device.domain.model.thingsboard.constants.DeviceTelemetry;
|
||||||
|
import com.ruoyi.device.domain.model.thingsboard.attributes.battery.BatteryData;
|
||||||
|
import com.ruoyi.device.domain.model.thingsboard.attributes.psdk.PsdkDevice;
|
||||||
import com.ruoyi.device.service.api.IBufferDeviceService;
|
import com.ruoyi.device.service.api.IBufferDeviceService;
|
||||||
|
import com.ruoyi.device.service.dto.AircraftDTO;
|
||||||
|
import com.ruoyi.device.service.dto.DockDTO;
|
||||||
|
import com.ruoyi.device.service.dto.AircraftDetailDTO;
|
||||||
|
import com.ruoyi.device.service.dto.DockDetailDTO;
|
||||||
|
import com.ruoyi.device.service.dto.NetworkDTO;
|
||||||
|
import com.ruoyi.device.service.dto.PayloadDTO;
|
||||||
|
import com.ruoyi.device.service.convert.DockServiceConvert;
|
||||||
|
import com.ruoyi.device.service.convert.AircraftServiceConvert;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过ID查询机场的信息
|
* 设备缓冲服务实现
|
||||||
|
* 整合数据库数据和ThingsBoard数据
|
||||||
*
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2026-01-20
|
||||||
*/
|
*/
|
||||||
public class BufferDeviceImpl implements IBufferDeviceService {
|
@Service
|
||||||
|
public class BufferDeviceImpl implements IBufferDeviceService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IDockDomain dockDomain;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IAircraftDomain aircraftDomain;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IThingsBoardDomain thingsBoardDomain;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DockDetailDTO getDockDetailById(Long dockId)
|
||||||
|
{
|
||||||
|
Dock dock = dockDomain.selectDockByDockId(dockId);
|
||||||
|
if (dock == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
DockDTO dockDTO = DockServiceConvert.toDTO(dock);
|
||||||
|
|
||||||
|
DockDetailDTO result = new DockDetailDTO();
|
||||||
|
|
||||||
|
result.setDockId(dockDTO.getDockId());
|
||||||
|
result.setDockName(dockDTO.getDockName());
|
||||||
|
result.setDockLocation(dockDTO.getDockLocation());
|
||||||
|
|
||||||
|
ThingsBoardData thingsBoardData = getThingsBoardData("dock", null);
|
||||||
|
|
||||||
|
if (thingsBoardData != null)
|
||||||
|
{
|
||||||
|
result.setFirmwareVersion(thingsBoardData.getFirmwareVersion());
|
||||||
|
result.setSnNumber(thingsBoardData.getSnNumber());
|
||||||
|
result.setBindTime(thingsBoardData.getBindTime());
|
||||||
|
result.setMaintenanceDays(thingsBoardData.getMaintenanceDays());
|
||||||
|
result.setDockName(thingsBoardData.getDockName());
|
||||||
|
result.setDockStatus(thingsBoardData.getDockStatus());
|
||||||
|
result.setBackupLongitude(thingsBoardData.getBackupLongitude());
|
||||||
|
result.setBackupLatitude(thingsBoardData.getBackupLatitude());
|
||||||
|
result.setRunningDuration(thingsBoardData.getRunningDuration());
|
||||||
|
result.setMissionCount(thingsBoardData.getMissionCount());
|
||||||
|
result.setWindSpeed(thingsBoardData.getWindSpeed());
|
||||||
|
result.setRainfall(thingsBoardData.getRainfall());
|
||||||
|
result.setEnvironmentTemperature(thingsBoardData.getEnvironmentTemperature());
|
||||||
|
result.setEnvironmentHumidity(thingsBoardData.getEnvironmentHumidity());
|
||||||
|
result.setNetworkType(thingsBoardData.getNetworkType());
|
||||||
|
result.setNetworkDelay(thingsBoardData.getNetworkDelay());
|
||||||
|
result.setAirConditionerStatus(thingsBoardData.getAirConditionerStatus());
|
||||||
|
result.setCabinDoorStatus(thingsBoardData.getCabinDoorStatus());
|
||||||
|
result.setDockRunStatus(thingsBoardData.getDockRunStatus());
|
||||||
|
result.setInternalCamera(thingsBoardData.getInternalCamera());
|
||||||
|
result.setExternalCamera(thingsBoardData.getExternalCamera());
|
||||||
|
result.setChargingStatus(thingsBoardData.getChargingStatus());
|
||||||
|
result.setCabinTemperature(thingsBoardData.getCabinTemperature());
|
||||||
|
result.setCabinHumidity(thingsBoardData.getCabinHumidity());
|
||||||
|
result.setElevatorPosition(thingsBoardData.getElevatorPosition());
|
||||||
|
result.setXAxisClampStatus(thingsBoardData.getXAxisClampStatus());
|
||||||
|
result.setYAxisClampStatus(thingsBoardData.getYAxisClampStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AircraftDetailDTO getAircraftDetailById(Long aircraftId)
|
||||||
|
{
|
||||||
|
Aircraft aircraft = aircraftDomain.selectAircraftByAircraftId(aircraftId);
|
||||||
|
if (aircraft == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
AircraftDTO aircraftDTO = AircraftServiceConvert.toDTO(aircraft);
|
||||||
|
|
||||||
|
AircraftDetailDTO result = new AircraftDetailDTO();
|
||||||
|
|
||||||
|
result.setAircraftId(aircraftDTO.getAircraftId());
|
||||||
|
result.setAircraftName(aircraftDTO.getAircraftName());
|
||||||
|
|
||||||
|
ThingsBoardData thingsBoardData = getThingsBoardData("aircraft", null);
|
||||||
|
|
||||||
|
if (thingsBoardData != null)
|
||||||
|
{
|
||||||
|
result.setManufacturerName(thingsBoardData.getManufacturerName());
|
||||||
|
result.setAircraftVersion(thingsBoardData.getAircraftVersion());
|
||||||
|
result.setSnNumber(thingsBoardData.getSnNumber());
|
||||||
|
result.setBatterySn(thingsBoardData.getBatterySn());
|
||||||
|
result.setBindTime(thingsBoardData.getBindTime());
|
||||||
|
result.setMaintenanceDays(thingsBoardData.getMaintenanceDays());
|
||||||
|
result.setFlightDuration(thingsBoardData.getFlightDuration());
|
||||||
|
result.setMissionCount(thingsBoardData.getMissionCount());
|
||||||
|
result.setNetworkList(thingsBoardData.getNetworkList());
|
||||||
|
result.setRtkSignal(thingsBoardData.getRtkSignal());
|
||||||
|
result.setMaxAltitude(thingsBoardData.getMaxAltitude());
|
||||||
|
result.setMaxDistance(thingsBoardData.getMaxDistance());
|
||||||
|
result.setVoltage(thingsBoardData.getVoltage());
|
||||||
|
result.setBatteryLevel(thingsBoardData.getBatteryLevel());
|
||||||
|
result.setFlightTimeRemaining(thingsBoardData.getFlightTimeRemaining());
|
||||||
|
result.setBatteryTemperature(thingsBoardData.getBatteryTemperature());
|
||||||
|
result.setCycleCount(thingsBoardData.getCycleCount());
|
||||||
|
result.setPayloadList(thingsBoardData.getPayloadList());
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private ThingsBoardData getThingsBoardData(String deviceType, String deviceIotId)
|
||||||
|
{
|
||||||
|
ThingsBoardData data = new ThingsBoardData();
|
||||||
|
|
||||||
|
AttributeMap attributes = thingsBoardDomain.getPredefinedDeviceAttributes(deviceIotId);
|
||||||
|
if (attributes != null)
|
||||||
|
{
|
||||||
|
data.setFirmwareVersion(attributes.get(DeviceAttributes.Firmware_Version).orElse(null));
|
||||||
|
data.setSnNumber(attributes.get(DeviceAttributes.DOCK_SN).orElse(null));
|
||||||
|
data.setSubDeviceSn(attributes.get(DeviceAttributes.SUB_DEVICE_SN).orElse(null));
|
||||||
|
|
||||||
|
Integer modeCode = attributes.get(DeviceAttributes.MODE_CODE).orElse(null);
|
||||||
|
if (modeCode != null)
|
||||||
|
{
|
||||||
|
if ("dock".equals(deviceType))
|
||||||
|
{
|
||||||
|
data.setDockStatus(getDockStatus(modeCode));
|
||||||
|
}
|
||||||
|
else if ("aircraft".equals(deviceType))
|
||||||
|
{
|
||||||
|
data.setAircraftStatus(getAircraftStatus(modeCode));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TelemetryMap telemetry = thingsBoardDomain.getPredefinedDeviceTelemetry(deviceIotId);
|
||||||
|
if (telemetry != null)
|
||||||
|
{
|
||||||
|
data.setRunningDuration(telemetry.get(DeviceTelemetry.Acc_Time).map(TelemetryValue::getValue).orElse(null));
|
||||||
|
data.setMissionCount(telemetry.get(DeviceTelemetry.Total_Flight_Sorties).map(TelemetryValue::getValue).orElse(null));
|
||||||
|
data.setWindSpeed(telemetry.get(DeviceTelemetry.Wind_Speed).map(TelemetryValue::getValue).orElse(null));
|
||||||
|
// data.setRainfall(telemetry.get(DeviceTelemetry.Rainfall).map(TelemetryValue::getValue).orElse(null));
|
||||||
|
data.setEnvironmentTemperature(telemetry.get(DeviceTelemetry.TEMPERATURE).map(TelemetryValue::getValue).orElse(null));
|
||||||
|
data.setEnvironmentHumidity(telemetry.get(DeviceTelemetry.HUMIDITY).map(TelemetryValue::getValue).orElse(null));
|
||||||
|
|
||||||
|
Integer networkType = telemetry.get(DeviceTelemetry.Network_State_Type).map(TelemetryValue::getValue).orElse(null);
|
||||||
|
if (networkType != null)
|
||||||
|
{
|
||||||
|
data.setNetworkType(getNetworkType(networkType));
|
||||||
|
}
|
||||||
|
|
||||||
|
data.setCabinTemperature(telemetry.get(DeviceTelemetry.TEMPERATURE).map(TelemetryValue::getValue).orElse(null));
|
||||||
|
data.setCabinHumidity(telemetry.get(DeviceTelemetry.HUMIDITY).map(TelemetryValue::getValue).orElse(null));
|
||||||
|
data.setFlightDuration(telemetry.get(DeviceTelemetry.Acc_Time).map(TelemetryValue::getValue).orElse(null));
|
||||||
|
data.setRtkSignal(getRtkSignal(telemetry.get(DeviceTelemetry.Position_State_Rtk_Number).map(TelemetryValue::getValue).orElse(null)));
|
||||||
|
data.setMaxAltitude(telemetry.get(DeviceTelemetry.Height_Limit).map(TelemetryValue::getValue).orElse(null));
|
||||||
|
data.setMaxDistance(telemetry.get(DeviceTelemetry.Distance_Limit_Status_Distance_Limit).map(TelemetryValue::getValue).orElse(null));
|
||||||
|
|
||||||
|
BatteryData battery = telemetry.get(DeviceTelemetry.BATTERY).map(TelemetryValue::getValue).orElse(null);
|
||||||
|
if (battery != null)
|
||||||
|
{
|
||||||
|
data.setBatteryLevel(battery.getCapacityPercent());
|
||||||
|
data.setFlightTimeRemaining(battery.getRemainFlightTime() != null ? battery.getRemainFlightTime().doubleValue() : null);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<PsdkDevice> psdkDevices = telemetry.get(DeviceTelemetry.PSDK_WIDGET_VALUES).map(TelemetryValue::getValue).orElse(null);
|
||||||
|
if (psdkDevices != null)
|
||||||
|
{
|
||||||
|
List<PayloadDTO> payloadList = psdkDevices.stream()
|
||||||
|
.map(this::convertToPayloadDTO)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
data.setPayloadList(payloadList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getDockStatus(Integer modeCode)
|
||||||
|
{
|
||||||
|
if (modeCode == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String[] statusMap = {"空闲中", "现场调试", "远程调试", "固件升级中", "作业中", "待标定"};
|
||||||
|
if (modeCode >= 0 && modeCode < statusMap.length)
|
||||||
|
{
|
||||||
|
return statusMap[modeCode];
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getAircraftStatus(Integer modeCode)
|
||||||
|
{
|
||||||
|
if (modeCode == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String[] statusMap = {"待机", "起飞准备", "起飞准备完毕", "手动飞行", "自动起飞", "航线飞行",
|
||||||
|
"全景拍照", "智能跟随", "ADS-B 躲避", "自动返航", "自动降落", "强制降落",
|
||||||
|
"三桨叶降落", "升级中", "未连接", "APAS", "虚拟摇杆状态", "指令飞行",
|
||||||
|
"空中 RTK 收敛模式", "机场选址中", "POI环绕"};
|
||||||
|
if (modeCode >= 0 && modeCode < statusMap.length)
|
||||||
|
{
|
||||||
|
return statusMap[modeCode];
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getNetworkType(Integer networkType)
|
||||||
|
{
|
||||||
|
if (networkType == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (networkType == 1)
|
||||||
|
{
|
||||||
|
return "4G";
|
||||||
|
}
|
||||||
|
else if (networkType == 2)
|
||||||
|
{
|
||||||
|
return "以太网";
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Double getRtkSignal(Integer rtkNumber)
|
||||||
|
{
|
||||||
|
if (rtkNumber == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return rtkNumber.doubleValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
private PayloadDTO convertToPayloadDTO(PsdkDevice psdkDevice)
|
||||||
|
{
|
||||||
|
PayloadDTO dto = new PayloadDTO();
|
||||||
|
dto.setPayloadName(psdkDevice.getPsdk_name());
|
||||||
|
dto.setPayloadType(psdkDevice.getPsdk_lib_version());
|
||||||
|
// dto.setPayloadStatus(psdkDevice.getPsdk_version());
|
||||||
|
return dto;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class ThingsBoardData
|
||||||
|
{
|
||||||
|
private String firmwareVersion;
|
||||||
|
private String snNumber;
|
||||||
|
private String subDeviceSn;
|
||||||
|
private String dockName;
|
||||||
|
private String dockStatus;
|
||||||
|
private String aircraftStatus;
|
||||||
|
private Long bindTime;
|
||||||
|
private Integer maintenanceDays;
|
||||||
|
private Double backupLongitude;
|
||||||
|
private Double backupLatitude;
|
||||||
|
private Integer runningDuration;
|
||||||
|
private Integer missionCount;
|
||||||
|
private Double windSpeed;
|
||||||
|
private Double rainfall;
|
||||||
|
private Double environmentTemperature;
|
||||||
|
private Double environmentHumidity;
|
||||||
|
private String networkType;
|
||||||
|
private Integer networkDelay;
|
||||||
|
private String airConditionerStatus;
|
||||||
|
private String cabinDoorStatus;
|
||||||
|
private String dockRunStatus;
|
||||||
|
private String internalCamera;
|
||||||
|
private String externalCamera;
|
||||||
|
private String chargingStatus;
|
||||||
|
private Double cabinTemperature;
|
||||||
|
private Double cabinHumidity;
|
||||||
|
private String elevatorPosition;
|
||||||
|
private String xAxisClampStatus;
|
||||||
|
private String yAxisClampStatus;
|
||||||
|
private String manufacturerName;
|
||||||
|
private String aircraftVersion;
|
||||||
|
private String batterySn;
|
||||||
|
private Integer flightDuration;
|
||||||
|
private List<NetworkDTO> networkList;
|
||||||
|
private Double rtkSignal;
|
||||||
|
private Integer maxAltitude;
|
||||||
|
private Integer maxDistance;
|
||||||
|
private Double voltage;
|
||||||
|
private Integer batteryLevel;
|
||||||
|
private Double flightTimeRemaining;
|
||||||
|
private Double batteryTemperature;
|
||||||
|
private Integer cycleCount;
|
||||||
|
private List<PayloadDTO> payloadList;
|
||||||
|
|
||||||
|
public String getFirmwareVersion()
|
||||||
|
{
|
||||||
|
return firmwareVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFirmwareVersion(String firmwareVersion)
|
||||||
|
{
|
||||||
|
this.firmwareVersion = firmwareVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSnNumber()
|
||||||
|
{
|
||||||
|
return snNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSnNumber(String snNumber)
|
||||||
|
{
|
||||||
|
this.snNumber = snNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSubDeviceSn()
|
||||||
|
{
|
||||||
|
return subDeviceSn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubDeviceSn(String subDeviceSn)
|
||||||
|
{
|
||||||
|
this.subDeviceSn = subDeviceSn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDockName()
|
||||||
|
{
|
||||||
|
return dockName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDockName(String dockName)
|
||||||
|
{
|
||||||
|
this.dockName = dockName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDockStatus()
|
||||||
|
{
|
||||||
|
return dockStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDockStatus(String dockStatus)
|
||||||
|
{
|
||||||
|
this.dockStatus = dockStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAircraftStatus()
|
||||||
|
{
|
||||||
|
return aircraftStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAircraftStatus(String aircraftStatus)
|
||||||
|
{
|
||||||
|
this.aircraftStatus = aircraftStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getBindTime()
|
||||||
|
{
|
||||||
|
return bindTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBindTime(Long bindTime)
|
||||||
|
{
|
||||||
|
this.bindTime = bindTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getMaintenanceDays()
|
||||||
|
{
|
||||||
|
return maintenanceDays;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaintenanceDays(Integer maintenanceDays)
|
||||||
|
{
|
||||||
|
this.maintenanceDays = maintenanceDays;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getBackupLongitude()
|
||||||
|
{
|
||||||
|
return backupLongitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBackupLongitude(Double backupLongitude)
|
||||||
|
{
|
||||||
|
this.backupLongitude = backupLongitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getBackupLatitude()
|
||||||
|
{
|
||||||
|
return backupLatitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBackupLatitude(Double backupLatitude)
|
||||||
|
{
|
||||||
|
this.backupLatitude = backupLatitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRunningDuration()
|
||||||
|
{
|
||||||
|
return runningDuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRunningDuration(Integer runningDuration)
|
||||||
|
{
|
||||||
|
this.runningDuration = runningDuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getMissionCount()
|
||||||
|
{
|
||||||
|
return missionCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMissionCount(Integer missionCount)
|
||||||
|
{
|
||||||
|
this.missionCount = missionCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getWindSpeed()
|
||||||
|
{
|
||||||
|
return windSpeed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWindSpeed(Double windSpeed)
|
||||||
|
{
|
||||||
|
this.windSpeed = windSpeed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getRainfall()
|
||||||
|
{
|
||||||
|
return rainfall;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRainfall(Double rainfall)
|
||||||
|
{
|
||||||
|
this.rainfall = rainfall;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getEnvironmentTemperature()
|
||||||
|
{
|
||||||
|
return environmentTemperature;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnvironmentTemperature(Double environmentTemperature)
|
||||||
|
{
|
||||||
|
this.environmentTemperature = environmentTemperature;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getEnvironmentHumidity()
|
||||||
|
{
|
||||||
|
return environmentHumidity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnvironmentHumidity(Double environmentHumidity)
|
||||||
|
{
|
||||||
|
this.environmentHumidity = environmentHumidity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNetworkType()
|
||||||
|
{
|
||||||
|
return networkType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNetworkType(String networkType)
|
||||||
|
{
|
||||||
|
this.networkType = networkType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNetworkDelay()
|
||||||
|
{
|
||||||
|
return networkDelay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNetworkDelay(Integer networkDelay)
|
||||||
|
{
|
||||||
|
this.networkDelay = networkDelay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAirConditionerStatus()
|
||||||
|
{
|
||||||
|
return airConditionerStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAirConditionerStatus(String airConditionerStatus)
|
||||||
|
{
|
||||||
|
this.airConditionerStatus = airConditionerStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCabinDoorStatus()
|
||||||
|
{
|
||||||
|
return cabinDoorStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCabinDoorStatus(String cabinDoorStatus)
|
||||||
|
{
|
||||||
|
this.cabinDoorStatus = cabinDoorStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDockRunStatus()
|
||||||
|
{
|
||||||
|
return dockRunStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDockRunStatus(String dockRunStatus)
|
||||||
|
{
|
||||||
|
this.dockRunStatus = dockRunStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInternalCamera()
|
||||||
|
{
|
||||||
|
return internalCamera;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInternalCamera(String internalCamera)
|
||||||
|
{
|
||||||
|
this.internalCamera = internalCamera;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExternalCamera()
|
||||||
|
{
|
||||||
|
return externalCamera;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExternalCamera(String externalCamera)
|
||||||
|
{
|
||||||
|
this.externalCamera = externalCamera;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getChargingStatus()
|
||||||
|
{
|
||||||
|
return chargingStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChargingStatus(String chargingStatus)
|
||||||
|
{
|
||||||
|
this.chargingStatus = chargingStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getCabinTemperature()
|
||||||
|
{
|
||||||
|
return cabinTemperature;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCabinTemperature(Double cabinTemperature)
|
||||||
|
{
|
||||||
|
this.cabinTemperature = cabinTemperature;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getCabinHumidity()
|
||||||
|
{
|
||||||
|
return cabinHumidity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCabinHumidity(Double cabinHumidity)
|
||||||
|
{
|
||||||
|
this.cabinHumidity = cabinHumidity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getElevatorPosition()
|
||||||
|
{
|
||||||
|
return elevatorPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setElevatorPosition(String elevatorPosition)
|
||||||
|
{
|
||||||
|
this.elevatorPosition = elevatorPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getXAxisClampStatus()
|
||||||
|
{
|
||||||
|
return xAxisClampStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setXAxisClampStatus(String xAxisClampStatus)
|
||||||
|
{
|
||||||
|
this.xAxisClampStatus = xAxisClampStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getYAxisClampStatus()
|
||||||
|
{
|
||||||
|
return yAxisClampStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setYAxisClampStatus(String yAxisClampStatus)
|
||||||
|
{
|
||||||
|
this.yAxisClampStatus = yAxisClampStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getManufacturerName()
|
||||||
|
{
|
||||||
|
return manufacturerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setManufacturerName(String manufacturerName)
|
||||||
|
{
|
||||||
|
this.manufacturerName = manufacturerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAircraftVersion()
|
||||||
|
{
|
||||||
|
return aircraftVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAircraftVersion(String aircraftVersion)
|
||||||
|
{
|
||||||
|
this.aircraftVersion = aircraftVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBatterySn()
|
||||||
|
{
|
||||||
|
return batterySn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBatterySn(String batterySn)
|
||||||
|
{
|
||||||
|
this.batterySn = batterySn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getFlightDuration()
|
||||||
|
{
|
||||||
|
return flightDuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlightDuration(Integer flightDuration)
|
||||||
|
{
|
||||||
|
this.flightDuration = flightDuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<NetworkDTO> getNetworkList()
|
||||||
|
{
|
||||||
|
return networkList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNetworkList(List<NetworkDTO> networkList)
|
||||||
|
{
|
||||||
|
this.networkList = networkList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getRtkSignal()
|
||||||
|
{
|
||||||
|
return rtkSignal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRtkSignal(Double rtkSignal)
|
||||||
|
{
|
||||||
|
this.rtkSignal = rtkSignal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getMaxAltitude()
|
||||||
|
{
|
||||||
|
return maxAltitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxAltitude(Integer maxAltitude)
|
||||||
|
{
|
||||||
|
this.maxAltitude = maxAltitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getMaxDistance()
|
||||||
|
{
|
||||||
|
return maxDistance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxDistance(Integer maxDistance)
|
||||||
|
{
|
||||||
|
this.maxDistance = maxDistance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getVoltage()
|
||||||
|
{
|
||||||
|
return voltage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVoltage(Double voltage)
|
||||||
|
{
|
||||||
|
this.voltage = voltage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getBatteryLevel()
|
||||||
|
{
|
||||||
|
return batteryLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBatteryLevel(Integer batteryLevel)
|
||||||
|
{
|
||||||
|
this.batteryLevel = batteryLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getFlightTimeRemaining()
|
||||||
|
{
|
||||||
|
return flightTimeRemaining;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlightTimeRemaining(Double flightTimeRemaining)
|
||||||
|
{
|
||||||
|
this.flightTimeRemaining = flightTimeRemaining;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getBatteryTemperature()
|
||||||
|
{
|
||||||
|
return batteryTemperature;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBatteryTemperature(Double batteryTemperature)
|
||||||
|
{
|
||||||
|
this.batteryTemperature = batteryTemperature;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getCycleCount()
|
||||||
|
{
|
||||||
|
return cycleCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCycleCount(Integer cycleCount)
|
||||||
|
{
|
||||||
|
this.cycleCount = cycleCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<PayloadDTO> getPayloadList()
|
||||||
|
{
|
||||||
|
return payloadList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPayloadList(List<PayloadDTO> payloadList)
|
||||||
|
{
|
||||||
|
this.payloadList = payloadList;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue