From fecaa7921df90a34997cbb911bc4ff494d6ab70c Mon Sep 17 00:00:00 2001 From: 15683799673 Date: Thu, 28 Aug 2025 19:51:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=97=A8=E7=A6=81=E5=8F=AF?= =?UTF-8?q?=E8=A7=86=E5=8C=96=20=E8=AE=BE=E5=A4=87=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E5=85=B3=E7=B3=BB=E8=A7=A3=E7=BB=91=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sis/service/impl/SisAccessControlServiceImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ruoyi-modules/Sis/src/main/java/org/dromara/sis/service/impl/SisAccessControlServiceImpl.java b/ruoyi-modules/Sis/src/main/java/org/dromara/sis/service/impl/SisAccessControlServiceImpl.java index 9cbe0b2a..79d435f0 100644 --- a/ruoyi-modules/Sis/src/main/java/org/dromara/sis/service/impl/SisAccessControlServiceImpl.java +++ b/ruoyi-modules/Sis/src/main/java/org/dromara/sis/service/impl/SisAccessControlServiceImpl.java @@ -142,7 +142,6 @@ public class SisAccessControlServiceImpl implements ISisAccessControlService { SisAccessControl update = MapstructUtils.convert(bo, SisAccessControl.class); boolean b = baseMapper.updateById(update) > 0; if (bo.getBindDeviceId() != null) { - // 检验设备是否存在 SisDeviceManageVo sisDeviceManageVo = sisDeviceManageService.queryById(bo.getBindDeviceId()); Assert.isTrue(sisDeviceManageVo != null, "设备-{}信息不存在.", bo.getBindDeviceId()); @@ -158,6 +157,9 @@ public class SisAccessControlServiceImpl implements ISisAccessControlService { // 重新构建绑定关系 Boolean insert = sisDeviceBindRefService.insert(sisDeviceBindRef); Assert.isTrue(insert, "写入设备关联表失败!"); + } else { + // 删除设备绑定关系 + sisDeviceBindRefService.deleteByBindId(bo.getId()); } if (CollUtil.isNotEmpty(bo.getDevicePoint())) { @@ -178,6 +180,10 @@ public class SisAccessControlServiceImpl implements ISisAccessControlService { // 构建新的关联关系 Boolean b2 = sisAcDeviceRefService.batchInsert(refs); log.info("门禁-监控设备关联关系构建完成, result={}", b2); + } else { + // 删除监控点管理 + Boolean b1 = sisAcDeviceRefService.deleteByAcId(bo.getId()); + log.info("门禁-监控关联关系删除完成, result={}, acId={}", b1, bo.getId()); } return b; }