Commit a7f7b28e authored by 周健威's avatar 周健威

修改天数计算方式

parent 1df770f4
...@@ -246,7 +246,7 @@ public class OrderCalculateBiz { ...@@ -246,7 +246,7 @@ public class OrderCalculateBiz {
bookDays += 1; bookDays += 1;
} }
if((0 == bookDays) && (bookTimeLag > 0)) { if(0 == bookDays) {
bookDays = 1; bookDays = 1;
} }
return bookDays; return bookDays;
......
...@@ -195,7 +195,7 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements ...@@ -195,7 +195,7 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
} }
bookVehicleId = pageDataVO.getData().get(0).getId(); bookVehicleId = pageDataVO.getData().get(0).getId();
} }
//判断是否为今天,如果是则设置为一分钟后开始 //判断是否为今天,如果是则设置为30秒后开始 防止预约开始时间比当前时间 要 前
if(DateUtil.today().equals(dto.getBookStartDate())) { if(DateUtil.today().equals(dto.getBookStartDate())) {
LocalDateTime ldt = LocalDateTime.ofInstant(Instant.ofEpochMilli(System.currentTimeMillis()), ZoneOffset.ofHours(8)).plusSeconds(30L); LocalDateTime ldt = LocalDateTime.ofInstant(Instant.ofEpochMilli(System.currentTimeMillis()), ZoneOffset.ofHours(8)).plusSeconds(30L);
dto.setBookStartDate(DateTimeFormatter.ofPattern(DATE_TIME_LINE).format(ldt)); dto.setBookStartDate(DateTimeFormatter.ofPattern(DATE_TIME_LINE).format(ldt));
......
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