WANG 6 anni fa
parent
commit
f69a8c6310

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

@@ -29,7 +29,6 @@ import org.springframework.data.domain.Sort;
 import org.springframework.data.domain.Sort.Direction;
 import org.springframework.data.jpa.domain.Specification;
 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.ModelAttribute;
 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.GetOrgsResp;
 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.ExamOrgSettingsDomain;
 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.ExamOrgPropertyRepo;
 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.ExamSpecialSettingsRepo;
 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.ExamEntity;
 import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamOrgPropertyEntity;
@@ -137,15 +131,9 @@ public class ExamController extends ControllerSupport {
 	@Autowired
 	ExamStudentServiceImpl examStudentService;
 
-	@Autowired
-	ExamCourseGroupSettingsRepo examCourseGroupSettingsRepo;
-
 	@Autowired
 	ExamSpecialSettingsRepo examSpecialSettingsRepo;
 
-	@Autowired
-	ExamCourseGroupRelationRepo examCourseGroupRelationRepo;
-
 	@Autowired
 	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);
-	}
-
 	/**
 	 * 方法注释
 	 *

+ 0 - 29
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/ExamCourseGroupRelationRepo.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.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);
-
-}

+ 0 - 27
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/ExamCourseGroupSettingsRepo.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.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);
-
-}

+ 0 - 57
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamCourseGroupRelationEntity.java

@@ -1,57 +0,0 @@
-package cn.com.qmth.examcloud.core.examwork.dao.entity;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.IdClass;
-import javax.persistence.Table;
-
-import cn.com.qmth.examcloud.web.jpa.JpaEntity;
-
-/**
- * 课程组关联课程
- * 
- * @author WANG
- *
- */
-@Entity
-@Table(name = "EC_E_COURSE_GROUP_RELATION")
-@IdClass(ExamCourseGroupRelationPK.class)
-public class ExamCourseGroupRelationEntity extends JpaEntity {
-
-	private static final long serialVersionUID = -3335725218626631530L;
-
-	@Id
-	private Long courseId;
-
-	@Id
-	private Long groupId;
-
-	@Column(nullable = false)
-	private Long examId;
-
-	public Long getCourseId() {
-		return courseId;
-	}
-
-	public void setCourseId(Long courseId) {
-		this.courseId = courseId;
-	}
-
-	public Long getGroupId() {
-		return groupId;
-	}
-
-	public void setGroupId(Long groupId) {
-		this.groupId = groupId;
-	}
-
-	public Long getExamId() {
-		return examId;
-	}
-
-	public void setExamId(Long examId) {
-		this.examId = examId;
-	}
-
-}

+ 0 - 35
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamCourseGroupRelationPK.java

@@ -1,35 +0,0 @@
-package cn.com.qmth.examcloud.core.examwork.dao.entity;
-
-import java.io.Serializable;
-
-/**
- * 课程组关联课程 主键
- * 
- * @author WANG
- *
- */
-public class ExamCourseGroupRelationPK implements Serializable {
-
-	private static final long serialVersionUID = 2741694459442340816L;
-
-	private Long courseId;
-
-	private Long groupId;
-
-	public Long getCourseId() {
-		return courseId;
-	}
-
-	public void setCourseId(Long courseId) {
-		this.courseId = courseId;
-	}
-
-	public Long getGroupId() {
-		return groupId;
-	}
-
-	public void setGroupId(Long groupId) {
-		this.groupId = groupId;
-	}
-
-}

+ 0 - 102
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamCourseGroupSettingsEntity.java

@@ -1,102 +0,0 @@
-package cn.com.qmth.examcloud.core.examwork.dao.entity;
-
-import java.util.Date;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Index;
-import javax.persistence.Table;
-
-import org.springframework.format.annotation.DateTimeFormat;
-
-import cn.com.qmth.examcloud.web.jpa.JpaEntity;
-
-/**
- * 考试--课程组设置
- * 
- * @author WANG
- *
- */
-@Entity
-@Table(name = "EC_E_EXAM_CG_SETTINGS", indexes = {
-		@Index(name = "IDX_E_C_G_001001", columnList = "examId", unique = false)})
-public class ExamCourseGroupSettingsEntity extends JpaEntity {
-
-	private static final long serialVersionUID = -3335725218626631530L;
-
-	@Id
-	@GeneratedValue(strategy = GenerationType.IDENTITY)
-	private Long id;
-
-	@Column(nullable = false)
-	private Long examId;
-
-	@Column(nullable = false)
-	private String name;
-
-	private String description;
-
-	/**
-	 * 考试批次开始时间
-	 */
-	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-	private Date beginTime;
-
-	/**
-	 * 考试批次结束时间
-	 */
-	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-	private Date endTime;
-
-	public Long getId() {
-		return id;
-	}
-
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	public Long getExamId() {
-		return examId;
-	}
-
-	public void setExamId(Long examId) {
-		this.examId = examId;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	public String getDescription() {
-		return description;
-	}
-
-	public void setDescription(String description) {
-		this.description = description;
-	}
-
-	public Date getBeginTime() {
-		return beginTime;
-	}
-
-	public void setBeginTime(Date beginTime) {
-		this.beginTime = beginTime;
-	}
-
-	public Date getEndTime() {
-		return endTime;
-	}
-
-	public void setEndTime(Date endTime) {
-		this.endTime = endTime;
-	}
-
-}