‘liusuyi’
2024-03-16 e58507190b23f09a5f4bb184164382cc519f33c4
增加报警历史查询按name模糊查询
增加雷达报警不存在井下载接口
已修改10个文件
182 ■■■■■ 文件已修改
ard-work/src/main/java/com/ruoyi/alarm/global/controller/GlobalAlarmController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/alarm/global/service/IGlobalAlarmService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/GlobalAlarmServiceImpl.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/inspect/controller/TaskController.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/utils/tools/ArdTool.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/resources/mapper/alarm/ArdAlarmApponekeyMapper.xml 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/resources/mapper/alarm/ArdAlarmStealelecMapper.xml 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/resources/mapper/alarm/ArdAlarmWallMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/alarm/global/controller/GlobalAlarmController.java
@@ -75,9 +75,9 @@
            @ApiImplicitParam(name="pageNum",value="页码",dataType="integer",paramType="query",example="1",required=true,dataTypeClass = Integer.class),
            @ApiImplicitParam(name="pageSize",value="页数量",dataType="integer",paramType="query",example="10",required=true,dataTypeClass = Integer.class)
    })
    public TableDataInfo selectAlarmList(Integer command, String beginTime, String endTime,Integer pageNum,Integer pageSize) {
    public TableDataInfo selectAlarmList(String name,Integer command, String beginTime, String endTime,Integer pageNum,Integer pageSize) {
        startPage();
        Object alarmList = globalAlarmService.selectAlarmList(command,beginTime,endTime, pageNum, pageSize);
        Object alarmList = globalAlarmService.selectAlarmList(name,command,beginTime,endTime, pageNum, pageSize);
        return getDataTable((List)alarmList);
    }
ard-work/src/main/java/com/ruoyi/alarm/global/service/IGlobalAlarmService.java
@@ -19,6 +19,6 @@
    Object updateAlarmViewTime(GlobalAlarmCondition condition);
    public void receiveAlarm(String topic,String message);
    public Map<String,Object> selectAlarmLogsCount();
    Object selectAlarmList(Integer command, String beginTime, String endTime,Integer pageNum,Integer pageSize);
    Object selectAlarmList(String name,Integer command, String beginTime, String endTime,Integer pageNum,Integer pageSize);
    public List<GlobalAlarmData> selectThermalMap(GlobalAlarmCondition condition);
}
ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/GlobalAlarmServiceImpl.java
@@ -33,6 +33,7 @@
import com.ruoyi.alarmpoints.well.domain.ArdWellGuideCamera;
import com.ruoyi.alarmpoints.well.mapper.ArdAlarmpointsWellMapper;
import com.ruoyi.alarmpoints.well.mapper.ArdWellGuideCameraMapper;
import com.ruoyi.common.config.ARDConfig;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.ConfigUtils;
@@ -88,8 +89,6 @@
    private ArdAlarmAccessMapper ardAlarmAccessMapper;
    @Resource
    private ArdAlarmExternalMapper ardAlarmExternalMapper;
    //@Resource
    //private ArdAlarmRadarMapper ardAlarmRadarMapper;
    @Resource
    private ArdAlarmRadarMoveMapper ardAlarmRadarMoveMapper;
    @Resource
