| | |
| | | } |
| | | return new Response().setII(1,bl,withOutDwg.replace(fileDirName,""),"原始文件相对路径"); |
| | | } |
| | | |
| | | public void getFixItem() { |
| | | List<ProductBomHistory> bomHistoryList = mapper.selectList(null); |
| | | Map<Integer, List<ProductBomHistory>> productMap = bomHistoryList.stream().collect(Collectors.groupingBy(ProductBomHistory::getProductId)); |
| | | Set<Integer> productIdSet = productMap.keySet(); |
| | | List<ProductBomHistory> needToDealWith = new LinkedList<>(); |
| | | for (Integer productId : productIdSet) { |
| | | List<ProductBomHistory> bomList = productMap.get(productId); |
| | | Map<Integer, List<ProductBomHistory>> materialIdMap = bomList.stream().collect(Collectors.groupingBy(ProductBomHistory::getMaterialId)); |
| | | Set<Integer> materialIdSet = materialIdMap.keySet(); |
| | | for (Integer materialId : materialIdSet) { |
| | | List<ProductBomHistory> temp = materialIdMap.get(materialId); |
| | | if(temp.size()!=1){ |
| | | System.err.println("需要手动处理的productBomHistory和productBom:"+productId+",物料id:"+materialId); |
| | | needToDealWith.add(temp.get(0)); |
| | | } |
| | | } |
| | | } |
| | | System.err.println("可能需要处理的条数为:"+needToDealWith.size()); |
| | | } |
| | | } |