Compare commits

...
2 Commits
11 changed files with 80 additions and 15 deletions

No files matched your search

@@ -1036,7 +1036,7 @@ public sealed class ApprovalsController(
items.AddRange(await gradeBatches.WhereApprovalBefore(x => x.SubmittedAt, cutoff).OrderByApprovalTime(x => x.SubmittedAt, oldestFirst).ThenBy(x => x.Id).Take(take)
.Select(x => new ApprovalItem(x.Id, "GradeSubmissionBatch", "部分成绩审核",
$"《{x.GradeSheet!.TeachingTask!.Course!.Name}》", "部分学生成绩待审核",
x.SubmittedAt, x.GradeSheet.TeachingTask.Course.College!.Name)).ToListAsync(ct));
x.SubmittedAt, x.GradeSheet.TeachingTask.Course.College!.Name, null, x.GradeSheetId)).ToListAsync(ct));
AddCount("GradeSubmissionBatch", await gradeBatches.WhereApprovalBefore(x => x.SubmittedAt, cutoff).CountAsync(ct));
var experimentGrades = Scoped<ExperimentGradeSheet>(x => x.Status == ExperimentGradeSheetStatus.Submitted && x.ExperimentProject!.TeachingTask!.Status == TeachingTaskStatus.Published);
@@ -1264,11 +1264,12 @@ public sealed class ComprehensiveAssessmentsController(
[Authorize(Roles = Reviewers)]
public async Task<ActionResult> PendingDeclarations(
int page = 1, int pageSize = 30, Guid? batchId = null, string? keyword = null,
CancellationToken token = default)
CancellationToken token = default, Guid? id = null)
{
page = Math.Max(page, 1);
pageSize = Math.Clamp(pageSize, 10, 100);
var query = PendingDeclarationScope(db.ComprehensiveAssessmentDeclarations.AsNoTracking());
if (id.HasValue) query = query.Where(x => x.Id == id.Value);
if (batchId.HasValue) query = query.Where(x => x.ComprehensiveAssessmentBatchId == batchId);
if (!string.IsNullOrWhiteSpace(keyword))
{
@@ -1350,13 +1351,14 @@ public sealed class ComprehensiveAssessmentsController(
public async Task<ActionResult> GetAppeals(
int page = 1, int pageSize = 30, Guid? batchId = null,
ComprehensiveAssessmentAppealStatus? status = null, string? keyword = null,
CancellationToken token = default)
CancellationToken token = default, Guid? id = null)
{
page = Math.Max(page, 1);
pageSize = Math.Clamp(pageSize, 10, 100);
var studentId = AssessmentScope.Scope == DataScope.Self ? await CurrentStudentIdAsync(token) : null;
var query = db.ComprehensiveAssessmentAppeals.AsNoTracking();
query = studentId.HasValue ? query.Where(x => x.StudentId == studentId) : ApplyAppealScope(query);
if (id.HasValue) query = query.Where(x => x.Id == id.Value);
if (batchId.HasValue) query = query.Where(x => x.ComprehensiveAssessmentBatchId == batchId);
if (status.HasValue) query = query.Where(x => x.Status == status);
if (!string.IsNullOrWhiteSpace(keyword))
@@ -786,9 +786,10 @@ public sealed class DormitoryServicesController(
[Authorize(Roles = Viewers)]
public async Task<ActionResult> GetApplications(DormitoryApplicationStatus? status = null,
DormitoryApplicationType? type = null, int? page = null, int? pageSize = null,
CancellationToken ct = default)
CancellationToken ct = default, Guid? id = null)
{
var source = ApplyApplicationScope(db.DormitoryApplications.AsNoTracking());
if (id.HasValue) source = source.Where(x => x.Id == id.Value);
if (status.HasValue) source = source.Where(x => x.Status == status.Value);
if (type.HasValue) source = source.Where(x => x.Type == type.Value);
var ordered = source.OrderByDescending(x => x.SubmittedAt).ThenByDescending(x => x.Id);
Loaded 3 of 11 files, more files were not shown because too many files have changed in this diff. Show more