Browse Source

Merge branch 'dev_v2.1.0' into release_v2.1.0
merge

wangliang 4 years ago
parent
commit
39c8e41291

+ 6 - 6
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/enums/GradeScopeEnum.java

@@ -8,12 +8,12 @@ package com.qmth.teachcloud.report.business.enums;
  * @Date: 2021/6/10
  */
 public enum GradeScopeEnum {
-    LOW_THAN_SIXTY("[0,60)", "60以下"),
-    SIXTY_TO_SEVENTY("[60,70)", "60-70"),
-    SEVENTY_TO_EIGHTY("[70,80)", "70-80"),
-    EIGHTY_TO_NINETY("[80,90)", "80-90"),
-    NINETY_TO_NINETY_FIVE("[90,95)", "90-95"),
-    NINETY_FIVE_TO_ONE_HUNDRED("[95,100)", "95-100");
+    LOW_THAN_FIFTY_FIVE("[0,54)", "1-54"),
+    FIFTY_FIVE_TO_SIXTY("[55,60)", "55-59"),
+    SIXTY_TO_SEVENTY("[60,70)", "60-69"),
+    SEVENTY_TO_EIGHTY("[70,80)", "70-79"),
+    EIGHTY_TO_NINETY("[80,90)", "80-89"),
+    NINETY_TO_ONE_HUNDRED("[90,100]", "90-100");
 
     GradeScopeEnum(String scope, String describe) {
         this.scope = scope;

+ 12 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/TBExamStudentServiceImpl.java

@@ -319,10 +319,16 @@ public class TBExamStudentServiceImpl extends ServiceImpl<TBExamStudentMapper, T
         ReportResult reportResult = new ReportResult();
         // 考生信息
         StudentInfo studentInfo = tbStudentMapper.getStudentBySchoolIdAndStudentCode(schoolId, studentCode);
+        if (Objects.isNull(studentInfo)) {
+            throw ExceptionResultEnum.ERROR.exception("未找到此考生信息");
+        }
         reportResult.setStudentInfo(studentInfo);
 
         //考试信息
         List<ExamInfo> examInfo = tbExamStudentMapper.listExamBySchoolIdAndStudentCode(schoolId, studentCode);
+        if (Objects.isNull(examInfo)) {
+            throw ExceptionResultEnum.ERROR.exception("未找到此考生的考试信息");
+        }
         for (ExamInfo info : examInfo) {
             List<CourseInfo> courseInfos = tbExamStudentMapper.listCourseByExamIdAndStudentCode(schoolId, info.getExamId(), studentCode);
             info.setCourseInfo(courseInfos);
@@ -340,10 +346,16 @@ public class TBExamStudentServiceImpl extends ServiceImpl<TBExamStudentMapper, T
         PersonalReportResult personalReportResult = new PersonalReportResult();
         // 考生信息
         ExamStudentResult examStudentResult = buildExamStudentResult(schoolId, examId, studentCode, courseCode);
+        if (Objects.isNull(examStudentResult)) {
+            throw ExceptionResultEnum.ERROR.exception("未找到此考生信息");
+        }
         personalReportResult.setStudent(examStudentResult);
 
         // 学院信息
         CollegeResult collegeResult = buildCollegeResult(schoolId, examId, studentCode, courseCode);
+        if (Objects.isNull(collegeResult)) {
+            throw ExceptionResultEnum.ERROR.exception("未找到考生的学院信息");
+        }
         personalReportResult.setCollege(collegeResult);
         return personalReportResult;
     }

+ 1 - 1
teachcloud-report-business/src/main/resources/mapper/TAExamCourseMapper.xml

@@ -171,7 +171,7 @@
         </where> ) t
         <if test="column != null and column != '' and order != null and order != ''">
             <choose>
-                <when test="inspectCollegeName != null and inspectCollegeName != ''">
+                <when test="column != null and column == 'inspectCollegeName'">
                     order by t.${column} ${order},t.teacherRank ${order}
                 </when>
                 <otherwise>

+ 3 - 1
teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/TBExamStudentController.java

@@ -139,6 +139,8 @@ public class TBExamStudentController {
             @ApiParam(value = "模糊查询", required = true) @RequestParam(required = false) String studentParam,
             @ApiParam(value = "排序列", required = false) @RequestParam(required = false) String column,
             @ApiParam(value = "排序规则", required = false) @RequestParam(required = false) OrderEnum order) throws Exception {
-        tbExamStudentService.exportInspectCollegeResult(semester, examId, courseCode, current, teachCollegeId, teacherId, studentParam, column, order);
+        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
+        Long orgId = sysUser.getOrgId();
+        tbExamStudentService.exportInspectCollegeResult(semester, examId, courseCode, current, orgId, teacherId, studentParam, column, order);
     }
 }