Przeglądaj źródła

Merge branch 'dev_v2.1.0' of http://git.qmth.com.cn/wangliang/distributed-print-service into dev_v2.1.0

xiaof 4 lat temu
rodzic
commit
3bb3e7f193

+ 1 - 1
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/dto/excel/AssignDto.java

@@ -8,7 +8,7 @@ import javax.validation.constraints.NotNull;
 
 public class AssignDto {
 
-    @ExcelNote(value = "考试编号")
+    @ExcelNote(value = "考试id")
     @NotNull
     private String examId;
 

+ 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) || examInfo.size() == 0) {
+            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;
     }

+ 4 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/templete/execute/AsyncDataCalculateTempleteService.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.qmth.teachcloud.common.contant.SpringContextHolder;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.TBTask;
+import com.qmth.teachcloud.common.enums.TaskResultEnum;
 import com.qmth.teachcloud.common.enums.TaskStatusEnum;
 import com.qmth.teachcloud.common.service.CacheService;
 import com.qmth.teachcloud.common.service.TBTaskService;
@@ -62,13 +63,16 @@ public class AsyncDataCalculateTempleteService extends AsyncCalculateTaskTemplet
             TaskCalculateService taskCalculateService = SpringContextHolder.getBean(TaskCalculateService.class);
             taskCalculateService.dataCalculate(map);
             tbExamCourse.setPublishStatus(PublishStatusEnum.UN_PUBLISH);
+            tbTask.setResult(TaskResultEnum.SUCCESS);
         }catch (Exception e){
             log.error("请求出错", e);
             exception = e.getMessage();
             tbTask.setRemark(exception);
+            tbTask.setResult(TaskResultEnum.ERROR);
             tbExamCourse.setPublishStatus(oldStatus);
         }finally {
             tbExamCourseService.updateById(tbExamCourse);
+            tbTaskService.updateById(tbTask);
             if (Objects.isNull(exception)){
                 cacheService.removeExamStudentReportCache();
                 cacheService.removeCollegeDeanCache();

+ 16 - 2
teachcloud-report-business/src/main/resources/mapper/TAExamCourseCollegeTeacherMapper.xml

@@ -119,7 +119,14 @@
             </if>
         </where> ) t
             <if test="column != null and column != '' and order != null and order != ''">
-                order by t.${column} ${order}
+                <choose>
+                    <when test="column != null and column == 'inspectCollegeName'">
+                        order by t.${column} ${order},t.rank ${order}
+                    </when>
+                    <otherwise>
+                        order by t.${column} ${order}
+                    </otherwise>
+                </choose>
             </if>
     </select>
 
@@ -187,7 +194,14 @@
             </if>
         </where> ) t
         <if test="column != null and column != '' and order != null and order != ''">
-            order by t.${column} ${order}
+            <choose>
+                <when test="column != null and column == 'inspectCollegeName'">
+                    order by t.${column} ${order},t.rank ${order}
+                </when>
+                <otherwise>
+                    order by t.${column} ${order}
+                </otherwise>
+            </choose>
         </if>
     </select>
 </mapper>

+ 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>

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

