952-2차점 특가 있는 2nd Agency 리스트
This commit is contained in:
parent
493a7c1868
commit
c07003bac8
@ -96,4 +96,11 @@ public class EstimateController {
|
||||
throws Exception {
|
||||
estimateService.excelDownload(request, response, estimateRequest);
|
||||
}
|
||||
|
||||
@Operation(description = "2차점 특가 있는 2nd Agency 목록을 조회한다.")
|
||||
@GetMapping("/agency-cust-list")
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public EstimateApiResponse selectAgencyCustList(PriceRequest priceRequest) throws Exception {
|
||||
return estimateService.selectAgencyCustList(priceRequest);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2246,4 +2246,35 @@ public class EstimateService {
|
||||
|
||||
return circuitCfg;
|
||||
}
|
||||
|
||||
public EstimateApiResponse selectAgencyCustList(PriceRequest priceRequest) throws Exception {
|
||||
// Validation
|
||||
|
||||
if (StringUtils.isEmpty(priceRequest.getSapSalesStoreCd())) {
|
||||
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
|
||||
message.getMessage("common.message.required.data", "Sap Sale Store Code"));
|
||||
}
|
||||
|
||||
|
||||
EstimateApiResponse response = null;
|
||||
/* [1]. QSP API (url + param) Setting */
|
||||
String url = QSP_API_URL + "/api/master/agencyCustList";
|
||||
String apiUrl = UriComponentsBuilder.fromHttpUrl(url)
|
||||
.queryParam("sapSalesStoreCd", priceRequest.getSapSalesStoreCd()).build().toUriString();
|
||||
|
||||
/* [2]. QSP API CALL -> Response */
|
||||
String strResponse = interfaceQsp.callApi(HttpMethod.GET, apiUrl, null);
|
||||
|
||||
if (!"".equals(strResponse)) {
|
||||
com.fasterxml.jackson.databind.ObjectMapper om =
|
||||
new com.fasterxml.jackson.databind.ObjectMapper()
|
||||
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
response = om.readValue(strResponse, EstimateApiResponse.class);
|
||||
} else {
|
||||
// [msg] No data
|
||||
throw new QcastException(ErrorCode.NOT_FOUND, message.getMessage("common.message.no.data"));
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user