|
@@ -337,10 +337,13 @@ public class GpsServiceImpl implements GpsService {
|
|
|
frontToEnd = false;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
if(frontToEnd){
|
|
|
int n = 0;
|
|
|
for (int i=0;i<stationInfoList.size();i++) {
|
|
|
StationInfo stationInfo = stationInfoList.get(i);
|
|
|
+
|
|
|
+
|
|
|
int distance = stationInfo.getRadius();
|
|
|
if (stationInfo.getRadius() == null){
|
|
|
distance = 100;
|
|
@@ -352,6 +355,19 @@ public class GpsServiceImpl implements GpsService {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
+ StationSubInfo stationSubInfo = stationSubInfoService.findByStationIdStartEnd(stationInfo.getId(),shiftInfo.getStartStationId(),shiftInfo.getEndStationId());
|
|
|
+ if (stationSubInfo != null){
|
|
|
+ StationInfo stationInfo1 = new StationInfo();
|
|
|
+ stationInfo1.setLongitude(stationSubInfo.getLongitude());
|
|
|
+ stationInfo1.setLatitude(stationSubInfo.getLatitude());
|
|
|
+ if(matchDistance(stationInfo,vehicleInfo,20)){
|
|
|
+ currentStationId = stationSubInfo.getStationId();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
if(matchDistance(stationInfo,vehicleInfo,distance)){
|
|
|
currentStationId = stationInfo.getId();
|
|
|
break;
|
|
@@ -371,6 +387,10 @@ public class GpsServiceImpl implements GpsService {
|
|
|
int n = 0;
|
|
|
for (int i=stationInfoList.size() - 1;i>=0;i--) {
|
|
|
StationInfo stationInfo = stationInfoList.get(i);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
int distance = stationInfo.getRadius();
|
|
|
if (stationInfo.getRadius() == null){
|
|
|
distance = 100;
|
|
@@ -381,6 +401,17 @@ public class GpsServiceImpl implements GpsService {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
+ StationSubInfo stationSubInfo = stationSubInfoService.findByStationIdStartEnd(stationInfo.getId(),shiftInfo.getStartStationId(),shiftInfo.getEndStationId());
|
|
|
+ if (stationSubInfo != null){
|
|
|
+ StationInfo stationInfo1 = new StationInfo();
|
|
|
+ stationInfo1.setLongitude(stationSubInfo.getLongitude());
|
|
|
+ stationInfo1.setLatitude(stationSubInfo.getLatitude());
|
|
|
+ if(matchDistance(stationInfo,vehicleInfo,20)){
|
|
|
+ currentStationId = stationSubInfo.getStationId();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if(matchDistance(stationInfo,vehicleInfo,distance)){
|
|
|
currentStationId = stationInfo.getId();
|
|
|
break;
|
|
@@ -397,7 +428,7 @@ public class GpsServiceImpl implements GpsService {
|
|
|
}
|
|
|
|
|
|
//gps修改站点时,查询是否有附属站点
|
|
|
- if (!manual){
|
|
|
+ /*if (!manual){
|
|
|
|
|
|
Double lo = Double.valueOf(vehicleInfo.getLongitude());
|
|
|
Double la = Double.valueOf(vehicleInfo.getLatestAddress());
|
|
@@ -424,7 +455,7 @@ public class GpsServiceImpl implements GpsService {
|
|
|
StationSubInfo stationSubInfo = stationSubInfoList.get(0);
|
|
|
currentStationId = stationSubInfo.getStationId();
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
}
|
|
|
}
|