| | |
| | | ProcessStream processStream=processStreamService.getById(paramId); |
| | | if(processStream == null) |
| | | ExceptionCast.cast(ProcessInfoCode.PROCESS_NOT_EXIST); |
| | | PermissionStream permission = permissionStreamService.getByProcessIdAndUserId(processStream.getProcessId(),processStream.getComponentId() |
| | | PermissionStream permission = permissionStreamService.getByProcessIdAndUserId(processStream.getProductId(),processStream.getComponentId() |
| | | ,processStream.getPartsId(),processStream.getProcessId(),userId); |
| | | return permission != null; |
| | | }else if (nodeType == 6){ |
| | | WorkStep workStep=workStepService.getById(paramId); |
| | | if(workStep == null) |
| | | ExceptionCast.cast(ProcessInfoCode.WORKSTEP_NOT_EXIST); |
| | | PermissionStream permission = permissionStreamService.getByStepIdAndUserId(workStep.getProcessId(),workStep.getComponentId() |
| | | PermissionStream permission = permissionStreamService.getByStepIdAndUserId(workStep.getProductId(),workStep.getComponentId() |
| | | ,workStep.getPartsId(),workStep.getProcessId(),workStep.getId(),userId); |
| | | return permission != null; |
| | | } |
| | |
| | | String key; |
| | | ComponentDepartment cp; |
| | | ComponentInfo cpInfo; |
| | | for(ComponentInfo c : childrenList){ |
| | | componentIdList.add(c.getComponentId()); |
| | | componentInfoMap.put(c.getComponentId(), c); |
| | | for(MdcProduction mdcProduction : mdcProductionList){ |
| | | key = c.getComponentId() + "," + mdcProduction.getId(); |
| | | cp = new ComponentDepartment(c.getComponentId(), mdcProduction.getId()); |
| | | componentPermissionMap.put(key, cp); |
| | | } |
| | | } |
| | | //查询已存在的权限数据 |
| | | List<ComponentDepartment> existList = componentDepartmentService.getByComponentIdsAndDepartIds(componentIdList, ids); |
| | | if(existList != null && !existList.isEmpty()){ |
| | | //踢出权限数据 |
| | | for(ComponentDepartment permission : existList){ |
| | | key = permission.getComponentId() + "," + permission.getDepartId(); |
| | | if(componentPermissionMap.containsKey(key)){ |
| | | componentPermissionMap.remove(key); |
| | | if(childrenList != null && !childrenList.isEmpty()) { |
| | | for (ComponentInfo c : childrenList) { |
| | | componentIdList.add(c.getComponentId()); |
| | | componentInfoMap.put(c.getComponentId(), c); |
| | | for (MdcProduction mdcProduction : mdcProductionList) { |
| | | key = c.getComponentId() + "," + mdcProduction.getId(); |
| | | cp = new ComponentDepartment(c.getComponentId(), mdcProduction.getId()); |
| | | componentPermissionMap.put(key, cp); |
| | | } |
| | | } |
| | | } |
| | | for(Map.Entry<String, ComponentDepartment> entry : componentPermissionMap.entrySet()){ |
| | | cp = entry.getValue(); |
| | | componentPermissionList.add(cp); |
| | | cpInfo = componentInfoMap.get(cp.getComponentId()); |
| | | s = new PermissionStream(); |
| | | s.setProductId(cpInfo.getProductId()); |
| | | s.setComponentId(cpInfo.getComponentId()); |
| | | s.setDepartId(cp.getDepartId()); |
| | | permissionStreamList.add(s); |
| | | //查询已存在的权限数据 |
| | | List<ComponentDepartment> existList = componentDepartmentService.getByComponentIdsAndDepartIds(componentIdList, ids); |
| | | if (existList != null && !existList.isEmpty()) { |
| | | //踢出权限数据 |
| | | for (ComponentDepartment permission : existList) { |
| | | key = permission.getComponentId() + "," + permission.getDepartId(); |
| | | if (componentPermissionMap.containsKey(key)) { |
| | | componentPermissionMap.remove(key); |
| | | } |
| | | } |
| | | } |
| | | for (Map.Entry<String, ComponentDepartment> entry : componentPermissionMap.entrySet()) { |
| | | cp = entry.getValue(); |
| | | componentPermissionList.add(cp); |
| | | cpInfo = componentInfoMap.get(cp.getComponentId()); |
| | | s = new PermissionStream(); |
| | | s.setProductId(cpInfo.getProductId()); |
| | | s.setComponentId(cpInfo.getComponentId()); |
| | | s.setDepartId(cp.getDepartId()); |
| | | permissionStreamList.add(s); |
| | | } |
| | | } |
| | | |
| | | //处理子零件 |