预约时间调整

This commit is contained in:
俞扬
2023-08-29 16:58:04 +08:00
parent ee172131ed
commit 1fac8e9935
2 changed files with 24 additions and 3 deletions

View File

@@ -225,7 +225,7 @@ public class HyPartnerInterviewPlanServiceImpl implements HyPartnerInterviewPlan
//更新会议开始时间为5分钟之内的房间状态为开启,会议状态变为已开始
Date startTime = new Date();
List<HyPartnerLineInfoDO> waitForOpenInterviewLineList = hyPartnerLineInfoMapper.getWaitForOpenInterviewLineList(DateUtil.offsetDay(startTime,-2), DateUtil.offsetMinute(startTime, 5));
List<HyPartnerLineInfoDO> waitForOpenInterviewLineList = hyPartnerLineInfoMapper.getWaitForOpenInterviewLineList(DateUtil.offsetDay(startTime,-1), DateUtil.offsetMinute(startTime, 5));
if(CollectionUtils.isEmpty(waitForOpenInterviewLineList)){
return;
}

View File

@@ -1,6 +1,7 @@
package com.cool.store.service.impl;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.cool.store.utils.StringUtil;
import com.cool.store.vo.interview.CalendarInfo;
import com.cool.store.vo.interview.FreeBusyInfo;
@@ -17,7 +18,7 @@ public class TimeSlotGenerator {
List<CalendarInfo> daySlots = generateDaySlots(startDate, endDate);
for (CalendarInfo daySlot : daySlots) {
System.out.println(daySlot);
System.out.println(JSON.toJSON(daySlot));
}
}
@@ -36,7 +37,7 @@ public class TimeSlotGenerator {
int day = startCal.get(Calendar.DAY_OF_MONTH);
int dayOfWeek = startCal.get(Calendar.DAY_OF_WEEK);
List<FreeBusyInfo> hourSlots = generateHourSlots();
List<FreeBusyInfo> hourSlots = generateHalfHourSlots();
CalendarInfo daySlot = new CalendarInfo(transDayOfWeek(dayOfWeek),
String.valueOf(year),
StringUtil.addZeroForNum(String.valueOf(month),2),
@@ -65,6 +66,26 @@ public class TimeSlotGenerator {
return hourSlots;
}
private static List<FreeBusyInfo> generateHalfHourSlots() {
List<FreeBusyInfo> hourSlots = new ArrayList<>();
//循环打印半小时的时间段
for (int hour = 10; hour < 17; hour++) {
String startTime = String.format("%02d:00", hour);
String endTime = String.format("%02d:30", hour);
//默认空闲
FreeBusyInfo hourSlot = new FreeBusyInfo(startTime, endTime, true);
hourSlots.add(hourSlot);
String startTime2 = String.format("%02d:30", hour);
String endTime2 = String.format("%02d:00", hour + 1);
//默认空闲
FreeBusyInfo hourSlot2 = new FreeBusyInfo(startTime2, endTime2, true);
hourSlots.add(hourSlot2);
}
return hourSlots;
}
public static int transDayOfWeek(int dayOfWeek) {
switch (dayOfWeek) {
case 1: