| | |
| | | @Lazy |
| | | private IProcessStreamService processStreamService; |
| | | @Autowired |
| | | private IWorkStepService workStepService; |
| | | @Autowired |
| | | private IDocInfoService docInfoService; |
| | | @Autowired |
| | | private INcLogInfoService iNcLogInfoService; |
| | |
| | | |
| | | @Override |
| | | public List<CommonGenericTree> loadProductTree(String userId) { |
| | | //todo 翻译创建人修改人 |
| | | //产品 |
| | | List<ProductInfo> productInfoList = getByUserPerms(userId); |
| | | if(productInfoList == null || productInfoList.isEmpty()) |
| | | return Collections.emptyList(); |
| | | //部件 |
| | | List<ComponentExt> componentInfoList = componentInfoService.getByUserPermsAs(userId); |
| | | if(componentInfoList == null) |
| | | componentInfoList = Collections.emptyList(); |
| | | //零件 |
| | | List<PartsInfo> partsInfos = partsInfoService.getByUserPerms(userId); |
| | | if(partsInfos == null) |
| | | partsInfos = Collections.emptyList(); |
| | | return ProductTreeWrapper.loadTree(productInfoList, componentInfoList, partsInfos); |
| | | //工序 |
| | | List<ProcessStream> processStreams=processStreamService.getByuserPerms(userId); |
| | | if(processStreams==null) |
| | | processStreams = Collections.emptyList(); |
| | | //工步 |
| | | List<WorkStep> workStepList=workStepService.getByUserPerms(userId); |
| | | if(workStepList==null) |
| | | workStepList = Collections.emptyList(); |
| | | return ProductTreeWrapper.loadTree(productInfoList, componentInfoList, partsInfos,processStreams,workStepList); |
| | | } |
| | | |
| | | @Override |
| | |
| | | List<ProductInfo> productInfos = this.getByUserPerms(userId, queryParam); |
| | | List<ComponentInfo> componentInfos = componentInfoService.getByUserPerms(userId, queryParam); |
| | | List<PartsInfo> partsInfos = partsInfoService.getByUserPerms(userId, null, queryParam); |
| | | |
| | | List<ProcessStream> processStreams=processStreamService.getByuserPerms(userId, queryParam); |
| | | List<WorkStep> workSteps=workStepService.getByUserPerms(userId, queryParam); |
| | | List<ComponentInfo> componentInfoList = new ArrayList<>(); |
| | | List<ProductInfo> productInfoList = new ArrayList<>(); |
| | | |
| | |
| | | |
| | | if(!componentInfoMap.containsKey(p.getComponentId())) { |
| | | component = componentInfoService.getById(p.getComponentId()); |
| | | if(component != null) { |
| | | componentInfoMap.put(component.getComponentId(), component); |
| | | componentInfoList.add(component); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | for (ProcessStream processStream : processStreams) { |
| | | if (!productInfoMap.containsKey(processStream.getProductId())) { |
| | | product = super.getById(processStream.getProductId()); |
| | | if(product != null) { |
| | | productInfoMap.put(product.getProductId(), product); |
| | | productInfoList.add(product); |
| | | } |
| | | } |
| | | |
| | | if(!componentInfoMap.containsKey(processStream.getComponentId())) { |
| | | component = componentInfoService.getById(processStream.getComponentId()); |
| | | if(component != null) { |
| | | componentInfoMap.put(component.getComponentId(), component); |
| | | componentInfoList.add(component); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | for (WorkStep workStep :workSteps){ |
| | | if (!productInfoMap.containsKey(workStep.getProductId())) { |
| | | product = super.getById(workStep.getProductId()); |
| | | if(product != null) { |
| | | productInfoMap.put(product.getProductId(), product); |
| | | productInfoList.add(product); |
| | | } |
| | | } |
| | | |
| | | if(!componentInfoMap.containsKey(workStep.getComponentId())) { |
| | | component = componentInfoService.getById(workStep.getComponentId()); |
| | | if(component != null) { |
| | | componentInfoMap.put(component.getComponentId(), component); |
| | | componentInfoList.add(component); |
| | |
| | | //转换数据 |
| | | List<ComponentExt> componentExtList = ComponentExt.convertToExtList(componentInfoList); |
| | | |
| | | return ProductTreeWrapper.loadTree(productInfoList, componentExtList, partsInfos); |
| | | return ProductTreeWrapper.loadTree(productInfoList, componentExtList, partsInfos,processStreams,workSteps); |
| | | } |
| | | } |