| | |
| | | if (!SmsType.ACCEPT_RIDES.name().equals(smsType)) { |
| | | return null; |
| | | } |
| | | // XpVehicle vehicle = xpVehicleClient.findByVehicleVin(vin).getData(); |
| | | // if (vehicle == null) { |
| | | // return XpCommonResponse.fail(RobotaxiErrorEnum.MOBILE_VIN_MISMATCH); |
| | | // } |
| | | // Integer status = vehicle.getStatus(); |
| | | // Integer operatingStatus = vehicle.getOperatingStatus(); |
| | | // if (status == null || status != 2 || operatingStatus == null || operatingStatus != 1) { |
| | | // return XpCommonResponse.fail(RobotaxiErrorEnum.VEHICLE_NOT_READY); |
| | | // } |
| | | |
| | | XpVehicle vehicle = xpVehicleClient.findByVehicleVin(vin).getData(); |
| | | if (vehicle == null) { |
| | | return XpCommonResponse.fail(RobotaxiErrorEnum.MOBILE_VIN_MISMATCH); |
| | | } |
| | | Integer status = vehicle.getStatus(); |
| | | Integer operatingStatus = vehicle.getOperatingStatus(); |
| | | if (smsType.equals(SmsType.ACCEPT_RIDES.name()) && operatingStatus != 1) { |
| | | return XpCommonResponse.fail(RobotaxiErrorEnum.VEHICLE_NOT_READY); |
| | | } |
| | | if (smsType.equals(SmsType.STOP_ACCEPT_RIDES.name()) && operatingStatus != 3) { |
| | | return XpCommonResponse.fail(RobotaxiErrorEnum.VEHICLE_NOT_READY); |
| | | } |
| | | return null; |
| | | } |
| | | |