fix: barcode 입력 fix

dev
Jonguk. Lim 4 months ago
parent 12e9617b1b
commit 39d7bfdc44

@ -19,7 +19,8 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView; 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 com.fasterxml.jackson.core.type.TypeReference;
import cokr.xit.adds.cmm.model.ApiBaseResponse; 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.DataObject;
import cokr.xit.foundation.data.JSON; import cokr.xit.foundation.data.JSON;
import cokr.xit.foundation.web.WebClient; import cokr.xit.foundation.web.WebClient;
import net.minidev.json.JSONObject;
import net.minidev.json.parser.ParseException;
@Controller @Controller
@RequestMapping( @RequestMapping(
@ -585,29 +584,32 @@ public class AddsNimsController extends ApplicationController {
//TODO : 서버통신으로 변경 할것 //TODO : 서버통신으로 변경 할것
@RequestMapping(value = "/getNimsBsshInfoSt.do", name="업체(마약류취급자) 검색", produces = "application/json;charset=UTF-8") @RequestMapping(value = "/getNimsBsshInfoSt.do", name="업체(마약류취급자) 검색", produces = "application/json;charset=UTF-8")
public @ResponseBody ApiBaseResponse<List<JSONObject>> getNimsBsshInfoSt(@ModelAttribute NimsApiRequest.BsshInfoReq dto) throws JsonProcessingException, ParseException { public @ResponseBody ApiBaseResponse<List<JSONObject>> getNimsBsshInfoSt(@ModelAttribute NimsApiRequest.BsshInfoReq dto) {
String rslt = ApiUtil.callNimsApi(apiHost + bsshInfoEndpoint, dto); String rslt = ApiUtil.callNimsApi(apiHost + bsshInfoEndpoint, dto);
return json.parse(rslt, new TypeReference<>() {}); return json.parse(rslt, new TypeReference<>() {});
} }
@RequestMapping(value = "/getNimsProductInfoKd.do", name="제품 검색", produces = "application/json;charset=UTF-8") @RequestMapping(value = "/getNimsProductInfoKd.do", name="제품 검색", produces = "application/json;charset=UTF-8")
public @ResponseBody ApiBaseResponse<List<JSONObject>> getNimsProductInfoKd(@ModelAttribute NimsApiRequest.ProductInfoReq dto) throws JsonProcessingException, ParseException { public @ResponseBody ApiBaseResponse<List<JSONObject>> getNimsProductInfoKd(@ModelAttribute NimsApiRequest.ProductInfoReq dto) {
String rslt = ApiUtil.callNimsApi(apiHost + productInfoEndpoint, dto); String rslt = ApiUtil.callNimsApi(apiHost + productInfoEndpoint, dto);
return json.parse(rslt, new TypeReference<>() {}); return json.parse(rslt, new TypeReference<>() {});
} }
@RequestMapping(value = "/getNimsProductSeqInfo.do", name="제품 시리얼번호 검색", produces = "application/json;charset=UTF-8") @RequestMapping(value = "/getNimsProductSeqInfo.do", name="제품 시리얼번호 검색", produces = "application/json;charset=UTF-8")
public @ResponseBody ApiBaseResponse<List<JSONObject>> getNimsProductSeqInfo(@ModelAttribute NimsApiRequest.MnfSeqInfoReq dto) throws JsonProcessingException, ParseException { public @ResponseBody ApiBaseResponse<List<JSONObject>> getNimsProductSeqInfo(@ModelAttribute NimsApiRequest.MnfSeqInfoReq dto) {
String rslt = ApiUtil.callNimsApi(apiHost + productSeqInfoEndpoint, dto); String rslt = ApiUtil.callNimsApi(apiHost + productSeqInfoEndpoint, dto);
return json.parse(rslt, new TypeReference<>() {}); return json.parse(rslt, new TypeReference<>() {});
} }
@RequestMapping(value = "/getNimsPrdMnfSeqInfoOfBarcode.do", name="NIMS 바코드 조회", produces = "application/json;charset=UTF-8") @RequestMapping(value = "/getNimsPrdMnfSeqInfoOfBarcode.do", name="NIMS 바코드 조회", produces = "application/json;charset=UTF-8")
public @ResponseBody ApiBaseResponse<JSONObject> getNimsPrdMnfSeqInfoOfBarcode(@RequestParam String barcodeStr) throws JsonProcessingException, ParseException { public @ResponseBody ApiBaseResponse<JSONObject> getNimsPrdMnfSeqInfoOfBarcode(
@RequestParam String barcodeStr,
@RequestParam String userId) {
HttpResponse<String> apiRslt = new WebClient().post(request -> { HttpResponse<String> apiRslt = new WebClient().post(request -> {
request.contentType(WebClient.Request.ContentType.FORM); request.contentType(WebClient.Request.ContentType.FORM);
request.uri(apiHost + prdMnfSeqInfoOfBarcodeEndpoint); request.uri(apiHost + prdMnfSeqInfoOfBarcodeEndpoint);
request.data("barcodeStr", barcodeStr); request.data("barcodeStr", barcodeStr);
request.data("userId", userId);
}); });
String rslt = apiRslt.body(); String rslt = apiRslt.body();
@ -615,7 +617,7 @@ public class AddsNimsController extends ApplicationController {
} }
@RequestMapping(value = "/getNimsProductInfoKdAndMnfSeqInfo.do", name="제품 & 시리얼번호 검색", produces = "application/json;charset=UTF-8") @RequestMapping(value = "/getNimsProductInfoKdAndMnfSeqInfo.do", name="제품 & 시리얼번호 검색", produces = "application/json;charset=UTF-8")
public @ResponseBody ApiBaseResponse<List<JSONObject>> getNimsProductInfoKdAndMnfSeqInfo(@ModelAttribute NimsApiRequest.ProductInfoReq dto) throws JsonProcessingException, ParseException { public @ResponseBody ApiBaseResponse<List<JSONObject>> getNimsProductInfoKdAndMnfSeqInfo(@ModelAttribute NimsApiRequest.ProductInfoReq dto) {
String rslt = ApiUtil.callNimsApi(apiHost + productAndseqInfoEndpoint, dto); String rslt = ApiUtil.callNimsApi(apiHost + productAndseqInfoEndpoint, dto);
return json.parse(rslt, new TypeReference<>() {}); return json.parse(rslt, new TypeReference<>() {});
} }

@ -575,7 +575,10 @@
if(barcode.length > 20){ if(barcode.length > 20){
ajax.get({ ajax.get({
url : wctx.url("/adds/nims/getNimsPrdMnfSeqInfoOfBarcode.do") url : wctx.url("/adds/nims/getNimsPrdMnfSeqInfoOfBarcode.do")
, data : {barcodeStr : barcode} , data : {
barcodeStr : barcode,
userId : "${currentUser.account}"
}
, success : obj => { , success : obj => {
if (!obj.success){ if (!obj.success){
dialog.alert(obj.message); dialog.alert(obj.message);

Loading…
Cancel
Save