Эх сурвалжийг харах

1.bug修改
2.机构中心对接方式更改为以学校编号为准

caozixuan 3 жил өмнө
parent
commit
01218940ca

+ 2 - 1
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/BasicCourseServiceImpl.java

@@ -89,7 +89,8 @@ public class BasicCourseServiceImpl extends ServiceImpl<BasicCourseMapper, Basic
         List<BasicCourse> basicCourseList = this.list(new QueryWrapper<BasicCourse>().lambda()
                 .eq(BasicCourse::getSchoolId,schoolId).eq(BasicCourse::getCode,courseCode));
         if (basicCourseList.size() > 0){
-            throw ExceptionResultEnum.ERROR.exception("已存在学校id为【" + schoolId + "】,课程编号为【" + courseCode + "】的课程");
+            return;
+//            throw ExceptionResultEnum.ERROR.exception("已存在学校id为【" + schoolId + "】,课程编号为【" + courseCode + "】的课程");
         }
         BasicCourse basicCourse = new BasicCourse();
         basicCourse.setId(SystemConstant.getDbUuid());

+ 25 - 31
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/OrgCenterDataDisposeServiceImpl.java

@@ -37,28 +37,12 @@ public class OrgCenterDataDisposeServiceImpl implements OrgCenterDataDisposeServ
         if (Objects.isNull(result) || result.size() == 0) {
             return;
         }
-        // 删除原有学校
+        // 禁用原有学校
         List<BasicSchool> basicSchoolList = basicSchoolService.list();
-        List<Long> oldIdList = basicSchoolList.stream().map(BasicSchool::getId).collect(Collectors.toList());
-        List<Long> newIdList = result.stream().map(e -> SystemConstant.convertIdToLong(String.valueOf(e.get("id")))).collect(Collectors.toList());
-        List<Long> needDisable = new ArrayList<>();
-        List<Long> needDelete = new ArrayList<>();
-        for (Long aLong : oldIdList) {
-            if (!newIdList.contains(aLong)) {
-                needDisable.add(aLong);
-            } else {
-                needDelete.add(aLong);
-            }
-        }
-        if (needDisable.size() > 0) {
-            basicSchoolService.update(new UpdateWrapper<BasicSchool>().lambda().set(BasicSchool::getEnable, false).in(BasicSchool::getId, needDisable));
-        }
-        if (needDelete.size() > 0) {
-            basicSchoolService.remove(new QueryWrapper<BasicSchool>().lambda().in(BasicSchool::getId, needDelete));
-        }
+        basicSchoolService.update(new UpdateWrapper<BasicSchool>().lambda().set(BasicSchool::getEnable, false).gt(BasicSchool::getId,0));
+
 
         for (Map map : result) {
-            Long id = SystemConstant.convertIdToLong(String.valueOf(map.get("id")));
             String code = String.valueOf(map.get("code"));
             String name = String.valueOf(map.get("name"));
             String logo = String.valueOf(map.get("logo"));
@@ -67,20 +51,30 @@ public class OrgCenterDataDisposeServiceImpl implements OrgCenterDataDisposeServ
             Map typeMap = JSONObject.parseObject(String.valueOf(map.get("type")));
             String typeCode = String.valueOf(typeMap.get("code"));
             String typeName = String.valueOf(typeMap.get("name"));
-            if (!Arrays.stream(OrgCenterTypeEnum.values()).map(OrgCenterTypeEnum::getTypeCode).collect(Collectors.toList()).contains(typeCode)) {
-                throw ExceptionResultEnum.ERROR.exception("机构类型在枚举中不存在 + typeCode = " + typeCode);
+
+            List<BasicSchool> oldSchoolList = basicSchoolList.stream().filter(e -> e.getCode().equals(code)).collect(Collectors.toList());
+            if (oldSchoolList.size() > 1){
+                throw ExceptionResultEnum.ERROR.exception("学校信息异常");
             }
-            if (!OrgCenterTypeEnum.PARTNER.getTypeCode().equals(typeCode)) {
-                BasicSchool school = new BasicSchool();
-                school.setId(id);
-                school.setCode(code);
-                school.setName(name);
-                school.setEnable(true);
-                school.setAccessKey(accessKey);
-                school.setAccessSecret(accessSecret);
-                school.setLogo(logo);
-                basicSchoolService.save(school);
+            Long schoolId;
+            if (oldSchoolList.size() > 0){
+                // 系统中原先就有该学校 -》 更新
+                BasicSchool oldSchool = oldSchoolList.get(0);
+                schoolId = oldSchool.getId();
+            }else {
+                // 系统中没有该学校 -》 新增 (系统中如果id被占用会报错)
+                schoolId = SystemConstant.getDbUuid();
             }
+
+            BasicSchool school = new BasicSchool();
+            school.setId(schoolId);
+            school.setCode(code);
+            school.setName(name);
+            school.setEnable(true);
+            school.setAccessKey(accessKey);
+            school.setAccessSecret(accessSecret);
+            school.setLogo(logo);
+            basicSchoolService.saveOrUpdate(school);
         }
     }
 }

+ 5 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/AnalyzeForReportServiceImpl.java

@@ -1979,6 +1979,11 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
         analyzeForReportService.buildAnalyzeExamTotal(examId);
         analyzeForReportService.buildAnalyzeExamCourseCollegeTeacher(examId, courseCode);
         analyzeForReportService.buildAnalyzeExamCourseTeacher(examId, courseCode);
+        analyzeForReportService.buildAnalyzeExamCourseTeacherCollegeDio(examId, courseCode);
+        analyzeForReportService.buildAnalyzeExamCourseTeacherCollegeDifficult(examId, courseCode);
+        analyzeForReportService.buildAnalyzeCollegePaperStruct(examId, courseCode);
+        analyzeForReportService.buildAnalyzeTeacherPaperStruct(examId, courseCode);
+        analyzeForReportService.buildAnalyzeTeacherCollegePaperStruct(examId, courseCode);
     }
 
     @Override

+ 5 - 4
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/ReportCommonServiceImpl.java

