|
|
|
|
@ -264,4 +264,42 @@ public class PendingCRMApplicationsService {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ResponseEntity<String> getPendingBussinessApplication(
|
|
|
|
|
InProcessApplicationsRequestDTO req, Long workFlowRefNum, String token, String susUserCode) {
|
|
|
|
|
|
|
|
|
|
String url = crmURI + "/crm" + "/mongodb/lazylist";
|
|
|
|
|
|
|
|
|
|
LazyListRequestDTO dto = BusinessBuildLazyListPayload(req);
|
|
|
|
|
|
|
|
|
|
Map<String, Object> bussinessFilter = Map.of(
|
|
|
|
|
"params", List.of(
|
|
|
|
|
param("workFlowRefNum", workFlowRefNum, "numeric", "=")
|
|
|
|
|
),
|
|
|
|
|
"operator", "$and"
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
Map<String, Object> existingFilter = (Map<String, Object>) dto.getFilter();
|
|
|
|
|
|
|
|
|
|
List<Object> nestedQuery = new ArrayList<>((List<Object>) existingFilter.get("nestedQuery"));
|
|
|
|
|
|
|
|
|
|
nestedQuery.add(bussinessFilter);
|
|
|
|
|
|
|
|
|
|
dto.setFilter(Map.of("nestedQuery", nestedQuery, "operator", "$and"));
|
|
|
|
|
|
|
|
|
|
dto.setLimit(1);
|
|
|
|
|
|
|
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
|
|
headers.set("Authorization", token);
|
|
|
|
|
headers.set("POR_ORGACODE", req.getPorOrgacode());
|
|
|
|
|
headers.set("SUS_USERCODE", susUserCode);
|
|
|
|
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
|
|
|
|
|
|
|
|
|
return restTemplate.exchange(
|
|
|
|
|
url,
|
|
|
|
|
HttpMethod.POST,
|
|
|
|
|
new HttpEntity<>(dto, headers),
|
|
|
|
|
String.class
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|