升级
This commit is contained in:
1 parent
cec56564b5
commit
ae075bda6d
32 files changed
+10052
-90
No files matched your search
@@ -27,7 +27,7 @@ public sealed class TeacherCourseApplicationsController(
|
||||
public async Task<ActionResult> GetCourseOptions(CancellationToken cancellationToken)
|
||||
{
|
||||
return Ok(await db.Courses.AsNoTracking()
|
||||
.Where(x => x.IsEnabled)
|
||||
.Where(x => x.IsEnabled && !x.IsArchived)
|
||||
.OrderBy(x => x.SortOrder)
|
||||
.ThenBy(x => x.Code)
|
||||
.Select(x => new
|
||||
@@ -95,11 +95,11 @@ public sealed class TeacherCourseApplicationsController(
|
||||
var teacher = await CurrentTeacherAsync(cancellationToken);
|
||||
if (teacher is null) return ConflictProblem("当前账号尚未关联在职教师档案。");
|
||||
if (!await db.AcademicTerms.AnyAsync(
|
||||
x => x.Id == request.AcademicTermId && x.IsEnabled,
|
||||
x => x.Id == request.AcademicTermId && x.IsEnabled && !x.IsArchived,
|
||||
cancellationToken))
|
||||
return ValidationProblem("所选学期不存在或已停用。");
|
||||
if (!await db.Courses.AnyAsync(
|
||||
x => x.Id == request.CourseId && x.IsEnabled,
|
||||
x => x.Id == request.CourseId && x.IsEnabled && !x.IsArchived,
|
||||
cancellationToken))
|
||||
return ValidationProblem("所选课程不存在或已停用。");
|
||||
|
||||
@@ -202,7 +202,7 @@ public sealed class TeacherCourseApplicationsController(
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
var teachers = db.Teachers.AsNoTracking()
|
||||
.Where(x => x.Status == TeacherStatus.Active);
|
||||
.Where(x => x.Status == TeacherStatus.Active && !x.IsArchived);
|
||||
var collegeId = currentUserDataScope.Current.RestrictedCollegeId;
|
||||
if (collegeId.HasValue)
|
||||
teachers = teachers.Where(x => x.CollegeId == collegeId.Value);
|
||||
@@ -222,7 +222,7 @@ public sealed class TeacherCourseApplicationsController(
|
||||
})
|
||||
.ToListAsync(cancellationToken),
|
||||
Courses = await db.Courses.AsNoTracking()
|
||||
.Where(x => x.IsEnabled)
|
||||
.Where(x => x.IsEnabled && !x.IsArchived)
|
||||
.OrderBy(x => x.SortOrder)
|
||||
.ThenBy(x => x.Code)
|
||||
.Select(x => new
|
||||
@@ -246,17 +246,17 @@ public sealed class TeacherCourseApplicationsController(
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
if (!await db.AcademicTerms.AnyAsync(
|
||||
x => x.Id == request.AcademicTermId && x.IsEnabled,
|
||||
x => x.Id == request.AcademicTermId && x.IsEnabled && !x.IsArchived,
|
||||
cancellationToken))
|
||||
return ValidationProblem("所选学期不存在或已停用。");
|
||||
if (!await db.Courses.AnyAsync(
|
||||
x => x.Id == request.CourseId && x.IsEnabled,
|
||||
x => x.Id == request.CourseId && x.IsEnabled && !x.IsArchived,
|
||||
cancellationToken))
|
||||
return ValidationProblem("所选课程不存在或已停用。");
|
||||
|
||||
var teachers = db.Teachers.Where(x =>
|
||||
x.Id == request.TeacherId &&
|
||||
x.Status == TeacherStatus.Active);
|
||||
x.Status == TeacherStatus.Active && !x.IsArchived);
|
||||
var collegeId = currentUserDataScope.Current.RestrictedCollegeId;
|
||||
if (collegeId.HasValue)
|
||||
teachers = teachers.Where(x => x.CollegeId == collegeId.Value);
|
||||
@@ -328,7 +328,7 @@ public sealed class TeacherCourseApplicationsController(
|
||||
x.AcademicTermId == academicTermId &&
|
||||
x.CourseId == courseId &&
|
||||
x.Status == TeacherCourseApplicationStatus.Approved &&
|
||||
x.Teacher!.Status == TeacherStatus.Active);
|
||||
x.Teacher!.Status == TeacherStatus.Active && !x.Teacher.IsArchived);
|
||||
return Ok(await source
|
||||
.OrderBy(x => x.Teacher!.TeacherNumber)
|
||||
.Select(x => new
|
||||
@@ -355,7 +355,7 @@ public sealed class TeacherCourseApplicationsController(
|
||||
{
|
||||
var userId = currentUserDataScope.Current.UserId;
|
||||
return db.Teachers.FirstOrDefaultAsync(
|
||||
x => x.UserId == userId && x.Status == TeacherStatus.Active,
|
||||
x => x.UserId == userId && x.Status == TeacherStatus.Active && !x.IsArchived,
|
||||
cancellationToken);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user