Commit 9668bcf5 authored by jiaorz's avatar jiaorz

出车问题

parent b0a6bbae
......@@ -693,10 +693,10 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
public Boolean bookedVehicle(BookVehicleVO bookVehicleVo) throws Exception {
//提取日期和相应的预定目标日期
Map<String, List<String>> yearMonthAndDate = Maps.newHashMap();
DateTime startDay = DateTime.parse(bookVehicleVo.getBookStartDate(), DEFAULT_DATE_TIME_FORMATTER);
DateTime endDay = DateTime.parse(bookVehicleVo.getBookEndDate(), DEFAULT_DATE_TIME_FORMATTER);
DateTime startDay = DateTime.parse(bookVehicleVo.getBookStartDate(), DATE_TIME_FORMATTER);
DateTime endDay = DateTime.parse(bookVehicleVo.getBookEndDate(), DATE_TIME_FORMATTER);
//转换日期范围为列表,并检查是否合法
fillDateList4DatePeriod(yearMonthAndDate, startDay, endDay);
fillDateList4DatePeriod(yearMonthAndDate, DateTime.parse(startDay.toString(DEFAULT_DATE_TIME_FORMATTER), DEFAULT_DATE_TIME_FORMATTER), DateTime.parse(endDay.toString(DEFAULT_DATE_TIME_FORMATTER), DEFAULT_DATE_TIME_FORMATTER));
if (yearMonthAndDate.size() > 3) {//连续的日期最多夸3个月
throw new BaseException(ResultCode.ONLY_BOOK_TWO_MONTH);
}
......
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