|
@@ -29,7 +29,6 @@ import org.springframework.data.domain.Sort;
|
|
import org.springframework.data.domain.Sort.Direction;
|
|
import org.springframework.data.domain.Sort.Direction;
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
-import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
@@ -67,12 +66,9 @@ import cn.com.qmth.examcloud.core.basic.api.request.GetStudentReq;
|
|
import cn.com.qmth.examcloud.core.basic.api.response.GetOrgResp;
|
|
import cn.com.qmth.examcloud.core.basic.api.response.GetOrgResp;
|
|
import cn.com.qmth.examcloud.core.basic.api.response.GetOrgsResp;
|
|
import cn.com.qmth.examcloud.core.basic.api.response.GetOrgsResp;
|
|
import cn.com.qmth.examcloud.core.basic.api.response.GetStudentResp;
|
|
import cn.com.qmth.examcloud.core.basic.api.response.GetStudentResp;
|
|
-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.ExamDomain;
|
|
import cn.com.qmth.examcloud.core.examwork.api.controller.bean.ExamOrgSettingsDomain;
|
|
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.base.enums.ExamProperty;
|
|
-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.ExamCourseRelationRepo;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamCourseRelationRepo;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamOrgPropertyRepo;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamOrgPropertyRepo;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamPaperTypeRelationRepo;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamPaperTypeRelationRepo;
|
|
@@ -80,8 +76,6 @@ 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.ExamRepo;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamSpecialSettingsRepo;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamSpecialSettingsRepo;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamStudentRepo;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamStudentRepo;
|
|
-import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamCourseGroupRelationEntity;
|
|
|
|
-import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamCourseGroupSettingsEntity;
|
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamCourseRelationEntity;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamCourseRelationEntity;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamEntity;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamEntity;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamOrgPropertyEntity;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamOrgPropertyEntity;
|
|
@@ -137,15 +131,9 @@ public class ExamController extends ControllerSupport {
|
|
@Autowired
|
|
@Autowired
|
|
ExamStudentServiceImpl examStudentService;
|
|
ExamStudentServiceImpl examStudentService;
|
|
|
|
|
|
- @Autowired
|
|
|
|
- ExamCourseGroupSettingsRepo examCourseGroupSettingsRepo;
|
|
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
ExamSpecialSettingsRepo examSpecialSettingsRepo;
|
|
ExamSpecialSettingsRepo examSpecialSettingsRepo;
|
|
|
|
|
|
- @Autowired
|
|
|
|
- ExamCourseGroupRelationRepo examCourseGroupRelationRepo;
|
|
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
OrgCloudService orgCloudService;
|
|
OrgCloudService orgCloudService;
|
|
|
|
|
|
@@ -773,158 +761,6 @@ public class ExamController extends ControllerSupport {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 方法注释
|
|
|
|
- *
|
|
|
|
- * @author WANGWEI
|
|
|
|
- * @param examId
|
|
|
|
- * @param curPage
|
|
|
|
- * @param pageSize
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- @ApiOperation(value = "查询课程组集合", notes = "")
|
|
|
|
- @GetMapping("getCourseGroupListByExamId/{examId}/{curPage}/{pageSize}")
|
|
|
|
- public List<ExamCourseGroupDomain> getCourseGroupListByExamId(@PathVariable Long examId,
|
|
|
|
- @PathVariable Integer curPage, @PathVariable Integer pageSize) {
|
|
|
|
-
|
|
|
|
- Pageable pageable = PageRequest.of(curPage - 1, pageSize, Sort.Direction.DESC,
|
|
|
|
- "updateTime");
|
|
|
|
- List<ExamCourseGroupSettingsEntity> groupList = examCourseGroupSettingsRepo
|
|
|
|
- .findAllByExamId(examId, pageable);
|
|
|
|
-
|
|
|
|
- List<ExamCourseGroupDomain> ret = Lists.newArrayList();
|
|
|
|
-
|
|
|
|
- for (ExamCourseGroupSettingsEntity curCourseGroup : groupList) {
|
|
|
|
- ExamCourseGroupDomain bean = new ExamCourseGroupDomain();
|
|
|
|
- bean.setBeginTime(curCourseGroup.getBeginTime());
|
|
|
|
- bean.setCreationTime(curCourseGroup.getCreationTime());
|
|
|
|
- bean.setDescription(curCourseGroup.getDescription());
|
|
|
|
- bean.setEndTime(curCourseGroup.getEndTime());
|
|
|
|
- bean.setExamId(curCourseGroup.getExamId());
|
|
|
|
- bean.setId(curCourseGroup.getId());
|
|
|
|
- bean.setName(curCourseGroup.getName());
|
|
|
|
- bean.setUpdateTime(curCourseGroup.getUpdateTime());
|
|
|
|
-
|
|
|
|
- List<Long> courseIdList = Lists.newArrayList();
|
|
|
|
- bean.setCourseIdList(courseIdList);
|
|
|
|
-
|
|
|
|
- List<ExamCourseGroupRelationEntity> relationList = examCourseGroupRelationRepo
|
|
|
|
- .findAllByGroupId(bean.getId());
|
|
|
|
-
|
|
|
|
- for (ExamCourseGroupRelationEntity cur : relationList) {
|
|
|
|
- courseIdList.add(cur.getCourseId());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- ret.add(bean);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return ret;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 方法注释
|
|
|
|
- *
|
|
|
|
- * @author WANGWEI
|
|
|
|
- * @param examId
|
|
|
|
- * @param courseId
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- @ApiOperation(value = "通过课程ID查询课程组集合", notes = "")
|
|
|
|
- @GetMapping("getCourseGroupListByExamIdAndCourseId/{examId}/{courseId}")
|
|
|
|
- public List<ExamCourseGroupDomain> getCourseGroupListByExamIdAndCourseId(
|
|
|
|
- @PathVariable Long examId, @PathVariable Long courseId) {
|
|
|
|
-
|
|
|
|
- List<ExamCourseGroupRelationEntity> relationList = examCourseGroupRelationRepo
|
|
|
|
- .findAllByCourseIdAndExamId(courseId, examId);
|
|
|
|
-
|
|
|
|
- List<Long> groupIdList = Lists.newArrayList();
|
|
|
|
- for (ExamCourseGroupRelationEntity cur : relationList) {
|
|
|
|
- Long groupId = cur.getGroupId();
|
|
|
|
- groupIdList.add(groupId);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- List<ExamCourseGroupSettingsEntity> groupList = examCourseGroupSettingsRepo
|
|
|
|
- .findAllByIdInOrderByUpdateTimeDesc(groupIdList);
|
|
|
|
-
|
|
|
|
- List<ExamCourseGroupDomain> ret = Lists.newArrayList();
|
|
|
|
-
|
|
|
|
- for (ExamCourseGroupSettingsEntity curCourseGroup : groupList) {
|
|
|
|
- ExamCourseGroupDomain bean = new ExamCourseGroupDomain();
|
|
|
|
- bean.setBeginTime(curCourseGroup.getBeginTime());
|
|
|
|
- bean.setCreationTime(curCourseGroup.getCreationTime());
|
|
|
|
- bean.setDescription(curCourseGroup.getDescription());
|
|
|
|
- bean.setEndTime(curCourseGroup.getEndTime());
|
|
|
|
- bean.setExamId(curCourseGroup.getExamId());
|
|
|
|
- bean.setId(curCourseGroup.getId());
|
|
|
|
- bean.setName(curCourseGroup.getName());
|
|
|
|
- bean.setUpdateTime(curCourseGroup.getUpdateTime());
|
|
|
|
-
|
|
|
|
- List<Long> courseIdList = Lists.newArrayList();
|
|
|
|
- bean.setCourseIdList(courseIdList);
|
|
|
|
-
|
|
|
|
- List<ExamCourseGroupRelationEntity> curRelationList = examCourseGroupRelationRepo
|
|
|
|
- .findAllByGroupId(bean.getId());
|
|
|
|
-
|
|
|
|
- for (ExamCourseGroupRelationEntity cur : curRelationList) {
|
|
|
|
- courseIdList.add(cur.getCourseId());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return ret;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 方法注释
|
|
|
|
- *
|
|
|
|
- * @author WANGWEI
|
|
|
|
- * @param courseGroupBean
|
|
|
|
- * @param request
|
|
|
|
- */
|
|
|
|
- @ApiOperation(value = "更新课程组", notes = "")
|
|
|
|
- @PutMapping("courseGroup")
|
|
|
|
- public void updateCourseGroup(@RequestBody ExamCourseGroupDomain courseGroupBean,
|
|
|
|
- HttpServletRequest request) {
|
|
|
|
-
|
|
|
|
- ExamCourseGroupSettingsEntity courseGroup = new ExamCourseGroupSettingsEntity();
|
|
|
|
- courseGroup.setBeginTime(courseGroupBean.getBeginTime());
|
|
|
|
- courseGroup.setCreationTime(courseGroupBean.getCreationTime());
|
|
|
|
- courseGroup.setDescription(courseGroupBean.getDescription());
|
|
|
|
- courseGroup.setEndTime(courseGroupBean.getEndTime());
|
|
|
|
- courseGroup.setExamId(courseGroupBean.getExamId());
|
|
|
|
- courseGroup.setId(courseGroupBean.getId());
|
|
|
|
- courseGroup.setName(courseGroupBean.getName());
|
|
|
|
- courseGroup.setUpdateTime(courseGroupBean.getUpdateTime());
|
|
|
|
-
|
|
|
|
- examCourseGroupSettingsRepo.save(courseGroup);
|
|
|
|
- List<Long> courseIdList = courseGroupBean.getCourseIdList();
|
|
|
|
-
|
|
|
|
- List<ExamCourseGroupRelationEntity> relationList = Lists.newArrayList();
|
|
|
|
-
|
|
|
|
- examCourseGroupRelationRepo.deleteByGroupId(courseGroup.getId());
|
|
|
|
-
|
|
|
|
- for (Long cur : courseIdList) {
|
|
|
|
- ExamCourseGroupRelationEntity relation = new ExamCourseGroupRelationEntity();
|
|
|
|
- relation.setCourseId(cur);
|
|
|
|
- relation.setExamId(courseGroupBean.getExamId());
|
|
|
|
- relation.setGroupId(courseGroup.getId());
|
|
|
|
- relationList.add(relation);
|
|
|
|
- }
|
|
|
|
- examCourseGroupRelationRepo.saveAll(relationList);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 方法注释
|
|
|
|
- *
|
|
|
|
- * @author WANGWEI
|
|
|
|
- * @param id
|
|
|
|
- */
|
|
|
|
- @ApiOperation(value = "删除课程组", notes = "")
|
|
|
|
- @DeleteMapping("courseGroup/{id}")
|
|
|
|
- public void deleteCourseGroup(@PathVariable Long id) {
|
|
|
|
- examCourseGroupSettingsRepo.deleteById(id);
|
|
|
|
- examCourseGroupRelationRepo.deleteByGroupId(id);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 方法注释
|
|
* 方法注释
|
|
*
|
|
*
|