lyh
2025-02-20 47b5de28773c5cf551ff9cbebd36e9c49c17609f
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);
                        }