zouyu
21 小时以前 a40e6b29c5a02c14712d56ffed16e36ce89464ca
inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java
@@ -1798,7 +1798,7 @@
            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<>();
@@ -1828,8 +1828,8 @@
            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);
@@ -1840,7 +1840,7 @@
                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<>();
@@ -1876,7 +1876,7 @@
            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));
@@ -1937,7 +1937,7 @@
     * @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();
@@ -1953,7 +1953,7 @@
                    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());
@@ -1963,7 +1963,7 @@
                                .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());
                        }
@@ -1998,7 +1998,7 @@
                    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());
@@ -2008,7 +2008,7 @@
                                .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());
                        }