refactor: 미사용 클래스 및 jsp 제거

dev
Jonguk. Lim 4 months ago
parent 23d8096765
commit e3aa2f93dc

@ -1,153 +0,0 @@
package cokr.xit.adds.nims;
import cokr.xit.foundation.component.QueryRequest;
/**
*/
public class BsshQuery extends QueryRequest{
private static final long serialVersionUID = 1L;
//검색조건
private String schBsshCd; // 취급자 식별번호
private String schBsshNm; // 취급자 명
//저장소 정보
private String bsshCd; // 취급자 식별번호
private String bsshNm; // 취급자명
private String indutyNm; // 업종명
private String hdntCd; // 의료업자 구분
private String hdntNm; // 의료업자 구분명
private String bizrno; // 사업자등록번호
private String rprsntvNm; // 대표자 명
private String chrgNm; // 담당자 명
private String hptlNo; // 요양기관 기호
private String joinYn; // 획원가입 여부
private String bsshSttsNm; // 상태
private String prmisnNo; // 허가 번호
public String getSchBsshCd() {
return ifEmpty(schBsshCd, () -> null);
}
public <T extends BsshQuery> T setSchBsshCd(String schBsshCd) {
this.schBsshCd = schBsshCd;
return self();
}
public String getSchBsshNm() {
return ifEmpty(schBsshNm, () -> null);
}
public <T extends BsshQuery> T setSchBsshNm(String schBsshNm) {
this.schBsshNm = schBsshNm;
return self();
}
public String getbsshCd() {
return ifEmpty(bsshCd, () -> null);
}
public <T extends BsshQuery> T setbsshCd(String bsshCd) {
this.bsshCd = bsshCd;
return self();
}
public String getbsshNm() {
return ifEmpty(bsshNm, () -> null);
}
public <T extends BsshQuery> T setbsshNm(String bsshNm) {
this.bsshNm = bsshNm;
return self();
}
public String getindutyNm() {
return ifEmpty(indutyNm, () -> null);
}
public <T extends BsshQuery> T setindutyNm(String indutyNm) {
this.indutyNm = indutyNm;
return self();
}
public String gethdntCd() {
return ifEmpty(hdntCd, () -> null);
}
public <T extends BsshQuery> T sethdntCd(String hdntCd) {
this.hdntCd = hdntCd;
return self();
}
public String gethdntNm() {
return ifEmpty(hdntNm, () -> null);
}
public <T extends BsshQuery> T sethdntNm(String hdntNm) {
this.hdntNm = hdntNm;
return self();
}
public String getbizrno() {
return ifEmpty(bizrno, () -> null);
}
public <T extends BsshQuery> T setbizrno(String bizrno) {
this.bizrno = bizrno;
return self();
}
public String getrprsntvNm() {
return ifEmpty(rprsntvNm, () -> null);
}
public <T extends BsshQuery> T setrprsntvNm(String rprsntvNm) {
this.rprsntvNm = rprsntvNm;
return self();
}
public String getchrgNm() {
return ifEmpty(chrgNm, () -> null);
}
public <T extends BsshQuery> T setchrgNm(String chrgNm) {
this.chrgNm = chrgNm;
return self();
}
public String gethptlNo() {
return ifEmpty(hptlNo, () -> null);
}
public <T extends BsshQuery> T sethptlNo(String hptlNo) {
this.hptlNo = hptlNo;
return self();
}
public String getjoinYn() {
return ifEmpty(joinYn, () -> null);
}
public <T extends BsshQuery> T setjoinYn(String joinYn) {
this.joinYn = joinYn;
return self();
}
public String getbsshSttsNm() {
return ifEmpty(bsshSttsNm, () -> null);
}
public <T extends BsshQuery> T setbsshSttsNm(String bsshSttsNm) {
this.bsshSttsNm = bsshSttsNm;
return self();
}
public String getprmisnNo() {
return ifEmpty(prmisnNo, () -> null);
}
public <T extends BsshQuery> T setprmisnNo(String prmisnNo) {
this.prmisnNo = prmisnNo;
return self();
}
}

