|
|
|
|
@ -1,10 +1,10 @@
|
|
|
|
|
package com.mfsys.aconnect.client.service;
|
|
|
|
|
|
|
|
|
|
import com.mfsys.aconnect.client.dto.*;
|
|
|
|
|
import com.mfsys.aconnect.configuration.config.WebClientConfig;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.http.*;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
@ -16,10 +16,9 @@ public class PendingCRMApplicationsService {
|
|
|
|
|
@Value("${app.crm.uri}")
|
|
|
|
|
private String crmURI;
|
|
|
|
|
|
|
|
|
|
private final RestTemplate restTemplate;
|
|
|
|
|
|
|
|
|
|
public PendingCRMApplicationsService(RestTemplate restTemplate) {
|
|
|
|
|
this.restTemplate = restTemplate;
|
|
|
|
|
private final WebClientConfig webClientConfig;
|
|
|
|
|
public PendingCRMApplicationsService(WebClientConfig webClientConfig) {
|
|
|
|
|
this.webClientConfig = webClientConfig;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Map<String, Object> param(String columnName, Object columnValue, String columnType, String conditionType) {
|
|
|
|
|
@ -193,13 +192,10 @@ public class PendingCRMApplicationsService {
|
|
|
|
|
headers.set("SUS_USERCODE", susUserCode);
|
|
|
|
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
|
|
|
|
|
|
|
|
|
HttpEntity<LazyListRequestDTO> entity = new HttpEntity<>(payload, headers);
|
|
|
|
|
|
|
|
|
|
return restTemplate.exchange(
|
|
|
|
|
return webClientConfig.postForString(
|
|
|
|
|
url,
|
|
|
|
|
HttpMethod.POST,
|
|
|
|
|
entity,
|
|
|
|
|
String.class
|
|
|
|
|
payload,
|
|
|
|
|
headers
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -216,13 +212,10 @@ public class PendingCRMApplicationsService {
|
|
|
|
|
headers.set("SUS_USERCODE", susUserCode);
|
|
|
|
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
|
|
|
|
|
|
|
|
|
HttpEntity<LazyListRequestDTO> entity = new HttpEntity<>(payload, headers);
|
|
|
|
|
|
|
|
|
|
return restTemplate.exchange(
|
|
|
|
|
return webClientConfig.postForString(
|
|
|
|
|
url,
|
|
|
|
|
HttpMethod.POST,
|
|
|
|
|
entity,
|
|
|
|
|
String.class
|
|
|
|
|
payload,
|
|
|
|
|
headers
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -256,11 +249,10 @@ public class PendingCRMApplicationsService {
|
|
|
|
|
headers.set("SUS_USERCODE", susUserCode);
|
|
|
|
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
|
|
|
|
|
|
|
|
|
return restTemplate.exchange(
|
|
|
|
|
return webClientConfig.postForString(
|
|
|
|
|
url,
|
|
|
|
|
HttpMethod.POST,
|
|
|
|
|
new HttpEntity<>(dto, headers),
|
|
|
|
|
String.class
|
|
|
|
|
dto,
|
|
|
|
|
headers
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -294,11 +286,10 @@ public class PendingCRMApplicationsService {
|
|
|
|
|
headers.set("SUS_USERCODE", susUserCode);
|
|
|
|
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
|
|
|
|
|
|
|
|
|
return restTemplate.exchange(
|
|
|
|
|
return webClientConfig.postForString(
|
|
|
|
|
url,
|
|
|
|
|
HttpMethod.POST,
|
|
|
|
|
new HttpEntity<>(dto, headers),
|
|
|
|
|
String.class
|
|
|
|
|
dto,
|
|
|
|
|
headers
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|