|
@@ -4,6 +4,7 @@ import java.util.List;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
|
|
+
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.ResponseEntity;
|
|
import org.springframework.http.ResponseEntity;
|
|
@@ -13,7 +14,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
-import cn.com.qmth.examcloud.commons.base.exception.StatusException;
|
|
|
|
import cn.com.qmth.examcloud.commons.web.security.bean.User;
|
|
import cn.com.qmth.examcloud.commons.web.security.bean.User;
|
|
import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
|
|
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.FailureBaseResponse;
|
|
@@ -120,25 +120,31 @@ public class CommonGainScoreController extends ControllerSupport{
|
|
|
|
|
|
@ApiOperation(value = "查询成绩明细:按考试名称、机构ID、学号、课程code查询成绩")
|
|
@ApiOperation(value = "查询成绩明细:按考试名称、机构ID、学号、课程code查询成绩")
|
|
@GetMapping("/batchQueryScoreDetail")
|
|
@GetMapping("/batchQueryScoreDetail")
|
|
- public List<OutletScore> batchQueryScoreDetail(@RequestParam(name = "examName")String examName,
|
|
|
|
|
|
+ public ResponseEntity<?> batchQueryScoreDetail(@RequestParam(name = "examName")String examName,
|
|
@RequestParam(name = "studentCode")String studentCode,
|
|
@RequestParam(name = "studentCode")String studentCode,
|
|
@RequestParam(name = "courseCode")String courseCode,
|
|
@RequestParam(name = "courseCode")String courseCode,
|
|
- HttpServletRequest request) throws Exception{
|
|
|
|
|
|
+ HttpServletRequest request){
|
|
User accessUser = getAccessUser();
|
|
User accessUser = getAccessUser();
|
|
if(accessUser == null){
|
|
if(accessUser == null){
|
|
- throw new StatusException("batchQueryScoreDetail-exception", "请先登录");
|
|
|
|
|
|
+ return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请先登录"), HttpStatus.INTERNAL_SERVER_ERROR);
|
|
}
|
|
}
|
|
if(examName == null){
|
|
if(examName == null){
|
|
- throw new StatusException("batchQueryScoreDetail-exception", "examName is not null");
|
|
|
|
|
|
+ return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("examName is not null"), HttpStatus.INTERNAL_SERVER_ERROR);
|
|
}
|
|
}
|
|
if(studentCode == null){
|
|
if(studentCode == null){
|
|
- throw new StatusException("batchQueryScoreDetail-exception", "studentCode is not null");
|
|
|
|
|
|
+ return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("studentCode is not null"), HttpStatus.INTERNAL_SERVER_ERROR);
|
|
}
|
|
}
|
|
if(courseCode == null){
|
|
if(courseCode == null){
|
|
- throw new StatusException("batchQueryScoreDetail-exception", "courseCode is not 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();
|
|
|
|
+ log.error("batchQueryScoreDetail:查询失败",e);
|
|
|
|
+ return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("查询失败"), HttpStatus.INTERNAL_SERVER_ERROR);
|
|
}
|
|
}
|
|
- List<OutletScore> outletScores = outletScoreService.queryExamScoreBy(accessUser.getRootOrgId(), examName, studentCode, courseCode);
|
|
|
|
- return outletScores;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|