Explorar o código

Merge remote-tracking branch 'origin/master'

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

+ 41 - 9
examcloud-core-oe-admin-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/admin/api/controller/ExamRecordController.java

@@ -7,6 +7,21 @@
 
 package cn.com.qmth.examcloud.core.oe.admin.api.controller;
 
+import java.util.List;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.GetMapping;
+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.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
 import cn.com.qmth.examcloud.api.commons.enums.ExamType;
 import cn.com.qmth.examcloud.core.oe.admin.base.utils.Check;
 import cn.com.qmth.examcloud.core.oe.admin.base.utils.JsonMapper;
@@ -15,6 +30,7 @@ import cn.com.qmth.examcloud.core.oe.admin.dao.ExamRecordDataRepo;
 import cn.com.qmth.examcloud.core.oe.admin.dao.ExamRecordForMarkingRepo;
 import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamRecordDataEntity;
 import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamRecordForMarkingEntity;
+import cn.com.qmth.examcloud.core.oe.admin.service.ExamCaptureService;
 import cn.com.qmth.examcloud.core.oe.admin.service.ExamRecordService;
 import cn.com.qmth.examcloud.core.oe.admin.service.bean.examrecord.ExamRecordInfo;
 import cn.com.qmth.examcloud.core.oe.admin.service.bean.examrecord.ExamRecordQuery;
@@ -25,14 +41,6 @@ import cn.com.qmth.examcloud.web.support.ControllerSupport;
 import cn.com.qmth.examcloud.web.support.Naked;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletResponse;
-import java.util.List;
 
 /**
  * 考试记录相关接口
@@ -49,7 +57,9 @@ public class ExamRecordController extends ControllerSupport {
 
     @Autowired
     private ExamRecordDataRepo examRecordDataRepo;
-
+    @Autowired
+    private ExamCaptureService examCaptureService;
+    
     @Autowired
     private ExamRecordForMarkingRepo examRecordForMarkingRepo;
 
@@ -61,6 +71,16 @@ public class ExamRecordController extends ControllerSupport {
         examRecordWaitingAuditList.getContent().forEach(p -> {
             p.setIdentityNumber(IdentityNumberHelper.conceal(p.getRootOrgId(), p.getIdentityNumber()));
         });
+        List<ExamRecordInfo> examRecordInfoList=examRecordWaitingAuditList.getContent();
+        if (examRecordInfoList != null && examRecordInfoList.size() > 0) {
+            String examType = examRecordInfoList.get(0).getExamType();
+
+            for (ExamRecordInfo examRecordInfo : examRecordInfoList) {
+                if (ExamType.ONLINE.name().equals(examType) || ExamType.ONLINE_HOMEWORK.name().equals(examType)) {
+                    examRecordInfo.setVirtualCameraNames(examCaptureService.getVirtualCameraNames(examRecordInfo.getDataId()));
+                }
+            }
+        }
         return examRecordWaitingAuditList;
     }
 
@@ -90,6 +110,9 @@ public class ExamRecordController extends ControllerSupport {
                                 FileStorageUtil.realPath(examRecordForMarkingEntity.getOfflineFileUrl()));
                     }
                 }
+                if (ExamType.ONLINE.name().equals(examType) || ExamType.ONLINE_HOMEWORK.name().equals(examType)) {
+                    examRecordInfo.setVirtualCameraNames(examCaptureService.getVirtualCameraNames(examRecordInfo.getDataId()));
+                }
             }
         }
         return examRecordInfoPage;
@@ -103,6 +126,15 @@ public class ExamRecordController extends ControllerSupport {
         Check.isNull(newQuery, "请求参数不能为空!");
         Check.isNull(newQuery.getExamId(), "请先选择考试批次!");
         List<ExamRecordInfo> examRecordInfoList = examRecordService.getExamRecordDetailList(newQuery);
+        if (examRecordInfoList != null && examRecordInfoList.size() > 0) {
+            String examType = examRecordInfoList.get(0).getExamType();
+
+            for (ExamRecordInfo examRecordInfo : examRecordInfoList) {
+                if (ExamType.ONLINE.name().equals(examType) || ExamType.ONLINE_HOMEWORK.name().equals(examType)) {
+                    examRecordInfo.setVirtualCameraNames(examCaptureService.getVirtualCameraNames(examRecordInfo.getDataId()));
+                }
+            }
+        }
         ExportUtils.exportEXCEL("考试明细列表", ExamRecordInfo.class, examRecordInfoList, response);
     }
 

+ 7 - 0
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/ExamCaptureService.java

@@ -36,4 +36,11 @@ public interface ExamCaptureService {
      */
     List<ExamCaptureInfo> getExamCaptureList(Long examRecordDataId);
 
+    /**
+     * 获取虚拟摄像头名称
+     * @param examRecordDataId
+     * @return
+     */
+    String getVirtualCameraNames(Long examRecordDataId);
+
 }

+ 15 - 1
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/bean/examrecord/ExamRecordInfo.java

