Explorar o código

学生成绩录入

dzx hai 11 meses
pai
achega
0ded022551

+ 4 - 4
src/main/java/com/xjrsoft/module/xycxedu/controller/ExamSubjectScoreEnterController.java

@@ -9,6 +9,7 @@ import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
 import com.xjrsoft.module.xycxedu.dto.AddExamSubjectScoreEnterDto;
+import com.xjrsoft.module.xycxedu.dto.ExamSubjectScoreEnterDto;
 import com.xjrsoft.module.xycxedu.dto.ExamSubjectScoreEnterPageDto;
 import com.xjrsoft.module.xycxedu.dto.UpdateExamSubjectScoreEnterDto;
 import com.xjrsoft.module.xycxedu.entity.ExamSubjectScoreEnter;
@@ -106,12 +107,11 @@ public class ExamSubjectScoreEnterController {
         return RT.ok(result);
     }
 
-    @GetMapping("/export")
+    @GetMapping("/export-query")
     @ApiOperation(value = "下载模板")
-    public ResponseEntity<byte[]> exportData(@Valid ExamSubjectScoreEnterPageDto dto, @RequestParam(defaultValue = "false") Boolean isTemplate) {
-        List<ExamSubjectScoreEnterPageVo> customerList = isTemplate != null && isTemplate ? new ArrayList<>() : ((PageOutput<ExamSubjectScoreEnterPageVo>) page(dto).getData()).getList();
+    public ResponseEntity<byte[]> exportData(@Valid ExamSubjectScoreEnterDto dto, @RequestParam(defaultValue = "false") Boolean isTemplate) {
         ByteArrayOutputStream bot = new ByteArrayOutputStream();
-        EasyExcel.write(bot, ExamSubjectScoreEnterPageVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(customerList);
+        EasyExcel.write(bot, ExamSubjectScoreEnterPageVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(new ArrayList<>());
 
         return RT.fileStream(bot.toByteArray(), "ExamSubjectScoreEnter" + ExcelTypeEnum.XLSX.getValue());
     }