|
@@ -1,5 +1,6 @@
|
|
|
package com.jpsoft.bus.modules.bus.service.impl;
|
|
|
|
|
|
+import com.github.pagehelper.Page;
|
|
|
import com.jpsoft.bus.modules.bus.dto.StationStatusDTO;
|
|
|
import com.jpsoft.bus.modules.bus.entity.*;
|
|
|
import com.jpsoft.bus.modules.bus.service.*;
|
|
@@ -36,6 +37,9 @@ public class GpsServiceImpl implements GpsService {
|
|
|
@Autowired
|
|
|
private RestTemplate restTemplate;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private StationSubInfoService stationSubInfoService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private VehicleInfoService vehicleInfoService;
|
|
|
|
|
@@ -305,8 +309,6 @@ public class GpsServiceImpl implements GpsService {
|
|
|
if (shiftInfoList.size() > 0) {
|
|
|
ShiftInfo shiftInfo = shiftInfoList.get(0);
|
|
|
|
|
|
-
|
|
|
-
|
|
|
RouteInfo routeInfo = routeInfoService.get(shiftInfo.getRouteId());
|
|
|
|
|
|
List<StationInfo> stationInfoList = stationInfoService.findByRouteId(routeInfo.getId());
|
|
@@ -394,6 +396,36 @@ public class GpsServiceImpl implements GpsService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //gps修改站点时,查询是否有附属站点
|
|
|
+ if (!manual){
|
|
|
+
|
|
|
+ Double lo = Double.valueOf(vehicleInfo.getLongitude());
|
|
|
+ Double la = Double.valueOf(vehicleInfo.getLatestAddress());
|
|
|
+
|
|
|
+ //50米
|
|
|
+ Double maxLo = lo + 0.0005D;
|
|
|
+ Double minLo = lo - 0.0005D;
|
|
|
+ Double maxLa = la + 0.0004D;
|
|
|
+ Double minLa = la - 0.0004D;
|
|
|
+
|
|
|
+
|
|
|
+ Map<String, Object> searchParams = new HashMap<>();
|
|
|
+ searchParams.put("maxLongitude", maxLo);
|
|
|
+ searchParams.put("minLongitude", minLo);
|
|
|
+ searchParams.put("maxLatitude", maxLa);
|
|
|
+ searchParams.put("minLatitude", minLa);
|
|
|
+ searchParams.put("startStationId",shiftInfo.getStartStationId());
|
|
|
+ searchParams.put("endStationId",shiftInfo.getEndStationId());
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("create_time", "desc"));
|
|
|
+ Page<StationSubInfo> page = stationSubInfoService.pageSearch(searchParams,1,1,false,sortList);
|
|
|
+ List<StationSubInfo> stationSubInfoList = page.getResult();
|
|
|
+ if (stationSubInfoList.size()>0){
|
|
|
+ StationSubInfo stationSubInfo = stationSubInfoList.get(0);
|
|
|
+ currentStationId = stationSubInfo.getStationId();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
return currentStationId;
|