Explorar o código

添加查询同步状态接口

lideyin %!s(int64=5) %!d(string=hai) anos
pai
achega
e49a35c4d9

+ 27 - 5
examcloud-core-oe-student-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/student/api/provider/ExamRecordDataCloudServiceProvider.java

@@ -8,10 +8,7 @@ import cn.com.qmth.examcloud.core.oe.student.api.bean.FaceBiopsyItemStepBean;
 import cn.com.qmth.examcloud.core.oe.student.api.request.*;
 import cn.com.qmth.examcloud.core.oe.student.api.response.*;
 import cn.com.qmth.examcloud.core.oe.student.dao.*;
-import cn.com.qmth.examcloud.core.oe.student.dao.entity.ExamFaceLivenessVerifyEntity;
-import cn.com.qmth.examcloud.core.oe.student.dao.entity.FaceBiopsyEntity;
-import cn.com.qmth.examcloud.core.oe.student.dao.entity.FaceBiopsyItemEntity;
-import cn.com.qmth.examcloud.core.oe.student.dao.entity.FaceBiopsyItemStepEntity;
+import cn.com.qmth.examcloud.core.oe.student.dao.entity.*;
 import cn.com.qmth.examcloud.core.oe.student.service.ExamControlService;
 import cn.com.qmth.examcloud.core.oe.student.service.ExamRecordDataService;
 import cn.com.qmth.examcloud.core.oe.student.service.ExamRecordPaperStructService;
@@ -20,6 +17,7 @@ import cn.com.qmth.examcloud.web.support.ControllerSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Example;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -41,6 +39,8 @@ public class ExamRecordDataCloudServiceProvider extends ControllerSupport implem
     @Autowired
     private ExamRecordDataService examRecordDataService;
     @Autowired
+    private ExamRecordDataRepo examRecordDataRepo;
+    @Autowired
     private ExamFaceLivenessVerifyRepo examFaceLivenessVerifyRepo;
     @Autowired
     private FaceBiopsyRepo faceBiopsyRepo;
@@ -261,12 +261,34 @@ public class ExamRecordDataCloudServiceProvider extends ControllerSupport implem
 
         return new HandInExamResp();
     }
+
     @ApiOperation(value = "修改考试记录状态")
     @PostMapping("/updateExamRecordStatus")
     @Override
-    public UpdateExamRecordStatusResp updateExamRecordStatus(UpdateExamRecordStatusReq req) {
+    public UpdateExamRecordStatusResp updateExamRecordStatus(@RequestBody UpdateExamRecordStatusReq req) {
         examRecordDataService.updateExamRecordStatus(req);
         UpdateExamRecordStatusResp res = new UpdateExamRecordStatusResp();
         return res;
     }
+
+    /**
+     * 获取考试记录数量
+     *
+     * @param req
+     * @return
+     */
+    @ApiOperation(value = "获取考试记录数量")
+    @PostMapping("/getExamRecordNum")
+    @Override
+    public GetExamRecordNumResp getExamRecordNum(@RequestBody GetExamRecordNumReq req) {
+        ExamRecordDataEntity query = new ExamRecordDataEntity();
+        query.setExamId(req.getExamId());
+        Example<ExamRecordDataEntity> queryExample = Example.of(query);
+        long num = examRecordDataRepo.count(queryExample);
+
+        GetExamRecordNumResp resp = new GetExamRecordNumResp();
+        resp.setNum(num);
+
+        return resp;
+    }
 }