diff --git a/src/Jiaowu.Api/Controllers/StudentStatusChangesController.cs b/src/Jiaowu.Api/Controllers/StudentStatusChangesController.cs index f1be122..6c758ac 100644 --- a/src/Jiaowu.Api/Controllers/StudentStatusChangesController.cs +++ b/src/Jiaowu.Api/Controllers/StudentStatusChangesController.cs @@ -112,6 +112,39 @@ public sealed class StudentStatusChangesController( .ToListAsync(token)); } + [HttpGet("discharge-deadlines")] + [Authorize(Roles = SystemRoles.Counselor + "," + SystemRoles.CollegeAdmin + "," + SystemRoles.AcademicAdmin + "," + SystemRoles.SuperAdmin)] + public async Task GetDischargeDeadlines(CancellationToken token) + { + var students = ScopedStudents().Where(x => !x.IsArchived && x.Status == StudentStatus.Retained); + var reports = await db.StudentMilitaryDischargeReports.AsNoTracking() + .Where(report => students.Any(student => student.Id == report.StudentId) && + db.StudentStatusChanges.Where(change => change.StudentId == report.StudentId && + change.Type == StudentStatusChangeType.Enlistment && change.State == StudentStatusChangeState.Approved) + .OrderByDescending(change => change.ApprovedAt).ThenByDescending(change => change.Id) + .Select(change => change.Id).FirstOrDefault() == report.EnlistmentChangeId && + db.StudentMilitaryDischargeReports.Where(other => other.StudentId == report.StudentId && + other.EnlistmentChangeId == report.EnlistmentChangeId) + .OrderByDescending(other => other.ReportedAt).ThenByDescending(other => other.Id) + .Select(other => other.Id).FirstOrDefault() == report.Id) + .OrderBy(report => report.DischargeDate).ThenBy(report => report.StudentId) + .Take(100) + .Select(report => new + { + report.StudentId, report.DischargeDate, report.ReportedAt, + StudentNumber = db.Students.Where(student => student.Id == report.StudentId).Select(student => student.StudentNumber).FirstOrDefault(), + StudentName = db.Students.Where(student => student.Id == report.StudentId).Select(student => student.Name).FirstOrDefault(), + ClassName = db.Students.Where(student => student.Id == report.StudentId).Select(student => student.AdministrativeClass!.Name).FirstOrDefault() + }).ToListAsync(token); + var today = DateOnly.FromDateTime(DateTime.UtcNow); + return Ok(reports.Select(report => new + { + report.StudentId, report.StudentNumber, report.StudentName, report.ClassName, report.DischargeDate, + report.ReportedAt, RetainedUntil = report.DischargeDate.AddYears(2), + DaysRemaining = report.DischargeDate.AddYears(2).DayNumber - today.DayNumber + })); + } + [HttpGet("students/{studentId:guid}/options")] [Authorize(Roles = SystemRoles.Counselor + "," + SystemRoles.CollegeAdmin + "," + SystemRoles.AcademicAdmin + "," + SystemRoles.SuperAdmin)] public async Task GetStudentOptions(Guid studentId, CancellationToken token) diff --git a/tests/Jiaowu.Api.Tests/ApprovalsControllerTests.cs b/tests/Jiaowu.Api.Tests/ApprovalsControllerTests.cs index 2541c73..7adaba6 100644 --- a/tests/Jiaowu.Api.Tests/ApprovalsControllerTests.cs +++ b/tests/Jiaowu.Api.Tests/ApprovalsControllerTests.cs @@ -672,8 +672,20 @@ public sealed class ApprovalsControllerTests var scope = new CollegeDataScope(fixture.CurrentCourse.CollegeId); var authorized = new StudentStatusChangesController(fixture.Db, scope); Assert.IsType(await authorized.ReportStudentDischarge(fixture.Student.Id, - new StudentDischargeReportRequest(today, "代为登记"), CancellationToken.None)); - Assert.Equal(scope.Current.UserId, (await fixture.Db.StudentMilitaryDischargeReports.SingleAsync()).ReportedByUserId); + new StudentDischargeReportRequest(today.AddDays(-1), "代为登记"), CancellationToken.None)); + Assert.IsType(await authorized.ReportStudentDischarge(fixture.Student.Id, + new StudentDischargeReportRequest(today, "更正登记"), CancellationToken.None)); + Assert.All(await fixture.Db.StudentMilitaryDischargeReports.ToListAsync(), report => Assert.Equal(scope.Current.UserId, report.ReportedByUserId)); + var deadlines = Assert.IsType(await authorized.GetDischargeDeadlines(CancellationToken.None)); + using var deadlineJson = System.Text.Json.JsonDocument.Parse(System.Text.Json.JsonSerializer.Serialize(deadlines.Value, + new System.Text.Json.JsonSerializerOptions(System.Text.Json.JsonSerializerDefaults.Web))); + Assert.Equal(1, deadlineJson.RootElement.GetArrayLength()); + Assert.Equal(fixture.Student.Id, deadlineJson.RootElement[0].GetProperty("studentId").GetGuid()); + Assert.Equal(today.ToString("yyyy-MM-dd"), deadlineJson.RootElement[0].GetProperty("dischargeDate").GetString()); + var otherDeadlines = Assert.IsType(await outsider.GetDischargeDeadlines(CancellationToken.None)); + using var otherJson = System.Text.Json.JsonDocument.Parse(System.Text.Json.JsonSerializer.Serialize(otherDeadlines.Value, + new System.Text.Json.JsonSerializerOptions(System.Text.Json.JsonSerializerDefaults.Web))); + Assert.Equal(0, otherJson.RootElement.GetArrayLength()); } [Fact] diff --git a/web/src/i18n/messages/en-US.ts b/web/src/i18n/messages/en-US.ts index e5a8f39..63ecca0 100644 --- a/web/src/i18n/messages/en-US.ts +++ b/web/src/i18n/messages/en-US.ts @@ -246,7 +246,7 @@ export default { teachingPreferences: { teacherTitle: 'Teaching course applications', reviewerTitle: 'Teaching eligibility review', teacherDescription: 'Apply for courses you are willing to teach before scheduling. College approval is required before public-course teaching tasks can be assigned.', reviewerDescription: 'Review teacher applications or assign teachers directly. Approved teachers enter the eligible pool for the selected term and course.', apply: 'Apply for course', assign: 'Assign teacher directly', teacher: 'Teacher', selectTermSubject: 'Select term and course', college: 'College', reviewAssign: 'Review or assign directly', academicOffice: 'Academic affairs', mergeAssign: 'Merge classes and assign teacher', scheduling: 'Scheduling', generateTimetable: 'Generate timetable', allTerms: 'All terms', allStatuses: 'All statuses', refresh: 'Refresh', total: '{count} records', applicant: 'Applicant', course: 'Applied course', term: 'Term', statement: 'Application statement', status: 'Status', reviewComment: 'Review comment', actions: 'Actions', withdraw: 'Withdraw', review: 'Review', processed: 'Processed', emptyTeacher: 'No teaching course applications', emptyReviewer: 'No applications awaiting review', submitTitle: 'Apply for a teaching course', proposedCourse: 'Proposed course', statementPlaceholder: 'Describe relevant teaching experience, research interests, or other context', cancel: 'Cancel', submitReview: 'Submit for college review', reviewTitle: 'Review teaching eligibility', teacherStatement: 'Teacher statement', notProvided: 'Not provided', conclusion: 'Decision', approve: 'Approve', reject: 'Reject', confirmReview: 'Confirm review', assignmentTitle: 'Assign teaching eligibility directly', assignmentHint: 'No teacher application is required. Saving immediately grants eligibility for the selected term and course.', teacherPlaceholder: 'Select by employee number or name', courseLabel: 'Course', coursePlaceholder: 'Select by code or name', credits: '{count} credits', assignmentComment: 'Assignment note', assignmentPlaceholder: 'Enter department arrangements, specialization, or other basis', confirmAssign: 'Confirm assignment', statuses: { Pending: 'Pending review', Approved: 'Approved', Rejected: 'Rejected', Withdrawn: 'Withdrawn' }, messages: { selectTermCourse: 'Select a term and course.', submitted: 'Course application submitted for college review.', withdrawConfirm: 'Withdraw the teaching application for “{course}”?', withdrawTitle: 'Withdraw application', approved: 'Application approved.', rejected: 'Application rejected.', selectAll: 'Select a term, teacher, and course.', assigned: 'Teaching eligibility assigned directly.' }, }, - statusChangeImpact: { dischargeReport: 'Report or correct discharge date', dischargeReportHint: 'This is a report for university verification. Corrections are retained; it does not automatically resume study or change status.', dischargeNotes: 'Report notes', reportedBy: 'Reported by', reportedAt: 'Reported at', recordDischarge: 'Save report', dischargeRecorded: 'Discharge date reported for university verification.', retentionUntil: 'Reference retention date based on the report: {date}; the university must verify it.', retentionReview: 'The retention date is approaching or needs review; contact the university promptly.', gradeWeights: 'Evaluation: {method} · Coursework weight: {regular}% · Final weight: {final}%', evaluation: { Percentage: 'Percentage', PassFail: 'Pass/fail', LetterGrade: 'Letter grade' }, viewArchivedGrades: 'View archived grades', noArchivedGrades: 'No unsubmitted grades were archived for this change.', archiveTime: 'Archived: {date} · Actor: {actor}', gradeSummary: 'Coursework: {regular} · Final: {final} · Total: {total} · Exam status: {exam}', gradeResult: 'Result: {result} · Passed: {passed} · Grade point: {point}', acknowledgeDraftArchive: 'I have reviewed the unsubmitted grades and approve archiving them before removing these courses.', proxyApply: 'Apply for a student', proxyStudent: 'Student', proxyStudentHint: 'Enter at least two characters of a student number or name', proxyStudentRequired: 'Select an eligible student without a pending application.', proxySubmitted: 'Submitted by staff', registryGuard: 'Use student status changes or record correction to change status or class.', correctionTitle: 'Correct a data entry error', correctionHint: 'Only for entry errors before the student or related classes have teaching, grade, exam or status-change records; the actor and reason are recorded.', correctionCurrent: 'Current: {status} · {className}', correctionStatus: 'Corrected status', correctionReason: 'Reason for correction (at least 10 characters)', correctionConfirm: 'Confirm correction', correctionRequired: 'Select a student, status and class, and enter a reason of at least 10 characters.', correctionSaved: 'Record correction saved.', catchUpFilter: 'Catch-up after status change', catchUpNeeded: 'Missed during a status change; catch-up needed (not a retake)', catchUpInProgress: 'Catch-up in progress (not a retake)', receivingPending: 'Receiving college review pending', receivingReviewed: 'Receiving college reviewed', receivingApprove: 'Receiving college approves', receivingReject: 'Receiving college rejects', majorTransferHint: 'Cross-college transfers require receiving-college review. Course recognition follows university rules.', classTransition: 'Class change', demotionTermHint: 'Incomplete classes exclusive to the original class are removed; shared classes and independent electives are kept.', resumptionTerm: 'Resumption term', resumptionTermHint: 'Takes effect upon approval; classes missed during leave are not automatically added.', serviceDate: 'Enlistment date', serviceDateRequired: 'Select the enlistment date', dischargeDate: 'Discharge date', dischargeDateRequired: 'Select the discharge date', retained: 'Status retained', targetClass: 'Target class', targetClassRequired: 'Select the target class', targetClassHint: 'Select an active class in the original major; a change of major requires separate approval.', affectedTerm: 'First affected term', affectedTermRequired: 'Select the first affected term', affectedTermHint: 'Incomplete courses from this term onward will be removed; valid results will be retained.', courseImpact: 'Course impact preview', courseImpactHint: 'The final review recalculates this list. Unpublished or exceptional results require prior review.', course: 'Teaching class', disposition: 'Disposition', impact: { Remove: 'Remove course', RemoveEmptyGrade: 'Remove course and empty grade row', ArchiveDraftGrade: 'Confirm archiving unsubmitted grade before removal', KeepGrade: 'Keep valid result', ReviewRequired: 'Review grade first' } }, + statusChangeImpact: { deadlinesTitle: 'Discharge retention date review', deadlinesHint: 'Based on reported dates; shows the earliest 100 records in your scope. Reports and actual deadlines require university verification.', referenceDate: 'Reference date', deadlineState: 'Reminder', deadlineReview: 'Approaching or needs review', deadlineTracked: 'Reported', dischargeReport: 'Report or correct discharge date', dischargeReportHint: 'This is a report for university verification. Corrections are retained; it does not automatically resume study or change status.', dischargeNotes: 'Report notes', reportedBy: 'Reported by', reportedAt: 'Reported at', recordDischarge: 'Save report', dischargeRecorded: 'Discharge date reported for university verification.', retentionUntil: 'Reference retention date based on the report: {date}; the university must verify it.', retentionReview: 'The retention date is approaching or needs review; contact the university promptly.', gradeWeights: 'Evaluation: {method} · Coursework weight: {regular}% · Final weight: {final}%', evaluation: { Percentage: 'Percentage', PassFail: 'Pass/fail', LetterGrade: 'Letter grade' }, viewArchivedGrades: 'View archived grades', noArchivedGrades: 'No unsubmitted grades were archived for this change.', archiveTime: 'Archived: {date} · Actor: {actor}', gradeSummary: 'Coursework: {regular} · Final: {final} · Total: {total} · Exam status: {exam}', gradeResult: 'Result: {result} · Passed: {passed} · Grade point: {point}', acknowledgeDraftArchive: 'I have reviewed the unsubmitted grades and approve archiving them before removing these courses.', proxyApply: 'Apply for a student', proxyStudent: 'Student', proxyStudentHint: 'Enter at least two characters of a student number or name', proxyStudentRequired: 'Select an eligible student without a pending application.', proxySubmitted: 'Submitted by staff', registryGuard: 'Use student status changes or record correction to change status or class.', correctionTitle: 'Correct a data entry error', correctionHint: 'Only for entry errors before the student or related classes have teaching, grade, exam or status-change records; the actor and reason are recorded.', correctionCurrent: 'Current: {status} · {className}', correctionStatus: 'Corrected status', correctionReason: 'Reason for correction (at least 10 characters)', correctionConfirm: 'Confirm correction', correctionRequired: 'Select a student, status and class, and enter a reason of at least 10 characters.', correctionSaved: 'Record correction saved.', catchUpFilter: 'Catch-up after status change', catchUpNeeded: 'Missed during a status change; catch-up needed (not a retake)', catchUpInProgress: 'Catch-up in progress (not a retake)', receivingPending: 'Receiving college review pending', receivingReviewed: 'Receiving college reviewed', receivingApprove: 'Receiving college approves', receivingReject: 'Receiving college rejects', majorTransferHint: 'Cross-college transfers require receiving-college review. Course recognition follows university rules.', classTransition: 'Class change', demotionTermHint: 'Incomplete classes exclusive to the original class are removed; shared classes and independent electives are kept.', resumptionTerm: 'Resumption term', resumptionTermHint: 'Takes effect upon approval; classes missed during leave are not automatically added.', serviceDate: 'Enlistment date', serviceDateRequired: 'Select the enlistment date', dischargeDate: 'Discharge date', dischargeDateRequired: 'Select the discharge date', retained: 'Status retained', targetClass: 'Target class', targetClassRequired: 'Select the target class', targetClassHint: 'Select an active class in the original major; a change of major requires separate approval.', affectedTerm: 'First affected term', affectedTermRequired: 'Select the first affected term', affectedTermHint: 'Incomplete courses from this term onward will be removed; valid results will be retained.', courseImpact: 'Course impact preview', courseImpactHint: 'The final review recalculates this list. Unpublished or exceptional results require prior review.', course: 'Teaching class', disposition: 'Disposition', impact: { Remove: 'Remove course', RemoveEmptyGrade: 'Remove course and empty grade row', ArchiveDraftGrade: 'Confirm archiving unsubmitted grade before removal', KeepGrade: 'Keep valid result', ReviewRequired: 'Review grade first' } }, performance: { title: 'System performance', description: 'Trace response-time costs from API endpoints into the database.', rangeAria: 'Performance report time range', refreshAria: 'Refresh performance report', notConfigured: 'Waiting for a performance data source', unavailable: 'Performance data is unavailable', fallbackNote: 'Business APIs continue operating normally. The report will not fall back to reading the academic business database.', openDashboard: 'Open monitoring platform', sampleConclusion: 'Sample conclusion', requestCount: 'Total requests', endpointP95: 'Endpoint P95', errorRate: '5xx rate', databaseP95: 'Database P95', slowQueries: 'Slow queries', queryFailures: 'Query failures', chartAria: 'Request rate and endpoint P95 trend', noSamples: 'The data source is connected, but no request metrics were received in this time range.', endpointRanking: 'Endpoint latency ranking', endpointMetrics: 'P95 / requests / 5xx', endpointCounts: '{count} requests · {errors} errors', noEndpoints: 'No endpoint metrics in this range.', databaseRanking: 'Database query ranking', databaseMetrics: 'P95 / calls / slow queries', databaseCounts: '{count} calls · {slow} slow', noDatabase: 'No database metrics in this range.', generatedAt: 'Generated {date} · Page data uses a short cache', viewTraces: 'View raw traces', requestsPerSecond: 'Requests / second', requestRate: 'Request rate', ranges: { '15m': '15 minutes', '1h': '1 hour', '24h': '24 hours', '7d': '7 days' }, notes: { waiting: 'Waiting for metric samples', failedDatabase: 'Database command failures detected', serverErrors: 'Server error rate needs attention', slowQueries: 'Queries exceeded the slow-query threshold', healthy: 'No significant anomalies in the current sample window' }, }, diff --git a/web/src/i18n/messages/zh-CN.ts b/web/src/i18n/messages/zh-CN.ts index 3758f23..12baa6b 100644 --- a/web/src/i18n/messages/zh-CN.ts +++ b/web/src/i18n/messages/zh-CN.ts @@ -246,7 +246,7 @@ export default { teachingPreferences: { teacherTitle: '授课科目申报', reviewerTitle: '授课资格审核', teacherDescription: '在排课前申报本学期愿意承担的课程,学院审核通过后才能分配公共课教学任务。', reviewerDescription: '审核教师申报,或由学院直接指定教师;通过后进入相应学期和课程的可分配教师池。', apply: '申报课程', assign: '直接分配教师', teacher: '教师', selectTermSubject: '选择学期与科目', college: '学院', reviewAssign: '审核或直接分配', academicOffice: '教务', mergeAssign: '合班并分配教师', scheduling: '排课', generateTimetable: '生成课表', allTerms: '全部学期', allStatuses: '全部状态', refresh: '刷新', total: '共 {count} 条', applicant: '申报教师', course: '申报课程', term: '学期', statement: '申报说明', status: '状态', reviewComment: '审核意见', actions: '操作', withdraw: '撤回', review: '审核', processed: '已处理', emptyTeacher: '尚未申报授课科目', emptyReviewer: '没有待处理的授课申报', submitTitle: '申报授课科目', proposedCourse: '拟授课程', statementPlaceholder: '可填写相关教学经历、研究方向或其他说明', cancel: '取消', submitReview: '提交学院审核', reviewTitle: '审核授课资格', teacherStatement: '教师说明', notProvided: '未填写', conclusion: '审核结论', approve: '通过', reject: '驳回', confirmReview: '确认审核', assignmentTitle: '直接分配授课教师', assignmentHint: '无需教师先申报,保存后立即取得所选学期与课程的授课资格。', teacherPlaceholder: '按工号或姓名选择', courseLabel: '课程', coursePlaceholder: '按编码或名称选择', credits: '{count} 学分', assignmentComment: '分配说明', assignmentPlaceholder: '可填写教研室安排、专业方向等依据', confirmAssign: '确认分配', statuses: { Pending: '待审核', Approved: '已通过', Rejected: '已驳回', Withdrawn: '已撤回' }, messages: { selectTermCourse: '请选择学期和课程。', submitted: '课程申报已提交,等待学院审核。', withdrawConfirm: '撤回“{course}”的授课申报?', withdrawTitle: '撤回申报', approved: '已审核通过。', rejected: '已驳回申报。', selectAll: '请选择学期、教师和课程。', assigned: '授课资格已直接分配。' }, }, - statusChangeImpact: { dischargeReport: '登记或更正退役日期', dischargeReportHint: '此处为信息登记,需由学校核验;更正会保留历史记录,不自动复学或改变学籍。', dischargeNotes: '登记说明', reportedBy: '登记人', reportedAt: '登记时间', recordDischarge: '保存登记', dischargeRecorded: '退役日期已登记,请等待学校核验。', retentionUntil: '按登记日期推算的保留期限参考日:{date},具体以学校核验为准。', retentionReview: '保留期限已临近或需要核查,请及时联系学校办理。', gradeWeights: '考核方式:{method} · 平时权重:{regular}% · 期末权重:{final}%', evaluation: { Percentage: '百分制', PassFail: '合格制', LetterGrade: '等级制' }, viewArchivedGrades: '查看成绩归档', noArchivedGrades: '本次异动没有归档的未提交成绩。', archiveTime: '归档时间:{date} · 操作人:{actor}', gradeSummary: '平时:{regular} · 期末:{final} · 总评:{total} · 考试状态:{exam}', gradeResult: '结果:{result} · 是否通过:{passed} · 绩点:{point}', acknowledgeDraftArchive: '我已核对上述未提交成绩,同意归档原记录并退出相关课程。', proxyApply: '代学生发起异动', proxyStudent: '选择学生', proxyStudentHint: '输入至少两个字符搜索学号或姓名', proxyStudentRequired: '请选择可办理异动且没有待审申请的学生。', proxySubmitted: '由工作人员代办', registryGuard: '学籍状态及行政班请通过学籍异动或档案纠错办理。', correctionTitle: '录入错误纠正', correctionHint: '仅限学生和相关班级尚未关联教学、成绩、考试或学籍异动记录的录入错误;系统记录纠错人和原因。', correctionCurrent: '当前:{status} · {className}', correctionStatus: '纠正后的状态', correctionReason: '纠错原因(至少 10 字)', correctionConfirm: '确认纠正', correctionRequired: '请选择学生、状态和班级,并填写至少 10 个字的原因。', correctionSaved: '档案纠错已记录。', catchUpFilter: '因异动补修', catchUpNeeded: '因异动落下,待补修(非重修)', catchUpInProgress: '补修中(非重修)', receivingPending: '转入学院尚未审核', receivingReviewed: '转入学院已审核', receivingApprove: '转入学院同意', receivingReject: '转入学院驳回', majorTransferHint: '跨学院转专业须经转入学院审核,课程认定仍需按学校规定办理。', classTransition: '班级变化', demotionTermHint: '退出原班级独有的未完成教学班;两班共用的教学班和独立选修课保留。', resumptionTerm: '复学生效学期', resumptionTermHint: '批准后立即生效;休学期间落下的教学班不会自动加入名单。', serviceDate: '入伍日期', serviceDateRequired: '请选择入伍日期', dischargeDate: '退役日期', dischargeDateRequired: '请选择退役日期', retained: '保留学籍', targetClass: '目标班级', targetClassRequired: '请选择目标班级', targetClassHint: '请选择原专业的有效班级,跨专业调整需另行审批。', affectedTerm: '受影响起始学期', affectedTermRequired: '请选择受影响起始学期', affectedTermHint: '该学期及之后未完成的课程将退出;已形成有效成绩的课程保留。', courseImpact: '课程影响预览', courseImpactHint: '终审时会重新计算。未发布或异常成绩需先由教务处理。', course: '教学班', disposition: '处理方式', impact: { Remove: '退出课程', RemoveEmptyGrade: '退出课程并移除空白成绩行', ArchiveDraftGrade: '需确认归档未提交成绩后退出', KeepGrade: '保留有效成绩', ReviewRequired: '成绩需先处理' } }, + statusChangeImpact: { deadlinesTitle: '退役学生保留期限核查', deadlinesHint: '按登记的退役日期推算,仅展示权限范围内参考日期最早的 100 人;登记信息及具体期限需学校核验。', referenceDate: '期限参考日', deadlineState: '提示', deadlineReview: '临近或需核查', deadlineTracked: '已登记', dischargeReport: '登记或更正退役日期', dischargeReportHint: '此处为信息登记,需由学校核验;更正会保留历史记录,不自动复学或改变学籍。', dischargeNotes: '登记说明', reportedBy: '登记人', reportedAt: '登记时间', recordDischarge: '保存登记', dischargeRecorded: '退役日期已登记,请等待学校核验。', retentionUntil: '按登记日期推算的保留期限参考日:{date},具体以学校核验为准。', retentionReview: '保留期限已临近或需要核查,请及时联系学校办理。', gradeWeights: '考核方式:{method} · 平时权重:{regular}% · 期末权重:{final}%', evaluation: { Percentage: '百分制', PassFail: '合格制', LetterGrade: '等级制' }, viewArchivedGrades: '查看成绩归档', noArchivedGrades: '本次异动没有归档的未提交成绩。', archiveTime: '归档时间:{date} · 操作人:{actor}', gradeSummary: '平时:{regular} · 期末:{final} · 总评:{total} · 考试状态:{exam}', gradeResult: '结果:{result} · 是否通过:{passed} · 绩点:{point}', acknowledgeDraftArchive: '我已核对上述未提交成绩,同意归档原记录并退出相关课程。', proxyApply: '代学生发起异动', proxyStudent: '选择学生', proxyStudentHint: '输入至少两个字符搜索学号或姓名', proxyStudentRequired: '请选择可办理异动且没有待审申请的学生。', proxySubmitted: '由工作人员代办', registryGuard: '学籍状态及行政班请通过学籍异动或档案纠错办理。', correctionTitle: '录入错误纠正', correctionHint: '仅限学生和相关班级尚未关联教学、成绩、考试或学籍异动记录的录入错误;系统记录纠错人和原因。', correctionCurrent: '当前:{status} · {className}', correctionStatus: '纠正后的状态', correctionReason: '纠错原因(至少 10 字)', correctionConfirm: '确认纠正', correctionRequired: '请选择学生、状态和班级,并填写至少 10 个字的原因。', correctionSaved: '档案纠错已记录。', catchUpFilter: '因异动补修', catchUpNeeded: '因异动落下,待补修(非重修)', catchUpInProgress: '补修中(非重修)', receivingPending: '转入学院尚未审核', receivingReviewed: '转入学院已审核', receivingApprove: '转入学院同意', receivingReject: '转入学院驳回', majorTransferHint: '跨学院转专业须经转入学院审核,课程认定仍需按学校规定办理。', classTransition: '班级变化', demotionTermHint: '退出原班级独有的未完成教学班;两班共用的教学班和独立选修课保留。', resumptionTerm: '复学生效学期', resumptionTermHint: '批准后立即生效;休学期间落下的教学班不会自动加入名单。', serviceDate: '入伍日期', serviceDateRequired: '请选择入伍日期', dischargeDate: '退役日期', dischargeDateRequired: '请选择退役日期', retained: '保留学籍', targetClass: '目标班级', targetClassRequired: '请选择目标班级', targetClassHint: '请选择原专业的有效班级,跨专业调整需另行审批。', affectedTerm: '受影响起始学期', affectedTermRequired: '请选择受影响起始学期', affectedTermHint: '该学期及之后未完成的课程将退出;已形成有效成绩的课程保留。', courseImpact: '课程影响预览', courseImpactHint: '终审时会重新计算。未发布或异常成绩需先由教务处理。', course: '教学班', disposition: '处理方式', impact: { Remove: '退出课程', RemoveEmptyGrade: '退出课程并移除空白成绩行', ArchiveDraftGrade: '需确认归档未提交成绩后退出', KeepGrade: '保留有效成绩', ReviewRequired: '成绩需先处理' } }, performance: { title: '系统性能', description: '从接口进入数据库,定位响应时间消耗在哪里。', rangeAria: '性能报表时间范围', refreshAria: '刷新性能报表', notConfigured: '等待连接性能数据源', unavailable: '性能数据暂不可用', fallbackNote: '业务接口继续正常运行;报表不会回退读取教务业务数据库。', openDashboard: '打开监控平台', sampleConclusion: '采样结论', requestCount: '请求总量', endpointP95: '接口 P95', errorRate: '5xx 比例', databaseP95: '数据库 P95', slowQueries: '慢查询', queryFailures: '查询失败', chartAria: '请求速率与接口 P95 趋势图', noSamples: '数据源已连接,但该时间范围内尚未收到请求指标。', endpointRanking: '接口耗时排行', endpointMetrics: 'P95 / 请求量 / 5xx', endpointCounts: '{count} 次 · {errors} 错误', noEndpoints: '该范围内没有接口指标。', databaseRanking: '数据库查询排行', databaseMetrics: 'P95 / 调用量 / 慢查询', databaseCounts: '{count} 次 · {slow} 慢', noDatabase: '该范围内没有数据库指标。', generatedAt: '生成于 {date} · 页面数据采用短时缓存', viewTraces: '查看原始调用链', requestsPerSecond: '请求 / 秒', requestRate: '请求速率', ranges: { '15m': '15 分钟', '1h': '1 小时', '24h': '24 小时', '7d': '7 天' }, notes: { waiting: '等待指标样本', failedDatabase: '存在失败的数据库命令', serverErrors: '服务端错误率需要关注', slowQueries: '存在超过阈值的慢查询', healthy: '当前采样窗口内未见明显异常' }, }, diff --git a/web/src/views/StudentStatusChangesView.vue b/web/src/views/StudentStatusChangesView.vue index 13611ce..207ccd7 100644 --- a/web/src/views/StudentStatusChangesView.vue +++ b/web/src/views/StudentStatusChangesView.vue @@ -34,6 +34,7 @@ const correctionForm = reactive({ targetStatus: '', targetClassId: '', reason: ' const dischargeDialog = ref(false) const dischargeForProxy = ref(false) const dischargeReports = ref([]) +const dischargeDeadlines = ref([]) const dischargeForm = reactive({ dischargeDate: '', notes: '' }) const loading = ref(false) const applyDialog = ref(false) @@ -133,6 +134,7 @@ async function load(resetPage = false) { actionableTotal.value = changeResponse.data.actionableTotal finishedTotal.value = changeResponse.data.finishedTotal if (optionResponse) options.value = optionResponse.data + if (canApplyForStudent.value) await loadDischargeDeadlines() if (changes.value.length === 0 && page.value > 1) { page.value-- await load() @@ -143,6 +145,10 @@ async function load(resetPage = false) { loading.value = false } } +async function loadDischargeDeadlines() { + try { dischargeDeadlines.value = (await http.get('/student-status-changes/discharge-deadlines')).data } + catch (error) { ElMessage.error(apiErrorMessage(error)) } +} function openApply(proxy = false) { proxyApply.value = proxy proxyStudentId.value = '' @@ -189,6 +195,11 @@ async function openDischargeReport(forProxy: boolean) { dischargeDialog.value = true } catch (error) { ElMessage.error(apiErrorMessage(error)) } } +async function manageDischargeDeadline(row: any) { + proxyStudentId.value = row.studentId + await selectProxyStudent(row.studentId) + if (proxyOptions.value?.requiresDischargeDate) await openDischargeReport(true) +} async function submitDischargeReport() { if (!dischargeForm.dischargeDate) { ElMessage.warning(t('statusChangeImpact.dischargeDateRequired')); return } const path = dischargeForProxy.value ? `/student-status-changes/students/${proxyStudentId.value}/discharge-reports` : '/student-status-changes/discharge-reports' @@ -196,7 +207,10 @@ async function submitDischargeReport() { await http.post(path, dischargeForm) dischargeDialog.value = false ElMessage.success(t('statusChangeImpact.dischargeRecorded')) - if (dischargeForProxy.value) await selectProxyStudent(proxyStudentId.value) + if (dischargeForProxy.value) { + await selectProxyStudent(proxyStudentId.value) + await loadDischargeDeadlines() + } else await load() } catch (error) { ElMessage.error(apiErrorMessage(error)) } } @@ -381,6 +395,20 @@ onMounted(async () => {
{{ t('statusChanges.actionable') }}{{ actionableTotal }}{{ t('statusChanges.itemUnit') }}
{{ t('statusChanges.total') }}{{ total }}{{ t('statusChanges.itemUnit') }}
{{ t('statusChanges.finished') }}{{ finishedTotal }}{{ t('statusChanges.itemUnit') }}

{{ t('statusChanges.securityNote') }}

+
+
+

{{ t('statusChangeImpact.deadlinesTitle') }}

+

{{ t('statusChangeImpact.deadlinesHint') }}

+ + + + + + + +
+
+