From c587ef738935bfd0271939d4558bb39ecd9fe03e Mon Sep 17 00:00:00 2001 From: chenyouting <514333061@qq.com> Date: Thu, 14 Aug 2025 18:57:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E7=BB=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/service/device/DeviceBizService.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/fys-admin/src/main/java/com/fuyuanshen/web/service/device/DeviceBizService.java b/fys-admin/src/main/java/com/fuyuanshen/web/service/device/DeviceBizService.java index 82a4964..4d9a8de 100644 --- a/fys-admin/src/main/java/com/fuyuanshen/web/service/device/DeviceBizService.java +++ b/fys-admin/src/main/java/com/fuyuanshen/web/service/device/DeviceBizService.java @@ -6,12 +6,16 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fuyuanshen.app.domain.AppDeviceBindRecord; +import com.fuyuanshen.app.domain.AppDeviceShare; import com.fuyuanshen.app.domain.dto.APPReNameDTO; import com.fuyuanshen.app.domain.dto.AppRealTimeStatusDto; import com.fuyuanshen.app.domain.dto.DeviceInstructDto; import com.fuyuanshen.app.domain.vo.APPDeviceTypeVo; +import com.fuyuanshen.app.domain.vo.AppUserVo; import com.fuyuanshen.app.mapper.AppDeviceBindRecordMapper; +import com.fuyuanshen.app.mapper.AppDeviceShareMapper; import com.fuyuanshen.app.mapper.AppPersonnelInfoMapper; +import com.fuyuanshen.app.mapper.AppUserMapper; import com.fuyuanshen.app.mapper.equipment.APPDeviceMapper; import com.fuyuanshen.common.core.exception.ServiceException; import com.fuyuanshen.common.core.utils.ObjectUtils; @@ -55,6 +59,8 @@ public class DeviceBizService { private final AppDeviceBindRecordMapper appDeviceBindRecordMapper; private final RealTimeStatusEngine realTimeStatusEngine; private final DeviceLogMapper deviceLogMapper; + private final AppDeviceShareMapper appDeviceShareMapper; + private final AppUserMapper appUserMapper;; @@ -240,6 +246,15 @@ public class DeviceBizService { appDeviceBindRecordMapper.deleteById(appDeviceBindRecord.getId())); } + AppUserVo appUserVo = appUserMapper.selectVoById(userId); + QueryWrapper appDeviceShareQueryWrapper = new QueryWrapper<>(); + appDeviceShareQueryWrapper.eq("device_id", device.getId()); + appDeviceShareQueryWrapper.eq("phonenumber", appUserVo.getPhonenumber()); + List appDeviceShareList = appDeviceShareMapper.selectList(appDeviceShareQueryWrapper); + if (CollectionUtil.isNotEmpty(appDeviceShareList)) { + appDeviceShareList.forEach(appDeviceShare -> + appDeviceShareMapper.deleteById(appDeviceShare.getId())); + } return 1; }