| | |
| | | import com.moral.api.service.ManageCoordinateDetailService; |
| | | import com.moral.api.util.RoadUtils; |
| | | import com.moral.constant.RedisConstants; |
| | | import com.moral.util.DateUtils; |
| | | import com.moral.util.TokenUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Transactional |
| | | public Integer batchAll(Map<String, Object> params) { |
| | | params.put("dateFormat", "%Y-%m-%d %H:%i:%s"); |
| | | String type = params.get("type").toString(); |
| | | int coordinateId = Integer.parseInt(params.get("coordinateId").toString()); |
| | | QueryWrapper<ManageCoordinateDetail> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("coordinate_id",coordinateId); |
| | | /* String time1 = params.remove("time1").toString(); |
| | | String time2 = params.remove("time2").toString(); |
| | | long l = DateUtils.compareDateStrDay(time1, time2); |
| | | if (l>0){ |
| | | params.put("time1",time1); |
| | | params.put("time2",time2); |
| | | }else { |
| | | params.put("time1",time2); |
| | | params.put("time2",time1); |
| | | }*/ |
| | | int j =0; |
| | | List<ManageCoordinateDetail> manageCoordinateDetails = manageCoordinateDetailMapper.selectList(queryWrapper); |
| | | // List<CruiserDTO> cruiserInfo = (List<CruiserDTO>) params.get("list"); |
| | | List<HashMap<String, Object>> list = (List<HashMap<String, Object>>) params.get("list"); |
| | | List<CruiserDTO> cruiserInfo = list.stream().distinct() |
| | | .map(map -> { |
| | | List<CruiserDTO> cruiserInfo; |
| | | //区域选择 |
| | | if (type.equals("1")){ |
| | | List<HashMap<String, Object>> list = (List<HashMap<String, Object>>) params.get("list"); |
| | | cruiserInfo = list.stream().distinct() |
| | | .map(map -> { |
| | | |
| | | CruiserDTO p = new CruiserDTO(); |
| | | Double flylat = (Double) map.get("flylat"); |
| | | Double flylon = (Double) map.get("flylon"); |
| | | p.setFlyLat(flylat); |
| | | p.setFlyLon(flylon); |
| | | return p; |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | CruiserDTO p = new CruiserDTO(); |
| | | Double flylat = (Double) map.get("flylat"); |
| | | Double flylon = (Double) map.get("flylon"); |
| | | p.setFlyLat(flylat); |
| | | p.setFlyLon(flylon); |
| | | return p; |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | |
| | | |
| | | // List<CruiserDTO> cruiserInfo = historySecondCruiserMapper.getCruiserInfo(params); |
| | | // cruiserInfo = cruiserInfo.stream().distinct().collect(Collectors.toList()); |
| | | }else { |
| | | //时间段选择 |
| | | String time1 = params.remove("time1").toString(); |
| | | String time2 = params.remove("time2").toString(); |
| | | long l = DateUtils.compareDateStrDay(time1, time2); |
| | | if (l>0){ |
| | | params.put("time1",time1); |
| | | params.put("time2",time2); |
| | | }else { |
| | | params.put("time1",time2); |
| | | params.put("time2",time1); |
| | | } |
| | | cruiserInfo = historySecondCruiserMapper.getCruiserInfo(params); |
| | | cruiserInfo = cruiserInfo.stream().distinct().collect(Collectors.toList()); |
| | | } |
| | | if (ObjectUtils.isEmpty(manageCoordinateDetails)){ |
| | | for (CruiserDTO cruiserDTO : cruiserInfo) { |
| | | Double flyLat = cruiserDTO.getFlyLat(); |