|
|
|
@ -1,6 +1,8 @@
|
|
|
|
|
package com.ibeetl.jlw.entity;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
import com.ibeetl.admin.core.annotation.Dict;
|
|
|
|
|
import com.ibeetl.admin.core.entity.BaseEntity;
|
|
|
|
|
import com.ibeetl.admin.core.util.ValidateConfig;
|
|
|
|
@ -13,6 +15,8 @@ import javax.validation.constraints.NotNull;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
import static cn.hutool.core.date.DatePattern.NORM_DATE_PATTERN;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* 课程开课-排课管理-课表
|
|
|
|
|
* gen by Spring Boot2 Admin 2022-09-11
|
|
|
|
@ -107,29 +111,19 @@ public class TeacherOpenCourseScheduleSession extends BaseEntity{
|
|
|
|
|
public static class TeacherOpenCourseScheduleSessionTagTemp {
|
|
|
|
|
|
|
|
|
|
//课次名称(支持自定义)
|
|
|
|
|
|
|
|
|
|
private String teacherOpenCourseScheduleSessionTagName;
|
|
|
|
|
|
|
|
|
|
//创建时间
|
|
|
|
|
|
|
|
|
|
private Date teacherOpenCourseScheduleSessionDayTime;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//课程时长(分钟)
|
|
|
|
|
private Integer teacherOpenCourseScheduleSessionTagDuration;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//开始时间
|
|
|
|
|
private String teacherOpenCourseScheduleSessionTagStartTime;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//结束时间
|
|
|
|
|
private String teacherOpenCourseScheduleSessionTagEndTime;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 星期几
|
|
|
|
|
//星期几
|
|
|
|
|
private String teacherOpenCourseScheduleSessionTagWeek;
|
|
|
|
|
|
|
|
|
|
//开始状态
|
|
|
|
|
private teacherOpenCourseScheduleSessionTagStartStatusEnum teacherOpenCourseScheduleSessionTagStartStatus;
|
|
|
|
|
// 教室名称
|
|
|
|
|
private String teacherOpenCourseScheduleSessionClassName;
|
|
|
|
|
|
|
|
|
@ -143,6 +137,40 @@ public class TeacherOpenCourseScheduleSession extends BaseEntity{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 尝试更新开始状态字段
|
|
|
|
|
*/
|
|
|
|
|
private void tryToUpdateStartStatus() {
|
|
|
|
|
if (ObjectUtil.isAllNotEmpty(teacherOpenCourseScheduleSessionDayTime, teacherOpenCourseScheduleSessionTagStartTime, teacherOpenCourseScheduleSessionTagEndTime)) {
|
|
|
|
|
// 精确到日 "yyyy-MM-dd"
|
|
|
|
|
String dayStr = DateUtil.format(teacherOpenCourseScheduleSessionDayTime, NORM_DATE_PATTERN);
|
|
|
|
|
String startTime = String.format("%s %s", dayStr, teacherOpenCourseScheduleSessionTagStartTime);
|
|
|
|
|
String endTime = String.format("%s %s", dayStr, teacherOpenCourseScheduleSessionTagEndTime);
|
|
|
|
|
|
|
|
|
|
DateTime startDateTime = DateUtil.parseDate(startTime);
|
|
|
|
|
DateTime endDateTime = DateUtil.parseDate(endTime);
|
|
|
|
|
|
|
|
|
|
DateUtil.parseDate(startTime).isBefore(startDateTime);
|
|
|
|
|
DateUtil.parseDate(startTime).isIn(startDateTime, endDateTime);
|
|
|
|
|
DateUtil.parseDate(startTime).isAfter(endDateTime);
|
|
|
|
|
|
|
|
|
|
// TODO 未完待续
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 进行中 ING
|
|
|
|
|
* 已结束 END
|
|
|
|
|
* 未开始 READY
|
|
|
|
|
*/
|
|
|
|
|
protected enum teacherOpenCourseScheduleSessionTagStartStatusEnum {
|
|
|
|
|
// 进行中
|
|
|
|
|
ING,
|
|
|
|
|
// 已结束
|
|
|
|
|
END,
|
|
|
|
|
// 未开始
|
|
|
|
|
READY;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|