feat: 일련번호 조회(seqinfo_pub) API 적용

제품조회 반영(업체의 제품 조회 되도록)
main
Jonguk. Lim 3 months ago
parent 826a46e603
commit a11ceea450

@ -3,11 +3,8 @@ package cokr.xit.adds.cmm.model;
import java.util.List; import java.util.List;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springmodules.validation.bean.conf.loader.annotation.handler.NotEmpty;
import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.Setter;
/** /**
* <pre> * <pre>
@ -152,6 +149,11 @@ public class NimsApiRequest {
*/ */
private String pn; private String pn;
/**
*
*/
private String bc;
/** /**
* <pre> * <pre>
* DB skip * DB skip
@ -296,7 +298,12 @@ public class NimsApiRequest {
/** /**
* *
*/ */
private String prdValidDe; private String vd;
/**
*
*/
private String bc;
/** /**
* *

@ -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);
}
public <T extends DsuseProductAndSeqQuery> T setOpenPage(String openPage) {
this.openPage = openPage;
return self();
}
public String getBsshCd() {
return ifEmpty(bsshCd, () -> null);
}
public <T extends DsuseProductAndSeqQuery> T setBsshCd(String bsshCd) {
this.bsshCd = bsshCd;
return self();
}
}

@ -51,6 +51,7 @@ import cokr.xit.adds.nims.DsuseMgtDocQuery;
import cokr.xit.adds.nims.DsuseMgtReceiptQuery; import cokr.xit.adds.nims.DsuseMgtReceiptQuery;
import cokr.xit.adds.nims.DsuseMgtRsltQuery; import cokr.xit.adds.nims.DsuseMgtRsltQuery;
import cokr.xit.adds.nims.DsuseMgtStatisticsQuery; 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.AddsNimsService;
import cokr.xit.adds.nims.service.ApiKeyService; import cokr.xit.adds.nims.service.ApiKeyService;
import cokr.xit.adds.nims.service.DsuseMgtDocService; import cokr.xit.adds.nims.service.DsuseMgtDocService;
@ -592,14 +593,15 @@ public class AddsNimsController extends ApplicationController {
} }
@RequestMapping(value = "/product-popup.do", name="마약류 제품 조회 팝업") @RequestMapping(value = "/product-popup.do", name="마약류 제품 조회 팝업")
public ModelAndView productPopup(String openPage) { public ModelAndView productPopup(DsuseProductAndSeqQuery query) {
ModelAndView mav = new ModelAndView("adds/nims/product-popup"); ModelAndView mav = new ModelAndView("adds/nims/product-popup");
return mav return mav
.addObject("pageName", "productMain") // View(jsp)에서 사용할 id 뒤에 붙일 suffix .addObject("pageName", "productPopup") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
.addObject("infoPrefix", "product") // prefix .addObject("infoPrefix", "product") // prefix
.addObject("infoPrefixUrl", "/adds/nims") // prefixUrl .addObject("infoPrefixUrl", "/adds/nims") // prefixUrl
.addObject("openPage", openPage); .addObject("openPage", query.getOpenPage())
.addObject("bsshCd", query.getBsshCd());
} }
//------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------
// 마약류폐기보고 팝업 // 마약류폐기보고 팝업

@ -363,14 +363,18 @@
$P.productControl.getProductInfo = () => { $P.productControl.getProductInfo = () => {
let dialogTitle = "마약류 제품 조회"; let dialogTitle = "마약류 제품 조회";
let params = {openPage : "product--${pageName}"}; let rowData = $P.bsshFormFields.get();
let params = {
openPage : "product--${pageName}"
, bsshCd: rowData.bsshCd
};
ajax.get({ ajax.get({
url : wctx.url("/adds/nims/product-popup.do") url : wctx.url("/adds/nims/product-popup.do")
, data : params , data : params
, success : resp => { , success : resp => {
dialog.open({ dialog.open({
id : "productMainDialog" id : "productPopupDialog"
, title : dialogTitle , title : dialogTitle
, content : resp , content : resp
, size : $P.productControl.infoSize , size : $P.productControl.infoSize

@ -14,6 +14,7 @@
<!-- hidden --> <!-- hidden -->
<input type="hidden" name="dscdmngId" data-map="dscdmngId" /> <input type="hidden" name="dscdmngId" data-map="dscdmngId" />
<input type="hidden" name="prgrsSttsCd" data-map="prgrsSttsCd" /> <input type="hidden" name="prgrsSttsCd" data-map="prgrsSttsCd" />
<input type="hidden" name="bsshCd" data-map="bsshCd"/>
<label for="bssh--${pageName}" style="margin-top: 10px; padding-left: 20px;"><strong>취급 업체 정보</strong></label> <label for="bssh--${pageName}" style="margin-top: 10px; padding-left: 20px;"><strong>취급 업체 정보</strong></label>
<div class="row my-1 mx-4 g-1 border-card rounded-3"> <div class="row my-1 mx-4 g-1 border-card rounded-3">
<div class="col-md-4"> <div class="col-md-4">
@ -332,14 +333,25 @@
$P.productControl.getProductInfo = () => { $P.productControl.getProductInfo = () => {
let dialogTitle = "마약류 제품 조회"; 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({ ajax.get({
url : wctx.url("/adds/nims/product-popup.do") url : wctx.url("/adds/nims/product-popup.do")
, data : params , data : params
, success : resp => { , success : resp => {
dialog.open({ dialog.open({
id : "productMainDialog" id : "productPopupDialog"
, title : dialogTitle , title : dialogTitle
, content : resp , content : resp
, size : $P.productControl.infoSize , size : $P.productControl.infoSize

@ -308,27 +308,6 @@
dsuseAcdtDe: row.DSUSE_ACDT_DE, dsuseAcdtDe: row.DSUSE_ACDT_DE,
prgrsSttsCd: row.PRGRS_STTS_CD 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({ ajax.get({

@ -16,8 +16,7 @@
<input type="text" class="form-control w-px-120" id="productCd--${pageName}" name="schProductCd" > <input type="text" class="form-control w-px-120" id="productCd--${pageName}" name="schProductCd" >
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<button type="button" class="btn btn-search w-px-50" id="btnSearch--${pageName}" title="검색">검색</button>&nbsp; <button type="button" class="btn btn-search w-px-50" id="btnSearch--${pageName}" title="검색">NIMS 검색</button>&nbsp;
<button type="button" class="btn btn-primary w-px-80" id="btnSearch2--${pageName}" title="검색">NIMS 검색</button>
</div> </div>
</div> </div>
</div> </div>
@ -68,6 +67,7 @@
</div> </div>
<div class="card col-6"> <div class="card col-6">
<form id="frmSearch--${pageName}Detail" name="frmSearchDetail"> <form id="frmSearch--${pageName}Detail" name="frmSearchDetail">
<input type="hidden" id="bsshCd" name="bsshCd">
<div class="container-search"> <div class="container-search">
<!-- hidden --> <!-- hidden -->
<div class="row my-0 mx-1 g-0" style="align-items: baseline"> <div class="row my-0 mx-1 g-0" style="align-items: baseline">
@ -86,9 +86,6 @@
<button type="button" class="btn btn-primary w-px-90" id="btnSearch3--${pageName}" title="검색">NIMS 검색</button> <button type="button" class="btn btn-primary w-px-90" id="btnSearch3--${pageName}" title="검색">NIMS 검색</button>
</div> </div>
</div> </div>
<div>
<span style="padding-left: 50px; font-weight: bold; color: #696cff">유효기간(제조번호 또는 시리얼번호 조회 결과 내에서 조회)</span>
</div>
</div> </div>
</form> </form>
<!-- 업무 버튼 표시 --> <!-- 업무 버튼 표시 -->
@ -195,7 +192,7 @@
$P.detailControl = new DatasetControl({ $P.seqInfoControl = new DatasetControl({
urls : { urls : {
load : wctx.url("/adds/nims/getNimsProductSeqInfo.do"), // 시리얼번호 검색 load : wctx.url("/adds/nims/getNimsProductSeqInfo.do"), // 시리얼번호 검색
} }
@ -227,7 +224,7 @@
}); });
// $P.control 설정 // $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 => { $P.control.onCurrentChange = item => {
if (!item) { if (!item) {
$P.detailControl.setData([]); $P.seqInfoControl.setData([]);
$("#btnSearch3--${pageName}").prop("disabled", true); $("#btnSearch3--${pageName}").prop("disabled", true);
return; return;
} }
@ -267,7 +264,7 @@
} }
// 현재 선택 자료 변경 이벤트 // 현재 선택 자료 변경 이벤트
$P.detailControl.onCurrentChange = (item) => { $P.seqInfoControl.onCurrentChange = (item) => {
if (!item) return; if (!item) return;
let key = item.data.keyCnt; let key = item.data.keyCnt;
@ -275,11 +272,11 @@
$("#tbody--${pageName}Detail").setCurrentRow(key); $("#tbody--${pageName}Detail").setCurrentRow(key);
}; };
$P.detailControl.onDatasetChange = (obj, option) => { $P.seqInfoControl.onDatasetChange = (obj, option) => {
$P.renderDetailList(obj.totalCount, option); $P.renderDetailList(obj.totalCount, option);
$("#${infoPrefix}DetailPaging--${pageName}").setPagingInfo({ $("#${infoPrefix}DetailPaging--${pageName}").setPagingInfo({
list: $P.detailControl.dataset list: $P.seqInfoControl.dataset
, prefix: "${infoPrefix}DetailPaging--${pageName}" , prefix: "${infoPrefix}DetailPaging--${pageName}"
, totalSize: obj.totalCount , totalSize: obj.totalCount
}); });
@ -322,7 +319,7 @@
} }
$P.renderDetailList = (totalSize, option) => { $P.renderDetailList = (totalSize, option) => {
let ${infoPrefix}DetailList = $P.detailControl.dataset; let ${infoPrefix}DetailList = $P.seqInfoControl.dataset;
let empty = ${infoPrefix}DetailList.empty; let empty = ${infoPrefix}DetailList.empty;
let trs = empty ? let trs = empty ?
@ -330,12 +327,12 @@
${infoPrefix}DetailList.inStrings( ${infoPrefix}DetailList.inStrings(
document.getElementById("${infoPrefix}Row--${pageName}Detail").innerHTML, <%-- from template#${infoPrefix}Row --%> document.getElementById("${infoPrefix}Row--${pageName}Detail").innerHTML, <%-- from template#${infoPrefix}Row --%>
(str, dataItem) => str (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()") .replace(/{ondblclick}/gi, "pageObject['${pageName}'].fnSave()")
); );
let noMore = (${infoPrefix}DetailList.length >= totalSize); 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); $("#table-responsive-1--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
@ -349,12 +346,12 @@
* 버튼 clickEvent * 버튼 clickEvent
**************************************************************************/ **************************************************************************/
//그리드(좌)조회(새로 조회) //그리드(좌)조회(새로 조회)
$P.fnSearchList = (dbSkipYn) => { $P.fnSearchList = () => {
$P.control.query = { $P.control.query = {
... $P.formFields.get(), ... $P.formFields.get(),
p: $P.formFields.get().schProductCd, p: $P.formFields.get().schProductCd,
pn: $P.formFields.get().schProductNm, pn: $P.formFields.get().schProductNm,
dbSkipYn: dbSkipYn? dbSkipYn : "N", bc: '${bsshCd}', //업체코드
userId: "${currentUser.account}" userId: "${currentUser.account}"
}; };
$P.control.query.fetchSize = FETCH_XXL; // 한번에 조회되는 자료 건수 $P.control.query.fetchSize = FETCH_XXL; // 한번에 조회되는 자료 건수
@ -364,34 +361,35 @@
} }
//그리드(우)조회(새로 조회) //그리드(우)조회(새로 조회)
$P.fnDetailSearchList = () => { $P.fnDetailSearchList = () => {
$P.detailControl.query = { $P.seqInfoControl.query = {
fg: $('#schOpt--productMain').val(), // 1-제조번호, 2-시리얼번호 fg: $('#schOpt--productPopup').val(), // 1-제조번호, 2-시리얼번호
pg: 1, pg: 1,
p: $P.control.dataset.getCurrent().prductCd , //제품코드 p: $P.control.dataset.getCurrent().prductCd , //제품코드
prdValidDe: $("input[name='schPrdValidDe']").val().replaceAll("-", ""), t: $('#schText--productPopup').val(), //제조번호 또는 시리얼번호
t: $('#schText--productMain').val(), //제조번호 또는 시리얼번호 vd: $("input[name='schPrdValidDe']").val().replaceAll("-", ""),
bc: '${bsshCd}', //업체코드
userId: "${currentUser.account}" userId: "${currentUser.account}"
}; };
$P.detailControl.query.fetchSize = FETCH_MD; // 한번에 조회되는 자료 건수 $P.seqInfoControl.query.fetchSize = FETCH_MD; // 한번에 조회되는 자료 건수
$P.detailControl.query.delYn = "N"; // 삭제 여부 $P.seqInfoControl.query.delYn = "N"; // 삭제 여부
$P.detailControl.load(1); $P.seqInfoControl.load(1);
} }
//그리드(우)조회(스크롤) //그리드(우)조회(스크롤)
$P.scrollDetailDataList = () => { $P.scrollDetailDataList = () => {
$P.detailControl.query.pg = $P.detailControl.query.pageNum + 1; $P.seqInfoControl.query.pg = $P.seqInfoControl.query.pageNum + 1;
$P.detailControl.load($P.detailControl.query.pageNum + 1); $P.seqInfoControl.load($P.seqInfoControl.query.pageNum + 1);
} }
// 저장 // 저장
$P.fnSave = () => { $P.fnSave = () => {
let openPage = new AddsFormFields("#${openPage}"); let openPage = new AddsFormFields("#${openPage}");
productData = {...$P.control.getCurrent(), ...$P.detailControl.getCurrent()} productData = {...$P.control.getCurrent(), ...$P.seqInfoControl.getCurrent()}
openPage.set (null,productData); // formFields openPage.set (null,productData); // formFields
dialog.close("productMainDialog"); dialog.close("productPopupDialog");
} }
/************************************************************************** /**************************************************************************
@ -415,7 +413,6 @@
// 버튼 이벤트 // 버튼 이벤트
$("#btnSave--${pageName}").on("click", () => $P.fnSave()); // 저장 $("#btnSave--${pageName}").on("click", () => $P.fnSave()); // 저장
$("#btnSearch--${pageName}").on("click", () => $P.fnSearchList()); $("#btnSearch--${pageName}").on("click", () => $P.fnSearchList());
$("#btnSearch2--${pageName}").on("click", () => $P.fnSearchList("Y"));
$("#btnSearch3--${pageName}").on("click", () => $P.fnDetailSearchList()); $("#btnSearch3--${pageName}").on("click", () => $P.fnDetailSearchList());
$("#frmSearch--${pageName} input").onEnterPress($P.fnSearchList); $("#frmSearch--${pageName} input").onEnterPress($P.fnSearchList);

Loading…
Cancel
Save