| Line 87... |
Line 87... |
| 87 |
HttpEntity<String> requestEntity = new HttpEntity<String>("", new HttpHeaders());
|
87 |
HttpEntity<String> requestEntity = new HttpEntity<String>("", new HttpHeaders());
|
| 88 |
ResponseEntity<byte[]> responseEntity = restTemplate.exchange(builder.build().encode().toUri(), HttpMethod.GET, requestEntity, byte[].class);
|
88 |
ResponseEntity<byte[]> responseEntity = restTemplate.exchange(builder.build().encode().toUri(), HttpMethod.GET, requestEntity, byte[].class);
|
| 89 |
return new ByteArrayResource(responseEntity.getBody());
|
89 |
return new ByteArrayResource(responseEntity.getBody());
|
| 90 |
|
90 |
|
| 91 |
}
|
91 |
}
|
| - |
|
92 |
|
| - |
|
93 |
public InputStreamSource getReportInputStreamSource(ReporticoProject projectName, String reportName, Map<String, String> params) throws HttpHostConnectException, ProfitMandiBusinessException {
|
| - |
|
94 |
|
| - |
|
95 |
Map<String, String> authMap = projectAuthMap.get(projectName);
|
| - |
|
96 |
|
| - |
|
97 |
params.putAll(authMap);
|
| - |
|
98 |
params.put("xmlin", reportName);
|
| - |
|
99 |
params.put("target_format", "CSV");
|
| - |
|
100 |
params.put("execute_mode", "EXECUTE");
|
| - |
|
101 |
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(reporticoUrl);
|
| - |
|
102 |
Set<String> keys = params.keySet();
|
| - |
|
103 |
|
| - |
|
104 |
for(String key : keys){
|
| - |
|
105 |
builder.queryParam(key, params.get(key));
|
| - |
|
106 |
}
|
| - |
|
107 |
HttpEntity<String> requestEntity = new HttpEntity<String>("", new HttpHeaders());
|
| - |
|
108 |
ResponseEntity<byte[]> responseEntity = restTemplate.exchange(builder.build().encode().toUri(), HttpMethod.GET, requestEntity, byte[].class);
|
| - |
|
109 |
return new ByteArrayResource(responseEntity.getBody());
|
| - |
|
110 |
|
| - |
|
111 |
}
|
| 92 |
|
112 |
|
| 93 |
public HttpResponse getReportFile(int fofoId, ReporticoProject projectName, String reportName) throws HttpHostConnectException, ProfitMandiBusinessException {
|
113 |
public HttpResponse getReportFile(int fofoId, ReporticoProject projectName, String reportName) throws HttpHostConnectException, ProfitMandiBusinessException {
|
| 94 |
|
114 |
|
| 95 |
Map<String, String> authMap = projectAuthMap.get(projectName);
|
115 |
Map<String, String> authMap = projectAuthMap.get(projectName);
|
| 96 |
|
116 |
|