| | |
| | | |
| | | AtomicInteger finalIndex = new AtomicInteger(1); |
| | | List<String> cableTags = insOrderMapper.selectSampleCableTag(insSample.getId()); |
| | | max = cableTags.size(); |
| | | max = Math.max(cableTags.size(),1); |
| | | //处理电缆配置检测项 |
| | | Map<String, List<SampleProductExportDto>> tempMap = new HashMap<>(); |
| | | Map<String, List<SampleProductExportDto>> tempMap2 = new HashMap<>(); |
| | |
| | | tempMap.putAll(listMap); |
| | | sortSampleProduct(tempMap,totalItem); |
| | | int tagNum = Math.min(max,maxCableTag); |
| | | List<String> tagList = cableTags.subList(0,tagNum); |
| | | handlerSampleItems(totalItem,finalIndex,sampleList,tagNum,text,rows,rowRenderData,resultCh,tagList,true); |
| | | List<String> tagList = cableTags.isEmpty()?new ArrayList<>():cableTags.subList(0,tagNum); |
| | | handlerSampleItems(OrderType.WG.getValue(),totalItem,finalIndex,sampleList,tagNum,text,rows,rowRenderData,resultCh,tagList,true); |
| | | |
| | | if(CollectionUtil.isNotEmpty(tempMap2)){ |
| | | sortSampleProduct(tempMap2,cableTagEnclosureItem); |
| | |
| | | List<TextRenderData> newText = new ArrayList<TextRenderData>(); |
| | | List<RowRenderData> newRows = new ArrayList<>(); |
| | | RowRenderData newRowRenderData = null; |
| | | handlerSampleItems(cableTagEnclosureItem,finalIndex2, new ArrayList<>(),newCableTags.size(),newText,newRows,newRowRenderData,resultCh,newCableTags,true); |
| | | handlerSampleItems(OrderType.WG.getValue(),cableTagEnclosureItem,finalIndex2, new ArrayList<>(),newCableTags.size(),newText,newRows,newRowRenderData,resultCh,newCableTags,true); |
| | | tableRenderData2.setRows(newRows); |
| | | tableRenderData2.setTableStyle(setTableStyle(newCableTags.size())); |
| | | HashMap<String, Object> tableMap = new HashMap<>(); |
| | |
| | | |
| | | |
| | | AtomicInteger finalIndex = new AtomicInteger(1); |
| | | handlerSampleItems(item,finalIndex,sampleList,max,text,rows,rowRenderData,resultCh,null,true); |
| | | handlerSampleItems(OrderType.RAW.getValue(), item,finalIndex,sampleList,max,text,rows,rowRenderData,resultCh,null,true); |
| | | tableRenderData.setRows(rows); |
| | | tableRenderData.setTableStyle(setTableStyle(max)); |
| | | |
| | |
| | | * @param rowRenderData |
| | | * @param resultCh |
| | | */ |
| | | private static void handlerSampleItems(Map<String, List<SampleProductExportDto>> item,AtomicInteger finalIndex,List<SampleProductExportDto> sampleList,Integer max,List<TextRenderData> text,List<RowRenderData> rows,RowRenderData rowRenderData,AtomicReference<String> resultCh,List<String> cableTagList,Boolean hasAddHead ){ |
| | | private static void handlerSampleItems(String orderType,Map<String, List<SampleProductExportDto>> item,AtomicInteger finalIndex,List<SampleProductExportDto> sampleList,Integer max,List<TextRenderData> text,List<RowRenderData> rows,RowRenderData rowRenderData,AtomicReference<String> resultCh,List<String> cableTagList,Boolean hasAddHead ){ |
| | | item.forEach((s, sampleProductDtoInside) -> { |
| | | // 添加检验项 |
| | | SampleProductExportDto dto2 = new SampleProductExportDto(); |
| | |
| | | String productName = productDto2.getInspectionItemClass() + productDto2.getInspectionItem() + productDto2.getCableTag(); |
| | | if (map.containsKey(productName)) { |
| | | // 如果名称已经存在,添加 lastValue 值到 lastValueList 列表 |
| | | if(CollectionUtil.isEmpty(map.get(productName).getLastValueList())){ |
| | | if(CollectionUtil.isEmpty(map.get(productName).getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(),orderType)){ |
| | | map.get(productName) |
| | | .getLastValueList() |
| | | .add(productDto2.getLastValue()); |
| | |
| | | .add(productDto2.getInsResult()); |
| | | } else { |
| | | // 如果名称不存在,直接放入 map |
| | | if(CollectionUtil.isEmpty(productDto2.getLastValueList())){ |
| | | if(CollectionUtil.isEmpty(productDto2.getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(),orderType)){ |
| | | productDto2.setLastValueList(new ArrayList<>()); // 检验内容 |
| | | productDto2.getLastValueList().add(productDto2.getLastValue()); |
| | | } |
| | |
| | | String productName = productDto2.getInspectionItemClass() + productDto2.getInspectionItem() + productDto2.getInspectionItemSubclass() + productDto2.getCableTag(); |
| | | if (map.containsKey(productName)) { |
| | | // 如果名称已经存在,添加 lastValue 值到 lastValueList 列表 |
| | | if(CollectionUtil.isEmpty(map.get(productName).getLastValueList())){ |
| | | if(CollectionUtil.isEmpty(map.get(productName).getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(),orderType)){ |
| | | map.get(productName) |
| | | .getLastValueList() |
| | | .add(productDto2.getLastValue()); |
| | |
| | | .add(productDto2.getInsResult()); |
| | | } else { |
| | | // 如果名称不存在,直接放入 map |
| | | if(CollectionUtil.isEmpty(productDto2.getLastValueList())){ |
| | | if(CollectionUtil.isEmpty(productDto2.getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(),orderType)){ |
| | | productDto2.setLastValueList(new ArrayList<>()); // 检验内容 |
| | | productDto2.getLastValueList().add(productDto2.getLastValue()); |
| | | } |