|
@@ -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;
|
|
|
}
|
|
|
|