1、停用教员的同时禁用该教员的账号;
2、教员导入的时候,如果有错误,跳过并返回具体报错行; 3、教研室接口权限添加控制
This commit is contained in:
+47
@@ -32,6 +32,7 @@ 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.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@@ -68,6 +69,7 @@ public class JYSController {
|
||||
/**
|
||||
* 新增教研室
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:office:list')")
|
||||
@PostMapping("/office/add")
|
||||
public Result<Void> addOffice(@RequestBody JYSB entity,
|
||||
@RequestParam(required = false) Boolean syncDept) {
|
||||
@@ -82,6 +84,7 @@ public class JYSController {
|
||||
* 001 001 军事基础教研室 军基 基础部
|
||||
* @param jysdh 教研室代号
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:office:list')")
|
||||
@PostMapping("/office/disable")
|
||||
public Result<Void> disableOffice(@RequestParam("jysdh") String jysdh,
|
||||
@RequestParam(required = false) Boolean syncDept) {
|
||||
@@ -92,6 +95,7 @@ public class JYSController {
|
||||
/**
|
||||
* 更新教研室
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:office:list')")
|
||||
@PostMapping("/office/update")
|
||||
public Result<Void> updateOffice(@RequestBody JYSB entity,
|
||||
@RequestParam(required = false) Boolean syncDeptName) {
|
||||
@@ -102,6 +106,7 @@ public class JYSController {
|
||||
/**
|
||||
* 单个教研室补建/对齐组织部门(幂等:已关联则直接返回部门编号)。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:office:list')")
|
||||
@PostMapping("/office/sync-dept")
|
||||
public Result<Long> syncOfficeDept(@RequestParam("jysdh") String jysdh) {
|
||||
JYSB entity = facultyService.getJYSBById(jysdh);
|
||||
@@ -115,6 +120,7 @@ public class JYSController {
|
||||
* 对齐组织部门:为教研室批量创建/复用组织部门(直接执行,幂等)。
|
||||
* body:{ "ids": ["JYS01", ...] };ids 不传 = 全部教研室。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:office:list')")
|
||||
@PostMapping("/org/align-dept")
|
||||
public Result<com.roomroot.jwgl.vo.orgsync.OrgAlignResultVO> alignDepts(
|
||||
@RequestBody(required = false) java.util.Map<String, List<String>> body) {
|
||||
@@ -127,6 +133,7 @@ public class JYSController {
|
||||
*
|
||||
* @param jysdh 教研室代号
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:office:list')")
|
||||
@GetMapping("/office/get")
|
||||
public Result<JYSB> getOffice(@RequestParam("jysdh") String jysdh) {
|
||||
JYSB entity = facultyService.getJYSBById(jysdh);
|
||||
@@ -143,6 +150,7 @@ public class JYSController {
|
||||
* </ul>
|
||||
* </p>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:office:list')")
|
||||
@GetMapping("/office/list")
|
||||
public Result<PageResult<JYSB>> listOffice(
|
||||
@RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@@ -172,6 +180,7 @@ public class JYSController {
|
||||
* 未填写时返回"XX未填写";序号、停用、虚实类型等非空字段由后台自动填充。
|
||||
* </p>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:office:list')")
|
||||
@PostMapping("/office/import")
|
||||
public Result<Integer> importOffice(@RequestParam("file") MultipartFile file,
|
||||
@RequestParam(required = false) Boolean syncDept) throws Exception {
|
||||
@@ -184,6 +193,7 @@ public class JYSController {
|
||||
* 新增教员(同时写入教员表和教员属性表)
|
||||
* <p>教员属性中的非空字段由前端一并传入。</p>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:teacher:list')")
|
||||
@PostMapping("/teacher/add")
|
||||
public Result<Void> addTeacher(@RequestBody AddTeacherDTO dto) {
|
||||
facultyService.addJYB(dto);
|
||||
@@ -195,6 +205,7 @@ public class JYSController {
|
||||
*
|
||||
* @param jybh 教员编号
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:teacher:list')")
|
||||
@PostMapping("/teacher/disable")
|
||||
public Result<Void> disableTeacher(@RequestParam("jybh") String jybh) {
|
||||
facultyService.disableJYB(jybh);
|
||||
@@ -204,6 +215,7 @@ public class JYSController {
|
||||
/**
|
||||
* 单个教员补建/对齐系统账号(幂等:已有账号直接返回用户编号)。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:teacher:list')")
|
||||
@PostMapping("/teacher/sync-user")
|
||||
public Result<Long> syncTeacherUser(@RequestParam("jybh") String jybh,
|
||||
@RequestParam(required = false) String loginName,
|
||||
@@ -220,6 +232,7 @@ public class JYSController {
|
||||
* 对齐到用户表:为无账号教员批量建账号(直接执行,幂等,逐条返回明细)。
|
||||
* body:{ "ids": ["JY01", ...] };ids 不传 = 全部无账号教员。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:teacher:list')")
|
||||
@PostMapping("/teacher/align-user")
|
||||
public Result<com.roomroot.jwgl.vo.orgsync.OrgAlignResultVO> alignUsers(
|
||||
@RequestBody(required = false) java.util.Map<String, List<String>> body) {
|
||||
@@ -230,6 +243,7 @@ public class JYSController {
|
||||
/**
|
||||
* 一键对齐:先对齐组织部门、再对齐用户账号(同一事务,幂等)。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:office:list') and @ss.hasPermi('teach:teacher:list')")
|
||||
@PostMapping("/org/align-apply")
|
||||
public Result<java.util.Map<String, com.roomroot.jwgl.vo.orgsync.OrgAlignResultVO>> alignApply() {
|
||||
java.util.Map<String, com.roomroot.jwgl.vo.orgsync.OrgAlignResultVO> result =
|
||||
@@ -243,6 +257,7 @@ public class JYSController {
|
||||
* 更新教员基本信息
|
||||
* <p>支持教学单位调整(修改教研室代号)、职称调整(修改职称、专业技术职务等级)。</p>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:teacher:list')")
|
||||
@PostMapping("/teacher/update")
|
||||
public Result<Void> updateTeacher(@RequestBody JYB entity) {
|
||||
facultyService.updateJYB(entity);
|
||||
@@ -254,6 +269,7 @@ public class JYSController {
|
||||
*
|
||||
* @param jybh 教员编号
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:teacher:list')")
|
||||
@GetMapping("/teacher/get")
|
||||
public Result<JYB> getTeacher(@RequestParam("jybh") String jybh) {
|
||||
JYB entity = facultyService.getJYBById(jybh);
|
||||
@@ -272,6 +288,7 @@ public class JYSController {
|
||||
* </ul>
|
||||
* </p>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:teacher:list')")
|
||||
@GetMapping("/teacher/list")
|
||||
public Result<PageResult<TeacherListVO>> listTeacher(
|
||||
@RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@@ -297,6 +314,7 @@ public class JYSController {
|
||||
* <p>表头顺序:教员编号, 教员姓名, 教研室代号, 职称, 专业技术职务等级, 教员类别,
|
||||
* 性别, 手机号, 身份证号, 备注, 序号, 虚实类型。教员编号不填自动创建,离职状态默认 0。</p>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:teacher:list')")
|
||||
@PostMapping("/teacher/import")
|
||||
public Result<Integer> importTeacher(@RequestParam("file") MultipartFile file) throws Exception {
|
||||
int count = facultyService.importJYBFromExcel(file);
|
||||
@@ -306,6 +324,7 @@ public class JYSController {
|
||||
/**
|
||||
* 导出全部在职教员到 Excel(.xlsx)。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:teacher:list')")
|
||||
@GetMapping("/teacher/export")
|
||||
public void exportTeacher(HttpServletResponse response) throws Exception {
|
||||
facultyService.exportJYBExcel(response);
|
||||
@@ -318,6 +337,7 @@ public class JYSController {
|
||||
*
|
||||
* @param jybh 教员编号
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:teacher:list')")
|
||||
@GetMapping("/teacher/attribute/get")
|
||||
public Result<JYSX> getTeacherAttribute(@RequestParam("jybh") String jybh) {
|
||||
JYSX entity = facultyService.getJYSXByJYBH(jybh);
|
||||
@@ -328,6 +348,7 @@ public class JYSController {
|
||||
* 更新教员属性
|
||||
* <p>支持岗位调整(修改职务、职务时间)和技术等级调整(修改技术等级、技术等级时间)。</p>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:teacher:list')")
|
||||
@PostMapping("/teacher/attribute/update")
|
||||
public Result<Void> updateTeacherAttribute(@RequestBody JYSX entity) {
|
||||
facultyService.updateJYSX(entity);
|
||||
@@ -343,6 +364,7 @@ public class JYSController {
|
||||
* @param entity 课表实体
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:subject:list')")
|
||||
@PostMapping("/kb/add")
|
||||
public Result<Void> addKb(@RequestBody KB entity) {
|
||||
kbService.add(entity);
|
||||
@@ -356,6 +378,7 @@ public class JYSController {
|
||||
* @param kbh 课编号
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:subject:list')")
|
||||
@PostMapping("/kb/delete")
|
||||
public Result<Void> deleteKb(@RequestParam("kbh") String kbh) {
|
||||
kbService.delete(kbh);
|
||||
@@ -368,6 +391,7 @@ public class JYSController {
|
||||
* @param entity 课表实体(须含课编号)
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:subject:list')")
|
||||
@PostMapping("/kb/update")
|
||||
public Result<Void> updateKb(@RequestBody KB entity) {
|
||||
kbService.update(entity);
|
||||
@@ -380,6 +404,7 @@ public class JYSController {
|
||||
* @param kbh 课编号
|
||||
* @return 课表详情
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:subject:list')")
|
||||
@GetMapping("/kb/get")
|
||||
public Result<KB> getKb(@RequestParam("kbh") String kbh) {
|
||||
return Result.success(kbService.getByKbh(kbh));
|
||||
@@ -399,6 +424,7 @@ public class JYSController {
|
||||
* @param jc 简称(模糊,可选)
|
||||
* @return 分页结果
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:subject:list')")
|
||||
@GetMapping("/kb/list")
|
||||
public Result<PageResult<KB>> listKb(
|
||||
@RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@@ -430,6 +456,7 @@ public class JYSController {
|
||||
* 支持按授课教员、课程科目名称、可选班次年级、选修班名称、选择课状态、培训层次筛选。
|
||||
* </p>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:elective:list')")
|
||||
@GetMapping("/elective/list")
|
||||
public Result<PageResult<ElectiveCourseVO>> listElective(
|
||||
@RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@@ -453,6 +480,7 @@ public class JYSController {
|
||||
/**
|
||||
* 新建选修课。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:elective:list')")
|
||||
@PostMapping("/elective/add")
|
||||
public Result<Void> addElective(@RequestBody ElectiveCourseSaveDTO dto) {
|
||||
electiveCourseService.add(dto);
|
||||
@@ -462,6 +490,7 @@ public class JYSController {
|
||||
/**
|
||||
* 所选批量开放报名。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:elective:list')")
|
||||
@PostMapping("/elective/batch-open")
|
||||
public Result<Integer> batchOpenElective(@RequestBody ElectiveCourseBatchDTO dto) {
|
||||
int count = electiveCourseService.batchOpenRegistration(dto == null ? null : dto.getBhList());
|
||||
@@ -471,6 +500,7 @@ public class JYSController {
|
||||
/**
|
||||
* 所选批量取消开放报名。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:elective:list')")
|
||||
@PostMapping("/elective/batch-cancel-open")
|
||||
public Result<Integer> batchCancelOpenElective(@RequestBody ElectiveCourseBatchDTO dto) {
|
||||
int count = electiveCourseService.batchCancelOpenRegistration(dto == null ? null : dto.getBhList());
|
||||
@@ -480,6 +510,7 @@ public class JYSController {
|
||||
/**
|
||||
* 批量停止报名。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:elective:list')")
|
||||
@PostMapping("/elective/batch-stop")
|
||||
public Result<Integer> batchStopElective(@RequestBody ElectiveCourseBatchDTO dto) {
|
||||
int count = electiveCourseService.batchStopRegistration(dto == null ? null : dto.getBhList());
|
||||
@@ -489,6 +520,7 @@ public class JYSController {
|
||||
/**
|
||||
* 所选批量根据学员反向确定班次范围。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:elective:list')")
|
||||
@PostMapping("/elective/batch-reverse-range")
|
||||
public Result<Integer> batchReverseRangeElective(@RequestBody ElectiveCourseBatchDTO dto) {
|
||||
int count = electiveCourseService.batchReverseClassRange(dto == null ? null : dto.getBhList());
|
||||
@@ -498,6 +530,7 @@ public class JYSController {
|
||||
/**
|
||||
* 下载选修班列表。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:elective:list')")
|
||||
@GetMapping("/elective/export")
|
||||
public void exportElective(
|
||||
@RequestParam(required = false) String jyxm,
|
||||
@@ -520,6 +553,7 @@ public class JYSController {
|
||||
/**
|
||||
* 下载选修班学员名单 Excel。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:elective:list')")
|
||||
@GetMapping("/elective/students/export-excel")
|
||||
public void exportElectiveStudentExcel(@RequestParam("bhList") List<String> bhList,
|
||||
HttpServletResponse response) {
|
||||
@@ -529,6 +563,7 @@ public class JYSController {
|
||||
/**
|
||||
* 下载选修班学员名单 Word。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:elective:list')")
|
||||
@GetMapping("/elective/students/export-word")
|
||||
public void exportElectiveStudentWord(@RequestParam("bhList") List<String> bhList,
|
||||
HttpServletResponse response) {
|
||||
@@ -540,6 +575,7 @@ public class JYSController {
|
||||
/**
|
||||
* 上传选修课数据。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:elective:list')")
|
||||
@PostMapping("/elective/import")
|
||||
public Result<Integer> importElective(@RequestParam("file") MultipartFile file) throws Exception {
|
||||
int count = electiveCourseService.importData(file);
|
||||
@@ -552,6 +588,7 @@ public class JYSController {
|
||||
* 分页查询教学任务列表。
|
||||
* <p>含教研室数、学员队数、合班前后课程任务数和学时。未传年度时按当前学期。</p>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:taskPlan:list')")
|
||||
@GetMapping("/task/list")
|
||||
public Result<PageResult<TeachingTaskVO>> listTask(
|
||||
@RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@@ -571,6 +608,7 @@ public class JYSController {
|
||||
/**
|
||||
* 教学任务详情(含教研室任务书、学员队两个页签)。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:taskPlan:list')")
|
||||
@GetMapping("/task/get")
|
||||
public Result<TeachingTaskDetailVO> getTask(@RequestParam("bh") String bh) {
|
||||
return Result.success(teachingTaskManageService.getDetail(bh));
|
||||
@@ -580,6 +618,7 @@ public class JYSController {
|
||||
* 新增教学任务。
|
||||
* <p>机关发布;关联学员队后按专业教学计划和课表归属教研室生成教研室任务书。</p>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:taskPlan:list')")
|
||||
@PostMapping("/task/add")
|
||||
public Result<Void> addTask(@RequestBody TeachingTaskSaveDTO dto) {
|
||||
teachingTaskManageService.add(dto);
|
||||
@@ -589,6 +628,7 @@ public class JYSController {
|
||||
/**
|
||||
* 编辑教学任务。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:taskPlan:list')")
|
||||
@PostMapping("/task/update")
|
||||
public Result<Void> updateTask(@RequestBody TeachingTaskSaveDTO dto) {
|
||||
teachingTaskManageService.update(dto);
|
||||
@@ -598,6 +638,7 @@ public class JYSController {
|
||||
/**
|
||||
* 删除教学任务(同时逻辑删除教研室任务书,并解除学员队关联)。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:taskPlan:list')")
|
||||
@PostMapping("/task/delete")
|
||||
public Result<Void> deleteTask(@RequestParam("bh") String bh) {
|
||||
teachingTaskManageService.delete(bh);
|
||||
@@ -607,6 +648,7 @@ public class JYSController {
|
||||
/**
|
||||
* 发布教学任务,并同步发布关联的教研室任务书。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:taskPlan:list')")
|
||||
@PostMapping("/task/publish")
|
||||
public Result<Integer> publishTask(@RequestParam("bh") String bh) {
|
||||
int count = teachingTaskManageService.publish(bh);
|
||||
@@ -616,6 +658,7 @@ public class JYSController {
|
||||
/**
|
||||
* 结束发布。结束后任务书和课程任务只读。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:taskPlan:list')")
|
||||
@PostMapping("/task/endPublish")
|
||||
public Result<Void> endPublishTask(@RequestParam("bh") String bh) {
|
||||
teachingTaskManageService.endPublish(bh);
|
||||
@@ -625,6 +668,7 @@ public class JYSController {
|
||||
/**
|
||||
* 教研室任务书列表。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:taskPlan:list')")
|
||||
@GetMapping("/task/office-book/list")
|
||||
public Result<List<TeachingOfficeBookVO>> listTaskOfficeBooks(@RequestParam("jxrwbh") String jxrwbh) {
|
||||
return Result.success(teachingTaskManageService.listOfficeBooks(jxrwbh));
|
||||
@@ -633,6 +677,7 @@ public class JYSController {
|
||||
/**
|
||||
* 教研室任务书详细(该教研室在本任务下的课程任务)。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:taskPlan:list')")
|
||||
@GetMapping("/task/office-book/courses")
|
||||
public Result<List<TeachingOfficeBookCourseVO>> listTaskOfficeBookCourses(
|
||||
@RequestParam("jxrwbh") String jxrwbh,
|
||||
@@ -643,6 +688,7 @@ public class JYSController {
|
||||
/**
|
||||
* 教学任务已关联学员队。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:taskPlan:list')")
|
||||
@GetMapping("/task/squad/list")
|
||||
public Result<List<TeachingTaskSquadVO>> listTaskSquads(@RequestParam("jxrwbh") String jxrwbh) {
|
||||
return Result.success(teachingTaskManageService.listBoundSquads(jxrwbh));
|
||||
@@ -651,6 +697,7 @@ public class JYSController {
|
||||
/**
|
||||
* 某学期可选学员队(未占用或占用当前任务)。年度、学期第次为空时取当前学期。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:taskPlan:list')")
|
||||
@GetMapping("/task/squad/available")
|
||||
public Result<List<TeachingTaskSquadVO>> listAvailableTaskSquads(
|
||||
@RequestParam(required = false) Integer nd,
|
||||
|
||||
Reference in New Issue
Block a user