|  |  | 
 |  |  |         List<JkSketchLine> jkSketchLineList = jkSketchLineMapper.selectJoinList(JkSketchLine.class,queryWrapper); | 
 |  |  |  | 
 |  |  |         telecomLineCountVO.setCategoryNum(sketchList.size()); | 
 |  |  |         telecomLineCountVO.setLineNum(sketchList.stream().map(i->i.getBeforeLineNum()).reduce(Constants.ZERO,Integer::sum)); | 
 |  |  |  | 
 |  |  | //        telecomLineCountVO.setLineNum(sketchList.stream().map(i->i.getBeforeLineNum()).reduce(Constants.ZERO,Integer::sum)); | 
 |  |  |         Integer lineNum = Constants.ZERO; | 
 |  |  |         List<TelecomCategoryDataVO> telecomCategoryDataVOList = new ArrayList<>(); | 
 |  |  |         for (JkSketch jkSketch:sketchList) { | 
 |  |  |             TelecomCategoryDataVO telecomCategoryDataVO = new TelecomCategoryDataVO(); | 
 |  |  | 
 |  |  |             //优化后数据 | 
 |  |  |             List<JkSketchLine> afterList = childLineList.stream() | 
 |  |  |                     .filter(i->Constants.equalsInteger(i.getType(),Constants.ONE)&&Constants.equalsInteger(i.getIsdeleted(),Constants.ZERO)).collect(Collectors.toList()); | 
 |  |  |  | 
 |  |  |             lineNum = lineNum + (Constants.equalsInteger(jkSketch.getOptStatus(),Constants.ZERO)?beforeList.size():afterList.size()); | 
 |  |  |             List<TelecomLineDataVO> telecomLineDataVOList = new ArrayList<>(); | 
 |  |  |             for (JkSketchLine sketchLine:beforeList) { | 
 |  |  |                 JkSketchLine finalSketchLine = sketchLine; | 
 |  |  |                 List<JkSketchLine> afterSelectList = afterList.stream().filter(i->Constants.equalsInteger(i.getLineId(), finalSketchLine.getLineId())).collect(Collectors.toList()); | 
 |  |  |                 if(afterSelectList.size()>Constants.ZERO){ | 
 |  |  |                     sketchLine = afterSelectList.get(Constants.ZERO); | 
 |  |  |                 } | 
 |  |  |             for (JkSketchLine sketchLine: Constants.equalsInteger(jkSketch.getOptStatus(),Constants.ZERO)?beforeList:afterList) { | 
 |  |  | //                JkSketchLine finalSketchLine = sketchLine; | 
 |  |  | //                List<JkSketchLine> afterSelectList = afterList.stream().filter(i->Constants.equalsInteger(i.getLineId(), finalSketchLine.getLineId())).collect(Collectors.toList()); | 
 |  |  | //                if(afterSelectList.size()>Constants.ZERO){ | 
 |  |  | //                    sketchLine = afterSelectList.get(Constants.ZERO); | 
 |  |  | //                } | 
 |  |  |                 TelecomLineDataVO telecomLineDataVO = new TelecomLineDataVO(); | 
 |  |  |                 telecomLineDataVO.setId(sketchLine.getId()); | 
 |  |  |                 telecomLineDataVO.setName(sketchLine.getLineName()); | 
 |  |  | 
 |  |  |             telecomCategoryDataVO.setTelecomLineDataVOList(telecomLineDataVOList); | 
 |  |  |             telecomCategoryDataVOList.add(telecomCategoryDataVO); | 
 |  |  |         } | 
 |  |  |         telecomLineCountVO.setLineNum(lineNum); | 
 |  |  |         telecomLineCountVO.setTelecomCategoryDataVOList(telecomCategoryDataVOList); | 
 |  |  |         return telecomLineCountVO; | 
 |  |  |     } | 
 |  |  | 
 |  |  |             telecomCategoryDataVO.setDistance( | 
 |  |  |                     beforeList.stream().map(i->i.getDistance()).reduce(Long.valueOf(0),Long::sum) | 
 |  |  |             ); | 
 |  |  |             //优化后数据 | 
 |  |  |             List<JkSketchLine> afterList = jkSketchLineList.stream() | 
 |  |  |                     .filter(i->Constants.equalsInteger(i.getSketchId(),jkSketch.getId())&&Constants.equalsInteger(i.getType(),Constants.ONE)&&Constants.equalsInteger(i.getIsdeleted(),Constants.ZERO)).collect(Collectors.toList()); | 
 |  |  |             if(org.apache.commons.collections.CollectionUtils.isEmpty(afterList)){ | 
 |  |  |             if(Constants.equalsInteger(jkSketch.getOptStatus(),Constants.ZERO)){ | 
 |  |  |                 telecomCategoryDataVO.setDistanceAfter(telecomCategoryDataVO.getDistance()); | 
 |  |  |             }else if(beforeList.size()>afterList.size()){ | 
 |  |  |             }else{ | 
 |  |  |                 //优化后数据 | 
 |  |  |                 List<JkSketchLine> afterList = jkSketchLineList.stream() | 
 |  |  |                         .filter(i->Constants.equalsInteger(i.getSketchId(),jkSketch.getId())&&Constants.equalsInteger(i.getType(),Constants.ONE)&&Constants.equalsInteger(i.getIsdeleted(),Constants.ZERO)).collect(Collectors.toList()); | 
 |  |  |  | 
 |  |  |                 Long distanceAfter = 0L; | 
 |  |  |                 for (JkSketchLine jkSketchLine:beforeList) { | 
 |  |  |                     List<JkSketchLine> afterSelectList = afterList.stream().filter(i->Constants.equalsInteger(i.getLineId(),jkSketchLine.getLineId())).collect(Collectors.toList()); | 
 |  |  |                     if(afterSelectList.size()>Constants.ZERO){ | 
 |  |  |                         distanceAfter = distanceAfter + afterSelectList.get(Constants.ZERO).getDistance(); | 
 |  |  |                     }else{ | 
 |  |  |                 for (JkSketchLine jkSketchLine:afterList) { | 
 |  |  |                         distanceAfter = distanceAfter + jkSketchLine.getDistance(); | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |                 telecomCategoryDataVO.setDistanceAfter(distanceAfter); | 
 |  |  |             }else{ | 
 |  |  |                 telecomCategoryDataVO.setDistanceAfter( | 
 |  |  |                         afterList.stream().map(i->i.getDistance()).reduce(Long.valueOf(0),Long::sum) | 
 |  |  |                 ); | 
 |  |  |  | 
 |  |  |             } | 
 |  |  |             telecomCategoryDataVOList.add(telecomCategoryDataVO); | 
 |  |  |         } | 
 |  |  | 
 |  |  |                 .eq(JkSketchLine::getIsdeleted,Constants.ZERO) | 
 |  |  |                 .eq(Objects.nonNull(telecomLineInfoDTO.getCategoryId()),JkSketchLine::getCategoryId,telecomLineInfoDTO.getCategoryId()) | 
 |  |  |                 .eq(Objects.nonNull(telecomLineInfoDTO.getLineId()),JkSketchLine::getLineId,telecomLineInfoDTO.getLineId()) | 
 |  |  |                 .apply(" ( t.TYPE = t1.OPT_STATUS ) ") | 
 |  |  |                 .eq(JkSketch::getDateInfo, telecomLineInfoDTO.getDateInfo()); | 
 |  |  |         List<JkSketchLine> jkSketchLineList = jkSketchLineMapper.selectJoinList(JkSketchLine.class,queryWrapper); | 
 |  |  |         List<JkSketchLine> returnLineList = jkSketchLineMapper.selectJoinList(JkSketchLine.class,queryWrapper); | 
 |  |  |  | 
 |  |  |         //优化前数据 | 
 |  |  |         List<JkSketchLine> beforeList = jkSketchLineList.stream() | 
 |  |  |                 .filter(i->Constants.equalsInteger(i.getType(),Constants.ZERO)).collect(Collectors.toList()); | 
 |  |  |  | 
 |  |  |         //优化后数据 | 
 |  |  |         List<JkSketchLine> afterList = jkSketchLineList.stream() | 
 |  |  |                 .filter(i->Constants.equalsInteger(i.getType(),Constants.ONE)&&Constants.equalsInteger(i.getIsdeleted(),Constants.ZERO)).collect(Collectors.toList()); | 
 |  |  |  | 
 |  |  |         List<JkSketchLine> returnLineList = new ArrayList<>(); | 
 |  |  |         for (JkSketchLine jkSketchLine:beforeList) { | 
 |  |  |             List<JkSketchLine> afterSelectList = afterList.stream().filter(i->Constants.equalsInteger(i.getLineId(),jkSketchLine.getLineId())).collect(Collectors.toList()); | 
 |  |  |             if(afterSelectList.size()>Constants.ZERO){ | 
 |  |  |                 returnLineList.add(afterList.get(Constants.ZERO)); | 
 |  |  |             }else{ | 
 |  |  |                 returnLineList.add(jkSketchLine); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  | //        //优化前数据 | 
 |  |  | //        List<JkSketchLine> beforeList = jkSketchLineList.stream() | 
 |  |  | //                .filter(i->Constants.equalsInteger(i.getType(),Constants.ZERO)).collect(Collectors.toList()); | 
 |  |  | // | 
 |  |  | //        //优化后数据 | 
 |  |  | //        List<JkSketchLine> afterList = jkSketchLineList.stream() | 
 |  |  | //                .filter(i->Constants.equalsInteger(i.getType(),Constants.ONE)&&Constants.equalsInteger(i.getIsdeleted(),Constants.ZERO)).collect(Collectors.toList()); | 
 |  |  | // | 
 |  |  | //        List<JkSketchLine> returnLineList = new ArrayList<>(); | 
 |  |  | //        for (JkSketchLine jkSketchLine:beforeList) { | 
 |  |  | //            List<JkSketchLine> afterSelectList = afterList.stream().filter(i->Constants.equalsInteger(i.getLineId(),jkSketchLine.getLineId())).collect(Collectors.toList()); | 
 |  |  | //            if(afterSelectList.size()>Constants.ZERO){ | 
 |  |  | //                returnLineList.add(afterList.get(Constants.ZERO)); | 
 |  |  | //            }else{ | 
 |  |  | //                returnLineList.add(jkSketchLine); | 
 |  |  | //            } | 
 |  |  | //        } | 
 |  |  |         List<TelecomLineDataVO> dataVOList = new ArrayList<>(); | 
 |  |  |         if(org.apache.commons.collections.CollectionUtils.isNotEmpty(returnLineList)){ | 
 |  |  |             //获取所有地图经纬度数据 |