@@ -503,7 +503,7 @@ public class BasicDatasourceController {
 
             String teacherCode;
             Long orgId = null;
-            if (tbExaminationRelations.size() != 1){
+            if (tbExaminationRelations.size() == 0){
                 teacherCode = teacherInfo;
             }else {
                 List<String> teacherCodeList = tbExaminationRelations.stream().map(TBExaminationRelation::getTeacherCode).distinct().collect(Collectors.toList());

+ 3 - 11
teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/CourseController.java

@@ -122,11 +122,7 @@ public class CourseController {
                                             @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
                                             @ApiParam(value = "考查学院id", required = false) @RequestParam(required = false) String collegeId,
                                             @ApiParam(value = "任课老师id", required = false) @RequestParam(required = false) String teacherId) {
-        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-        if (Objects.isNull(sysUser)) {
-            throw ExceptionResultEnum.NOT_LOGIN.exception();
-        }
-        return ResultUtil.ok(taExamCourseService.surveyTeacherQuestionView(Objects.isNull(schoolId) ? SystemConstant.convertIdToLong(String.valueOf(ServletUtil.getRequestHeaderSchoolId())) : SystemConstant.convertIdToLong(schoolId), semester, SystemConstant.convertIdToLong(examId), courseCode, Objects.nonNull(collegeId) ? SystemConstant.convertIdToLong(collegeId) : sysUser.getOrgId(), Objects.nonNull(teacherId) ? SystemConstant.convertIdToLong(teacherId) : null));
+        return ResultUtil.ok(taExamCourseService.surveyTeacherQuestionView(Objects.isNull(schoolId) ? SystemConstant.convertIdToLong(String.valueOf(ServletUtil.getRequestHeaderSchoolId())) : SystemConstant.convertIdToLong(schoolId), semester, SystemConstant.convertIdToLong(examId), courseCode, Objects.nonNull(collegeId) ? SystemConstant.convertIdToLong(collegeId) : null, Objects.nonNull(teacherId) ? SystemConstant.convertIdToLong(teacherId) : null));
     }
 
     @ApiOperation(value = "开课课程考试总览-各难度水平题目上的作答分析接口")
@@ -138,11 +134,7 @@ public class CourseController {
                                                   @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
                                                   @ApiParam(value = "考查学院id", required = false) @RequestParam(required = false) String collegeId,
                                                   @ApiParam(value = "任课老师id", required = false) @RequestParam(required = false) String teacherId) {
-        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-        if (Objects.isNull(sysUser)) {
-            throw ExceptionResultEnum.NOT_LOGIN.exception();
-        }
-        return ResultUtil.ok(taExamCourseService.surveyTeacherQuestionAnswerView(Objects.isNull(schoolId) ? SystemConstant.convertIdToLong(String.valueOf(ServletUtil.getRequestHeaderSchoolId())) : SystemConstant.convertIdToLong(schoolId), semester, SystemConstant.convertIdToLong(examId), courseCode, Objects.nonNull(collegeId) ? SystemConstant.convertIdToLong(collegeId) : sysUser.getOrgId(), Objects.nonNull(teacherId) ? SystemConstant.convertIdToLong(teacherId) : null));
+        return ResultUtil.ok(taExamCourseService.surveyTeacherQuestionAnswerView(Objects.isNull(schoolId) ? SystemConstant.convertIdToLong(String.valueOf(ServletUtil.getRequestHeaderSchoolId())) : SystemConstant.convertIdToLong(schoolId), semester, SystemConstant.convertIdToLong(examId), courseCode, Objects.nonNull(collegeId) ? SystemConstant.convertIdToLong(collegeId) : null, Objects.nonNull(teacherId) ? SystemConstant.convertIdToLong(teacherId) : null));
     }
 
     @ApiOperation(value = "开课课程考试总览图表接口")
@@ -229,7 +221,7 @@ public class CourseController {
             @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
             @ApiParam(value = "赋分系数", required = true) @RequestParam BigDecimal coefficient) {
 
-        analyzeForReportService.realityForCalculate(SystemConstant.convertIdToLong(examId),courseCode);
+        analyzeForReportService.realityForCalculate(SystemConstant.convertIdToLong(examId), courseCode);
         Map<String, Object> map = tbTaskService.saveTask(TaskTypeEnum.DATA_CALCULATE);
         map.put("examId", examId);
         map.put("courseCode", courseCode);

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

@@ -43,7 +43,7 @@ public class SysReportController {
     @ApiResponses({@ApiResponse(code = 200, message = "考试信息", response = TBExamResult.class)})
     public Result listSemester(@ApiParam(value = "学校id", required = true) @RequestParam String schoolId) {
         QueryWrapper<TBExam> tbExamQueryWrapper = new QueryWrapper<>();
-        tbExamQueryWrapper.select(" DISTINCT id,semester ").eq("school_id", SystemConstant.convertIdToLong(schoolId));
+        tbExamQueryWrapper.select(" DISTINCT id,semester,exam_time ").eq("school_id", SystemConstant.convertIdToLong(schoolId)).orderByDesc("exam_time");
         List<TBExam> tbExamList = tbExamService.list(tbExamQueryWrapper);
         List<TBExamResult> tbExamResultList = null;
         if (Objects.nonNull(tbExamList) && tbExamList.size() > 0) {