| | |
| | | System.err.println("司机没有上传位置信息"); |
| | | |
| | | //调用获取轨迹中的数据 |
| | | List<Map<String, Object>> list = orderPositionService.queryTrack(orderId, 2); |
| | | if(list.size() > 0){ |
| | | Map<String, Object> map = list.get(list.size() - 1); |
| | | value = map.get("lon") + "," + map.get("lat"); |
| | | File file = new File(filePath + orderId + "_1.txt"); |
| | | if(file.exists()){ |
| | | //读取文件(字符流) |
| | | BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file),"UTF-8")); |
| | | //循环取出数据 |
| | | String str = null; |
| | | StringBuffer sb = new StringBuffer(); |
| | | while ((str = in.readLine()) != null) { |
| | | sb.append(str); |
| | | } |
| | | List<OrderPosition> list = JSONArray.parseArray(sb.toString(), OrderPosition.class); |
| | | if(list.size() > 0){ |
| | | OrderPosition orderPosition = list.get(list.size() - 1); |
| | | value = orderPosition.getLon() + "," + orderPosition.getLat(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | String lnt = (null != value ? value.split(",")[0] : "0.0"); |
| | | String lat = (null != value ? value.split(",")[1] : "0.0"); |