学籍异动:休学、复学、退学申请及辅导员→学院→教务处分级审批。
毕业审核:批次计算、缺失课程检查、人工复核、结果发布。 学位授予:毕业资格与 GPA 计算、人工调整、发布授予结果。 毕业离校:离校事项配置、责任角色分工、逐项办理及批次关闭。
This commit is contained in:
@@ -41,6 +41,18 @@ public sealed class AppDbContext(DbContextOptions<AppDbContext> options)
|
||||
Set<ExamSessionInvigilator>();
|
||||
public DbSet<StudentStatusChange> StudentStatusChanges =>
|
||||
Set<StudentStatusChange>();
|
||||
public DbSet<GraduationAuditBatch> GraduationAuditBatches =>
|
||||
Set<GraduationAuditBatch>();
|
||||
public DbSet<GraduationAuditResult> GraduationAuditResults =>
|
||||
Set<GraduationAuditResult>();
|
||||
public DbSet<DegreeAwardBatch> DegreeAwardBatches => Set<DegreeAwardBatch>();
|
||||
public DbSet<DegreeAwardResult> DegreeAwardResults => Set<DegreeAwardResult>();
|
||||
public DbSet<GraduationClearanceBatch> GraduationClearanceBatches =>
|
||||
Set<GraduationClearanceBatch>();
|
||||
public DbSet<GraduationClearanceItem> GraduationClearanceItems =>
|
||||
Set<GraduationClearanceItem>();
|
||||
public DbSet<GraduationClearanceRecord> GraduationClearanceRecords =>
|
||||
Set<GraduationClearanceRecord>();
|
||||
public DbSet<AuditLog> AuditLogs => Set<AuditLog>();
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder builder)
|
||||
@@ -396,6 +408,82 @@ public sealed class AppDbContext(DbContextOptions<AppDbContext> options)
|
||||
entity.HasOne(x => x.Student).WithMany()
|
||||
.HasForeignKey(x => x.StudentId).OnDelete(DeleteBehavior.Restrict);
|
||||
});
|
||||
builder.Entity<GraduationAuditBatch>(entity =>
|
||||
{
|
||||
entity.Property(x => x.Name).HasMaxLength(120);
|
||||
entity.Property(x => x.Notes).HasMaxLength(500);
|
||||
entity.HasIndex(x => new { x.GraduationYear, x.EnrollmentYear });
|
||||
entity.HasIndex(x => x.Status);
|
||||
});
|
||||
builder.Entity<GraduationAuditResult>(entity =>
|
||||
{
|
||||
entity.Property(x => x.RequiredCredits).HasPrecision(6, 2);
|
||||
entity.Property(x => x.EarnedCredits).HasPrecision(6, 2);
|
||||
entity.Property(x => x.MissingCourseNames).HasMaxLength(2000);
|
||||
entity.Property(x => x.ReviewComment).HasMaxLength(500);
|
||||
entity.HasIndex(x => new { x.GraduationAuditBatchId, x.StudentId })
|
||||
.IsUnique();
|
||||
entity.HasIndex(x => new { x.Conclusion, x.IsOverridden });
|
||||
entity.HasOne(x => x.GraduationAuditBatch).WithMany(x => x.Results)
|
||||
.HasForeignKey(x => x.GraduationAuditBatchId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
entity.HasOne(x => x.Student).WithMany()
|
||||
.HasForeignKey(x => x.StudentId).OnDelete(DeleteBehavior.Restrict);
|
||||
entity.HasOne(x => x.CurriculumPlan).WithMany()
|
||||
.HasForeignKey(x => x.CurriculumPlanId).OnDelete(DeleteBehavior.SetNull);
|
||||
});
|
||||
builder.Entity<DegreeAwardBatch>(entity =>
|
||||
{
|
||||
entity.Property(x => x.Name).HasMaxLength(120);
|
||||
entity.Property(x => x.DegreeName).HasMaxLength(80);
|
||||
entity.Property(x => x.MinimumGradePoint).HasPrecision(3, 2);
|
||||
entity.Property(x => x.Notes).HasMaxLength(500);
|
||||
entity.HasIndex(x => new { x.GraduationYear, x.Status });
|
||||
});
|
||||
builder.Entity<DegreeAwardResult>(entity =>
|
||||
{
|
||||
entity.Property(x => x.AverageGradePoint).HasPrecision(4, 2);
|
||||
entity.Property(x => x.ExceptionReason).HasMaxLength(500);
|
||||
entity.Property(x => x.ReviewComment).HasMaxLength(500);
|
||||
entity.HasIndex(x => new { x.DegreeAwardBatchId, x.StudentId }).IsUnique();
|
||||
entity.HasIndex(x => new { x.Conclusion, x.IsOverridden });
|
||||
entity.HasOne(x => x.DegreeAwardBatch).WithMany(x => x.Results)
|
||||
.HasForeignKey(x => x.DegreeAwardBatchId).OnDelete(DeleteBehavior.Cascade);
|
||||
entity.HasOne(x => x.Student).WithMany()
|
||||
.HasForeignKey(x => x.StudentId).OnDelete(DeleteBehavior.Restrict);
|
||||
entity.HasOne(x => x.GraduationAuditResult).WithMany()
|
||||
.HasForeignKey(x => x.GraduationAuditResultId)
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
});
|
||||
builder.Entity<GraduationClearanceBatch>(entity =>
|
||||
{
|
||||
entity.Property(x => x.Name).HasMaxLength(120);
|
||||
entity.Property(x => x.Notes).HasMaxLength(500);
|
||||
entity.HasIndex(x => new { x.GraduationYear, x.Status });
|
||||
});
|
||||
builder.Entity<GraduationClearanceItem>(entity =>
|
||||
{
|
||||
entity.Property(x => x.Code).HasMaxLength(30);
|
||||
entity.Property(x => x.Name).HasMaxLength(100);
|
||||
entity.Property(x => x.ResponsibleUnit).HasMaxLength(100);
|
||||
entity.Property(x => x.ResponsibleRole).HasMaxLength(30);
|
||||
entity.HasIndex(x => new { x.GraduationClearanceBatchId, x.Code }).IsUnique();
|
||||
entity.HasOne(x => x.GraduationClearanceBatch).WithMany(x => x.Items)
|
||||
.HasForeignKey(x => x.GraduationClearanceBatchId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
builder.Entity<GraduationClearanceRecord>(entity =>
|
||||
{
|
||||
entity.Property(x => x.Notes).HasMaxLength(500);
|
||||
entity.HasIndex(x => new { x.GraduationClearanceItemId, x.StudentId })
|
||||
.IsUnique();
|
||||
entity.HasIndex(x => new { x.StudentId, x.Status });
|
||||
entity.HasOne(x => x.GraduationClearanceItem).WithMany(x => x.Records)
|
||||
.HasForeignKey(x => x.GraduationClearanceItemId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
entity.HasOne(x => x.Student).WithMany()
|
||||
.HasForeignKey(x => x.StudentId).OnDelete(DeleteBehavior.Restrict);
|
||||
});
|
||||
|
||||
builder.Entity<AuditLog>(entity =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user