|
@@ -3,26 +3,29 @@ package com.qmth.distributed.print.api;
|
|
import com.qmth.boot.api.annotation.Aac;
|
|
import com.qmth.boot.api.annotation.Aac;
|
|
import com.qmth.boot.api.annotation.BOOL;
|
|
import com.qmth.boot.api.annotation.BOOL;
|
|
import com.qmth.boot.api.constant.ApiConstant;
|
|
import com.qmth.boot.api.constant.ApiConstant;
|
|
|
|
+import com.qmth.distributed.print.business.bean.params.open.GradeOpenPageParams;
|
|
|
|
+import com.qmth.distributed.print.business.bean.params.open.GradeOpenParams;
|
|
import com.qmth.distributed.print.business.service.OpenApiService;
|
|
import com.qmth.distributed.print.business.service.OpenApiService;
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
import com.qmth.teachcloud.common.entity.BasicSchool;
|
|
import com.qmth.teachcloud.common.entity.BasicSchool;
|
|
|
|
+import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
import com.qmth.teachcloud.common.util.AuthThirdUtil;
|
|
import com.qmth.teachcloud.common.util.AuthThirdUtil;
|
|
|
|
+import com.qmth.teachcloud.common.util.JacksonUtil;
|
|
import com.qmth.teachcloud.common.util.Result;
|
|
import com.qmth.teachcloud.common.util.Result;
|
|
import com.qmth.teachcloud.common.util.ResultUtil;
|
|
import com.qmth.teachcloud.common.util.ResultUtil;
|
|
-import io.swagger.annotations.Api;
|
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
|
-import io.swagger.annotations.ApiResponse;
|
|
|
|
-import io.swagger.annotations.ApiResponses;
|
|
|
|
|
|
+import io.swagger.annotations.*;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
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.RequestMapping;
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
-import javax.validation.constraints.Min;
|
|
|
|
|
|
+import java.io.UnsupportedEncodingException;
|
|
|
|
+import java.net.URLDecoder;
|
|
|
|
+import java.util.Optional;
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -42,85 +45,79 @@ public class OpenApiController {
|
|
@Resource
|
|
@Resource
|
|
private OpenApiService openApiService;
|
|
private OpenApiService openApiService;
|
|
|
|
|
|
- /**
|
|
|
|
- * 试卷基础配置查询
|
|
|
|
- *
|
|
|
|
- * @param thirdExamId 第三方考试id
|
|
|
|
- * @param gradeCourseCode 第三方课程编号
|
|
|
|
- */
|
|
|
|
@ApiOperation(value = "试卷基础配置查询")
|
|
@ApiOperation(value = "试卷基础配置查询")
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷基础配置查询", response = Object.class)})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷基础配置查询", response = Object.class)})
|
|
@PostMapping("/paper_config")
|
|
@PostMapping("/paper_config")
|
|
@Aac(auth = BOOL.FALSE)
|
|
@Aac(auth = BOOL.FALSE)
|
|
- public Result paperConfig(@RequestParam String thirdExamId,
|
|
|
|
- @RequestParam String gradeCourseCode) {
|
|
|
|
|
|
+ public Result paperConfig(@ApiParam(value = "接收试卷配置数据信息", required = true) @RequestBody String result) throws UnsupportedEncodingException {
|
|
|
|
+ Optional.ofNullable(result).orElseThrow(() -> ExceptionResultEnum.PARAMS_ERROR.exception("数据为空"));
|
|
|
|
+ String decodeJson = URLDecoder.decode(result, SystemConstant.CHARSET_NAME);
|
|
|
|
+ log.info("paperConfigSelect进来了,result:{}", decodeJson);
|
|
|
|
+ GradeOpenParams gradeOpenParams = JacksonUtil.readJson(decodeJson, GradeOpenParams.class);
|
|
|
|
+ Optional.ofNullable(gradeOpenParams).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("转换后的数据为空"));
|
|
|
|
+ gradeOpenParams.validParams();
|
|
BasicSchool basicSchool = AuthThirdUtil.hasPermission();
|
|
BasicSchool basicSchool = AuthThirdUtil.hasPermission();
|
|
- return ResultUtil.ok(openApiService.getPaperConfig(basicSchool, thirdExamId, gradeCourseCode));
|
|
|
|
|
|
+ return ResultUtil.ok(openApiService.getPaperConfig(basicSchool, gradeOpenParams.getThirdExamId(), gradeOpenParams.getGradeCourseCode()));
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 试卷考察点查询
|
|
|
|
- *
|
|
|
|
- * @param thirdExamId 第三方考试id
|
|
|
|
- * @param gradeCourseCode 第三方课程编号
|
|
|
|
- */
|
|
|
|
@ApiOperation(value = "试卷考察点查询")
|
|
@ApiOperation(value = "试卷考察点查询")
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷考察点查询", response = Object.class)})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷考察点查询", response = Object.class)})
|
|
@PostMapping("/paper_dimension")
|
|
@PostMapping("/paper_dimension")
|
|
@Aac(auth = BOOL.FALSE)
|
|
@Aac(auth = BOOL.FALSE)
|
|
- public Result paperDimension(@RequestParam String thirdExamId,
|
|
|
|
- @RequestParam String gradeCourseCode) {
|
|
|
|
|
|
+ public Result paperDimension(@ApiParam(value = "试卷考察点查询", required = true) @RequestBody String result) throws UnsupportedEncodingException {
|
|
|
|
+
|
|
|
|
+ Optional.ofNullable(result).orElseThrow(() -> ExceptionResultEnum.PARAMS_ERROR.exception("数据为空"));
|
|
|
|
+ String decodeJson = URLDecoder.decode(result, SystemConstant.CHARSET_NAME);
|
|
|
|
+ log.info("paperDimensionSelect进来了,result:{}", decodeJson);
|
|
|
|
+ GradeOpenParams gradeOpenParams = JacksonUtil.readJson(decodeJson, GradeOpenParams.class);
|
|
|
|
+ Optional.ofNullable(gradeOpenParams).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("转换后的数据为空"));
|
|
|
|
+ gradeOpenParams.validParams();
|
|
BasicSchool basicSchool = AuthThirdUtil.hasPermission();
|
|
BasicSchool basicSchool = AuthThirdUtil.hasPermission();
|
|
- return ResultUtil.ok(openApiService.getPaperDimension(basicSchool, thirdExamId, gradeCourseCode));
|
|
|
|
|
|
+ return ResultUtil.ok(openApiService.getPaperDimension(basicSchool, gradeOpenParams.getThirdExamId(), gradeOpenParams.getGradeCourseCode()));
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 试卷蓝图查询
|
|
|
|
- *
|
|
|
|
- * @param thirdExamId 第三方考试id
|
|
|
|
- * @param gradeCourseCode 第三方课程编号
|
|
|
|
- */
|
|
|
|
@ApiOperation(value = "试卷蓝图查询")
|
|
@ApiOperation(value = "试卷蓝图查询")
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷蓝图查询", response = Object.class)})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷蓝图查询", response = Object.class)})
|
|
@PostMapping("/paper_structure")
|
|
@PostMapping("/paper_structure")
|
|
@Aac(auth = BOOL.FALSE)
|
|
@Aac(auth = BOOL.FALSE)
|
|
- public Result paperStructure(@RequestParam String thirdExamId,
|
|
|
|
- @RequestParam String gradeCourseCode) {
|
|
|
|
|
|
+ public Result paperStructure(@ApiParam(value = "试卷考察点查询", required = true) @RequestBody String result) throws UnsupportedEncodingException {
|
|
|
|
+ Optional.ofNullable(result).orElseThrow(() -> ExceptionResultEnum.PARAMS_ERROR.exception("数据为空"));
|
|
|
|
+ String decodeJson = URLDecoder.decode(result, SystemConstant.CHARSET_NAME);
|
|
|
|
+ log.info("paperStructureSelect进来了,result:{}", decodeJson);
|
|
|
|
+ GradeOpenParams gradeOpenParams = JacksonUtil.readJson(decodeJson, GradeOpenParams.class);
|
|
|
|
+ Optional.ofNullable(gradeOpenParams).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("转换后的数据为空"));
|
|
|
|
+ gradeOpenParams.validParams();
|
|
BasicSchool basicSchool = AuthThirdUtil.hasPermission();
|
|
BasicSchool basicSchool = AuthThirdUtil.hasPermission();
|
|
- return ResultUtil.ok(openApiService.getPaperStructure(basicSchool, thirdExamId, gradeCourseCode));
|
|
|
|
|
|
+ return ResultUtil.ok(openApiService.getPaperStructure(basicSchool, gradeOpenParams.getThirdExamId(), gradeOpenParams.getGradeCourseCode()));
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 试卷评价模型查询
|
|
|
|
- *
|
|
|
|
- * @param thirdExamId 第三方考试id
|
|
|
|
- * @param gradeCourseCode 第三方课程编号
|
|
|
|
- */
|
|
|
|
@ApiOperation(value = "试卷评价模型查询")
|
|
@ApiOperation(value = "试卷评价模型查询")
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷评价模型查询", response = Object.class)})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷评价模型查询", response = Object.class)})
|
|
@PostMapping("/paper_evaluation")
|
|
@PostMapping("/paper_evaluation")
|
|
@Aac(auth = BOOL.FALSE)
|
|
@Aac(auth = BOOL.FALSE)
|
|
- public Result paperEvaluation(@RequestParam String thirdExamId,
|
|
|
|
- @RequestParam String gradeCourseCode) {
|
|
|
|
|
|
+ public Result paperEvaluation(@ApiParam(value = "试卷评价模型查询", required = true) @RequestBody String result) throws UnsupportedEncodingException {
|
|
|
|
+ Optional.ofNullable(result).orElseThrow(() -> ExceptionResultEnum.PARAMS_ERROR.exception("数据为空"));
|
|
|
|
+ String decodeJson = URLDecoder.decode(result, SystemConstant.CHARSET_NAME);
|
|
|
|
+ log.info("paperEvaluation进来了,result:{}", decodeJson);
|
|
|
|
+ GradeOpenParams gradeOpenParams = JacksonUtil.readJson(decodeJson, GradeOpenParams.class);
|
|
|
|
+ Optional.ofNullable(gradeOpenParams).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("转换后的数据为空"));
|
|
|
|
+ gradeOpenParams.validParams();
|
|
BasicSchool basicSchool = AuthThirdUtil.hasPermission();
|
|
BasicSchool basicSchool = AuthThirdUtil.hasPermission();
|
|
- return ResultUtil.ok(openApiService.getPaperEvaluation(basicSchool, thirdExamId, gradeCourseCode));
|
|
|
|
|
|
+ return ResultUtil.ok(openApiService.getPaperEvaluation(basicSchool, gradeOpenParams.getThirdExamId(), gradeOpenParams.getGradeCourseCode()));
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 考生成绩查询
|
|
|
|
- *
|
|
|
|
- * @param thirdExamId 第三方考试id
|
|
|
|
- * @param gradeCourseCode 第三方课程编号
|
|
|
|
- */
|
|
|
|
@ApiOperation(value = "考生成绩查询")
|
|
@ApiOperation(value = "考生成绩查询")
|
|
@ApiResponses({@ApiResponse(code = 200, message = "考生成绩查询", response = Object.class)})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "考生成绩查询", response = Object.class)})
|
|
@PostMapping("/exam_student_score")
|
|
@PostMapping("/exam_student_score")
|
|
@Aac(auth = BOOL.FALSE)
|
|
@Aac(auth = BOOL.FALSE)
|
|
- public Result examStudentScore(@RequestParam String thirdExamId,
|
|
|
|
- @RequestParam String gradeCourseCode,
|
|
|
|
- @RequestParam(defaultValue = "1") @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
|
|
|
|
- @RequestParam(defaultValue = "10") @Min(SystemConstant.PAGE_SIZE_MIN) Integer pageSize) {
|
|
|
|
|
|
+ public Result examStudentScore(@ApiParam(value = "考生成绩查询", required = true) @RequestBody String result) throws UnsupportedEncodingException {
|
|
|
|
+ Optional.ofNullable(result).orElseThrow(() -> ExceptionResultEnum.PARAMS_ERROR.exception("数据为空"));
|
|
|
|
+ String decodeJson = URLDecoder.decode(result, SystemConstant.CHARSET_NAME);
|
|
|
|
+ log.info("examStudentScore进来了,result:{}", decodeJson);
|
|
|
|
+ GradeOpenPageParams gradeOpenPageParams = JacksonUtil.readJson(decodeJson, GradeOpenPageParams.class);
|
|
|
|
+ Optional.ofNullable(gradeOpenPageParams).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("转换后的数据为空"));
|
|
|
|
+ gradeOpenPageParams.validParams();
|
|
BasicSchool basicSchool = AuthThirdUtil.hasPermission();
|
|
BasicSchool basicSchool = AuthThirdUtil.hasPermission();
|
|
- return ResultUtil.ok(openApiService.listExamStudentScore(basicSchool, thirdExamId, gradeCourseCode, pageNumber, pageSize));
|
|
|
|
|
|
+ return ResultUtil.ok(openApiService.listExamStudentScore(basicSchool, gradeOpenPageParams.getThirdExamId(), gradeOpenPageParams.getGradeCourseCode(), gradeOpenPageParams.getPageNumber(), gradeOpenPageParams.getPageSize()));
|
|
}
|
|
}
|
|
}
|
|
}
|