获取各预约时间段预约情况bug-fix
This commit is contained in:
@@ -15,7 +15,7 @@ public class FreeBusyInfo {
|
||||
private String endTime;
|
||||
|
||||
@ApiModelProperty("是否空闲")
|
||||
private boolean isFree;
|
||||
private boolean free;
|
||||
|
||||
@ApiModelProperty("预约人数")
|
||||
private Integer appointmentCount;
|
||||
@@ -23,22 +23,21 @@ public class FreeBusyInfo {
|
||||
@ApiModelProperty("是否被预约")
|
||||
private Boolean booked;
|
||||
|
||||
public FreeBusyInfo(String startTime, String endTime, boolean isFree) {
|
||||
public FreeBusyInfo(String startTime, String endTime, boolean free) {
|
||||
this.startTime = startTime;
|
||||
this.endTime = endTime;
|
||||
this.isFree = isFree;
|
||||
this.free = free;
|
||||
}
|
||||
|
||||
public FreeBusyInfo(String startTime, String endTime) {
|
||||
this.startTime = startTime;
|
||||
this.endTime = endTime;
|
||||
this.isFree = isFree;
|
||||
}
|
||||
|
||||
public FreeBusyInfo(String startTime, String endTime, boolean isFree, Integer appointmentCount, Boolean booked) {
|
||||
public FreeBusyInfo(String startTime, String endTime, boolean free, Integer appointmentCount, Boolean booked) {
|
||||
this.startTime = startTime;
|
||||
this.endTime = endTime;
|
||||
this.isFree = isFree;
|
||||
this.free = free;
|
||||
this.appointmentCount = appointmentCount;
|
||||
this.booked = booked;
|
||||
}
|
||||
@@ -59,12 +58,12 @@ public class FreeBusyInfo {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public boolean isFree() {
|
||||
return isFree;
|
||||
public boolean getFree() {
|
||||
return free;
|
||||
}
|
||||
|
||||
public void setFree(boolean free) {
|
||||
isFree = free;
|
||||
this.free = free;
|
||||
}
|
||||
|
||||
public Integer getAppointmentCount() {
|
||||
|
||||
@@ -722,7 +722,7 @@ public class InterviewServiceImpl implements InterviewService {
|
||||
//2.1 PC 端和小程序查询的开始和结束时间不同
|
||||
String startTimeSuffix = " 10:00:00";
|
||||
String endTimeSuffix = " 17:00:00";
|
||||
if (request.getWhetherPC()) {
|
||||
if (Boolean.TRUE.equals(request.getWhetherPC())) {
|
||||
startTimeSuffix = " 00:00:00";
|
||||
endTimeSuffix = " 23:59:59";
|
||||
}
|
||||
|
||||
@@ -86,10 +86,10 @@ public class TimeSlotGenerator {
|
||||
List<FreeBusyInfo> hourSlots = new ArrayList<>();
|
||||
|
||||
for (int hour = 10; hour < 17; hour++) {
|
||||
String startTime = String.format("%02d:00", hour);
|
||||
String endTime = String.format("%02d:00", hour + 1);
|
||||
String startTime = String.format("%02d:00:00", hour);
|
||||
String endTime = String.format("%02d:00:00", hour + 1);
|
||||
//默认空闲
|
||||
FreeBusyInfo hourSlot = new FreeBusyInfo(startTime, endTime, true);
|
||||
FreeBusyInfo hourSlot = new FreeBusyInfo(startTime, endTime, true, 0, false);
|
||||
hourSlots.add(hourSlot);
|
||||
}
|
||||
|
||||
@@ -104,14 +104,14 @@ public class TimeSlotGenerator {
|
||||
if(hour == 12){
|
||||
continue;
|
||||
}
|
||||
String startTime = String.format("%02d:00", hour);
|
||||
String endTime = String.format("%02d:30", hour);
|
||||
String startTime = String.format("%02d:00:00", hour);
|
||||
String endTime = String.format("%02d:30:00", hour);
|
||||
//默认空闲
|
||||
FreeBusyInfo hourSlot = new FreeBusyInfo(startTime, endTime, true);
|
||||
FreeBusyInfo hourSlot = new FreeBusyInfo(startTime, endTime, true, 0, false);
|
||||
hourSlots.add(hourSlot);
|
||||
|
||||
String startTime2 = String.format("%02d:30", hour);
|
||||
String endTime2 = String.format("%02d:00", hour + 1);
|
||||
String startTime2 = String.format("%02d:30:00", hour);
|
||||
String endTime2 = String.format("%02d:00:00", hour + 1);
|
||||
//默认空闲
|
||||
FreeBusyInfo hourSlot2 = new FreeBusyInfo(startTime2, endTime2, true, 0, false);
|
||||
hourSlots.add(hourSlot2);
|
||||
@@ -124,14 +124,14 @@ public class TimeSlotGenerator {
|
||||
|
||||
//循环打印半小时的时间段
|
||||
for (int hour = 8; hour < 24; hour++) {
|
||||
String startTime = String.format("%02d:00", hour);
|
||||
String endTime = String.format("%02d:30", hour);
|
||||
String startTime = String.format("%02d:00:00", hour);
|
||||
String endTime = String.format("%02d:30:00", hour);
|
||||
//默认空闲
|
||||
FreeBusyInfo hourSlot = new FreeBusyInfo(startTime, endTime, true);
|
||||
FreeBusyInfo hourSlot = new FreeBusyInfo(startTime, endTime, true, 0, false);
|
||||
hourSlots.add(hourSlot);
|
||||
|
||||
String startTime2 = String.format("%02d:30", hour);
|
||||
String endTime2 = String.format("%02d:00", hour + 1);
|
||||
String startTime2 = String.format("%02d:30:00", hour);
|
||||
String endTime2 = String.format("%02d:00:00", hour + 1);
|
||||
//默认空闲,预约人数为 0
|
||||
FreeBusyInfo hourSlot2 = new FreeBusyInfo(startTime2, endTime2, true, 0, false);
|
||||
hourSlots.add(hourSlot2);
|
||||
|
||||
Reference in New Issue
Block a user