Browse Source

Merge branch 'dev' into release
111

wangliang 4 years ago
parent
commit
f5d4668b58

+ 13 - 4
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamStudentController.java

@@ -1,6 +1,7 @@
 package com.qmth.themis.backend.api;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.qmth.themis.business.annotation.ApiJsonObject;
@@ -127,10 +128,8 @@ public class TEExamStudentController {
             if (Objects.isNull(s.getId())) {
                 QueryWrapper<TEStudent> teExamStudentQueryWrapper = new QueryWrapper<>();
                 teExamStudentQueryWrapper.lambda().eq(TEStudent::getName, s.getName())
-                        .eq(TEStudent::getIdentity, s.getIdentity());
-                if (Objects.nonNull(tbOrg) && Objects.nonNull(tbOrg.getId())) {
-                    teExamStudentQueryWrapper.lambda().eq(TEStudent::getOrgId, tbOrg.getId());
-                }
+                        .eq(TEStudent::getIdentity, s.getIdentity())
+                        .eq(TEStudent::getOrgId, tbOrg.getId());
                 int count = teStudentService.count(teExamStudentQueryWrapper);
                 if (count == 0) {
                     TEStudent teStudent = new TEStudent(tbOrg.getId(), s.getIdentity(), s.getName(), tbUser.getId());
@@ -139,6 +138,16 @@ public class TEExamStudentController {
                     s.setCreateId(tbUser.getId());
                 }
             } else {
+                UpdateWrapper<TEExamStudent> teExamStudentUpdateWrapper = new UpdateWrapper<>();
+                teExamStudentUpdateWrapper.lambda().set(TEExamStudent::getName, s.getName())
+                        .eq(TEExamStudent::getIdentity, s.getIdentity());
+                teExamStudentService.update(teExamStudentUpdateWrapper);
+
+                UpdateWrapper<TEStudent> teStudentUpdateWrapper = new UpdateWrapper<>();
+                teStudentUpdateWrapper.lambda().set(TEStudent::getName, s.getName())
+                        .eq(TEStudent::getIdentity, s.getIdentity());
+                teStudentService.update(teStudentUpdateWrapper);
+
                 s.setUpdateId(tbUser.getId());
             }
         });

+ 1 - 1
themis-business/src/main/java/com/qmth/themis/business/templete/service/impl/TempleteLogicServiceImpl.java

@@ -86,7 +86,7 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
         Map<String, String> courseCodeMap = (Map<String, String>) map.get("courseCodeMap");
         QueryWrapper<TEExamCourse> teExamCourseQueryWrapper = new QueryWrapper<>();
         Set<String> courseCodeSet = courseCodeMap.keySet().stream().collect(Collectors.toSet());
-        teExamCourseQueryWrapper.lambda().in(TEExamCourse::getCourseCode, courseCodeSet);
+        teExamCourseQueryWrapper.lambda().in(TEExamCourse::getCourseCode, courseCodeSet).eq(TEExamCourse::getExamId, examId);
         List<TEExamCourse> teExamCourseList = teExamCourseService.list(teExamCourseQueryWrapper);
         Integer examCount = Integer.parseInt(String.valueOf(map.get("examCount")));
         if (Objects.nonNull(teExamCourseList) && teExamCourseList.size() > 0) {

+ 7 - 1
themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

@@ -132,7 +132,13 @@
             <if test="status != null and status != ''">
                 <choose>
                     <when test="status == EXCEPTION">
-                        and t.exception_status is not null
+                        and (t.exception_status is not null or t.status = 'BREAK_OFF')
+                    </when>
+                    <when test="status == PREPARE">
+                        and t.status = 'FIRST_PREPARE'
+                    </when>
+                    <when test="status == EXAMING">
+                        and (t.status = 'ANSWERING' or t.status = 'RESUME_PREPARE')
                     </when>
                     <otherwise>
                         and t.status = #{status}