drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/controller/GdManageDeviceController.java
@@ -31,6 +31,9 @@ import org.springframework.web.bind.annotation.*; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import org.sxkj.gd.common.GenericConverter; import org.sxkj.gd.common.IdParam; import org.sxkj.gd.workorder.dto.GdManageDeviceDTO; import org.sxkj.gd.workorder.entity.GdManageDeviceEntity; import org.sxkj.gd.workorder.vo.GdManageDeviceVO; import org.sxkj.gd.workorder.excel.GdManageDeviceExcel; @@ -65,8 +68,11 @@ @GetMapping("/detail") @ApiOperationSupport(order = 1) @ApiOperation(value = "详情", notes = "传入gdManageDevice") public R<GdManageDeviceVO> detail(GdManageDeviceEntity gdManageDevice) { GdManageDeviceEntity detail = gdManageDeviceService.getOne(Condition.getQueryWrapper(gdManageDevice)); public R<GdManageDeviceVO> detail(@Valid IdParam manageDevice) { GdManageDeviceEntity detail = gdManageDeviceService.getOne(Condition.getQueryWrapper(GenericConverter.convert(manageDevice, GdManageDeviceEntity.class))); if (detail == null) { return R.fail("该设备不存在"); } return R.data(GdManageDeviceWrapper.build().entityVO(detail)); } @@ -98,8 +104,8 @@ @PostMapping("/submit") @ApiOperationSupport(order = 6) @ApiOperation(value = "新增或修改", notes = "传入gdManageDevice") public R submit(@Valid @RequestBody GdManageDeviceEntity gdManageDevice) { return R.status(gdManageDeviceService.saveOrUpdate(gdManageDevice)); public R submit(@Valid @RequestBody GdManageDeviceDTO gdManageDevice) { return R.status(gdManageDeviceService.saveOrUpdate(GdManageDeviceWrapper.build().entityDTO(gdManageDevice))); } /** drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/dto/GdManageDeviceDTO.java
@@ -16,9 +16,16 @@ */ package org.sxkj.gd.workorder.dto; import org.sxkj.gd.workorder.entity.GdManageDeviceEntity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; /** * 设备信息 数据传输对象实体类 @@ -27,8 +34,89 @@ * @since 2026-01-14 */ @Data @EqualsAndHashCode(callSuper = true) public class GdManageDeviceDTO extends GdManageDeviceEntity { public class GdManageDeviceDTO implements Serializable { private static final long serialVersionUID = 1L; @ApiModelProperty("主键id") private Long id; /** * 设备编码 */ @ApiModelProperty(value = "设备编码") private String deviceSn; /** * 设备型号 */ @ApiModelProperty(value = "设备型号") private String deviceName; /** * 设备昵称 */ @ApiModelProperty(value = "设备昵称") private String nickname; /** * 设备类型(0机场,1无人机) */ @ApiModelProperty(value = "设备类型(0机场,1无人机)") private Integer deviceType; /** * 设备负载(红外,喇叭,闪光灯) */ @ApiModelProperty(value = "设备负载(红外,喇叭,闪光灯)") private String devicePayload; /** /** * 当前经度 */ @ApiModelProperty(value = "当前经度") private Double longitude; /** * 当前纬度 */ @ApiModelProperty(value = "当前纬度") private Double latitude; /** * 固件版本 */ @ApiModelProperty(value = "固件版本") private String firmwareVersion; /** * 子设备(一般用途是机场下面的无人机) */ @ApiModelProperty(value = "子设备(一般用途是机场下面的无人机)") private String childSn; /** * 设备状态:{0:"在线",1:"离线"} */ @ApiModelProperty(value = "设备状态:{0:\"在线\",1:\"离线\"}") private Long modeCode; /** * 保险过期时间 */ @ApiModelProperty(value = "保险过期时间yyyy-MM-dd HH:mm:ss") @DateTimeFormat( pattern = "yyyy-MM-dd HH:mm:ss" ) @JsonFormat( pattern = "yyyy-MM-dd HH:mm:ss" ) private Date insureExpiredTime; /** * 剩余流量(单位:GB) */ @ApiModelProperty(value = "剩余流量(单位:GB)") private BigDecimal trafficRemaining; /** * 流量到期时间 */ @ApiModelProperty(value = "流量到期时间yyyy-MM-dd HH:mm:ss") @DateTimeFormat( pattern = "yyyy-MM-dd HH:mm:ss" ) @JsonFormat( pattern = "yyyy-MM-dd HH:mm:ss" ) private Date trafficExpireTime; } drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/entity/GdManageDeviceEntity.java
@@ -34,44 +34,34 @@ */ @Data @TableName("ja_gd_manage_device") @ApiModel(value = "GdManageDevice对象", description = "设备信息") @ApiModel(value = "设备信息", description = "设备信息") @EqualsAndHashCode(callSuper = true) public class GdManageDeviceEntity extends BaseEntity { /** * dock, drone, remote control * 设备编码 */ @ApiModelProperty(value = "dock, drone, remote control") @ApiModelProperty(value = "设备编码") private String deviceSn; /** * model of the device. This parameter corresponds to the device name in the device dictionary table. * 设备型号 */ @ApiModelProperty(value = "model of the device. This parameter corresponds to the device name in the device dictionary table.") @ApiModelProperty(value = "设备型号") private String deviceName; /** * custom name of the device * 设备昵称 */ @ApiModelProperty(value = "custom name of the device") @ApiModelProperty(value = "设备昵称") private String nickname; /** * The workspace to which the current device belongs.如果为时间戳则表明该机场已被解绑 * 设备类型(0机场,1无人机) */ @ApiModelProperty(value = "The workspace to which the current device belongs.如果为时间戳则表明该机场已被解绑") private String workspaceId; /** * This parameter corresponds to the device type in the device dictionary table. */ @ApiModelProperty(value = "This parameter corresponds to the device type in the device dictionary table.") @ApiModelProperty(value = "设备类型(0机场,1无人机)") private Integer deviceType; /** * This parameter corresponds to the sub type in the device dictionary table. */ @ApiModelProperty(value = "This parameter corresponds to the sub type in the device dictionary table.") private Integer subType; /** * 设备负载(红外,喇叭,闪光灯) */ @ApiModelProperty(value = "设备负载(红外,喇叭,闪光灯)") @ApiModelProperty(value = "设备负载(红外,喇叭,闪光灯)") private String devicePayload; /** * 当前经度 @@ -84,130 +74,25 @@ @ApiModelProperty(value = "当前纬度") private Double latitude; /** * The account used when the device was bound. * 固件版本 */ @ApiModelProperty(value = "The account used when the device was bound.") private String userId; /** * This parameter corresponds to the domain in the device dictionary table. */ @ApiModelProperty(value = "This parameter corresponds to the domain in the device dictionary table.") private Integer domain; /** * firmware version of the device */ @ApiModelProperty(value = "firmware version of the device") @ApiModelProperty(value = "固件版本") private String firmwareVersion; /** * 1:一致;0:不一致;固件版本是否一致。 * 子设备(一般用途是机场下面的无人机) */ @ApiModelProperty(value = "1:一致;0:不一致;固件版本是否一致。") private Boolean compatibleStatus; /** * version of the protocol. This field is currently not useful. */ @ApiModelProperty(value = "version of the protocol. This field is currently not useful.") private String version; /** * Control of the drone, A control or B control. */ @ApiModelProperty(value = "Control of the drone, A control or B control.") private String deviceIndex; /** * The device controlled by the gateway. */ @ApiModelProperty(value = "The device controlled by the gateway.") @ApiModelProperty(value = "子设备(一般用途是机场下面的无人机)") private String childSn; /** * The time when the device is bound to the workspace. * 设备状态:{0:"在线",1:"离线"} */ @ApiModelProperty(value = "The time when the device is bound to the workspace.") private Long boundTime; /** * The status when the device is bound to the workspace. 1: bound; 0: not bound; */ @ApiModelProperty(value = "The status when the device is bound to the workspace. 1: bound; 0: not bound;") private Boolean boundStatus; /** * The time of the last device login. */ @ApiModelProperty(value = "The time of the last device login.") private Long loginTime; /** * */ @ApiModelProperty(value = "") private String deviceDesc; /** * The icon displayed on the remote control. */ @ApiModelProperty(value = "The icon displayed on the remote control.") private String urlNormal; /** * The icon displayed on the remote control when it is selected. */ @ApiModelProperty(value = "The icon displayed on the remote control when it is selected.") private String urlSelect; /** * 保护区ID */ @ApiModelProperty(value = "保护区ID") private String reserveId; /** * 相机名称 */ @ApiModelProperty(value = "相机名称") private String creamaName; /** * 机巢编号 */ @ApiModelProperty(value = "机巢编号") private String machineNestSn; /** * 飞机操控密码 */ @ApiModelProperty(value = "飞机操控密码") private String operatePassword; /** * 设备状态:{"0":"空闲中","1":"现场调试","2":"远程调试","3":"固件升级中","4":"作业中","5":"待标定"} */ @ApiModelProperty(value = "设备状态:{0:空闲中,1:现场调试,2:远程调试,3:固件升级中,4:作业中,5:待标定}") @ApiModelProperty(value = "设备状态:{0:\"在线\",1:\"离线\"}") private Long modeCode; /** * 是否可移动,0=不可移动,1=可移动 */ @ApiModelProperty(value = "是否可移动,0=不可移动,1=可移动") private Byte movable; /** * 保险过期时间 */ @ApiModelProperty(value = "保险过期时间") private Date insureExpiredTime; /** * 流量剩余类型:0充足,1=流量到期,2=不足 */ @ApiModelProperty(value = "流量剩余类型:0充足,1=流量到期,2=不足") private Byte flowType; /** * 维保开始时间 */ @ApiModelProperty(value = "维保开始时间") private Date maintenanceStart; /** * 维保结束时间 */ @ApiModelProperty(value = "维保结束时间") private Date maintenanceEnd; /** * 保险开始时间 */ @ApiModelProperty(value = "保险开始时间") private Date insureStartTime; /** * 设备eid编号 */ @ApiModelProperty(value = "设备eid编号") private String eid; /** * 剩余流量(单位:GB) */ @@ -218,35 +103,6 @@ */ @ApiModelProperty(value = "流量到期时间") private Date trafficExpireTime; /** * 内部隐藏标识(0-正常,1-下线) */ @ApiModelProperty(value = "内部隐藏标识(0-正常,1-下线)") private Boolean hiddenFlag; /** * 部署模式:0-统一部署,1-独立部署 */ @ApiModelProperty(value = "部署模式:0-统一部署,1-独立部署") private Boolean deploymentMode; /** * 绑定机构id */ @ApiModelProperty(value = "绑定机构id") private Long deptId; /** * 行政区域编号 */ @ApiModelProperty(value = "行政区域编号") private String areaCode; /** * 4G流量数据 */ @ApiModelProperty(value = "4G流量数据") private String trafficData; /** * DEM数据状态:0-未初始化,1-初始化中,2-初始化成功,3-初始化失败 */ @ApiModelProperty(value = "DEM数据状态:0-未初始化,1-初始化中,2-初始化成功,3-初始化失败") private Integer demStatus; } drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/vo/GdManageDeviceVO.java
@@ -16,16 +16,10 @@ */ package org.sxkj.gd.workorder.vo; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import org.sxkj.gd.workorder.entity.GdManageDeviceEntity; import lombok.Data; import lombok.EqualsAndHashCode; import java.math.BigDecimal; import java.util.Date; import java.io.Serializable; import java.util.List; /** @@ -35,7 +29,8 @@ * @since 2026-01-14 */ @Data public class GdManageDeviceVO { public class GdManageDeviceVO implements Serializable { private static final long serialVersionUID = 1L; @ApiModelProperty("主键id") drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/wrapper/GdManageDeviceWrapper.java
@@ -18,6 +18,7 @@ import org.springblade.core.mp.support.BaseEntityWrapper; import org.springblade.core.tool.utils.BeanUtil; import org.sxkj.gd.workorder.dto.GdManageDeviceDTO; import org.sxkj.gd.workorder.entity.GdManageDeviceEntity; import org.sxkj.gd.workorder.vo.GdManageDeviceVO; import java.util.Objects; @@ -36,15 +37,11 @@ @Override public GdManageDeviceVO entityVO(GdManageDeviceEntity gdManageDevice) { GdManageDeviceVO gdManageDeviceVO = Objects.requireNonNull(BeanUtil.copy(gdManageDevice, GdManageDeviceVO.class)); //User createUser = UserCache.getUser(gdManageDevice.getCreateUser()); //User updateUser = UserCache.getUser(gdManageDevice.getUpdateUser()); //gdManageDeviceVO.setCreateUserName(createUser.getName()); //gdManageDeviceVO.setUpdateUserName(updateUser.getName()); return gdManageDeviceVO; return Objects.requireNonNull(BeanUtil.copy(gdManageDevice, GdManageDeviceVO.class)); } public GdManageDeviceEntity entityDTO(GdManageDeviceDTO gdManageDevice) { return Objects.requireNonNull(BeanUtil.copy(gdManageDevice, GdManageDeviceEntity.class)); } }