浏览代码

3.4.0 update

xiaofei 11 月之前
父节点
当前提交
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 {
             } 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);
                     List<ExamDetail> examDetailList1 = examTaskService.matchBasicExamStudent(basicExam, examTask, examTaskDetail, user);
                     if (CollectionUtils.isNotEmpty(examDetailList1)) {
                     if (CollectionUtils.isNotEmpty(examDetailList1)) {

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

@@ -35,8 +35,6 @@
                 LEFT JOIN
                 LEFT JOIN
             basic_course bc ON bes.course_id = bc.id
             basic_course bc ON bes.course_id = bc.id
                 LEFT JOIN
                 LEFT JOIN
-            basic_teach_clazz tbc ON bes.clazz_id = tbc.id
-                LEFT JOIN
             sys_user teacher ON bes.teacher_id = teacher.id
             sys_user teacher ON bes.teacher_id = teacher.id
                 LEFT JOIN
                 LEFT JOIN
             sys_user su ON bes.create_id = su.id
             sys_user su ON bes.create_id = su.id
@@ -65,10 +63,10 @@
                 AND bes.major_name LIKE CONCAT('%',#{major},'%')
                 AND bes.major_name LIKE CONCAT('%',#{major},'%')
             </if>
             </if>
             <if test="teachClassName != null and teachClassName != ''">
             <if test="teachClassName != null and teachClassName != ''">
-                AND tbc.teach_class_name LIKE CONCAT('%',#{teachClassName},'%')
+                AND bes.teach_class_name LIKE CONCAT('%',#{teachClassName},'%')
             </if>
             </if>
             <if test="className != null and className != ''">
             <if test="className != null and className != ''">
-                AND tbc.class_name LIKE CONCAT('%',#{className},'%')
+                AND bes.class_name LIKE CONCAT('%',#{className},'%')
             </if>
             </if>
             <if test="examStudentInfo != null and examStudentInfo != ''">
             <if test="examStudentInfo != null and examStudentInfo != ''">
                 AND (bes.student_code LIKE CONCAT('%',#{examStudentInfo},'%') OR bes.student_name LIKE CONCAT('%',#{examStudentInfo},'%'))
                 AND (bes.student_code LIKE CONCAT('%',#{examStudentInfo},'%') OR bes.student_name LIKE CONCAT('%',#{examStudentInfo},'%'))
@@ -85,6 +83,7 @@
                 </if>
                 </if>
             </if>
             </if>
         </where>
         </where>
+        order by bes.course_id, bes.student_code
     </select>
     </select>
     <select id="findBasicExamStudentList"
     <select id="findBasicExamStudentList"
             resultType="com.qmth.distributed.print.business.bean.result.BasicExamStudentResult">
             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 standardAnswer;
     private String answer;
     private String answer;
+    private Double score;
     private Double totalScore;
     private Double totalScore;
     private Boolean exist;
     private Boolean exist;
     private Integer questionType;
     private Integer questionType;
@@ -43,6 +44,14 @@ public class StudentObjectiveAnswerDto {
         this.answer = answer;
         this.answer = answer;
     }
     }
 
 
+    public Double getScore() {
+        return score;
+    }
+
+    public void setScore(Double score) {
+        this.score = score;
+    }
+
     public Double getTotalScore() {
     public Double getTotalScore() {
         return totalScore;
         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.LinkedList;
 import java.util.List;
 import java.util.List;
 
 
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.math.RandomUtils;
 import org.apache.commons.lang.math.RandomUtils;
 import org.apache.commons.lang3.StringUtils;
 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,
     public MarkStudent(Long id, Long examId, Long basicStudentId, Long courseId,
                        String paperNumber, String coursePaperId, String paperType,
                        String paperNumber, String coursePaperId, String paperType,
                        String studentCode, String packageCode, String examPlace,
                        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.id = id;
         this.examId = examId;
         this.examId = examId;
         this.basicStudentId = basicStudentId;
         this.basicStudentId = basicStudentId;
@@ -553,21 +554,33 @@ public class MarkStudent implements Serializable {
 
 
     public List<String> getAnswerList() {
     public List<String> getAnswerList() {
         List<String> list = new ArrayList<>();
         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;
         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() {
     public List<String> getSheetPathList() {
         List<String> list = new ArrayList<String>();
         List<String> list = new ArrayList<String>();
         String trimSheetPath = StringUtils.trimToNull(sheetPath);
         String trimSheetPath = StringUtils.trimToNull(sheetPath);
@@ -674,6 +687,7 @@ public class MarkStudent implements Serializable {
     public void setMarkPaperStatus(String markPaperStatus) {
     public void setMarkPaperStatus(String markPaperStatus) {
         this.markPaperStatus = markPaperStatus;
         this.markPaperStatus = markPaperStatus;
     }
     }
+
     public Boolean getInvalid() {
     public Boolean getInvalid() {
         return invalid;
         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.MarkPaperSettingConfig;
 import com.qmth.teachcloud.common.bean.params.mark.setting.MarkPaperSettingList;
 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.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.MarkQuestion;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.mark.MarkMode;
 import com.qmth.teachcloud.common.enums.mark.MarkMode;
 import com.qmth.teachcloud.common.enums.mark.MarkPaperStatus;
 import com.qmth.teachcloud.common.enums.mark.MarkPaperStatus;
 import com.qmth.teachcloud.common.enums.mark.SubjectiveStatus;
 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.BasicRoleDataPermissionService;
 import com.qmth.teachcloud.common.service.TeachcloudCommonService;
 import com.qmth.teachcloud.common.service.TeachcloudCommonService;
 import com.qmth.teachcloud.common.util.ServletUtil;
 import com.qmth.teachcloud.common.util.ServletUtil;
@@ -72,6 +74,8 @@ public class MarkPaperServiceImpl extends ServiceImpl<MarkPaperMapper, MarkPaper
     private MarkUserGroupService markUserGroupService;
     private MarkUserGroupService markUserGroupService;
     @Resource
     @Resource
     private MarkDocumentService markDocumentService;
     private MarkDocumentService markDocumentService;
+    @Resource
+    private BasicCourseService basicCourseService;
 
 
 
 
     @Override
     @Override
@@ -188,7 +192,8 @@ public class MarkPaperServiceImpl extends ServiceImpl<MarkPaperMapper, MarkPaper
         for (String paperNumber : paperNumbers) {
         for (String paperNumber : paperNumbers) {
             MarkPaper markPaper = this.getByExamIdAndPaperNumber(examId, paperNumber);
             MarkPaper markPaper = this.getByExamIdAndPaperNumber(examId, paperNumber);
             if (MarkPaperStatus.FINISH.equals(status)) {
             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);
                 List<MarkQuestion> markQuestionObjectiveList = markQuestionService.listQuestionByExamIdAndPaperNumberAndGroupNumber(examId, paperNumber, null, true);
                 if (CollectionUtils.isNotEmpty(markQuestionObjectiveList)) {
                 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.params.MarkHeaderResult;
 import com.qmth.teachcloud.mark.service.*;
 import com.qmth.teachcloud.mark.service.*;
 import com.qmth.teachcloud.mark.utils.BatchGetDataUtil;
 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.Calculator;
 import com.qmth.teachcloud.mark.utils.ScoreCalculateUtil;
 import com.qmth.teachcloud.mark.utils.ScoreCalculateUtil;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.CollectionUtils;
@@ -675,8 +676,10 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
             List<MarkQuestion> questions = markQuestionService.listQuestionByExamIdAndPaperNumberAndGroupNumber(
             List<MarkQuestion> questions = markQuestionService.listQuestionByExamIdAndPaperNumberAndGroupNumber(
                     markStudent.getExamId(), markStudent.getPaperNumber(), null, true);
                     markStudent.getExamId(), markStudent.getPaperNumber(), null, true);
             List<String> answers = markStudent.getAnswerList();
             List<String> answers = markStudent.getAnswerList();
+            List<String> answerScores = markStudent.getAnswerScoreList();
             int questionCount = questions.size();
             int questionCount = questions.size();
             int answerCount = answers.size();
             int answerCount = answers.size();
+            int answerScoreCount = answerScores.size();
 
 
             List<StudentObjectiveAnswerDto> answerDtoList = new ArrayList<>();
             List<StudentObjectiveAnswerDto> answerDtoList = new ArrayList<>();
             Map<Integer, String> titles = new HashMap<>();
             Map<Integer, String> titles = new HashMap<>();
@@ -685,11 +688,13 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
             for (int i = 0; i < maxCount; i++) {
             for (int i = 0; i < maxCount; i++) {
                 MarkQuestion q = questionCount > i ? questions.get(i) : null;
                 MarkQuestion q = questionCount > i ? questions.get(i) : null;
                 String answer = answerCount > i ? answers.get(i) : "#";
                 String answer = answerCount > i ? answers.get(i) : "#";
+                String answerScore = answerScoreCount > i ? answerScores.get(i) : "0";
                 StudentObjectiveAnswerDto studentObjectiveAnswerDto = new StudentObjectiveAnswerDto();
                 StudentObjectiveAnswerDto studentObjectiveAnswerDto = new StudentObjectiveAnswerDto();
                 studentObjectiveAnswerDto.setMainNumber(q != null ? q.getMainNumber() : 0);
                 studentObjectiveAnswerDto.setMainNumber(q != null ? q.getMainNumber() : 0);
                 studentObjectiveAnswerDto.setSubNumber(q != null ? q.getSubNumber() : 0);
                 studentObjectiveAnswerDto.setSubNumber(q != null ? q.getSubNumber() : 0);
                 studentObjectiveAnswerDto.setStandardAnswer(q != null ? q.getAnswer() : null);
                 studentObjectiveAnswerDto.setStandardAnswer(q != null ? q.getAnswer() : null);
                 studentObjectiveAnswerDto.setAnswer(answer);
                 studentObjectiveAnswerDto.setAnswer(answer);
+                studentObjectiveAnswerDto.setScore(Double.valueOf(answerScore));
                 studentObjectiveAnswerDto.setTotalScore(q.getTotalScore());
                 studentObjectiveAnswerDto.setTotalScore(q.getTotalScore());
                 studentObjectiveAnswerDto.setExist(q != null && q.getTotalScore() > 0);
                 studentObjectiveAnswerDto.setExist(q != null && q.getTotalScore() > 0);
                 studentObjectiveAnswerDto.setQuestionType(q != null ? q.getQuestionType() : 0);
                 studentObjectiveAnswerDto.setQuestionType(q != null ? q.getQuestionType() : 0);