wangwei 6 年之前
父节点
当前提交
8c735661ce
共有 17 个文件被更改,包括 141 次插入146 次删除
  1. 48 48
      examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/controller/ExamController.java
  2. 2 7
      examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/controller/bean/ExamCourseGroupDomain.java
  3. 2 2
      examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/controller/bean/ExamOrgSettingsDomain.java
  4. 0 29
      examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/CourseGroupRelationRepo.java
  5. 0 27
      examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/CourseGroupRepo.java
  6. 29 0
      examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/ExamCourseGroupRelationRepo.java
  7. 27 0
      examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/ExamCourseGroupSettingsRepo.java
  8. 8 8
      examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/ExamOrgSettingsRepo.java
  9. 2 2
      examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamCourseGroupRelationEntity.java
  10. 1 1
      examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamCourseGroupRelationPK.java
  11. 3 3
      examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamCourseGroupSettingsEntity.java
  12. 1 1
      examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamOrgPropertyEntity.java
  13. 4 4
      examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamOrgSettingsEntity.java
  14. 3 3
      examcloud-core-examwork-service/src/main/java/cn/com/qmth/examcloud/core/examwork/service/ExamService.java
  15. 1 1
      examcloud-core-examwork-service/src/main/java/cn/com/qmth/examcloud/core/examwork/service/bean/ExamOrgSettingsInfo.java
  16. 8 8
      examcloud-core-examwork-service/src/main/java/cn/com/qmth/examcloud/core/examwork/service/impl/ExamServiceImpl.java
  17. 2 2
      examcloud-core-examwork-service/src/main/java/cn/com/qmth/examcloud/core/examwork/service/impl/ExamStudentServiceImpl.java

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

@@ -49,26 +49,26 @@ import cn.com.qmth.examcloud.core.basic.api.OrgCloudService;
 import cn.com.qmth.examcloud.core.basic.api.bean.OrgBean;
 import cn.com.qmth.examcloud.core.basic.api.request.GetOrgReq;
 import cn.com.qmth.examcloud.core.basic.api.response.GetOrgResp;
-import cn.com.qmth.examcloud.core.examwork.api.controller.bean.CourseGroupDomain;
+import cn.com.qmth.examcloud.core.examwork.api.controller.bean.ExamCourseGroupDomain;
 import cn.com.qmth.examcloud.core.examwork.api.controller.bean.ExamDomain;
-import cn.com.qmth.examcloud.core.examwork.api.controller.bean.ExamOrgDomain;
+import cn.com.qmth.examcloud.core.examwork.api.controller.bean.ExamOrgSettingsDomain;
 import cn.com.qmth.examcloud.core.examwork.base.enums.ExamProperty;
-import cn.com.qmth.examcloud.core.examwork.dao.CourseGroupRelationRepo;
-import cn.com.qmth.examcloud.core.examwork.dao.CourseGroupRepo;
+import cn.com.qmth.examcloud.core.examwork.dao.ExamCourseGroupRelationRepo;
+import cn.com.qmth.examcloud.core.examwork.dao.ExamCourseGroupSettingsRepo;
 import cn.com.qmth.examcloud.core.examwork.dao.ExamOrgPropertyRepo;
-import cn.com.qmth.examcloud.core.examwork.dao.ExamOrgRepo;
+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.ExamStudentRepo;
-import cn.com.qmth.examcloud.core.examwork.dao.entity.CourseGroupEntity;
-import cn.com.qmth.examcloud.core.examwork.dao.entity.CourseGroupRelationEntity;
+import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamCourseGroupSettingsEntity;
+import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamCourseGroupRelationEntity;
 import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamEntity;
-import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamOrgEntity;
+import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamOrgSettingsEntity;
 import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamOrgPropertyEntity;
 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;
