whycxzp
2022-08-13 a1371a2912a6ef9b65354bb0d274be5fc3a21359
src/main/java/com/whyc/service/WorksheetLinkService.java
@@ -244,9 +244,12 @@
                bomService.updateUrl(fileBomApprovingList);
            }
            else if(type.intValue() == EnumWorksheetType.Component.getType()){ //散装件
                //将散装件从审批表中转移到正式表
                List<Component> componentList = new LinkedList<>();
                List<ComponentApproving> approvingList = cAService.getListByMainId(link.getMainId());
                List<Component> componentList = new LinkedList<>();
                //区分是新增还是删除
                Integer componentId = approvingList.get(0).getComponentId();
                if(componentId==null) { //新增
                    //将散装件从审批表中转移到正式表
                approvingList.forEach(approve->{
                    Component component = new Component();
                    component.setCategory(approve.getCategory());
@@ -262,6 +265,10 @@
                    componentList.add(component);
                });
                cService.insertBatch(componentList);
                }else{ //删除
                    List<Integer> componentIdList = approvingList.stream().map(ComponentApproving::getComponentId).collect(Collectors.toList());
                    cService.deleteBatch(componentIdList);
                }
                //更新散装件审批子表中type为完结
                cAService.endStatus(link.getMainId());
            }