Bladeren bron

Merge remote-tracking branch 'origin/release_v5.0.6'

deason 1 week geleden
bovenliggende
commit
ebb194a30b

+ 0 - 2
examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/controller/ExamStudentController.java

@@ -415,7 +415,6 @@ public class ExamStudentController extends ControllerSupport {
      */
     @ApiOperation(value = "新增考试学生", notes = "新增")
     @PostMapping()
-    @Transactional
     public ExamStudentDomain addExamStudent(@RequestBody ExamStudentDomain examStudent) {
         trim(examStudent);
         Long rootOrgId = getRootOrgId();
@@ -437,7 +436,6 @@ public class ExamStudentController extends ControllerSupport {
      */
     @ApiOperation(value = "更新考试学生", notes = "更新")
     @PutMapping()
-    @Transactional
     public ExamStudentDomain updateExamStudent(@RequestBody ExamStudentDomain examStudent) {
         trim(examStudent);
         Long rootOrgId = getRootOrgId();

+ 0 - 3
examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/provider/ExamStudentCloudServiceProvider.java

@@ -107,7 +107,6 @@ public class ExamStudentCloudServiceProvider extends ControllerSupport implement
 
     @ApiOperation(value = "保存考生")
     @PostMapping("saveExamStudent")
-    @Transactional
     @Override
     public SaveExamStudentResp saveExamStudent(@RequestBody SaveExamStudentReq req) {
         trim(req);
@@ -189,7 +188,6 @@ public class ExamStudentCloudServiceProvider extends ControllerSupport implement
 
     @ApiOperation(value = "复制考生")
     @PostMapping("copyExamStudents")
-    @Transactional
     @Override
     public CopyExamStudentsResp copyExamStudents(@RequestBody CopyExamStudentsReq req) {
 
@@ -533,7 +531,6 @@ public class ExamStudentCloudServiceProvider extends ControllerSupport implement
 
     @ApiOperation(value = "重置考生")
     @PostMapping("resetExamStudent")
-    @Transactional
     @Override
     public ResetExamStudentResp resetExamStudent(@RequestBody ResetExamStudentReq req) {
 

+ 4 - 0
examcloud-core-examwork-service/src/main/java/cn/com/qmth/examcloud/core/examwork/service/ExamStudentService.java

@@ -28,4 +28,8 @@ public interface ExamStudentService {
      */
     void unbindExamStudentExamStage(Long examId);
 
+    void syncExamStudent(ExamStudentInfo saved);
+
+    ExamStudentInfo saveExamStudentData(ExamStudentInfo examStudentInfo);
+
 }

+ 65 - 40
examcloud-core-examwork-service/src/main/java/cn/com/qmth/examcloud/core/examwork/service/impl/ExamStudentServiceImpl.java

@@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.dao.DataIntegrityViolationException;
 import org.springframework.data.domain.Example;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import cn.com.qmth.examcloud.commons.exception.StatusException;
 import cn.com.qmth.examcloud.commons.util.DateUtil;
@@ -242,6 +243,13 @@ public class ExamStudentServiceImpl implements ExamStudentService {
         }
     }
 
+    @Override
+    public ExamStudentInfo saveExamStudent(ExamStudentInfo examStudentInfo) {
+        ExamStudentInfo savedExamStudent = examStudentService.saveExamStudentData(examStudentInfo);
+        examStudentService.syncExamStudent(savedExamStudent);
+        return savedExamStudent;
+    }
+
     /*
      * 实现
      *
@@ -251,8 +259,9 @@ public class ExamStudentServiceImpl implements ExamStudentService {
      * saveExamStudent(cn.com.qmth.examcloud.core.examwork.service.bean.
      * ExamStudentInfo)
      */
+    @Transactional
     @Override
-    public ExamStudentInfo saveExamStudent(ExamStudentInfo examStudentInfo) {
+    public ExamStudentInfo saveExamStudentData(ExamStudentInfo examStudentInfo) {
         String paperType = examStudentInfo.getPaperType();
         String studentCode = examStudentInfo.getStudentCode();
 
@@ -433,7 +442,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
                 relation.setWeixinAnswerEnabled(true);
                 relation.setPassScoreLine(Constants.OE_PASSS_CORE_LINE);
                 relation.setGoodScoreLine(Constants.OE_GOOD_SCORE_LINE);
-                examCourseRelationRepo.save(relation);
+                examCourseRelationRepo.saveAndFlush(relation);
             } else {
                 relation.setCourseLevel(saved.getCourseLevel());
                 relation.setCourseName(saved.getCourseName());
@@ -460,6 +469,49 @@ public class ExamStudentServiceImpl implements ExamStudentService {
             throw new StatusException("500500", "保存考生相关信息异常!", e);
         }
 
+        ExamStudentInfo ret = new ExamStudentInfo();
+        ret.setId(saved.getId());
+
+        ret.setEnable(saved.getEnable());
+
+        ret.setCourseId(courseBean.getId());
+        ret.setCourseCode(courseBean.getCode());
+        ret.setCourseLevel(courseBean.getLevel());
+        ret.setCourseName(courseBean.getName());
+
+        ret.setExamId(exam.getId());
+        ret.setExamName(exam.getName());
+
+        ret.setRootOrgId(saved.getRootOrgId());
+        ret.setStudentName(studentInfo.getName());
+        ret.setIdentityNumber(saved.getIdentityNumber());
+        ret.setStudentCode(saved.getStudentCode());
+        ret.setOrgId(studentInfo.getOrgId());
+        ret.setOrgName(studentInfo.getOrgName());
+        ret.setOrgCode(studentInfo.getOrgCode());
+        ret.setStudentId(studentInfo.getId());
+
+        ret.setPaperType(saved.getPaperType());
+        ret.setRemark(saved.getRemark());
+        ret.setInfoCollector(saved.getInfoCollector());
+        ret.setExamSite(saved.getExamSite());
+
+        ret.setGrade(saved.getGrade());
+        ret.setSpecialtyName(saved.getSpecialtyName());
+        ret.setExamStageId(saved.getExamStageId());
+        ret.setExamStageOrder(saved.getExamStageOrder());
+
+        ret.setExt1(saved.getExt1());
+        ret.setExt2(saved.getExt2());
+        ret.setExt3(saved.getExt3());
+        ret.setExt4(saved.getExt4());
+        ret.setExt5(saved.getExt5());
+
+        return ret;
+    }
+
+    @Override
+    public void syncExamStudent(ExamStudentInfo saved) {
         // 同步操作
         SyncExamStudentReq req = new SyncExamStudentReq();
         req.setSyncType("update");
@@ -467,22 +519,22 @@ public class ExamStudentServiceImpl implements ExamStudentService {
 
         req.setEnable(saved.getEnable());
 
-        req.setCourseId(courseBean.getId());
-        req.setCourseCode(courseBean.getCode());
-        req.setCourseLevel(courseBean.getLevel());
-        req.setCourseName(courseBean.getName());
+        req.setCourseId(saved.getCourseId());
+        req.setCourseCode(saved.getCourseCode());
+        req.setCourseLevel(saved.getCourseLevel());
+        req.setCourseName(saved.getCourseName());
 
-        req.setExamId(exam.getId());
-        req.setExamName(exam.getName());
+        req.setExamId(saved.getExamId());
+        req.setExamName(saved.getExamName());
 
         req.setRootOrgId(saved.getRootOrgId());
-        req.setStudentId(studentInfo.getId());
-        req.setStudentName(studentInfo.getName());
+        req.setStudentId(saved.getStudentId());
+        req.setStudentName(saved.getStudentName());
         req.setIdentityNumber(saved.getIdentityNumber());
         req.setStudentCode(saved.getStudentCode());
-        req.setOrgId(studentInfo.getOrgId());
-        req.setOrgName(studentInfo.getOrgName());
-        req.setOrgCode(studentInfo.getOrgCode());
+        req.setOrgId(saved.getOrgId());
+        req.setOrgName(saved.getOrgName());
+        req.setOrgCode(saved.getOrgCode());
 
         req.setGrade(saved.getGrade());
         req.setSpecialtyName(saved.getSpecialtyName());
@@ -504,33 +556,6 @@ public class ExamStudentServiceImpl implements ExamStudentService {
                 req.getExamId(), req.getCourseCode(), req.getStudentId(), req.getId(), req.getStudentCode(),
                 req.getIdentityNumber());
         dataSyncCloudService.syncExamStudent(req);
-
-        ExamStudentInfo ret = new ExamStudentInfo();
-        ret.setId(saved.getId());
-
-        ret.setCourseId(courseBean.getId());
-        ret.setCourseCode(courseBean.getCode());
-        ret.setCourseLevel(courseBean.getLevel());
-        ret.setCourseName(courseBean.getName());
-
-        ret.setExamId(exam.getId());
-        ret.setExamName(exam.getName());
-
-        ret.setRootOrgId(saved.getRootOrgId());
-        ret.setStudentName(studentInfo.getName());
-        ret.setIdentityNumber(saved.getIdentityNumber());
-        ret.setStudentCode(saved.getStudentCode());
-        ret.setOrgId(studentInfo.getOrgId());
-        ret.setOrgName(studentInfo.getOrgName());
-        ret.setOrgCode(studentInfo.getOrgCode());
-        ret.setStudentId(studentInfo.getId());
-
-        ret.setPaperType(saved.getPaperType());
-        ret.setRemark(saved.getRemark());
-        ret.setInfoCollector(saved.getInfoCollector());
-        ret.setExamSite(saved.getExamSite());
-
-        return ret;
     }
 
     @Override

+ 6 - 0
examcloud-core-examwork-starter/src/main/resources/exam-properties.xml

@@ -348,4 +348,10 @@
         <desc>考中活体不通过强制退出</desc>
         <valueType>BOOLEAN</valueType>
     </enum>
+    <enum>
+        <id>59</id>
+        <name>MARKING_WORK_TYPE</name>
+        <desc>阅卷任务创建模式</desc>
+        <valueType>STRING</valueType>
+    </enum>
 </enums>