-import cn.com.qmth.examcloud.core.examwork.service.bean.ExamOrgInfo;
+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 io.swagger.annotations.ApiOperation;
@@ -104,13 +104,13 @@ public class ExamController extends ControllerSupport {
 	ExamStudentServiceImpl examStudentService;
 
 	@Autowired
-	CourseGroupRepo courseGroupRepo;
+	ExamCourseGroupSettingsRepo courseGroupRepo;
 
 	@Autowired
-	ExamOrgRepo examOrgRepo;
+	ExamOrgSettingsRepo examOrgRepo;
 
 	@Autowired
-	CourseGroupRelationRepo courseGroupRelationRepo;
+	ExamCourseGroupRelationRepo courseGroupRelationRepo;
 
 	@Autowired
 	OrgCloudService orgCloudService;
@@ -458,17 +458,17 @@ public class ExamController extends ControllerSupport {
 	 */
 	@ApiOperation(value = "查询课程组集合", notes = "")
 	@GetMapping("getCourseGroupListByExamId/{examId}/{curPage}/{pageSize}")
-	public List<CourseGroupDomain> getCourseGroupListByExamId(@PathVariable Long examId,
+	public List<ExamCourseGroupDomain> getCourseGroupListByExamId(@PathVariable Long examId,
 			@PathVariable Integer curPage, @PathVariable Integer pageSize) {
 
 		Pageable pageable = new PageRequest(curPage - 1, pageSize, Sort.Direction.DESC,
 				"updateTime");
-		List<CourseGroupEntity> groupList = courseGroupRepo.findAllByExamId(examId, pageable);
+		List<ExamCourseGroupSettingsEntity> groupList = courseGroupRepo.findAllByExamId(examId, pageable);
 
-		List<CourseGroupDomain> ret = Lists.newArrayList();
+		List<ExamCourseGroupDomain> ret = Lists.newArrayList();
 
-		for (CourseGroupEntity curCourseGroup : groupList) {
-			CourseGroupDomain bean = new CourseGroupDomain();
+		for (ExamCourseGroupSettingsEntity curCourseGroup : groupList) {
+			ExamCourseGroupDomain bean = new ExamCourseGroupDomain();
 			bean.setBeginTime(curCourseGroup.getBeginTime());
 			bean.setCreationTime(curCourseGroup.getCreationTime());
 			bean.setDescription(curCourseGroup.getDescription());
@@ -481,10 +481,10 @@ public class ExamController extends ControllerSupport {
 			List<Long> courseIdList = Lists.newArrayList();
 			bean.setCourseIdList(courseIdList);
 
-			List<CourseGroupRelationEntity> relationList = courseGroupRelationRepo
+			List<ExamCourseGroupRelationEntity> relationList = courseGroupRelationRepo
 					.findAllByGroupId(bean.getId());
 
-			for (CourseGroupRelationEntity cur : relationList) {
+			for (ExamCourseGroupRelationEntity cur : relationList) {
 				courseIdList.add(cur.getCourseId());
 			}
 
@@ -504,25 +504,25 @@ public class ExamController extends ControllerSupport {
 	 */
 	@ApiOperation(value = "通过课程ID查询课程组集合", notes = "")
 	@GetMapping("getCourseGroupListByExamIdAndCourseId/{examId}/{courseId}")
-	public List<CourseGroupDomain> getCourseGroupListByExamIdAndCourseId(@PathVariable Long examId,
+	public List<ExamCourseGroupDomain> getCourseGroupListByExamIdAndCourseId(@PathVariable Long examId,
 			@PathVariable Long courseId) {
 
-		List<CourseGroupRelationEntity> relationList = courseGroupRelationRepo
+		List<ExamCourseGroupRelationEntity> relationList = courseGroupRelationRepo
 				.findAllByCourseIdAndExamId(courseId, examId);
 
 		List<Long> groupIdList = Lists.newArrayList();
-		for (CourseGroupRelationEntity cur : relationList) {
+		for (ExamCourseGroupRelationEntity cur : relationList) {
 			Long groupId = cur.getGroupId();
 			groupIdList.add(groupId);
 		}
 
-		List<CourseGroupEntity> groupList = courseGroupRepo
+		List<ExamCourseGroupSettingsEntity> groupList = courseGroupRepo
 				.findAllByIdInOrderByUpdateTimeDesc(groupIdList);
 
-		List<CourseGroupDomain> ret = Lists.newArrayList();
+		List<ExamCourseGroupDomain> ret = Lists.newArrayList();
 
-		for (CourseGroupEntity curCourseGroup : groupList) {
-			CourseGroupDomain bean = new CourseGroupDomain();
+		for (ExamCourseGroupSettingsEntity curCourseGroup : groupList) {
+			ExamCourseGroupDomain bean = new ExamCourseGroupDomain();
 			bean.setBeginTime(curCourseGroup.getBeginTime());
 			bean.setCreationTime(curCourseGroup.getCreationTime());
 			bean.setDescription(curCourseGroup.getDescription());
@@ -535,10 +535,10 @@ public class ExamController extends ControllerSupport {
 			List<Long> courseIdList = Lists.newArrayList();
 			bean.setCourseIdList(courseIdList);
 
-			List<CourseGroupRelationEntity> curRelationList = courseGroupRelationRepo
+			List<ExamCourseGroupRelationEntity> curRelationList = courseGroupRelationRepo
 					.findAllByGroupId(bean.getId());
 
-			for (CourseGroupRelationEntity cur : curRelationList) {
+			for (ExamCourseGroupRelationEntity cur : curRelationList) {
 				courseIdList.add(cur.getCourseId());
 			}
 		}
@@ -555,10 +555,10 @@ public class ExamController extends ControllerSupport {
 	 */
 	@ApiOperation(value = "更新课程组", notes = "")
 	@PutMapping("courseGroup")
-	public void updateCourseGroup(@RequestBody CourseGroupDomain courseGroupBean,
+	public void updateCourseGroup(@RequestBody ExamCourseGroupDomain courseGroupBean,
 			HttpServletRequest request) {
 
-		CourseGroupEntity courseGroup = new CourseGroupEntity();
+		ExamCourseGroupSettingsEntity courseGroup = new ExamCourseGroupSettingsEntity();
 		courseGroup.setBeginTime(courseGroupBean.getBeginTime());
 		courseGroup.setCreationTime(courseGroupBean.getCreationTime());
 		courseGroup.setDescription(courseGroupBean.getDescription());
@@ -571,12 +571,12 @@ public class ExamController extends ControllerSupport {
 		courseGroupRepo.save(courseGroup);
 		List<Long> courseIdList = courseGroupBean.getCourseIdList();
 
-		List<CourseGroupRelationEntity> relationList = Lists.newArrayList();
+		List<ExamCourseGroupRelationEntity> relationList = Lists.newArrayList();
 
 		courseGroupRelationRepo.deleteByGroupId(courseGroup.getId());
 
 		for (Long cur : courseIdList) {
-			CourseGroupRelationEntity relation = new CourseGroupRelationEntity();
+			ExamCourseGroupRelationEntity relation = new ExamCourseGroupRelationEntity();
 			relation.setCourseId(cur);
 			relation.setExamId(courseGroupBean.getExamId());
 			relation.setGroupId(courseGroup.getId());
@@ -609,8 +609,8 @@ public class ExamController extends ControllerSupport {
 	 */
 	@ApiOperation(value = "查询考试相关的学习中心设置", notes = "")
 	@GetMapping("getExamOrgList/{curPage}/{pageSize}")
-	public PageInfo<ExamOrgDomain> getExamOrgList(@PathVariable Integer curPage,
-			@PathVariable Integer pageSize, @ModelAttribute ExamOrgDomain examOrgDomain) {
+	public PageInfo<ExamOrgSettingsDomain> getExamOrgList(@PathVariable Integer curPage,
+			@PathVariable Integer pageSize, @ModelAttribute ExamOrgSettingsDomain examOrgDomain) {
 
 		Long examId = examOrgDomain.getExamId();
 		if (null == examOrgDomain.getExamId()) {
@@ -622,7 +622,7 @@ public class ExamController extends ControllerSupport {
 		}
 		validateRootOrgIsolation(examEntity.getRootOrgId());
 
-		Specification<ExamOrgEntity> specification = (root, query, cb) -> {
+		Specification<ExamOrgSettingsEntity> specification = (root, query, cb) -> {
 			List<Predicate> predicates = new ArrayList<>();
 
 			predicates.add(cb.equal(root.get("examId"), examOrgDomain.getExamId()));
@@ -635,14 +635,14 @@ public class ExamController extends ControllerSupport {
 		};
 
 		Pageable pageable = new PageRequest(curPage, pageSize, Sort.Direction.DESC, "updateTime");
-		Page<ExamOrgEntity> page = examOrgRepo.findAll(specification, pageable);
+		Page<ExamOrgSettingsEntity> page = examOrgRepo.findAll(specification, pageable);
 
-		Iterator<ExamOrgEntity> iterator = page.iterator();
-		List<ExamOrgDomain> domainList = Lists.newArrayList();
+		Iterator<ExamOrgSettingsEntity> iterator = page.iterator();
+		List<ExamOrgSettingsDomain> domainList = Lists.newArrayList();
 
 		while (iterator.hasNext()) {
-			ExamOrgEntity next = iterator.next();
-			ExamOrgDomain bean = new ExamOrgDomain();
+			ExamOrgSettingsEntity next = iterator.next();
+			ExamOrgSettingsDomain bean = new ExamOrgSettingsDomain();
 			domainList.add(bean);
 
 			bean.setBeginTime(next.getBeginTime());
@@ -672,7 +672,7 @@ public class ExamController extends ControllerSupport {
 			bean.setProperties(map);
 		}
 
-		PageInfo<ExamOrgDomain> ret = new PageInfo<ExamOrgDomain>();
+		PageInfo<ExamOrgSettingsDomain> ret = new PageInfo<ExamOrgSettingsDomain>();
 		ret.setList(domainList);
 		ret.setTotal(page.getTotalElements());
 		return ret;
@@ -680,7 +680,7 @@ public class ExamController extends ControllerSupport {
 
 	@ApiOperation(value = "查询考生考试机构配置", notes = "")
 	@PostMapping("studentExamOrg/{examId}")
-	public ExamOrgEntity getStudentExamOrg(@PathVariable Long examId) {
+	public ExamOrgSettingsEntity getStudentExamOrg(@PathVariable Long examId) {
 		User accessUser = getAccessUser();
 		ExamEntity examEntity = examRepo.findOne(examId);
 		if (null == examEntity) {
@@ -688,7 +688,7 @@ public class ExamController extends ControllerSupport {
 		}
 		validateRootOrgIsolation(examEntity.getRootOrgId());
 
-		ExamOrgEntity examOrgEntity = examOrgRepo.findByExamIdAndOrgId(examId,
+		ExamOrgSettingsEntity examOrgEntity = examOrgRepo.findByExamIdAndOrgId(examId,
 				accessUser.getOrgId());
 
 		return examOrgEntity;
@@ -703,7 +703,7 @@ public class ExamController extends ControllerSupport {
 	 */
 	@ApiOperation(value = "新增考试相关的学习中心设置", notes = "")
 	@PostMapping("examOrg")
-	public ExamOrgEntity addExamOrg(@RequestBody ExamOrgDomain domain) {
+	public ExamOrgSettingsEntity addExamOrg(@RequestBody ExamOrgSettingsDomain domain) {
 		return saveExamOrg(domain);
 	}
 
@@ -716,7 +716,7 @@ public class ExamController extends ControllerSupport {
 	 */
 	@ApiOperation(value = "更新考试相关的学习中心设置", notes = "")
 	@PutMapping("examOrg")
-	public ExamOrgEntity updateExamOrg(@RequestBody ExamOrgDomain domain) {
+	public ExamOrgSettingsEntity updateExamOrg(@RequestBody ExamOrgSettingsDomain domain) {
 		return saveExamOrg(domain);
 	}
 
@@ -727,7 +727,7 @@ public class ExamController extends ControllerSupport {
 	 * @param domain
 	 * @return
 	 */
-	private ExamOrgEntity saveExamOrg(ExamOrgDomain domain) {
+	private ExamOrgSettingsEntity saveExamOrg(ExamOrgSettingsDomain domain) {
 		Long examId = domain.getExamId();
 
 		ExamEntity examEntity = examRepo.findOne(examId);
@@ -746,7 +746,7 @@ public class ExamController extends ControllerSupport {
 		validateRootOrgIsolation(org.getRootId());
 
 		User accessUser = getAccessUser();
-		ExamOrgInfo info = new ExamOrgInfo();
+		ExamOrgSettingsInfo info = new ExamOrgSettingsInfo();
 		info.setId(domain.getId());
 		info.setBeginTime(domain.getBeginTime());
 		info.setEndTime(domain.getEndTime());
@@ -760,7 +760,7 @@ public class ExamController extends ControllerSupport {
 		}
 		info.setProperties(domain.getProperties());
 
-		ExamOrgEntity ret = examService.saveExamOrg(info);
+		ExamOrgSettingsEntity ret = examService.saveExamOrg(info);
 		return ret;
 	}
 

+ 2 - 7
examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/controller/bean/CourseGroupDomain.java → examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/controller/bean/ExamCourseGroupDomain.java

@@ -3,25 +3,20 @@ package cn.com.qmth.examcloud.core.examwork.api.controller.bean;
 import java.util.Date;
 import java.util.List;
 
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-
 import org.springframework.format.annotation.DateTimeFormat;
 
 import cn.com.qmth.examcloud.commons.web.cloud.api.JsonSerializable;
 
 /**
- * 课程组
+ * 考试--课程组
  * 
  * @author WANG
  *
  */
-public class CourseGroupDomain implements JsonSerializable {
+public class ExamCourseGroupDomain implements JsonSerializable {
 
 	private static final long serialVersionUID = -3335725218626631530L;
 
-	@Id
-	@GeneratedValue
 	private Long id;
 
 	private Long examId;

+ 2 - 2
examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/controller/bean/ExamOrgDomain.java → examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/controller/bean/ExamOrgSettingsDomain.java

@@ -6,13 +6,13 @@ import java.util.Map;
 import cn.com.qmth.examcloud.commons.web.cloud.api.JsonSerializable;
 
 /**
- * 考试机构设置
+ * 考试--机构设置
  *
  * @author WANGWEI
  * @date 2018年5月16日
  * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
  */
-public class ExamOrgDomain implements JsonSerializable {
+public class ExamOrgSettingsDomain implements JsonSerializable {
 
 	private static final long serialVersionUID = -3335725218626631530L;
 

+ 0 - 29
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/CourseGroupRelationRepo.java

@@ -1,29 +0,0 @@
-package cn.com.qmth.examcloud.core.examwork.dao;
-
-import java.util.List;
-
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.repository.query.QueryByExampleExecutor;
-
-import cn.com.qmth.examcloud.core.examwork.dao.entity.CourseGroupRelationEntity;
-import cn.com.qmth.examcloud.core.examwork.dao.entity.CourseGroupRelationPK;
-
-/**
- * 类注释
- *
- * @author WANGWEI
- * @date 2018年6月7日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public interface CourseGroupRelationRepo
-		extends
-			JpaRepository<CourseGroupRelationEntity, CourseGroupRelationPK>,
-			QueryByExampleExecutor<CourseGroupRelationEntity> {
-
-	List<CourseGroupRelationEntity> findAllByGroupId(Long groupId);
-
-	List<CourseGroupRelationEntity> findAllByCourseIdAndExamId(Long courseId, Long examId);
-
-	void deleteByGroupId(Long groupId);
-
-}

+ 0 - 27
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/CourseGroupRepo.java

@@ -1,27 +0,0 @@
-package cn.com.qmth.examcloud.core.examwork.dao;
-
-import java.util.List;
-
-import org.springframework.data.domain.Pageable;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.repository.query.QueryByExampleExecutor;
-
-import cn.com.qmth.examcloud.core.examwork.dao.entity.CourseGroupEntity;
-
-/**
- * 类注释
- *
- * @author WANGWEI
- * @date 2018年6月7日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public interface CourseGroupRepo
-		extends
-			JpaRepository<CourseGroupEntity, Long>,
-			QueryByExampleExecutor<CourseGroupEntity> {
-
-	List<CourseGroupEntity> findAllByExamId(Long examId, Pageable pageable);
-
-	List<CourseGroupEntity> findAllByIdInOrderByUpdateTimeDesc(List<Long> idList);
-
-}

+ 29 - 0
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/ExamCourseGroupRelationRepo.java

@@ -0,0 +1,29 @@
+package cn.com.qmth.examcloud.core.examwork.dao;
+
+import java.util.List;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.repository.query.QueryByExampleExecutor;
+
+import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamCourseGroupRelationEntity;
+import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamCourseGroupRelationPK;
+
+/**
+ * 类注释
+ *
+ * @author WANGWEI
+ * @date 2018年6月7日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public interface ExamCourseGroupRelationRepo
+		extends
+			JpaRepository<ExamCourseGroupRelationEntity, ExamCourseGroupRelationPK>,
+			QueryByExampleExecutor<ExamCourseGroupRelationEntity> {
+
+	List<ExamCourseGroupRelationEntity> findAllByGroupId(Long groupId);
+
+	List<ExamCourseGroupRelationEntity> findAllByCourseIdAndExamId(Long courseId, Long examId);
+
+	void deleteByGroupId(Long groupId);
+
+}

+ 27 - 0
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/ExamCourseGroupSettingsRepo.java

@@ -0,0 +1,27 @@
+package cn.com.qmth.examcloud.core.examwork.dao;
+
+import java.util.List;
+
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.repository.query.QueryByExampleExecutor;
+
+import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamCourseGroupSettingsEntity;
+
+/**
+ * 类注释
+ *
+ * @author WANGWEI
+ * @date 2018年6月7日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public interface ExamCourseGroupSettingsRepo
+		extends
+			JpaRepository<ExamCourseGroupSettingsEntity, Long>,
+			QueryByExampleExecutor<ExamCourseGroupSettingsEntity> {
+
+	List<ExamCourseGroupSettingsEntity> findAllByExamId(Long examId, Pageable pageable);
+
+	List<ExamCourseGroupSettingsEntity> findAllByIdInOrderByUpdateTimeDesc(List<Long> idList);
+
+}

+ 8 - 8
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/ExamOrgRepo.java → examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/ExamOrgSettingsRepo.java

@@ -7,24 +7,24 @@ import org.springframework.data.jpa.repository.Query;
 import org.springframework.data.repository.query.QueryByExampleExecutor;
 import org.springframework.transaction.annotation.Transactional;
 
-import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamOrgEntity;
+import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamOrgSettingsEntity;
 
-public interface ExamOrgRepo
+public interface ExamOrgSettingsRepo
 		extends
-			JpaRepository<ExamOrgEntity, Long>,
-			QueryByExampleExecutor<ExamOrgEntity>,
-			JpaSpecificationExecutor<ExamOrgEntity> {
+			JpaRepository<ExamOrgSettingsEntity, Long>,
+			QueryByExampleExecutor<ExamOrgSettingsEntity>,
+			JpaSpecificationExecutor<ExamOrgSettingsEntity> {
 
 	@Transactional
 	@Modifying
-	@Query("delete from ExamOrgEntity where examId = ?1")
+	@Query("delete from ExamOrgSettingsEntity where examId = ?1")
 	void deleteByExamId(Long examId);
 
 	@Transactional
 	@Modifying
-	@Query("delete from ExamOrgEntity where examId = ?1 and orgId = ?2")
+	@Query("delete from ExamOrgSettingsEntity where examId = ?1 and orgId = ?2")
 	void deleteByExamIdAndOrgId(Long examId, Long orgId);
 
-	ExamOrgEntity findByExamIdAndOrgId(Long examId, Long orgId);
+	ExamOrgSettingsEntity findByExamIdAndOrgId(Long examId, Long orgId);
 
 }

+ 2 - 2
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/CourseGroupRelationEntity.java → examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamCourseGroupRelationEntity.java

@@ -16,8 +16,8 @@ import cn.com.qmth.examcloud.commons.web.jpa.JpaEntity;
  */
 @Entity
 @Table(name = "EC_E_COURSE_GROUP_RELATION")
-@IdClass(CourseGroupRelationPK.class)
-public class CourseGroupRelationEntity extends JpaEntity {
+@IdClass(ExamCourseGroupRelationPK.class)
+public class ExamCourseGroupRelationEntity extends JpaEntity {
 
 	private static final long serialVersionUID = -3335725218626631530L;
 

+ 1 - 1
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/CourseGroupRelationPK.java → examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamCourseGroupRelationPK.java

@@ -8,7 +8,7 @@ import java.io.Serializable;
  * @author WANG
  *
  */
-public class CourseGroupRelationPK implements Serializable {
+public class ExamCourseGroupRelationPK implements Serializable {
 
 	private static final long serialVersionUID = 2741694459442340816L;
 

+ 3 - 3
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/CourseGroupEntity.java → examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamCourseGroupSettingsEntity.java

@@ -14,15 +14,15 @@ import org.springframework.format.annotation.DateTimeFormat;
 import cn.com.qmth.examcloud.commons.web.jpa.JpaEntity;
 
 /**
- * 课程组
+ * 考试--课程组设置
  * 
  * @author WANG
  *
  */
 @Entity
-@Table(name = "EC_E_COURSE_GROUP", indexes = {
+@Table(name = "EC_E_EXAM_CG_SETTINGS", indexes = {
 		@Index(name = "IDX_E_C_G_001001", columnList = "examId", unique = false)})
-public class CourseGroupEntity extends JpaEntity {
+public class ExamCourseGroupSettingsEntity extends JpaEntity {
 
 	private static final long serialVersionUID = -3335725218626631530L;
 

+ 1 - 1
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamOrgPropertyEntity.java

@@ -11,7 +11,7 @@ import javax.persistence.Table;
 import cn.com.qmth.examcloud.commons.web.jpa.JpaEntity;
 
 /**
- * 机构属性配置
+ * 考试--机构属性配置
  *
  * @author WANGWEI
  * @date 2018年8月6日

+ 4 - 4
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamOrgEntity.java → examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamOrgSettingsEntity.java

@@ -14,16 +14,16 @@ import org.springframework.format.annotation.DateTimeFormat;
 import cn.com.qmth.examcloud.commons.web.jpa.JpaEntity;
 
 /**
- * 考试机构设置
+ * 考试--机构特殊设置
  *
  * @author WANGWEI
  * @date 2018年5月16日
  * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
  */
 @Entity
-@Table(name = "EC_E_EXAM_ORG", indexes = {
-		@Index(name = "IDX_E_E_ORG_001001", columnList = "examId,orgId", unique = true)})
-public class ExamOrgEntity extends JpaEntity {
+@Table(name = "EC_E_EXAM_ORG_SETTINGS", indexes = {
+		@Index(name = "IDX_E_E_O_S_001001", columnList = "examId,orgId", unique = true)})
+public class ExamOrgSettingsEntity extends JpaEntity {
 
 	private static final long serialVersionUID = -3335725218626631530L;
 

+ 3 - 3
examcloud-core-examwork-service/src/main/java/cn/com/qmth/examcloud/core/examwork/service/ExamService.java

@@ -1,9 +1,9 @@
 package cn.com.qmth.examcloud.core.examwork.service;
 
 import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamEntity;
-import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamOrgEntity;
+import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamOrgSettingsEntity;
 import cn.com.qmth.examcloud.core.examwork.service.bean.ExamInfo;
-import cn.com.qmth.examcloud.core.examwork.service.bean.ExamOrgInfo;
+import cn.com.qmth.examcloud.core.examwork.service.bean.ExamOrgSettingsInfo;
 
 /**
  * 类注释
@@ -30,7 +30,7 @@ public interface ExamService {
 	 * @param examInfo
 	 * @return
 	 */
-	ExamOrgEntity saveExamOrg(ExamOrgInfo examOrgInfo);
+	ExamOrgSettingsEntity saveExamOrg(ExamOrgSettingsInfo examOrgInfo);
 
 	/**
 	 * 查询机构属性

+ 1 - 1
examcloud-core-examwork-service/src/main/java/cn/com/qmth/examcloud/core/examwork/service/bean/ExamOrgInfo.java → examcloud-core-examwork-service/src/main/java/cn/com/qmth/examcloud/core/examwork/service/bean/ExamOrgSettingsInfo.java

@@ -12,7 +12,7 @@ import cn.com.qmth.examcloud.commons.web.cloud.api.JsonSerializable;
  * @date 2018年5月16日
  * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
  */
-public class ExamOrgInfo implements JsonSerializable {
+public class ExamOrgSettingsInfo implements JsonSerializable {
 
 	private static final long serialVersionUID = -3335725218626631530L;
 

+ 8 - 8
examcloud-core-examwork-service/src/main/java/cn/com/qmth/examcloud/core/examwork/service/impl/ExamServiceImpl.java

@@ -16,16 +16,16 @@ import cn.com.qmth.examcloud.commons.base.exception.StatusException;
 import cn.com.qmth.examcloud.core.basic.api.OrgCloudService;
 import cn.com.qmth.examcloud.core.examwork.base.enums.ExamProperty;
 import cn.com.qmth.examcloud.core.examwork.dao.ExamOrgPropertyRepo;
-import cn.com.qmth.examcloud.core.examwork.dao.ExamOrgRepo;
+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.ExamOrgEntity;
+import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamOrgSettingsEntity;
 import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamOrgPropertyEntity;
 import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamPropertyEntity;
 import cn.com.qmth.examcloud.core.examwork.service.ExamService;
 import cn.com.qmth.examcloud.core.examwork.service.bean.ExamInfo;
-import cn.com.qmth.examcloud.core.examwork.service.bean.ExamOrgInfo;
+import cn.com.qmth.examcloud.core.examwork.service.bean.ExamOrgSettingsInfo;
 
 /**
  * 类注释
@@ -43,7 +43,7 @@ public class ExamServiceImpl implements ExamService {
 	ExamStudentServiceImpl examStudentService;
 
 	@Autowired
-	ExamOrgRepo examOrgRepo;
+	ExamOrgSettingsRepo examOrgRepo;
 
 	@Autowired
 	OrgCloudService orgCloudService;
@@ -197,14 +197,14 @@ public class ExamServiceImpl implements ExamService {
 	 * com.qmth.examcloud.core.examwork.service.bean.ExamOrgInfo)
 	 */
 	@Override
-	public ExamOrgEntity saveExamOrg(ExamOrgInfo examOrgInfo) {
-		ExamOrgEntity examOrgEntity = null;
+	public ExamOrgSettingsEntity saveExamOrg(ExamOrgSettingsInfo examOrgInfo) {
+		ExamOrgSettingsEntity examOrgEntity = null;
 
 		if (null == examOrgInfo.getId()) {
 			examOrgEntity = examOrgRepo.findByExamIdAndOrgId(examOrgInfo.getExamId(),
 					examOrgInfo.getOrgId());
 			if (null == examOrgEntity) {
-				examOrgEntity = new ExamOrgEntity();
+				examOrgEntity = new ExamOrgSettingsEntity();
 			}
 		} else {
 			examOrgEntity = examOrgRepo.findOne(examOrgInfo.getId());
@@ -221,7 +221,7 @@ public class ExamServiceImpl implements ExamService {
 
 		Map<ExamProperty, String> map = checkAndGetExamProperties(examOrgInfo.getProperties());
 
-		ExamOrgEntity saved = examOrgRepo.save(examOrgEntity);
+		ExamOrgSettingsEntity saved = examOrgRepo.save(examOrgEntity);
 
 		for (Entry<ExamProperty, String> entry : map.entrySet()) {
 			ExamProperty prop = entry.getKey();

+ 2 - 2
examcloud-core-examwork-service/src/main/java/cn/com/qmth/examcloud/core/examwork/service/impl/ExamStudentServiceImpl.java

@@ -22,7 +22,7 @@ import cn.com.qmth.examcloud.core.basic.api.request.SaveCourseReq;
 import cn.com.qmth.examcloud.core.basic.api.response.GetOrgResp;
 import cn.com.qmth.examcloud.core.basic.api.response.GetStudentResp;
 import cn.com.qmth.examcloud.core.basic.api.response.SaveCourseResp;
-import cn.com.qmth.examcloud.core.examwork.dao.ExamOrgRepo;
+import cn.com.qmth.examcloud.core.examwork.dao.ExamOrgSettingsRepo;
 import cn.com.qmth.examcloud.core.examwork.dao.ExamRepo;
 import cn.com.qmth.examcloud.core.examwork.dao.ExamStudentRepo;
 import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamEntity;
@@ -45,7 +45,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
 	ExamRepo examRepo;
 
 	@Autowired
-	ExamOrgRepo examOrgRepo;
+	ExamOrgSettingsRepo examOrgRepo;
 
 	@Autowired
 	OrgCloudService orgCloudService;