Преглед изворни кода

fix:bug 考察院长-考察学院看板课程查询异常查到了缺考和应届的,后端做临时处理,之后需要前端配合调整传入参数

caozixuan пре 3 година
родитељ
комит
7b462ecba1

+ 3 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/TBExamCourseServiceImpl.java

@@ -138,6 +138,9 @@ public class TBExamCourseServiceImpl extends ServiceImpl<TBExamCourseMapper, TBE
         if (Objects.nonNull(collegeIds) && collegeIds.size() > 0) {
             return tbExamCourseMapper.findCourseList(schoolId, examId, inspect, collegeIds, filter, absent, current, Objects.nonNull(status) ? status.name() : null);
         } else {
+            // TODO: 2022/1/8 临时针对考察学院的考察课程考试分析的更改要之后要前端配合改 
+            absent = false;
+            current = true;
             return tbExamCourseMapper.findCourseList(schoolId, examId, inspect, Objects.nonNull(sysUser.getOrgId()) ? Arrays.asList(sysUser.getOrgId()) : null, filter, absent, current, Objects.nonNull(status) ? status.name() : null);
         }
     }

+ 6 - 0
teachcloud-report-business/src/main/resources/mapper/TBExamCourseMapper.xml

@@ -26,6 +26,12 @@
             <if test="schoolId != null and schoolId != ''">
                 and bc.school_id = #{schoolId}
             </if>
+            <if test="absent != null and absent != ''">
+                and tbs.absent = #{absent}
+            </if>
+            <if test="current != null and current != ''">
+                and tbs.student_current = #{current}
+            </if>
             <if test="collegeIds != null and collegeIds != ''">
                 <choose>
                     <when test="inspect != null and inspect == true">

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

