wangliang 4 år sedan
förälder
incheckning
e5607d3ff3

+ 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());
             }
         });

+ 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}