|
|
|
@ -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<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);
|
|
|
|
|
return json.parse(rslt, new TypeReference<>() {});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@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);
|
|
|
|
|
return json.parse(rslt, new TypeReference<>() {});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@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);
|
|
|
|
|
return json.parse(rslt, new TypeReference<>() {});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@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 -> {
|
|
|
|
|
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<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);
|
|
|
|
|
return json.parse(rslt, new TypeReference<>() {});
|
|
|
|
|
}
|
|
|
|
|