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 22f94cd..dd2a393 100644 --- a/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java +++ b/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java @@ -19,7 +19,8 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; -import com.fasterxml.jackson.core.JsonProcessingException; +import net.minidev.json.JSONObject; + import com.fasterxml.jackson.core.type.TypeReference; import cokr.xit.adds.cmm.model.ApiBaseResponse; @@ -49,8 +50,6 @@ import cokr.xit.base.web.ApplicationController; import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.JSON; import cokr.xit.foundation.web.WebClient; -import net.minidev.json.JSONObject; -import net.minidev.json.parser.ParseException; @Controller @RequestMapping( @@ -585,29 +584,32 @@ public class AddsNimsController extends ApplicationController { //TODO : 서버통신으로 변경 할것 @RequestMapping(value = "/getNimsBsshInfoSt.do", name="업체(마약류취급자) 검색", produces = "application/json;charset=UTF-8") - public @ResponseBody ApiBaseResponse> getNimsBsshInfoSt(@ModelAttribute NimsApiRequest.BsshInfoReq dto) throws JsonProcessingException, ParseException { + public @ResponseBody ApiBaseResponse> getNimsBsshInfoSt(@ModelAttribute NimsApiRequest.BsshInfoReq dto) { String rslt = ApiUtil.callNimsApi(apiHost + bsshInfoEndpoint, dto); return json.parse(rslt, new TypeReference<>() {}); } @RequestMapping(value = "/getNimsProductInfoKd.do", name="제품 검색", produces = "application/json;charset=UTF-8") - public @ResponseBody ApiBaseResponse> getNimsProductInfoKd(@ModelAttribute NimsApiRequest.ProductInfoReq dto) throws JsonProcessingException, ParseException { + public @ResponseBody ApiBaseResponse> getNimsProductInfoKd(@ModelAttribute NimsApiRequest.ProductInfoReq dto) { String rslt = ApiUtil.callNimsApi(apiHost + productInfoEndpoint, dto); return json.parse(rslt, new TypeReference<>() {}); } @RequestMapping(value = "/getNimsProductSeqInfo.do", name="제품 시리얼번호 검색", produces = "application/json;charset=UTF-8") - public @ResponseBody ApiBaseResponse> getNimsProductSeqInfo(@ModelAttribute NimsApiRequest.MnfSeqInfoReq dto) throws JsonProcessingException, ParseException { + public @ResponseBody ApiBaseResponse> getNimsProductSeqInfo(@ModelAttribute NimsApiRequest.MnfSeqInfoReq dto) { String rslt = ApiUtil.callNimsApi(apiHost + productSeqInfoEndpoint, dto); return json.parse(rslt, new TypeReference<>() {}); } @RequestMapping(value = "/getNimsPrdMnfSeqInfoOfBarcode.do", name="NIMS 바코드 조회", produces = "application/json;charset=UTF-8") - public @ResponseBody ApiBaseResponse getNimsPrdMnfSeqInfoOfBarcode(@RequestParam String barcodeStr) throws JsonProcessingException, ParseException { + public @ResponseBody ApiBaseResponse getNimsPrdMnfSeqInfoOfBarcode( + @RequestParam String barcodeStr, + @RequestParam String userId) { HttpResponse apiRslt = new WebClient().post(request -> { request.contentType(WebClient.Request.ContentType.FORM); request.uri(apiHost + prdMnfSeqInfoOfBarcodeEndpoint); request.data("barcodeStr", barcodeStr); + request.data("userId", userId); }); String rslt = apiRslt.body(); @@ -615,7 +617,7 @@ public class AddsNimsController extends ApplicationController { } @RequestMapping(value = "/getNimsProductInfoKdAndMnfSeqInfo.do", name="제품 & 시리얼번호 검색", produces = "application/json;charset=UTF-8") - public @ResponseBody ApiBaseResponse> getNimsProductInfoKdAndMnfSeqInfo(@ModelAttribute NimsApiRequest.ProductInfoReq dto) throws JsonProcessingException, ParseException { + public @ResponseBody ApiBaseResponse> getNimsProductInfoKdAndMnfSeqInfo(@ModelAttribute NimsApiRequest.ProductInfoReq dto) { String rslt = ApiUtil.callNimsApi(apiHost + productAndseqInfoEndpoint, dto); return json.parse(rslt, new TypeReference<>() {}); } diff --git a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-info.jsp b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-info.jsp index 924699a..7deaa09 100644 --- a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-info.jsp @@ -575,7 +575,10 @@ if(barcode.length > 20){ ajax.get({ url : wctx.url("/adds/nims/getNimsPrdMnfSeqInfoOfBarcode.do") - , data : {barcodeStr : barcode} + , data : { + barcodeStr : barcode, + userId : "${currentUser.account}" + } , success : obj => { if (!obj.success){ dialog.alert(obj.message);