|
@@ -1,9 +1,27 @@
|
|
package com.qmth.teachcloud.report.api;
|
|
package com.qmth.teachcloud.report.api;
|
|
|
|
|
|
|
|
|
|
|
|
+import com.qmth.boot.api.constant.ApiConstant;
|
|
|
|
+import com.qmth.boot.api.exception.ApiException;
|
|
|
|
+import com.qmth.teachcloud.common.entity.BasicAttachment;
|
|
|
|
+import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
|
|
+import com.qmth.teachcloud.common.enums.UploadFileEnum;
|
|
|
|
+import com.qmth.teachcloud.common.service.BasicAttachmentService;
|
|
|
|
+import com.qmth.teachcloud.common.util.Result;
|
|
|
|
+import com.qmth.teachcloud.common.util.ResultUtil;
|
|
|
|
+import com.qmth.teachcloud.common.util.ServletUtil;
|
|
|
|
+import com.qmth.teachcloud.report.business.bean.result.TBExamStudentResult;
|
|
|
|
+import com.qmth.teachcloud.report.business.service.TBExamStudentService;
|
|
|
|
+import io.swagger.annotations.*;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
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 org.springframework.web.bind.annotation.RestController;
|
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
|
+
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -13,8 +31,103 @@ import org.springframework.web.bind.annotation.RestController;
|
|
* @author wangliang
|
|
* @author wangliang
|
|
* @since 2021-06-01
|
|
* @since 2021-06-01
|
|
*/
|
|
*/
|
|
|
|
+@Api(tags = "教研分析学校公用Controller")
|
|
@RestController
|
|
@RestController
|
|
-@RequestMapping("/t-bexam-student")
|
|
|
|
|
|
+@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/${prefix.url.reportSchool}/student")
|
|
public class TBExamStudentController {
|
|
public class TBExamStudentController {
|
|
|
|
|
|
-}
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private TBExamStudentService tbExamStudentService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private BasicAttachmentService basicAttachmentService;
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "开课成绩查询")
|
|
|
|
+ @RequestMapping(value = "/list_teach_college_result", method = RequestMethod.POST)
|
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "开课成绩查询信息", response = TBExamStudentResult.class)})
|
|
|
|
+ public Result listTeachCollegeResult(
|
|
|
|
+ @ApiParam(value = "学期", required = true) @RequestParam String semester,
|
|
|
|
+ @ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
|
|
|
|
+ @ApiParam(value = "课程代码", required = true) @RequestParam String courseCode,
|
|
|
|
+ @ApiParam(value = "考试类型", required = true) @RequestParam Boolean current,
|
|
|
|
+ @ApiParam(value = "考查学院ID", required = true) @RequestParam Long inspectCollegeId,
|
|
|
|
+ @ApiParam(value = "教师ID", required = true) @RequestParam Long teacherId,
|
|
|
|
+ @ApiParam(value = "模糊查询", required = true) @RequestParam String studentParam,
|
|
|
|
+ @ApiParam(value = "分页页码", required = true) @RequestParam Integer pageNumber,
|
|
|
|
+ @ApiParam(value = "分页数量", required = true) @RequestParam Integer pageSize) {
|
|
|
|
+ return ResultUtil.ok(tbExamStudentService.listTeachCollegeResult(semester, examId, courseCode, current, inspectCollegeId, teacherId, studentParam, pageNumber, pageSize));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "开课成绩查询-导入异常考试类型")
|
|
|
|
+ @RequestMapping(value = "/import_abnormal_data", method = RequestMethod.POST)
|
|
|
|
+ public Result importAbnormalData(
|
|
|
|
+ @ApiParam(value = "考试id", required = true) @RequestParam Long examId,
|
|
|
|
+ @ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file) {
|
|
|
|
+ BasicAttachment basicAttachment = null;
|
|
|
|
+ try {
|
|
|
|
+ basicAttachment = basicAttachmentService.saveAttachment(file, ServletUtil.getRequestMd5(), UploadFileEnum.FILE);
|
|
|
|
+ if (Objects.isNull(basicAttachment)) {
|
|
|
|
+ throw ExceptionResultEnum.ATTACHMENT_ERROR.exception();
|
|
|
|
+ } else {
|
|
|
|
+ tbExamStudentService.importFile(examId, file);
|
|
|
|
+ return ResultUtil.ok(true);
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ if (Objects.nonNull(basicAttachment)) {
|
|
|
|
+ basicAttachmentService.deleteAttachment(basicAttachment);
|
|
|
|
+ }
|
|
|
|
+ if (e instanceof ApiException) {
|
|
|
|
+ ResultUtil.error((ApiException) e, e.getMessage());
|
|
|
|
+ } else {
|
|
|
|
+ ResultUtil.error(e.getMessage());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "开课成绩查询-导出查询结果")
|
|
|
|
+ @RequestMapping(value = "/export_teach_college_result", method = RequestMethod.POST)
|
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "开课成绩查询信息", response = TBExamStudentResult.class)})
|
|
|
|
+ public void exportTeachCollegeResult(
|
|
|
|
+ @ApiParam(value = "学期", required = true) @RequestParam String semester,
|
|
|
|
+ @ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
|
|
|
|
+ @ApiParam(value = "课程代码", required = true) @RequestParam String courseCode,
|
|
|
|
+ @ApiParam(value = "考试类型", required = true) @RequestParam Boolean current,
|
|
|
|
+ @ApiParam(value = "考查学院ID", required = true) @RequestParam Long inspectCollegeId,
|
|
|
|
+ @ApiParam(value = "教师ID", required = true) @RequestParam Long teacherId,
|
|
|
|
+ @ApiParam(value = "模糊查询", required = true) @RequestParam String studentParam,
|
|
|
|
+ HttpServletResponse response) throws Exception {
|
|
|
|
+ tbExamStudentService.exportTeachCollegeResult(semester, examId, courseCode, current, inspectCollegeId, teacherId, studentParam, response);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "考查成绩查询")
|
|
|
|
+ @RequestMapping(value = "/listInspectCollegeResult", method = RequestMethod.POST)
|
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "开课成绩查询信息", response = TBExamStudentResult.class)})
|
|
|
|
+ public Result listInspectCollegeResult(
|
|
|
|
+ @ApiParam(value = "学期", required = true) @RequestParam String semester,
|
|
|
|
+ @ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
|
|
|
|
+ @ApiParam(value = "课程代码", required = true) @RequestParam String courseCode,
|
|
|
|
+ @ApiParam(value = "考试类型", required = true) @RequestParam Boolean current,
|
|
|
|
+ @ApiParam(value = "开课学院ID", required = true) @RequestParam Long teachCollegeId,
|
|
|
|
+ @ApiParam(value = "教师ID", required = true) @RequestParam Long teacherId,
|
|
|
|
+ @ApiParam(value = "模糊查询", required = true) @RequestParam String studentParam,
|
|
|
|
+ @ApiParam(value = "分页页码", required = true) @RequestParam Integer pageNumber,
|
|
|
|
+ @ApiParam(value = "分页数量", required = true) @RequestParam Integer pageSize) {
|
|
|
|
+ return ResultUtil.ok(tbExamStudentService.listInspectCollegeResult(semester, examId, courseCode, current, teachCollegeId, teacherId, studentParam, pageNumber, pageSize));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "考查成绩查询-导出查询结果")
|
|
|
|
+ @RequestMapping(value = "/export_inspect_college_result", method = RequestMethod.POST)
|
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "开课成绩查询信息", response = TBExamStudentResult.class)})
|
|
|
|
+ public void exportInspectCollegeResult(
|
|
|
|
+ @ApiParam(value = "学期", required = true) @RequestParam String semester,
|
|
|
|
+ @ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
|
|
|
|
+ @ApiParam(value = "课程代码", required = true) @RequestParam String courseCode,
|
|
|
|
+ @ApiParam(value = "考试类型", required = true) @RequestParam Boolean current,
|
|
|
|
+ @ApiParam(value = "开课学院ID", required = true) @RequestParam Long teachCollegeId,
|
|
|
|
+ @ApiParam(value = "教师ID", required = true) @RequestParam Long teacherId,
|
|
|
|
+ @ApiParam(value = "模糊查询", required = true) @RequestParam String studentParam,
|
|
|
|
+ HttpServletResponse response) throws Exception {
|
|
|
|
+ tbExamStudentService.exportInspectCollegeResult(semester, examId, courseCode, current, teachCollegeId, teacherId, studentParam, response);
|
|
|
|
+ }
|
|
|
|
+}
|