修改无人机状态
This commit is contained in:
parent
1ea9422f40
commit
35c0cf0c63
|
|
@ -7,7 +7,6 @@ import com.ruoyi.device.api.domain.DockDetailVO;
|
||||||
import com.ruoyi.device.api.domain.DockVO;
|
import com.ruoyi.device.api.domain.DockVO;
|
||||||
import com.ruoyi.device.service.api.IDockService;
|
import com.ruoyi.device.service.api.IDockService;
|
||||||
import com.ruoyi.device.service.api.IBufferDeviceService;
|
import com.ruoyi.device.service.api.IBufferDeviceService;
|
||||||
import com.ruoyi.device.controller.convert.DockDetailVOConvert;
|
|
||||||
import com.ruoyi.device.service.dto.DockDetailDTO;
|
import com.ruoyi.device.service.dto.DockDetailDTO;
|
||||||
import com.ruoyi.device.service.dto.DockDTO;
|
import com.ruoyi.device.service.dto.DockDTO;
|
||||||
import com.ruoyi.device.controller.convert.DockVOConvert;
|
import com.ruoyi.device.controller.convert.DockVOConvert;
|
||||||
|
|
@ -58,8 +57,7 @@ public class DockController extends BaseController
|
||||||
@GetMapping("/detail/{dockId}")
|
@GetMapping("/detail/{dockId}")
|
||||||
public R<DockDetailVO> getDockDetail(@PathVariable("dockId") Long dockId)
|
public R<DockDetailVO> getDockDetail(@PathVariable("dockId") Long dockId)
|
||||||
{
|
{
|
||||||
DockDetailDTO dto = bufferDeviceService.getDockDetailById(dockId);
|
|
||||||
DockDetailVO vo = DockDetailVOConvert.from(dto);
|
return R.ok(null);
|
||||||
return R.ok(vo);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,88 +0,0 @@
|
||||||
package com.ruoyi.device.controller.convert;
|
|
||||||
|
|
||||||
import com.ruoyi.common.core.utils.BaseConvert;
|
|
||||||
import com.ruoyi.device.api.domain.DockDetailVO;
|
|
||||||
import com.ruoyi.device.service.dto.DockDetailDTO;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备缓冲服务转换类
|
|
||||||
* 用于 DTO 到 VO 的转换
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
* @date 2026-01-20
|
|
||||||
*/
|
|
||||||
public class DockDetailVOConvert extends BaseConvert<DockDetailDTO, DockDetailVO>
|
|
||||||
{
|
|
||||||
|
|
||||||
private static final DockDetailVOConvert INSTANCE = new DockDetailVOConvert();
|
|
||||||
|
|
||||||
private DockDetailVOConvert() {
|
|
||||||
super(DockDetailDTO.class, DockDetailVO.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static DockDetailVO from(DockDetailDTO dto)
|
|
||||||
{
|
|
||||||
if (dto == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
DockDetailVO vo = new DockDetailVO();
|
|
||||||
|
|
||||||
vo.setDockId(dto.getDockId());
|
|
||||||
vo.setDockName(dto.getDockName());
|
|
||||||
vo.setManufacturerName(dto.getManufacturerName());
|
|
||||||
vo.setFirmwareVersion(dto.getFirmwareVersion());
|
|
||||||
vo.setSnNumber(dto.getSnNumber());
|
|
||||||
vo.setBindTime(dto.getBindTime());
|
|
||||||
vo.setMaintenanceDays(dto.getMaintenanceDays());
|
|
||||||
vo.setDockName(dto.getDockName());
|
|
||||||
vo.setDockStatus(dto.getDockStatus());
|
|
||||||
vo.setBackupLongitude(dto.getBackupLongitude());
|
|
||||||
vo.setBackupLatitude(dto.getBackupLatitude());
|
|
||||||
vo.setRunningDuration(dto.getRunningDuration());
|
|
||||||
vo.setMissionCount(dto.getMissionCount());
|
|
||||||
vo.setWindSpeed(dto.getWindSpeed());
|
|
||||||
vo.setRainfall(dto.getRainfall());
|
|
||||||
vo.setEnvironmentTemperature(dto.getEnvironmentTemperature());
|
|
||||||
vo.setEnvironmentHumidity(dto.getEnvironmentHumidity());
|
|
||||||
vo.setNetworkType(dto.getNetworkType());
|
|
||||||
vo.setNetworkDelay(dto.getNetworkDelay());
|
|
||||||
vo.setAirConditionerStatus(dto.getAirConditionerStatus());
|
|
||||||
vo.setCabinDoorStatus(dto.getCabinDoorStatus());
|
|
||||||
vo.setDockRunStatus(dto.getDockRunStatus());
|
|
||||||
vo.setInternalCamera(dto.getInternalCamera());
|
|
||||||
vo.setExternalCamera(dto.getExternalCamera());
|
|
||||||
vo.setChargingStatus(dto.getChargingStatus());
|
|
||||||
vo.setCabinTemperature(dto.getCabinTemperature());
|
|
||||||
vo.setCabinHumidity(dto.getCabinHumidity());
|
|
||||||
vo.setElevatorPosition(dto.getElevatorPosition());
|
|
||||||
vo.setXAxisClampStatus(dto.getXAxisClampStatus());
|
|
||||||
vo.setYAxisClampStatus(dto.getYAxisClampStatus());
|
|
||||||
|
|
||||||
return vo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static DockDetailDTO to(DockDetailVO vo)
|
|
||||||
{
|
|
||||||
return INSTANCE.innerTo(vo);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<DockDetailVO> fromList(List<DockDetailDTO> dtoList)
|
|
||||||
{
|
|
||||||
if (dtoList == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return dtoList.stream().map(DockDetailVOConvert::from).collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<DockDetailDTO> toList(List<DockDetailVO> voList)
|
|
||||||
{
|
|
||||||
return INSTANCE.innerToList(voList);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -7,7 +7,7 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 无人机详情DTO对象
|
* 无人机详情DTO对象
|
||||||
* 包含 AircraftVO 和 AircraftDetailVO 的所有字段
|
* 字段与 AircraftDetailVO 保持一致(包含 AircraftVO 的所有字段)
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
* @date 2026-01-20
|
* @date 2026-01-20
|
||||||
|
|
@ -40,10 +40,9 @@ public class AircraftDetailDTO implements Serializable
|
||||||
/** 挂载列表 */
|
/** 挂载列表 */
|
||||||
private List<PayloadDTO> payloadList;
|
private List<PayloadDTO> payloadList;
|
||||||
|
|
||||||
// ========== AircraftDetailVO 字段 ==========
|
// ========== AircraftDetailVO 特有字段 ==========
|
||||||
|
|
||||||
|
|
||||||
/** 厂商名称 */
|
|
||||||
private String manufacturerName;
|
|
||||||
|
|
||||||
/** 无人机版本 */
|
/** 无人机版本 */
|
||||||
private String aircraftVersion;
|
private String aircraftVersion;
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 机场详情DTO对象
|
* 机场详情DTO对象
|
||||||
* 包含 DockVO 和 DockDetailVO 的所有字段
|
* 字段与 DockDetailVO 保持一致(包含 DockVO 的所有字段)
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
* @date 2026-01-20
|
* @date 2026-01-20
|
||||||
|
|
@ -63,8 +63,7 @@ public class DockDetailDTO implements Serializable
|
||||||
/** 挂载列表 */
|
/** 挂载列表 */
|
||||||
private List<PayloadVO> payloadList;
|
private List<PayloadVO> payloadList;
|
||||||
|
|
||||||
// ========== DetailVO 字段 ==========
|
// ========== DockDetailVO 特有字段 ==========
|
||||||
|
|
||||||
|
|
||||||
/** 固件版本 */
|
/** 固件版本 */
|
||||||
private String firmwareVersion;
|
private String firmwareVersion;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue