|
@@ -1,181 +0,0 @@
|
|
|
-package cn.com.qmth.scancentral.controller.admin;
|
|
|
-
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-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 com.qmth.boot.api.constant.ApiConstant;
|
|
|
-import com.qmth.boot.core.exception.ParameterException;
|
|
|
-
|
|
|
-import cn.com.qmth.scancentral.bean.ImportCetAbsentDomain;
|
|
|
-import cn.com.qmth.scancentral.bean.ImportExamDomain;
|
|
|
-import cn.com.qmth.scancentral.bean.ImportStudentDomain;
|
|
|
-import cn.com.qmth.scancentral.bean.ImportSubjectDomain;
|
|
|
-import cn.com.qmth.scancentral.bean.ImportUserDomain;
|
|
|
-import cn.com.qmth.scancentral.controller.BaseController;
|
|
|
-import cn.com.qmth.scancentral.entity.ExamEntity;
|
|
|
-import cn.com.qmth.scancentral.entity.QuestionEntity;
|
|
|
-import cn.com.qmth.scancentral.entity.SubjectEntity;
|
|
|
-import cn.com.qmth.scancentral.service.ExamService;
|
|
|
-import cn.com.qmth.scancentral.service.QuestionService;
|
|
|
-import cn.com.qmth.scancentral.service.StudentService;
|
|
|
-import cn.com.qmth.scancentral.service.SubjectService;
|
|
|
-import cn.com.qmth.scancentral.service.UserService;
|
|
|
-import cn.com.qmth.scancentral.vo.CountVo;
|
|
|
-import cn.com.qmth.scancentral.vo.ExportCetMarkingQueryVo;
|
|
|
-import cn.com.qmth.scancentral.vo.ExportCetVo;
|
|
|
-import cn.com.qmth.scancentral.vo.ImportExamVo;
|
|
|
-import cn.com.qmth.scancentral.vo.ImportStudentQueryVo;
|
|
|
-import cn.com.qmth.scancentral.vo.ImportStudentVo;
|
|
|
-import cn.com.qmth.scancentral.vo.SubjectCheckVo;
|
|
|
-import io.swagger.annotations.Api;
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
-
|
|
|
-@RestController
|
|
|
-@Api(tags = "本地工具接口")
|
|
|
-@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/tool")
|
|
|
-public class ToolController extends BaseController {
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private UserService userService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ExamService examService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private StudentService studentService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private SubjectService subjectService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private QuestionService questionService;
|
|
|
-
|
|
|
- @ApiOperation(value = "批量创建管理员用户接口")
|
|
|
- @PostMapping("/import/user")
|
|
|
- public CountVo importUser(@RequestBody List<ImportUserDomain> users) {
|
|
|
- return new CountVo(userService.importUser(users));
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "创建考试接口")
|
|
|
- @PostMapping("/import/exam")
|
|
|
- public ImportExamVo importExam(@RequestBody ImportExamDomain exam) {
|
|
|
- return new ImportExamVo(examService.save(exam).getId());
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "批量创建科目接口")
|
|
|
- @PostMapping("/import/course")
|
|
|
- public CountVo importCourse(@RequestBody List<ImportSubjectDomain> subjects) {
|
|
|
- return new CountVo(subjectService.importSubject(subjects));
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "批量新建考生接口")
|
|
|
- @PostMapping("/import/exam/student")
|
|
|
- public CountVo importStudent(@RequestBody List<ImportStudentDomain> students) {
|
|
|
- return new CountVo(studentService.importStudent(students));
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "查询考生数量接口")
|
|
|
- @PostMapping("/exam/student/count")
|
|
|
- public CountVo countStudent(@RequestBody ImportStudentQueryVo query) {
|
|
|
- return new CountVo(studentService.countByQuery(query));
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "分页查询考生接口")
|
|
|
- @PostMapping("/exam/student/find")
|
|
|
- public List<ImportStudentVo> findStudent(@RequestBody ImportStudentQueryVo query) {
|
|
|
- return studentService.findByQuery(query);
|
|
|
- }
|
|
|
-
|
|
|
- // @ApiOperation(value = "检查并修复考生导出图片接口")
|
|
|
- // @PostMapping("/exam/student/check")
|
|
|
- // public void studentCheck(@RequestParam Long studentId) {
|
|
|
- // toolExportService.studentCheck(studentId);
|
|
|
- // }
|
|
|
-
|
|
|
- @ApiOperation(value = "获取考试详情")
|
|
|
- @RequestMapping(value = "/exam/info", method = RequestMethod.POST)
|
|
|
- public ExamEntity examInfo(@RequestParam Long examId) {
|
|
|
- return examService.getById(examId);
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "获取科目详情")
|
|
|
- @RequestMapping(value = "/exam/subject/info", method = RequestMethod.POST)
|
|
|
- public SubjectEntity subjectInfo(@RequestBody SubjectCheckVo query) {
|
|
|
- Long examId = query.getExamId();
|
|
|
- String code = query.getSubjectCode();
|
|
|
- if (examId == null) {
|
|
|
- throw new ParameterException("examId 不能为空");
|
|
|
- }
|
|
|
- if (StringUtils.isBlank(code)) {
|
|
|
- throw new ParameterException("subjectCode 不能为空");
|
|
|
- }
|
|
|
- return subjectService.findByExamIdAndCode(examId, code);
|
|
|
- }
|
|
|
-
|
|
|
- // @ApiOperation(value = "清空考生数据")
|
|
|
- // @RequestMapping(value = "/exam/student/clean", method =
|
|
|
- // RequestMethod.POST)
|
|
|
- // public void studentClean(@RequestParam Long examId) {
|
|
|
- // studentService.studentClean(examId);
|
|
|
- // }
|
|
|
-
|
|
|
- @ApiOperation(value = "cet导入违纪接口")
|
|
|
- @PostMapping("/import/cet/breach")
|
|
|
- public CountVo importCetAbsent(@RequestBody List<ImportCetAbsentDomain> students) {
|
|
|
- return new CountVo(studentService.importCetAbsent(students));
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "cet导出扫描结果和评卷分配数据")
|
|
|
- @PostMapping("/export/cet/data")
|
|
|
- public List<ExportCetVo> exportCetData(@RequestBody ExportCetMarkingQueryVo query) {
|
|
|
- return studentService.exportCetData(query);
|
|
|
- }
|
|
|
-
|
|
|
- // @ApiOperation(value = "查询试卷结构")
|
|
|
- // @PostMapping("/import/question/query")
|
|
|
- // public List<QuestionEntity> questionQuery(@RequestParam Long examId,
|
|
|
- // @RequestParam String subjectCode) {
|
|
|
- // return questionService.findByExamIdAndSubjectCode(examId, subjectCode);
|
|
|
- // }
|
|
|
-
|
|
|
- @ApiOperation(value = "保存试卷结构")
|
|
|
- @PostMapping("/import/question/save")
|
|
|
- public CountVo importQuestion(@RequestBody List<QuestionEntity> questionList) {
|
|
|
- return new CountVo(questionService.importQuestion(questionList));
|
|
|
- }
|
|
|
-
|
|
|
- // @ApiOperation(value = "保存卡格式")
|
|
|
- // @PostMapping("/import/card/save")
|
|
|
- // public Integer importCard(@RequestParam Long examId, @RequestParam String
|
|
|
- // subjectCode,
|
|
|
- // @RequestParam Integer paperCount, @RequestParam Boolean singlePage,
|
|
|
- // @RequestParam String md5,
|
|
|
- // @RequestParam(required = false) Integer dpi, @RequestParam MultipartFile
|
|
|
- // file) {
|
|
|
- // if (!SystemMode.STANDALONE.equals(SystemMode.current())) {
|
|
|
- // throw new ParameterException("非独立模式不可调用");
|
|
|
- // }
|
|
|
- // if (concurrentService.getLock(LockType.CARD_SYNC + "-" +
|
|
|
- // examId).tryLock()) {
|
|
|
- // try {
|
|
|
- // AnswerCardEntity card = answerCardService.save(null, examId, null,
|
|
|
- // subjectCode, null, null, paperCount,
|
|
|
- // singlePage, md5, dpi, file);
|
|
|
- // return card.getNumber();
|
|
|
- // } finally {
|
|
|
- // concurrentService.getLock(LockType.CARD_SYNC + "-" + examId).unlock();
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // throw new ReentrantException("正在同步卡格式,请稍后再试");
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
-}
|