|
@@ -10,12 +10,12 @@ import com.mooctest.util.HttpUtil;
|
|
|
import com.mooctest.util.ReportUtil;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.http.HttpEntity;
|
|
|
+import org.springframework.http.HttpHeaders;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
-import java.sql.Timestamp;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -77,9 +77,13 @@ public class FinalReportService {
|
|
|
public String getExportReportAddr(TaskDTO task) {
|
|
|
List<FinalReport> finalReports = finalReportDao.findByExamIdAndCaseId(task.getExamId(), task.getCaseId());
|
|
|
|
|
|
- RestTemplate rt = HttpUtil.getRestTemplate();
|
|
|
+ HttpHeaders headers = new HttpHeaders();
|
|
|
+ headers.set("Content-Type", "application/json");
|
|
|
+
|
|
|
JSONObject reportJson = genJsonForExport(task, finalReports);
|
|
|
- String url = rt.postForObject(reportExportAddr, reportJson.toJSONString(), String.class);
|
|
|
+ HttpEntity<String> request = new HttpEntity<>(reportJson.toJSONString(), headers);
|
|
|
+ RestTemplate rt = HttpUtil.getRestTemplate();
|
|
|
+ String url = rt.postForObject(reportExportAddr, request, String.class);
|
|
|
return url;
|
|
|
}
|
|
|
|