|
@@ -41,7 +41,8 @@ public class CallPrintOpenApiServiceImpl implements CallPrintOpenApiService {
|
|
|
|
|
|
@Override
|
|
|
public PaperConfig callPaperConfig(Long thirdExamId, String gradeCourseCode) throws IOException {
|
|
|
- Long schoolId = SystemConstant.getHeadOrUserSchoolId();
|
|
|
+// Long schoolId = SystemConstant.getHeadOrUserSchoolId();
|
|
|
+ Long schoolId = 2L;
|
|
|
BasicSchool basicSchool = commonCacheService.schoolCache(schoolId);
|
|
|
log.info("请求分布式印刷试卷配置");
|
|
|
JSONObject printOpenParams = new JSONObject();
|
|
@@ -54,9 +55,9 @@ public class CallPrintOpenApiServiceImpl implements CallPrintOpenApiService {
|
|
|
PaperConfig paperConfig = new PaperConfig();
|
|
|
if (Objects.nonNull(callResult)) {
|
|
|
log.info("callResult:{}", JacksonUtil.parseJson(callResult));
|
|
|
- Result result = JSON.parseObject(callResult,Result.class);
|
|
|
+ Result result = JSON.parseObject(callResult, Result.class);
|
|
|
Object data = result.getData();
|
|
|
- paperConfig = JSON.parseObject(JSON.toJSONString(data),PaperConfig.class);
|
|
|
+ paperConfig = JSON.parseObject(JSON.toJSONString(data), PaperConfig.class);
|
|
|
}
|
|
|
return paperConfig;
|
|
|
}
|
|
@@ -76,9 +77,9 @@ public class CallPrintOpenApiServiceImpl implements CallPrintOpenApiService {
|
|
|
List<PaperDimension> paperDimensionList = new ArrayList<>();
|
|
|
if (Objects.nonNull(callResult)) {
|
|
|
log.info("callResult:{}", JacksonUtil.parseJson(callResult));
|
|
|
- Result result = JSON.parseObject(callResult,Result.class);
|
|
|
+ Result result = JSON.parseObject(callResult, Result.class);
|
|
|
Object data = result.getData();
|
|
|
- paperDimensionList = JSON.parseArray(JSON.toJSONString(data),PaperDimension.class);
|
|
|
+ paperDimensionList = JSON.parseArray(JSON.toJSONString(data), PaperDimension.class);
|
|
|
}
|
|
|
return paperDimensionList;
|
|
|
}
|
|
@@ -98,9 +99,9 @@ public class CallPrintOpenApiServiceImpl implements CallPrintOpenApiService {
|
|
|
List<PaperStructure> paperStructureList = new ArrayList<>();
|
|
|
if (Objects.nonNull(callResult)) {
|
|
|
log.info("callResult:{}", JacksonUtil.parseJson(callResult));
|
|
|
- Result result = JSON.parseObject(callResult,Result.class);
|
|
|
+ Result result = JSON.parseObject(callResult, Result.class);
|
|
|
Object data = result.getData();
|
|
|
- paperStructureList = JSON.parseArray(JSON.toJSONString(data),PaperStructure.class);
|
|
|
+ paperStructureList = JSON.parseArray(JSON.toJSONString(data), PaperStructure.class);
|
|
|
}
|
|
|
return paperStructureList;
|
|
|
}
|
|
@@ -120,9 +121,9 @@ public class CallPrintOpenApiServiceImpl implements CallPrintOpenApiService {
|
|
|
List<PaperEvaluation> paperEvaluationList = new ArrayList<>();
|
|
|
if (Objects.nonNull(callResult)) {
|
|
|
log.info("callResult:{}", JacksonUtil.parseJson(callResult));
|
|
|
- Result result = JSON.parseObject(callResult,Result.class);
|
|
|
+ Result result = JSON.parseObject(callResult, Result.class);
|
|
|
Object data = result.getData();
|
|
|
- paperEvaluationList = JSON.parseArray(JSON.toJSONString(data),PaperEvaluation.class);
|
|
|
+ paperEvaluationList = JSON.parseArray(JSON.toJSONString(data), PaperEvaluation.class);
|
|
|
}
|
|
|
return paperEvaluationList;
|
|
|
}
|
|
@@ -139,20 +140,20 @@ public class CallPrintOpenApiServiceImpl implements CallPrintOpenApiService {
|
|
|
List<ExamStudentScore> examStudentScoreList = new ArrayList<>();
|
|
|
List<ExamStudentScore> examStudentScoreCell = new ArrayList<>();
|
|
|
int pageNumber = 1;
|
|
|
- do{
|
|
|
- printOpenParams.put("pageNumber",pageNumber);
|
|
|
+ do {
|
|
|
+ printOpenParams.put("pageNumber", pageNumber);
|
|
|
long timestamp = System.currentTimeMillis();
|
|
|
String accessToken = SignatureEntity.build(SignatureType.SECRET, SystemConstant.METHOD, dictionaryConfig.printOpenDomain().getExamStudentScore(), timestamp, basicSchool.getAccessKey(), basicSchool.getAccessSecret());
|
|
|
String callResult = HttpUtil.postJson(dictionaryConfig.printOpenDomain().getHostUrl() + dictionaryConfig.printOpenDomain().getExamStudentScore(), JacksonUtil.parseJson(printOpenParams), accessToken, timestamp);
|
|
|
if (Objects.nonNull(callResult)) {
|
|
|
log.info("callResult:{}", JacksonUtil.parseJson(callResult));
|
|
|
- Result result = JSON.parseObject(callResult,Result.class);
|
|
|
+ Result result = JSON.parseObject(callResult, Result.class);
|
|
|
Object data = result.getData();
|
|
|
- examStudentScoreCell = JSON.parseArray(JSON.toJSONString(data),ExamStudentScore.class);
|
|
|
+ examStudentScoreCell = JSON.parseArray(JSON.toJSONString(data), ExamStudentScore.class);
|
|
|
examStudentScoreList.addAll(examStudentScoreCell);
|
|
|
}
|
|
|
- pageNumber ++;
|
|
|
- }while (examStudentScoreCell.size() > 0);
|
|
|
+ pageNumber++;
|
|
|
+ } while (examStudentScoreCell.size() > 0);
|
|
|
return examStudentScoreList;
|
|
|
}
|
|
|
|