|
|
@ -1,6 +1,7 @@
|
|
|
|
package cokr.xit.adds.nims.web;
|
|
|
|
package cokr.xit.adds.nims.web;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.File;
|
|
|
|
|
|
|
|
import java.net.http.HttpResponse;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
@ -14,9 +15,13 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
|
|
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
|
|
|
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 net.minidev.json.JSONObject;
|
|
|
|
|
|
|
|
import net.minidev.json.parser.ParseException;
|
|
|
|
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
|
|
|
|
|
|
|
|
@ -44,8 +49,7 @@ import cokr.xit.base.user.service.SigunguDepartmentService;
|
|
|
|
import cokr.xit.base.web.ApplicationController;
|
|
|
|
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 net.minidev.json.JSONObject;
|
|
|
|
import cokr.xit.foundation.web.WebClient;
|
|
|
|
import net.minidev.json.parser.ParseException;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Controller
|
|
|
|
@Controller
|
|
|
|
@RequestMapping(
|
|
|
|
@RequestMapping(
|
|
|
@ -71,6 +75,9 @@ public class AddsNimsController extends ApplicationController {
|
|
|
|
@Value("${app.inf.nims.api.productAndseqInfo}")
|
|
|
|
@Value("${app.inf.nims.api.productAndseqInfo}")
|
|
|
|
private String productAndseqInfoEndpoint;
|
|
|
|
private String productAndseqInfoEndpoint;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Value("${app.inf.nims.api.prdMnfSeqInfoOfBarcode}")
|
|
|
|
|
|
|
|
private String prdMnfSeqInfoOfBarcodeEndpoint;
|
|
|
|
|
|
|
|
|
|
|
|
@Resource(name="sigunguDepartmentService")
|
|
|
|
@Resource(name="sigunguDepartmentService")
|
|
|
|
private SigunguDepartmentService sggDeptService;
|
|
|
|
private SigunguDepartmentService sggDeptService;
|
|
|
|
|
|
|
|
|
|
|
@ -573,6 +580,18 @@ public class AddsNimsController extends ApplicationController {
|
|
|
|
return json.parse(rslt, new TypeReference<>() {});
|
|
|
|
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 {
|
|
|
|
|
|
|
|
HttpResponse<String> apiRslt = new WebClient().post(request -> {
|
|
|
|
|
|
|
|
request.contentType(WebClient.Request.ContentType.FORM);
|
|
|
|
|
|
|
|
request.uri(apiHost + prdMnfSeqInfoOfBarcodeEndpoint);
|
|
|
|
|
|
|
|
request.data("barcodeStr", barcodeStr);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
String rslt = apiRslt.body();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return json.parse(rslt, new TypeReference<>() {});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@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) throws JsonProcessingException, ParseException {
|
|
|
|
String rslt = ApiUtil.callNimsApi(apiHost + productAndseqInfoEndpoint, dto);
|
|
|
|
String rslt = ApiUtil.callNimsApi(apiHost + productAndseqInfoEndpoint, dto);
|
|
|
|