fix: 폐기보고 서버 호출로 변경

dev
Jonguk. Lim 4 months ago
parent cbcda15fbb
commit 72e657893d

@ -72,9 +72,6 @@ public class AddsNimsController extends ApplicationController {
@Value("${app.inf.nims.api.seqInfo}")
private String productSeqInfoEndpoint;
@Value("${app.inf.nims.api.productAndseqInfo}")
private String productAndseqInfoEndpoint;
@Value("${app.inf.nims.api.prdMnfSeqInfoOfBarcode}")
private String prdMnfSeqInfoOfBarcodeEndpoint;
@ -301,9 +298,166 @@ public class AddsNimsController extends ApplicationController {
return null;
}
//-------------------------------------------------------------------------------------------------
// 보고 문서 관리
//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
// menu 처리
//-------------------------------------------------------------------------------------------------
@RequestMapping(value = "/dsuseMgtReceipt.do", name="신청서 접수 메인")
public ModelAndView dsuseMgtReceiptMain() {
ModelAndView mav = new ModelAndView("adds/nims/dsuseMgtReceipt-main");
setCmmCode("ADDS11", mav);
List<DataObject> deptList = sggDeptService.getDepartmentList(new DepartmentQuery());
mav.addObject("DEPTList", deptList);
return mav
.addObject("pageName", "dsuseMgtReceipt") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
// .addObject("infoPrefix", "dsuseMgtReceipt") // prefix
// .addObject("infoPrefixUrl", "/adds/nims") // prefixUrl
;
}
@RequestMapping(value = "dsuseMgtRslt.do", name="결과[통보] 처리 메인")
public ModelAndView dsuseMgtRsltMain() {
ModelAndView mav = new ModelAndView("adds/nims/dsuseMgtRslt-main");
setCmmCode("ADDS11", mav);
List<DataObject> deptList = sggDeptService.getDepartmentList(new DepartmentQuery());
mav.addObject("DEPTList", deptList);
return mav
.addObject("pageName", "dsuseMgtRslt") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
// .addObject("infoPrefix", "dsuseMgtReceipt") // prefix
// .addObject("infoPrefixUrl", "/adds/nims") // prefixUrl
;
}
@RequestMapping(value = "/dsuseMgtMapping.do", name="폐기 보고 확인 메인")
public ModelAndView dsuseMgtMapping() {
ModelAndView mav = new ModelAndView("adds/nims/dsuseMgtMapping-main");
setCmmCode("ADDS11", mav);
List<DataObject> deptList = sggDeptService.getDepartmentList(new DepartmentQuery());
mav.addObject("DEPTList", deptList);
return mav
.addObject("pageName", "dsuseMgtMapping") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
// .addObject("infoPrefix", "dsuseMgtReceipt") // prefix
// .addObject("infoPrefixUrl", "/adds/nims") // prefixUrl
;
}
@RequestMapping(value="/makeDisposeResultReportHwp.do", name="폐기결과보고서 HWP파일 생성")
public ModelAndView makeDisposeResultReportHwp(String dtls) {
@RequestMapping(name = "폐기보고 문서 관리 메인", value = {"/dsuseMgtDoc.do"})
public ModelAndView dsuseMgtDoc() {
ModelAndView mav = new ModelAndView();
mav.setViewName("adds/nims/dsuseDoc-main");
setCmmCode("ADDS11", mav);
Map<String, List<CommonCode>> commonCodes = getCodesOf("ADDS11");
mav.addObject(
"ADDS11",
getCodesOf("ADDS11")
.get("ADDS11")
.stream()
.filter(c -> c.getCode().compareTo("06") >= 0)
.toList());
List<DataObject> deptList = sggDeptService.getDepartmentList(new DepartmentQuery());
mav.addObject("DEPTList", deptList);
mav.addObject("pageName", "dsuseMgtDoc");
mav.addObject("apiHost", apiHost);
return mav;
}
//-------------------------------------------------------------------------------------------------
// menu 호출 처리
//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
// 마약류폐기보고 팝업
//-------------------------------------------------------------------------------------------------
@RequestMapping(value = "/bssh-popup.do", name="마약류 취급 업체 조회 팝업")
public ModelAndView bsshPopup(String openPage) {
ModelAndView mav = new ModelAndView("adds/nims/bssh-popup");
return mav
.addObject("pageName", "bsshPopup") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
.addObject("infoPrefix", "bssh") // prefix
.addObject("infoPrefixUrl", "/adds/nims") // prefixUrl
.addObject("openPage", openPage)
.addObject("apiHost", apiHost);
}
@RequestMapping(value = "/product-popup.do", name="마약류 제품 조회 팝업")
public ModelAndView productPopup(String openPage) {
ModelAndView mav = new ModelAndView("adds/nims/product-popup");
return mav
.addObject("pageName", "productMain") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
.addObject("infoPrefix", "product") // prefix
.addObject("infoPrefixUrl", "/adds/nims") // prefixUrl
.addObject("openPage", openPage)
.addObject("apiHost", apiHost);
}
//-------------------------------------------------------------------------------------------------
// 마약류폐기보고 팝업
//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
// API server call
//-------------------------------------------------------------------------------------------------
@RequestMapping(value = "/getNimsBsshInfoSt.do", name="업체(마약류취급자) 검색", produces = "application/json;charset=UTF-8")
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) {
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) {
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,
@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();
return json.parse(rslt, new TypeReference<>() {});
}
//-------------------------------------------------------------------------------------------------
// API server call
//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
// private method
//-------------------------------------------------------------------------------------------------
private void setCmmCode(String grpCode, ModelAndView mav){
Map<String, List<CommonCode>> commonCodes = getCodesOf(grpCode);
mav.addObject(grpCode, commonCodes.get(grpCode));
}
private ModelAndView makeDisposeResultReportHwp(String dtls) {
ModelAndView mav = new ModelAndView();
mav.setViewName("downloadView");
@ -377,10 +531,7 @@ public class AddsNimsController extends ApplicationController {
return mav;
}
@RequestMapping(value="/makeDisposeProcessDetailsHwp.do", name="폐기 처리 내역 및 사진 HWP파일 생성")
public ModelAndView makeDisposeProcessDetailsHwp(String dtls) {
private ModelAndView makeDisposeProcessDetailsHwp(String dtls) {
ModelAndView mav = new ModelAndView();
mav.setViewName("downloadView");
@ -504,160 +655,7 @@ public class AddsNimsController extends ApplicationController {
}
return partitions;
}
//-------------------------------------------------------------------------------------------------
// 보고 문서 관리
//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
// menu 처리
//-------------------------------------------------------------------------------------------------
@RequestMapping(value = "/dsuseMgtReceipt.do", name="신청서 접수 메인")
public ModelAndView dsuseMgtReceiptMain() {
ModelAndView mav = new ModelAndView("adds/nims/dsuseMgtReceipt-main");
setCmmCode("ADDS11", mav);
List<DataObject> deptList = sggDeptService.getDepartmentList(new DepartmentQuery());
mav.addObject("DEPTList", deptList);
return mav
.addObject("pageName", "dsuseMgtReceipt") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
// .addObject("infoPrefix", "dsuseMgtReceipt") // prefix
// .addObject("infoPrefixUrl", "/adds/nims") // prefixUrl
;
}
@RequestMapping(value = "dsuseMgtRslt.do", name="결과[통보] 처리 메인")
public ModelAndView dsuseMgtRsltMain() {
ModelAndView mav = new ModelAndView("adds/nims/dsuseMgtRslt-main");
setCmmCode("ADDS11", mav);
List<DataObject> deptList = sggDeptService.getDepartmentList(new DepartmentQuery());
mav.addObject("DEPTList", deptList);
return mav
.addObject("pageName", "dsuseMgtRslt") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
// .addObject("infoPrefix", "dsuseMgtReceipt") // prefix
// .addObject("infoPrefixUrl", "/adds/nims") // prefixUrl
;
}
@RequestMapping(value = "/dsuseMgtMapping.do", name="폐기 보고 확인 메인")
public ModelAndView dsuseMgtMapping() {
ModelAndView mav = new ModelAndView("adds/nims/dsuseMgtMapping-main");
setCmmCode("ADDS11", mav);
List<DataObject> deptList = sggDeptService.getDepartmentList(new DepartmentQuery());
mav.addObject("DEPTList", deptList);
return mav
.addObject("pageName", "dsuseMgtMapping") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
// .addObject("infoPrefix", "dsuseMgtReceipt") // prefix
// .addObject("infoPrefixUrl", "/adds/nims") // prefixUrl
;
}
@RequestMapping(name = "폐기보고 문서 관리 메인", value = {"/dsuseMgtDoc.do"})
public ModelAndView dsuseMgtDoc() {
ModelAndView mav = new ModelAndView();
mav.setViewName("adds/nims/dsuseDoc-main");
setCmmCode("ADDS11", mav);
Map<String, List<CommonCode>> commonCodes = getCodesOf("ADDS11");
mav.addObject(
"ADDS11",
getCodesOf("ADDS11")
.get("ADDS11")
.stream()
.filter(c -> c.getCode().compareTo("06") >= 0)
.toList());
List<DataObject> deptList = sggDeptService.getDepartmentList(new DepartmentQuery());
mav.addObject("DEPTList", deptList);
mav.addObject("pageName", "dsuseMgtDoc");
mav.addObject("apiHost", apiHost);
return mav;
}
//-------------------------------------------------------------------------------------------------
// menu 호출 처리
//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
// 마약류폐기보고 팝업
//-------------------------------------------------------------------------------------------------
@RequestMapping(value = "/bssh-popup.do", name="마약류 취급 업체 조회 팝업")
public ModelAndView bsshPopup(String openPage) {
ModelAndView mav = new ModelAndView("adds/nims/bssh-popup");
return mav
.addObject("pageName", "bsshPopup") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
.addObject("infoPrefix", "bssh") // prefix
.addObject("infoPrefixUrl", "/adds/nims") // prefixUrl
.addObject("openPage", openPage)
.addObject("apiHost", apiHost);
}
@RequestMapping(value = "/product-popup.do", name="마약류 제품 조회 팝업")
public ModelAndView productPopup(String openPage) {
ModelAndView mav = new ModelAndView("adds/nims/product-popup");
return mav
.addObject("pageName", "productMain") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
.addObject("infoPrefix", "product") // prefix
.addObject("infoPrefixUrl", "/adds/nims") // prefixUrl
.addObject("openPage", openPage)
.addObject("apiHost", apiHost);
}
//-------------------------------------------------------------------------------------------------
// 마약류폐기보고 팝업
//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
// private method
//-------------------------------------------------------------------------------------------------
private void setCmmCode(String grpCode, ModelAndView mav){
Map<String, List<CommonCode>> commonCodes = getCodesOf(grpCode);
mav.addObject(grpCode, commonCodes.get(grpCode));
}
//-------------------------------------------------------------------------------------------------
// private method
//-------------------------------------------------------------------------------------------------
//TODO : 서버통신으로 변경 할것
@RequestMapping(value = "/getNimsBsshInfoSt.do", name="업체(마약류취급자) 검색", produces = "application/json;charset=UTF-8")
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) {
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) {
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,
@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();
return json.parse(rslt, new TypeReference<>() {});
}
}

Loading…
Cancel
Save