@ -1,153 +0,0 @@
package cokr.xit.adds.nims;
import cokr.xit.foundation.component.QueryRequest;
/**
*
*/
public class ProductQuery extends QueryRequest{
private static final long serialVersionUID = 1L;
//검색조건
private String schProductCd; // 제품코드
private String schProductNm; // 제품명
//저장소 정보
private String prductCd; // 제품코드
private String prdlstMstCd; // ??
private String prductNm; // 제품명
private String nrcdSeNm; // 마약/향정구분
private String prtmSeNm; // 중점/일반구분
private String prdMinDistbQy; // 최소유통단위
private String stdPackngStleNm; // 최소유통단위명
private String prdTotPceQy; // 낱개단위
private String pceCoUnitNm; // 낱개단위명
private String bsshCd; // 취급자 번호
private String rgsDt; // ??일시
private String updDt; // 수정일시
public String getSchProductCd() {
return ifEmpty(schProductCd, () -> null);
}
public <T extends ProductQuery> T setSchProductCd(String schProductCd) {
this.schProductCd = schProductCd;
return self();
}
public String getSchProductNm() {
return ifEmpty(schProductNm, () -> null);
}
public <T extends ProductQuery> T setSchProductNm(String schProductNm) {
this.schProductNm = schProductNm;
return self();
}
public String getPrductCd() {
return ifEmpty(prductCd, () -> null);
}
public <T extends ProductQuery> T setPrductCd(String prductCd) {
this.prductCd = prductCd;
return self();
}
public String getPrdlstMstCd() {
return ifEmpty(prdlstMstCd, () -> null);
}
public <T extends ProductQuery> T setPrdlstMstCd(String prdlstMstCd) {
this.prdlstMstCd = prdlstMstCd;
return self();
}
public String getPrductNm() {
return ifEmpty(prductNm, () -> null);
}
public <T extends ProductQuery> T setPrductNm(String prductNm) {
this.prductNm = prductNm;
return self();
}
public String getNrcdSeNm() {
return ifEmpty(nrcdSeNm, () -> null);
}
public <T extends ProductQuery> T setNrcdSeNm(String nrcdSeNm) {
this.nrcdSeNm = nrcdSeNm;
return self();
}
public String getPrtmSeNm() {
return ifEmpty(prtmSeNm, () -> null);
}
public <T extends ProductQuery> T setPrtmSeNm(String prtmSeNm) {
this.prtmSeNm = prtmSeNm;
return self();
}
public String getPrdMinDistbQy() {
return ifEmpty(prdMinDistbQy, () -> null);
}
public <T extends ProductQuery> T setPrdMinDistbQy(String prdMinDistbQy) {
this.prdMinDistbQy = prdMinDistbQy;
return self();
}
public String getStdPackngStleNm() {
return ifEmpty(stdPackngStleNm, () -> null);
}
public <T extends ProductQuery> T setStdPackngStleNm(String stdPackngStleNm) {
this.stdPackngStleNm = stdPackngStleNm;
return self();
}
public String getPrdTotPceQy() {
return ifEmpty(prdTotPceQy, () -> null);
}
public <T extends ProductQuery> T setPrdTotPceQy(String prdTotPceQy) {
this.prdTotPceQy = prdTotPceQy;
return self();
}
public String getPceCoUnitNm() {
return ifEmpty(pceCoUnitNm, () -> null);
}
public <T extends ProductQuery> T setPceCoUnitNm(String pceCoUnitNm) {
this.pceCoUnitNm = pceCoUnitNm;
return self();
}
public String getbsshCd() {
return ifEmpty(bsshCd, () -> null);
}
public <T extends BsshQuery> T setbsshCd(String bsshCd) {
this.bsshCd = bsshCd;
return self();
}
public String getRgsDt() {
return ifEmpty(rgsDt, () -> null);
}
public <T extends ProductQuery> T setRgsDt(String rgsDt) {
this.rgsDt = rgsDt;
return self();
}
public String getUpdDt() {
return ifEmpty(updDt, () -> null);
}
public <T extends ProductQuery> T setUpdDt(String updDt) {
this.updDt = updDt;
return self();
}
}

@ -1,22 +0,0 @@
package cokr.xit.adds.nims.dao;
import java.util.List;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import cokr.xit.adds.nims.BsshQuery;
import cokr.xit.foundation.component.AbstractMapper;
import cokr.xit.foundation.data.DataObject;
/** DAO
*/
@Mapper("bsshMapper")
public interface BsshMapper extends AbstractMapper {
/** .<br />
* @param req
* @return
*/
List<DataObject> selectBsshList(BsshQuery req);
}

