diff --git a/src/main/java/cokr/xit/adds/cmm/model/NimsApiRequest.java b/src/main/java/cokr/xit/adds/cmm/model/NimsApiRequest.java index 5fcbabf..f68b204 100644 --- a/src/main/java/cokr/xit/adds/cmm/model/NimsApiRequest.java +++ b/src/main/java/cokr/xit/adds/cmm/model/NimsApiRequest.java @@ -3,11 +3,8 @@ package cokr.xit.adds.cmm.model; import java.util.List; import org.apache.commons.lang3.StringUtils; -import org.springmodules.validation.bean.conf.loader.annotation.handler.NotEmpty; -import lombok.Builder; import lombok.Data; -import lombok.Setter; /** *
@@ -152,6 +149,11 @@ public class NimsApiRequest { */ private String pn; + /** + * 마약류취급자번호 + */ + private String bc; + /** ** DB 조회 skip 여부 @@ -296,7 +298,12 @@ public class NimsApiRequest { /** * 유효기간 */ - private String prdValidDe; + private String vd; + + /** + * 마약류취급자번호 + */ + private String bc; /** * 제조번호 diff --git a/src/main/java/cokr/xit/adds/nims/DsuseProductAndSeqQuery.java b/src/main/java/cokr/xit/adds/nims/DsuseProductAndSeqQuery.java new file mode 100644 index 0000000..310726c --- /dev/null +++ b/src/main/java/cokr/xit/adds/nims/DsuseProductAndSeqQuery.java @@ -0,0 +1,33 @@ +package cokr.xit.adds.nims; + +import cokr.xit.foundation.component.QueryRequest; + +/** +* 제품 및 일련번호 조회 팝업 요청 +*/ +public class DsuseProductAndSeqQuery extends QueryRequest{ + + private static final long serialVersionUID = 1L; + + + private String openPage; // 검색 폐기관리 id + private String bsshCd; // 검색 폐기관리 id + + public String getOpenPage() { + return ifEmpty(openPage, () -> null); + } + + publicT setOpenPage(String openPage) { + this.openPage = openPage; + return self(); + } + + public String getBsshCd() { + return ifEmpty(bsshCd, () -> null); + } + + public T setBsshCd(String bsshCd) { + this.bsshCd = bsshCd; + return self(); + } +} 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 9a27b15..b9f2fb9 100644 --- a/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java +++ b/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java @@ -51,6 +51,7 @@ import cokr.xit.adds.nims.DsuseMgtDocQuery; import cokr.xit.adds.nims.DsuseMgtReceiptQuery; import cokr.xit.adds.nims.DsuseMgtRsltQuery; import cokr.xit.adds.nims.DsuseMgtStatisticsQuery; +import cokr.xit.adds.nims.DsuseProductAndSeqQuery; import cokr.xit.adds.nims.service.AddsNimsService; import cokr.xit.adds.nims.service.ApiKeyService; import cokr.xit.adds.nims.service.DsuseMgtDocService; @@ -592,14 +593,15 @@ public class AddsNimsController extends ApplicationController { } @RequestMapping(value = "/product-popup.do", name="마약류 제품 조회 팝업") - public ModelAndView productPopup(String openPage) { + public ModelAndView productPopup(DsuseProductAndSeqQuery query) { ModelAndView mav = new ModelAndView("adds/nims/product-popup"); return mav - .addObject("pageName", "productMain") // View(jsp)에서 사용할 id 뒤에 붙일 suffix + .addObject("pageName", "productPopup") // View(jsp)에서 사용할 id 뒤에 붙일 suffix .addObject("infoPrefix", "product") // prefix .addObject("infoPrefixUrl", "/adds/nims") // prefixUrl - .addObject("openPage", openPage); + .addObject("openPage", query.getOpenPage()) + .addObject("bsshCd", query.getBsshCd()); } //------------------------------------------------------------------------------------------------- // 마약류폐기보고 팝업 diff --git a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-edit.jsp b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-edit.jsp index cb10fb8..787603c 100644 --- a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-edit.jsp +++ b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-edit.jsp @@ -363,14 +363,18 @@ $P.productControl.getProductInfo = () => { let dialogTitle = "마약류 제품 조회"; - let params = {openPage : "product--${pageName}"}; + let rowData = $P.bsshFormFields.get(); + let params = { + openPage : "product--${pageName}" + , bsshCd: rowData.bsshCd + }; ajax.get({ url : wctx.url("/adds/nims/product-popup.do") , data : params , success : resp => { dialog.open({ - id : "productMainDialog" + id : "productPopupDialog" , title : dialogTitle , content : resp , size : $P.productControl.infoSize 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 522ce88..b42b493 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 @@ -14,6 +14,7 @@ + @@ -68,6 +67,7 @@@@ -332,14 +333,25 @@ $P.productControl.getProductInfo = () => { let dialogTitle = "마약류 제품 조회"; - let params = {openPage : "product--${pageName}"}; + let rowData = $P.bsshFormFields.get(); + if(rowData.bsshCd == null || rowData.bsshCd == "") { + dialog.alert({ + content: "업체를 먼저 선택해주세요." + }); + return false; + } + + let params = { + openPage : "product--${pageName}" + , bsshCd : rowData.bsshCd + }; ajax.get({ url : wctx.url("/adds/nims/product-popup.do") , data : params , success : resp => { dialog.open({ - id : "productMainDialog" + id : "productPopupDialog" , title : dialogTitle , content : resp , size : $P.productControl.infoSize diff --git a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-main.jsp b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-main.jsp index 8ee0f5a..1dc9f29 100644 --- a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-main.jsp @@ -308,27 +308,6 @@ dsuseAcdtDe: row.DSUSE_ACDT_DE, prgrsSttsCd: row.PRGRS_STTS_CD }; - // let productDS = $P.detailControl.dataset.getDataset(); - // if(productDS.length > 0){ - // let newArr = []; - // for(let product of productDS){ - // let newObj = {}; - // newObj.dscdmngSn = product.DSCDMNG_SN; - // newObj.prductNm = product.PRDUCT_NM; - // newObj.prductCd = product.PRDUCT_CD; - // newObj.prdValidDe = product.PRD_VALID_DE; - // newObj.mnfNo = product.MNF_NO; - // newObj.mnfSeq = product.MNF_SEQ; - // newObj.minDistbQy = product.MIN_DISTB_QY; - // newObj.minDistbUnit = product.MIN_DISTB_UNIT; - // newObj.pceQy = product.PCE_QY; - // newObj.pceUnit = product.PCE_UNIT; - // newObj.dsuseQy = product.DSUSE_QY; - // newArr.push(newObj); - // } - // params.productList = JSON.stringify(newArr); - // - // } } ajax.get({ diff --git a/src/main/webapp/WEB-INF/jsp/adds/nims/product-popup.jsp b/src/main/webapp/WEB-INF/jsp/adds/nims/product-popup.jsp index 5423c8e..d5a92d1 100644 --- a/src/main/webapp/WEB-INF/jsp/adds/nims/product-popup.jsp +++ b/src/main/webapp/WEB-INF/jsp/adds/nims/product-popup.jsp @@ -16,8 +16,7 @@- - +@@ -195,7 +192,7 @@ - $P.detailControl = new DatasetControl({ + $P.seqInfoControl = new DatasetControl({ urls : { load : wctx.url("/adds/nims/getNimsProductSeqInfo.do"), // 시리얼번호 검색 } @@ -227,7 +224,7 @@ }); // $P.control 설정 - $P.detailControl.defaultFetchSize = FETCH_MD; // 1 페이지당 조회되는 자료 건수 index.jsp에서 확인 FETCH_XS = 30 + $P.seqInfoControl.defaultFetchSize = FETCH_MD; // 1 페이지당 조회되는 자료 건수 index.jsp에서 확인 FETCH_XS = 30 @@ -254,7 +251,7 @@ // 현재 선택 자료 변경 이벤트 $P.control.onCurrentChange = item => { if (!item) { - $P.detailControl.setData([]); + $P.seqInfoControl.setData([]); $("#btnSearch3--${pageName}").prop("disabled", true); return; } @@ -267,7 +264,7 @@ } // 현재 선택 자료 변경 이벤트 - $P.detailControl.onCurrentChange = (item) => { + $P.seqInfoControl.onCurrentChange = (item) => { if (!item) return; let key = item.data.keyCnt; @@ -275,11 +272,11 @@ $("#tbody--${pageName}Detail").setCurrentRow(key); }; - $P.detailControl.onDatasetChange = (obj, option) => { + $P.seqInfoControl.onDatasetChange = (obj, option) => { $P.renderDetailList(obj.totalCount, option); $("#${infoPrefix}DetailPaging--${pageName}").setPagingInfo({ - list: $P.detailControl.dataset + list: $P.seqInfoControl.dataset , prefix: "${infoPrefix}DetailPaging--${pageName}" , totalSize: obj.totalCount }); @@ -322,7 +319,7 @@ } $P.renderDetailList = (totalSize, option) => { - let ${infoPrefix}DetailList = $P.detailControl.dataset; + let ${infoPrefix}DetailList = $P.seqInfoControl.dataset; let empty = ${infoPrefix}DetailList.empty; let trs = empty ? @@ -330,12 +327,12 @@ ${infoPrefix}DetailList.inStrings( document.getElementById("${infoPrefix}Row--${pageName}Detail").innerHTML, <%-- from template#${infoPrefix}Row --%> (str, dataItem) => str - .replace(/{onclick}/gi, "pageObject['${pageName}'].detailControl.setCurrent('" + dataItem.getValue("keyCnt") + "');") + .replace(/{onclick}/gi, "pageObject['${pageName}'].seqInfoControl.setCurrent('" + dataItem.getValue("keyCnt") + "');") .replace(/{ondblclick}/gi, "pageObject['${pageName}'].fnSave()") ); let noMore = (${infoPrefix}DetailList.length >= totalSize); - let initScroll = ($P.detailControl.query.pageNum < 2); + let initScroll = ($P.seqInfoControl.query.pageNum < 2); $("#table-responsive-1--${pageName}")[0].changeContent(trs.join(), initScroll, noMore); @@ -349,12 +346,12 @@ * 버튼 clickEvent **************************************************************************/ //그리드(좌)조회(새로 조회) - $P.fnSearchList = (dbSkipYn) => { + $P.fnSearchList = () => { $P.control.query = { ... $P.formFields.get(), p: $P.formFields.get().schProductCd, pn: $P.formFields.get().schProductNm, - dbSkipYn: dbSkipYn? dbSkipYn : "N", + bc: '${bsshCd}', //업체코드 userId: "${currentUser.account}" }; $P.control.query.fetchSize = FETCH_XXL; // 한번에 조회되는 자료 건수 @@ -364,34 +361,35 @@ } //그리드(우)조회(새로 조회) $P.fnDetailSearchList = () => { - $P.detailControl.query = { - fg: $('#schOpt--productMain').val(), // 1-제조번호, 2-시리얼번호 + $P.seqInfoControl.query = { + fg: $('#schOpt--productPopup').val(), // 1-제조번호, 2-시리얼번호 pg: 1, - p: $P.control.dataset.getCurrent().prductCd , //제품코드 - prdValidDe: $("input[name='schPrdValidDe']").val().replaceAll("-", ""), - t: $('#schText--productMain').val(), //제조번호 또는 시리얼번호 + p: $P.control.dataset.getCurrent().prductCd , //제품코드 + t: $('#schText--productPopup').val(), //제조번호 또는 시리얼번호 + vd: $("input[name='schPrdValidDe']").val().replaceAll("-", ""), + bc: '${bsshCd}', //업체코드 userId: "${currentUser.account}" }; - $P.detailControl.query.fetchSize = FETCH_MD; // 한번에 조회되는 자료 건수 - $P.detailControl.query.delYn = "N"; // 삭제 여부 + $P.seqInfoControl.query.fetchSize = FETCH_MD; // 한번에 조회되는 자료 건수 + $P.seqInfoControl.query.delYn = "N"; // 삭제 여부 - $P.detailControl.load(1); + $P.seqInfoControl.load(1); } //그리드(우)조회(스크롤) $P.scrollDetailDataList = () => { - $P.detailControl.query.pg = $P.detailControl.query.pageNum + 1; - $P.detailControl.load($P.detailControl.query.pageNum + 1); + $P.seqInfoControl.query.pg = $P.seqInfoControl.query.pageNum + 1; + $P.seqInfoControl.load($P.seqInfoControl.query.pageNum + 1); } // 저장 $P.fnSave = () => { let openPage = new AddsFormFields("#${openPage}"); - productData = {...$P.control.getCurrent(), ...$P.detailControl.getCurrent()} + productData = {...$P.control.getCurrent(), ...$P.seqInfoControl.getCurrent()} openPage.set (null,productData); // formFields - dialog.close("productMainDialog"); + dialog.close("productPopupDialog"); } /************************************************************************** @@ -415,7 +413,6 @@ // 버튼 이벤트 $("#btnSave--${pageName}").on("click", () => $P.fnSave()); // 저장 $("#btnSearch--${pageName}").on("click", () => $P.fnSearchList()); - $("#btnSearch2--${pageName}").on("click", () => $P.fnSearchList("Y")); $("#btnSearch3--${pageName}").on("click", () => $P.fnDetailSearchList()); $("#frmSearch--${pageName} input").onEnterPress($P.fnSearchList);