From 879f0f4ab74d6d6ee147ea41648b35d368045e6c Mon Sep 17 00:00:00 2001 From: ‘liusuyi’ <1951119284@qq.com> Date: 星期五, 07 七月 2023 10:32:02 +0800 Subject: [PATCH] 修改雷达管理业务 修改相机复选框接口状态 --- ard-work/src/main/java/com/ruoyi/utils/mqtt/MqttConsumer.java | 2 ard-work/src/main/java/com/ruoyi/device/external/service/impl/ArdEquipExternalServiceImpl.java | 2 ard-work/src/main/resources/mapper/device/ArdEquipExternalMapper.xml | 142 +++++++++---------- ard-work/src/main/java/com/ruoyi/device/camera/controller/ArdCamerasController.java | 4 ard-work/src/main/java/com/ruoyi/device/external/domain/ArdEquipExternal.java | 214 ++++++++++++++---------------- 5 files changed, 173 insertions(+), 191 deletions(-) diff --git a/ard-work/src/main/java/com/ruoyi/device/camera/controller/ArdCamerasController.java b/ard-work/src/main/java/com/ruoyi/device/camera/controller/ArdCamerasController.java index a7ca092..e0efc82 100644 --- a/ard-work/src/main/java/com/ruoyi/device/camera/controller/ArdCamerasController.java +++ b/ard-work/src/main/java/com/ruoyi/device/camera/controller/ArdCamerasController.java @@ -148,14 +148,14 @@ @ApiOperation("鑾峰彇閮ㄩ棬鍜岀浉鏈�") public AjaxResult getDeptAndCamera() { - Map deptAndCamera = ardCamerasService.getChildDeptAndCamera(false); + Map deptAndCamera = ardCamerasService.getChildDeptAndCamera(true); return AjaxResult.success(deptAndCamera); } @GetMapping("/getDeptAndCameraWithCheckBox") @ApiOperation("鑾峰彇閮ㄩ棬鍜岀浉鏈�(寮�鍚閫夋)") public AjaxResult getDeptAndCameraWithCheckBox() { - Map deptAndCamera = ardCamerasService.getChildDeptAndCamera(true); + Map deptAndCamera = ardCamerasService.getChildDeptAndCamera(false); return AjaxResult.success(deptAndCamera); } @PostMapping("/getNearCamerasBycoordinate") diff --git a/ard-work/src/main/java/com/ruoyi/device/external/domain/ArdEquipExternal.java b/ard-work/src/main/java/com/ruoyi/device/external/domain/ArdEquipExternal.java index 24f385a..d4ef464 100644 --- a/ard-work/src/main/java/com/ruoyi/device/external/domain/ArdEquipExternal.java +++ b/ard-work/src/main/java/com/ruoyi/device/external/domain/ArdEquipExternal.java @@ -6,10 +6,10 @@ import com.ruoyi.common.core.domain.BaseEntity; /** - * external瀵硅薄 ard_equip_external - * - * @author zj - * @date 2023-03-13 + * 澶栬仈璁惧绠$悊瀵硅薄 ard_equip_external + * + * @author ard + * @date 2023-07-07 */ public class ArdEquipExternal extends BaseEntity { @@ -30,194 +30,178 @@ @Excel(name = "鍘傚晢") private String factory; - /** 鎶ヨ鍖哄煙 */ - @Excel(name = "鎶ヨ鍖哄煙") - private String region; - /** ip */ @Excel(name = "ip") private String ip; - /** 瀹夎楂樺害 */ - @Excel(name = "瀹夎楂樺害") - private String altitude; + /** 绔彛 */ + @Excel(name = "绔彛") + private Integer port; /** 鐢ㄦ埛鍚� */ - @Excel(name = "鐢ㄦ埛鍚�") private String username; /** 瀵嗙爜 */ - @Excel(name = "瀵嗙爜") private String password; + + /** 缁忓害 */ + @Excel(name = "缁忓害") + private Double longitude; + + /** 绾害 */ + @Excel(name = "绾害") + private Double latitude; + + /** 瀹夎楂樺害 */ + @Excel(name = "瀹夎楂樺害") + private Double altitude; /** 閮ㄩ棬id */ @Excel(name = "閮ㄩ棬id") - private String deptId; + private Integer deptId; /** 鐢ㄦ埛id */ @Excel(name = "鐢ㄦ埛id") private String userId; - /** 绔彛 */ - @Excel(name = "绔彛") - private String port; - - /** 缁忓害 */ - @Excel(name = "缁忓害") - private String longitude; - - /** 绾害 */ - @Excel(name = "绾害") - private String latitude; - - public void setId(String id) + public void setId(String id) { this.id = id; } - public String getId() + public String getId() { return id; } - public void setName(String name) + public void setName(String name) { this.name = name; } - public String getName() + public String getName() { return name; } - public void setType(String type) + public void setType(String type) { this.type = type; } - public String getType() + public String getType() { return type; } - public void setFactory(String factory) + public void setFactory(String factory) { this.factory = factory; } - public String getFactory() + public String getFactory() { return factory; } - public void setRegion(String region) - { - this.region = region; - } - - public String getRegion() - { - return region; - } - public void setIp(String ip) + public void setIp(String ip) { this.ip = ip; } - public String getIp() + public String getIp() { return ip; } - public void setAltitude(String altitude) - { - this.altitude = altitude; - } - - public String getAltitude() - { - return altitude; - } - public void setUsername(String username) - { - this.username = username; - } - - public String getUsername() - { - return username; - } - public void setPassword(String password) - { - this.password = password; - } - - public String getPassword() - { - return password; - } - public void setDeptId(String deptId) - { - this.deptId = deptId; - } - - public String getDeptId() - { - return deptId; - } - public void setUserId(String userId) - { - this.userId = userId; - } - - public String getUserId() - { - return userId; - } - public void setPort(String port) + public void setPort(Integer port) { this.port = port; } - public String getPort() + public Integer getPort() { return port; } - public void setLongitude(String longitude) + public void setUsername(String username) + { + this.username = username; + } + + public String getUsername() + { + return username; + } + public void setPassword(String password) + { + this.password = password; + } + + public String getPassword() + { + return password; + } + public void setLongitude(Double longitude) { this.longitude = longitude; } - public String getLongitude() + public Double getLongitude() { return longitude; } - public void setLatitude(String latitude) + public void setLatitude(Double latitude) { this.latitude = latitude; } - public String getLatitude() + public Double getLatitude() { return latitude; + } + public void setAltitude(Double altitude) + { + this.altitude = altitude; + } + + public Double getAltitude() + { + return altitude; + } + public void setDeptId(Integer deptId) + { + this.deptId = deptId; + } + + public Integer getDeptId() + { + return deptId; + } + public void setUserId(String userId) + { + this.userId = userId; + } + + public String getUserId() + { + return userId; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("updateTime", getUpdateTime()) - .append("name", getName()) - .append("type", getType()) - .append("factory", getFactory()) - .append("region", getRegion()) - .append("ip", getIp()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("altitude", getAltitude()) - .append("username", getUsername()) - .append("password", getPassword()) - .append("deptId", getDeptId()) - .append("userId", getUserId()) - .append("port", getPort()) - .append("longitude", getLongitude()) - .append("latitude", getLatitude()) - .toString(); + .append("id", getId()) + .append("name", getName()) + .append("type", getType()) + .append("factory", getFactory()) + .append("ip", getIp()) + .append("port", getPort()) + .append("username", getUsername()) + .append("password", getPassword()) + .append("longitude", getLongitude()) + .append("latitude", getLatitude()) + .append("altitude", getAltitude()) + .append("deptId", getDeptId()) + .append("userId", getUserId()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); } } diff --git a/ard-work/src/main/java/com/ruoyi/device/external/service/impl/ArdEquipExternalServiceImpl.java b/ard-work/src/main/java/com/ruoyi/device/external/service/impl/ArdEquipExternalServiceImpl.java index a8302bc..0de8701 100644 --- a/ard-work/src/main/java/com/ruoyi/device/external/service/impl/ArdEquipExternalServiceImpl.java +++ b/ard-work/src/main/java/com/ruoyi/device/external/service/impl/ArdEquipExternalServiceImpl.java @@ -5,6 +5,7 @@ import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.uuid.IdUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.device.external.mapper.ArdEquipExternalMapper; @@ -58,6 +59,7 @@ public int insertArdEquipExternal(ArdEquipExternal ardEquipExternal) { //鑾峰彇褰撳墠鐧诲綍鐢ㄦ埛id + ardEquipExternal.setId(IdUtils.simpleUUID()); String userId = SecurityUtils.getUserId(); ardEquipExternal.setCreateBy(userId); ardEquipExternal.setUserId(userId); diff --git a/ard-work/src/main/java/com/ruoyi/utils/mqtt/MqttConsumer.java b/ard-work/src/main/java/com/ruoyi/utils/mqtt/MqttConsumer.java index 3c36909..6254a44 100644 --- a/ard-work/src/main/java/com/ruoyi/utils/mqtt/MqttConsumer.java +++ b/ard-work/src/main/java/com/ruoyi/utils/mqtt/MqttConsumer.java @@ -75,7 +75,7 @@ // 璁剧疆浼氳瘽蹇冭烦鏃堕棿 options.setKeepAliveInterval(PropertiesUtil.MQTT_KEEP_ALIVE); // 鏄惁娓呴櫎session - options.setCleanSession(false); + options.setCleanSession(true); log.info("--鐢熸垚mqtt閰嶇疆瀵硅薄"); return options; } diff --git a/ard-work/src/main/resources/mapper/device/ArdEquipExternalMapper.xml b/ard-work/src/main/resources/mapper/device/ArdEquipExternalMapper.xml index 31741f3..06ddea5 100644 --- a/ard-work/src/main/resources/mapper/device/ArdEquipExternalMapper.xml +++ b/ard-work/src/main/resources/mapper/device/ArdEquipExternalMapper.xml @@ -1,49 +1,47 @@ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper -PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.ruoyi.device.external.mapper.ArdEquipExternalMapper"> - + <resultMap type="ArdEquipExternal" id="ArdEquipExternalResult"> - <result property="id" column="id" /> - <result property="updateTime" column="update_time" /> - <result property="name" column="name" /> - <result property="type" column="type" /> - <result property="factory" column="factory" /> - <result property="region" column="region" /> - <result property="ip" column="ip" /> - <result property="createBy" column="create_by" /> - <result property="createTime" column="create_time" /> - <result property="updateBy" column="update_by" /> - <result property="altitude" column="altitude" /> - <result property="username" column="username" /> - <result property="password" column="password" /> - <result property="deptId" column="dept_id" /> - <result property="userId" column="user_id" /> - <result property="port" column="port" /> - <result property="longitude" column="longitude" /> - <result property="latitude" column="latitude" /> + <result property="id" column="id"/> + <result property="name" column="name"/> + <result property="type" column="type"/> + <result property="factory" column="factory"/> + <result property="ip" column="ip"/> + <result property="port" column="port"/> + <result property="username" column="username"/> + <result property="password" column="password"/> + <result property="longitude" column="longitude"/> + <result property="latitude" column="latitude"/> + <result property="altitude" column="altitude"/> + <result property="deptId" column="dept_id"/> + <result property="userId" column="user_id"/> + <result property="createBy" column="create_by"/> + <result property="createTime" column="create_time"/> + <result property="updateBy" column="update_by"/> + <result property="updateTime" column="update_time"/> </resultMap> <sql id="selectArdEquipExternalVo"> select c.id, - c.update_time, c.name, c.type, c.factory, - c.region, c.ip, + c.port, + c.username, + c.password, + c.longitude, + c.latitude, + c.altitude, + d.dept_id, + u.user_id, c.create_by, c.create_time, c.update_by, - c.altitude, - c.username, - c.password, - d.dept_id, - u.user_id, - c.port, - c.longitude, - c.latitude + c.update_time from ard_equip_external c left join sys_dept d on d.dept_id = c.dept_id left join sys_user u on u.user_id = c.user_id @@ -51,15 +49,14 @@ <select id="selectArdEquipExternalList" parameterType="ArdEquipExternal" resultMap="ArdEquipExternalResult"> <include refid="selectArdEquipExternalVo"/> - <where> - <if test="name != null and name != ''"> and c.name like '%'||#{name}||'%'</if> - <if test="type != null and type != ''"> and c.type = #{type}</if> - <if test="factory != null and factory != ''"> and c.factory = #{factory}</if> - <if test="region != null and region != ''"> and c.region = #{region}</if> + <where> + <if test="name != null and name != ''">and c.name like '%'||#{name}||'%'</if> + <if test="type != null and type != ''">and c.type = #{type}</if> + <if test="factory != null and factory != ''">and c.factory = #{factory}</if> <if test="deptId != null ">and (c.dept_id = #{deptId} OR c.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE cast(#{deptId} as varchar) = any(string_to_array(ancestors,',')) )) </if> - <if test="userId != null and userId != ''"> and c.user_id = #{userId}</if> + <if test="userId != null and userId != ''">and c.user_id = #{userId}</if> <if test="params.beginTime != null and params.beginTime != ''"><!-- 寮�濮嬫椂闂存绱� --> and create_time >= to_timestamp(#{params.beginTime},'yyyy-MM-DD') </if> @@ -70,86 +67,85 @@ ${params.dataScope} </where> </select> - + <select id="selectArdEquipExternalById" parameterType="String" resultMap="ArdEquipExternalResult"> <include refid="selectArdEquipExternalVo"/> where id = #{id} </select> - + <insert id="insertArdEquipExternal" parameterType="ArdEquipExternal"> insert into ard_equip_external <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null">id,</if> - <if test="updateTime != null">update_time,</if> <if test="name != null">name,</if> <if test="type != null">type,</if> <if test="factory != null">factory,</if> - <if test="region != null">region,</if> <if test="ip != null">ip,</if> + <if test="port != null">port,</if> + <if test="username != null">username,</if> + <if test="password != null">password,</if> + <if test="longitude != null">longitude,</if> + <if test="latitude != null">latitude,</if> + <if test="altitude != null">altitude,</if> + <if test="deptId != null">dept_id,</if> + <if test="userId != null">user_id,</if> <if test="createBy != null">create_by,</if> <if test="createTime != null">create_time,</if> <if test="updateBy != null">update_by,</if> - <if test="altitude != null">altitude,</if> - <if test="username != null">username,</if> - <if test="password != null">password,</if> - <if test="deptId != null">dept_id,</if> - <if test="userId != null">user_id,</if> - <if test="port != null">port,</if> - <if test="longitude != null">longitude,</if> - <if test="latitude != null">latitude,</if> - </trim> + <if test="updateTime != null">update_time,</if> + </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null">#{id},</if> - <if test="updateTime != null">#{updateTime},</if> <if test="name != null">#{name},</if> <if test="type != null">#{type},</if> <if test="factory != null">#{factory},</if> - <if test="region != null">#{region},</if> <if test="ip != null">#{ip},</if> + <if test="port != null">#{port},</if> + <if test="username != null">#{username},</if> + <if test="password != null">#{password},</if> + <if test="longitude != null">#{longitude},</if> + <if test="latitude != null">#{latitude},</if> + <if test="altitude != null">#{altitude},</if> + <if test="deptId != null">#{deptId},</if> + <if test="userId != null">#{userId},</if> <if test="createBy != null">#{createBy},</if> <if test="createTime != null">#{createTime},</if> <if test="updateBy != null">#{updateBy},</if> - <if test="altitude != null">#{altitude},</if> - <if test="username != null">#{username},</if> - <if test="password != null">#{password},</if> - <if test="deptId != null">#{deptId},</if> - <if test="userId != null">#{userId},</if> - <if test="port != null">#{port},</if> - <if test="longitude != null">#{longitude},</if> - <if test="latitude != null">#{latitude},</if> - </trim> + <if test="updateTime != null">#{updateTime},</if> + </trim> </insert> <update id="updateArdEquipExternal" parameterType="ArdEquipExternal"> update ard_equip_external <trim prefix="SET" suffixOverrides=","> - <if test="updateTime != null">update_time = #{updateTime},</if> <if test="name != null">name = #{name},</if> <if test="type != null">type = #{type},</if> <if test="factory != null">factory = #{factory},</if> - <if test="region != null">region = #{region},</if> <if test="ip != null">ip = #{ip},</if> + <if test="port != null">port = #{port},</if> + <if test="username != null">username = #{username},</if> + <if test="password != null">password = #{password},</if> + <if test="longitude != null">longitude = #{longitude},</if> + <if test="latitude != null">latitude = #{latitude},</if> + <if test="altitude != null">altitude = #{altitude},</if> + <if test="deptId != null">dept_id = #{deptId},</if> + <if test="userId != null">user_id = #{userId},</if> <if test="createBy != null">create_by = #{createBy},</if> <if test="createTime != null">create_time = #{createTime},</if> <if test="updateBy != null">update_by = #{updateBy},</if> - <if test="altitude != null">altitude = #{altitude},</if> - <if test="username != null">username = #{username},</if> - <if test="password != null">password = #{password},</if> - <if test="deptId != null">dept_id = #{deptId},</if> - <if test="userId != null">user_id = #{userId},</if> - <if test="port != null">port = #{port},</if> - <if test="longitude != null">longitude = #{longitude},</if> - <if test="latitude != null">latitude = #{latitude},</if> + <if test="updateTime != null">update_time = #{updateTime},</if> </trim> where id = #{id} </update> <delete id="deleteArdEquipExternalById" parameterType="String"> - delete from ard_equip_external where id = #{id} + delete + from ard_equip_external + where id = #{id} </delete> <delete id="deleteArdEquipExternalByIds" parameterType="String"> - delete from ard_equip_external where id in + delete from ard_equip_external where id in <foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach> -- Gitblit v1.9.3