@ -1,19 +0,0 @@
package cokr.xit.adds.nims.service;
import java.util.List;
import cokr.xit.adds.nims.BsshQuery;
import cokr.xit.foundation.data.DataObject;
public interface BsshService {
/** .
* @param query
* <ul><li>pageNum: </li>
* <li>fetchSize: </li>
* </ul>
* @return
*/
List<DataObject> getbsshList(BsshQuery query);
}

@ -1,145 +0,0 @@
package cokr.xit.adds.nims.service.bean;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.nio.charset.Charset;
import javax.annotation.Resource;
import javax.net.ssl.HttpsURLConnection;
import org.springframework.stereotype.Service;
import com.fasterxml.jackson.databind.ObjectMapper;
import cokr.xit.adds.nims.BsshQuery;
import cokr.xit.adds.nims.dao.BsshMapper;
import cokr.xit.adds.nims.service.BsshService;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.foundation.data.DataObject;
@Service("bsshService")
public class BsshServiceBean extends AbstractServiceBean implements BsshService {
/** 취급자 정보 DAO */
@Resource(name = "bsshMapper")
private BsshMapper bsshMapper;
@Override
public List<DataObject> getbsshList(BsshQuery query){
ObjectMapper mapper = new ObjectMapper();
String sUrl = "http://localhost:9076/api/biz/nims/v1/getNimsBsshInfoSt";
String sJsonData = "";
String rtnMsg = ""; // 처리 결과 메시지
// Json 파라미터 설정
sJsonData = "{ "
+ " \"k\":" + "\"" + "\""
+ ", \"fg\":" + "\"1\""
+ ", \"pg\":" + "\"1\""
+ ", \"bi\":\"\""
+ ", \"hp\":\"\""
+ ", \"bn\":" + query.getSchBsshNm() + "\""
+ ", \"bc\":" + query.getSchBsshCd() + "\""
+ ", \"ymd\":\"\""
+ ", \"fg2\":\"\"1\""
+ ", \"dbSkipYn\":\"\"N\""
+ ", \"userId\":\"suji\""
+ " }";
rtnMsg = callHttpsJson(sUrl, "POST", sJsonData);
return bsshMapper.selectBsshList(query);
}
/** .
* @param req
* @return
*/
public String callHttpsJson(String sUrl, String sMethod, String sJsonData) {
//
String returnMsg = "";
//
HttpsURLConnection httpsConn = null;
try {
// HTTPS 통신을 위한 URL 생성
URL url = new URL(sUrl);
// HttpsURLConnection 객체 생성
httpsConn = (HttpsURLConnection) url.openConnection();
// Content-Type
httpsConn.setRequestProperty("Content-Type", "application/json");
// Method Setting(GET/POST)
httpsConn.setRequestMethod(sMethod); // GET, POST, DELETE
// Connection Timeout setting
httpsConn.setConnectTimeout(10000); // 컨텍션타임아웃 10초
// Read Timeout Setting
httpsConn.setReadTimeout(10000); // 컨텐츠조회 타임아웃 10초
if (sMethod.equals("POST")) {
// Input setting
httpsConn.setDoInput(true);
// Output setting
httpsConn.setDoOutput(true); // 항상 갱신된내용을 가져옴
// POST방식으로 송신할 json 데이터 전송
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(httpsConn.getOutputStream()));
bw.write(sJsonData);
bw.flush();
bw.close();
} else {
// Input setting
httpsConn.setDoInput(false);
// Output setting
httpsConn.setDoOutput(false);
}
// HTTP 응답 코드 수신, 서버에서 보낸 응답 데이터 수신 받기
int responseCode = httpsConn.getResponseCode();
Charset charset = Charset.forName("UTF-8");
String inputLine;
StringBuffer response = new StringBuffer();
if (responseCode == 200) {
BufferedReader in = new BufferedReader(new InputStreamReader(httpsConn.getInputStream(), charset));
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
} else {
BufferedReader in = new BufferedReader(new InputStreamReader(httpsConn.getErrorStream(), charset));
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
}
returnMsg = response.toString();
} catch (IOException e) {
returnMsg = "IOException :" + e;
} catch (Exception e) {
returnMsg = "Exception :" + e;
} finally {
if (httpsConn != null) {
httpsConn.disconnect();
}
}
return returnMsg;
}
}

