| | |
| | | } |
| | | } |
| | | //切割电缆配置项 |
| | | dto.setTell(String.join("\n",tellSet)); |
| | | dto.setTell(String.join("\n",tellSet.stream().sorted(Comparator.naturalOrder()).collect(Collectors.toList()))); |
| | | dto.setLastValueList(lastValueList); |
| | | sampleProductExportDtos.add(dto); |
| | | } |
| | |
| | | enterFactoryReport.setInspectDate(insSampleUser.getInspectDate()); |
| | | } |
| | | |
| | | Map<String, List<SampleProductExportDto>> item = new LinkedHashMap<>();//非电缆配置检测项 |
| | | Map<String, List<SampleProductExportDto>> totalItem = new LinkedHashMap<>();//检测项列表 |
| | | Map<String, List<SampleProductExportDto>> cableTagItem = new LinkedHashMap<>();//电缆配置检测项 |
| | | Map<String, List<SampleProductExportDto>> cableTagEnclosureItem = new LinkedHashMap<>();//电缆配置检测项附件 |
| | | |
| | |
| | | }else{ |
| | | sampleProductExportDtos = transformSampleProduct(cableTags,collect,0,cableTags.size()); |
| | | } |
| | | tempMap.put(key,sampleProductExportDtos); |
| | | cableTagItem.put(key,sampleProductExportDtos); |
| | | } |
| | | sortSampleProduct(tempMap,cableTagItem); |
| | | //处理非电缆配置检测项 |
| | | Map<String, List<SampleProductExportDto>> listMap = filterItems.stream() |
| | | .filter(f -> StringUtils.isBlank(f.getCableTag()) && StringUtils.isNotBlank(f.getInspectionItem())) |
| | | .collect(Collectors.groupingBy(s->s.getInspectionItem()+"&")); |
| | | //合并检测项列表 |
| | | tempMap.putAll(cableTagItem); |
| | | tempMap.putAll(listMap); |
| | | sortSampleProduct(tempMap,totalItem); |
| | | int tagNum = Math.min(max,maxCableTag); |
| | | List<String> tagList = cableTags.subList(0,tagNum); |
| | | handlerSampleItems(cableTagItem,finalIndex,sampleList,tagNum,text,rows,rowRenderData,resultCh,tagList,true); |
| | | handlerSampleItems(totalItem,finalIndex,sampleList,tagNum,text,rows,rowRenderData,resultCh,tagList,true); |
| | | |
| | | if(CollectionUtil.isNotEmpty(tempMap2)){ |
| | | sortSampleProduct(tempMap2,cableTagEnclosureItem); |
| | |
| | | cableTagEnclosureTables.add(tableMap); |
| | | } |
| | | |
| | | //处理非电缆配置检测项 |
| | | Map<String, List<SampleProductExportDto>> listMap = filterItems.stream() |
| | | .filter(f -> StringUtils.isBlank(f.getCableTag()) && StringUtils.isNotBlank(f.getInspectionItem())) |
| | | .collect(Collectors.groupingBy(SampleProductExportDto::getInspectionItem)); |
| | | sortSampleProduct(listMap,item); |
| | | text = new ArrayList<>(); |
| | | sampleList = new ArrayList<>(); |
| | | handlerSampleItems(item,finalIndex,sampleList,tagNum,text,rows,rowRenderData,resultCh,cableTags,false); |
| | | tableRenderData.setRows(rows); |
| | | tableRenderData.setTableStyle(setTableStyle(tagNum)); |
| | | if (!resultCh.get().equals("")) { |
| | | if (!resultCh.get().isEmpty()) { |
| | | resultCh.set("经检验," + resultCh.get() + "所检项目不合格,其余所检项目均合格。(盖章有效)"); |
| | | } else { |
| | | resultCh.set("本产品符合相关标准要求,经检验合格准予出厂(盖章有效)"); |
| | |
| | | Map<String, List<SampleProductExportDto>> sortedMap = sampleProductDto2s.stream() |
| | | .filter(sampleProductDto2 -> StringUtils.isNotBlank(sampleProductDto2.getInspectionItem())) |
| | | .collect(Collectors.groupingBy(SampleProductExportDto::getInspectionItem)); |
| | | // List<Map.Entry<String, List<SampleProductExportDto>>> entries = new ArrayList<>(sortedMap.entrySet()); |
| | | // entries.sort(Comparator.comparingInt(o -> (o.getValue().get(0).getSort() == null ? 0 : o.getValue().get(0).getSort()))); |
| | | // // 创建一个 LinkedHashMap 来保持插入顺序 |
| | | Map<String, List<SampleProductExportDto>> item = new LinkedHashMap<>(); |
| | | // for (Map.Entry<String, List<SampleProductExportDto>> entry : entries) { |
| | | // item.put(entry.getKey(), entry.getValue()); |
| | | // } |
| | | sortSampleProduct(sortedMap,item); |
| | | |
| | | |
| | |
| | | // 处理集合 |
| | | Map<String, SampleProductExportDto> map = new LinkedHashMap<>(); |
| | | for (SampleProductExportDto productDto2 : sampleProductDtoInside) { |
| | | String productName = productDto2.getInspectionItemClass() + productDto2.getInspectionItem(); |
| | | String productName = productDto2.getInspectionItemClass() + productDto2.getInspectionItem() + productDto2.getCableTag(); |
| | | if (map.containsKey(productName)) { |
| | | // 如果名称已经存在,添加 lastValue 值到 lastValueList 列表 |
| | | if(CollectionUtil.isEmpty(map.get(productName).getLastValueList())){ |
| | |
| | | // 处理集合 |
| | | Map<String, SampleProductExportDto> map = new LinkedHashMap<>(); |
| | | for (SampleProductExportDto productDto2 : sampleProductDtoInside) { |
| | | String productName = productDto2.getInspectionItemClass() + productDto2.getInspectionItem() + productDto2.getInspectionItemSubclass(); |
| | | String productName = productDto2.getInspectionItemClass() + productDto2.getInspectionItem() + productDto2.getInspectionItemSubclass() + productDto2.getCableTag(); |
| | | if (map.containsKey(productName)) { |
| | | // 如果名称已经存在,添加 lastValue 值到 lastValueList 列表 |
| | | if(CollectionUtil.isEmpty(map.get(productName).getLastValueList())){ |
| | |
| | | |
| | | // 检验项目 |
| | | TextRenderData middleRenderData2 = new TextRenderData(); |
| | | middleRenderData2.setText(sample.getInspectionName()+"∑"+sample.getInspectionName()+i); |
| | | String[] split = sample.getInspectionName().split("&"); |
| | | String itemName = split.length>0?split[0]:sample.getInspectionName(); |
| | | middleRenderData2.setText(itemName+"∑"+itemName+i+"_"+finalIndex); |
| | | Style middleStyle2 = new Style(); |
| | | middleStyle2.setFontFamily("宋体"); |
| | | middleStyle2.setColor("000000"); |