| | |
| | | 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); |
| | | } |
| | |
| | | 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); |
| | | } |