| | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.List; |
| | | import java.util.concurrent.ExecutorService; |
| | | import java.util.concurrent.Executors; |
| | | import java.util.function.Predicate; |
| | |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import com.ruoyi.utils.tools.Point; |
| | | import com.ruoyi.scheduling.domian.SchedulingParam; |
| | | import com.ruoyi.sy.domain.ArdSyCarDay; |
| | | import com.ruoyi.sy.mapper.ArdSyCarDayMapper; |
| | |
| | | public List<Map<String, Object>> getNearCarWithPolygon(SchedulingParam param) { |
| | | List<Map<String, Object>> filteredList = new ArrayList<>(); |
| | | try { |
| | | List<Point2D> partitionLocation = param.getPartitionLocation(); |
| | | List<Point> partitionLocation = param.getPartitionLocation(); |
| | | if (partitionLocation == null) { |
| | | log.debug("多边形坐标集合为空"); |
| | | return null; |
| | |
| | | List<Map<String, Object>> carGPSMap = (List<Map<String, Object>>) carGPSTrack.get("list"); |
| | | Double lng = Double.valueOf((String) carGPSMap.get(0).get("lng")); |
| | | Double lat = Double.valueOf((String) carGPSMap.get(0).get("lat")); |
| | | Point2D point2D = new Point2D.Double(lng, lat); |
| | | boolean inPolygon = GisTool.isInPolygon(point2D, partitionLocation); |
| | | Point point = new Point(lng, lat); |
| | | boolean inPolygon = GisTool.isInPolygon(point, partitionLocation); |
| | | if (inPolygon) { |
| | | carMap.put("longitude", lng); |
| | | carMap.put("latitude", lat); |