@@ -782,25 +781,28 @@
     * @修改人和其它信息
     */
    @Override
    public Object selectAlarmList(Integer command, String beginTime, String endTime, Integer pageNum, Integer pageSize) {
    public Object selectAlarmList(String name,Integer command, String beginTime, String endTime, Integer pageNum, Integer pageSize) {
        Map<String, Object> params = new HashMap<>();
        params.put("beginTime", beginTime);
        params.put("endTime", endTime);
        switch (command) {
            case 1001:
                ArdAlarmStealelec aas = new ArdAlarmStealelec();
                aas.setName(name);
                aas.setParams(params);
                aas.setPageNum(pageNum);
                aas.setPageSize(pageSize);
                return ardAlarmStealelecMapper.selectArdAlarmStealelecList(aas);
            case 1002:
                ArdAlarmCamera aac = new ArdAlarmCamera();
                aac.setCameraName(name);
                aac.setParams(params);
                aac.setPageNum(pageNum);
                aac.setPageSize(pageSize);
                return ardAlarmCameraMapper.selectArdAlarmCameraList(aac);
            case 1003:
                ArdAlarmRadarMove aarm = new ArdAlarmRadarMove();
                aarm.setName(name);
                aarm.setParams(params);
                aarm.setPageNum(pageNum);
                aarm.setPageSize(pageSize);
@@ -808,6 +810,7 @@
                return ardAlarmRadarMoveMapper.selectArdAlarmRadarMoveList(aarm);
            case 1004:
                ArdAlarmRadarFire aarf = new ArdAlarmRadarFire();
                aarf.setName(name);
                aarf.setParams(params);
                aarf.setPageNum(pageNum);
                aarf.setPageSize(pageSize);
@@ -815,6 +818,7 @@
                return ardAlarmRadarFireMapper.selectArdAlarmRadarFireList(aarf);
            case 1007:
                ArdAlarmRadarPump aarp = new ArdAlarmRadarPump();
                aarp.setName(name);
                aarp.setParams(params);
                aarp.setPageNum(pageNum);
                aarp.setPageSize(pageSize);
@@ -822,6 +826,7 @@
                return ardAlarmRadarPumpMapper.selectArdAlarmRadarPumpList(aarp);
            case 1005:
                ArdAlarmExternal aae = new ArdAlarmExternal();
                aae.setAlarmName(name);
                aae.setParams(params);
                aae.setPageNum(pageNum);
                aae.setPageSize(pageSize);
@@ -829,6 +834,7 @@
                return ardAlarmExternalMapper.selectArdAlarmExternalList(aae);
            case 1006:
                ArdAlarmAccess aaa = new ArdAlarmAccess();
                aaa.setAcsName(name);
                aaa.setParams(params);
                aaa.setPageNum(pageNum);
                aaa.setPageSize(pageSize);
@@ -836,30 +842,35 @@
                return ardAlarmAccessMapper.selectArdAlarmAccessList(aaa);
            case 1009:
                ArdAlarmApponekey aaak = new ArdAlarmApponekey();
                aaak.setName(name);
                aaak.setParams(params);
                aaak.setPageNum(pageNum);
                aaak.setPageSize(pageSize);
                return ardAlarmApponekeyMapper.selectArdAlarmApponekeyList(aaak);
            case 1010:
                ArdAlarmWall aaw = new ArdAlarmWall();
                aaw.setWallName(name);
                aaw.setParams(params);
                aaw.setPageNum(pageNum);
                aaw.setPageSize(pageSize);
                return ardAlarmWallMapper.selectArdAlarmWallList(aaw);
            case 1012:
                ArdAlarmDigitization3 aad3 = new ArdAlarmDigitization3();
                aad3.setfName(name);
                aad3.setParams(params);
                aad3.setPageNum(pageNum);
                aad3.setPageSize(pageSize);
                return ardAlarmDigitization3Mapper.selectArdAlarmDigitization3List(aad3);
            case 1014:
                ArdAlarmTube aat = new ArdAlarmTube();
                aat.setTubeName(name);
                aat.setParams(params);
                aat.setPageNum(pageNum);
                aat.setPageSize(pageSize);
                return ardAlarmTubeMapper.selectArdAlarmTubeList(aat);
            case 1015:
                ArdAlarmSuperBrain aasb = new ArdAlarmSuperBrain();
                aasb.setAlarmName(name);
                aasb.setParams(params);
                aasb.setPageNum(pageNum);
                aasb.setPageSize(pageSize);
@@ -1075,8 +1086,8 @@
                        String alarmpointName = ardAlarmRadar.getName();//兴趣点名称
                        ArdAlarmpointsWell well = ardAlarmpointsWellMapper.selectArdAlarmpointsWellByWellId(alarmpointName);
                        if (well == null) {
                            String path = System.getProperty("user.dir") + File.separator + "noExistWell.txt";
                            writeStringToFile(alarmpointName, path);
                            String filePath = ARDConfig.getDownloadPath() +  "noExistWell.txt";
                            writeStringToFile(alarmpointName, filePath);
                            continue;
                        }
ard-work/src/main/java/com/ruoyi/inspect/controller/TaskController.java
@@ -107,21 +107,18 @@
    @ApiOperation("查询范围内的井")
    @PostMapping("/getWellListByPolygon")
    AjaxResult getWellListByPolygon(@RequestBody List<Point> points) {
        List<List<ArdAlarmpointsWell>> listOfLists = new ArrayList<>();
        List<SysDept> depts = deptService.selectDeptList(new SysDept());
        depts.stream().forEach(dept -> {
            ArdAlarmpointsWell ardAlarmpointsWell = new ArdAlarmpointsWell();
            ardAlarmpointsWell.setDeptId(dept.getDeptId());
            List<ArdAlarmpointsWell> wellList = ardAlarmpointsWellService.selectArdAlarmpointsWellList(ardAlarmpointsWell);
            List<ArdAlarmpointsWell> wells = wellList.stream()
                    .filter(well -> well.getLongitude() != null && well.getLatitude() != null)
                    .filter(well -> GisUtil.isInPolygon(new Point(well.getLongitude(), well.getLatitude()), points)
            ).collect(Collectors.toList());
            listOfLists.add(wells);
        });
        List<ArdAlarmpointsWell> inPolygonWellList = listOfLists.stream()
        List<ArdAlarmpointsWell> inPolygonWellList = deptService.selectDeptList(new SysDept()).stream()
                .map(dept -> {
                    ArdAlarmpointsWell ardAlarmpointsWell = new ArdAlarmpointsWell();
                    ardAlarmpointsWell.setDeptId(dept.getDeptId());
                    return ardAlarmpointsWellService.selectArdAlarmpointsWellList(ardAlarmpointsWell).stream()
                            .filter(well -> well.getLongitude() != null && well.getLatitude() != null)
                            .filter(well -> GisUtil.isInPolygon(new Point(well.getLongitude(), well.getLatitude()), points))
                            .collect(Collectors.toList());
                })
                .flatMap(List::stream)
                .collect(Collectors.toList());
        return AjaxResult.success(inPolygonWellList);
    }
}
ard-work/src/main/java/com/ruoyi/utils/tools/ArdTool.java
@@ -148,6 +148,10 @@
        try {
            File file = new File(fileName);
            File parentDir = file.getParentFile();
            if (!parentDir.exists()) {
                parentDir.mkdirs(); // 创建文件所在的目录,包括父目录
            }
            boolean fileExists = file.exists();
            boolean dataExists = false;
            if(fileExists) {
ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml
@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.alarm.access.mapper.ArdAlarmAccessMapper">
    <resultMap type="ArdAlarmAccess" id="ArdAlarmAccessResult">
        <result property="id"    column="id"    />
        <result property="serialNo"    column="serial_no"    />
@@ -32,6 +32,9 @@
    <select id="selectArdAlarmAccessList" parameterType="ArdAlarmAccess" resultMap="ArdAlarmAccessResult">
        <include refid="selectArdAlarmAccessVo"/>
        <where>
            <if test="acsName!=null and acsName!=''">
                AND acs_name like concat('%', #{acsName}, '%')
            </if>
            <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
                AND alarm_time &gt;= to_timestamp(#{params.beginTime},'yyyy-MM-DD HH24:MI:ss')
            </if>
@@ -41,12 +44,12 @@
        </where>
        order by alarm_time desc
    </select>
    <select id="selectArdAlarmAccessById" parameterType="String" resultMap="ArdAlarmAccessResult">
        <include refid="selectArdAlarmAccessVo"/>
        where id = #{id}
    </select>
    <insert id="insertArdAlarmAccess" parameterType="ArdAlarmAccess">
        insert into ard_alarm_access
        <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -120,7 +123,7 @@
    </delete>
    <delete id="deleteArdAlarmAccessByIds" parameterType="String">
        delete from ard_alarm_access where id in
        delete from ard_alarm_access where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
@@ -180,4 +183,4 @@
        from ard_alarm_access
        where alarm_time &gt;= #{start} and  alarm_time &lt;= #{end}  group by date order by date
    </select>
</mapper>
</mapper>
ard-work/src/main/resources/mapper/alarm/ArdAlarmApponekeyMapper.xml
@@ -1,28 +1,38 @@
<?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.alarm.apponekey.mapper.ArdAlarmApponekeyMapper">
    <resultMap type="ArdAlarmApponekey" id="ArdAlarmApponekeyResult">
        <result property="id"    column="id"    />
        <result property="userId"    column="user_id"    />
        <result property="name"    column="name"    />
        <result property="longitude"    column="longitude"    />
        <result property="latitude"    column="latitude"    />
        <result property="altitude"    column="altitude"    />
        <result property="recordUrl"    column="record_url"    />
        <result property="createTime"    column="create_time"    />
        <result property="viewTime"    column="view_time"    />
        <result property="id" column="id"/>
        <result property="userId" column="user_id"/>
        <result property="name" column="name"/>
        <result property="longitude" column="longitude"/>
        <result property="latitude" column="latitude"/>
        <result property="altitude" column="altitude"/>
        <result property="recordUrl" column="record_url"/>
        <result property="createTime" column="create_time"/>
        <result property="viewTime" column="view_time"/>
    </resultMap>
    <sql id="selectArdAlarmApponekeyVo">
        select id, user_id,name, longitude, latitude, altitude, record_url, create_time,view_time from ard_alarm_apponekey
        select id,
               user_id,
               name,
               longitude,
               latitude,
               altitude,
               record_url,
               create_time,
               view_time
        from ard_alarm_apponekey
    </sql>
    <select id="selectArdAlarmApponekeyList" parameterType="ArdAlarmApponekey" resultMap="ArdAlarmApponekeyResult">
        <include refid="selectArdAlarmApponekeyVo"/>
        <where>
            <if test="name != null ">AND name like concat('%', #{name}, '%')</if>
            <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
                AND create_time &gt;= to_timestamp(#{params.beginTime},'yyyy-MM-DD HH24:MI:ss')
            </if>
@@ -32,12 +42,12 @@
        </where>
        order by create_time desc
    </select>
    <select id="selectArdAlarmApponekeyById" parameterType="String" resultMap="ArdAlarmApponekeyResult">
        <include refid="selectArdAlarmApponekeyVo"/>
        where id = #{id}
    </select>
    <insert id="insertArdAlarmApponekey" parameterType="ArdAlarmApponekey">
        insert into ard_alarm_apponekey
        <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -50,7 +60,7 @@
            <if test="recordUrl != null">record_url,</if>
            <if test="createTime != null">create_time,</if>
            <if test="viewTime != null">view_time,</if>
         </trim>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="userId != null">#{userId},</if>
@@ -61,7 +71,7 @@
            <if test="recordUrl != null">#{recordUrl},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="viewTime != null">#{viewTime},</if>
         </trim>
        </trim>
    </insert>
    <update id="updateArdAlarmApponekey" parameterType="ArdAlarmApponekey">
@@ -80,11 +90,13 @@
    </update>
    <delete id="deleteArdAlarmApponekeyById" parameterType="String">
        delete from ard_alarm_apponekey where id = #{id}
        delete
        from ard_alarm_apponekey
        where id = #{id}
    </delete>
    <delete id="deleteArdAlarmApponekeyByIds" parameterType="String">
        delete from ard_alarm_apponekey where id in
        delete from ard_alarm_apponekey where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
@@ -97,29 +109,25 @@
    </select>
    <select id="selectListAllByCommand" resultMap="ArdAlarmApponekeyResult">
        SELECT T.*
        FROM
            (
                SELECT
                    aaa.ID,
                    aaa.user_id,
                    aaa.NAME,
                    aaa.create_time,
                    aaa.longitude,
                    aaa.latitude,
                    aaa.altitude,
                    aaa.record_url,
                    ROW_NUMBER () OVER ( PARTITION BY aaa.NAME ORDER BY aaa.create_time DESC ) AS rn,
                        COUNT ( CASE WHEN aaa.view_time IS NULL THEN 1 END ) OVER ( PARTITION BY aaa.NAME ) AS COUNT,
        FROM (
                 SELECT aaa.ID,
                        aaa.user_id,
                        aaa.NAME,
                        aaa.create_time,
                        aaa.longitude,
                        aaa.latitude,
                        aaa.altitude,
                        aaa.record_url,
                        ROW_NUMBER() OVER ( PARTITION BY aaa.NAME ORDER BY aaa.create_time DESC ) AS rn, COUNT(CASE WHEN aaa.view_time IS NULL THEN 1 END) OVER ( PARTITION BY aaa.NAME ) AS COUNT,
        COUNT ( aaa.create_time ) OVER ( PARTITION BY aaa.NAME ) AS total
                FROM
                    ard_alarm_apponekey aaa
                WHERE
                    aaa.create_time >= ( CURRENT_TIMESTAMP - INTERVAL '%${refreshTime}%' MINUTE )
                ORDER BY
                    aaa.create_time DESC
            ) T
        WHERE
            T.rn = 1
                 FROM
                     ard_alarm_apponekey aaa
                 WHERE
                     aaa.create_time >= ( CURRENT_TIMESTAMP - INTERVAL '%${refreshTime}%' MINUTE )
                 ORDER BY
                     aaa.create_time DESC
             ) T
        WHERE T.rn = 1
    </select>
    <update id="updateViewTimeByUserId" parameterType="String">
        update ard_alarm_apponekey
@@ -132,11 +140,17 @@
    <select id="apponekeyYear" resultType="com.ruoyi.statistical.vo.CountVo">
        select to_char(create_time::DATE, 'MM') as date,count(id)
        from ard_alarm_apponekey
        where create_time &gt;= #{start} and  create_time &lt;= #{end}  group by date order by date
        where create_time &gt;= #{start}
          and create_time &lt;= #{end}
        group by date
        order by date
    </select>
    <select id="apponekeyMonth" resultType="com.ruoyi.statistical.vo.CountVo">
        select to_char(create_time::DATE, 'dd') as date,count(id)
        from ard_alarm_apponekey
        where create_time &gt;= #{start} and  create_time &lt;= #{end}  group by date order by date
        where create_time &gt;= #{start}
          and create_time &lt;= #{end}
        group by date
        order by date
    </select>
</mapper>
</mapper>
ard-work/src/main/resources/mapper/alarm/ArdAlarmStealelecMapper.xml
@@ -24,6 +24,9 @@
        <include refid="Base_Column_List"/>
        from ard_alarm_stealelec
        <where>
            <if test="name != null  and name != ''">
                AND name like concat('%', #{name}, '%')
            </if>
            <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
                AND start_time &gt;= to_timestamp(#{params.beginTime},'yyyy-MM-DD HH24:MI:ss')
            </if>
@@ -140,4 +143,4 @@
        from ard_alarm_stealelec
        where start_time &gt;= #{start} and  start_time &lt;= #{end}  group by date order by date
    </select>
</mapper>
</mapper>
ard-work/src/main/resources/mapper/alarm/ArdAlarmWallMapper.xml
@@ -41,7 +41,7 @@
        <include refid="selectArdAlarmWallVo"/>
        <where>
            <if test="wallId != null  and wallId != ''">and wall_id = #{wallId}</if>
            <if test="wallName != null  and wallName != ''">and wall_name = #{wallName}</if>
            <if test="wallName != null  and wallName != ''">and wall_name like concat('%', #{wallName}, '%')</if>
            <if test="userId != null  and userId != ''">and user_id = #{userId}</if>
            <if test="alarmType != null  and alarmType != ''">and alarm_type = #{alarmType}</if>
<!--            <if test="alarmTime != null ">and alarm_time = #{alarmTime}</if>-->
@@ -172,4 +172,4 @@
        from ard_alarm_wall
        where alarm_time &gt;= #{start} and  alarm_time &lt;= #{end}  group by date order by date
    </select>
</mapper>
</mapper>
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
@@ -73,11 +73,11 @@
        boolean b = SecurityUtils.matchesPassword(sysUser.getPassword(),user.getPassword());
        if(b)
        {
            return AjaxResult.success("密码正确");
            return AjaxResult.success("原密码正确");
        }
        else
        {
            return AjaxResult.error("密码错误");
            return AjaxResult.error("原密码错误");
        }
    }
    /**