| | |
| | | // 读取订单ID的JSON文件内容 |
| | | try { |
| | | String jsonContent = new String(Files.readAllBytes(Paths.get(jsonFilePath))); |
| | | System.out.println("JSON 文件内容:" + jsonContent); |
| | | List<ServeCoordinate> coordinate = JSONObject.parseObject(jsonContent, List.class); |
| | | // 订单轨迹信息 |
| | | ServeCoordinate data = new ServeCoordinate(); |
| | |
| | | String nowStr = now.format(formatter); |
| | | |
| | | |
| | | redisService.setCacheObject("MARK:"+workerId+":"+nowStr,longitude + "," + latitude); |
| | | redisService.setCacheObject("MARK:"+workerId+":"+nowStr,longitude + "," + latitude, 10L, TimeUnit.MINUTES); |
| | | |
| | | String cacheObject = redisService.getCacheObject("MARK:" + workerId + ":" + formattedTime); |
| | | if (cacheObject!=null){ |
| | |
| | | System.err.println("-----当前距离"+distance); |
| | | //如果超出一定范围,存入Mark文件 |
| | | if (distance<50){ |
| | | redisService.setCacheObject("TIME:"+workerId,LocalDateTime.now()); |
| | | redisService.setCacheObject("TIME:"+workerId,LocalDateTime.now(), 10L, TimeUnit.MINUTES); |
| | | marker(longitude,latitude); |
| | | } |
| | | } |
| | |
| | | // 读取订单ID的JSON文件内容 |
| | | try { |
| | | String jsonContent = new String(Files.readAllBytes(Paths.get(jsonFilePath))); |
| | | System.out.println("JSON 文件内容:" + jsonContent); |
| | | List<ServeCoordinate> coordinate = JSONObject.parseObject(jsonContent, List.class); |
| | | // 订单轨迹信息 |
| | | ServeCoordinate data = new ServeCoordinate(); |