Route student record changes through auditable workflows
This commit is contained in:
1 parent
d513f001b7
commit
db7b137148
15 files changed
+12444
-27
No files matched your search
@@ -1370,7 +1370,7 @@ public sealed class ApprovalsController(
|
||||
private async Task NotifyCollege(GradeModification gm, CancellationToken ct) { await NotificationService.SendToRoleAsync(db, SystemRoles.CollegeAdmin, "成绩修改待审核", $"{gm.GradeRecord!.Student!.Name} — 《{gm.GradeRecord.GradeSheet!.TeachingTask!.Course!.Name}》{gm.CurrentScore}→{gm.RequestedScore}", cancellationToken: ct, category: NotificationCategory.Grade); }
|
||||
private async Task NotifyRole(string role, string title, string content, CancellationToken ct) { await NotificationService.SendToRoleAsync(db, role, title, content, cancellationToken: ct, category: NotificationCategory.Approval); }
|
||||
|
||||
private static string SSCLabel(StudentStatusChangeType t) => t switch { StudentStatusChangeType.Suspension => "休学", StudentStatusChangeType.Resumption => "复学", StudentStatusChangeType.Withdrawal => "退学", StudentStatusChangeType.Enlistment => "入伍保留学籍", StudentStatusChangeType.Demotion => "降级", StudentStatusChangeType.ClassTransfer => "转班", StudentStatusChangeType.MajorTransfer => "转专业", _ => "异动" };
|
||||
private static string SSCLabel(StudentStatusChangeType t) => t switch { StudentStatusChangeType.Suspension => "休学", StudentStatusChangeType.Resumption => "复学", StudentStatusChangeType.Withdrawal => "退学", StudentStatusChangeType.Enlistment => "入伍保留学籍", StudentStatusChangeType.Demotion => "降级", StudentStatusChangeType.ClassTransfer => "转班", StudentStatusChangeType.MajorTransfer => "转专业", StudentStatusChangeType.DataCorrection => "档案纠错", _ => "异动" };
|
||||
private static string CALabel(CourseAdjustmentType t) => t switch { CourseAdjustmentType.Reschedule => "调课", CourseAdjustmentType.Cancel => "停课", CourseAdjustmentType.Makeup => "补课", CourseAdjustmentType.Substitute => "代课", _ => "调停课" };
|
||||
private ActionResult ConflictProblem(string d) => Conflict(new ProblemDetails { Title = "无法完成", Detail = d, Status = 409 });
|
||||
}
|
||||
|
||||
@@ -426,6 +426,8 @@ public sealed class PersonnelController(
|
||||
return Forbid();
|
||||
|
||||
if (entity.IsArchived) return ConflictProblem("已归档人员请先恢复后再编辑。");
|
||||
if (entity.Status != request.Status || entity.AdministrativeClassId != request.AdministrativeClassId)
|
||||
return ConflictProblem("现有学生的学籍状态或行政班不能在档案编辑中直接修改,请通过学籍异动或档案纠错办理。");
|
||||
entity.StudentNumber = request.StudentNumber.Trim();
|
||||
entity.Name = request.Name.Trim();
|
||||
entity.Gender = request.Gender;
|
||||
|
||||
@@ -361,6 +361,11 @@ public sealed class PersonnelExcelController(
|
||||
errors.Add($"第 {row.RowNumber} 行:学号“{number}”已属于无权维护的学院。");
|
||||
continue;
|
||||
}
|
||||
if (entity is not null && (entity.Status != status.Value || entity.AdministrativeClassId != targetClass.Id))
|
||||
{
|
||||
errors.Add($"第 {row.RowNumber} 行:已有学生的学籍状态或行政班不能通过导入直接修改,请通过学籍异动或档案纠错办理。");
|
||||
continue;
|
||||
}
|
||||
if (entity is null)
|
||||
{
|
||||
entity = new Student
|
||||
|
||||
Loaded 3 of 15 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user