|
@@ -1110,30 +1110,32 @@ public class DriverApiController {
|
|
|
sysLog.setRemoteIp(HttpUtil.getIpAddress(request));
|
|
|
sysLog.setCreateTime(new Date());
|
|
|
logService.insert(sysLog);
|
|
|
-
|
|
|
- //创建一个站点附属站点
|
|
|
- StationSubInfo stationSubInfo = stationSubInfoService.findByStationIdStartEnd(currentStationId,shiftInfo.getStartStationId(),shiftInfo.getEndStationId());
|
|
|
- if (stationSubInfo == null){
|
|
|
- StationSubInfo stationSubInfo1 = new StationSubInfo();
|
|
|
- stationSubInfo1.setId(UUID.randomUUID().toString());
|
|
|
- stationSubInfo1.setStationId(currentStationId);
|
|
|
- stationSubInfo1.setStartStationId(shiftInfo.getStartStationId());
|
|
|
- stationSubInfo1.setEndStationId(shiftInfo.getEndStationId());
|
|
|
- stationSubInfo1.setLongitude(new Double(vehicleInfo.getLongitude()));
|
|
|
- stationSubInfo1.setLatitude(new Double(vehicleInfo.getLatitude()));
|
|
|
- stationSubInfo1.setRadius(20);
|
|
|
- stationSubInfo1.setCreateTime(new Date());
|
|
|
- stationSubInfoService.insert(stationSubInfo1);
|
|
|
- }else {
|
|
|
- stationSubInfo.setLongitude(new Double(vehicleInfo.getLongitude()));
|
|
|
- stationSubInfo.setLatitude(new Double(vehicleInfo.getLatitude()));
|
|
|
- stationSubInfo.setUpdateTime(new Date());
|
|
|
- stationSubInfoService.update(stationSubInfo);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- //重新计算当前乘客状态
|
|
|
if(vehicleInfo.getLongitude()!=null && vehicleInfo.getLatitude()!=null) {
|
|
|
+ if(currentStation!=null) {
|
|
|
+ //创建一个站点附属站点
|
|
|
+ StationSubInfo stationSubInfo = stationSubInfoService.findByStationIdStartEnd(currentStationId, shiftInfo.getStartStationId(), shiftInfo.getEndStationId());
|
|
|
+ if (stationSubInfo == null) {
|
|
|
+ StationSubInfo stationSubInfo1 = new StationSubInfo();
|
|
|
+ stationSubInfo1.setId(UUID.randomUUID().toString());
|
|
|
+ stationSubInfo1.setStationId(currentStationId);
|
|
|
+ stationSubInfo1.setStartStationId(shiftInfo.getStartStationId());
|
|
|
+ stationSubInfo1.setEndStationId(shiftInfo.getEndStationId());
|
|
|
+ stationSubInfo1.setLongitude(new Double(vehicleInfo.getLongitude()));
|
|
|
+ stationSubInfo1.setLatitude(new Double(vehicleInfo.getLatitude()));
|
|
|
+ stationSubInfo1.setRadius(20);
|
|
|
+ stationSubInfo1.setCreateTime(new Date());
|
|
|
+ stationSubInfoService.insert(stationSubInfo1);
|
|
|
+ } else {
|
|
|
+ stationSubInfo.setLongitude(new Double(vehicleInfo.getLongitude()));
|
|
|
+ stationSubInfo.setLatitude(new Double(vehicleInfo.getLatitude()));
|
|
|
+ stationSubInfo.setUpdateTime(new Date());
|
|
|
+ stationSubInfoService.update(stationSubInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //重新计算当前乘客状态
|
|
|
gpsDataCallback.receive(vehicleInfo.getGpsDeviceNo(),
|
|
|
String.valueOf(vehicleInfo.getLongitude()),
|
|
|
String.valueOf(vehicleInfo.getLatitude()),
|
|
@@ -1146,7 +1148,6 @@ public class DriverApiController {
|
|
|
// String.valueOf(currentStation.getLatitude()),
|
|
|
// true);
|
|
|
// }
|
|
|
-
|
|
|
shiftInfo.setCurrentStationId(currentStationId);
|
|
|
shiftInfo.setUpdateTime(new Date());
|
|
|
shiftInfo.setUpdateBy(subject);
|