wangwei 6 سال پیش
والد
کامیت
4ba2993adf

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

@@ -13,9 +13,11 @@ import org.springframework.web.bind.annotation.RestController;
 import cn.com.qmth.examcloud.commons.base.exception.StatusException;
 import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
 import cn.com.qmth.examcloud.core.examwork.base.enums.ExamProperty;
+import cn.com.qmth.examcloud.core.examwork.dao.ExamOrgSettingsRepo;
 import cn.com.qmth.examcloud.core.examwork.dao.ExamPropertyRepo;
 import cn.com.qmth.examcloud.core.examwork.dao.ExamRepo;
 import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamEntity;
+import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamOrgSettingsEntity;
 import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamPropertyEntity;
 import cn.com.qmth.examcloud.core.examwork.dao.enums.ExamType;
 import cn.com.qmth.examcloud.core.examwork.service.bean.ExamInfo;
@@ -48,6 +50,9 @@ public class ExamCloudServiceProvider extends ControllerSupport implements ExamC
 	@Autowired
 	private ExamServiceImpl examService;
 
+	@Autowired
+	ExamOrgSettingsRepo examOrgSettingsRepo;
+
 	@Autowired
 	ExamRepo examRepo;
 
@@ -132,6 +137,15 @@ public class ExamCloudServiceProvider extends ControllerSupport implements ExamC
 		bean.setRemark(exam.getRemark());
 		bean.setRootOrgId(exam.getRootOrgId());
 
+		Long orgId = req.getOrgId();
+		if (null != orgId) {
+			ExamOrgSettingsEntity examOrgEntity = examOrgSettingsRepo
+					.findByExamIdAndOrgId(exam.getId(), orgId);
+
+			bean.setBeginTime(examOrgEntity.getBeginTime());
+			bean.setEndTime(examOrgEntity.getEndTime());
+		}
+
 		return examResp;
 	}