|
@@ -1,27 +1,42 @@
|
|
|
package cn.com.qmth.scancentral.controller.admin;
|
|
|
|
|
|
-import cn.com.qmth.scancentral.bean.*;
|
|
|
+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.AnswerCardEntity;
|
|
|
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.enums.LockType;
|
|
|
-import cn.com.qmth.scancentral.enums.SystemMode;
|
|
|
-import cn.com.qmth.scancentral.service.*;
|
|
|
-import cn.com.qmth.scancentral.vo.*;
|
|
|
-import com.qmth.boot.api.constant.ApiConstant;
|
|
|
-import com.qmth.boot.core.concurrent.service.ConcurrentService;
|
|
|
-import com.qmth.boot.core.exception.ParameterException;
|
|
|
-import com.qmth.boot.core.exception.ReentrantException;
|
|
|
+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;
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
-import org.springframework.web.multipart.MultipartFile;
|
|
|
-
|
|
|
-import java.util.List;
|
|
|
|
|
|
@RestController
|
|
|
@Api(tags = "本地工具接口")
|
|
@@ -40,18 +55,9 @@ public class ToolController extends BaseController {
|
|
|
@Autowired
|
|
|
private SubjectService subjectService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private ToolExportService toolExportService;
|
|
|
-
|
|
|
@Autowired
|
|
|
private QuestionService questionService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private AnswerCardService answerCardService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ConcurrentService concurrentService;
|
|
|
-
|
|
|
@ApiOperation(value = "批量创建管理员用户接口")
|
|
|
@PostMapping("/import/user")
|
|
|
public CountVo importUser(@RequestBody List<ImportUserDomain> users) {
|
|
@@ -88,11 +94,11 @@ public class ToolController extends BaseController {
|
|
|
return studentService.findByQuery(query);
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "检查并修复考生导出图片接口")
|
|
|
- @PostMapping("/exam/student/check")
|
|
|
- public void studentCheck(@RequestParam Long studentId) {
|
|
|
- toolExportService.studentCheck(studentId);
|
|
|
- }
|
|
|
+ // @ApiOperation(value = "检查并修复考生导出图片接口")
|
|
|
+ // @PostMapping("/exam/student/check")
|
|
|
+ // public void studentCheck(@RequestParam Long studentId) {
|
|
|
+ // toolExportService.studentCheck(studentId);
|
|
|
+ // }
|
|
|
|
|
|
@ApiOperation(value = "获取考试详情")
|
|
|
@RequestMapping(value = "/exam/info", method = RequestMethod.POST)
|
|
@@ -146,25 +152,30 @@ public class ToolController extends BaseController {
|
|
|
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("正在同步卡格式,请稍后再试");
|
|
|
- }
|
|
|
- }
|
|
|
+ // @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("正在同步卡格式,请稍后再试");
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
}
|