wangwei 6 anos atrás
pai
commit
1880f4cf90

+ 22 - 1
examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/controller/ExamController.java

@@ -77,6 +77,9 @@ import cn.com.qmth.examcloud.core.examwork.service.bean.ExamInfo;
 import cn.com.qmth.examcloud.core.examwork.service.bean.ExamOrgSettingsInfo;
 import cn.com.qmth.examcloud.core.examwork.service.impl.ExamServiceImpl;
 import cn.com.qmth.examcloud.core.examwork.service.impl.ExamStudentServiceImpl;
+import cn.com.qmth.examcloud.core.oe.admin.api.ExamRecordCloudService;
+import cn.com.qmth.examcloud.core.oe.admin.api.request.CheckExamIsStartedReq;
+import cn.com.qmth.examcloud.core.oe.admin.api.response.CheckExamIsStartedResp;
 import io.swagger.annotations.ApiOperation;
 
 /**
@@ -133,6 +136,9 @@ public class ExamController extends ControllerSupport {
 	@Autowired
 	ExamPaperTypeRelationRepo examPaperTypeRelationRepo;
 
+	@Autowired
+	ExamRecordCloudService examRecordCloudService;
+
 	@ApiOperation(value = "查询考试课程的试卷类型集合")
 	@GetMapping("queryExamCoursePaperTypeList")
 	public List<ExamPaperTypeRelationEntity> queryExamCoursePaperTypeList(
@@ -325,10 +331,25 @@ public class ExamController extends ControllerSupport {
 		domain.setName(one.getName());
 		domain.setRemark(one.getRemark());
 		domain.setRootOrgId(one.getRootOrgId());
-		domain.setStarted(one.getBeginTime().before(new Date()));
+		domain.setStarted(isStarted(one.getId()));
 		return domain;
 	}
 
+	/**
+	 * 是否开考
+	 *
+	 * @author WANGWEI
+	 * @param examId
+	 * @return
+	 */
+	private boolean isStarted(Long examId) {
+		CheckExamIsStartedReq checkExamIsStartedReq = new CheckExamIsStartedReq();
+		checkExamIsStartedReq.setExamId(examId);
+		CheckExamIsStartedResp checkExamIsStartedResp = examRecordCloudService
+				.checkExamIsStarted(checkExamIsStartedReq);
+		return checkExamIsStartedResp.getIsStarted();
+	}
+
 	/**
 	 * 方法注释
 	 *