‘liusuyi’
2023-07-07 879f0f4ab74d6d6ee147ea41648b35d368045e6c
修改雷达管理业务
修改相机复选框接口状态
已修改5个文件
364 ■■■■ 文件已修改
ard-work/src/main/java/com/ruoyi/device/camera/controller/ArdCamerasController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/device/external/domain/ArdEquipExternal.java 214 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/device/external/service/impl/ArdEquipExternalServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/utils/mqtt/MqttConsumer.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/resources/mapper/device/ArdEquipExternalMapper.xml 142 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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")
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();
    }
}
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);
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;
    }
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 &gt;= 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>