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