|
@@ -3,18 +3,25 @@ package com.qmth.distributed.print.api;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.qmth.boot.api.constant.ApiConstant;
|
|
|
import com.qmth.distributed.print.business.bean.result.ScoreResult;
|
|
|
+import com.qmth.distributed.print.business.bean.result.report.ReportResult;
|
|
|
+import com.qmth.distributed.print.business.entity.TRBasicInfo;
|
|
|
import com.qmth.distributed.print.business.service.PrintCommonService;
|
|
|
import com.qmth.teachcloud.common.annotation.OperationLogDetail;
|
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
|
import com.qmth.teachcloud.common.enums.log.CustomizedOperationTypeEnum;
|
|
|
import com.qmth.teachcloud.common.util.ResultUtil;
|
|
|
+import com.qmth.teachcloud.mark.entity.MarkPaper;
|
|
|
+import com.qmth.teachcloud.mark.service.MarkPaperService;
|
|
|
import io.swagger.annotations.*;
|
|
|
+import org.springframework.validation.BindingResult;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import javax.validation.Valid;
|
|
|
import javax.validation.constraints.Max;
|
|
|
import javax.validation.constraints.Min;
|
|
|
import java.io.IOException;
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -32,6 +39,9 @@ public class TRBasicInfoController {
|
|
|
@Resource
|
|
|
PrintCommonService printCommonService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ MarkPaperService markPaperService;
|
|
|
+
|
|
|
@ApiOperation(value = "报告管理列表")
|
|
|
@RequestMapping(value = "/report/list", method = RequestMethod.POST)
|
|
|
@OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.SEARCH)
|
|
@@ -46,10 +56,12 @@ public class TRBasicInfoController {
|
|
|
@ApiOperation(value = "查看报告")
|
|
|
@RequestMapping(value = "/report/view", method = RequestMethod.POST)
|
|
|
@OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.SEARCH)
|
|
|
- @ApiResponses({@ApiResponse(code = 200, message = "查看报告", response = Object.class)})
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "查看报告", response = ReportResult.class)})
|
|
|
public Object reportView(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
|
|
|
@ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
|
|
|
@ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber) {
|
|
|
+ MarkPaper markPaper = markPaperService.getByExamIdAndPaperNumber(examId, paperNumber);
|
|
|
+ Objects.requireNonNull(markPaper, "未找到科目信息");
|
|
|
return ResultUtil.ok(true);
|
|
|
}
|
|
|
|
|
@@ -57,11 +69,15 @@ public class TRBasicInfoController {
|
|
|
@RequestMapping(value = "/report/save", method = RequestMethod.POST)
|
|
|
@OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.UPDATE)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "保存报告", response = Object.class)})
|
|
|
- public Object reportSave(@ApiParam(value = "保存报告结构", required = true) @RequestBody Object body) {
|
|
|
+ public Object reportSave(@ApiParam(value = "保存报告结构", required = true) @Valid @RequestBody TRBasicInfo trBasicInfo, BindingResult bindingResult) {
|
|
|
+ if (bindingResult.hasErrors()) {
|
|
|
+ return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
|
|
+ }
|
|
|
+ MarkPaper markPaper = markPaperService.getByExamIdAndPaperNumber(trBasicInfo.getExamId(), trBasicInfo.getPaperNumber());
|
|
|
+ Objects.requireNonNull(markPaper, "未找到科目信息");
|
|
|
return ResultUtil.ok(true);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@ApiOperation(value = "导出报告")
|
|
|
@RequestMapping(value = "/report/export", method = RequestMethod.POST)
|
|
|
@OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.EXPORT)
|
|
@@ -69,6 +85,7 @@ public class TRBasicInfoController {
|
|
|
public void reportExport(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
|
|
|
@ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
|
|
|
@ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber) throws IOException {
|
|
|
-
|
|
|
+ MarkPaper markPaper = markPaperService.getByExamIdAndPaperNumber(examId, paperNumber);
|
|
|
+ Objects.requireNonNull(markPaper, "未找到科目信息");
|
|
|
}
|
|
|
}
|