1、校历的78、晚上、夜间等直接落库,

2、配当、任务书完善、排课窗完善;
3、任务书批量发布、删除等;
4、班历同步校历
This commit is contained in:
2026-09-18 10:38:39 +08:00
parent 911dfe911b
commit f3ae9fb2fd
62 changed files with 3508 additions and 143 deletions
@@ -47,12 +47,14 @@ public class ClassEventCalendarController {
}
/**
* 重新同步校历:confirm=false 返回缺失格预览,confirm=true 实际补齐(只补缺失,不覆盖人工改动)
* 重新同步校历:confirm=false 返回差异预览,confirm=true 实际写入;
* force=true 时额外覆盖与校历不一致的已有格。
*/
@PostMapping("/resync")
public Result<ClassCalendarResyncVO> resync(@RequestParam("xydxqbh") String xydxqbh,
@RequestParam(value = "confirm", defaultValue = "false") boolean confirm) {
return Result.success(classEventCalendarService.resync(xydxqbh, confirm));
@RequestParam(value = "confirm", defaultValue = "false") boolean confirm,
@RequestParam(value = "force", defaultValue = "false") boolean force) {
return Result.success(classEventCalendarService.resync(xydxqbh, confirm, force));
}
@PostMapping("/apply")
@@ -10,6 +10,8 @@ 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.DailyWeeklyTimetableRangeVO;
import com.roomroot.jwgl.vo.kcb.DailyWeeklyTimetableVO;
import com.roomroot.jwgl.vo.kcb.FreePeriodsVO;
import com.roomroot.jwgl.vo.kcb.TimetableGridVO;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.http.HttpHeaders;
@@ -166,4 +168,24 @@ public class KCBController {
new String(name.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1));
return ResponseEntity.ok().headers(headers).body(bytes);
}
/**
* 有课/无课时段查询:按日期给出 busy(有课节次)与 free(无课节次)。
* <p>dim=semester|team|teacher|roomid 为对应编号;start/end 缺省本周。</p>
*/
@GetMapping("/freeSlots")
public Result<FreePeriodsVO> freeSlots(TimetableGridQuery query) {
return Result.success(timetableGridService.freePeriods(query));
}
/**
* 课次综合查询:按 年度/学期/学员队/教员/教室/教研室/学员 组合过滤课次日历。
* <p>学员账号只看本队;教员只看本人;教研室只看本室课程。</p>
*/
@GetMapping("/lessons")
public Result<List<DailyWeeklyTimetableVO>> listLessons(TimetableQuery cond,
@RequestParam(value = "start", required = false) String start,
@RequestParam(value = "end", required = false) String end) {
return Result.success(kcbService.listLessons(cond, start, end));
}
}
@@ -0,0 +1,109 @@
package com.roomroot.web.controller.jwgl;
import com.roomroot.jwgl.service.MyBusinessService;
import com.roomroot.jwgl.unit.Result;
import com.roomroot.jwgl.vo.kcb.ClassTimetableVO;
import com.roomroot.jwgl.vo.kcb.DailyWeeklyTimetableVO;
import com.roomroot.jwgl.vo.kcb.TimetableGridVO;
import com.roomroot.jwgl.vo.mybusiness.MyCourseTaskVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
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;
/**
* 「我的教学」角色视图接口(阶段 C)。
*
* <p>教员/教研室/学员维度全部由服务端按登录身份解析,
* 不接受调用方传入他人编号。</p>
*/
@RestController
@RequestMapping("/my")
public class MyBusinessController {
@Autowired
private MyBusinessService myBusinessService;
// ==================== 教员 ====================
/** 本教员课程任务 */
@GetMapping("/teacher/courses")
public Result<List<MyCourseTaskVO>> teacherCourses(@RequestParam(value = "nd", required = false) Integer nd,
@RequestParam(value = "xqdc", required = false) Integer xqdc) {
return Result.success(myBusinessService.teacherCourses(nd, xqdc));
}
/** 本教员实施计划(默认本周) */
@GetMapping("/teacher/lessons")
public Result<List<DailyWeeklyTimetableVO>> teacherLessons(@RequestParam(value = "start", required = false) String start,
@RequestParam(value = "end", required = false) String end,
@RequestParam(value = "nd", required = false) Integer nd) {
return Result.success(myBusinessService.teacherLessons(start, end, nd));
}
/** 本教员课表网格 */
@GetMapping("/teacher/grid")
public Result<TimetableGridVO> teacherGrid(@RequestParam(value = "mbbh", required = false) String mbbh,
@RequestParam(value = "start", required = false) String start,
@RequestParam(value = "end", required = false) String end,
@RequestParam(value = "nd", required = false) Integer nd) {
return Result.success(myBusinessService.teacherGrid(mbbh, start, end, nd));
}
// ==================== 教研室 ====================
/** 今日本室计划 */
@GetMapping("/office/today")
public Result<List<DailyWeeklyTimetableVO>> officeToday(@RequestParam(value = "rq", required = false) String rq,
@RequestParam(value = "offset", required = false) Integer offset) {
return Result.success(myBusinessService.officeToday(rq, offset));
}
/** 本室课程 */
@GetMapping("/office/courses")
public Result<List<ClassTimetableVO>> officeCourses(@RequestParam(value = "nd", required = false) Integer nd,
@RequestParam(value = "xqdc", required = false) Integer xqdc) {
return Result.success(myBusinessService.officeCourses(nd, xqdc));
}
/** 本室教员清单 */
@GetMapping("/office/teachers")
public Result<List<Map<String, Object>>> officeTeachers() {
return Result.success(myBusinessService.officeTeachers());
}
// ==================== 学员 ====================
/** 本学员队课程列表 */
@GetMapping("/student/courses")
public Result<List<ClassTimetableVO>> studentCourses(@RequestParam(value = "nd", required = false) Integer nd,
@RequestParam(value = "xqdc", required = false) Integer xqdc) {
return Result.success(myBusinessService.studentCourses(nd, xqdc));
}
/** 本学员队课次(默认本周) */
@GetMapping("/student/lessons")
public Result<List<DailyWeeklyTimetableVO>> studentLessons(@RequestParam(value = "start", required = false) String start,
@RequestParam(value = "end", required = false) String end) {
return Result.success(myBusinessService.studentLessons(start, end));
}
/** 本学员队课表网格 */
@GetMapping("/student/grid")
public Result<TimetableGridVO> studentGrid(@RequestParam(value = "mbbh", required = false) String mbbh,
@RequestParam(value = "start", required = false) String start,
@RequestParam(value = "end", required = false) String end,
@RequestParam(value = "nd", required = false) Integer nd) {
return Result.success(myBusinessService.studentGrid(mbbh, start, end, nd));
}
/** 本学员队干部清单 */
@GetMapping("/team/cadres")
public Result<List<Map<String, Object>>> teamCadres() {
return Result.success(myBusinessService.teamCadres());
}
}
@@ -4,11 +4,15 @@ import com.roomroot.common.exception.ServiceException;
import com.roomroot.jwgl.dto.scheduling.SchedulingArrangeRequest;
import com.roomroot.jwgl.dto.scheduling.SchedulingCellOpRequest;
import com.roomroot.jwgl.dto.scheduling.SchedulingCourseEditRequest;
import com.roomroot.jwgl.dto.scheduling.SchedulingMoveRequest;
import com.roomroot.jwgl.service.RunningCoursePublishService;
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.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@@ -17,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -38,6 +43,20 @@ public class SchedulingWindowController {
@Autowired
private RunningCoursePublishService runningCoursePublishService;
/**
* 导出排课窗视图 Excel:每周一个 sheet(节次×星期网格,阶段 E4)。
*/
@PreAuthorize("@ss.hasPermi('teach:schedulingWindow:list')")
@GetMapping("/export")
public ResponseEntity<byte[]> export(@RequestParam("xydxqbh") String xydxqbh) {
byte[] bytes = schedulingWindowService.exportView(xydxqbh);
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
headers.setContentDispositionFormData("attachment",
new String("排课窗口.xlsx".getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1));
return ResponseEntity.ok().headers(headers).body(bytes);
}
/**
* 排课窗组合视图:班次头 + 课程列表(排满标绿)+ 周次×星期×节次格子。
*/
@@ -56,6 +75,16 @@ public class SchedulingWindowController {
return Result.success(schedulingWindowService.arrange(request));
}
/**
* 拖拽移动课次:把 from 格的课次平移到 to 格(阶段 E4)。
* 目标格走与 arrange 相同的硬冲突校验;软提示照常移动并返回 warning。
*/
@PreAuthorize("@ss.hasPermi('teach:schedulingWindow:edit')")
@PostMapping("/move")
public Result<Map<String, Object>> move(@RequestBody SchedulingMoveRequest request) {
return Result.success(schedulingWindowService.moveLesson(request));
}
/**
* 删除所选节次:仅删除该课程在这些格上的课次;已提交实施计划的课次拒绝。
*/
@@ -0,0 +1,50 @@
package com.roomroot.web.controller.jwgl;
import com.roomroot.jwgl.entity.DBVersion;
import com.roomroot.jwgl.entity.JCSJB;
import com.roomroot.jwgl.service.ClassPeriodService;
import com.roomroot.jwgl.service.SystemSettingsService;
import com.roomroot.jwgl.unit.Result;
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.RestController;
import java.util.List;
/**
* 教务系统参数(DBVersion 单行,阶段 E1)。
*
* <p>当前开放字段:显示78节(xs78j)、显示晚上(xsws)、显示夜间(xsyj)、
* 教学要点名称(jxydmc)。更新只写非空字段。</p>
*/
@RestController
@RequestMapping("/systemSettings")
public class SystemSettingsController {
@Autowired
private SystemSettingsService systemSettingsService;
@Autowired
private ClassPeriodService classPeriodService;
/** 读取系统参数 */
@GetMapping("/get")
public Result<DBVersion> get() {
return Result.success(systemSettingsService.get());
}
/** 节次段字典:节次时间表的双节次行,供日历编辑器渲染节次列 */
@GetMapping("/periodSlots")
public Result<List<JCSJB>> periodSlots() {
return Result.success(classPeriodService.slotRows());
}
/** 更新系统参数(只写非空字段) */
@PostMapping("/update")
public Result<DBVersion> update(@RequestBody DBVersion settings) {
return Result.success(systemSettingsService.update(settings));
}
}
@@ -1,5 +1,8 @@
package com.roomroot.web.controller.jwgl;
import com.roomroot.jwgl.dto.taskbook.TaskBookBatchFillRequest;
import com.roomroot.jwgl.dto.taskbook.TaskBookBatchRoomRequest;
import com.roomroot.jwgl.dto.taskbook.TaskBookBatchTeacherRequest;
import com.roomroot.jwgl.dto.taskbook.TaskBookBhListRequest;
import com.roomroot.jwgl.dto.taskbook.TaskBookFillRequest;
import com.roomroot.jwgl.dto.taskbook.TaskBookRoomRequest;
@@ -34,8 +37,9 @@ public class TaskBookFillController {
* 填报列表:某教学任务下全部课程任务行(排序 课程→责任教员→课次,含合班分组号)。
*/
@GetMapping("/list")
public Result<List<TaskBookRowVO>> list(@RequestParam("jxrwbh") String jxrwbh) {
return Result.success(taskBookFillService.list(jxrwbh));
public Result<List<TaskBookRowVO>> list(@RequestParam("jxrwbh") String jxrwbh,
@RequestParam(value = "jybh", required = false) String jybh) {
return Result.success(taskBookFillService.list(jxrwbh, jybh));
}
/**
@@ -80,10 +84,50 @@ public class TaskBookFillController {
}
/**
* 填报字段:计划教员 / 场地(同合班同步)/ 排课建议。
* 填报字段:计划教员 / 场地(同合班同步)/ 排课建议 / 课次序号
*/
@PostMapping("/fill")
public Result<Integer> fill(@RequestBody TaskBookFillRequest request) {
return Result.success(taskBookFillService.fill(request));
}
/**
* 批量指定责任教员:对每行执行与 setTeacher 相同的校验与合班组同步。
*/
@PostMapping("/batchSetTeacher")
public Result<Integer> batchSetTeacher(@RequestBody TaskBookBatchTeacherRequest request) {
return Result.success(taskBookFillService.batchSetTeacher(request));
}
/**
* 批量指定场地:对每行执行与 setRoom 相同的校验与合班组同步。
*/
@PostMapping("/batchSetRoom")
public Result<Integer> batchSetRoom(@RequestBody TaskBookBatchRoomRequest request) {
return Result.success(taskBookFillService.batchSetRoom(request));
}
/**
* 批量填报:对所选行统一应用填报字段(仅写非空),单事务。
*/
@PostMapping("/batchFill")
public Result<Integer> batchFill(@RequestBody TaskBookBatchFillRequest request) {
return Result.success(taskBookFillService.batchFill(request));
}
/**
* 行级删除:所选课程任务行逻辑删除;已发布到运行课表的班次须先撤回。
*/
@PostMapping("/deleteRows")
public Result<Integer> deleteRows(@RequestBody TaskBookBhListRequest request) {
return Result.success(taskBookFillService.deleteRows(request));
}
/**
* 教研室跨任务汇总:该教研室全部任务书(附教学任务名称/年度/状态)。
*/
@GetMapping("/officeSummary")
public Result<List<Map<String, Object>>> officeSummary(@RequestParam("jysdh") String jysdh) {
return Result.success(taskBookFillService.officeSummary(jysdh));
}
}
@@ -72,6 +72,17 @@ public class TeachingAllocationController {
return Result.success(teachingAllocationService.setGroup(request));
}
/**
* 自动排布:按铺学时建议把计算起始周回填到 pdqsz。
* onlyMissing=true(辅助排布)只补未设起始周的任务;body 可选传任务编号列表限定范围。
*/
@PostMapping("/autoArrange")
public Result<Integer> autoArrange(@RequestParam("xydxqbh") String xydxqbh,
@RequestParam(value = "onlyMissing", defaultValue = "false") boolean onlyMissing,
@RequestBody(required = false) List<String> bhList) {
return Result.success(teachingAllocationService.autoArrange(xydxqbh, bhList, onlyMissing));
}
/**
* 导出配当 Excel(支持批量:xydxqbh 逗号分隔)。
*/
@@ -81,15 +81,15 @@ public class TeachingTaskController {
}
/**
* 发布教学任务及教研室任务书
* 根据教学任务编号修改状态为"发布",并批量更新所有关联的教研室任务书状态为"发布"
* 批量发布教学任务及教研室任务书
* 逐个任务置"发布"并同步教研室任务书;任一校验失败(已结束/任务书未生成)整批回滚。
*
* @param bh 教学任务编号
* @return 更新数量
* @param bhList 教学任务编号列表
* @return 更新的教研室任务书行数合计
*/
@PostMapping("/batchPublish")
public Result<Integer> batchPublish(@RequestParam("bh") String bh) {
int count = teachingTaskService.batchPublish(bh);
public Result<Integer> batchPublish(@RequestBody List<String> bhList) {
int count = teachingTaskService.batchPublish(bhList);
return Result.success(count);
}