Commit da90114d authored by jiaorz's avatar jiaorz

Merge remote-tracking branch 'origin/dev' into dev

parents 2263aee2 64eef2b2
...@@ -159,6 +159,7 @@ public class OrderDelayBiz { ...@@ -159,6 +159,7 @@ public class OrderDelayBiz {
//根据订单号获取订单 //根据订单号获取订单
RestResponse restResponse = vehicleFeign.updateOrderBookRecord(new BookVehicleVO() {{ RestResponse restResponse = vehicleFeign.updateOrderBookRecord(new BookVehicleVO() {{
setVehicleId(orderPageVO.getOrderRentVehicleDetail().getVehicleId()); setVehicleId(orderPageVO.getOrderRentVehicleDetail().getVehicleId());
setVehicleBookRecordId(orvd.getBookRecordId());
setBookStartDate(dto.getBookStartDateTime()); setBookStartDate(dto.getBookStartDateTime());
setBookEndDate(dto.getBookEndDateTime()); setBookEndDate(dto.getBookEndDateTime());
setBookStartDateTime(dto.getBookStartDateTime()); setBookStartDateTime(dto.getBookStartDateTime());
......
...@@ -16,6 +16,9 @@ public class BookVehicleVO { ...@@ -16,6 +16,9 @@ public class BookVehicleVO {
@ApiModelProperty("车辆id") @ApiModelProperty("车辆id")
private String vehicleId; private String vehicleId;
/**
* 填写RecordId 修改日期
*/
private Long vehicleBookRecordId; private Long vehicleBookRecordId;
/** /**
......
...@@ -402,7 +402,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR ...@@ -402,7 +402,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
DateTime startDay = DateTime.parse(bookVehicleVo.getBookStartDate(), DATE_TIME_FORMATTER); DateTime startDay = DateTime.parse(bookVehicleVo.getBookStartDate(), DATE_TIME_FORMATTER);
DateTime endDay = DateTime.parse(bookVehicleVo.getBookEndDate(), DATE_TIME_FORMATTER); DateTime endDay = DateTime.parse(bookVehicleVo.getBookEndDate(), DATE_TIME_FORMATTER);
//转换日期范围为列表,并检查是否合法 //转换日期范围为列表,并检查是否合法
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)); 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), bookVehicleVo.getNotCheckTimeLegal());
if (yearMonthAndDate.size() > 3) {//连续的日期最多夸3个月 if (yearMonthAndDate.size() > 3) {//连续的日期最多夸3个月
throw new BaseException(ResultCode.ONLY_BOOK_TWO_MONTH); throw new BaseException(ResultCode.ONLY_BOOK_TWO_MONTH);
} }
...@@ -705,7 +705,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR ...@@ -705,7 +705,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
DateTime startDay = DateTime.parse(bookVehicleVo.getBookStartDate(), DATE_TIME_FORMATTER); DateTime startDay = DateTime.parse(bookVehicleVo.getBookStartDate(), DATE_TIME_FORMATTER);
DateTime endDay = DateTime.parse(bookVehicleVo.getBookEndDate(), DATE_TIME_FORMATTER); DateTime endDay = DateTime.parse(bookVehicleVo.getBookEndDate(), DATE_TIME_FORMATTER);
//转换日期范围为列表,并检查是否合法 //转换日期范围为列表,并检查是否合法
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)); 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), bookVehicleVo.getNotCheckTimeLegal());
if (yearMonthAndDate.size() > 3) {//连续的日期最多夸3个月 if (yearMonthAndDate.size() > 3) {//连续的日期最多夸3个月
throw new BaseException(ResultCode.ONLY_BOOK_TWO_MONTH); throw new BaseException(ResultCode.ONLY_BOOK_TWO_MONTH);
} }
...@@ -827,12 +827,15 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR ...@@ -827,12 +827,15 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
* @param startDay * @param startDay
* @param endDay * @param endDay
*/ */
private void fillDateList4DatePeriod(Map<String, List<String>> yearMonthAndDate, DateTime startDay, DateTime endDay) { private void fillDateList4DatePeriod(Map<String, List<String>> yearMonthAndDate, DateTime startDay, DateTime endDay, Boolean notCheckTimeLegal) {
for (DateTime curDate = startDay; curDate.compareTo(endDay) <= 0; curDate = curDate.plusDays(1)) { for (DateTime curDate = startDay; curDate.compareTo(endDay) <= 0; curDate = curDate.plusDays(1)) {
String curDateStr = curDate.toString(DEFAULT_DATE_TIME_FORMATTER); String curDateStr = curDate.toString(DEFAULT_DATE_TIME_FORMATTER);
if (!Boolean.TRUE.equals(notCheckTimeLegal)) {
//判定时间是否合法
if (curDateStr.compareTo(DateTime.now().toString(DEFAULT_DATE_TIME_FORMATTER)) < 0) { if (curDateStr.compareTo(DateTime.now().toString(DEFAULT_DATE_TIME_FORMATTER)) < 0) {
throw new BaseException(ResultCode.ONLY_BOOK_FROM_TODAY); throw new BaseException(ResultCode.ONLY_BOOK_FROM_TODAY);
} }
}
String curYearMonth = curDate.toString(YEARMONTH_DATE_TIME_FORMATTER); String curYearMonth = curDate.toString(YEARMONTH_DATE_TIME_FORMATTER);
if (!yearMonthAndDate.containsKey(curYearMonth)) { if (!yearMonthAndDate.containsKey(curYearMonth)) {
yearMonthAndDate.put(curYearMonth, Lists.newArrayList()); yearMonthAndDate.put(curYearMonth, Lists.newArrayList());
......
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