@@ -270,7 +270,11 @@ public class ExamRecordInfo implements JsonSerializable {
      */
     private String offlineFileUrl;
     
-
+    /**
+     * 虚拟摄像头名称
+     */
+    @ExcelProperty(name = "虚拟摄像头名称", width = 30, index = 31)
+    private String virtualCameraNames;
     public Long getId() {
         return id;
     }
@@ -703,5 +707,15 @@ public class ExamRecordInfo implements JsonSerializable {
 	public void setOfflineFileUrl(String offlineFileUrl) {
 		this.offlineFileUrl = offlineFileUrl;
 	}
+
+    
+    public String getVirtualCameraNames() {
+        return virtualCameraNames;
+    }
+
+    
+    public void setVirtualCameraNames(String virtualCameraNames) {
+        this.virtualCameraNames = virtualCameraNames;
+    }
     
 }

+ 2 - 1
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/bean/examrecord/ExamRecordQuery.java

@@ -281,8 +281,9 @@ public class ExamRecordQuery implements JsonSerializable {
     }
 
     
-    public void setHasVirtual(String Boolean) {
+    public void setHasVirtual(Boolean hasVirtual) {
         this.hasVirtual = hasVirtual;
     }
 
+
 }

+ 2 - 1
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/ExamCaptureServiceImpl.java

@@ -140,7 +140,8 @@ public class ExamCaptureServiceImpl implements ExamCaptureService {
      * @param examRecordDataId
      * @return
      */
-    private String getVirtualCameraNames(Long examRecordDataId){
+    @Override
+    public String getVirtualCameraNames(Long examRecordDataId){
     	 Set<String> virtualCameraNames = new HashSet<String>();
          List<ExamCaptureEntity> examCaptureList = examCaptureRepo.findByExamRecordDataId(examRecordDataId);
          if(examCaptureList != null && examCaptureList.size() >0){

+ 3 - 42
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/ExamRecordServiceImpl.java

@@ -162,46 +162,7 @@ public class ExamRecordServiceImpl implements ExamRecordService {
         Check.isNull(query, "查询参数不能为空!");
         //查询条件
         StringBuilder sqlBuilder = new StringBuilder();
-        sqlBuilder.append("select  record_data.id," +
-                "record_data.exam_record_status," +
-                "record_data.start_time," +
-                "record_data.end_time," +
-                "record_data.clean_time," +
-                "record_data.used_exam_time," +
-                "record_data.exam_order," +
-                "record_data.is_warn," +
-                "record_data.is_audit," +
-                "record_data.is_illegality," +
-                "record_data.is_reexamine," +
-                "record_data.is_continued," +
-                "record_data.is_all_objective_paper," +
-                "record_data.continued_count," +
-                "record_data.face_success_count," +
-                "record_data.face_failed_count," +
-                "record_data.face_stranger_count," +
-                "record_data.face_total_count," +
-                "record_data.face_success_percent," +
-                "record_data.face_verify_result," +
-                "record_data.baidu_face_liveness_success_percent," +
-                "record_data.creation_time," +
-                "record_data.update_time," +
-                "record_data.exam_id exam_id," +
-                "record_data.exam_type exam_type," +
-                "record_data.exam_student_id exam_student_id," +
-                "record_data.student_id student_id," +
-                "record_data.student_code student_code," +
-                "record_data.student_name student_name," +
-                "record_data.identity_number identity_number," +
-                "record_data.course_id course_id," +
-                "record_data.course_level course_level," +
-                "record_data.root_org_id root_org_id," +
-                "record_data.org_id org_id," +
-                "record_data.base_paper_id base_paper_id," +
-                "record_data.paper_type paper_type," +
-                "record_data.paper_struct_id paper_struct_id," +
-                "record_data.info_collector info_collector" +
-                " from ec_oe_exam_record_data record_data " +
-                " where 1=1");
+        sqlBuilder.append(EXAM_RECORD_SQL);
         sqlBuilder.append(buildExamRecordCommonSelectCondition(query));
         sqlBuilder.append(" and ((record_data.is_warn = 0) OR (record_data.is_warn  = 1 and record_data.is_audit = 1))");
         sqlBuilder.append(" order by record_data.id desc");
@@ -329,9 +290,9 @@ public class ExamRecordServiceImpl implements ExamRecordService {
         //是否有虚拟设备
         if (query.getHasVirtual() != null) {
             if (query.getHasVirtual()) {
-                sql.append(" and record_data.id in (select t1.id from ec_oe_exam_record_data t1 left join ec_oe_exam_capture t2 on t1.id=t2.exam_record_data_id where t1.exam_id = " + query.getExamId()+" and t2.has_virtual_camera=1 ");
+                sql.append(" and record_data.id in (select t1.id from ec_oe_exam_record_data t1 left join ec_oe_exam_capture t2 on t1.id=t2.exam_record_data_id where t1.exam_id =" + query.getExamId()+" and t2.has_virtual_camera=1 )");
             } else {
-                sql.append(" and record_data.id in (select t1.id from ec_oe_exam_record_data t1 left join ec_oe_exam_capture t2 on t1.id=t2.exam_record_data_id where t1.exam_id = " + query.getExamId()+" and (t2.has_virtual_camera=0 oe t2.has_virtual_camera is null) ");
+                sql.append(" and record_data.id in (select t1.id from ec_oe_exam_record_data t1 left join ec_oe_exam_capture t2 on t1.id=t2.exam_record_data_id where t1.exam_id =" + query.getExamId()+" and (t2.has_virtual_camera=0 or t2.has_virtual_camera is null) )");
             }
         }
         return sql;

+ 1 - 1
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/ExamStudentServiceImpl.java

@@ -979,7 +979,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
         return ret;
     }
     private void countUseExamTimes(ExamStudentInfo examStudentInfo, String examType) {
-        if (!ExamType.ONLINE.name().equals(examType) && ExamType.ONLINE_HOMEWORK.name().equals(examType)) {
+        if (!ExamType.ONLINE.name().equals(examType) && !ExamType.ONLINE_HOMEWORK.name().equals(examType)) {
             return;
         }
         //考生已考次数