forked from liweijie/education
后端代码
This commit is contained in:
+9
-7
@@ -290,19 +290,21 @@ public class CourseRunningController {
|
||||
|
||||
/**
|
||||
* 分页查询调课申请列表。
|
||||
* <p>
|
||||
* 根据查询条件分页查询调课申请列表,支持按实施_课程表编号、申请教员、
|
||||
* 年度、审批状态、查收状态、删除状态、申请日期范围筛选。
|
||||
* </p>
|
||||
*
|
||||
* @param query 查询参数(包含分页信息和筛选条件)
|
||||
* @return 分页调课申请列表
|
||||
*/
|
||||
@GetMapping("/adjust/list")
|
||||
public Result<PageResult<ScheduleAdjustApplyVO>> queryScheduleAdjustList(ScheduleAdjustQueryDTO query) {
|
||||
return Result.success(courseRunningImportService.queryScheduleAdjustList(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前教员可供调课的课次(学员队任务表 + 课表 + 课程表)。
|
||||
*/
|
||||
@GetMapping("/adjust/lessons")
|
||||
public Result<List<AdjustableLessonVO>> listAdjustableLessons(
|
||||
@RequestParam(value = "nd", required = false) Integer nd) {
|
||||
return Result.success(courseRunningImportService.listAdjustableLessons(nd));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询单个调课申请的完整详情。
|
||||
* <p>
|
||||
|
||||
+256
@@ -1,20 +1,41 @@
|
||||
package com.roomroot.web.controller.jwgl;
|
||||
|
||||
import com.roomroot.jwgl.dto.faculty.AddTeacherDTO;
|
||||
import com.roomroot.jwgl.dto.jys.ElectiveCourseBatchDTO;
|
||||
import com.roomroot.jwgl.dto.jys.ElectiveCourseQuery;
|
||||
import com.roomroot.jwgl.dto.jys.ElectiveCourseSaveDTO;
|
||||
import com.roomroot.jwgl.dto.jys.TeachingTaskQuery;
|
||||
import com.roomroot.jwgl.dto.jys.TeachingTaskSaveDTO;
|
||||
import com.roomroot.jwgl.entity.JYB;
|
||||
import com.roomroot.jwgl.entity.JYSB;
|
||||
import com.roomroot.jwgl.entity.JYSX;
|
||||
import com.roomroot.jwgl.entity.KB;
|
||||
import com.roomroot.jwgl.service.ElectiveCourseService;
|
||||
import com.roomroot.jwgl.service.FacultyService;
|
||||
import com.roomroot.jwgl.service.KBService;
|
||||
import com.roomroot.jwgl.service.TeachingTaskManageService;
|
||||
import com.roomroot.jwgl.unit.PageQuery;
|
||||
import com.roomroot.jwgl.unit.PageResult;
|
||||
import com.roomroot.jwgl.unit.Result;
|
||||
import com.roomroot.jwgl.vo.faculty.TeacherListVO;
|
||||
import com.roomroot.jwgl.vo.jys.ElectiveCourseVO;
|
||||
import com.roomroot.jwgl.vo.jys.TeachingOfficeBookCourseVO;
|
||||
import com.roomroot.jwgl.vo.jys.TeachingOfficeBookVO;
|
||||
import com.roomroot.jwgl.vo.jys.TeachingTaskDetailVO;
|
||||
import com.roomroot.jwgl.vo.jys.TeachingTaskSquadVO;
|
||||
import com.roomroot.jwgl.vo.jys.TeachingTaskVO;
|
||||
import com.roomroot.jwgl.unit.PageQuery;
|
||||
import com.roomroot.jwgl.unit.PageResult;
|
||||
import com.roomroot.jwgl.unit.Result;
|
||||
import com.roomroot.jwgl.vo.faculty.TeacherListVO;
|
||||
import com.roomroot.jwgl.vo.jys.ElectiveCourseVO;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 教研室管理(教研室管理
|
||||
* 教员管理
|
||||
@@ -32,6 +53,12 @@ public class JYSController {
|
||||
|
||||
@Resource
|
||||
private KBService kbService;
|
||||
|
||||
@Resource
|
||||
private ElectiveCourseService electiveCourseService;
|
||||
|
||||
@Resource
|
||||
private TeachingTaskManageService teachingTaskManageService;
|
||||
// ======================== 教研室管理 ========================
|
||||
|
||||
/**
|
||||
@@ -303,4 +330,233 @@ public class JYSController {
|
||||
cond.setJc(jc);
|
||||
return Result.success(kbService.pageList(new PageQuery(pageNum, pageSize), cond));
|
||||
}
|
||||
|
||||
// ======================== 选修课管理 ========================
|
||||
|
||||
/**
|
||||
* 分页查询选修课。
|
||||
* <p>
|
||||
* 联查学员队任务表、学员队表、课表,课类型含“选修”。
|
||||
* 支持按授课教员、课程科目名称、可选班次年级、选修班名称、选择课状态、培训层次筛选。
|
||||
* </p>
|
||||
*/
|
||||
@GetMapping("/elective/list")
|
||||
public Result<PageResult<ElectiveCourseVO>> listElective(
|
||||
@RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(defaultValue = "20") Integer pageSize,
|
||||
@RequestParam(required = false) String jyxm,
|
||||
@RequestParam(required = false) String kmc,
|
||||
@RequestParam(required = false) String kxbcnj,
|
||||
@RequestParam(required = false) String xxbmc,
|
||||
@RequestParam(required = false) String xkzt,
|
||||
@RequestParam(required = false) String pxcc) {
|
||||
ElectiveCourseQuery cond = new ElectiveCourseQuery();
|
||||
cond.setJyxm(jyxm);
|
||||
cond.setKmc(kmc);
|
||||
cond.setKxbcnj(kxbcnj);
|
||||
cond.setXxbmc(xxbmc);
|
||||
cond.setXkzt(xkzt);
|
||||
cond.setPxcc(pxcc);
|
||||
return Result.success(electiveCourseService.pageList(new PageQuery(pageNum, pageSize), cond));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新建选修课。
|
||||
*/
|
||||
@PostMapping("/elective/add")
|
||||
public Result<Void> addElective(@RequestBody ElectiveCourseSaveDTO dto) {
|
||||
electiveCourseService.add(dto);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 所选批量开放报名。
|
||||
*/
|
||||
@PostMapping("/elective/batch-open")
|
||||
public Result<Integer> batchOpenElective(@RequestBody ElectiveCourseBatchDTO dto) {
|
||||
int count = electiveCourseService.batchOpenRegistration(dto == null ? null : dto.getBhList());
|
||||
return Result.success("已开放报名 " + count + " 条", count);
|
||||
}
|
||||
|
||||
/**
|
||||
* 所选批量取消开放报名。
|
||||
*/
|
||||
@PostMapping("/elective/batch-cancel-open")
|
||||
public Result<Integer> batchCancelOpenElective(@RequestBody ElectiveCourseBatchDTO dto) {
|
||||
int count = electiveCourseService.batchCancelOpenRegistration(dto == null ? null : dto.getBhList());
|
||||
return Result.success("已取消开放报名 " + count + " 条", count);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量停止报名。
|
||||
*/
|
||||
@PostMapping("/elective/batch-stop")
|
||||
public Result<Integer> batchStopElective(@RequestBody ElectiveCourseBatchDTO dto) {
|
||||
int count = electiveCourseService.batchStopRegistration(dto == null ? null : dto.getBhList());
|
||||
return Result.success("已停止报名 " + count + " 条", count);
|
||||
}
|
||||
|
||||
/**
|
||||
* 所选批量根据学员反向确定班次范围。
|
||||
*/
|
||||
@PostMapping("/elective/batch-reverse-range")
|
||||
public Result<Integer> batchReverseRangeElective(@RequestBody ElectiveCourseBatchDTO dto) {
|
||||
int count = electiveCourseService.batchReverseClassRange(dto == null ? null : dto.getBhList());
|
||||
return Result.success("已根据学员反向确定班次范围 " + count + " 条", count);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载选修班列表。
|
||||
*/
|
||||
@GetMapping("/elective/export")
|
||||
public void exportElective(
|
||||
@RequestParam(required = false) String jyxm,
|
||||
@RequestParam(required = false) String kmc,
|
||||
@RequestParam(required = false) String kxbcnj,
|
||||
@RequestParam(required = false) String xxbmc,
|
||||
@RequestParam(required = false) String xkzt,
|
||||
@RequestParam(required = false) String pxcc,
|
||||
HttpServletResponse response) {
|
||||
ElectiveCourseQuery cond = new ElectiveCourseQuery();
|
||||
cond.setJyxm(jyxm);
|
||||
cond.setKmc(kmc);
|
||||
cond.setKxbcnj(kxbcnj);
|
||||
cond.setXxbmc(xxbmc);
|
||||
cond.setXkzt(xkzt);
|
||||
cond.setPxcc(pxcc);
|
||||
electiveCourseService.exportClassList(cond, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载选修班学员名单 Excel。
|
||||
*/
|
||||
@GetMapping("/elective/students/export-excel")
|
||||
public void exportElectiveStudentExcel(@RequestParam("bhList") List<String> bhList,
|
||||
HttpServletResponse response) {
|
||||
electiveCourseService.exportStudentExcel(bhList, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载选修班学员名单 Word。
|
||||
*/
|
||||
@GetMapping("/elective/students/export-word")
|
||||
public void exportElectiveStudentWord(@RequestParam("bhList") List<String> bhList,
|
||||
HttpServletResponse response) {
|
||||
electiveCourseService.exportStudentWord(bhList, response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 上传选修课数据。
|
||||
*/
|
||||
@PostMapping("/elective/import")
|
||||
public Result<Integer> importElective(@RequestParam("file") MultipartFile file) throws Exception {
|
||||
int count = electiveCourseService.importData(file);
|
||||
return Result.success("导入成功,共" + count + "条", count);
|
||||
}
|
||||
|
||||
// ======================== 教学任务管理 ========================
|
||||
|
||||
/**
|
||||
* 分页查询教学任务列表。
|
||||
* <p>含教研室数、学员队数、合班前后课程任务数和学时。未传年度时按当前学期。</p>
|
||||
*/
|
||||
@GetMapping("/task/list")
|
||||
public Result<PageResult<TeachingTaskVO>> listTask(
|
||||
@RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(defaultValue = "20") Integer pageSize,
|
||||
@RequestParam(required = false) String rwmc,
|
||||
@RequestParam(required = false) Integer nd,
|
||||
@RequestParam(required = false) Integer xqdc,
|
||||
@RequestParam(required = false) String zt) {
|
||||
TeachingTaskQuery cond = new TeachingTaskQuery();
|
||||
cond.setRwmc(rwmc);
|
||||
cond.setNd(nd);
|
||||
cond.setXqdc(xqdc);
|
||||
cond.setZt(zt);
|
||||
return Result.success(teachingTaskManageService.pageList(new PageQuery(pageNum, pageSize), cond));
|
||||
}
|
||||
|
||||
/**
|
||||
* 教学任务详情(含教研室任务书、学员队两个页签)。
|
||||
*/
|
||||
@GetMapping("/task/get")
|
||||
public Result<TeachingTaskDetailVO> getTask(@RequestParam("bh") String bh) {
|
||||
return Result.success(teachingTaskManageService.getDetail(bh));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增教学任务。
|
||||
* <p>机关发布;关联学员队后按专业教学计划和课表归属教研室生成教研室任务书。</p>
|
||||
*/
|
||||
@PostMapping("/task/add")
|
||||
public Result<Void> addTask(@RequestBody TeachingTaskSaveDTO dto) {
|
||||
teachingTaskManageService.add(dto);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑教学任务。
|
||||
*/
|
||||
@PostMapping("/task/update")
|
||||
public Result<Void> updateTask(@RequestBody TeachingTaskSaveDTO dto) {
|
||||
teachingTaskManageService.update(dto);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除教学任务(同时逻辑删除教研室任务书,并解除学员队关联)。
|
||||
*/
|
||||
@PostMapping("/task/delete")
|
||||
public Result<Void> deleteTask(@RequestParam("bh") String bh) {
|
||||
teachingTaskManageService.delete(bh);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布教学任务,并同步发布关联的教研室任务书。
|
||||
*/
|
||||
@PostMapping("/task/publish")
|
||||
public Result<Integer> publishTask(@RequestParam("bh") String bh) {
|
||||
int count = teachingTaskManageService.publish(bh);
|
||||
return Result.success("已发布,同步教研室任务书 " + count + " 份", count);
|
||||
}
|
||||
|
||||
/**
|
||||
* 教研室任务书列表。
|
||||
*/
|
||||
@GetMapping("/task/office-book/list")
|
||||
public Result<List<TeachingOfficeBookVO>> listTaskOfficeBooks(@RequestParam("jxrwbh") String jxrwbh) {
|
||||
return Result.success(teachingTaskManageService.listOfficeBooks(jxrwbh));
|
||||
}
|
||||
|
||||
/**
|
||||
* 教研室任务书详细(该教研室在本任务下的课程任务)。
|
||||
*/
|
||||
@GetMapping("/task/office-book/courses")
|
||||
public Result<List<TeachingOfficeBookCourseVO>> listTaskOfficeBookCourses(
|
||||
@RequestParam("jxrwbh") String jxrwbh,
|
||||
@RequestParam("jysdh") String jysdh) {
|
||||
return Result.success(teachingTaskManageService.listOfficeBookCourses(jxrwbh, jysdh));
|
||||
}
|
||||
|
||||
/**
|
||||
* 教学任务已关联学员队。
|
||||
*/
|
||||
@GetMapping("/task/squad/list")
|
||||
public Result<List<TeachingTaskSquadVO>> listTaskSquads(@RequestParam("jxrwbh") String jxrwbh) {
|
||||
return Result.success(teachingTaskManageService.listBoundSquads(jxrwbh));
|
||||
}
|
||||
|
||||
/**
|
||||
* 某学期可选学员队(未占用或占用当前任务)。年度、学期第次为空时取当前学期。
|
||||
*/
|
||||
@GetMapping("/task/squad/available")
|
||||
public Result<List<TeachingTaskSquadVO>> listAvailableTaskSquads(
|
||||
@RequestParam(required = false) Integer nd,
|
||||
@RequestParam(required = false) Integer xqdc,
|
||||
@RequestParam(required = false) String jxrwbh) {
|
||||
return Result.success(teachingTaskManageService.listAvailableSquads(nd, xqdc, jxrwbh));
|
||||
}
|
||||
}
|
||||
|
||||
+54
@@ -1,8 +1,14 @@
|
||||
package com.roomroot.web.controller.jwgl;
|
||||
|
||||
import com.roomroot.jwgl.dto.kcb.TimetableQuery;
|
||||
import com.roomroot.jwgl.entity.KCB;
|
||||
import com.roomroot.jwgl.service.KCBService;
|
||||
import com.roomroot.jwgl.unit.PageQuery;
|
||||
import com.roomroot.jwgl.unit.PageResult;
|
||||
import com.roomroot.jwgl.unit.Result;
|
||||
import com.roomroot.jwgl.vo.kcb.ClassTimetableVO;
|
||||
import com.roomroot.jwgl.vo.kcb.DailyWeeklyTimetableVO;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
@@ -69,4 +75,52 @@ public class KCBController {
|
||||
public Result<List<KCB>> list() {
|
||||
return Result.success(kcbService.list());
|
||||
}
|
||||
|
||||
/**
|
||||
* 今日课表。未传年度时按当前时间取本学期,可按队别班次筛选。
|
||||
*/
|
||||
@GetMapping("/today/list")
|
||||
public Result<List<DailyWeeklyTimetableVO>> listToday(TimetableQuery cond) {
|
||||
return Result.success(kcbService.listToday(cond));
|
||||
}
|
||||
|
||||
/**
|
||||
* 本周课表(周一至周日)。未传年度时按当前时间取本学期,可按队别班次筛选。
|
||||
*/
|
||||
@GetMapping("/week/list")
|
||||
public Result<List<DailyWeeklyTimetableVO>> listWeek(TimetableQuery cond) {
|
||||
return Result.success(kcbService.listWeek(cond));
|
||||
}
|
||||
|
||||
/**
|
||||
* 班次课表。未传年度时按当前时间取本学期,可按队别班次筛选。
|
||||
*/
|
||||
@GetMapping("/class/list")
|
||||
public Result<PageResult<ClassTimetableVO>> listClass(PageQuery query, TimetableQuery cond) {
|
||||
return Result.success(kcbService.pageClassTimetable(query, cond));
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载学期教学实施计划 Excel。
|
||||
*/
|
||||
@GetMapping("/class/export-plan")
|
||||
public void exportSemesterPlan(TimetableQuery cond, HttpServletResponse response) {
|
||||
kcbService.exportSemesterPlan(cond, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载学期成绩表 Excel。
|
||||
*/
|
||||
@GetMapping("/class/export-grades")
|
||||
public void exportSemesterGrades(TimetableQuery cond, HttpServletResponse response) {
|
||||
kcbService.exportSemesterGrades(cond, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 班次课程列表另存 Excel。
|
||||
*/
|
||||
@GetMapping("/class/export-courses")
|
||||
public void exportClassCourses(TimetableQuery cond, HttpServletResponse response) {
|
||||
kcbService.exportClassCourses(cond, response);
|
||||
}
|
||||
}
|
||||
|
||||
+4
@@ -25,6 +25,10 @@ public class SemesterController {
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public Result<Void> add(@RequestBody XQ xq) {
|
||||
|
||||
if (semesterService.getById(xq.getNd()) != null) {
|
||||
return Result.error(400, "该年度已存在,不能重复添加");
|
||||
}
|
||||
semesterService.add(xq);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package com.roomroot.web.controller.jwtest;
|
||||
|
||||
import com.roomroot.jwgl.mapper.TestPkMapper;
|
||||
import com.roomroot.jwgl.unit.Result;
|
||||
import com.roomroot.jwgl.vo.jwtest.PkLessonVO;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 排课测试接口。
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/jwtest/pk")
|
||||
public class TestPkController {
|
||||
|
||||
@Resource
|
||||
private TestPkMapper testPkMapper;
|
||||
|
||||
/**
|
||||
* 全查排课记录,无筛选条件。
|
||||
* <p>
|
||||
* 回显:课堂名称、课程名称、教师名称、班级名称、教室名称、
|
||||
* 上课日期、开始时间、结束时间、学年学期、周次、应到人数。
|
||||
* </p>
|
||||
*/
|
||||
@GetMapping("/all")
|
||||
public Result<List<PkLessonVO>> all() {
|
||||
return Result.success(testPkMapper.selectAll());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user