Commit 5d678c3c authored by jiaorz's avatar jiaorz

预订时间处理bug

parent 85e02085
...@@ -64,19 +64,15 @@ public class VehicleBookHourInfoBiz extends BaseBiz<VehicleBookHourInfoMapper, V ...@@ -64,19 +64,15 @@ public class VehicleBookHourInfoBiz extends BaseBiz<VehicleBookHourInfoMapper, V
int endHour = new DateTime(endDate).hourOfDay().get(); int endHour = new DateTime(endDate).hourOfDay().get();
//获取开始天的预定小时 //获取开始天的预定小时
int startPredictableHour = 0; int startPredictableHour = 0;
if(hour > 0 ) { for (int curentHour = hour; curentHour <= 23; curentHour++) {
for (int curentHour = hour; curentHour <= 24; curentHour++) { startPredictableHour |= 1 << (curentHour);
startPredictableHour |= 1 << (curentHour - 1);
} }
}
//获取结束天的预定小时 //获取结束天的预定小时
int endPredictableHour = 0; int endPredictableHour = 0;
if(endHour > 0) { for (int curentHour = 0; curentHour <= endHour; curentHour++) {
for (int curentHour = 0; curentHour < endHour; curentHour++) {
endPredictableHour |= 1 << (curentHour); endPredictableHour |= 1 << (curentHour);
} }
}
DateTime startDay = DateTime.parse(DateTime.parse(bookStartDate, DEFAULT_DATE_TIME_FORMATTER).toString(DATE_TIME_FORMATTER), DATE_TIME_FORMATTER); DateTime startDay = DateTime.parse(DateTime.parse(bookStartDate, DEFAULT_DATE_TIME_FORMATTER).toString(DATE_TIME_FORMATTER), DATE_TIME_FORMATTER);
DateTime endDay = DateTime.parse(DateTime.parse(bookEndDate, DEFAULT_DATE_TIME_FORMATTER).toString(DATE_TIME_FORMATTER), DATE_TIME_FORMATTER); DateTime endDay = DateTime.parse(DateTime.parse(bookEndDate, DEFAULT_DATE_TIME_FORMATTER).toString(DATE_TIME_FORMATTER), DATE_TIME_FORMATTER);
...@@ -204,10 +200,15 @@ public class VehicleBookHourInfoBiz extends BaseBiz<VehicleBookHourInfoMapper, V ...@@ -204,10 +200,15 @@ public class VehicleBookHourInfoBiz extends BaseBiz<VehicleBookHourInfoMapper, V
} }
public static void main(String[] args) throws Exception{ // public static void main(String[] args) throws Exception{
// VehicleBookHourInfoBiz vehicleBookHourInfoBiz = new VehicleBookHourInfoBiz();
Integer a = 7936 & 2047; // Map<String, Integer> map = vehicleBookHourInfoBiz.getPredictableHours("2019-08-26 10:00:00", "2019-08-27 10:00:00", Boolean.TRUE);
System.out.println(a); // for(Map.Entry<String, Integer> entry : map.entrySet()) {
} // System.out.println(entry.getKey());
// System.out.println(entry.getValue());
// }
// Integer a = 7936 & 2047;
// System.out.println(a);
// }
} }
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