xiaofei 11 kuukautta sitten
vanhempi
commit
cc2f4b691a

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/PrintCommonServiceImpl.java

@@ -895,7 +895,7 @@ public class PrintCommonServiceImpl implements PrintCommonService {
                     }
                 }
             } else {
-                if (ExamModelEnum.MODEL1.equals(basicExam.getExamModel())) {
+                if (ExamModelEnum.MODEL1.equals(basicExam.getExamModel()) || ExamModelEnum.MODEL3.equals(basicExam.getExamModel())) {
                     // 自动关联考生表中数据,并生成考场信息
                     List<ExamDetail> examDetailList1 = examTaskService.matchBasicExamStudent(basicExam, examTask, examTaskDetail, user);
                     if (CollectionUtils.isNotEmpty(examDetailList1)) {

+ 3 - 4
distributed-print-business/src/main/resources/mapper/BasicExamStudentMapper.xml

@@ -35,8 +35,6 @@
                 LEFT JOIN
             basic_course bc ON bes.course_id = bc.id
                 LEFT JOIN
-            basic_teach_clazz tbc ON bes.clazz_id = tbc.id
-                LEFT JOIN
             sys_user teacher ON bes.teacher_id = teacher.id
                 LEFT JOIN
             sys_user su ON bes.create_id = su.id
@@ -65,10 +63,10 @@
                 AND bes.major_name LIKE CONCAT('%',#{major},'%')
             </if>
             <if test="teachClassName != null and teachClassName != ''">
-                AND tbc.teach_class_name LIKE CONCAT('%',#{teachClassName},'%')
+                AND bes.teach_class_name LIKE CONCAT('%',#{teachClassName},'%')
             </if>
             <if test="className != null and className != ''">
-                AND tbc.class_name LIKE CONCAT('%',#{className},'%')
+                AND bes.class_name LIKE CONCAT('%',#{className},'%')
             </if>
             <if test="examStudentInfo != null and examStudentInfo != ''">
                 AND (bes.student_code LIKE CONCAT('%',#{examStudentInfo},'%') OR bes.student_name LIKE CONCAT('%',#{examStudentInfo},'%'))
@@ -85,6 +83,7 @@
                 </if>
             </if>
         </where>
+        order by bes.course_id, bes.student_code
     </select>
     <select id="findBasicExamStudentList"
             resultType="com.qmth.distributed.print.business.bean.result.BasicExamStudentResult">

+ 9 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/mark/score/StudentObjectiveAnswerDto.java

@@ -7,6 +7,7 @@ public class StudentObjectiveAnswerDto {
     // 标答
     private String standardAnswer;
     private String answer;
+    private Double score;
     private Double totalScore;
     private Boolean exist;
     private Integer questionType;
@@ -43,6 +44,14 @@ public class StudentObjectiveAnswerDto {
         this.answer = answer;
     }
 
+    public Double getScore() {
+        return score;
+    }
+
+    public void setScore(Double score) {
+        this.score = score;
+    }
+
     public Double getTotalScore() {
         return totalScore;
     }

+ 26 - 12
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/entity/MarkStudent.java

@@ -5,6 +5,7 @@ import java.util.ArrayList;
 import java.util.LinkedList;
 import java.util.List;
 
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.math.RandomUtils;
 import org.apache.commons.lang3.StringUtils;
 
@@ -195,7 +196,7 @@ public class MarkStudent implements Serializable {
     public MarkStudent(Long id, Long examId, Long basicStudentId, Long courseId,
                        String paperNumber, String coursePaperId, String paperType,
                        String studentCode, String packageCode, String examPlace,
-                       String examRoom,  Long examStartTime, Long examEndTime, Long createId) {
+                       String examRoom, Long examStartTime, Long examEndTime, Long createId) {
         this.id = id;
         this.examId = examId;
         this.basicStudentId = basicStudentId;
@@ -553,21 +554,33 @@ public class MarkStudent implements Serializable {
 
     public List<String> getAnswerList() {
         List<String> list = new ArrayList<>();
-        if(StringUtils.isNotBlank(answers)){
-        	try {
-				list = JSON.parseArray(answers, String.class);
-			} catch (Exception e) {
-				String[] values = StringUtils.split(StringUtils.trimToNull(answers), ANSWER_SPLIT);
-		        if (values != null && values.length > 0) {
-		            for (String answer : values) {
-		                list.add(StringUtils.trim(answer));
-		            }
-		        }
-			}
+        if (StringUtils.isNotBlank(answers)) {
+            try {
+                list = JSON.parseArray(answers, String.class);
+            } catch (Exception e) {
+                String[] values = StringUtils.split(StringUtils.trimToNull(answers), ANSWER_SPLIT);
+                if (values != null && values.length > 0) {
+                    for (String answer : values) {
+                        list.add(StringUtils.trim(answer));
+                    }
+                }
+            }
         }
         return list;
     }
 
+    public List<String> getAnswerScoreList() {
+        List<String> scoreList = new ArrayList<>();
+        List<String> answerList = getAnswerList();
+        if (StringUtils.isNotBlank(objectiveScoreList) && CollectionUtils.isNotEmpty(answerList)) {
+            String[] answerScores = objectiveScoreList.split(";");
+            for (String answerScore : answerScores) {
+                scoreList.add(answerScore.split(":")[1]);
+            }
+        }
+        return scoreList;
+    }
+
     public List<String> getSheetPathList() {
         List<String> list = new ArrayList<String>();
         String trimSheetPath = StringUtils.trimToNull(sheetPath);
@@ -674,6 +687,7 @@ public class MarkStudent implements Serializable {
     public void setMarkPaperStatus(String markPaperStatus) {
         this.markPaperStatus = markPaperStatus;
     }
+
     public Boolean getInvalid() {
         return invalid;
     }

+ 6 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkPaperServiceImpl.java

@@ -12,12 +12,14 @@ import com.qmth.teachcloud.common.bean.dto.mark.MarkSettingDto;
 import com.qmth.teachcloud.common.bean.params.mark.setting.MarkPaperSettingConfig;
 import com.qmth.teachcloud.common.bean.params.mark.setting.MarkPaperSettingList;
 import com.qmth.teachcloud.common.bean.params.mark.setting.MarkPaperSettingParam;
+import com.qmth.teachcloud.common.entity.BasicCourse;
 import com.qmth.teachcloud.common.entity.MarkQuestion;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.mark.MarkMode;
 import com.qmth.teachcloud.common.enums.mark.MarkPaperStatus;
 import com.qmth.teachcloud.common.enums.mark.SubjectiveStatus;
+import com.qmth.teachcloud.common.service.BasicCourseService;
 import com.qmth.teachcloud.common.service.BasicRoleDataPermissionService;
 import com.qmth.teachcloud.common.service.TeachcloudCommonService;
 import com.qmth.teachcloud.common.util.ServletUtil;
@@ -72,6 +74,8 @@ public class MarkPaperServiceImpl extends ServiceImpl<MarkPaperMapper, MarkPaper
     private MarkUserGroupService markUserGroupService;
     @Resource
     private MarkDocumentService markDocumentService;
+    @Resource
+    private BasicCourseService basicCourseService;
 
 
     @Override
@@ -188,7 +192,8 @@ public class MarkPaperServiceImpl extends ServiceImpl<MarkPaperMapper, MarkPaper
         for (String paperNumber : paperNumbers) {
             MarkPaper markPaper = this.getByExamIdAndPaperNumber(examId, paperNumber);
             if (MarkPaperStatus.FINISH.equals(status)) {
-                String courseInfo = String.format("%s[%s],试卷编号%s,", markPaper.getCourseName(), markPaper.getCourseCode(), markPaper.getPaperNumber());
+                BasicCourse basicCourse = basicCourseService.getById(markPaper.getCourseId());
+                String courseInfo = String.format("%s[%s],试卷编号%s,", basicCourse.getName(), basicCourse.getCode(), markPaper.getPaperNumber());
                 // 主观题是否全部分组
                 List<MarkQuestion> markQuestionObjectiveList = markQuestionService.listQuestionByExamIdAndPaperNumberAndGroupNumber(examId, paperNumber, null, true);
                 if (CollectionUtils.isNotEmpty(markQuestionObjectiveList)) {

+ 5 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkStudentServiceImpl.java

@@ -62,6 +62,7 @@ import com.qmth.teachcloud.mark.mapper.MarkStudentMapper;
 import com.qmth.teachcloud.mark.params.MarkHeaderResult;
 import com.qmth.teachcloud.mark.service.*;
 import com.qmth.teachcloud.mark.utils.BatchGetDataUtil;
+import com.qmth.teachcloud.mark.utils.BigDecimalUtils;
 import com.qmth.teachcloud.mark.utils.Calculator;
 import com.qmth.teachcloud.mark.utils.ScoreCalculateUtil;
 import org.apache.commons.collections4.CollectionUtils;
@@ -675,8 +676,10 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
             List<MarkQuestion> questions = markQuestionService.listQuestionByExamIdAndPaperNumberAndGroupNumber(
                     markStudent.getExamId(), markStudent.getPaperNumber(), null, true);
             List<String> answers = markStudent.getAnswerList();
+            List<String> answerScores = markStudent.getAnswerScoreList();
             int questionCount = questions.size();
             int answerCount = answers.size();
+            int answerScoreCount = answerScores.size();
 
             List<StudentObjectiveAnswerDto> answerDtoList = new ArrayList<>();
             Map<Integer, String> titles = new HashMap<>();
@@ -685,11 +688,13 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
             for (int i = 0; i < maxCount; i++) {
                 MarkQuestion q = questionCount > i ? questions.get(i) : null;
                 String answer = answerCount > i ? answers.get(i) : "#";
+                String answerScore = answerScoreCount > i ? answerScores.get(i) : "0";
                 StudentObjectiveAnswerDto studentObjectiveAnswerDto = new StudentObjectiveAnswerDto();
                 studentObjectiveAnswerDto.setMainNumber(q != null ? q.getMainNumber() : 0);
                 studentObjectiveAnswerDto.setSubNumber(q != null ? q.getSubNumber() : 0);
                 studentObjectiveAnswerDto.setStandardAnswer(q != null ? q.getAnswer() : null);
                 studentObjectiveAnswerDto.setAnswer(answer);
+                studentObjectiveAnswerDto.setScore(Double.valueOf(answerScore));
                 studentObjectiveAnswerDto.setTotalScore(q.getTotalScore());
                 studentObjectiveAnswerDto.setExist(q != null && q.getTotalScore() > 0);
                 studentObjectiveAnswerDto.setQuestionType(q != null ? q.getQuestionType() : 0);