教学大纲新增导出模板和导入按钮

This commit is contained in:
2026-09-17 10:03:29 +08:00
parent 9af6de6ff3
commit f7299c36e8
7 changed files with 602 additions and 41 deletions
@@ -92,13 +92,23 @@ public class ZYJXJHBController {
/**
* 专业教学计划表数据文件导入(.xls/.xlsx)。
* <p>表头顺序:专业代号, 课编号, 学期第次, 课类型, 学时, 学分, 周课时, 课程定位,
* 模块, 成绩分制, 理论学时, 实践学时, 考试课时, 教研室代号, 简称。编号由系统自动生成。</p>
* <p>按表头名匹配列(列位置不限),推荐使用 /template 下载的模板填写。
* 必填列:专业代号、课编号、学期第次、课类型、学时;
* "专业代号+课编号+学期第次"已存在的行跳过,校验失败行返回行级明细。</p>
*/
@PostMapping("/import")
public Result<Integer> importData(@RequestParam("file") MultipartFile file) throws Exception {
int count = zyjxjhbService.importZYJXJHBFromExcel(file);
return Result.success("导入成功,共" + count + "条", count);
public Result<com.roomroot.jwgl.vo.syllabus.SyllabusImportResultVO> importData(
@RequestParam("file") MultipartFile file) throws Exception {
com.roomroot.jwgl.vo.syllabus.SyllabusImportResultVO result = zyjxjhbService.importExcel(file);
return Result.success(result.getMessage(), result);
}
/**
* 下载教学大纲导入模板(数据 sheet + 填写说明 sheet)。
*/
@GetMapping("/template")
public void downloadTemplate(HttpServletResponse response) throws Exception {
zyjxjhbService.downloadTemplate(response);
}
/**