|
@@ -1,148 +1,148 @@
|
|
-package cn.com.qmth.examcloud.exchange.outer.api.controller.swufe;
|
|
|
|
-
|
|
|
|
-import java.util.List;
|
|
|
|
-
|
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
|
-
|
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
-import org.springframework.http.HttpStatus;
|
|
|
|
-import org.springframework.http.ResponseEntity;
|
|
|
|
-import org.springframework.util.StringUtils;
|
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
-
|
|
|
|
-import cn.com.qmth.examcloud.commons.web.security.bean.User;
|
|
|
|
-import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
|
|
|
|
-import cn.com.qmth.examcloud.exchange.base.response.FailureBaseResponse;
|
|
|
|
-import cn.com.qmth.examcloud.exchange.base.response.SuccessBaseResponse;
|
|
|
|
-import cn.com.qmth.examcloud.exchange.outer.service.OutletScoreService;
|
|
|
|
-import cn.com.qmth.examcloud.exchange.outer.service.bean.OutletScore;
|
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
|
-
|
|
|
|
-/**
|
|
|
|
- * 获取成绩接口
|
|
|
|
- * @author chenken
|
|
|
|
- * @date 2018年4月3日 下午3:57:26
|
|
|
|
- * @company QMTH
|
|
|
|
- * @description ScoreController.java
|
|
|
|
- */
|
|
|
|
-@RestController
|
|
|
|
-@RequestMapping("${$rmp.cloud.exchange.outer}/score")
|
|
|
|
-public class CommonGainScoreController extends ControllerSupport{
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private OutletScoreService outletScoreService;
|
|
|
|
-
|
|
|
|
- @ApiOperation(value = "查询成绩:根据考试名称、机构ID和学生考试方式查询")
|
|
|
|
- @GetMapping
|
|
|
|
- public ResponseEntity<?> query(@RequestParam(name = "examName") String examName,
|
|
|
|
- @RequestParam(name = "examStuRemark",required=false) String examStuRemark,
|
|
|
|
- HttpServletRequest request) {
|
|
|
|
- try{
|
|
|
|
- User accessUser = getAccessUser();
|
|
|
|
- if(accessUser == null){
|
|
|
|
- return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请先登录"), HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
|
- }
|
|
|
|
- if (StringUtils.isEmpty(examName)) {
|
|
|
|
- return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("考试名称不能为空"),HttpStatus.BAD_REQUEST);
|
|
|
|
- }
|
|
|
|
- Long orgId = accessUser.getRootOrgId();
|
|
|
|
- List<OutletScore> outletScoreList = outletScoreService.queryExamScore(examName, examStuRemark, orgId);
|
|
|
|
- return new ResponseEntity<SuccessBaseResponse>(new SuccessBaseResponse("查询成功",outletScoreList), HttpStatus.OK);
|
|
|
|
- }catch(Exception e){
|
|
|
|
- e.printStackTrace();
|
|
|
|
- return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请求失败"), HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @ApiOperation(value = "查询成绩:按考试名称、考生身份证号、机构ID查询成绩")
|
|
|
|
- @GetMapping("/examNameAndIdentityNumberList")
|
|
|
|
- public ResponseEntity<?> queryByIdentityNumber(@RequestParam(name = "examName") String examName,
|
|
|
|
- @RequestParam(name = "identityNumberList") List<String> identityNumberList,
|
|
|
|
- HttpServletRequest request) {
|
|
|
|
- try{
|
|
|
|
- User accessUser = getAccessUser();
|
|
|
|
- if(accessUser == null){
|
|
|
|
- return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请先登录"), HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
|
- }
|
|
|
|
- if (StringUtils.isEmpty(examName)) {
|
|
|
|
- return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("考试名称不能为空"),HttpStatus.BAD_REQUEST);
|
|
|
|
- }
|
|
|
|
- if (identityNumberList==null||identityNumberList.size()==0) {
|
|
|
|
- return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("身份证号不能为空"),HttpStatus.BAD_REQUEST);
|
|
|
|
- }
|
|
|
|
- if(identityNumberList.size()>1000){
|
|
|
|
- return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("单次查询,身份证号数量不能大于1000"),HttpStatus.BAD_REQUEST);
|
|
|
|
- }
|
|
|
|
- List<OutletScore> outletScoreList = outletScoreService.queryExamScoreByExamNameAndIdentityNumbers(examName,identityNumberList,accessUser.getRootOrgId());
|
|
|
|
- return new ResponseEntity<SuccessBaseResponse>(new SuccessBaseResponse("查询成功",outletScoreList), HttpStatus.OK);
|
|
|
|
- }catch(Exception e){
|
|
|
|
- e.printStackTrace();
|
|
|
|
- return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请求失败"), HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @ApiOperation(value = "查询成绩:按考试名称、机构ID、学号、课程code查询成绩")
|
|
|
|
- @GetMapping("/batchNameAndCourseCodeAndStudentCodes")
|
|
|
|
- public ResponseEntity<?> queryExamScores(
|
|
|
|
- @RequestParam(name = "batchName") String batchName,
|
|
|
|
- @RequestParam(name = "courseCode") String courseCode,
|
|
|
|
- @RequestParam(name = "studentCodes") List<String> studentCodes,
|
|
|
|
- HttpServletRequest request){
|
|
|
|
- try{
|
|
|
|
- User accessUser = getAccessUser();
|
|
|
|
- if(accessUser == null){
|
|
|
|
- return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请先登录"), HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
|
- }
|
|
|
|
- if(StringUtils.isEmpty(batchName)){
|
|
|
|
- return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("考试名称不能为空"),HttpStatus.BAD_REQUEST);
|
|
|
|
- }
|
|
|
|
- if(StringUtils.isEmpty(courseCode)){
|
|
|
|
- return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("课程不能为空"),HttpStatus.BAD_REQUEST);
|
|
|
|
- }
|
|
|
|
- if(studentCodes == null || studentCodes.size()==0){
|
|
|
|
- return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("学号不能为空"),HttpStatus.BAD_REQUEST);
|
|
|
|
- }
|
|
|
|
- if(studentCodes.size()>1000){
|
|
|
|
- return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("单次查询,学号数量不能大于1000"),HttpStatus.BAD_REQUEST);
|
|
|
|
- }
|
|
|
|
- List<OutletScore> outletScoreList = outletScoreService.queryExamScoreBy(accessUser.getRootOrgId(),batchName,courseCode,studentCodes);
|
|
|
|
- return new ResponseEntity<SuccessBaseResponse>(new SuccessBaseResponse("查询成功",outletScoreList), HttpStatus.OK);
|
|
|
|
- }catch(Exception e){
|
|
|
|
- e.printStackTrace();
|
|
|
|
- return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请求失败"), HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @ApiOperation(value = "查询成绩明细:按考试名称、机构ID、学号、课程code查询成绩")
|
|
|
|
- @GetMapping("/batchQueryScoreDetail")
|
|
|
|
- public ResponseEntity<?> batchQueryScoreDetail(@RequestParam(name = "examName")String examName,
|
|
|
|
- @RequestParam(name = "studentCode")String studentCode,
|
|
|
|
- @RequestParam(name = "courseCode")String courseCode,
|
|
|
|
- HttpServletRequest request){
|
|
|
|
- User accessUser = getAccessUser();
|
|
|
|
- if(accessUser == null){
|
|
|
|
- return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请先登录"), HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
|
- }
|
|
|
|
- if(examName == null){
|
|
|
|
- return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("examName is not null"), HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
|
- }
|
|
|
|
- if(studentCode == null){
|
|
|
|
- return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("studentCode is not null"), HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
|
- }
|
|
|
|
- if(courseCode == null){
|
|
|
|
- return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("courseCode is not null"), HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
|
- }
|
|
|
|
- try {
|
|
|
|
- List<OutletScore> outletScores = outletScoreService.queryExamScoreBy(accessUser.getRootOrgId(), examName, studentCode, courseCode);
|
|
|
|
- return new ResponseEntity<SuccessBaseResponse>(new SuccessBaseResponse("查询成功",outletScores), HttpStatus.OK);
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("查询失败"), HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-}
|
|
|
|
|
|
+package cn.com.qmth.examcloud.exchange.outer.api.controller;
|
|
|
|
+
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
|
+
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.http.HttpStatus;
|
|
|
|
+import org.springframework.http.ResponseEntity;
|
|
|
|
+import org.springframework.util.StringUtils;
|
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
+
|
|
|
|
+import cn.com.qmth.examcloud.commons.web.security.bean.User;
|
|
|
|
+import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
|
|
|
|
+import cn.com.qmth.examcloud.exchange.base.response.FailureBaseResponse;
|
|
|
|
+import cn.com.qmth.examcloud.exchange.base.response.SuccessBaseResponse;
|
|
|
|
+import cn.com.qmth.examcloud.exchange.outer.service.OutletScoreService;
|
|
|
|
+import cn.com.qmth.examcloud.exchange.outer.service.bean.OutletScore;
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * 获取成绩接口
|
|
|
|
+ * @author chenken
|
|
|
|
+ * @date 2018年4月3日 下午3:57:26
|
|
|
|
+ * @company QMTH
|
|
|
|
+ * @description ScoreController.java
|
|
|
|
+ */
|
|
|
|
+@RestController
|
|
|
|
+@RequestMapping("${$rmp.cloud.exchange.outer}/score")
|
|
|
|
+public class CommonGainScoreController extends ControllerSupport{
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private OutletScoreService outletScoreService;
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "查询成绩:根据考试名称、机构ID和学生考试方式查询")
|
|
|
|
+ @GetMapping
|
|
|
|
+ public ResponseEntity<?> query(@RequestParam(name = "examName") String examName,
|
|
|
|
+ @RequestParam(name = "examStuRemark",required=false) String examStuRemark,
|
|
|
|
+ HttpServletRequest request) {
|
|
|
|
+ try{
|
|
|
|
+ User accessUser = getAccessUser();
|
|
|
|
+ if(accessUser == null){
|
|
|
|
+ return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请先登录"), HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isEmpty(examName)) {
|
|
|
|
+ return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("考试名称不能为空"),HttpStatus.BAD_REQUEST);
|
|
|
|
+ }
|
|
|
|
+ Long orgId = accessUser.getRootOrgId();
|
|
|
|
+ List<OutletScore> outletScoreList = outletScoreService.queryExamScore(examName, examStuRemark, orgId);
|
|
|
|
+ return new ResponseEntity<SuccessBaseResponse>(new SuccessBaseResponse("查询成功",outletScoreList), HttpStatus.OK);
|
|
|
|
+ }catch(Exception e){
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请求失败"), HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "查询成绩:按考试名称、考生身份证号、机构ID查询成绩")
|
|
|
|
+ @GetMapping("/examNameAndIdentityNumberList")
|
|
|
|
+ public ResponseEntity<?> queryByIdentityNumber(@RequestParam(name = "examName") String examName,
|
|
|
|
+ @RequestParam(name = "identityNumberList") List<String> identityNumberList,
|
|
|
|
+ HttpServletRequest request) {
|
|
|
|
+ try{
|
|
|
|
+ User accessUser = getAccessUser();
|
|
|
|
+ if(accessUser == null){
|
|
|
|
+ return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请先登录"), HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isEmpty(examName)) {
|
|
|
|
+ return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("考试名称不能为空"),HttpStatus.BAD_REQUEST);
|
|
|
|
+ }
|
|
|
|
+ if (identityNumberList==null||identityNumberList.size()==0) {
|
|
|
|
+ return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("身份证号不能为空"),HttpStatus.BAD_REQUEST);
|
|
|
|
+ }
|
|
|
|
+ if(identityNumberList.size()>1000){
|
|
|
|
+ return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("单次查询,身份证号数量不能大于1000"),HttpStatus.BAD_REQUEST);
|
|
|
|
+ }
|
|
|
|
+ List<OutletScore> outletScoreList = outletScoreService.queryExamScoreByExamNameAndIdentityNumbers(examName,identityNumberList,accessUser.getRootOrgId());
|
|
|
|
+ return new ResponseEntity<SuccessBaseResponse>(new SuccessBaseResponse("查询成功",outletScoreList), HttpStatus.OK);
|
|
|
|
+ }catch(Exception e){
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请求失败"), HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "查询成绩:按考试名称、机构ID、学号、课程code查询成绩")
|
|
|
|
+ @GetMapping("/batchNameAndCourseCodeAndStudentCodes")
|
|
|
|
+ public ResponseEntity<?> queryExamScores(
|
|
|
|
+ @RequestParam(name = "batchName") String batchName,
|
|
|
|
+ @RequestParam(name = "courseCode") String courseCode,
|
|
|
|
+ @RequestParam(name = "studentCodes") List<String> studentCodes,
|
|
|
|
+ HttpServletRequest request){
|
|
|
|
+ try{
|
|
|
|
+ User accessUser = getAccessUser();
|
|
|
|
+ if(accessUser == null){
|
|
|
|
+ return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请先登录"), HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
|
+ }
|
|
|
|
+ if(StringUtils.isEmpty(batchName)){
|
|
|
|
+ return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("考试名称不能为空"),HttpStatus.BAD_REQUEST);
|
|
|
|
+ }
|
|
|
|
+ if(StringUtils.isEmpty(courseCode)){
|
|
|
|
+ return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("课程不能为空"),HttpStatus.BAD_REQUEST);
|
|
|
|
+ }
|
|
|
|
+ if(studentCodes == null || studentCodes.size()==0){
|
|
|
|
+ return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("学号不能为空"),HttpStatus.BAD_REQUEST);
|
|
|
|
+ }
|
|
|
|
+ if(studentCodes.size()>1000){
|
|
|
|
+ return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("单次查询,学号数量不能大于1000"),HttpStatus.BAD_REQUEST);
|
|
|
|
+ }
|
|
|
|
+ List<OutletScore> outletScoreList = outletScoreService.queryExamScoreBy(accessUser.getRootOrgId(),batchName,courseCode,studentCodes);
|
|
|
|
+ return new ResponseEntity<SuccessBaseResponse>(new SuccessBaseResponse("查询成功",outletScoreList), HttpStatus.OK);
|
|
|
|
+ }catch(Exception e){
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请求失败"), HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "查询成绩明细:按考试名称、机构ID、学号、课程code查询成绩")
|
|
|
|
+ @GetMapping("/batchQueryScoreDetail")
|
|
|
|
+ public ResponseEntity<?> batchQueryScoreDetail(@RequestParam(name = "examName")String examName,
|
|
|
|
+ @RequestParam(name = "studentCode")String studentCode,
|
|
|
|
+ @RequestParam(name = "courseCode")String courseCode,
|
|
|
|
+ HttpServletRequest request){
|
|
|
|
+ User accessUser = getAccessUser();
|
|
|
|
+ if(accessUser == null){
|
|
|
|
+ return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请先登录"), HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
|
+ }
|
|
|
|
+ if(examName == null){
|
|
|
|
+ return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("examName is not null"), HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
|
+ }
|
|
|
|
+ if(studentCode == null){
|
|
|
|
+ return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("studentCode is not null"), HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
|
+ }
|
|
|
|
+ if(courseCode == null){
|
|
|
|
+ return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("courseCode is not null"), HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
|
+ }
|
|
|
|
+ try {
|
|
|
|
+ List<OutletScore> outletScores = outletScoreService.queryExamScoreBy(accessUser.getRootOrgId(), examName, studentCode, courseCode);
|
|
|
|
+ return new ResponseEntity<SuccessBaseResponse>(new SuccessBaseResponse("查询成功",outletScores), HttpStatus.OK);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("查询失败"), HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|