Commit cb283c02 authored by jiaorz's avatar jiaorz

添加出车日志

parent 5494b4e4
......@@ -62,10 +62,12 @@ public class VehicleActiveService {
log.info("出车参数: departureVo = {}", departureVo.toString());
Vehicle vehicle = vehicleBiz.selectById(departureVo.getVehicleId());
if (vehicle == null) {
log.info("出车异常,车辆不存在!");
throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getDesc(),
ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getCode());
}
if (StringUtils.isBlank(departureVo.getCheckMan()) || StringUtils.isBlank(departureVo.getCheckManTel())) {
log.error("出车 核销人姓名不能为空!");
throw new BaseException(ResCode.CHECKUSER_AND_PHONE_NOT_NULL.getDesc(),
ResCode.CHECKUSER_AND_PHONE_NOT_NULL.getCode());
}
......@@ -74,7 +76,11 @@ public class VehicleActiveService {
ResCode.VEHICLE_STATUS_IS_NOT_NORMAL.getCode());
}
//添加出车时间过滤 再出车开始时间前一天至结束时间内可以出车,并且预定记录为已审核状态
checkDateInvalid(departureVo);
try {
checkDateInvalid(departureVo);
} catch (BaseException b) {
throw new BaseException(b.getMessage(), b.getStatus());
}
Integer MileageLift = vehicle.getMileageLastUpdate();
Integer MileageLift1 = departureVo.getMileage();
if (MileageLift1 == null) {
......@@ -259,7 +265,7 @@ public class VehicleActiveService {
throw new BaseException(ResCode.VEHICLE_UNBOOK_FAIL.getDesc(), ResCode.VEHICLE_UNBOOK_FAIL.getCode());
}
} catch (Exception e) {
log.info("提前还车失败,bookVehicleVo = {}", bookVehicleVo.toString());
log.error("提前还车失败,bookVehicleVo = {}", bookVehicleVo.toString());
e.printStackTrace();
}
} else if (actualArrivalDate.compareTo(arrivalDate) > 0) {//实际还车时间大于预计还车时间
......@@ -339,6 +345,7 @@ public class VehicleActiveService {
}
}
if (!(startDate.minusDays(1).compareTo(DateTime.now()) <= 0 && DateTime.now().compareTo(endDate) <= 0 && vehicleBookRecord.getStatus() == VehicleBookRecordStatus.APPROVE.getCode() && (list == null || list.size() <= 0))) {
log.error("出车过滤,有正常未还车记录,请按照预定的日期出车");
throw new BaseException(ResCode.VEHICLE_DEPARTURE_DATE_IS_NOT_ABLED.getDesc(),
ResCode.VEHICLE_DEPARTURE_DATE_IS_NOT_ABLED.getCode());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment