|
@@ -2235,7 +2235,8 @@ public class GeoHazardMonitorTokenController {
|
|
|
VehiclePosition vehiclePosition = vehiclePositionService.getOne(new LambdaQueryWrapper<VehiclePosition>().eq(VehiclePosition::getVehicleCode, baseTerminalLog.getTrainNum()).orderByDesc(VehiclePosition::getCreateTime).last("limit 1"));
|
|
|
VehiclePosition positionServiceOne = vehiclePositionService.getOne(new LambdaQueryWrapper<VehiclePosition>().eq(VehiclePosition::getVehicleCode, baseTerminalLog.getFrontTrainNum()).orderByDesc(VehiclePosition::getCreateTime).last("limit 1"));
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
- map.put("frontVehicleDistance", vehiclePosition.getTravelMile()-positionServiceOne.getTravelMile());
|
|
|
+ int dif= vehiclePosition.getTravelMile()-positionServiceOne.getTravelMile();
|
|
|
+ map.put("frontVehicleDistance", Math.abs(dif));
|
|
|
AjaxResults1 = new AjaxResults(1, "ok", map);
|
|
|
}else {
|
|
|
AjaxResults1 = new AjaxResults(1, "ok");
|