|
@@ -13,9 +13,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.http.HttpEntity;
|
|
|
import org.springframework.http.HttpHeaders;
|
|
|
+import org.springframework.http.MediaType;
|
|
|
+import org.springframework.http.converter.StringHttpMessageConverter;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
+import java.nio.charset.Charset;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -78,11 +81,12 @@ public class FinalReportService {
|
|
|
List<FinalReport> finalReports = finalReportDao.findByExamIdAndCaseId(task.getExamId(), task.getCaseId());
|
|
|
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
- headers.set("Content-Type", "application/json");
|
|
|
+ headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
|
|
|
|
|
|
JSONObject reportJson = genJsonForExport(task, finalReports);
|
|
|
HttpEntity<String> request = new HttpEntity<>(reportJson.toJSONString(), headers);
|
|
|
RestTemplate rt = HttpUtil.getRestTemplate();
|
|
|
+
|
|
|
String url = rt.postForObject(reportExportAddr, request, String.class);
|
|
|
return url;
|
|
|
}
|