xiaofei 10 сар өмнө
parent
commit
9999e70fe9

+ 18 - 18
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/ImportLogicServiceImpl.java

@@ -128,7 +128,7 @@ public class ImportLogicServiceImpl implements ImportLogicService {
         List<BasicExamStudent> basicExamStudentList = basicExamStudentService.list(new QueryWrapper<BasicExamStudent>().lambda()
                 .select(BasicExamStudent::getId, BasicExamStudent::getCourseId, BasicExamStudent::getStudentCode, BasicExamStudent::getPaperNumber, BasicExamStudent::getPaperType, BasicExamStudent::getExamStartTime, BasicExamStudent::getExamEndTime)
                 .eq(BasicExamStudent::getSchoolId, schoolId).eq(BasicExamStudent::getExamId, examId));
-        Map<String, BasicExamStudent> courseIdStudentCodeMap = basicExamStudentList.stream().collect(Collectors.toMap(k -> k.getCourseId() + SystemConstant.HYPHEN + k.getStudentCode(), Function.identity()));
+        Map<String, BasicExamStudent> courseIdStudentCodeMap = basicExamStudentList.stream().collect(Collectors.toMap(k -> k.getCourseId() + SystemConstant.HYPHEN + k.getStudentCode(), Function.identity(), (v1, v2) -> v1));
 
         BasicSchool basicSchool = commonCacheService.schoolCache(schoolId);
         // 学校设置强制校验卷型或者模式4
@@ -346,7 +346,7 @@ public class ImportLogicServiceImpl implements ImportLogicService {
         List<BasicExamStudent> basicExamStudentList = basicExamStudentService.list(new QueryWrapper<BasicExamStudent>().lambda()
                 .select(BasicExamStudent::getId, BasicExamStudent::getCourseId, BasicExamStudent::getStudentCode, BasicExamStudent::getPaperNumber, BasicExamStudent::getTeachClassName, BasicExamStudent::getTeacherId, BasicExamStudent::getRequiredFields)
                 .eq(BasicExamStudent::getSchoolId, schoolId).eq(BasicExamStudent::getExamId, examId));
-        Map<String, BasicExamStudent> courseIdStudentCodeMap = basicExamStudentList.stream().collect(Collectors.toMap(k -> k.getCourseId() + SystemConstant.HYPHEN + k.getStudentCode(), e -> e));
+        Map<String, BasicExamStudent> courseIdStudentCodeMap = basicExamStudentList.stream().collect(Collectors.toMap(k -> k.getCourseId() + SystemConstant.HYPHEN + k.getStudentCode(), Function.identity(), (v1, v2) -> v1));
 
         Map<String, Long> basicCourseIdMap = new HashMap<>();
         // 课程学号唯一
@@ -525,7 +525,7 @@ public class ImportLogicServiceImpl implements ImportLogicService {
         List<BasicExamStudent> basicExamStudentList = basicExamStudentService.list(new QueryWrapper<BasicExamStudent>().lambda()
                 .select(BasicExamStudent::getId, BasicExamStudent::getCourseId, BasicExamStudent::getStudentCode, BasicExamStudent::getPaperNumber, BasicExamStudent::getExamStartTime, BasicExamStudent::getExamEndTime)
                 .eq(BasicExamStudent::getSchoolId, schoolId).eq(BasicExamStudent::getExamId, examId));
-        Map<String, BasicExamStudent> courseIdStudentCodeMap = basicExamStudentList.stream().collect(Collectors.toMap(k -> k.getCourseId() + SystemConstant.HYPHEN + k.getStudentCode(), Function.identity()));
+        Map<String, BasicExamStudent> courseIdStudentCodeMap = basicExamStudentList.stream().collect(Collectors.toMap(k -> k.getCourseId() + SystemConstant.HYPHEN + k.getStudentCode(), Function.identity(), (v1, v2) -> v1));
 
         // 文件中试卷编号对应多个课程代码
         Map<String, Long> paperNumberCourseIdInMap = new HashMap<>();
@@ -954,20 +954,20 @@ public class ImportLogicServiceImpl implements ImportLogicService {
             // 4.判断答案是否符合题型
             if (questionType != null && SystemConstant.strNotNull(answer)) {
                 switch (questionType) {
-                case 1:
-                    if (answer.length() > 1) {
-                        logicErrorList.add("单选题答案只能有一个");
-                    }
-                    break;
-                case 2:
-                    break;
-                case 3:
-                    if (optionCount != 2) {
-                        logicErrorList.add("判断题[选项个数]只能为2");
-                    }
-                    break;
-                default:
-                    logicErrorList.add("[题型(1-单选,2-多选,3-判断)]必须从1、2、3中填写");
+                    case 1:
+                        if (answer.length() > 1) {
+                            logicErrorList.add("单选题答案只能有一个");
+                        }
+                        break;
+                    case 2:
+                        break;
+                    case 3:
+                        if (optionCount != 2) {
+                            logicErrorList.add("判断题[选项个数]只能为2");
+                        }
+                        break;
+                    default:
+                        logicErrorList.add("[题型(1-单选,2-多选,3-判断)]必须从1、2、3中填写");
                 }
             }
 
@@ -1241,7 +1241,7 @@ public class ImportLogicServiceImpl implements ImportLogicService {
                                     userSaveParams.setPassword(SystemConstant.DEFAULT_PASSWORD);
                                     userSaveParams.setOrgId(orgId);
                                     userSaveParams.setEnable(true);
-                                    userSaveParams.setRoleIds(new Long[] { markerRole.getId() });
+                                    userSaveParams.setRoleIds(new Long[]{markerRole.getId()});
                                     try {
                                         markUser.setUserId(sysUserService.saveUser(userSaveParams, requestUser.getId()));
                                         markUser.setName(markerCode);

+ 3 - 0
teachcloud-task/src/main/java/com/qmth/teachcloud/task/service/impl/PrintFinishServiceImpl.java

@@ -14,6 +14,7 @@ import com.qmth.teachcloud.common.entity.BasicAttachment;
 import com.qmth.teachcloud.common.entity.MarkQuestion;
 import com.qmth.teachcloud.common.enums.CardCreateMethodEnum;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
+import com.qmth.teachcloud.common.enums.ObjectivePolicy;
 import com.qmth.teachcloud.common.enums.UploadFileEnum;
 import com.qmth.teachcloud.common.service.BasicAttachmentService;
 import com.qmth.teachcloud.common.util.ExamTaskUtil;
@@ -258,7 +259,9 @@ public class PrintFinishServiceImpl implements PrintFinishService {
                     markQuestion.setPaperIndex(struct.getPaperIndex());
                     markQuestion.setPageIndex(struct.getPageIndex());
                     if (StringUtils.isNotBlank(struct.getAnswer())) {
+                        // 客观题有标答时,给分策略默认为全对给分
                         markQuestion.setAnswer(struct.getAnswer());
+                        markQuestion.setObjectivePolicy(ObjectivePolicy.NONE);
                     }
                     if (struct.getScore() != null) {
                         markQuestion.setTotalScore(struct.getScore());