|
@@ -9,7 +9,9 @@ package cn.com.qmth.examcloud.core.print.api.controller;
|
|
|
|
|
|
import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
|
|
|
import cn.com.qmth.examcloud.core.print.common.Result;
|
|
|
+import cn.com.qmth.examcloud.core.print.service.CoursePaperService;
|
|
|
import cn.com.qmth.examcloud.core.print.service.CourseStatisticService;
|
|
|
+import cn.com.qmth.examcloud.core.print.service.bean.coursepaper.CoursePaperTotalInfo;
|
|
|
import cn.com.qmth.examcloud.core.print.service.bean.coursestatistic.CourseRefreshForm;
|
|
|
import cn.com.qmth.examcloud.core.print.service.bean.coursestatistic.CourseStatisticInfo;
|
|
|
import cn.com.qmth.examcloud.core.print.service.bean.coursestatistic.CourseStatisticQuery;
|
|
@@ -19,6 +21,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.io.Writer;
|
|
|
+
|
|
|
import static cn.com.qmth.examcloud.core.print.common.Result.success;
|
|
|
|
|
|
/**
|
|
@@ -33,6 +38,8 @@ import static cn.com.qmth.examcloud.core.print.common.Result.success;
|
|
|
public class CourseStatisticController extends ControllerSupport {
|
|
|
@Autowired
|
|
|
private CourseStatisticService courseStatisticService;
|
|
|
+ @Autowired
|
|
|
+ private CoursePaperService coursePaperService;
|
|
|
|
|
|
@PostMapping("/list")
|
|
|
@ApiOperation(value = "获取课程统计信息列表(分页)")
|
|
@@ -47,6 +54,62 @@ public class CourseStatisticController extends ControllerSupport {
|
|
|
return success();
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("/allot/paper/{orgId}/{examId}")
|
|
|
+ @ApiOperation(value = "分配待指定试卷")
|
|
|
+ public Result allotCoursePaper(@PathVariable Long orgId, @PathVariable Long examId) {
|
|
|
+ courseStatisticService.allotCoursePaper(orgId, examId);
|
|
|
+ return success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/paper/total/{orgId}/{examId}")
|
|
|
+ @ApiOperation(value = "获取某学校考试的试卷数量情况")
|
|
|
+ public CoursePaperTotalInfo paperTotal(@PathVariable Long orgId, @PathVariable Long examId) {
|
|
|
+ return courseStatisticService.getPaperTotalByOrgIdAndExamId(orgId, examId);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/export/all/{orgId}/{examId}")
|
|
|
+ @ApiOperation(value = "整体导出(导出考试下所有试卷文件)")
|
|
|
+ public void exportAll(@PathVariable Long orgId, @PathVariable Long examId, HttpServletResponse response) throws Exception {
|
|
|
+ String downloadUrl = courseStatisticService.exportAllByOrgIdAndExamId(orgId, examId);
|
|
|
+ //todo
|
|
|
+ Writer out = response.getWriter();
|
|
|
+ out.write("ok");
|
|
|
+ out.close();
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/export/batch/{ids}")
|
|
|
+ @ApiOperation(value = "批量导出")
|
|
|
+ public void exportBatch(@PathVariable Long[] ids, HttpServletResponse response) throws Exception {
|
|
|
+ String downloadUrl = courseStatisticService.exportBatchByIds(ids);
|
|
|
+ //todo
|
|
|
+ Writer out = response.getWriter();
|
|
|
+ out.write("ok");
|
|
|
+ out.close();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 下载考试结构
|
|
|
+ */
|
|
|
+ @PostMapping("/download/paper/{examId}/{paperId}")
|
|
|
+ @ApiOperation(value = "下载考试结构")
|
|
|
+ public void downloadPaper(@PathVariable Long examId, @PathVariable Long paperId, HttpServletResponse response) throws Exception {
|
|
|
+ String downloadUrl = coursePaperService.downloadPaperStructure(examId, paperId);
|
|
|
+ //todo
|
|
|
+ Writer out = response.getWriter();
|
|
|
+ out.write("ok");
|
|
|
+ out.close();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 校验考试结构
|
|
|
+ */
|
|
|
+ @PostMapping("/check/paper/{examId}/{paperId}")
|
|
|
+ @ApiOperation(value = "校验考试结构")
|
|
|
+ public Result checkPaper(@PathVariable Long examId, @PathVariable Long paperId) {
|
|
|
+ coursePaperService.checkPaperStructure(examId, paperId);
|
|
|
+ return success();
|
|
|
+ }
|
|
|
+
|
|
|
@GetMapping("/all/init")
|
|
|
public Result init() {
|
|
|
courseStatisticService.initAllCourseStatistic();
|