diff --git a/src/main/java/cokr/xit/adds/cmm/model/ApiUtil.java b/src/main/java/cokr/xit/adds/cmm/model/ApiUtil.java index 2bf3181..d7c8cb9 100644 --- a/src/main/java/cokr/xit/adds/cmm/model/ApiUtil.java +++ b/src/main/java/cokr/xit/adds/cmm/model/ApiUtil.java @@ -44,6 +44,16 @@ public class ApiUtil { return rslt.body(); } + public static String callNimsApiFromJSON(String uri, T cls) { + HttpResponse rslt = new WebClient().post(request -> { + request.contentType(WebClient.Request.ContentType.JSON); + request.uri(uri); + toData(request, cls); + System.out.println("request : " + request); + }); + return rslt.body(); + } + /** * Object -> data로 변환 * @param request WebClient.Request diff --git a/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java b/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java index 1cd0c51..9a27b15 100644 --- a/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java +++ b/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java @@ -704,7 +704,7 @@ public class AddsNimsController extends ApplicationController { @RequestMapping(value = "/modifyMappingDsuseMgt.do", name="폐기보고 확인 정보 저장", produces = "application/json;charset=UTF-8") public @ResponseBody ApiBaseResponse> modifyMappingDsuseMgt(@ModelAttribute NimsApiRequest.DsuseMgtMappingReq dto) { - String rslt = ApiUtil.callNimsApi(apiHost + modifyMappingDsuseMgtEndpoint, dto); + String rslt = ApiUtil.callNimsApiFromJSON(apiHost + modifyMappingDsuseMgtEndpoint, dto); return json.parse(rslt, new TypeReference<>() {}); } //------------------------------------------------------------------------------------------------- diff --git a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtMapping-info.jsp b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtMapping-info.jsp index f09451a..1ff12dd 100644 --- a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtMapping-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtMapping-info.jsp @@ -402,7 +402,7 @@ ajax.post({ url: wctx.url("/adds/nims/modifyMappingDsuseMgt.do") - , data: JSON.stringify({ + , data: { dscdmngId: $P.formFields.get().dscdmngId, prgrsSttsCd: "21", usrRptIdNo: $P.mappingControl.dataset.getCurrent().usrRptIdNo, @@ -410,8 +410,7 @@ rptTyCd: $P.mappingControl.dataset.getCurrent().rptTyCd, stts: $P.mappingControl.dataset.getCurrent().status, userId: "${currentUser.account}" - }) - , contentType : "application/json; charset=utf-8" + } , success: resp => { if(!resp.success){ dialog.alert({