From 998725b108d3004ce2e0ab4db99c77f91de8a2e1 Mon Sep 17 00:00:00 2001 From: weitang Date: Thu, 22 May 2025 15:33:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nettyserver/NettyServerHandler.java | 8 ++- .../controller/AnalyseCallController.java | 9 ++- .../service/impl/AlarmLogServiceImpl.java | 18 ++--- .../utils/wrapper/QueryCondition.java | 4 +- .../utils/wrapper/QueryWrapperBuilder.java | 5 ++ .../mapper/basedata/AlarmThresholdMapper.xml | 2 +- .../mapper/patroltask/AlarmLogMapper.xml | 70 +++++++++++++++++-- 7 files changed, 90 insertions(+), 26 deletions(-) diff --git a/riis-system/src/main/java/com/yfd/platform/component/nettyserver/NettyServerHandler.java b/riis-system/src/main/java/com/yfd/platform/component/nettyserver/NettyServerHandler.java index 389f4a8..db0914f 100644 --- a/riis-system/src/main/java/com/yfd/platform/component/nettyserver/NettyServerHandler.java +++ b/riis-system/src/main/java/com/yfd/platform/component/nettyserver/NettyServerHandler.java @@ -1202,14 +1202,13 @@ public class NettyServerHandler extends SimpleChannelInboundHandler list = alarmThresholdService.list(new LambdaQueryWrapper().eq(AlarmThreshold::getDeviceId, deviceid)); @@ -1218,6 +1217,9 @@ public class NettyServerHandler extends SimpleChannelInboundHandler thresholdInterval = alarmThresholdService.getThresholdInterval(deviceid); jsonObject.putAll(thresholdInterval); } + jsonObject.putOpt("deviceid", jsonObject.getStr("deviceId")); + jsonObject.putOpt("channelId", taskResult.getPatroldeviceChannelcode()); + jsonObject.putOpt("deviceId", taskResult.getPatroldeviceCode()); // 如果是站端则区域也需要发送告警 WebSocketServer.sendInfo(stationId, jsonObject.toString()); return true; diff --git a/riis-system/src/main/java/com/yfd/platform/modules/patroltask/controller/AnalyseCallController.java b/riis-system/src/main/java/com/yfd/platform/modules/patroltask/controller/AnalyseCallController.java index 33b5f7d..c2fefb2 100644 --- a/riis-system/src/main/java/com/yfd/platform/modules/patroltask/controller/AnalyseCallController.java +++ b/riis-system/src/main/java/com/yfd/platform/modules/patroltask/controller/AnalyseCallController.java @@ -206,14 +206,19 @@ public class AnalyseCallController { @GetMapping("/playAudioFile") @ApiOperation("在线在线播放音频文件") @ResponseBody - public void playAudioFile(HttpServletResponse response, String filename) throws IOException { + public void playAudioFile(HttpServletResponse response, String filename,String type) throws IOException { OsInfo osInfo = new OsInfo(); boolean isLinux = osInfo.isLinux(); filename = URLDecoder.decode(filename, "utf-8"); if (isLinux) {//linux系统替换文件路径字符 filename = StrUtil.replace(filename, "\\", "/"); } - String originfilename = Config.getSnapFilePath() + filename; + String originfilename = ""; + if (StrUtil.isNotEmpty(type) && "alarm".equals(type)) {//报警显示不同目录 + originfilename = Config.getAlarmFilePath() + filename; + } else { + originfilename = Config.getSnapFilePath() + filename; + } if (cn.hutool.core.io.FileUtil.exist(originfilename)) { FileUtil.playAudio(originfilename, response); } diff --git a/riis-system/src/main/java/com/yfd/platform/modules/patroltask/service/impl/AlarmLogServiceImpl.java b/riis-system/src/main/java/com/yfd/platform/modules/patroltask/service/impl/AlarmLogServiceImpl.java index de02a76..ac47f03 100644 --- a/riis-system/src/main/java/com/yfd/platform/modules/patroltask/service/impl/AlarmLogServiceImpl.java +++ b/riis-system/src/main/java/com/yfd/platform/modules/patroltask/service/impl/AlarmLogServiceImpl.java @@ -1170,15 +1170,7 @@ public class AlarmLogServiceImpl extends ServiceImpl i @Override public Map getAlarmLogById(String id) { Map alarmLog = alarmLogMapper.getAlarmLogById(id); - - if (ObjectUtil.isNotEmpty(alarmLog.get("deviceid"))) { - Map thresholdInterval = alarmThresholdService.getThresholdInterval(alarmLog.get("deviceId" - ).toString()); - if (thresholdInterval != null) { - alarmLog.putAll(thresholdInterval); - } - } - + alarmLog.put("deviceid", alarmLog.get("adeviceId")); return alarmLog; } @@ -1919,19 +1911,21 @@ public class AlarmLogServiceImpl extends ServiceImpl i SysOrganization sysOrganization = sysOrganizationMapper.selectOne(new LambdaUpdateWrapper().eq(SysOrganization::getOrgcode, stationCode)); String parentid = sysOrganization.getParentid(); - jsonObject.putOpt("deviceid", jsonObject.getStr("deviceId")); + // if (ObjectUtil.isNotEmpty(map.get("patroldeviceCode")) && ObjectUtil.isNotEmpty(map.get( // "patroldeviceChannelcode"))) { // jsonObject.putOpt("channelId", map.get("patroldeviceChannelcode").toString()); // jsonObject.putOpt("deviceId", map.get("patroldeviceCode").toString()); // } - jsonObject.putOpt("channelId", taskResult.getPatroldeviceChannelcode()); - jsonObject.putOpt("deviceId", taskResult.getPatroldeviceCode()); + // 告警阈值 if (list.size() > 0) { Map thresholdInterval = alarmThresholdService.getThresholdInterval(deviceid); jsonObject.putAll(thresholdInterval); } + jsonObject.putOpt("channelId", taskResult.getPatroldeviceChannelcode()); + jsonObject.putOpt("deviceId", taskResult.getPatroldeviceCode()); + jsonObject.putOpt("deviceid", jsonObject.getStr("deviceId")); // 如果是站端则区域也需要发送告警 if (!"0".equals(parentid)) { WebSocketServer.sendInfo(parentid, jsonObject.toString()); diff --git a/riis-system/src/main/java/com/yfd/platform/utils/wrapper/QueryCondition.java b/riis-system/src/main/java/com/yfd/platform/utils/wrapper/QueryCondition.java index de6a0a7..4a06b03 100644 --- a/riis-system/src/main/java/com/yfd/platform/utils/wrapper/QueryCondition.java +++ b/riis-system/src/main/java/com/yfd/platform/utils/wrapper/QueryCondition.java @@ -11,9 +11,9 @@ import java.util.Map; @ApiModel("查询构造器") public class QueryCondition { @ApiModelProperty("当前页") - private Integer current; + private Integer current = 1; @ApiModelProperty("页大小") - private Integer size; + private Integer size = 10; @ApiModelProperty("条件过滤器") private Map filters; // 修改为 SortOrder 列表 diff --git a/riis-system/src/main/java/com/yfd/platform/utils/wrapper/QueryWrapperBuilder.java b/riis-system/src/main/java/com/yfd/platform/utils/wrapper/QueryWrapperBuilder.java index b245ff9..d3bca22 100644 --- a/riis-system/src/main/java/com/yfd/platform/utils/wrapper/QueryWrapperBuilder.java +++ b/riis-system/src/main/java/com/yfd/platform/utils/wrapper/QueryWrapperBuilder.java @@ -95,6 +95,11 @@ public class QueryWrapperBuilder { wrapper.in(column, (Collection) value); } break; + case "notin": + if (value instanceof Collection) { + wrapper.notIn(column, (Collection) value); + } + break; default: throw new IllegalArgumentException("不支持的运算符: " + operator); } diff --git a/riis-system/src/main/resources/mapper/basedata/AlarmThresholdMapper.xml b/riis-system/src/main/resources/mapper/basedata/AlarmThresholdMapper.xml index 815e4eb..a628976 100644 --- a/riis-system/src/main/resources/mapper/basedata/AlarmThresholdMapper.xml +++ b/riis-system/src/main/resources/mapper/basedata/AlarmThresholdMapper.xml @@ -5,7 +5,7 @@