forked from liweijie/education
通过AI比对原操作文档,生成系统功能完善方案,根据方案进行增补,完善从学期新增到最终的排课功能
This commit is contained in:
+80
@@ -0,0 +1,80 @@
|
||||
package com.roomroot.web.controller.jwgl;
|
||||
|
||||
import com.roomroot.jwgl.dto.scheduling.SchedulingArrangeRequest;
|
||||
import com.roomroot.jwgl.dto.scheduling.SchedulingCellOpRequest;
|
||||
import com.roomroot.jwgl.service.SchedulingWindowService;
|
||||
import com.roomroot.jwgl.unit.Result;
|
||||
import com.roomroot.jwgl.vo.scheduling.SchedulingViewVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 实施排课窗口 Controller(阶段 5.3)。
|
||||
*
|
||||
* <p>组合查询 + 写操作:安排所选节次 / 删除所选节次 / 删除课程全部节次 / 彻底删除运行课程。
|
||||
* 硬冲突格忽略(双占、校历/班历/场地历/教员历不可排);软提示(配当周次不符、非正课)随返回值给出。</p>
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/schedulingWindow")
|
||||
public class SchedulingWindowController {
|
||||
|
||||
@Autowired
|
||||
private SchedulingWindowService schedulingWindowService;
|
||||
|
||||
/**
|
||||
* 排课窗组合视图:班次头 + 课程列表(排满标绿)+ 周次×星期×节次格子。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public Result<SchedulingViewVO> view(@RequestParam("xydxqbh") String xydxqbh) {
|
||||
return Result.success(schedulingWindowService.view(xydxqbh));
|
||||
}
|
||||
|
||||
/**
|
||||
* 安排所选节次。硬冲突格忽略并列出,软提示格照常安排并给出提示。
|
||||
*/
|
||||
@PostMapping("/arrange")
|
||||
public Result<Map<String, Object>> arrange(@RequestBody SchedulingArrangeRequest request) {
|
||||
return Result.success(schedulingWindowService.arrange(request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除所选节次:仅删除该课程在这些格上的课次;已提交实施计划的课次拒绝。
|
||||
*/
|
||||
@PostMapping("/deleteCells")
|
||||
public Result<Integer> deleteCells(@RequestBody SchedulingCellOpRequest request) {
|
||||
return Result.success(schedulingWindowService.deleteCells(request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除课程全部节次(课程仍留在列表)。
|
||||
*/
|
||||
@PostMapping("/clearCourse")
|
||||
public Result<Integer> clearCourse(@RequestParam("sskcbh") String sskcbh) {
|
||||
return Result.success(schedulingWindowService.clearCourse(sskcbh));
|
||||
}
|
||||
|
||||
/**
|
||||
* 彻底删除运行课程:课次与列表项一起删,编制侧任务保留(教员不可用)。
|
||||
*/
|
||||
@PostMapping("/deleteCourse")
|
||||
public Result<Integer> deleteCourse(@RequestParam("sskcbh") String sskcbh) {
|
||||
return Result.success(schedulingWindowService.deleteCourse(sskcbh));
|
||||
}
|
||||
|
||||
/**
|
||||
* 排课日志查询:按课程(可叠加操作类型)。
|
||||
*/
|
||||
@GetMapping("/logs")
|
||||
public Result<List<Map<String, Object>>> logs(@RequestParam("sskcbh") String sskcbh,
|
||||
@RequestParam(value = "czlx", required = false) String czlx) {
|
||||
return Result.success(schedulingWindowService.logs(sskcbh, czlx));
|
||||
}
|
||||
}
|
||||
+7
-9
@@ -124,21 +124,19 @@ public class StudentTeamTaskController {
|
||||
/**
|
||||
* 自动生成必修课程
|
||||
* <p>
|
||||
* 根据学员队编号从学员队表获取专业代号,
|
||||
* 再根据专业代号和学期第次查询专业教学计划表,
|
||||
* 为当前班次自动生成必修课程,插入到学员队任务表。
|
||||
* 按学员队学期编号定位目标班次学期,由它反查学员队编号、学期第次与年度,
|
||||
* 再按专业代号 + 学期第次查专业教学计划表补齐必修课程。
|
||||
* 已存在的课程(按课编号判断)不会重复添加。
|
||||
* </p>
|
||||
*
|
||||
* @param xydbh 学员队编号
|
||||
* @param xqdc 学期第次
|
||||
* @param xydxqbh 学员队学期编号
|
||||
* @return 新增数量
|
||||
*/
|
||||
@PostMapping("/autoGenerateRequiredCourses")
|
||||
public Result<Integer> autoGenerateRequiredCourses(
|
||||
@RequestParam("xydbh") String xydbh,
|
||||
@RequestParam("xqdc") Integer xqdc) {
|
||||
int count = studentTeamTaskService.autoGenerateRequiredCourses(xydbh, xqdc);
|
||||
public Result<Integer> autoGenerateRequiredCourses(@RequestParam("xydxqbh") String xydxqbh) {
|
||||
// 必须按「班次学期编号」定位:同一学员队在多个年度可能有学期第次相同的班次学期,
|
||||
// 只传 (学员队编号, 学期第次) 无法区分学年,会把课程任务写进别的年度。
|
||||
int count = studentTeamTaskService.autoGenerateRequiredCourses(xydxqbh);
|
||||
return Result.success(count);
|
||||
}
|
||||
|
||||
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
package com.roomroot.web.controller.jwgl;
|
||||
|
||||
import com.roomroot.jwgl.dto.taskbook.TaskBookBhListRequest;
|
||||
import com.roomroot.jwgl.dto.taskbook.TaskBookFillRequest;
|
||||
import com.roomroot.jwgl.dto.taskbook.TaskBookRoomRequest;
|
||||
import com.roomroot.jwgl.dto.taskbook.TaskBookTeacherRequest;
|
||||
import com.roomroot.jwgl.service.TaskBookFillService;
|
||||
import com.roomroot.jwgl.unit.Result;
|
||||
import com.roomroot.jwgl.vo.taskbook.TaskBookRowVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 教研室任务书填报 Controller(阶段 4)。
|
||||
*
|
||||
* <p>把已生成的课程任务确认成「可以排课的运行对象」:合班、责任教员、默认场地。</p>
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/taskBookFill")
|
||||
public class TaskBookFillController {
|
||||
|
||||
@Autowired
|
||||
private TaskBookFillService taskBookFillService;
|
||||
|
||||
/**
|
||||
* 填报列表:某教学任务下全部课程任务行(排序 课程→责任教员→课次,含合班分组号)。
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public Result<List<TaskBookRowVO>> list(@RequestParam("jxrwbh") String jxrwbh) {
|
||||
return Result.success(taskBookFillService.list(jxrwbh));
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动合班:所选行写入同一编组;科目/学时/课类型/成绩分制不同则拒绝并说明。
|
||||
*/
|
||||
@PostMapping("/merge")
|
||||
public Result<Integer> merge(@RequestBody TaskBookBhListRequest request) {
|
||||
return Result.success(taskBookFillService.merge(request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 按预设合班:按课程科目分组,组内按预设编班号写入同一编组。
|
||||
*/
|
||||
@PostMapping("/mergeByPreset")
|
||||
public Result<List<Map<String, Object>>> mergeByPreset(@RequestBody TaskBookBhListRequest request) {
|
||||
return Result.success(taskBookFillService.mergeByPreset(request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 拆班:所选行编组置 0。
|
||||
*/
|
||||
@PostMapping("/split")
|
||||
public Result<Integer> split(@RequestBody TaskBookBhListRequest request) {
|
||||
return Result.success(taskBookFillService.split(request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 责任教员指定:mode = unit(责任单位教员)/ academy(全院教员)/ plan(应用教研室计划教员)。
|
||||
* 同合班组其它行同步。
|
||||
*/
|
||||
@PostMapping("/setTeacher")
|
||||
public Result<Integer> setTeacher(@RequestBody TaskBookTeacherRequest request) {
|
||||
return Result.success(taskBookFillService.setTeacher(request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 场地指定:useSpecial=true 使用班次专用教室;否则按 jsbh 指定其它教室。同合班组同步。
|
||||
*/
|
||||
@PostMapping("/setRoom")
|
||||
public Result<Integer> setRoom(@RequestBody TaskBookRoomRequest request) {
|
||||
return Result.success(taskBookFillService.setRoom(request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 填报字段:计划教员 / 场地(同合班同步)/ 排课建议。
|
||||
*/
|
||||
@PostMapping("/fill")
|
||||
public Result<Integer> fill(@RequestBody TaskBookFillRequest request) {
|
||||
return Result.success(taskBookFillService.fill(request));
|
||||
}
|
||||
}
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
package com.roomroot.web.controller.jwgl;
|
||||
|
||||
import com.roomroot.jwgl.entity.JYL;
|
||||
import com.roomroot.jwgl.service.JYLService;
|
||||
import com.roomroot.jwgl.unit.PageQuery;
|
||||
import com.roomroot.jwgl.unit.PageResult;
|
||||
import com.roomroot.jwgl.unit.Result;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 教员历控制器(阶段 5.1)。排课冲突同时读取场地历与教员历。
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/teacherCalendar/jyl")
|
||||
public class TeacherCalendarController {
|
||||
|
||||
@Resource
|
||||
private JYLService jylService;
|
||||
|
||||
/** 新增教员历 */
|
||||
@PostMapping("/add")
|
||||
public Result<Void> add(@RequestBody JYL jyl) {
|
||||
jylService.add(jyl);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/** 删除教员历(软删) */
|
||||
@PostMapping("/delete")
|
||||
public Result<Void> delete(@RequestParam("bh") String bh) {
|
||||
jylService.delete(bh);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/** 更新教员历 */
|
||||
@PostMapping("/update")
|
||||
public Result<Void> update(@RequestBody JYL jyl) {
|
||||
jylService.update(jyl);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/** 根据编号查询 */
|
||||
@GetMapping("/get")
|
||||
public Result<JYL> getById(@RequestParam("bh") String bh) {
|
||||
return Result.success(jylService.getById(bh));
|
||||
}
|
||||
|
||||
/** 分页查询 */
|
||||
@GetMapping("/list")
|
||||
public Result<PageResult<JYL>> list(PageQuery query, JYL jyl) {
|
||||
return Result.success(jylService.pageList(query, jyl));
|
||||
}
|
||||
|
||||
/** 查询全部 */
|
||||
@GetMapping("/all")
|
||||
public Result<List<JYL>> all(JYL jyl) {
|
||||
return Result.success(jylService.list(jyl));
|
||||
}
|
||||
|
||||
/** 按教员编号查询 */
|
||||
@GetMapping("/listByJybh")
|
||||
public Result<List<JYL>> listByJybh(@RequestParam("jybh") String jybh) {
|
||||
return Result.success(jylService.listByJybh(jybh));
|
||||
}
|
||||
|
||||
/** 按日期查询 */
|
||||
@GetMapping("/listByRq")
|
||||
public Result<List<JYL>> listByRq(@RequestParam("rq") String rq) {
|
||||
return Result.success(jylService.listByRq(rq));
|
||||
}
|
||||
}
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
package com.roomroot.web.controller.jwgl;
|
||||
|
||||
import com.roomroot.jwgl.unit.Result;
|
||||
import com.roomroot.jwgl.dto.allocation.AllocationGroupRequest;
|
||||
import com.roomroot.jwgl.dto.allocation.AllocationSaveItem;
|
||||
import com.roomroot.jwgl.service.TeachingAllocationService;
|
||||
import com.roomroot.jwgl.vo.allocation.AllocationViewVO;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 教学配当 Controller(阶段 3)。
|
||||
*
|
||||
* <p>配当只做排课粗约束(周学时分布、同开同结),不直接写实施课程表。</p>
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/teachingAllocation")
|
||||
public class TeachingAllocationController {
|
||||
|
||||
@Autowired
|
||||
private TeachingAllocationService teachingAllocationService;
|
||||
|
||||
/**
|
||||
* 配当编辑器视图:周轴(每周可排正课)+ 任务行(含铺学时建议)。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public Result<AllocationViewVO> view(@RequestParam("xydxqbh") String xydxqbh) {
|
||||
return Result.success(teachingAllocationService.view(xydxqbh));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存配当:单条(列表 1 个元素)或多选批量;元素 saveGroup=true 时整编组同开同结。
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
public Result<Integer> save(@RequestBody List<AllocationSaveItem> items) {
|
||||
return Result.success(teachingAllocationService.save(items));
|
||||
}
|
||||
|
||||
/**
|
||||
* 优选序数上移/下移(direction: up/down),返回归一化后的任务编号顺序。
|
||||
*/
|
||||
@PostMapping("/move")
|
||||
public Result<List<String>> move(@RequestParam("xydxqbh") String xydxqbh,
|
||||
@RequestParam("bh") String bh,
|
||||
@RequestParam("direction") String direction) {
|
||||
return Result.success(teachingAllocationService.move(xydxqbh, bh, direction));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编组管理面板:同科目全部开课班次。
|
||||
*/
|
||||
@GetMapping("/groups")
|
||||
public Result<List<Map<String, Object>>> groups(@RequestParam("kbh") String kbh) {
|
||||
return Result.success(teachingAllocationService.groups(kbh));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编组管理:把所选任务统一改编组号。
|
||||
*/
|
||||
@PostMapping("/setGroup")
|
||||
public Result<Integer> setGroup(@RequestBody AllocationGroupRequest request) {
|
||||
return Result.success(teachingAllocationService.setGroup(request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出配当 Excel(支持批量:xydxqbh 逗号分隔)。
|
||||
*/
|
||||
@GetMapping("/export")
|
||||
public void export(@RequestParam("xydxqbh") String xydxqbh, HttpServletResponse response) throws Exception {
|
||||
teachingAllocationService.exportExcel(Arrays.asList(xydxqbh.split(",")), response);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user