@ -1,45 +0,0 @@
package cokr.xit.adds.nims.web;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.web.ApplicationController;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
@Controller
@RequestMapping(
name = "Nims 관리",
value = {"/adds/nims/"}
)
public class TestController extends ApplicationController {
@Value("${app.api.host:}")
private String apiHost;
/**
* url
* http://localhost:9077/adds/nims/barcodeForm.do
* @return
*/
@RequestMapping(
name = "Nims 바코드 리더",
value = {"/barcodeForm.do"}
)
public ModelAndView barcodeForm() {
ModelAndView mav = new ModelAndView();
mav.setViewName("adds/nims/barcode-main");
return mav.addObject("apiHost", apiHost);
}
@RequestMapping(
name = "신청서접수",
value = {"/dsuseMgtReceipt_Test.do"}
)
public ModelAndView dsuseMgtReceiptForm() {
ModelAndView mav = new ModelAndView();
mav.setViewName("adds/nims/dsuseMgtReceipt_Test-main");
return mav.addObject("apiHost", apiHost);
}
}

@ -1,406 +0,0 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<c:set var="prefixName" scope="request">신청서 정보 상세</c:set>
<!-- inner page html -->
<div class="content-wrapper">
<!-- Content -->
<div class="container flex-grow-1 px-0">
<!-- Page Body -->
<div class="card">
<!-- 입력 영역 -->
<form id="frmEdit--${pageName}" name="frmEdit">
<!-- hidden -->
<label for="bssh--${pageName}">마약류 취급업체 정보</label>
<div class="row my-1 mx-4 g-1 border-card rounded-3">
<div class="col-md-4">
<label for="bsshNm--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">업체명</label>
<input type="text" class="form-control w-60" id="bsshNm--${pageName}" name="bsshNm" data-map="BSSH_NM" readonly>
</div>
<div class="col-md-4">
<label for="bsshCd--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">식별번호</label>
<input type="text" class="form-control w-60" id="bsshNm--${pageName}" name="bsshCd" data-map="BSSH_CD" readonly>
</div>
<button type="button" class="btn btn-search w-px-120" id="btnBsshSearch--${pageName}" title="검색">검색</button>
<div class="col-md-4">
<label for="rprsntvNm--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">대표자명</label>
<input type="text" class="form-control w-60" id="storgeNo--${pageName}" name="storgeNo" data-map="STORGE_NO" readonly>
</div>
<div class="col-md-4">
<label for="prmisnNo--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">허가번호</label>
<input type="text" class="form-control w-60" id="storgeNm--${pageName}" name="storgeNm" data-map="STORGE_NM" readonly>
</div>
<div class="col-md-4">
<label for="bizrNo--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">사업자등록번호</label>
<input type="text" class="form-control w-60" id="bsshAdres--${pageName}" name="bsshAdres" data-map="BSSH_ADRES" readonly>
</div>
<div class="col-md-8">
<label for="addr--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">폐기사유</label>
<select class="form-select" id="schVltnCd--${pageName}" name="schVltnCd"><option value="">사고마약류(파손)</option><option value="01">사고마약류(변질,부패)</option><option value="02">유효기한 또는 사용기한 경과</option><option value="03">재고관리 또는 보관을 하기에 곤란한 사유(유효기한 임박)</option>
<option value="04">재고관리 또는 보관을 하기에 곤란한 사유(사용중단)</option>
<option value="05">재고관리 또는 보관을 하기에 곤란한 사유(폐업)</option>
<option value="06">재고관리 또는 보관을 하기에 곤란한 사유(환자반납)</option>
<option value="07">기타(사고마약류(도난,분실,재해) 발생보고 완료건)</option>
<option value="08">기타(제조공정 중 폐기물)</option></select>
</div>
</div>
<div class="row my-1 mx-1 g-1 border-card rounded"></div>
<label for="bssh--${pageName}">폐기 공통 정보</label>
<div class="row my-1 mx-4 g-1 border-card rounded-3">
<div class="col-md-12">
<label for="hdrDe--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">취급일자</label>
<input type="text" id="hdrDe--${pageName}" name="hdrDe" data-map="HDR_DE" class="form-control w-px-200" readonly="" data-maxlengthb="200">
</div>
<div class="col-md-4">
<label for="dsuseDe--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">폐기일자</label>
<input type="text" id="dsuseDe--${pageName}" name="dsuseDe" data-map="DSUSE_DE" class="form-control w-px-200" readonly="" data-maxlengthb="200">
</div>
<div class="col-md-4">
<label for="dsuseSe--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">폐기구분</label>
<input type="text" class="form-control w-60" id="dsuseSe--${pageName}" name="dsuseSe" data-map="DSUSE_SE" readonly>
</div>
<div class="col-md-4">
<label for="dsuseMth--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">폐기방법</label>
<input type="text" class="form-control w-60" id="dsuseMth--${pageName}" name="dsuseMth" data-map="DSUSE_MTH" readonly>
</div>
<div class="col-md-4">
<label for="dsuseLoc--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">폐기장소</label>
<input type="text" class="form-control w-60" id="dsuseLoc--${pageName}" name="dsuseLoc" data-map="DSUSE_LOC" readonly>
</div>
<div class="col-md-4">
<label for="dsuseImg--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">폐기이미지</label>
<input type="text" class="form-control w-60" id="dsuseImg--${pageName}" name="dsuseImg" data-map="DSUSE_IMG" readonly>
</div>
</div>
<div class="row my-1 mx-1 g-1 border-card rounded"></div>
<label for="rtpyrNm--${pageName}">폐기정보 상세</label>
<form id="code-form">
<div class="row my-1 mx-4 g-1 border-card rounded-3">
<div class="col-md-6">
<label for="rtpyrNm--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">제품명</label>
<input type="text" id="rtpyrNm--${pageName}" name="rtpyrNm" data-map="RTPYR_NM" class="form-control" readonly="">
<button type="button" class="btn btn-search w-px-120" id="btnSearch--excl02010" title="검색">바코드 검색</button>
</div>
<div class="col-md-6">
<label for="dtlAddr--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">제품 코드</label>
<input type="text" id="dtlAddr--${pageName}" name="dtlAddr" data-map="DTL_ADDR" class="form-control w-px-300" readonly="" data-maxlengthb="200">
</div>
<div class="col-md-6">
<label for="dtlAddr--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">제조 번호</label>
<input type="text" id="dtlAddr--${pageName}" name="dtlAddr" data-map="DTL_ADDR" class="form-control w-px-300" readonly="" data-maxlengthb="200">
</div>
<div class="col-md-6">
<label for="dtlAddr--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">제조 일련 번호</label>
<input type="text" id="dtlAddr--${pageName}" name="dtlAddr" data-map="DTL_ADDR" class="form-control w-px-300" readonly="" data-maxlengthb="200">
</div>
<div class="col-md-12">
<label for="addr--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">유효기간</label>
<input type="text" id="dtlAddr--${pageName}" name="dtlAddr" data-map="DTL_ADDR" class="form-control w-px-200" readonly="" data-maxlengthb="200">
</div>
<div class="col-md-4">
<label for="zip--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">최소 유통단위 슈량</label>
<input type="text" id="zip--${pageName}" name="zip" data-map="ZIP" class="form-control w-px-100" readonly="">
</div>
<div class="col-md-4">
<label for="addr--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">낱개 단위 수량</label>
<input type="text" id="addr--${pageName}" name="addr" data-map="ADDR" class="form-control w-px-100" data-maxlengthb="320" readonly="">
</div>
<div class="col-md-4">
<label for="addr--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">폐기 수량</label>
<input type="text" id="addr--${pageName}" name="addr" data-map="ADDR" class="form-control w-px-100" data-maxlengthb="320">
</div>
<div style=" align-content: center; text-align: center;">
<span>
<!-- 업무 버튼 -->
<button type="button" class="btn btn-primary w-px-80" id="btnSave--${pageName}" title="저장">추가</button>
<button type="button" class="btn btn-primary w-px-80" id="btnSave--${pageName}" title="저장">제거</button>
</span>
</div>
</div>
<table class="datatables-ajax table table-bordered dataTable no-footer" id="DataTables_Table_0" aria-describedby="DataTables_Table_0_info">
<thead>
<tr><th style="width: 15.828px;text-align:center;" tabindex="0">No</th>
<th class="sorting sorting_asc" aria-sort="ascending" style="width: 223.719px;">제품명</th>
<th class="sorting" style="width: 146.156px;">제품코드</th>
<th class="sorting" style="width: 160.141px;">제품번호</th>
<th class="sorting" style="width: 160.141px;">폐기수량</th>
<th class="sorting" style="width: 230.469px;">유효기간</th>
<th class="sorting" style="width: 230.469px;">최소 유통단위 수량</th>
<th class="sorting" style="width: 230.469px;">낱개 단위 수량</th>
<th class="sorting" style="width: 230.469px;">폐기 수량</th>
</tr>
</thead>
<tbody id="tbody--${pageName}">
</tbody>
<template id="${infoPrefix}Row--${pageName}">
<tr data-key="DSCDMNG_SN">
<td style="text-align:center;"><input value="DSCDMNG_SN" onchange="userControl.select('DSCDMNG_SN', this.checked);" type="checkbox" class="form-check-input"></td>
<td {onclick}="" {ondblclick}="">{PRDUCT_NM}</td>
<td {onclick}="" {ondblclick}="">{PRDUCT_CD}</td>
<td {onclick}="" {ondblclick}="">{MNF_NO}</td>
<td {onclick}="" {ondblclick}="">{PRD_VALID_DE}</td>
<td {onclick}="" {ondblclick}="">{MIN_DISTB_QY}</td>
<td {onclick}="" {ondblclick}="">{PCE_QY}</td>
<td {onclick}="" {ondblclick}="">{DSUSE_QY}</td>
</tr>
</template>
</table>
</form>
</form> <!-- /입력 영역 -->
</div> <!-- <div class="card"> -->
<!-- 업무 버튼 표시 -->
<div>
<span class="container-page-btn">
<span class="container-window-btn-right">
<!-- 업무 버튼 -->
<button type="button" class="btn btn-primary w-px-80" id="btnSave--${pageName}" title="저장">저장</button>
</span>
</span>
</div>
<!-- / 업무 버튼 표시 -->
</div> <!-- / Content <div class="container flex-grow-1 px-0"> -->
</div> <!-- / inner page html <div class="content-wrapper"> -->
<script>
/**************************************************************************
* Global Variable
**************************************************************************/
pageObject["${pageName}"] = {};
/**************************************************************************
* script 진입
**************************************************************************/
$(document).ready(function() {
// pageObject
let $P = pageObject["${pageName}"];
// FormFields
$P.formFields = new AddsFormFields("#frmEdit--${pageName}");
/**************************************************************************
* DatasetControl
**************************************************************************/
$P.control = new DatasetControl({
urls : {
load : wctx.url("/adds/nims/dsuseMgt-list.do")
}
, prefix: "dsuseMgt"
, prefixName: "신청서접수"
, keymapper: info => info ? info.DSCDMNG_ID : ""
, dataGetter: obj => obj.dsuseMgtList
, appendData: true
, infoSize: "xl"
, formats: {
RPT_DE: dateFormat
, HDR_DE: dateFormat
, DSUSE_DE: dateFormat
}
});
// $P.control 설정
$P.control.defaultFetchSize = FETCH_XS; // 1 페이지당 조회되는 자료 건수 index.jsp에서 확인 FETCH_XS = 30
$P.control.untilPageNum = 0; // 현재 페이지 번호
$P.control.beforeCurrent = null;
/**************************************************************************
* DatasetControl 이벤트
**************************************************************************/
// Dataset 변경 이벤트
$P.control.onDatasetChange = (obj) => {
$P.renderList(obj.${infoPrefix}Total);
$("#paging--${pageName}").setPaging({
list: $P.control.dataset
, prefix: "paging--${pageName}"
, start: obj.dsuseMgtStart
, totalSize: obj.dsuseMgtTotal
, fetchSize: obj.dsuseMgtFetch
, func: "pageObject['${pageName}'].control.load({index})"
});
};
// 현재 선택 자료 변경 이벤트
$P.control.onCurrentChange = item => {
if (!item) return;
// Dataset 셋팅
$P.formFields.set($P.control, item);
// 업무구분에 따른 URL 변경
$P.fnSetURL(item.data.TASK_SE_CD);
}
// 저장 callback
$P.control.onSave = (resp) => {
let dialogTitle = $("#" + $P.control.prefix + "Dialog--${openerPageName}").find("h5.modal-title").html();
let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, dialogTitle);
// 메시지 출력
dialog.alert({
content: showMessage
, init: () => { setDialogZindex(); }
, onOK: () => { }
});
if (resp.saved) {
dialog.close($P.control.prefix + "Dialog--${openerPageName}");
}
}
$P.control.getBsshInfo = (gdccId) => {
let dialogTitle = "마약류 취급자 조회";
let params = {};
ajax.get({
url : wctx.url("/adds/nims/bssh-popup.do")
, data : params || {}
, success : resp => {
dialog.open({
id : "bsshPopupDialog"
, title : dialogTitle
, content : resp
, size : $P.control.infoSize
, onClose : () => { $P.control.setData(); }
});
}
});
}
// 저장
$P.control.save = (info) => {
if (!info) return;
let create = (info.mngId == "");
ajax.post({
url: !create ? $P.control.urls.update : $P.control.urls.create
, data: info || {}
, success: resp => $P.control.onSave(resp)
});
}
/**************************************************************************
* DataTables 이벤트
**************************************************************************/
// DataTables에 click, dbclick 이벤트
$P.renderList = (totalSize) => {
let ${infoPrefix}List = $P.control.dataset;
let empty = ${infoPrefix}List.empty;
// 업무별 DataTables(그리드) tr, td
let foundContent = document.getElementById("${infoPrefix}Row--${pageName}").content;
let foundTr = $(foundContent).find("tr")[0].cloneNode(false);
let foundTds = $(foundContent).find("td");
foundTds.each(function() {
foundTr.appendChild(this.cloneNode(true));
});
//
let replacer = (str, dataItem) => str;
// .replace(/{onclick}/gi, "pageObject['${pageName}'].control.setCurrent('" + dataItem.getValue("USR_RPT_ID_NO") + "');")
// .replace(/{ondblclick}/gi, "pageObject['${pageName}'].getTotalInfo('" + dataItem.getValue("USR_RPT_ID_NO") + "');");
let trs = empty ? [document.getElementById("${infoPrefix}NotFound--${pageName}").content.outerHTML]
: ${infoPrefix}List.inStrings(foundTr.outerHTML, replacer);
let noMore = (${infoPrefix}List.length >= totalSize);
let initScroll = ($P.control.query.pageNum < 2) && ($P.control.untilPageNum == 0);
$("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
if ($P.control.untilPageNum != 0) {
$P.control.query.fetchSize = $P.control.defaultFetchSize;
$P.control.query.pageNum = $P.control.untilPageNum;
$P.control.untilPageNum = 0;
}
}
// DataTables에 스크롤이 맨 밑으로 이동했을 때 이벤트
$P.scrollDataList = () => {
$P.control.load($P.control.query.pageNum + 1);
}
/**************************************************************************
* 사용자 함수(function)
**************************************************************************/
// 업무구분에 따른 URL 설정
$P.fnSetURL = (taskSeCd) => {
//$P.control.urls.create = wctx.url("/" + taskSeCd + "${infoPrefixUrl}" + "/040/create.do"); // 등록
//$P.control.urls.update = wctx.url("/" + taskSeCd + "${infoPrefixUrl}" + "/040/update.do"); // 수정
}
// 전자우편 안내문 등록 버튼 이벤트
$P.fnSearchBssh = (title) => {
$P.control.getBsshInfo();
}
/**************************************************************************
* 버튼 clickEvent
**************************************************************************/
// 저장
$P.fnSave = () => {
// validate 확인
if (!customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return;
dialog.alert({
content: "현재 " + $P.control.prefixName + " 정보를 저장하시겠습니까?"
, init: () => { setDialogZindex(); }
, onOK: () => {
$P.control.save($P.formFields.get()); // formFields
}
});
}
/**************************************************************************
* 초기 셋팅
**************************************************************************/
// 이벤트 설정
$P.setEvent = () => {
// 안내문 등록 버튼 이벤트
$("#btnBsshSearch--${pageName}").on("click", function() {
$P.fnSearchBssh($(this).attr("title"));
});
// 버튼 이벤트
$("#btnSave--${pageName}").on("click", () => $P.fnSave()); // 저장
}
// DataTables width 변경 조정 (업무별 그리드가 존재 한다면.. crdn06010-main.jsp 참고)
fnMakeResizableTable($("#table-responsive--${pageName}")[0]);
// DataTables 스크롤 이벤트 생성
fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollDataList);
// 초기 화면 설정
$P.initForm = () => {
}
/**************************************************************************
* 최초 실행 함수
**************************************************************************/
// 1. 이벤트 설정
$P.setEvent();
// 2. 초기 화면 설정
$P.initForm();
// 3. Dataset 설정
//$P.control.setData([${opnnDlbrMbrInfo}]);
});
</script>
Loading…
Cancel
Save