已发布方案可修改名称、总学分、说明、课程模块及课程配置。
适用专业、入学年级、版本号保持锁定;前端禁用,后端也会返回 409 拒绝篡改。 归档方案仍只读。 修改已发布方案前增加即时生效警示和二次确认。
This commit is contained in:
1 parent
9a3afa3df5
commit
ce65fe82d9
6 files changed
+125
-24
No files matched your search
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
面向普通高校的教务管理系统。后端使用 ASP.NET Core 10、EF Core 10,前端使用 Vue 3、TypeScript 和 Element Plus。
|
面向普通高校的教务管理系统。后端使用 ASP.NET Core 10、EF Core 10,前端使用 Vue 3、TypeScript 和 Element Plus。
|
||||||
|
|
||||||
当前已实现系统登录与角色权限、基础数据、用户管理、教师档案、学生档案、课程库、培养方案、教学任务、排课课表、学生选课、成绩管理、考试考场、学籍异动、毕业审核、学位授予、毕业离校和首页统计。人员及课程列表支持组合筛选、服务端分页和完整增删改查;培养方案支持课程模块、专业年级版本、复制新版本、发布锁定和旧版本归档;教学任务支持学期课程开设、多教师、合班、容量校验、发布与结课,公共课由校级教务负责、专业必修/专业选修/实践课下放课程所属学院管理,并支持教师按学期申报授课科目、学院审核授课资格、公共课按若干行政班合并教学班,以及在审核通过的教师池中随机均衡分配后批量生成草稿;排课支持学期作息维护、单双周与周次节次、课程可用时间、校区/教学楼/指定教室约束、不占用教室课程、教室容量、教师/行政班/教室冲突校验、自动生成、手工微调和版本化发布;选课支持批次时间窗、投放范围、容量与学分上限、重复课程与课表冲突校验、退课截止时间和实时教学班名单;成绩管理支持分项比例、批量录入、特殊考试状态、自动总评与绩点、教师提交、学院审核、校级发布和学生成绩单;考试管理支持考试计划、场次、考场容量、监考教师、考生名单以及考场/监考/学生时间冲突校验;学籍异动支持休学、复学、退学申请,辅导员、学院、学校三级顺序审核,学生撤回,以及最终审批后自动同步学籍状态;毕业审核按入学年级匹配已发布培养方案,以正式成绩计算总学分、必修通过和未解决不及格课程,支持学院范围查看、人工复核、校级锁定发布和学生结果查询;学位授予以已发布毕业资格为来源,按正式成绩加权平均绩点生成规则结论,支持学院人工复核、校级发布锁定和学生结果查询;毕业离校支持自定义事项与责任部门,按校级、学院、辅导员角色分工办理,强制数据范围校验,学生进度查询,以及必办事项全部完成后的批次锁定。
|
当前已实现系统登录与角色权限、基础数据、用户管理、教师档案、学生档案、课程库、培养方案、教学任务、排课课表、学生选课、成绩管理、考试考场、学籍异动、毕业审核、学位授予、毕业离校和首页统计。人员及课程列表支持组合筛选、服务端分页和完整增删改查;培养方案支持课程模块、专业年级版本、复制新版本、发布与旧版本归档,已发布版本可继续维护名称、学分说明和课程结构,适用专业、入学年级及版本号保持锁定;教学任务支持学期课程开设、多教师、合班、容量校验、发布与结课,公共课由校级教务负责、专业必修/专业选修/实践课下放课程所属学院管理,并支持教师按学期申报授课科目、学院审核授课资格、公共课按若干行政班合并教学班,以及在审核通过的教师池中随机均衡分配后批量生成草稿;排课支持学期作息维护、单双周与周次节次、课程可用时间、校区/教学楼/指定教室约束、不占用教室课程、教室容量、教师/行政班/教室冲突校验、自动生成、手工微调和版本化发布;选课支持批次时间窗、投放范围、容量与学分上限、重复课程与课表冲突校验、退课截止时间和实时教学班名单;成绩管理支持分项比例、批量录入、特殊考试状态、自动总评与绩点、教师提交、学院审核、校级发布和学生成绩单;考试管理支持考试计划、场次、考场容量、监考教师、考生名单以及考场/监考/学生时间冲突校验;学籍异动支持休学、复学、退学申请,辅导员、学院、学校三级顺序审核,学生撤回,以及最终审批后自动同步学籍状态;毕业审核按入学年级匹配已发布培养方案,以正式成绩计算总学分、必修通过和未解决不及格课程,支持学院范围查看、人工复核、校级锁定发布和学生结果查询;学位授予以已发布毕业资格为来源,按正式成绩加权平均绩点生成规则结论,支持学院人工复核、校级发布锁定和学生结果查询;毕业离校支持自定义事项与责任部门,按校级、学院、辅导员角色分工办理,强制数据范围校验,学生进度查询,以及必办事项全部完成后的批次锁定。
|
||||||
|
|
||||||
课程库支持下载标准模板后批量导入 `.xlsx`,按课程编码新增或更新,并在整批校验失败时不写入任何课程;授课资格既支持教师申报后审核,也支持学院在本院教师范围内直接分配;学生可在“我的培养方案”中查看本人适用的已发布方案,并按已完成、在读、重修中、未通过、待完成和未修读状态核对课程与学分进度。
|
课程库支持下载标准模板后批量导入 `.xlsx`,按课程编码新增或更新,并在整批校验失败时不写入任何课程;授课资格既支持教师申报后审核,也支持学院在本院教师范围内直接分配;学生可在“我的培养方案”中查看本人适用的已发布方案,并按已完成、在读、重修中、未通过、待完成和未修读状态核对课程与学分进度。
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using Jiaowu.Api.Contracts;
|
|||||||
using Jiaowu.Api.Domain.Academic;
|
using Jiaowu.Api.Domain.Academic;
|
||||||
using Jiaowu.Api.Domain.Identity;
|
using Jiaowu.Api.Domain.Identity;
|
||||||
using Jiaowu.Api.Infrastructure.Auth;
|
using Jiaowu.Api.Infrastructure.Auth;
|
||||||
|
using Jiaowu.Api.Infrastructure.Graduation;
|
||||||
using Jiaowu.Api.Infrastructure.Persistence;
|
using Jiaowu.Api.Infrastructure.Persistence;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
@@ -211,8 +212,16 @@ public sealed class CurriculumPlansController(
|
|||||||
{
|
{
|
||||||
var plan = await EditablePlanAsync(id, cancellationToken);
|
var plan = await EditablePlanAsync(id, cancellationToken);
|
||||||
if (plan is null) return NotFound();
|
if (plan is null) return NotFound();
|
||||||
if (plan.Status != CurriculumPlanStatus.Draft)
|
if (!CurriculumPlanEditingPolicy.CanModifyContent(plan.Status))
|
||||||
return ConflictProblem("已发布或已归档的培养方案不可直接修改,请复制为新版本。");
|
return ConflictProblem("已归档的培养方案不可修改。");
|
||||||
|
if (!CurriculumPlanEditingPolicy.CanChangeApplicability(plan.Status) &&
|
||||||
|
(plan.MajorId != request.MajorId ||
|
||||||
|
plan.EffectiveGrade != request.EffectiveGrade ||
|
||||||
|
!string.Equals(plan.Version, request.Version.Trim(), StringComparison.Ordinal)))
|
||||||
|
{
|
||||||
|
return ConflictProblem(
|
||||||
|
"已发布方案可以修改名称、学分说明和课程结构;如需变更适用专业、入学年级或版本号,请复制为新版本。");
|
||||||
|
}
|
||||||
var major = await FindAccessibleMajorAsync(request.MajorId, cancellationToken);
|
var major = await FindAccessibleMajorAsync(request.MajorId, cancellationToken);
|
||||||
if (major is null) return ValidationProblem("所选专业不存在或不在当前数据范围内。");
|
if (major is null) return ValidationProblem("所选专业不存在或不在当前数据范围内。");
|
||||||
|
|
||||||
@@ -327,7 +336,7 @@ public sealed class CurriculumPlansController(
|
|||||||
CurriculumModuleRequest request,
|
CurriculumModuleRequest request,
|
||||||
CancellationToken cancellationToken)
|
CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var plan = await DraftPlanAsync(planId, cancellationToken);
|
var plan = await ModifiablePlanAsync(planId, cancellationToken);
|
||||||
if (plan is null) return NotFound();
|
if (plan is null) return NotFound();
|
||||||
var module = new CurriculumModule
|
var module = new CurriculumModule
|
||||||
{
|
{
|
||||||
@@ -348,7 +357,7 @@ public sealed class CurriculumPlansController(
|
|||||||
CurriculumModuleRequest request,
|
CurriculumModuleRequest request,
|
||||||
CancellationToken cancellationToken)
|
CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
if (await DraftPlanAsync(planId, cancellationToken) is null) return NotFound();
|
if (await ModifiablePlanAsync(planId, cancellationToken) is null) return NotFound();
|
||||||
var module = await db.CurriculumModules
|
var module = await db.CurriculumModules
|
||||||
.FirstOrDefaultAsync(x => x.Id == moduleId && x.CurriculumPlanId == planId, cancellationToken);
|
.FirstOrDefaultAsync(x => x.Id == moduleId && x.CurriculumPlanId == planId, cancellationToken);
|
||||||
if (module is null) return NotFound();
|
if (module is null) return NotFound();
|
||||||
@@ -365,7 +374,7 @@ public sealed class CurriculumPlansController(
|
|||||||
Guid moduleId,
|
Guid moduleId,
|
||||||
CancellationToken cancellationToken)
|
CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
if (await DraftPlanAsync(planId, cancellationToken) is null) return NotFound();
|
if (await ModifiablePlanAsync(planId, cancellationToken) is null) return NotFound();
|
||||||
var module = await db.CurriculumModules
|
var module = await db.CurriculumModules
|
||||||
.FirstOrDefaultAsync(x => x.Id == moduleId && x.CurriculumPlanId == planId, cancellationToken);
|
.FirstOrDefaultAsync(x => x.Id == moduleId && x.CurriculumPlanId == planId, cancellationToken);
|
||||||
if (module is null) return NotFound();
|
if (module is null) return NotFound();
|
||||||
@@ -380,7 +389,7 @@ public sealed class CurriculumPlansController(
|
|||||||
CurriculumCourseRequest request,
|
CurriculumCourseRequest request,
|
||||||
CancellationToken cancellationToken)
|
CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var plan = await DraftPlanAsync(planId, cancellationToken);
|
var plan = await ModifiablePlanAsync(planId, cancellationToken);
|
||||||
if (plan is null) return NotFound();
|
if (plan is null) return NotFound();
|
||||||
if (!await db.CurriculumModules.AnyAsync(
|
if (!await db.CurriculumModules.AnyAsync(
|
||||||
x => x.Id == moduleId && x.CurriculumPlanId == planId,
|
x => x.Id == moduleId && x.CurriculumPlanId == planId,
|
||||||
@@ -418,7 +427,7 @@ public sealed class CurriculumPlansController(
|
|||||||
CurriculumCourseRequest request,
|
CurriculumCourseRequest request,
|
||||||
CancellationToken cancellationToken)
|
CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var plan = await DraftPlanAsync(planId, cancellationToken);
|
var plan = await ModifiablePlanAsync(planId, cancellationToken);
|
||||||
if (plan is null) return NotFound();
|
if (plan is null) return NotFound();
|
||||||
var item = await db.CurriculumCourses
|
var item = await db.CurriculumCourses
|
||||||
.FirstOrDefaultAsync(x =>
|
.FirstOrDefaultAsync(x =>
|
||||||
@@ -454,7 +463,7 @@ public sealed class CurriculumPlansController(
|
|||||||
Guid itemId,
|
Guid itemId,
|
||||||
CancellationToken cancellationToken)
|
CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
if (await DraftPlanAsync(planId, cancellationToken) is null) return NotFound();
|
if (await ModifiablePlanAsync(planId, cancellationToken) is null) return NotFound();
|
||||||
var item = await db.CurriculumCourses
|
var item = await db.CurriculumCourses
|
||||||
.FirstOrDefaultAsync(x =>
|
.FirstOrDefaultAsync(x =>
|
||||||
x.Id == itemId &&
|
x.Id == itemId &&
|
||||||
@@ -488,13 +497,15 @@ public sealed class CurriculumPlansController(
|
|||||||
CancellationToken cancellationToken) =>
|
CancellationToken cancellationToken) =>
|
||||||
await ScopedPlans().FirstOrDefaultAsync(x => x.Id == id, cancellationToken);
|
await ScopedPlans().FirstOrDefaultAsync(x => x.Id == id, cancellationToken);
|
||||||
|
|
||||||
private async Task<CurriculumPlan?> DraftPlanAsync(
|
private async Task<CurriculumPlan?> ModifiablePlanAsync(
|
||||||
Guid id,
|
Guid id,
|
||||||
CancellationToken cancellationToken) =>
|
CancellationToken cancellationToken) =>
|
||||||
await ScopedPlans()
|
await ScopedPlans()
|
||||||
.Include(x => x.Major)
|
.Include(x => x.Major)
|
||||||
.FirstOrDefaultAsync(
|
.FirstOrDefaultAsync(
|
||||||
x => x.Id == id && x.Status == CurriculumPlanStatus.Draft,
|
x => x.Id == id &&
|
||||||
|
(x.Status == CurriculumPlanStatus.Draft ||
|
||||||
|
x.Status == CurriculumPlanStatus.Published),
|
||||||
cancellationToken);
|
cancellationToken);
|
||||||
|
|
||||||
private Guid? ScopedCollegeId()
|
private Guid? ScopedCollegeId()
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
using Jiaowu.Api.Domain.Academic;
|
||||||
|
|
||||||
|
namespace Jiaowu.Api.Infrastructure.Graduation;
|
||||||
|
|
||||||
|
public static class CurriculumPlanEditingPolicy
|
||||||
|
{
|
||||||
|
public static bool CanModifyContent(CurriculumPlanStatus status) =>
|
||||||
|
status is CurriculumPlanStatus.Draft or CurriculumPlanStatus.Published;
|
||||||
|
|
||||||
|
public static bool CanChangeApplicability(CurriculumPlanStatus status) =>
|
||||||
|
status == CurriculumPlanStatus.Draft;
|
||||||
|
}
|
||||||
Loaded 3 of 6 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user