@@ -458,10 +458,11 @@ public class ReportCommonServiceImpl implements ReportCommonService {
             List<TBPaperStructResult> errorCellList = cellList.stream().filter(e -> PaperStructJudgeEnum.NOT_QUITE_RIGHT.equals(e.getPaperStructJudge())).collect(Collectors.toList());
             // 获取考察点集合
             for (TBPaperStructResult cell : errorCellList) {
-                String knowledgeDimension = cell.getKnowledgeDimension();
-                String[] arr = knowledgeDimension.split(",");
-                knowledgeDimensionSet.addAll(Arrays.asList(arr));
-
+                if (Objects.nonNull(cell.getKnowledgeDimension())){
+                    String knowledgeDimension = cell.getKnowledgeDimension();
+                    String[] arr = knowledgeDimension.split(",");
+                    knowledgeDimensionSet.addAll(Arrays.asList(arr));
+                }
                 if (Objects.nonNull(cell.getAbilityDimension())) {
                     String abilityDimension = cell.getAbilityDimension();
                     String[] arrAbilityDimension = abilityDimension.split(",");

+ 2 - 2
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/TAExamCourseServiceImpl.java

@@ -125,7 +125,7 @@ public class TAExamCourseServiceImpl extends ServiceImpl<TAExamCourseMapper, TAE
         List<GradeDistributeResult> gradeDistributeResultList = new ArrayList<>();//全体卷面成绩
         List<GradeDistributePaperResult> gradeDistributePaperResultList = new ArrayList<>();//全体赋分成绩
         List<GradeDistributeCurrentAssignedResult> gradeDistributeCurrentAssignedResultList = new ArrayList<>();//应届赋分成绩
-        List<SurveyTeacherGradeDistributionResult> surveyTeacherGradeDistributionResultList = reportCommonService.surveyTeacherDistribution(examId, courseCode, sysUser.getOrgId(), true);
+        List<SurveyTeacherGradeDistributionResult> surveyTeacherGradeDistributionResultList = reportCommonService.surveyTeacherDistribution(examId, courseCode, null, true);
         if (Objects.nonNull(surveyTeacherGradeDistributionResultList) && surveyTeacherGradeDistributionResultList.size() > 0) {
             for (SurveyTeacherGradeDistributionResult s : surveyTeacherGradeDistributionResultList) {
                 String describe = String.join(",", s.getDescribe());
@@ -187,7 +187,7 @@ public class TAExamCourseServiceImpl extends ServiceImpl<TAExamCourseMapper, TAE
         SurveyTeacherExamCourseResult surveyTeacherExamCourseResult = reportCommonService.findAvgScore(schoolId, courseCode, examId, false);
 
         //学院学科报表科目描述
-        List<SurveyTeacherGradeDistributionResult> surveyTeacherGradeDistributionResultList = reportCommonService.surveyTeacherDistribution(examId, courseCode, collegeId, false);
+        List<SurveyTeacherGradeDistributionResult> surveyTeacherGradeDistributionResultList = reportCommonService.surveyTeacherDistribution(examId, courseCode, null, false);
         //查找题目信息
         QuestionListResult questionListResult = reportCommonService.findQuestionInfo(examId, courseCode, collegeId);
         return new SurveyTeacherViewResult(surveyTeacherGradeDistributionResultList, questionListResult, surveyTeacherExamCourseResult, teachCourseSurveyResult);

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

@@ -451,7 +451,7 @@ public class BasicDatasourceController {
         Long examId = tbExam.getId();
         Long schoolId = tbExamService.getById(examId).getSchoolId();
 
-        if (!schoolId.equals(pSchoolId)){
+        if (!schoolId.equals(pSchoolId)) {
             throw ExceptionResultEnum.ERROR.exception("学校id不匹配");
         }
 
@@ -491,34 +491,57 @@ public class BasicDatasourceController {
         // TODO: 2021/6/2 筛选并创建学校教师表
         // 查询考务关系
         List<TBExaminationRelation> tbExaminationRelationList = tbExaminationRelationService.list(new QueryWrapper<TBExaminationRelation>().lambda()
-                .eq(TBExaminationRelation::getExamId,examId));
+                .eq(TBExaminationRelation::getExamId, examId));
 
         List<TBSchoolTeacherDto> tbSchoolTeacherDtoList = new ArrayList<>();
-        List<String> teacherList = finalList.stream()
-                .map(e -> String.valueOf(e.get(ExamCloudDataEnum.TEACHER.getName())))
-                .distinct().collect(Collectors.toList());
-        for (String teacherInfo : teacherList) {
+
+        List<Map<String, String>> teacherList = finalList.stream()
+                .flatMap(e -> {
+                    Map<String, String> map = new HashMap<>();
+                    map.put("subjectName", String.valueOf(e.get(ExamCloudDataEnum.SUBJECT_NAME.getName())));
+                    map.put("teacherInfo", String.valueOf(e.get(ExamCloudDataEnum.TEACHER.getName())));
+                    return Stream.of(map);
+                }).distinct().collect(Collectors.toList());
+
+        for (Map<String, String> teacherPackage : teacherList) {
+
+            String teacherInfo = teacherPackage.get("teacherInfo");
+            String subjectName = teacherPackage.get("subjectName");
+            List<TBExamCourse> tmpList = tbExamCourseList.stream().filter(e -> e.getCourseName().equals(subjectName)).collect(Collectors.toList());
+            if (tmpList.size() != 1) {
+                throw ExceptionResultEnum.ERROR.exception("课程信息异常");
+            }
+            Long teacherCollegeId = tmpList.get(0).getTeachCollegeId();
+
+            // 教师信息统一化处理逻辑
+            Map<String, String> map = this.disposeTeacherInfo(teacherInfo);
+            String teacherName = map.get("teacherName");
+            String teacherCode = map.get("teacherCode");
+
             List<TBExaminationRelation> tbExaminationRelations = tbExaminationRelationList.stream()
-                    .filter(e -> teacherInfo.equals(e.getTeacherName()))
+                    .filter(e -> teacherName.equals(e.getTeacherName()))
                     .distinct().collect(Collectors.toList());
 
-            String teacherCode;
+            // TODO: 2021/7/26 研究下面臃肿且被考务数据限制死的的教师机构获取方式是否可以使用上面的替代 
             Long orgId = null;
-            if (tbExaminationRelations.size() == 0){
-                teacherCode = teacherInfo;
-            }else {
+            if (tbExaminationRelations.size() == 0) {
+                if (!SystemConstant.strNotNull(teacherCode)) {
+                    teacherCode = teacherInfo;
+                }
+                orgId = teacherCollegeId;
+            } else {
                 List<String> teacherCodeList = tbExaminationRelations.stream().map(TBExaminationRelation::getTeacherCode).distinct().collect(Collectors.toList());
-                if (teacherCodeList.size() != 1){
+                if (teacherCodeList.size() != 1) {
                     throw ExceptionResultEnum.ERROR.exception("考务数据-教师对应的教师编号有误");
                 }
                 List<String> teachCollegeNameList = tbExaminationRelations.stream().map(TBExaminationRelation::getTeachCollegeName).distinct().collect(Collectors.toList());
-                if (teachCollegeNameList.size() != 1){
+                if (teachCollegeNameList.size() != 1) {
                     throw ExceptionResultEnum.ERROR.exception("考务数据-教师对应的开课学院有误");
                 }
                 teacherCode = teacherCodeList.get(0);
                 String teachCollegeName = teachCollegeNameList.get(0);
-                List<SysOrg> sysOrgList = sysOrgService.list(new QueryWrapper<SysOrg>().lambda().eq(SysOrg::getName,teachCollegeName).eq(SysOrg::getSchoolId,schoolId));
-                if (sysOrgList.size() != 1){
+                List<SysOrg> sysOrgList = sysOrgService.list(new QueryWrapper<SysOrg>().lambda().eq(SysOrg::getName, teachCollegeName).eq(SysOrg::getSchoolId, schoolId));
+                if (sysOrgList.size() != 1) {
                     throw ExceptionResultEnum.ERROR.exception("未能找到考务数据中学院名称的学院");
                 }
                 orgId = sysOrgList.get(0).getId();
@@ -527,7 +550,7 @@ public class BasicDatasourceController {
             TBSchoolTeacherDto tbSchoolTeacherDto = new TBSchoolTeacherDto();
             tbSchoolTeacherDto.setSchoolId(schoolId);
             tbSchoolTeacherDto.setTeacherCode(teacherCode);
-            tbSchoolTeacherDto.setTeacherName(teacherInfo);
+            tbSchoolTeacherDto.setTeacherName(teacherName);
             tbSchoolTeacherDto.setOrgId(orgId);
             tbSchoolTeacherDtoList.add(tbSchoolTeacherDto);
         }
@@ -545,6 +568,7 @@ public class BasicDatasourceController {
         int count = paperTypeList.size();
         int i = 0;
 
+        Map<String, TBStudent> checkMap = new HashMap<>();
         for (Map map : finalList) {
             String subjectCode = (String) map.get(ExamCloudDataEnum.SUBJECT_CODE.getName()); //科目代码
             String subjectName = (String) map.get(ExamCloudDataEnum.SUBJECT_NAME.getName()); //科目名称
@@ -563,6 +587,9 @@ public class BasicDatasourceController {
             String college = (String) map.get(ExamCloudDataEnum.COLLEGE.getName()); //学院
             String className = (String) map.get(ExamCloudDataEnum.CLASS_NAME.getName()); //班级名称
             String teacher = (String) map.get(ExamCloudDataEnum.TEACHER.getName()); //教师
+            Map<String, String> teacherMap = this.disposeTeacherInfo(teacher);
+            String teacherName = teacherMap.get("teacherName");
+            String teacherCode = teacherMap.get("teacherCode");
             // 缺考状态 2 -> 缺考 ; 3 -> 违纪
             int status = (int) map.get(ExamCloudDataEnum.STATUS.getName()); //学生考试状态
             String totalScore = (String) map.get(ExamCloudDataEnum.TOTAL_SCORE.getName()); //考生总分
@@ -571,26 +598,32 @@ public class BasicDatasourceController {
             List<Map<Object, Object>> objectiveScoreDetailList = (List<Map<Object, Object>>) map.get(ExamCloudDataEnum.OBJECTIVE_SCORE_DETAIL.getName()); //客观题明细
             List<Map<Object, Object>> subjectiveScoreDetailList = (List<Map<Object, Object>>) map.get(ExamCloudDataEnum.SUBJECTIVE_SCORE_DETAIL.getName()); //主观题答题明细
 
-
-
             /*
                 组建学生基础信息 student
              */
-            TBStudent studentTemp = tbStudentService.getOne(new QueryWrapper<TBStudent>().lambda()
-                    .eq(TBStudent::getSchoolId, schoolId)
-                    .eq(TBStudent::getStudentCode, studentCode));
-            Long studentId;
-            if (Objects.nonNull(studentTemp)) {
-                studentId = studentTemp.getId();
+            if (checkMap.containsKey(studentCode)) {
+                if (!checkMap.get(studentCode).getName().equals(name)) {
+                    throw ExceptionResultEnum.ERROR.exception("有学号【" + studentCode + "】的学生名称不同意");
+                }
             } else {
-                studentId = SystemConstant.getDbUuid();
+                TBStudent studentTemp = tbStudentService.getOne(new QueryWrapper<TBStudent>().lambda()
+                        .eq(TBStudent::getSchoolId, schoolId)
+                        .eq(TBStudent::getStudentCode, studentCode));
+                Long studentId;
+                if (Objects.nonNull(studentTemp)) {
+                    studentId = studentTemp.getId();
+                } else {
+                    studentId = SystemConstant.getDbUuid();
+                }
+                TBStudent tbStudent = new TBStudent();
+                tbStudent.setId(studentId);
+                tbStudent.setSchoolId(schoolId);
+                tbStudent.setName(name);
+                tbStudent.setStudentCode(studentCode);
+                checkMap.put(studentCode, tbStudent);
+                tbStudentList.add(tbStudent);
             }
-            TBStudent tbStudent = new TBStudent();
-            tbStudent.setId(studentId);
-            tbStudent.setSchoolId(schoolId);
-            tbStudent.setName(name);
-            tbStudent.setStudentCode(studentCode);
-            tbStudentList.add(tbStudent);
+
 
             /*
                 组建考生考试信息 exm_pap_tik
@@ -617,7 +650,7 @@ public class BasicDatasourceController {
                 // 获取关联的基础表主键
                 SysOrg tbSchoolCollege = sysOrgService.findByForeignKey(schoolId, college, college);
                 TBSchoolClazz tbSchoolClazz = tbSchoolClazzService.findByForeignKey(schoolId, className, className);
-                SysUser tbSchoolTeacher = sysUserService.findByForeignKey(schoolId, teacher);
+                SysUser tbSchoolTeacher = sysUserService.findByForeignKey(schoolId, teacherName);
 
                 TBExamStudent tbExamStudent = new TBExamStudent();
                 Long examStudentId = SystemConstant.getDbUuid();
@@ -625,7 +658,7 @@ public class BasicDatasourceController {
                 tbExamStudent.setSchoolId(tbExamService.getById(examId).getSchoolId());
                 tbExamStudent.setExamId(examId);
                 tbExamStudent.setName(name);
-                tbExamStudent.setStudentId(studentId);
+                tbExamStudent.setStudentId(checkMap.get(studentCode).getId());
                 tbExamStudent.setStudentCode(studentCode);
                 tbExamStudent.setCourseCode(courseCode);
                 tbExamStudent.setCourseName(courseName);
@@ -633,9 +666,9 @@ public class BasicDatasourceController {
                 tbExamStudent.setInspectCollegeId(tbSchoolCollege.getId());
                 tbExamStudent.setClazzId(tbSchoolClazz.getId());
                 tbExamStudent.setMajorId(0L);
-                if (Objects.nonNull(tbSchoolTeacher)){
+                if (Objects.nonNull(tbSchoolTeacher)) {
                     tbExamStudent.setTeacherId(tbSchoolTeacher.getId());
-                }else {
+                } else {
                     tbExamStudent.setTeacherId(0L);
                 }
                 tbExamStudent.setTicketNumber(examNumber);
@@ -761,7 +794,7 @@ public class BasicDatasourceController {
                 // 迁移数据至't_a_exam_course_record'
                 List<TAExamCourseRecord> taExamCourseRecordList = new ArrayList<>();
                 for (BasicExamRecordDto basicExamRecordDto : basicExamRecordDtoList) {
-                    if (basicExamRecordDto.getStudentCode().equals("2020303041027")){
+                    if (basicExamRecordDto.getStudentCode().equals("2020303041027")) {
                         System.out.println("进入");
                     }
                     // 正常公式赋分操作
@@ -775,7 +808,7 @@ public class BasicDatasourceController {
                     BigDecimal coefficient = tbPaper.getCoefficient();
                     BigDecimal assignScore;
                     if (coefficient != null && coefficient.compareTo(BigDecimal.ZERO) > 0 && !basicExamRecordDto.getAbsent()) {
-                        assignScore = myScore.add(fullScore.subtract(myScore).divide(coefficient, 4, BigDecimal.ROUND_HALF_UP)).setScale(0,BigDecimal.ROUND_HALF_UP);
+                        assignScore = myScore.add(fullScore.subtract(myScore).divide(coefficient, 4, BigDecimal.ROUND_HALF_UP)).setScale(0, BigDecimal.ROUND_HALF_UP);
                     } else {
                         assignScore = myScore;
                     }
@@ -835,7 +868,7 @@ public class BasicDatasourceController {
                                     .filter(e -> assExamId.equals(e.getExamId()) && s.equals(e.getCourseCode()) && assStudentCode.equals(e.getStudentCode()))
                                     .collect(Collectors.toList());
                             if (taExamCourseRecordList.size() != 1) {
-                                if (taExamCourseRecordList.size() < 1){
+                                if (taExamCourseRecordList.size() < 1) {
                                     continue;
                                 }
                                 System.out.println("-----------------------");
@@ -872,12 +905,12 @@ public class BasicDatasourceController {
     @RequestMapping(value = "/course/create", method = RequestMethod.POST)
     @Transactional(rollbackFor = Exception.class)
     @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
-    public Result courseCreate(@RequestParam Long schoolId, @RequestParam String examId, @RequestParam String courseCode,@RequestParam String courseName,@RequestParam(required = false) String examinationCourseCode,@RequestParam(required = false) String teachCollegeName) {
-        if ((!SystemConstant.strNotNull(examinationCourseCode) && !SystemConstant.strNotNull(teachCollegeName)) || (SystemConstant.strNotNull(examinationCourseCode) && SystemConstant.strNotNull(teachCollegeName))){
+    public Result courseCreate(@RequestParam Long schoolId, @RequestParam String examId, @RequestParam String courseCode, @RequestParam String courseName, @RequestParam(required = false) String examinationCourseCode, @RequestParam(required = false) String teachCollegeName) {
+        if ((!SystemConstant.strNotNull(examinationCourseCode) && !SystemConstant.strNotNull(teachCollegeName)) || (SystemConstant.strNotNull(examinationCourseCode) && SystemConstant.strNotNull(teachCollegeName))) {
             throw ExceptionResultEnum.ERROR.exception("参数异常 : 考务课程编号和课程授课学院不能全不传或全传");
         }
-        basicCourseService.createCourse(schoolId,courseCode,courseName);
-        tbExamCourseService.createCourse(schoolId,SystemConstant.convertIdToLong(examId),courseCode,courseName,examinationCourseCode,teachCollegeName);
+        basicCourseService.createCourse(schoolId, courseCode, courseName);
+        tbExamCourseService.createCourse(schoolId, SystemConstant.convertIdToLong(examId), courseCode, courseName, examinationCourseCode, teachCollegeName);
 
         return ResultUtil.ok(Collections.singletonMap(SystemConstant.SUCCESS, true));
     }
@@ -886,7 +919,7 @@ public class BasicDatasourceController {
     @RequestMapping(value = "/examination/sync", method = RequestMethod.POST)
     @Transactional(rollbackFor = Exception.class)
     @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
-    public Result examinationSync(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file,@RequestParam Long schoolId, @RequestParam String examId) throws IOException, NoSuchFieldException {
+    public Result examinationSync(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file, @RequestParam Long schoolId, @RequestParam String examId) throws IOException, NoSuchFieldException {
         if (Objects.isNull(file)) {
             throw ExceptionResultEnum.ERROR.exception("附件不存在");
         }
@@ -933,7 +966,7 @@ public class BasicDatasourceController {
                         tbExamination.setTeacherCode(teacherCode);
                         tbExamination.setTeacherName(teacherName);
                         tbExamination.setTeachCollegeName(teachCollegeName);
-                        if (SystemConstant.strNotNull(credit)){
+                        if (SystemConstant.strNotNull(credit)) {
                             tbExamination.setCredit(credit);
                         }
                         tbExamination.setStudentCode(studentCode);
@@ -947,15 +980,15 @@ public class BasicDatasourceController {
                 }
             }
         }
-        List<Map<String,Object>> tbExaminationRelationMapList = tbExaminationList.stream().flatMap(e -> {
+        List<Map<String, Object>> tbExaminationRelationMapList = tbExaminationList.stream().flatMap(e -> {
             Map<String, Object> map = new HashMap<>();
-            map.put("schoolId",e.getSchoolId());
-            map.put("examId",e.getExamId());
-            map.put("examinationCourseCode",e.getExaminationCourseCode());
-            map.put("courseName",e.getCourseName());
-            map.put("teachCollegeName",e.getTeachCollegeName());
-            map.put("teacherCode",e.getTeacherCode());
-            map.put("teacherName",e.getTeacherName());
+            map.put("schoolId", e.getSchoolId());
+            map.put("examId", e.getExamId());
+            map.put("examinationCourseCode", e.getExaminationCourseCode());
+            map.put("courseName", e.getCourseName());
+            map.put("teachCollegeName", e.getTeachCollegeName());
+            map.put("teacherCode", e.getTeacherCode());
+            map.put("teacherName", e.getTeacherName());
             return Stream.of(map);
         }).distinct().collect(Collectors.toList());
 
@@ -973,8 +1006,8 @@ public class BasicDatasourceController {
             tbExaminationRelationList.add(tbExaminationRelation);
         }
 
-        tbExaminationService.remove(new QueryWrapper<TBExamination>().lambda().eq(TBExamination::getExamId,examId));
-        tbExaminationRelationService.remove(new QueryWrapper<TBExaminationRelation>().lambda().eq(TBExaminationRelation::getExamId,examId));
+        tbExaminationService.remove(new QueryWrapper<TBExamination>().lambda().eq(TBExamination::getExamId, examId));
+        tbExaminationRelationService.remove(new QueryWrapper<TBExaminationRelation>().lambda().eq(TBExaminationRelation::getExamId, examId));
 
         tbExaminationService.saveBatch(tbExaminationList);
         tbExaminationRelationService.saveBatch(tbExaminationRelationList);
@@ -991,15 +1024,15 @@ public class BasicDatasourceController {
             throw ExceptionResultEnum.ERROR.exception("课程编号[" + courseCode + "]的课程分析数据已测试或发布,不能变更基础数据");
         }
         List<TBExamination> tbExaminationList = tbExaminationService.list(new QueryWrapper<TBExamination>().lambda()
-                .eq(TBExamination::getExamId,SystemConstant.convertIdToLong(examId))
-                .eq(TBExamination::getSchoolId,SystemConstant.convertIdToLong(schoolId))
-                .eq(TBExamination::getExaminationCourseCode,tbExamCourseService.getOne(new QueryWrapper<TBExamCourse>().lambda()
-                        .eq(TBExamCourse::getExamId,examId)
-                        .eq(TBExamCourse::getCourseCode,courseCode)
-                        .eq(TBExamCourse::getSchoolId,schoolId))
+                .eq(TBExamination::getExamId, SystemConstant.convertIdToLong(examId))
+                .eq(TBExamination::getSchoolId, SystemConstant.convertIdToLong(schoolId))
+                .eq(TBExamination::getExaminationCourseCode, tbExamCourseService.getOne(new QueryWrapper<TBExamCourse>().lambda()
+                        .eq(TBExamCourse::getExamId, examId)
+                        .eq(TBExamCourse::getCourseCode, courseCode)
+                        .eq(TBExamCourse::getSchoolId, schoolId))
                         .getExaminationCourseCode())
-                .eq(TBExamination::getCourseName,courseName)
-                .ne(TBExamination::getStudyType,"普通"));
+                .eq(TBExamination::getCourseName, courseName)
+                .ne(TBExamination::getStudyType, "普通"));
         int count = tbExaminationList.size();
         if (count > 0) {
             List<TBExamStudent> tbExamStudentList = tbExamStudentService.list(new QueryWrapper<TBExamStudent>().lambda()
@@ -1030,18 +1063,18 @@ public class BasicDatasourceController {
     public Result exceptionStudentDisposeByStudentCode(@RequestParam String schoolId, @RequestParam String examId, @RequestParam List<String> courseCodeList, @RequestParam String year) {
         for (String courseCode : courseCodeList) {
             TBExamCourse tbExamCourse = tbExamCourseService.getOne(new QueryWrapper<TBExamCourse>().lambda()
-                    .eq(TBExamCourse::getExamId,examId)
-                    .eq(TBExamCourse::getSchoolId,schoolId)
-                    .eq(TBExamCourse::getCourseCode,courseCode));
-            if (tbExamCourse.getPublishStatus().equals(PublishStatusEnum.PUBLISH)){
+                    .eq(TBExamCourse::getExamId, examId)
+                    .eq(TBExamCourse::getSchoolId, schoolId)
+                    .eq(TBExamCourse::getCourseCode, courseCode));
+            if (tbExamCourse.getPublishStatus().equals(PublishStatusEnum.PUBLISH)) {
                 throw ExceptionResultEnum.ERROR.exception("已经发布的课程【" + tbExamCourse.getCourseName() + "】不能进行特殊处理");
             }
         }
         // 更改 ‘t_b_exam_student’表考生应届状态
         List<TBExamStudent> tbExamStudentList = tbExamStudentService.list(new QueryWrapper<TBExamStudent>().lambda()
-                .eq(TBExamStudent::getSchoolId,schoolId)
-                .eq(TBExamStudent::getExamId,examId)
-                .in(TBExamStudent::getCourseCode,courseCodeList));
+                .eq(TBExamStudent::getSchoolId, schoolId)
+                .eq(TBExamStudent::getExamId, examId)
+                .in(TBExamStudent::getCourseCode, courseCodeList));
         // 全部改为应届
         for (TBExamStudent tbExamStudent : tbExamStudentList) {
             tbExamStudent.setStudentCurrent(true);
@@ -1049,14 +1082,14 @@ public class BasicDatasourceController {
         tbExamStudentService.updateBatchById(tbExamStudentList);
         // 非应届考生
         tbExamStudentList = tbExamStudentList.stream()
-                .filter(e -> !e.getStudentCode().substring(0,4).equals(year))
+                .filter(e -> !e.getStudentCode().substring(0, 4).equals(year))
                 .collect(Collectors.toList());
 
         // 更改 ‘t_a_exam_course_record’表考生应届状态
         List<TAExamCourseRecord> taExamCourseRecordList = taExamCourseRecordService.list(new QueryWrapper<TAExamCourseRecord>().lambda()
-                .eq(TAExamCourseRecord::getSchoolId,schoolId)
-                .eq(TAExamCourseRecord::getExamId,examId)
-                .in(TAExamCourseRecord::getCourseCode,courseCodeList));
+                .eq(TAExamCourseRecord::getSchoolId, schoolId)
+                .eq(TAExamCourseRecord::getExamId, examId)
+                .in(TAExamCourseRecord::getCourseCode, courseCodeList));
         // 全部改为应届
         for (TAExamCourseRecord taExamCourseRecord : taExamCourseRecordList) {
             taExamCourseRecord.setStudentCurrent(true);
@@ -1064,17 +1097,17 @@ public class BasicDatasourceController {
         taExamCourseRecordService.updateBatchById(taExamCourseRecordList);
 
         // 非应届考生记录
-        taExamCourseRecordList =taExamCourseRecordList.stream()
-                .filter(e -> !e.getStudentCode().substring(0,4).equals(year))
+        taExamCourseRecordList = taExamCourseRecordList.stream()
+                .filter(e -> !e.getStudentCode().substring(0, 4).equals(year))
                 .collect(Collectors.toList());
 
-        if (tbExamStudentList.size() > 0){
+        if (tbExamStudentList.size() > 0) {
             for (TBExamStudent tbExamStudent : tbExamStudentList) {
                 tbExamStudent.setStudentCurrent(false);
             }
             tbExamStudentService.updateBatchById(tbExamStudentList);
 
-            if (tbExamStudentList.size() == taExamCourseRecordList.size()){
+            if (tbExamStudentList.size() == taExamCourseRecordList.size()) {
                 for (TAExamCourseRecord taExamCourseRecord : taExamCourseRecordList) {
                     taExamCourseRecord.setStudentCurrent(false);
                 }
@@ -1099,18 +1132,18 @@ public class BasicDatasourceController {
         String comMain = combineDto.getComMain();
         String comSub = combineDto.getComSub();
         // TODO: 2021/6/25 合题的检验
-        TBPaper tbPaper = tbPaperService.getOne(new QueryWrapper<TBPaper>().lambda().eq(TBPaper::getExamId,examId).eq(TBPaper::getCourseCode,courseCode));
+        TBPaper tbPaper = tbPaperService.getOne(new QueryWrapper<TBPaper>().lambda().eq(TBPaper::getExamId, examId).eq(TBPaper::getCourseCode, courseCode));
         Long paperId = tbPaper.getId();
-        List<TBExamRecord> tbExamRecordList = tbExamRecordService.list(new QueryWrapper<TBExamRecord>().lambda().eq(TBExamRecord::getExamId,examId).eq(TBExamRecord::getPaperId,paperId));
+        List<TBExamRecord> tbExamRecordList = tbExamRecordService.list(new QueryWrapper<TBExamRecord>().lambda().eq(TBExamRecord::getExamId, examId).eq(TBExamRecord::getPaperId, paperId));
         List<Long> examRecordIdList = tbExamRecordList.stream().map(TBExamRecord::getId).distinct().collect(Collectors.toList());
 
-        List<TBAnswer> tbAnswerList = tbAnswerService.list(new QueryWrapper<TBAnswer>().lambda().in(TBAnswer::getExamRecordId,examRecordIdList));
+        List<TBAnswer> tbAnswerList = tbAnswerService.list(new QueryWrapper<TBAnswer>().lambda().in(TBAnswer::getExamRecordId, examRecordIdList));
 
         List<Long> willDeleteList = new ArrayList<>();
         List<TBAnswer> willInsertList = new ArrayList<>();
         for (Long examRecordId : examRecordIdList) {
             List<TBAnswer> oneStudentAnswerList = tbAnswerList.stream().filter(e -> e.getExamRecordId().equals(examRecordId)).collect(Collectors.toList());
-            if (oneStudentAnswerList.size() == 0){
+            if (oneStudentAnswerList.size() == 0) {
                 continue;
             }
             // 原始1题
@@ -1127,7 +1160,7 @@ public class BasicDatasourceController {
 
             Long org2Id = org2.getId();
             BigDecimal org2Score = org2.getScore();
-            if (!org1.getNumberType().equals(org2.getNumberType())){
+            if (!org1.getNumberType().equals(org2.getNumberType())) {
                 throw ExceptionResultEnum.ERROR.exception("题目类型不一致 合题失败");
             }
 
@@ -1154,20 +1187,20 @@ public class BasicDatasourceController {
     @RequestMapping(value = "/exception_answer/score_dispose", method = RequestMethod.POST)
     @Transactional(rollbackFor = Exception.class)
     @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
-    public Result exceptionAnswerScoreDispose(@RequestParam Long schoolId, @RequestParam String examId, @RequestParam String courseCode,@RequestParam String numberType,@RequestParam String mainNumber,@RequestParam String subNumber,@RequestParam String answer,@RequestParam BigDecimal score) {
+    public Result exceptionAnswerScoreDispose(@RequestParam Long schoolId, @RequestParam String examId, @RequestParam String courseCode, @RequestParam String numberType, @RequestParam String mainNumber, @RequestParam String subNumber, @RequestParam String answer, @RequestParam BigDecimal score) {
 
-        TBPaper tbPaper = tbPaperService.getOne(new QueryWrapper<TBPaper>().lambda().eq(TBPaper::getCourseCode,courseCode).eq(TBPaper::getExamId,examId));
+        TBPaper tbPaper = tbPaperService.getOne(new QueryWrapper<TBPaper>().lambda().eq(TBPaper::getCourseCode, courseCode).eq(TBPaper::getExamId, examId));
         Long paperId = tbPaper.getId();
-        List<TBExamRecord> tbExamRecordList = tbExamRecordService.list(new QueryWrapper<TBExamRecord>().lambda().eq(TBExamRecord::getExamId,examId).eq(TBExamRecord::getPaperId,paperId));
+        List<TBExamRecord> tbExamRecordList = tbExamRecordService.list(new QueryWrapper<TBExamRecord>().lambda().eq(TBExamRecord::getExamId, examId).eq(TBExamRecord::getPaperId, paperId));
         List<Long> examRecordIdList = tbExamRecordList.stream().map(TBExamRecord::getId).distinct().collect(Collectors.toList());
 
         // 要改分的作答记录
         List<TBAnswer> tbAnswerList = tbAnswerService.list(new QueryWrapper<TBAnswer>().lambda()
-                .in(TBAnswer::getExamRecordId,examRecordIdList)
-                .eq(TBAnswer::getNumberType,numberType)
-                .eq(TBAnswer::getMainNumber,mainNumber)
-                .eq(TBAnswer::getSubNumber,subNumber)
-                .eq(TBAnswer::getAnswer,answer));
+                .in(TBAnswer::getExamRecordId, examRecordIdList)
+                .eq(TBAnswer::getNumberType, numberType)
+                .eq(TBAnswer::getMainNumber, mainNumber)
+                .eq(TBAnswer::getSubNumber, subNumber)
+                .eq(TBAnswer::getAnswer, answer));
 
         List<TBExamRecord> willUpdateRecordList = new ArrayList<>();
         for (TBAnswer tbAnswer : tbAnswerList) {
@@ -1179,15 +1212,15 @@ public class BasicDatasourceController {
             // 对该考生 总体考试成绩的得分修改
             TBExamRecord tbExamRecord = tbExamRecordList.stream().filter(e -> e.getId().equals(tbAnswer.getExamRecordId())).collect(Collectors.toList()).get(0);
             BigDecimal totalScore = tbExamRecord.getTotalScore();
-            if (numberType.equals("客观题")){
+            if (numberType.equals("客观题")) {
                 BigDecimal objectiveScore = tbExamRecord.getObjectiveScore();
                 objectiveScore = objectiveScore.add(scoreGap);
                 tbExamRecord.setObjectiveScore(objectiveScore);
-            }else if (numberType.equals("主观题")){
+            } else if (numberType.equals("主观题")) {
                 BigDecimal subjectiveScore = tbExamRecord.getSubjectiveScore();
                 subjectiveScore = subjectiveScore.add(scoreGap);
                 tbExamRecord.setSubjectiveScore(subjectiveScore);
-            }else {
+            } else {
                 throw ExceptionResultEnum.ERROR.exception("题目类型有误");
             }
             totalScore = totalScore.add(scoreGap);
@@ -1199,16 +1232,16 @@ public class BasicDatasourceController {
         tbExamRecordService.updateBatchById(willUpdateRecordList);
 
         // 成绩核对
-        List<TBExamRecord> verifyExamRecordList = tbExamRecordService.list(new QueryWrapper<TBExamRecord>().lambda().eq(TBExamRecord::getExamId,examId).eq(TBExamRecord::getPaperId,paperId));
+        List<TBExamRecord> verifyExamRecordList = tbExamRecordService.list(new QueryWrapper<TBExamRecord>().lambda().eq(TBExamRecord::getExamId, examId).eq(TBExamRecord::getPaperId, paperId));
         for (TBExamRecord verifyRecord : verifyExamRecordList) {
             BigDecimal totalScore = verifyRecord.getTotalScore();
             Long examRecordId = verifyRecord.getId();
-            List<TBAnswer> oneStudentAnswer = tbAnswerService.list(new QueryWrapper<TBAnswer>().lambda().eq(TBAnswer::getExamRecordId,examRecordId));
-            if (oneStudentAnswer.size() == 0 && totalScore.compareTo(BigDecimal.ZERO) != 0){
+            List<TBAnswer> oneStudentAnswer = tbAnswerService.list(new QueryWrapper<TBAnswer>().lambda().eq(TBAnswer::getExamRecordId, examRecordId));
+            if (oneStudentAnswer.size() == 0 && totalScore.compareTo(BigDecimal.ZERO) != 0) {
                 throw ExceptionResultEnum.ERROR.exception("计算数据异常");
             } else {
                 double scoreSum = oneStudentAnswer.stream().collect(Collectors.summarizingDouble(e -> e.getScore().doubleValue())).getSum();
-                if (totalScore.compareTo(BigDecimal.valueOf(scoreSum)) != 0){
+                if (totalScore.compareTo(BigDecimal.valueOf(scoreSum)) != 0) {
                     System.out.println("考试总分 : " + totalScore + ",作答总分 : " + scoreSum);
                     throw ExceptionResultEnum.ERROR.exception("考试总分和作答总分不一致");
                 }
@@ -1230,11 +1263,11 @@ public class BasicDatasourceController {
         }
         // 查找留学生
         List<TAExamCourseRecord> taExamCourseRecordList = taExamCourseRecordService.list(new QueryWrapper<TAExamCourseRecord>().lambda()
-                .eq(TAExamCourseRecord::getCourseCode,courseCode)
-                .eq(TAExamCourseRecord::getExamId,examId)
-                .eq(TAExamCourseRecord::getTotalScore,0)
-                .gt(TAExamCourseRecord::getAssignedScore,0));
-        if (taExamCourseRecordList.size() > 0){
+                .eq(TAExamCourseRecord::getCourseCode, courseCode)
+                .eq(TAExamCourseRecord::getExamId, examId)
+                .eq(TAExamCourseRecord::getTotalScore, 0)
+                .gt(TAExamCourseRecord::getAssignedScore, 0));
+        if (taExamCourseRecordList.size() > 0) {
             List<Long> willDeleteTAExamCourseRecordIds = taExamCourseRecordList.stream().map(TAExamCourseRecord::getId).distinct().collect(Collectors.toList());
             List<String> willDeleteStudentCodeList = taExamCourseRecordList.stream().map(TAExamCourseRecord::getStudentCode).distinct().collect(Collectors.toList());
             List<Long> willDeleteExamRecordIdList = taExamCourseRecordList.stream().map(TAExamCourseRecord::getExamRecordId).distinct().collect(Collectors.toList());
@@ -1243,16 +1276,16 @@ public class BasicDatasourceController {
             taExamCourseRecordService.removeByIds(willDeleteTAExamCourseRecordIds);
 
             // 删除‘t_b_exam_student’
-            if (willDeleteStudentCodeList.size() > 0){
-                tbExamStudentService.remove(new QueryWrapper<TBExamStudent>().lambda().eq(TBExamStudent::getExamId,examId).eq(TBExamStudent::getCourseCode,courseCode).in(TBExamStudent::getStudentCode,willDeleteStudentCodeList).gt(TBExamStudent::getId,0));
+            if (willDeleteStudentCodeList.size() > 0) {
+                tbExamStudentService.remove(new QueryWrapper<TBExamStudent>().lambda().eq(TBExamStudent::getExamId, examId).eq(TBExamStudent::getCourseCode, courseCode).in(TBExamStudent::getStudentCode, willDeleteStudentCodeList).gt(TBExamStudent::getId, 0));
             }
 
-            if (willDeleteExamRecordIdList.size() > 0){
+            if (willDeleteExamRecordIdList.size() > 0) {
                 // 删除't_b_exam_record'
                 tbExamRecordService.removeByIds(willDeleteExamRecordIdList);
 
                 // 删除‘t_b_answer’
-                tbAnswerService.remove(new QueryWrapper<TBAnswer>().lambda().in(TBAnswer::getExamRecordId,willDeleteExamRecordIdList).gt(TBAnswer::getId,0));
+                tbAnswerService.remove(new QueryWrapper<TBAnswer>().lambda().in(TBAnswer::getExamRecordId, willDeleteExamRecordIdList).gt(TBAnswer::getId, 0));
             }
 
         }
@@ -1261,7 +1294,6 @@ public class BasicDatasourceController {
     }
 
 
-
     /**
      * 更新或新增专业信息
      *
@@ -1333,7 +1365,7 @@ public class BasicDatasourceController {
      */
     private void saveCollegeInfo(List<TBSchoolCollegeDto> tbSchoolCollegeDtoList) {
         for (TBSchoolCollegeDto tbSchoolCollegeDto : tbSchoolCollegeDtoList) {
-            sysOrgService.searchOrInsert(tbSchoolCollegeDto.getSchoolId(),tbSchoolCollegeDto.getCollegeName());
+            sysOrgService.searchOrInsert(tbSchoolCollegeDto.getSchoolId(), tbSchoolCollegeDto.getCollegeName());
         }
     }
 
@@ -1372,4 +1404,52 @@ public class BasicDatasourceController {
             sysUserService.saveUserNoAuth(userSaveParams);
         }
     }
+
+    /**
+     * 由于不同大学的教师数据在云阅卷中出现了不同的储存样式,为了解决这种问题进行统一处理
+     * 1.武汉大学:教师名称A
+     * 2.山东师范大学:教师编号A/教师名称A;教师编号B/教师名称B......
+     * 将教师信息统一处理成如下格式:
+     * teacherCode(教师编号):教师编号A;教师编号B......
+     * teacherName(教师名称):教师名称A:教师名称B......
+     *
+     * @param teacherInfo 教师信息
+     * @return 键值对
+     */
+    private Map<String, String> disposeTeacherInfo(String teacherInfo) {
+        String teacherName = "";
+        String teacherCode = "";
+        teacherInfo = teacherInfo.trim().replaceAll(";", ";").replaceAll("\\\\", "/");
+        String[] teacherInfoArr = teacherInfo.split(";");
+        for (String teacher : teacherInfoArr) {
+            String cellName = "";
+            String cellCode = "";
+            String[] cellArr = teacher.split("/");
+            if (cellArr.length == 1) {
+                cellName = cellArr[0];
+            } else if (cellArr.length == 2) {
+                cellCode = cellArr[0];
+                cellName = cellArr[1];
+            } else {
+                System.out.println("error");
+            }
+            if (SystemConstant.strNotNull(cellName)) {
+                teacherName = teacherName + cellName + ";";
+            }
+            if (SystemConstant.strNotNull(cellCode)) {
+                teacherCode = teacherCode + cellCode + ";";
+            }
+        }
+        if (SystemConstant.strNotNull(teacherName)) {
+            teacherName = teacherName.substring(0, teacherName.length() - 1);
+        }
+        if (SystemConstant.strNotNull(teacherCode)) {
+            teacherCode = teacherCode.substring(0, teacherCode.length() - 1);
+        }
+
+        Map<String, String> map = new HashMap<>();
+        map.put("teacherName", teacherName);
+        map.put("teacherCode", teacherCode);
+        return map;
+    }
 }

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

@@ -96,6 +96,9 @@ 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) {
+        if (Objects.isNull(status)){
+            status = PublishStatusEnum.PUBLISH;
+        }
         return ResultUtil.ok(tbExamCourseService.findCourseList(SystemConstant.convertIdToLong(schoolId), SystemConstant.convertIdToLong(examId), absent, current, status));
     }