选课批次:时间窗口、退课截止、学分上限、开放/关闭。
教学班投放:容量、班级范围、全校开放。 学生选退课:容量、重复课程、学分上限、课表冲突校验。 教学班实时名单。 校级、学院级、学生角色分级操作。 SQLite 本地增量升级及演示数据。 MySQL 正式 EF Core 迁移。 Vue 已编译进 wwwroot,单服务运行无需 npm run dev。 学生端和管理端均完成桌面、手机响应式检查。
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
using Jiaowu.Api.Domain.Academic;
|
||||
using Jiaowu.Api.Infrastructure.Scheduling;
|
||||
|
||||
namespace Jiaowu.Api.Infrastructure.CourseSelection;
|
||||
|
||||
public static class CourseSelectionRules
|
||||
{
|
||||
public static bool IsSelectionOpen(CourseSelectionRound round, DateTime nowUtc) =>
|
||||
round.Status == CourseSelectionRoundStatus.Open &&
|
||||
nowUtc >= round.StartsAt &&
|
||||
nowUtc <= round.EndsAt;
|
||||
|
||||
public static bool CanWithdraw(CourseSelectionRound round, DateTime nowUtc) =>
|
||||
round.Status == CourseSelectionRoundStatus.Open &&
|
||||
nowUtc <= round.WithdrawalEndsAt;
|
||||
|
||||
public static bool HasScheduleConflict(
|
||||
IEnumerable<ScheduleEntry> candidateEntries,
|
||||
IEnumerable<ScheduleEntry> selectedEntries) =>
|
||||
candidateEntries.Any(candidate =>
|
||||
selectedEntries.Any(selected =>
|
||||
ScheduleConflictDetector.TimeOverlaps(candidate, selected)));
|
||||
}
|
||||
Reference in New Issue
Block a user