diff --git a/backend/roomroot-admin/src/main/java/com/roomroot/web/controller/jwgl/StudentRecordsController.java b/backend/roomroot-admin/src/main/java/com/roomroot/web/controller/jwgl/StudentRecordsController.java index 27128d83..a9e49a4d 100644 --- a/backend/roomroot-admin/src/main/java/com/roomroot/web/controller/jwgl/StudentRecordsController.java +++ b/backend/roomroot-admin/src/main/java/com/roomroot/web/controller/jwgl/StudentRecordsController.java @@ -4,6 +4,7 @@ import com.roomroot.jwgl.entity.XYXX; import com.roomroot.jwgl.entity.XYDNDXQJBXXB; import com.roomroot.jwgl.entity.XYDB; import com.roomroot.jwgl.entity.XYDQB; +import com.roomroot.jwgl.entity.KB; import com.roomroot.jwgl.entity.PXRW; import com.roomroot.jwgl.entity.XYXJYDSQB; import com.roomroot.jwgl.entity.XYXJYJJGB; @@ -103,6 +104,15 @@ public class StudentRecordsController { return Result.success(studentRecordsService.listPeriodOptions()); } + /** + * 课程科目下拉选项(课编号+课名称),供学员成绩查询等页面使用。 + * 与 /jys/kb/list 不同,本接口不带教研室权限要求。 + */ + @GetMapping("/kb-options") + public Result> kbOptions() { + return Result.success(studentRecordsService.listKbOptions()); + } + // ======================== 学员信息批量导入 ======================== /** diff --git a/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/service/StudentRecordsService.java b/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/service/StudentRecordsService.java index 56dce787..0c146daa 100644 --- a/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/service/StudentRecordsService.java +++ b/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/service/StudentRecordsService.java @@ -3,6 +3,7 @@ package com.roomroot.jwgl.service; import com.roomroot.jwgl.entity.XYXX; import com.roomroot.jwgl.entity.XYDB; import com.roomroot.jwgl.entity.XYDQB; +import com.roomroot.jwgl.entity.KB; import com.roomroot.jwgl.entity.PXRW; import com.roomroot.jwgl.entity.XYXJYDSQB; import com.roomroot.jwgl.entity.XYXJYJJGB; @@ -43,6 +44,9 @@ public interface StudentRecordsService { /** 学员队期下拉选项(编号+名称) */ List listPeriodOptions(); + /** 课程科目下拉选项(课编号+课名称),供成绩查询等页面使用,不受教研室权限限制 */ + List listKbOptions(); + /** 学籍异动——留级 */ void retainGrade(String bh); diff --git a/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/service/impl/StudentRecordsServiceImpl.java b/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/service/impl/StudentRecordsServiceImpl.java index 4eea3e3b..d29c1fea 100644 --- a/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/service/impl/StudentRecordsServiceImpl.java +++ b/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/service/impl/StudentRecordsServiceImpl.java @@ -15,6 +15,7 @@ import com.roomroot.jwgl.entity.XYXJYJJGB; import com.roomroot.jwgl.entity.XYXJYJTJB; import com.roomroot.jwgl.entity.XYKCCJ; import com.roomroot.jwgl.entity.XYKCGCCJ; +import com.roomroot.jwgl.entity.KB; import com.roomroot.jwgl.mapper.XYXXMapper; import com.roomroot.jwgl.mapper.XYDBMapper; import com.roomroot.jwgl.mapper.XYDQBMapper; @@ -24,6 +25,7 @@ import com.roomroot.jwgl.mapper.XYXJYJJGBMapper; import com.roomroot.jwgl.mapper.XYXJYJTJBMapper; import com.roomroot.jwgl.mapper.XYKCCJMapper; import com.roomroot.jwgl.mapper.XYKCGCCJMapper; +import com.roomroot.jwgl.mapper.KBMapper; import com.roomroot.jwgl.service.StudentRecordsService; import com.roomroot.jwgl.unit.PageQuery; import com.roomroot.jwgl.unit.PageResult; @@ -70,6 +72,9 @@ public class StudentRecordsServiceImpl implements StudentRecordsService { @Resource private XYDQBMapper xydqbMapper; + @Resource + private KBMapper kbMapper; + @Resource private PXRWMapper pxrwMapper; @@ -247,6 +252,13 @@ public class StudentRecordsServiceImpl implements StudentRecordsService { .orderByAsc(XYDQB::getXydbh)); } + @Override + public List listKbOptions() { + return kbMapper.selectList(new LambdaQueryWrapper() + .select(KB::getKbh, KB::getKmc) + .orderByAsc(KB::getKbh)); + } + /** * 当前班次编号关联学员队表、专业表、学员课程成绩,回显年级、专业、班次、考试情况、不及格门数、管理机构。 */ diff --git a/frontend/src/api/studentRecords/studentRecords.js b/frontend/src/api/studentRecords/studentRecords.js index 8a6894b9..bdc3ae26 100644 --- a/frontend/src/api/studentRecords/studentRecords.js +++ b/frontend/src/api/studentRecords/studentRecords.js @@ -17,6 +17,14 @@ export function listPeriodOptions() { }) } +// 课程科目下拉选项(kbh 课编号、kmc 课名称),不带教研室权限要求 +export function listKbOptions() { + return request({ + url: '/student-records/kb-options', + method: 'get' + }) +} + // 查询学员信息详情(bh 编号必传) export function getStudentRecord(bh) { return request({ diff --git a/frontend/src/views/student/score/index.vue b/frontend/src/views/student/score/index.vue index 38e01d6c..025c98ae 100644 --- a/frontend/src/views/student/score/index.vue +++ b/frontend/src/views/student/score/index.vue @@ -84,9 +84,9 @@ import { listStudentGrades, listStudentProcessGrades, exportStudentGrades, - exportStudentProcessGrades + exportStudentProcessGrades, + listKbOptions } from "@/api/studentRecords/studentRecords" -import { listKb } from "@/api/teachOffice/kb" import { listTeam } from "@/api/studentRecords/team" export default { @@ -144,9 +144,8 @@ export default { /** 加载课程名称下拉选项 */ loadKbOptions() { - listKb({ pageNum: 1, pageSize: 1000 }).then(res => { - const data = res.data || {} - this.kbOptions = data.records || [] + listKbOptions().then(res => { + this.kbOptions = (res && res.data) || [] }).catch(() => { this.kbOptions = [] })