123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- package cn.com.qmth.print.manage.controller;
- import cn.com.qmth.print.manage.entity.ExamStudentEntity;
- import cn.com.qmth.print.manage.enums.GroupType;
- import cn.com.qmth.print.manage.enums.RecordStatus;
- import cn.com.qmth.print.manage.enums.dto.EnumDto;
- import cn.com.qmth.print.manage.service.ExamStudentService;
- import cn.com.qmth.print.manage.utils.result.ResultUtil;
- import com.qmth.boot.api.constant.ApiConstant;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.util.CollectionUtils;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestMethod;
- import org.springframework.web.bind.annotation.RequestParam;
- import org.springframework.web.bind.annotation.RestController;
- import java.util.ArrayList;
- import java.util.List;
- import java.util.stream.Collectors;
- /**
- * @Date: 2021/11/16.
- */
- @RestController
- @RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/condition")
- public class ConditionController {
- @Autowired
- private ExamStudentService examStudentService;
- /**
- * 分组字段列表
- *
- * @return
- */
- @RequestMapping(value = "/list_group_type", method = RequestMethod.POST)
- public Object listGroupType() {
- return GroupType.listGroupType();
- }
- /**
- * 状态列表
- *
- * @return
- */
- @RequestMapping(value = "/list_record_status", method = RequestMethod.POST)
- public Object listRecordStatus() {
- return RecordStatus.listRecordStatus();
- }
- /**
- * 准考证列表
- *
- * @param examId 批次ID
- * @return
- */
- @RequestMapping(value = "/list_exam_number", method = RequestMethod.POST)
- public Object listExamNumber(@RequestParam Long examId) {
- List<ExamStudentEntity> studentEntityList = examStudentService.listByExamId(examId);
- List<String> examNumberList = new ArrayList<>();
- if (!CollectionUtils.isEmpty(studentEntityList)) {
- examNumberList = studentEntityList.stream().map(m -> m.getExamNumber()).distinct().collect(Collectors.toList());
- }
- return examNumberList;
- }
- /**
- * 科目列表
- *
- * @param examId 批次ID
- * @return
- */
- @RequestMapping(value = "/list_course_code", method = RequestMethod.POST)
- public Object listCourseCode(@RequestParam Long examId) {
- List<ExamStudentEntity> studentEntityList = examStudentService.listByExamId(examId);
- List<String> courseCodeList = new ArrayList<>();
- if (!CollectionUtils.isEmpty(studentEntityList)) {
- courseCodeList = studentEntityList.stream().map(m -> m.getCourseCode()).distinct().collect(Collectors.toList());
- }
- return courseCodeList;
- }
- /**
- * 考点列表
- *
- * @param examId 批次ID
- * @return
- */
- @RequestMapping(value = "/list_exam_site", method = RequestMethod.POST)
- public Object listExamSite(@RequestParam Long examId) {
- List<ExamStudentEntity> studentEntityList = examStudentService.listByExamId(examId);
- List<String> examSiteList = new ArrayList<>();
- if (!CollectionUtils.isEmpty(studentEntityList)) {
- examSiteList = studentEntityList.stream().map(m -> m.getExamSite()).distinct().collect(Collectors.toList());
- }
- return examSiteList;
- }
- /**
- * 考场列表
- *
- * @param examId 批次ID
- * @return
- */
- @RequestMapping(value = "/list_exam_room", method = RequestMethod.POST)
- public Object listExamRoom(@RequestParam Long examId) {
- List<ExamStudentEntity> studentEntityList = examStudentService.listByExamId(examId);
- List<String> examRoomList = new ArrayList<>();
- if (!CollectionUtils.isEmpty(studentEntityList)) {
- examRoomList = studentEntityList.stream().map(m -> m.getExamRoom()).distinct().collect(Collectors.toList());
- }
- return examRoomList;
- }
- }
|