From 47b5de28773c5cf551ff9cbebd36e9c49c17609f Mon Sep 17 00:00:00 2001 From: lyh <liuyuanheng@xalxzn.com> Date: 星期四, 20 二月 2025 15:12:57 +0800 Subject: [PATCH] 修改bug --- lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DeviceInfoServiceImpl.java | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DeviceInfoServiceImpl.java b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DeviceInfoServiceImpl.java index bb59e16..0a2e79f 100644 --- a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DeviceInfoServiceImpl.java +++ b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DeviceInfoServiceImpl.java @@ -20,6 +20,7 @@ import org.jeecg.modules.mdc.service.IMdcProductionEquipmentService; import org.jeecg.modules.system.entity.MdcProduction; import org.jeecg.modules.system.entity.MdcProductionEquipment; +import org.jeecg.modules.system.entity.MdcUserProduction; import org.jeecg.modules.system.entity.SysUser; import org.jeecg.modules.system.service.IMdcProductionService; import org.jeecg.modules.system.service.IMdcUserProductionService; @@ -227,8 +228,8 @@ if(mdcProduction == null) { ExceptionCast.cast(DeviceGroupCode.DEVICE_GROUP_NOT_EXIST); } - DeviceGroupPermission permission = deviceGroupPermissionService.getByUserIdAndGroupId(userId, mdcProduction.getId()); - if(permission == null) + MdcUserProduction mdcUserProduction=mdcUserProductionService.getByUserIdAndGroupId(userId,mdcProduction.getId()); + if(mdcUserProduction == null) return false; return true; }else if(nodeType == 2) { @@ -298,14 +299,14 @@ ExceptionCast.cast(DeviceGroupCode.DEVICE_GROUP_PERM_ERROR); } //鑾峰彇鍒嗙粍涓嬫墍鏈夌殑瀛愬垎缁� - List<MdcProduction> childrenList = mdcProductionService.queryProdByPid(mdcProduction.getId()); + List<MdcProduction> childrenList = mdcProductionService.recursionChildrenByPid(mdcProduction.getId()); List<String> childrenIds = new ArrayList<>(); if(childrenList != null && !childrenList.isEmpty()) { childrenList.forEach(item -> { childrenIds.add(item.getId()); boolean b = checkDevicePerm(1, item.getId()); if(b) { - b = deviceGroupPermissionService.assignAddUser(mdcProduction, userList); + b = deviceGroupPermissionService.assignAddUser(item, userList); if(!b) { ExceptionCast.cast(DeviceGroupCode.DEVICE_GROUP_PERM_ERROR); } @@ -488,14 +489,14 @@ ExceptionCast.cast(DeviceGroupCode.DEVICE_GROUP_PERM_ERROR); } //鑾峰彇鍒嗙粍涓嬫墍鏈夌殑瀛愬垎缁� - List<MdcProduction> childrenList = mdcProductionService.queryProdByPid(mdcProduction.getId()); + List<MdcProduction> childrenList = mdcProductionService.recursionChildrenByPid(mdcProduction.getId()); List<String> childrenIds = new ArrayList<>(); if(childrenList != null && !childrenList.isEmpty()) { childrenList.forEach(item -> { childrenIds.add(item.getId()); boolean b = checkDevicePerm(1, item.getId()); if(b) { - b = deviceGroupPermissionService.assignRemoveUser(mdcProduction, userList); + b = deviceGroupPermissionService.assignRemoveUser(item, userList); if(!b) { ExceptionCast.cast(DeviceGroupCode.DEVICE_GROUP_PERM_ERROR); } -- Gitblit v1.9.3