From ffb629c51abd4be9cc76a20b06d8e7809e52671a Mon Sep 17 00:00:00 2001 From: weitang Date: Fri, 23 May 2025 17:38:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=83=A8=E5=88=86=E4=B9=8B?= =?UTF-8?q?=E5=89=8D=E4=BB=A3=E7=A0=81=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AlarmThresholdController.java | 2 + .../controller/LinkageSignalController.java | 38 ++++++------------- .../basedata/mapper/AlarmThresholdMapper.java | 2 + .../service/IAlarmThresholdService.java | 2 + .../impl/AlarmThresholdServiceImpl.java | 5 +++ .../mapper/basedata/AlarmThresholdMapper.xml | 13 +++++++ 6 files changed, 35 insertions(+), 27 deletions(-) diff --git a/riis-system/src/main/java/com/yfd/platform/modules/basedata/controller/AlarmThresholdController.java b/riis-system/src/main/java/com/yfd/platform/modules/basedata/controller/AlarmThresholdController.java index 7655d7e..82c62b5 100644 --- a/riis-system/src/main/java/com/yfd/platform/modules/basedata/controller/AlarmThresholdController.java +++ b/riis-system/src/main/java/com/yfd/platform/modules/basedata/controller/AlarmThresholdController.java @@ -54,6 +54,8 @@ public class AlarmThresholdController { Map m = new HashMap<>(BeanUtil.beanToMap(alarmThreshold)); Map thresholdInterval = alarmThresholdService.getThresholdInterval(id); m.putAll(thresholdInterval); + +// Map thresholdInterval1=alarmThresholdService.getAlgorithmModelById(id); return ResponseResult.successData(m); } diff --git a/riis-system/src/main/java/com/yfd/platform/modules/basedata/controller/LinkageSignalController.java b/riis-system/src/main/java/com/yfd/platform/modules/basedata/controller/LinkageSignalController.java index 0c8d983..8c740cd 100644 --- a/riis-system/src/main/java/com/yfd/platform/modules/basedata/controller/LinkageSignalController.java +++ b/riis-system/src/main/java/com/yfd/platform/modules/basedata/controller/LinkageSignalController.java @@ -99,33 +99,17 @@ public class LinkageSignalController { @ApiOperation("根据联动信号Id查询绑定的巡视信息") public ResponseResult getSubstationDeviceListById(String id) { LinkageSignal linkageSignal = linkageSignalService.getById(id); - String deviceIdList = linkageSignal.getDeviceIdList(); - //String videoPos = linkageSignal.getVideoPos(); - List> mapList = new ArrayList<>(); - if (StrUtil.isNotBlank(deviceIdList)) { - String[] split = deviceIdList.split(","); - for (String s : split) { - Map map = new HashMap<>(); - SubstationDevice substationDevice = substationDeviceService.getById(s); - if (substationDevice == null) { - continue; - } - map.put("deviceId", substationDevice.getDeviceId()); - map.put("deviceName", substationDevice.getDeviceName()); - map.put("stationName", substationDevice.getStationName()); - map.put("stationCode", substationDevice.getStationCode()); - map.put("areaName", substationDevice.getAreaName()); - map.put("bayName", substationDevice.getBayName()); - map.put("areaId", substationDevice.getAreaId()); - map.put("bayId", substationDevice.getBayId()); - mapList.add(map); - } - } /*else if (StrUtil.isNotBlank(videoPos)) { - List list = JSONUtil.toList(videoPos, Map.class); - for (Map map : list) { - mapList.add(map); - } - }*/ + String deviceIdListStr = linkageSignal.getDeviceIdList(); + List deviceIdList = StrUtil.split(deviceIdListStr, ","); + if (deviceIdList.size() <= 0) { + return ResponseResult.successData(new ArrayList<>()); + } + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.in(SubstationDevice::getDeviceId, deviceIdList).select(SubstationDevice::getDeviceId, + SubstationDevice::getDeviceName, SubstationDevice::getStationName, SubstationDevice::getStationCode, + SubstationDevice::getAreaName, SubstationDevice::getAreaId, SubstationDevice::getBayId, + SubstationDevice::getBayName); + List> mapList = substationDeviceService.listMaps(queryWrapper); return ResponseResult.successData(mapList); } diff --git a/riis-system/src/main/java/com/yfd/platform/modules/basedata/mapper/AlarmThresholdMapper.java b/riis-system/src/main/java/com/yfd/platform/modules/basedata/mapper/AlarmThresholdMapper.java index 3f85fb1..614aada 100644 --- a/riis-system/src/main/java/com/yfd/platform/modules/basedata/mapper/AlarmThresholdMapper.java +++ b/riis-system/src/main/java/com/yfd/platform/modules/basedata/mapper/AlarmThresholdMapper.java @@ -16,4 +16,6 @@ import java.util.Map; public interface AlarmThresholdMapper extends BaseMapper { Map getThresholdInterval(String deviceId); + + Map getAlgorithmModelById(String id); } diff --git a/riis-system/src/main/java/com/yfd/platform/modules/basedata/service/IAlarmThresholdService.java b/riis-system/src/main/java/com/yfd/platform/modules/basedata/service/IAlarmThresholdService.java index cc3f1d1..0db5ef9 100644 --- a/riis-system/src/main/java/com/yfd/platform/modules/basedata/service/IAlarmThresholdService.java +++ b/riis-system/src/main/java/com/yfd/platform/modules/basedata/service/IAlarmThresholdService.java @@ -16,4 +16,6 @@ import java.util.Map; public interface IAlarmThresholdService extends IService { Map getThresholdInterval(String deviceId); + + Map getAlgorithmModelById(String id); } diff --git a/riis-system/src/main/java/com/yfd/platform/modules/basedata/service/impl/AlarmThresholdServiceImpl.java b/riis-system/src/main/java/com/yfd/platform/modules/basedata/service/impl/AlarmThresholdServiceImpl.java index 7984b78..a7af6a2 100644 --- a/riis-system/src/main/java/com/yfd/platform/modules/basedata/service/impl/AlarmThresholdServiceImpl.java +++ b/riis-system/src/main/java/com/yfd/platform/modules/basedata/service/impl/AlarmThresholdServiceImpl.java @@ -26,4 +26,9 @@ public class AlarmThresholdServiceImpl extends ServiceImpl getThresholdInterval(String deviceId) { return alarmThresholdMapper.getThresholdInterval(deviceId); } + + @Override + public Map getAlgorithmModelById(String id) { + return alarmThresholdMapper.getAlgorithmModelById(id); + } } diff --git a/riis-system/src/main/resources/mapper/basedata/AlarmThresholdMapper.xml b/riis-system/src/main/resources/mapper/basedata/AlarmThresholdMapper.xml index a628976..2e50193 100644 --- a/riis-system/src/main/resources/mapper/basedata/AlarmThresholdMapper.xml +++ b/riis-system/src/main/resources/mapper/basedata/AlarmThresholdMapper.xml @@ -16,4 +16,17 @@ iis_alarm_threshold WHERE device_id = #{deviceId} +