|
@@ -1,44 +1,47 @@
|
|
package cn.com.qmth.examcloud.core.oe.student.provider;
|
|
package cn.com.qmth.examcloud.core.oe.student.provider;
|
|
|
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
-
|
|
|
|
|
|
+import cn.com.qmth.examcloud.commons.exception.StatusException;
|
|
import cn.com.qmth.examcloud.core.oe.common.entity.ExamRecordForMarkingEntity;
|
|
import cn.com.qmth.examcloud.core.oe.common.entity.ExamRecordForMarkingEntity;
|
|
import cn.com.qmth.examcloud.core.oe.common.repository.ExamRecordForMarkingRepo;
|
|
import cn.com.qmth.examcloud.core.oe.common.repository.ExamRecordForMarkingRepo;
|
|
import cn.com.qmth.examcloud.core.oe.student.api.OeExamRecordForMarkingCloudService;
|
|
import cn.com.qmth.examcloud.core.oe.student.api.OeExamRecordForMarkingCloudService;
|
|
import cn.com.qmth.examcloud.core.oe.student.api.request.SaveExamRecordForMarkingReq;
|
|
import cn.com.qmth.examcloud.core.oe.student.api.request.SaveExamRecordForMarkingReq;
|
|
|
|
+import cn.com.qmth.examcloud.core.oe.student.api.request.UpdateExamRecordForMarkingBatchNumReq;
|
|
import cn.com.qmth.examcloud.core.oe.student.service.ExamRecordQuestionsService;
|
|
import cn.com.qmth.examcloud.core.oe.student.service.ExamRecordQuestionsService;
|
|
import cn.com.qmth.examcloud.web.support.ControllerSupport;
|
|
import cn.com.qmth.examcloud.web.support.ControllerSupport;
|
|
|
|
+import com.mysql.cj.util.StringUtils;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
-
|
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
@Api(tags = "保存阅卷数据接口")
|
|
@Api(tags = "保存阅卷数据接口")
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping("${$rmp.cloud.oe.student}" + "examRecordForMarking")
|
|
@RequestMapping("${$rmp.cloud.oe.student}" + "examRecordForMarking")
|
|
-public class OeExamRecordForMarkingCloudServiceProvider extends ControllerSupport implements OeExamRecordForMarkingCloudService{
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- *
|
|
|
|
- */
|
|
|
|
- private static final long serialVersionUID = 5991001721278000904L;
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private ExamRecordQuestionsService examRecordQuestionsService;
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private ExamRecordForMarkingRepo examRecordForMarkingRepo;
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- @PostMapping("/saveExamRecordForMarking")
|
|
|
|
- public void saveExamRecordForMarking(@RequestBody SaveExamRecordForMarkingReq req) {
|
|
|
|
- ExamRecordForMarkingEntity examRecordForMarkingExists = examRecordForMarkingRepo.findByExamRecordDataId(req.getExamRecordDataId());
|
|
|
|
- if(examRecordForMarkingExists != null){
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- ExamRecordForMarkingEntity examRecordForMarking = new ExamRecordForMarkingEntity();
|
|
|
|
|
|
+public class OeExamRecordForMarkingCloudServiceProvider extends ControllerSupport
|
|
|
|
+ implements OeExamRecordForMarkingCloudService {
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ *
|
|
|
|
+ */
|
|
|
|
+ private static final long serialVersionUID = 5991001721278000904L;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private ExamRecordQuestionsService examRecordQuestionsService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private ExamRecordForMarkingRepo examRecordForMarkingRepo;
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ @PostMapping("/saveExamRecordForMarking")
|
|
|
|
+ public void saveExamRecordForMarking(@RequestBody SaveExamRecordForMarkingReq req) {
|
|
|
|
+ ExamRecordForMarkingEntity examRecordForMarkingExists = examRecordForMarkingRepo.findByExamRecordDataId(req.getExamRecordDataId());
|
|
|
|
+ if (examRecordForMarkingExists != null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ ExamRecordForMarkingEntity examRecordForMarking = new ExamRecordForMarkingEntity();
|
|
examRecordForMarking.setExamId(req.getExamId());
|
|
examRecordForMarking.setExamId(req.getExamId());
|
|
examRecordForMarking.setExamRecordDataId(req.getExamRecordDataId());
|
|
examRecordForMarking.setExamRecordDataId(req.getExamRecordDataId());
|
|
examRecordForMarking.setExamStudentId(req.getExamStudentId());
|
|
examRecordForMarking.setExamStudentId(req.getExamStudentId());
|
|
@@ -49,6 +52,22 @@ public class OeExamRecordForMarkingCloudServiceProvider extends ControllerSuppor
|
|
int subjectiveAnswerLength = examRecordQuestionsService.calculationSubjectiveAnswerLength(req.getExamRecordDataId());
|
|
int subjectiveAnswerLength = examRecordQuestionsService.calculationSubjectiveAnswerLength(req.getExamRecordDataId());
|
|
examRecordForMarking.setSubjectiveAnswerLength(subjectiveAnswerLength);
|
|
examRecordForMarking.setSubjectiveAnswerLength(subjectiveAnswerLength);
|
|
examRecordForMarkingRepo.save(examRecordForMarking);
|
|
examRecordForMarkingRepo.save(examRecordForMarking);
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ @PostMapping("/updateExamRecordForMarkingBatchNum")
|
|
|
|
+ public void updateExamRecordForMarkingBatchNum(@RequestBody UpdateExamRecordForMarkingBatchNumReq req) {
|
|
|
|
+ if (req.getIdList()==null || req.getIdList().isEmpty()){
|
|
|
|
+ throw new StatusException("222001","阅卷原始数据表id不允许为空");
|
|
|
|
+ }
|
|
|
|
+ if (req.getIdList().size()>100){
|
|
|
|
+ throw new StatusException("222002","阅卷原始数据表id集合最大不得超过100条");
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNullOrEmpty(req.getBatchNum())){
|
|
|
|
+ throw new StatusException("222003","批次号不允许为空");
|
|
|
|
+ }
|
|
|
|
+ examRecordForMarkingRepo.updateBatchNum(req.getIdList(),req.getBatchNum());
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|