教学大纲下载功能
This commit is contained in:
+6
-2
@@ -103,9 +103,13 @@ public class ZYJXJHBController {
|
||||
|
||||
/**
|
||||
* 导出专业教学计划到 Excel(.xlsx)。
|
||||
* <p>专业代号、停用标识可选,与列表筛选条件一致。</p>
|
||||
*/
|
||||
@GetMapping("/export")
|
||||
public void exportData(HttpServletResponse response) throws Exception {
|
||||
zyjxjhbService.exportZYJXJHBExcel(response);
|
||||
public void exportData(
|
||||
HttpServletResponse response,
|
||||
@RequestParam(required = false) String zydh,
|
||||
@RequestParam(required = false) Integer ty) throws Exception {
|
||||
zyjxjhbService.exportZYJXJHBExcel(response, zydh, ty);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,6 +68,11 @@ public interface ZYJXJHBService {
|
||||
/** 从 Excel(.xls/.xlsx) 导入专业教学计划 */
|
||||
int importZYJXJHBFromExcel(org.springframework.web.multipart.MultipartFile file) throws Exception;
|
||||
|
||||
/** 导出专业教学计划到 Excel(.xlsx) */
|
||||
void exportZYJXJHBExcel(jakarta.servlet.http.HttpServletResponse response) throws Exception;
|
||||
/**
|
||||
* 导出专业教学计划到 Excel(.xlsx)。
|
||||
*
|
||||
* @param zydh 专业代号(可选)
|
||||
* @param ty 停用标识(可选,0-正常,1-停用)
|
||||
*/
|
||||
void exportZYJXJHBExcel(jakarta.servlet.http.HttpServletResponse response, String zydh, Integer ty) throws Exception;
|
||||
}
|
||||
|
||||
+10
-3
@@ -104,9 +104,16 @@ public class ZYJXJHBServiceImpl implements ZYJXJHBService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportZYJXJHBExcel(jakarta.servlet.http.HttpServletResponse response) throws Exception {
|
||||
List<ZYJXJHB> list = zyjxjhbMapper.selectList(
|
||||
new LambdaQueryWrapper<ZYJXJHB>().orderByAsc(ZYJXJHB::getZydh));
|
||||
public void exportZYJXJHBExcel(jakarta.servlet.http.HttpServletResponse response, String zydh, Integer ty) throws Exception {
|
||||
LambdaQueryWrapper<ZYJXJHB> wrapper = new LambdaQueryWrapper<>();
|
||||
if (zydh != null && !zydh.isEmpty()) {
|
||||
wrapper.eq(ZYJXJHB::getZydh, zydh);
|
||||
}
|
||||
if (ty != null) {
|
||||
wrapper.eq(ZYJXJHB::getTy, ty);
|
||||
}
|
||||
wrapper.orderByAsc(ZYJXJHB::getZydh);
|
||||
List<ZYJXJHB> list = zyjxjhbMapper.selectList(wrapper);
|
||||
String[] headers = {"专业代号", "课编号", "学期第次", "课类型", "学时", "学分", "周课时",
|
||||
"课程定位", "模块", "成绩分制", "理论学时", "实践学时", "考试课时", "教研室代号", "简称"};
|
||||
byte[] bytes = com.roomroot.jwgl.utils.ExcelExportUtil.export("专业教学计划", headers, list,
|
||||
|
||||
Reference in New Issue
Block a user