소스 검색

班级成绩查看导出

dzx 10 달 전
부모
커밋
2874debabe
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      src/main/java/com/xjrsoft/module/xycxedu/controller/ExamSubjectScoreController.java

+ 5 - 2
src/main/java/com/xjrsoft/module/xycxedu/controller/ExamSubjectScoreController.java

@@ -98,7 +98,7 @@ public class ExamSubjectScoreController {
     @SaCheckPermission("examsubjectscore:detail")
     @XjrLog("班级成绩查询(分页)")
     public RT<PageOutput<ClassStudentScorePageVo>> classStudentScorePage(@Valid ClassStudentScorePageDto dto){
-        if(dto.getTreeType() != 4 || dto.getTreeId() == null ){
+        if((dto.getTreeType() != null && dto.getTreeType() != 4) || dto.getTreeId() == null ){
             return RT.ok(new PageOutput<>());
         }
         PageOutput<ClassStudentScorePageVo> pageOutput = scoreService.getClassStudentScorePage(dto);
@@ -120,9 +120,12 @@ public class ExamSubjectScoreController {
     @SaCheckPermission("examsubjectscore:detail")
     @XjrLog("导出考试成绩")
     public ResponseEntity<byte[]> classStudentScoreExportQuery(@Valid @RequestBody ClassStudentScorePageDto dto) throws IOException {
+        String fileName = "class-student-export-query" + ExcelTypeEnum.XLSX.getValue();
+        if((dto.getTreeType() != null && dto.getTreeType() != 4) || dto.getTreeId() == null ){
+            return RT.fileStream(new byte[0], fileName);
+        }
         //查询列头
         byte[] bytes = scoreService.getClassStudentScoreExportQuery(dto);
-        String fileName = "class-student-export-query" + ExcelTypeEnum.XLSX.getValue();
         return RT.fileStream(bytes, fileName);
     }