@@ -188,12 +188,12 @@ public class BasicDatasourceController {
 
                         // 考察点去空格
                         String knowledgeDimension = paperStructDto.getKnowledgeDimension();
-                        if (SystemConstant.strNotNull(knowledgeDimension)){
-                            knowledgeDimension = knowledgeDimension.trim().replaceAll(SystemConstant.COMMA_OF_CHINESE,SystemConstant.COMMA_OF_ENGLISH).replaceAll(SystemConstant.PAUSE_SIGN,SystemConstant.COMMA_OF_ENGLISH);
+                        if (SystemConstant.strNotNull(knowledgeDimension)) {
+                            knowledgeDimension = knowledgeDimension.trim().replaceAll(SystemConstant.COMMA_OF_CHINESE, SystemConstant.COMMA_OF_ENGLISH).replaceAll(SystemConstant.PAUSE_SIGN, SystemConstant.COMMA_OF_ENGLISH);
                         }
                         String abilityDimension = paperStructDto.getAbilityDimension();
-                        if (SystemConstant.strNotNull(abilityDimension)){
-                            abilityDimension = abilityDimension.trim().replaceAll(SystemConstant.COMMA_OF_CHINESE,SystemConstant.COMMA_OF_ENGLISH).replaceAll(SystemConstant.PAUSE_SIGN,SystemConstant.COMMA_OF_ENGLISH);
+                        if (SystemConstant.strNotNull(abilityDimension)) {
+                            abilityDimension = abilityDimension.trim().replaceAll(SystemConstant.COMMA_OF_CHINESE, SystemConstant.COMMA_OF_ENGLISH).replaceAll(SystemConstant.PAUSE_SIGN, SystemConstant.COMMA_OF_ENGLISH);
                         }
 
                         // 题号组合与匹配
@@ -562,7 +562,12 @@ public class BasicDatasourceController {
             Long orgId = null;
             if (tbExaminationRelations.size() == 0) {
                 if (!SystemConstant.strNotNull(teacherCode)) {
-                    teacherCode = teacherInfo;
+                    List<TBTeacher> tbTeacherList = tbTeacherService.list(new QueryWrapper<TBTeacher>().lambda().eq(TBTeacher::getSchoolId, schoolId).eq(TBTeacher::getTeacherName, teacherName));
+                    if (tbTeacherList.size() == 1) {
+                        teacherCode = tbTeacherList.get(0).getTeacherCode();
+                    } else {
+                        teacherCode = teacherInfo;
+                    }
                 }
                 orgId = teacherCollegeId;
             } else {
@@ -821,7 +826,7 @@ public class BasicDatasourceController {
         List<BasicExamRecordDto> basicExamRecordDtoDatasource = tbExamRecordService.findByExamIdAndCourseCodeS(examId, courseCodeList);
         Set<TAExamCourseRecord> taExamCourseRecordDatasource = new HashSet<>();
         for (String s : courseCodeList) {
-            if (tbExamCourseService.verifyExamCourseCantRun(examId, schoolId, s, basicCourseService.findByCourseCode(s,schoolId).getName())) {
+            if (tbExamCourseService.verifyExamCourseCantRun(examId, schoolId, s, basicCourseService.findByCourseCode(s, schoolId).getName())) {
                 throw ExceptionResultEnum.ERROR.exception("课程编号[" + s + "]的课程分析数据已测试或发布,不能变更基础数据");
             }
             List<BasicExamRecordDto> basicExamRecordDtoList = basicExamRecordDtoDatasource.stream()
@@ -931,7 +936,7 @@ public class BasicDatasourceController {
     @Transactional(rollbackFor = Exception.class)
     @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
     public Result configImport(@RequestParam Long schoolId, @RequestParam Long examId, @RequestParam String courseCode) {
-        String courseName = basicCourseService.findByCourseCode(courseCode,schoolId).getName();
+        String courseName = basicCourseService.findByCourseCode(courseCode, schoolId).getName();
         if (tbExamCourseService.verifyExamCourseCantRun(examId, schoolId, courseCode, courseName)) {
             throw ExceptionResultEnum.ERROR.exception("课程编号[" + courseCode + "]的课程分析数据已测试或发布,不能变更基础数据");
         }
@@ -1058,7 +1063,7 @@ public class BasicDatasourceController {
     @Transactional(rollbackFor = Exception.class)
     @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
     public Result exceptionStudentBatchDispose(@RequestParam String schoolId, @RequestParam String examId, @RequestParam(required = false) String courseCode) {
-        String courseName = basicCourseService.findByCourseCode(courseCode,SystemConstant.convertIdToLong(schoolId)).getName();
+        String courseName = basicCourseService.findByCourseCode(courseCode, SystemConstant.convertIdToLong(schoolId)).getName();
         if (tbExamCourseService.verifyExamCourseCantRun(SystemConstant.convertIdToLong(examId), SystemConstant.convertIdToLong(schoolId), courseCode, courseName)) {
             throw ExceptionResultEnum.ERROR.exception("课程编号[" + courseCode + "]的课程分析数据已测试或发布,不能变更基础数据");
         }
@@ -1296,7 +1301,7 @@ public class BasicDatasourceController {
     @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
     public Result exceptionStudentDispose(@RequestParam String schoolId, @RequestParam String examId, @RequestParam String courseCode) {
 
-        String courseName = basicCourseService.findByCourseCode(courseCode,SystemConstant.convertIdToLong(schoolId)).getName();
+        String courseName = basicCourseService.findByCourseCode(courseCode, SystemConstant.convertIdToLong(schoolId)).getName();
         if (tbExamCourseService.verifyExamCourseCantRun(SystemConstant.convertIdToLong(examId), SystemConstant.convertIdToLong(schoolId), courseCode, courseName)) {
             throw ExceptionResultEnum.ERROR.exception("课程编号[" + courseCode + "]的课程分析数据已测试或发布,不能变更基础数据");
         }
@@ -1383,7 +1388,7 @@ public class BasicDatasourceController {
         Set<TAExamCourseRecord> taExamCourseRecordDatasource = new HashSet<>();
         for (String s : courseCodeList) {
             taExamCourseRecordDatasource.addAll(taExamCourseRecordService.list(new QueryWrapper<TAExamCourseRecord>()
-                    .lambda().eq(TAExamCourseRecord::getExamId,examId).eq(TAExamCourseRecord::getCourseCode,s)));
+                    .lambda().eq(TAExamCourseRecord::getExamId, examId).eq(TAExamCourseRecord::getCourseCode, s)));
         }
 
 
@@ -1425,10 +1430,10 @@ public class BasicDatasourceController {
                             }
                             TAExamCourseRecord taExamCourseRecord = taExamCourseRecordList.get(0);
                             TBStudent tbStudent = tbStudentService.getById(taExamCourseRecord.getStudentId());
-                            if (!assStudentName.equals(tbStudent.getName())){
+                            if (!assStudentName.equals(tbStudent.getName())) {
                                 result.add(assignCheckDto);
-                            }else {
-                                count ++;
+                            } else {
+                                count++;
                             }
                         }
                     }
@@ -1522,16 +1527,16 @@ public class BasicDatasourceController {
      * @param tbSchoolTeacherDtoList 基础教师数据源
      */
     private void saveTeacherInfo(List<TBSchoolTeacherDto> tbSchoolTeacherDtoList) {
-        Map<String,String> checkMap = new HashMap<>();
+        Map<String, String> checkMap = new HashMap<>();
         for (TBSchoolTeacherDto tbSchoolTeacherDto : tbSchoolTeacherDtoList) {
-            if (checkMap.containsKey(tbSchoolTeacherDto.getTeacherCode())){
+            if (checkMap.containsKey(tbSchoolTeacherDto.getTeacherCode())) {
                 continue;
             }
             SysUser old = sysUserService.getOne(new QueryWrapper<SysUser>().lambda()
                     .eq(SysUser::getSchoolId, tbSchoolTeacherDto.getSchoolId())
                     .eq(SysUser::getLoginName, tbSchoolTeacherDto.getTeacherCode())
                     .eq(SysUser::getRealName, tbSchoolTeacherDto.getTeacherName()));
-            checkMap.put(tbSchoolTeacherDto.getTeacherCode(),tbSchoolTeacherDto.getTeacherName());
+            checkMap.put(tbSchoolTeacherDto.getTeacherCode(), tbSchoolTeacherDto.getTeacherName());
             Long id = 0L;
             if (Objects.nonNull(old)) {
                 id = old.getId();

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

@@ -85,6 +85,7 @@ public class SysReportController {
                              @ApiParam(value = "是否缺考,false:没缺考,true:缺考", required = false) @RequestParam(required = false) Boolean absent,
                              @ApiParam(value = "是否本届,false:非本届,true:本届", required = false) @RequestParam(required = false) Boolean current,
                              @ApiParam(value = "发布状态(UN_COMPUTE:未计算、COMPUTING:计算中、 UN_PUBLISH:未发布、PUBLISH:已发布)", required = false) @RequestParam(required = false) PublishStatusEnum status) {
+
         return ResultUtil.ok(tbExamCourseService.findCourseList(SystemConstant.convertIdToLong(schoolId), SystemConstant.convertIdToLong(examId), inspect, absent, current, status));
     }