ard-work/src/main/java/com/ruoyi/alarm/globalAlarm/service/impl/GlobalAlarmServiceImpl.java
@@ -365,7 +365,7 @@ String defenseName = ardAlarmExternal.getDefenseName(); String alarmType = ardAlarmExternal.getAlarmType(); String alarmTime = fmt.format(ardAlarmExternal.getAlarmTime()); ardAlarmRadarMapper.updateViewTimeByCondition(defenseName, alarmType, alarmTime, DateUtils.getTime()); ardAlarmExternalMapper.updateViewTimeByCondition(defenseName, alarmType, alarmTime, DateUtils.getTime()); return ardAlarmExternal; } case 1006: @@ -717,7 +717,6 @@ return minDistanceCameraId; } public static void main(String[] args) { Comparator<Obj> PriorityDescCom = Comparator.comparingInt(Obj::getPriority).reversed(); Comparator<Obj> NumDescCom = Comparator.comparingInt(Obj::getNum).reversed(); @@ -738,8 +737,8 @@ log.info("==================================================================="); priorityQueue.add(new Obj(999, 5, "2023-07-01 16:00:01")); PriorityBlockingQueue queue = new PriorityBlockingQueue<>(priorityQueue); while (priorityQueue.size() > 0) { Obj task = priorityQueue.poll(); while (queue.size() > 0) { Obj task = (Obj)queue.poll(); log.info("正在排队【priority】" + task.getPriority() + "【num】" + task.getNum() + "【alarmTime】" + task.getAlarmTime()); } } ard-work/src/main/java/com/ruoyi/alarm/radarAlarm/mapper/ArdAlarmRadarMapper.java
@@ -75,7 +75,9 @@ * 查找5分钟内引导过的记录 */ public ArdAlarmRadar getArdAlarmRadarWithGuide(ArdAlarmRadar ardAlarmRadar); /** * 获取未引导的记录数量 */ public int getArdAlarmRadarWithNotGuide(@Param("ardAlarmRadar") ArdAlarmRadar ardAlarmRadar, @Param("guideTime") Date guideTime); public int updateViewTimeByCondition(@Param("name")String name,@Param("alarmType")String alarmType,@Param("alarmTime") String alarmTime,@Param("viewTime") String viewTime); ard-work/src/main/resources/mapper/alarm/ArdAlarmCameraMapper.xml
@@ -16,7 +16,6 @@ <result property="latitude" column="latitude" /> <result property="ruleId" column="rule_id" /> <result property="picUrl" column="pic_url" /> <result property="recordUrl" column="record_url" /> <result property="viewTime" column="view_time" /> <result property="createBy" column="create_by" /> <result property="createTime" column="create_time" /> @@ -25,7 +24,7 @@ </resultMap> <sql id="selectArdAlarmCameraVo"> select id, camera_id, camera_name, camera_channel, camera_type, alarm_type, alarm_time, longitude, latitude, rule_id, pic_url, record_url, view_time, create_by, create_time, user_id, dept_id from ard_alarm_camera select id, camera_id, camera_name, camera_channel, camera_type, alarm_type, alarm_time, longitude, latitude, rule_id, pic_url, view_time, create_by, create_time, user_id, dept_id from ard_alarm_camera </sql> <select id="selectArdAlarmCameraList" parameterType="ArdAlarmCamera" resultMap="ArdAlarmCameraResult"> @@ -36,7 +35,6 @@ <if test="cameraChannel != null "> and camera_channel = #{cameraChannel}</if> <if test="cameraType != null and cameraType != ''"> and camera_type = #{cameraType}</if> <if test="alarmType != null and alarmType != ''"> and alarm_type = #{alarmType}</if> <!-- <if test="alarmTime != null "> and alarm_time = #{alarmTime}</if>--> <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> AND alarm_time >= to_timestamp(#{params.beginTime},'yyyy-MM-DD HH24:MI:ss') </if> @@ -47,7 +45,6 @@ <if test="latitude != null "> and latitude = #{latitude}</if> <if test="ruleId != null "> and rule_id = #{ruleId}</if> <if test="picUrl != null and picUrl != ''"> and pic_url = #{picUrl}</if> <if test="recordUrl != null and recordUrl != ''"> and record_url = #{recordUrl}</if> <if test="viewTime != null "> and view_time = #{viewTime}</if> <if test="userId != null and userId != ''"> and user_id = #{userId}</if> <if test="deptId != null "> and dept_id = #{deptId}</if> @@ -74,7 +71,6 @@ <if test="latitude != null">latitude,</if> <if test="ruleId != null">rule_id,</if> <if test="picUrl != null">pic_url,</if> <if test="recordUrl != null">record_url,</if> <if test="viewTime != null">view_time,</if> <if test="createBy != null">create_by,</if> <if test="createTime != null">create_time,</if> @@ -93,7 +89,6 @@ <if test="latitude != null">#{latitude},</if> <if test="ruleId != null">#{ruleId},</if> <if test="picUrl != null">#{picUrl},</if> <if test="recordUrl != null">#{recordUrl},</if> <if test="viewTime != null">#{viewTime},</if> <if test="createBy != null">#{createBy},</if> <if test="createTime != null">#{createTime},</if> @@ -115,7 +110,6 @@ <if test="latitude != null">latitude = #{latitude},</if> <if test="ruleId != null">rule_id = #{ruleId},</if> <if test="picUrl != null">pic_url = #{picUrl},</if> <if test="recordUrl != null">record_url = #{recordUrl},</if> <if test="viewTime != null">view_time = #{viewTime},</if> <if test="createBy != null">create_by = #{createBy},</if> <if test="createTime != null">create_time = #{createTime},</if> @@ -136,8 +130,7 @@ </foreach> </delete> <select id="selectListAllByCommand" resultMap="ArdAlarmCameraResult"> SELECT T .* SELECT T.* FROM ( SELECT @@ -147,7 +140,6 @@ aac.alarm_time, aac.longitude, aac.latitude, aac.record_url, ROW_NUMBER () OVER ( PARTITION BY aac.camera_id ORDER BY aac.alarm_time DESC ) AS rn, COUNT ( CASE WHEN aac.view_time IS NULL THEN 1 END ) OVER ( PARTITION BY aac.camera_id ) AS COUNT, COUNT ( aac.alarm_time ) OVER ( PARTITION BY camera_id ) AS total ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/AlarmTask.java
@@ -41,22 +41,30 @@ * @修改人和其它信息 */ public void globalAlarmCountPush() { try { IGlobalAlarmService globalAlarmService = SpringUtils.getBean(IGlobalAlarmService.class); Map<String, Object> stringIntegerMap = globalAlarmService.selectAlarmLogsCount(); if (ONLINE_USER_SESSIONS.size() > 0) { WebSocketUtils.sendMessageAll(stringIntegerMap); } } catch (Exception ex) { log.error("定时推送所有报警的点位数量异常:" + ex.getMessage()); } } /** * 定时清空引导队列 * 刘苏义 * 2023/7/1 10:41 */ public void clearGuideQueue() { try { log.info("定时清理引导队列"); for(PriorityBlockingQueue<GuideTask> guideQueue:GuidePriorityQueue.cameraQueueMap.values()) { for (PriorityBlockingQueue<GuideTask> guideQueue : GuidePriorityQueue.cameraQueueMap.values()) { guideQueue.clear(); } } catch (Exception ex) { log.error("定时清空引导队列:" + ex.getMessage()); } } } ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/MinioTask.java
@@ -23,7 +23,7 @@ public class MinioTask { public void delHistoryTask(Integer saveDays) { log.info("执行历史数据删除"); log.debug("执行历史数据删除"); //遍历存储 try { List<String> buckets=new ArrayList<>(); @@ -33,7 +33,6 @@ Iterable<Result<Item>> listObjectsPic = MinioUtils.getObjectsByBucket(name); for (Result<Item> result : listObjectsPic) { Item item = result.get(); log.info(item.objectName() + "创建时间:" + item.lastModified()); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.of("Asia/Shanghai")); String objectTime = item.lastModified().format(formatter); @@ -43,17 +42,16 @@ calendar.setTime(now); calendar.add(Calendar.DATE, saveDays); SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String nowTime = fmt.format(calendar.getTime()); String expireTime = fmt.format(calendar.getTime()); log.info("objectTime : " + objectTime); log.info("nowTime : " + nowTime); if (objectTime.compareTo(nowTime) < 0) { log.info("objectTime 时间在 nowTime 之前"); if (objectTime.compareTo(expireTime) < 0) { log.debug("objectTime : " + objectTime); log.debug("expireTime : " + expireTime); log.debug("objectTime 时间在 expireTime 之前,执行删除"); boolean b = MinioUtils.removeObject(name, item.objectName()); if(b) { log.info("删除过期数据:"+ item.objectName()+"---"+item.lastModified()); log.debug("成功删除过期数据:"+ item.objectName()+"---"+item.lastModified()); } } }