cjl
9 hours ago bcc076d63c5c2ff473adb5ac15ea242559086000
screen-job/src/main/java/com/moral/api/service/impl/HistorySecondCruiserServiceImpl.java
@@ -63,25 +63,31 @@
        //
        ArrayList<SecondCruiserSort> list1 = new ArrayList<>();
        if (!ObjectUtils.isEmpty(result)){
            for (HistorySecondCruiser historySecondCruiser : result) {
                String mac = historySecondCruiser.getMac();
                Integer organizationId = historySecondCruiser.getOrganizationId();
                List<Integer> orgList = organizationMapper.orgIdSpecialDevList(organizationId, mac);
                if(CollectionUtils.isEmpty(orgList)){
                    return;
                    continue;
                }
                HashMap<String, Object> params = new HashMap<>();
                params.put("mac",mac);
                params.put("startTime",startTime);
                params.put("endTime",endTime);
                List<Map<String, Object>> dusts = historySecondCruiserMapper.getDusts(params);
                if (ObjectUtils.isEmpty(dusts)){
                    continue;
                }
                Map<String, List<DustldDTO>> collect = manageCoordinateDetailMapper.CompareTo(orgList.get(0)).stream().collect(Collectors.groupingBy(o -> o.getName()));
                if (ObjectUtils.isEmpty(dusts) || ObjectUtils.isEmpty(collect)){
                    return;
                if (ObjectUtils.isEmpty(collect)){
                    continue;
                }
                Set<String> strings = collect.keySet();
                int i = 1;
                for (String string : strings) {
                    log.info("当前记录>>>>>>>>>  "+i+"/"+strings.size()+"    >>>>>>>>    "+string+"      >>>>>>");
                    i++;
                    SecondCruiserSort secondCruiserSort = new SecondCruiserSort();
                    ArrayList<Double> doubleArrayList = new ArrayList<>();
                    List<DustldDTO> dustldDTOS = collect.get(string);
@@ -93,7 +99,9 @@
                        }
                        double latDouble1 = Double.parseDouble(flyLat);
                        double lonDouble1 = Double.parseDouble(flyLon);
                        for (Map<String, Object> dust : dusts) {
                        //for (Map<String, Object> dust : dusts) {
                       for( int ii=0;ii<dusts.size();ii++){
                           Map<String, Object> dust = dusts.get(ii);
                            String flyLat1 = Objects.nonNull(dust.get("flyLat")) ? dust.get("flyLat").toString() :"0";
                            String flyLon1 = Objects.nonNull(dust.get("flyLon")) ? dust.get("flyLon").toString() :"0";
                            double latDouble = Double.parseDouble(flyLat1);
@@ -103,6 +111,8 @@
                                Double dustld = Objects.nonNull(dust.get("dustld"))?Double.parseDouble(dust.get("dustld").toString()):0d;
                                doubleArrayList.add(dustld);
//                                break;
                                dusts.remove(ii);
                                ii--;
                            }
                        }
                    }
@@ -121,8 +131,8 @@
            }
        }
        if (!ObjectUtils.isEmpty(list1)){
//            log.info(list1.size()+"");
            secondCruiserSortMapper.insertAll(list1);
            log.info("新增路段排名>>>>>>>> "+list1.size()+" >>>>>>>>>条");
        }
    }