wangwei 6 years ago
parent
commit
726114bbcf

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

@@ -1,56 +0,0 @@
-package cn.com.qmth.examcloud.core.examwork.api.controller;
-
-import cn.com.qmth.examcloud.core.examwork.dao.ExamStudentRepo;
-import cn.com.qmth.examcloud.core.examwork.dao.bean.ExamPaperTypeDTO;
-import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamStudent;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.ArrayList;
-import java.util.List;
-/**
- * Created by yuanpan on 2017/4/12.
- */
-@Transactional
-@RestController
-@RequestMapping("${$rmp.ctr.examwork}/exam_paper_type")
-public class ExamPaperTypController {
-
-    @Autowired
-    ExamStudentRepo examStudentRepo;
-
-
-    @ApiOperation(value="根据考试获取试卷类型",notes = "获取试卷类型")
-    @GetMapping
-    public List<ExamPaperTypeDTO> query(@RequestParam("exam_id") Long examId,
-                                        @RequestParam("course_no") String courseNo) {
-
-
-        List<ExamStudent> examStudents = examStudentRepo.findDistinctPaperType(examId,courseNo);
-
-        List<ExamPaperTypeDTO> examPaperTypeDTOs = new ArrayList<ExamPaperTypeDTO>();
-
-        for(ExamStudent examStudent:examStudents){
-            ExamPaperTypeDTO examPaperTypeDTO = new ExamPaperTypeDTO();
-            examPaperTypeDTO.setCode(examStudent.getPaperType());
-            examPaperTypeDTO.setName(examStudent.getPaperType());
-            examPaperTypeDTO.setExamId(examId);
-            examPaperTypeDTOs.add(examPaperTypeDTO);
-        }
-
-        if(examStudents == null || examStudents.size() == 0){
-            ExamPaperTypeDTO examPaperTypeDTO = new ExamPaperTypeDTO();
-            examPaperTypeDTO.setCode("O");
-            examPaperTypeDTO.setName("O");
-            examPaperTypeDTO.setExamId(examId);
-            examPaperTypeDTOs.add(examPaperTypeDTO);
-        }
-        return examPaperTypeDTOs;
-    }
-
-}

+ 0 - 52
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/ExamStudentRepo.java

@@ -2,15 +2,11 @@ package cn.com.qmth.examcloud.core.examwork.dao;
 
 import java.util.List;
 
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.Pageable;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.data.jpa.repository.Modifying;
 import org.springframework.data.jpa.repository.Query;
-import org.springframework.data.repository.query.Param;
 import org.springframework.data.repository.query.QueryByExampleExecutor;
-import org.springframework.transaction.annotation.Transactional;
 
 import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamStudent;
 
@@ -19,62 +15,14 @@ public interface ExamStudentRepo
 			JpaRepository<ExamStudent, Long>,
 			QueryByExampleExecutor<ExamStudent>,
 			JpaSpecificationExecutor<ExamStudent> {
-	Page<ExamStudent> findByExamId(Long examId, Pageable pageable);
-
-	List<ExamStudent> findByExamId(Long examId);
 
 	List<ExamStudent> findByStudentId(Long examId);
 
-	@Query("select s from ExamStudent s where s.exam.id=?1 group by s.courseCode order by s.courseCode")
-	List<ExamStudent> findDistinctCourseCode(Long examId);
-
-	@Query("select s from ExamStudent s where s.exam.id=?1 and s.courseCode = ?2 group by s.courseCode order by s.courseCode")
-	List<ExamStudent> findDistinctCourseCode(Long examId, String courseCode);
-
-	@Query("select s from ExamStudent s where s.exam.id=?1 group by s.courseCode order by s.courseCode")
-	Page<ExamStudent> findDistinctCourseCode(Long examId, Pageable pageable);
-
-	@Query("select s from ExamStudent s where s.exam.id=?1 and s.courseCode = ?2 group by s.courseCode order by s.courseCode")
-	Page<ExamStudent> findDistinctCourseCode(Long examId, String courseCode, Pageable pageable);
-
 	List<ExamStudent> findByIdIn(List<Long> ids);
 
-	@Query("select s from ExamStudent s where s.exam.id=?1 and s.courseCode =?2 group by s.paperType")
-	List<ExamStudent> findDistinctPaperType(Long examId, String courseCode);
-
-	@Query("select s from ExamStudent s where s.exam.id = ?1 and s.courseCode = ?2 and (s.studentCode = ?3 or s.identityNumber = ?3)")
-	ExamStudent findFirstByExamId(Long examId, String courseCode, String stuNumber);
-
-	@Query("select count(s) from ExamStudent s where s.exam.id = ?1 and s.rootOrgId=?2 and s.identityNumber=?3 and s.courseCode=?4 and s.id <> ?5")
-	int checkExamStuById(Long examId, Long rootOrgId, String identityNumber, String courseCode,
-			Long id);
-
-	@Query("select count(s) from ExamStudent s where s.exam.id = ?1 and s.rootOrgId=?2 and s.identityNumber=?3 and s.courseCode=?4")
-	int checkExamStu(Long examId, Long rootOrgId, String identityNumber, String courseCode);
-
-	@Transactional
-	@Modifying
-	@Query("update ExamStudent s set s.name = ?2,s.specialtyName  = ?3,s.examSite = ?4  where s.identityNumber = ?1")
-	void updateById(String identityNumber, String name, String specialtyName, String examSite);
-
-	@Query("select s from ExamStudent s where s.rootOrgId=?1 and s.courseCode=?2")
-	List<ExamStudent> findByCourseCode(Long rootOrgId, String courseCode);
-
-	List<ExamStudent> findByOrgId(Long orgId);
-
 	@Modifying
 	@Query("delete from ExamStudent s where s.exam.id = ?1")
 	void deleteByExamId(Long examId);
 
-	@Query(nativeQuery = true, value = "select org_id, org_name, finished, count(id) from ecs_exam_student  where exam_id = :examId group by org_id, org_name, finished")
-	List<Object[]> countByCampusAndFinished(@Param("examId") Long examId);
-
-	@Modifying
-	@Query("update ExamStudent e set e.finished = ?2 where e.id = ?1")
-	void updateForFinished(Long id, Boolean finished);
-
-	@Query(value = "SELECT * FROM ecs_exam_student t WHERE t.exam_id = ?1 order by id desc limit ?2,?3 ", nativeQuery = true)
-	public List<ExamStudent> findByLimit(Long examId, Integer startLimit, Integer endLimit);
-
 	ExamStudent findByExamIdAndStudentIdAndCourseId(Long examId, Long studentId, Long courseId);
 }

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

@@ -1,35 +0,0 @@
-package cn.com.qmth.examcloud.core.examwork.dao.bean;
-
-/**
- * Created by yuanpan on 2017/4/12.
- */
-public class ExamPaperTypeDTO {
-
-    private Long examId;
-    private String code;
-    private String name;
-
-    public Long getExamId() {
-        return examId;
-    }
-
-    public void setExamId(Long examId) {
-        this.examId = examId;
-    }
-
-    public String getCode() {
-        return code;
-    }
-
-    public void setCode(String code) {
-        this.code = code;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-}