Commit f9d396d6309416852f174112a4c2d60344e6acf1
1 parent
f6997c4b
查询车辆某时刻营运状态与最近到离站接口加字段:车牌号、终点站名。
Showing
2 changed files
with
13 additions
and
4 deletions
src/main/java/com/bsth/repository/ScheduleRealInfoRepository.java
| @@ -93,8 +93,8 @@ public interface ScheduleRealInfoRepository extends PagingAndSortingRepository<S | @@ -93,8 +93,8 @@ public interface ScheduleRealInfoRepository extends PagingAndSortingRepository<S | ||
| 93 | @Query(value = " select bc_type from bsth_c_s_sp_info where id = ?1 ", nativeQuery = true) | 93 | @Query(value = " select bc_type from bsth_c_s_sp_info where id = ?1 ", nativeQuery = true) |
| 94 | List<String> findoOriginalType(Long spId); | 94 | List<String> findoOriginalType(Long spId); |
| 95 | 95 | ||
| 96 | - @Query(value = " select equipment_code from bsth_c_cars where inside_code = ?1 ", nativeQuery = true) | ||
| 97 | - List<String> findDeviceId(String nbbm); | 96 | + @Query(value = " select equipment_code, car_plate from bsth_c_cars where inside_code = ?1 ", nativeQuery = true) |
| 97 | + List<Object[]> findDeviceId(String nbbm); | ||
| 98 | 98 | ||
| 99 | @Query(value = " select station_name, b_jwpoints from bsth_c_station where station_cod = ?1 ", nativeQuery = true) | 99 | @Query(value = " select station_name, b_jwpoints from bsth_c_station where station_cod = ?1 ", nativeQuery = true) |
| 100 | List<Object[]> findStationName(String stationCode); | 100 | List<Object[]> findStationName(String stationCode); |
src/main/java/com/bsth/server_rs/bigdata/BigdataService.java
| @@ -2220,6 +2220,9 @@ public class BigdataService { | @@ -2220,6 +2220,9 @@ public class BigdataService { | ||
| 2220 | String inOut = ""; | 2220 | String inOut = ""; |
| 2221 | String bLongitude = ""; | 2221 | String bLongitude = ""; |
| 2222 | String bLatitude = ""; | 2222 | String bLatitude = ""; |
| 2223 | + String qdzName = ""; | ||
| 2224 | + String zdzName = ""; | ||
| 2225 | + String pzh = ""; | ||
| 2223 | 2226 | ||
| 2224 | List<ScheduleRealInfo> findByDateAndNbbm = scheduleRealInfoRepository.findByDateAndNbbm(dateStr, nbbm); | 2227 | List<ScheduleRealInfo> findByDateAndNbbm = scheduleRealInfoRepository.findByDateAndNbbm(dateStr, nbbm); |
| 2225 | 2228 | ||
| @@ -2270,12 +2273,15 @@ public class BigdataService { | @@ -2270,12 +2273,15 @@ public class BigdataService { | ||
| 2270 | lineName = temp.getXlName(); | 2273 | lineName = temp.getXlName(); |
| 2271 | lineCode = temp.getXlBm(); | 2274 | lineCode = temp.getXlBm(); |
| 2272 | dir = temp.getXlDir(); | 2275 | dir = temp.getXlDir(); |
| 2276 | + qdzName = temp.getQdzName(); | ||
| 2277 | + zdzName = temp.getZdzName(); | ||
| 2273 | } | 2278 | } |
| 2274 | 2279 | ||
| 2275 | String deviceId = ""; | 2280 | String deviceId = ""; |
| 2276 | - List<String> findDeviceId = scheduleRealInfoRepository.findDeviceId(nbbm); | 2281 | + List<Object[]> findDeviceId = scheduleRealInfoRepository.findDeviceId(nbbm); |
| 2277 | if(findDeviceId != null && findDeviceId.size() > 0){ | 2282 | if(findDeviceId != null && findDeviceId.size() > 0){ |
| 2278 | - deviceId = findDeviceId.get(0); | 2283 | + deviceId = findDeviceId.get(0)[0].toString(); |
| 2284 | + pzh = findDeviceId.get(0)[1].toString(); | ||
| 2279 | } | 2285 | } |
| 2280 | 2286 | ||
| 2281 | Connection conn = null; | 2287 | Connection conn = null; |
| @@ -2343,6 +2349,9 @@ public class BigdataService { | @@ -2343,6 +2349,9 @@ public class BigdataService { | ||
| 2343 | resJson.put("inOut", inOut); | 2349 | resJson.put("inOut", inOut); |
| 2344 | resJson.put("bLongitude", bLongitude); | 2350 | resJson.put("bLongitude", bLongitude); |
| 2345 | resJson.put("bLatitude", bLatitude); | 2351 | resJson.put("bLatitude", bLatitude); |
| 2352 | + resJson.put("startStationName", qdzName); | ||
| 2353 | + resJson.put("endStationName", zdzName); | ||
| 2354 | + resJson.put("carPlate", pzh); | ||
| 2346 | 2355 | ||
| 2347 | }catch(Exception e){ | 2356 | }catch(Exception e){ |
| 2348 | logger.error("", e); | 2357 | logger.error("", e); |