|
@@ -3,6 +3,7 @@ package cn.com.qmth.examcloud.exchange.outer.api.provider;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
+import cn.com.qmth.examcloud.commons.util.StringUtil;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiResponse;
|
|
@@ -37,10 +38,10 @@ import cn.com.qmth.examcloud.web.support.StatusResponse;
|
|
|
public class GetScoreDataServiceProvider extends ControllerSupport implements GetScoreDataService {
|
|
|
|
|
|
/**
|
|
|
- *
|
|
|
+ *
|
|
|
*/
|
|
|
private static final long serialVersionUID = 1857049574734356057L;
|
|
|
-
|
|
|
+
|
|
|
@Autowired
|
|
|
private ExamScoreDataCloudService examScoreDataCloudService;
|
|
|
|
|
@@ -62,7 +63,7 @@ public class GetScoreDataServiceProvider extends ControllerSupport implements Ge
|
|
|
GetScoreDataReq getScoreDataReq = new GetScoreDataReq();
|
|
|
getScoreDataReq.setExamRecordDataId(req.getExamRecordDataId());
|
|
|
GetScoreDataResp scoreDataResp = examScoreDataCloudService.getScoreData(getScoreDataReq);
|
|
|
-
|
|
|
+
|
|
|
OuterGetScoreDataResp outerGetScoreDataResp = new OuterGetScoreDataResp();
|
|
|
OuterScoreDataBean outerScoreDataBean = new OuterScoreDataBean();
|
|
|
outerScoreDataBean.setExamRecordDataId(scoreDataResp.getExamRecordDataId());
|
|
@@ -80,7 +81,7 @@ public class GetScoreDataServiceProvider extends ControllerSupport implements Ge
|
|
|
outerGetScoreDataResp.setOuterScoreDataBean(outerScoreDataBean);
|
|
|
return outerGetScoreDataResp;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@ApiOperation(value = "按考试名称,rootOrgId,courseCode,身份证号或学号获取成绩数据", httpMethod = "POST")
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "成功", response = OuterQueryScoreDataResp.class),
|
|
|
@ApiResponse(code = 500, message = "系统异常(异常信息见响应体)", response = StatusResponse.class)})
|
|
@@ -93,9 +94,7 @@ public class GetScoreDataServiceProvider extends ControllerSupport implements Ge
|
|
|
if (!getEnterpriseRootOrgId().equals(req.getRootOrgId())) {
|
|
|
throw new StatusException("1000002", "rootOrgId错误");
|
|
|
}
|
|
|
- if(StringUtils.isBlank(req.getExamName())){
|
|
|
- throw new StatusException("1000003", "考试名称不能为空");
|
|
|
- }
|
|
|
+
|
|
|
if(StringUtils.isBlank(req.getCourseCode())){
|
|
|
throw new StatusException("1000004", "课程code不能为空");
|
|
|
}
|
|
@@ -107,7 +106,17 @@ public class GetScoreDataServiceProvider extends ControllerSupport implements Ge
|
|
|
}
|
|
|
QueryScoreDataReq queryScoreDataReq = new QueryScoreDataReq();
|
|
|
queryScoreDataReq.setCourseCode(req.getCourseCode());
|
|
|
- queryScoreDataReq.setExamCode(req.getExamCode());
|
|
|
+
|
|
|
+ //如果考试名称不为空,则把考试名称作为考试编码
|
|
|
+ if (StringUtils.isNoneBlank(req.getExamName())) {
|
|
|
+ queryScoreDataReq.setExamCode(req.getExamName());
|
|
|
+ } else {
|
|
|
+ queryScoreDataReq.setExamCode(req.getExamCode());
|
|
|
+ }
|
|
|
+ if(StringUtils.isBlank(queryScoreDataReq.getExamCode())){
|
|
|
+ throw new StatusException("1000003", "考试代码不能为空");
|
|
|
+ }
|
|
|
+
|
|
|
queryScoreDataReq.setExamName(req.getExamName());
|
|
|
queryScoreDataReq.setIdentityNumber(req.getIdentityNumber());
|
|
|
queryScoreDataReq.setRootOrgId(req.getRootOrgId());
|