|
@@ -146,7 +146,7 @@ public class DataSyncController extends BaseExamController {
|
|
|
int examId = getSessionExamId(request);
|
|
|
DataSync sync = dataSyncService.findByExamId(examId);
|
|
|
try {
|
|
|
- List<SubjectiveQuestionDTO> list = getPaperStruct(sync.getSubjectUrl(), sync.getCloudExamId());
|
|
|
+ List<SubjectiveQuestionDTO> list = getPaperStruct(sync);
|
|
|
new ExportExcel("主观题数据", SubjectiveQuestionDTO.class, 2).setDataList(list).write(response, "主观题数据.xlsx")
|
|
|
.dispose();
|
|
|
return null;
|
|
@@ -157,12 +157,13 @@ public class DataSyncController extends BaseExamController {
|
|
|
return new ModelAndView("redirect:/admin/exam/sync?examId=" + examId);
|
|
|
}
|
|
|
|
|
|
- private List<SubjectiveQuestionDTO> getPaperStruct(String url, Long cloudExamId) {
|
|
|
+ private List<SubjectiveQuestionDTO> getPaperStruct(DataSync sync) {
|
|
|
List<SubjectiveQuestionDTO> list = new ArrayList<SubjectiveQuestionDTO>();
|
|
|
|
|
|
- HttpUtil subjectHttp = new HttpUtil(url, secretKey, appId, rootOrgId);
|
|
|
+ HttpUtil subjectHttp = new HttpUtil(sync.getSubjectUrl(), sync.getSecretKey(), sync.getAppId(),
|
|
|
+ sync.getRootOrgId());
|
|
|
JSONObject datas = new JSONObject();
|
|
|
- datas.accumulate("examId", cloudExamId);
|
|
|
+ datas.accumulate("examId", sync.getCloudExamId());
|
|
|
String subjectResult = subjectHttp.httpAction(null, datas.toString());
|
|
|
JSONObject subjectJson = JSONObject.fromObject(subjectResult);
|
|
|
JSONArray subjectArray = subjectJson.getJSONArray("paperStructList");
|