forked from liweijie/education
课表申请功能重写 bug修复
This commit is contained in:
+7
-126
@@ -3,7 +3,6 @@ package com.roomroot.web.controller.jwgl;
|
||||
import com.roomroot.jwgl.dto.courserunning.ClassesImportDTO;
|
||||
import com.roomroot.jwgl.dto.courserunning.ImportRemoveDTO;
|
||||
import com.roomroot.jwgl.dto.courserunning.ScheduleAdjustApplyDTO;
|
||||
import com.roomroot.jwgl.dto.courserunning.ScheduleAdjustStrategyDTO;
|
||||
import com.roomroot.jwgl.dto.courserunning.ScheduleAdjustAuditDTO;
|
||||
import com.roomroot.jwgl.dto.courserunning.ScheduleAdjustQueryDTO;
|
||||
import com.roomroot.jwgl.dto.courserunning.SemesterImportDTO;
|
||||
@@ -309,7 +308,7 @@ public class CourseRunningController {
|
||||
* 查询单个调课申请的完整详情。
|
||||
* <p>
|
||||
* 根据调课申请编号查询该申请的完整信息,包括申请信息、调整后的内容、
|
||||
* 教研室审批状态、机关审批记录、关联的教室、辅助教员、学员队、保障明细等。
|
||||
* 教研室审批与查收状态、关联的教室、辅助教员、学员队、保障明细等。
|
||||
* </p>
|
||||
*
|
||||
* @param ssdksqbh 调课申请编号
|
||||
@@ -338,148 +337,30 @@ public class CourseRunningController {
|
||||
/**
|
||||
* 教研室审批调课申请。
|
||||
* <p>
|
||||
* 教研室审批教员提交的调课申请,包含同意、发回、拒绝三种处理方式。
|
||||
* 教研室审批调课申请。点审批即已查收,审批人同时记为查收人。
|
||||
* 同意、发回、拒绝均为已查收;教员撤回后为未查收。
|
||||
* </p>
|
||||
*
|
||||
* @param dto 教研室审批参数(auditRole 传 "jys")
|
||||
* @param dto 教研室审批参数
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping("/adjust/audit/jys")
|
||||
public Result<Void> auditByTeachingOffice(@Valid @RequestBody ScheduleAdjustAuditDTO dto) {
|
||||
// 自动设置审批角色为教研室
|
||||
dto.setAuditRole("jys");
|
||||
courseRunningImportService.auditByTeachingOffice(dto);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 教研室查收调课申请。
|
||||
* <p>
|
||||
* 教研室查收调课申请,标记查收状态和查收时间。
|
||||
* </p>
|
||||
*
|
||||
* @param ssdksqbh 调课申请编号
|
||||
* @param csrbh 查收人编号
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping("/adjust/receive/jys")
|
||||
public Result<Void> receiveByTeachingOffice(@RequestParam("ssdksqbh") String ssdksqbh,
|
||||
@RequestParam("csrbh") String csrbh) {
|
||||
courseRunningImportService.receiveByTeachingOffice(ssdksqbh, csrbh);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 教学系审批调课申请。
|
||||
* <p>
|
||||
* 教学系审批教研室已同意的调课申请,包含同意、发回、拒绝三种处理方式。
|
||||
* 构成三级审批流程的中间环节(教研室→教学系→机关)。
|
||||
* </p>
|
||||
*
|
||||
* @param dto 教学系审批参数(auditRole 传 "jxx")
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping("/adjust/audit/jxx")
|
||||
public Result<Void> auditByTeachingDepartment(@Valid @RequestBody ScheduleAdjustAuditDTO dto) {
|
||||
// 自动设置审批角色为教学系
|
||||
dto.setAuditRole("jxx");
|
||||
courseRunningImportService.auditByTeachingDepartment(dto);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 机关审批调课申请。
|
||||
* <p>
|
||||
* 机关审批教研室已同意的调课申请,包含同意、发回、拒绝三种处理方式。
|
||||
* </p>
|
||||
*
|
||||
* @param dto 机关审批参数(auditRole 传 "jg",需传 jgbh)
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping("/adjust/audit/jg")
|
||||
public Result<Void> auditByAuthority(@Valid @RequestBody ScheduleAdjustAuditDTO dto) {
|
||||
// 自动设置审批角色为机关
|
||||
dto.setAuditRole("jg");
|
||||
courseRunningImportService.auditByAuthority(dto);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 机关查收调课申请。
|
||||
* <p>
|
||||
* 机关查收调课申请,标记查收状态和查收时间。
|
||||
* </p>
|
||||
*
|
||||
* @param ssdksqbh 调课申请编号
|
||||
* @param jgbh 机关编号
|
||||
* @param csrbh 查收人编号
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping("/adjust/receive/jg")
|
||||
public Result<Void> receiveByAuthority(@RequestParam("ssdksqbh") String ssdksqbh,
|
||||
@RequestParam("jgbh") String jgbh,
|
||||
@RequestParam("csrbh") String csrbh) {
|
||||
courseRunningImportService.receiveByAuthority(ssdksqbh, jgbh, csrbh);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤销调课申请。
|
||||
* <p>
|
||||
* 教员撤销自己提交的、未经过审批的调课申请。
|
||||
* 教员撤销未经过审批的调课申请。列表已按登录教员过滤,只需传申请编号。
|
||||
* </p>
|
||||
*
|
||||
* @param ssdksqbh 调课申请编号
|
||||
* @param sqjybh 申请教员编号
|
||||
* @return 操作结果
|
||||
*/
|
||||
@DeleteMapping("/adjust/cancel")
|
||||
public Result<Void> cancelScheduleAdjust(@RequestParam("ssdksqbh") String ssdksqbh,
|
||||
@RequestParam("sqjybh") String sqjybh) {
|
||||
courseRunningImportService.cancelScheduleAdjust(ssdksqbh, sqjybh);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
// ==================== 调课策略管理 ====================
|
||||
|
||||
/**
|
||||
* 查询调课策略列表。
|
||||
* <p>
|
||||
* 支持按策略类型筛选,返回所有策略(含停用)。
|
||||
* </p>
|
||||
*
|
||||
* @param cllx 策略类型:TIME_LIMIT=时间段限制,AUTO_APPROVE=免审批,为空时查询全部
|
||||
* @return 调课策略列表
|
||||
*/
|
||||
@GetMapping("/adjust/strategy/list")
|
||||
public Result<List<ScheduleAdjustStrategyVO>> listScheduleAdjustStrategies(
|
||||
@RequestParam(required = false) String cllx) {
|
||||
return Result.success(courseRunningImportService.listScheduleAdjustStrategies(cllx));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存调课策略(新增或修改)。
|
||||
* <p>
|
||||
* 策略编号为空时执行新增,非空时执行修改。
|
||||
* </p>
|
||||
*
|
||||
* @param dto 策略参数
|
||||
* @return 策略编号
|
||||
*/
|
||||
@PostMapping("/adjust/strategy/save")
|
||||
public Result<String> saveScheduleAdjustStrategy(@Valid @RequestBody ScheduleAdjustStrategyDTO dto) {
|
||||
return Result.success("保存成功", courseRunningImportService.saveScheduleAdjustStrategy(dto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除调课策略。
|
||||
*
|
||||
* @param clbh 策略编号
|
||||
* @return 操作结果
|
||||
*/
|
||||
@DeleteMapping("/adjust/strategy/delete")
|
||||
public Result<Void> deleteScheduleAdjustStrategy(@RequestParam("clbh") String clbh) {
|
||||
courseRunningImportService.deleteScheduleAdjustStrategy(clbh);
|
||||
public Result<Void> cancelScheduleAdjust(@RequestParam("ssdksqbh") String ssdksqbh) {
|
||||
courseRunningImportService.cancelScheduleAdjust(ssdksqbh);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
+19
@@ -221,6 +221,25 @@ public class JYSController {
|
||||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 教员数据文件导入(.xls/.xlsx)
|
||||
* <p>表头顺序:教员编号, 教员姓名, 教研室代号, 职称, 专业技术职务等级, 教员类别,
|
||||
* 性别, 手机号, 身份证号, 备注, 序号, 虚实类型。教员编号不填自动创建,离职状态默认 0。</p>
|
||||
*/
|
||||
@PostMapping("/teacher/import")
|
||||
public Result<Integer> importTeacher(@RequestParam("file") MultipartFile file) throws Exception {
|
||||
int count = facultyService.importJYBFromExcel(file);
|
||||
return Result.success("导入成功,共" + count + "条", count);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出全部在职教员到 Excel(.xlsx)。
|
||||
*/
|
||||
@GetMapping("/teacher/export")
|
||||
public void exportTeacher(HttpServletResponse response) throws Exception {
|
||||
facultyService.exportJYBExcel(response);
|
||||
}
|
||||
|
||||
// ======================== 教员属性管理 ========================
|
||||
|
||||
/**
|
||||
|
||||
+21
@@ -5,7 +5,9 @@ import com.roomroot.jwgl.service.TrainingProgramService;
|
||||
import com.roomroot.jwgl.unit.PageQuery;
|
||||
import com.roomroot.jwgl.unit.PageResult;
|
||||
import com.roomroot.jwgl.unit.Result;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
@@ -115,4 +117,23 @@ public class TrainingProgramController {
|
||||
PageResult<ZYB> pageResult = trainingProgramService.pageList(query, cond);
|
||||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 培养方案(专业)数据文件导入(.xls/.xlsx)。
|
||||
* <p>表头顺序:专业代号, 专业名称, 专业代码, 专业版本, 培训类型, 培训层次, 学年制,
|
||||
* 学期数, 专业方向, 专业备注, 学员类别, 简称, 培训类型2。专业代号不填自动生成。</p>
|
||||
*/
|
||||
@PostMapping("/import")
|
||||
public Result<Integer> importData(@RequestParam("file") MultipartFile file) throws Exception {
|
||||
int count = trainingProgramService.importZYBFromExcel(file);
|
||||
return Result.success("导入成功,共" + count + "条", count);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出培养方案(专业)到 Excel(.xlsx)。
|
||||
*/
|
||||
@GetMapping("/export")
|
||||
public void exportData(HttpServletResponse response) throws Exception {
|
||||
trainingProgramService.exportZYBExcel(response);
|
||||
}
|
||||
}
|
||||
|
||||
+21
@@ -3,7 +3,9 @@ package com.roomroot.web.controller.jwgl;
|
||||
import com.roomroot.jwgl.entity.ZYJXJHB;
|
||||
import com.roomroot.jwgl.service.ZYJXJHBService;
|
||||
import com.roomroot.jwgl.unit.Result;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.List;
|
||||
@@ -81,4 +83,23 @@ public class ZYJXJHBController {
|
||||
@RequestParam("ty") Integer ty) {
|
||||
return Result.success(zyjxjhbService.listByZydhAndTy(zydh, ty));
|
||||
}
|
||||
|
||||
/**
|
||||
* 专业教学计划表数据文件导入(.xls/.xlsx)。
|
||||
* <p>表头顺序:专业代号, 课编号, 学期第次, 课类型, 学时, 学分, 周课时, 课程定位,
|
||||
* 模块, 成绩分制, 理论学时, 实践学时, 考试课时, 教研室代号, 简称。编号由系统自动生成。</p>
|
||||
*/
|
||||
@PostMapping("/import")
|
||||
public Result<Integer> importData(@RequestParam("file") MultipartFile file) throws Exception {
|
||||
int count = zyjxjhbService.importZYJXJHBFromExcel(file);
|
||||
return Result.success("导入成功,共" + count + "条", count);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出专业教学计划到 Excel(.xlsx)。
|
||||
*/
|
||||
@GetMapping("/export")
|
||||
public void exportData(HttpServletResponse response) throws Exception {
|
||||
zyjxjhbService.exportZYJXJHBExcel(response);
|
||||
}
|
||||
}
|
||||
|
||||
+56
@@ -2,10 +2,13 @@ package com.roomroot.web.controller.jwtest;
|
||||
|
||||
import com.roomroot.jwgl.mapper.TestPkMapper;
|
||||
import com.roomroot.jwgl.unit.Result;
|
||||
import com.roomroot.jwgl.vo.jwtest.PkConflictCheckVO;
|
||||
import com.roomroot.jwgl.vo.jwtest.PkConflictVO;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
@@ -31,4 +34,57 @@ public class TestPkController {
|
||||
public Result<List<PkLessonVO>> all() {
|
||||
return Result.success(testPkMapper.selectAll());
|
||||
}
|
||||
|
||||
/**
|
||||
* 教学班时间冲突:同一个班在同一日期同一节次被安排多门课程。
|
||||
*/
|
||||
@GetMapping("/conflict/class")
|
||||
public Result<PkConflictCheckVO> classTimeConflict(@RequestParam(required = false) Integer nd) {
|
||||
return Result.success(wrap(
|
||||
"教学班时间冲突",
|
||||
"同一班次在同一天同一节次被安排了多门课程",
|
||||
testPkMapper.selectClassTimeConflict(nd)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 必修课与选修课时间冲突:同一班次同一时间既有必修又有选修。
|
||||
*/
|
||||
@GetMapping("/conflict/elective-required")
|
||||
public Result<PkConflictCheckVO> electiveRequiredConflict(@RequestParam(required = false) Integer nd) {
|
||||
return Result.success(wrap(
|
||||
"必修选修时间冲突",
|
||||
"同一班次在同一天同一节次同时安排了必修课和选修课",
|
||||
testPkMapper.selectElectiveRequiredConflict(nd)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 教员时间冲突:同一教员在同一时间段被安排多门课程。
|
||||
*/
|
||||
@GetMapping("/conflict/teacher")
|
||||
public Result<PkConflictCheckVO> teacherTimeConflict(@RequestParam(required = false) Integer nd) {
|
||||
return Result.success(wrap(
|
||||
"教员时间冲突",
|
||||
"同一教员在同一天同一节次被安排了多门课程",
|
||||
testPkMapper.selectTeacherTimeConflict(nd)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 教室时间冲突:同一教室在同一时间段被多门课程占用。
|
||||
*/
|
||||
@GetMapping("/conflict/classroom")
|
||||
public Result<PkConflictCheckVO> classroomTimeConflict(@RequestParam(required = false) Integer nd) {
|
||||
return Result.success(wrap(
|
||||
"教室时间冲突",
|
||||
"同一教室在同一天同一节次被多门课程占用",
|
||||
testPkMapper.selectClassroomTimeConflict(nd)));
|
||||
}
|
||||
|
||||
private PkConflictCheckVO wrap(String ctlx, String jcsm, List<PkConflictVO> mx) {
|
||||
PkConflictCheckVO vo = new PkConflictCheckVO();
|
||||
vo.setCtlx(ctlx);
|
||||
vo.setJcsm(jcsm);
|
||||
vo.setMx(mx);
|
||||
vo.setTs(mx == null ? 0 : mx.size());
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,6 +107,7 @@ mybatis-plus:
|
||||
typeAliasesPackage: com.roomroot.**.domain
|
||||
# 配置mapper的扫描,找到所有的mapper.xml映射文件
|
||||
mapperLocations: classpath*:mapper/**/*Mapper.xml,classpath*:com/roomroot/**/mapper/*.xml
|
||||
typeHandlersPackage: com.roomroot.jwgl.handler
|
||||
# 加载全局的配置文件
|
||||
configLocation: classpath:mybatis/mybatis-config.xml
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
|
||||
<setting name="defaultExecutorType" value="SIMPLE" />
|
||||
<!-- 指定 MyBatis 所用日志的具体实现 -->
|
||||
<setting name="logImpl" value="SLF4J" />
|
||||
<!-- 使用驼峰命名法转换字段 -->
|
||||
<!-- 使用驼峰命名法转换字段 -->
|
||||
<!-- <setting name="mapUnderscoreToCamelCase" value="true"/> -->
|
||||
</settings>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user