drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/entity/GdManageDeviceEntity.java
@@ -89,7 +89,7 @@ /** * 设备状态:{0:"在线",1:"离线"} */ @ApiModelProperty(value = "设备状态:{0:\"在线\",1:\"离线\"}") @ApiModelProperty(value = "设备状态:{0:在线,1:离线}") private Long modeCode; /** * 保险过期时间 @@ -119,4 +119,8 @@ @ApiModelProperty(value = "设备位置") private String location; @ApiModelProperty(value = "设备部门") private String deviceDeptName; } drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdManageDeviceMapper.xml
@@ -3,53 +3,50 @@ <mapper namespace="org.sxkj.gd.workorder.mapper.GdManageDeviceMapper"> <!-- 通用查询映射结果 --> <resultMap id="gdManageDeviceResultMap" type="org.sxkj.gd.workorder.entity.GdManageDeviceEntity"> <resultMap id="gdManageDeviceResultMap" type="org.sxkj.gd.workorder.vo.GdManageDeviceVO"> <result column="id" property="id"/> <result column="device_sn" property="deviceSn"/> <result column="device_name" property="deviceName"/> <result column="nickname" property="nickname"/> <result column="device_type" property="deviceType"/> <result column="device_payload" property="devicePayload"/> <result column="longitude" property="longitude"/> <result column="latitude" property="latitude"/> <result column="firmware_version" property="firmwareVersion"/> <result column="child_sn" property="childSn"/> <result column="mode_code" property="modeCode"/> <result column="insure_expired_time" property="insureExpiredTime"/> <result column="traffic_remaining" property="trafficRemaining"/> <result column="traffic_expire_time" property="trafficExpireTime"/> <result column="create_time" property="createTime"/> <result column="update_time" property="updateTime"/> <result column="is_deleted" property="isDeleted"/> <result column="device_dept_name" property="deviceDeptName"/> </resultMap> <select id="selectGdManageDevicePage" resultMap="gdManageDeviceResultMap"> select id, device_sn, device_name, nickname, device_payload, longitude, latitude, location md.id, md.device_sn, md.device_name, md.nickname, md.mode_code, md.device_payload, md.longitude, md.latitude, md.location, bd.dept_name as device_dept_name from ja_gd_manage_device ja_gd_manage_device md left join blade_dept bd on md.create_dept = bd.id <where> <if test="deviceName != null and deviceName != ''"> and device_name like concat('%',#{deviceName},'%') and md.is_deleted = 0 <if test="param2.deviceName != null and param2.deviceName != ''"> and md.device_name like concat('%',#{param2.deviceName},'%') </if> <if test="nickname != null and nickname != ''"> and nickname like concat('%',#{nickname},'%') <if test="param2.nickname != null and param2.nickname != ''"> and md.nickname like concat('%',#{param2.nickname},'%') </if> <if test="deptId != null"> and create_dept = #{deptId} <if test="param2.deptId != null"> and md.create_dept = #{param2.deptId} </if> <if test="location != null and location != ''"> and location like concat('%',#{location},'%') <if test="param2.location != null and param2.location != ''"> and md.location like concat('%',#{param2.location},'%') </if> and is_deleted = 0 </where> </select> drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/service/impl/GdManageDeviceServiceImpl.java
@@ -16,6 +16,7 @@ */ package org.sxkj.gd.workorder.service.impl; import org.sxkj.gd.utils.GdGeoAddressUtil; import org.sxkj.gd.utils.GeomUtils; import org.sxkj.gd.workorder.entity.GdManageDeviceEntity; import org.sxkj.gd.workorder.param.GdManageDevicePageParam; @@ -27,6 +28,8 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import org.springblade.core.mp.base.BaseServiceImpl; import org.sxkj.system.cache.DictCache; import org.sxkj.system.enums.DictEnum; import java.util.List; @@ -41,7 +44,8 @@ @Override public IPage<GdManageDeviceVO> selectGdManageDevicePage(IPage<GdManageDeviceVO> page, GdManageDevicePageParam gdManageDevice) { return page.setRecords(baseMapper.selectGdManageDevicePage(page, gdManageDevice)); List<GdManageDeviceVO> gdManageDeviceVOS = baseMapper.selectGdManageDevicePage(page, gdManageDevice); return page.setRecords(gdManageDeviceVOS); } @Override @@ -71,6 +75,8 @@ if (gdManageDeviceEntity.getLongitude() != null && gdManageDeviceEntity.getLatitude() != null) { String bufferAroundPointAsString = GeomUtils.getBufferAroundPointAsString(gdManageDeviceEntity.getLongitude(), gdManageDeviceEntity.getLatitude(), 5 * 1000); gdManageDeviceEntity.setGeom(bufferAroundPointAsString); String location = GdGeoAddressUtil.getFormattedAddress(gdManageDeviceEntity.getLongitude(), gdManageDeviceEntity.getLatitude()); gdManageDeviceEntity.setLocation(location); } return saveOrUpdate(gdManageDeviceEntity); } drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/vo/GdManageDeviceVO.java
@@ -16,10 +16,12 @@ */ package org.sxkj.gd.workorder.vo; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; import java.util.Date; import java.util.List; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; @@ -39,6 +41,12 @@ @JsonSerialize(using = ToStringSerializer.class) private Long id; /** * 设备编码 */ @ApiModelProperty(value = "设备编码") private String deviceSn; @ApiModelProperty(value = "设备型号") private String deviceName; /** @@ -46,6 +54,12 @@ */ @ApiModelProperty(value = "设备名称") private String nickname; /** * 设备状态:{0:"在线",1:"离线"} */ @ApiModelProperty(value = "设备状态:{0:在线,1:离线}") private Long modeCode; /** * 设备负载(红外,喇叭,闪光灯) @@ -66,10 +80,20 @@ @ApiModelProperty(value = "设备ids") private List<String> deviceIds; @ApiModelProperty(value = "设备位置") @ApiModelProperty(value = "设备范围") private String geom; @ApiModelProperty(value = "5公里范围面数据") private String fiveKmArea; @ApiModelProperty(value = "设备位置") private String location; @ApiModelProperty(value = "设备部门") private String deviceDeptName; @ApiModelProperty(value = "创建时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createTime; }