Leeyh1121 5 months ago
commit 36b1d95100

@ -17,6 +17,14 @@ public class DsuseMgtReceiptQuery extends QueryRequest{
//폐기관리
private String dscdmngId; // 폐기관리 ID
public String getDscdmngId() {
return dscdmngId;
}
public void setDscdmngId(String dscdmngId) {
this.dscdmngId = dscdmngId;
}
private String deptCd; // 부서 코드
private String userId; // 사용자 ID
private String prgrsSttsCd; // 진행 상태 코드

@ -19,4 +19,6 @@ public interface DsuseMgtReceiptMapper extends AbstractMapper {
*/
List<DataObject> selectDsuseMgtReceiptList(DsuseMgtReceiptQuery req);
DataObject selectDsuseMgtReceiptInfo(String dscdmngId);
}

@ -1,10 +1,8 @@
package cokr.xit.adds.nims.service;
import java.util.List;
import java.util.Map;
import cokr.xit.adds.nims.DsuseMgtReceiptQuery;
import cokr.xit.base.file.FileInfo;
import cokr.xit.foundation.data.DataObject;
public interface DsuseMgtReceiptService {
@ -16,6 +14,8 @@ public interface DsuseMgtReceiptService {
* </ul>
* @return
*/
List<DataObject> getdsuseMgtReceiptList(DsuseMgtReceiptQuery query);
List<DataObject> getDsuseMgtReceiptList(DsuseMgtReceiptQuery query);
DataObject getDsuseMgtReceiptInfo(String dscdmngId);
}

@ -20,10 +20,14 @@ public class DsuseMgtReceiptServiceBean extends AbstractServiceBean implements D
private DsuseMgtReceiptMapper dsuseMgtReceiptMapper;
@Override
public List<DataObject> getdsuseMgtReceiptList(DsuseMgtReceiptQuery query){
public List<DataObject> getDsuseMgtReceiptList(DsuseMgtReceiptQuery query){
query.setOrderBy("DSCDMNG_ID DESC");
return dsuseMgtReceiptMapper.selectDsuseMgtReceiptList(query);
}
@Override
public DataObject getDsuseMgtReceiptInfo(String dscdmngId){
return dsuseMgtReceiptMapper.selectDsuseMgtReceiptInfo(dscdmngId);
}
}

@ -18,6 +18,8 @@ import cokr.xit.adds.nims.service.DsuseMgtReceiptService;
import cokr.xit.applib.ogdp.OgdpQuery;
import cokr.xit.applib.ogdp.service.bean.DefaultOgdpBean;
import cokr.xit.base.code.CommonCode;
import cokr.xit.base.file.service.FileQuery;
import cokr.xit.base.file.service.FileService;
import cokr.xit.base.web.ApplicationController;
import cokr.xit.foundation.data.DataObject;
@ -31,7 +33,7 @@ public class AddsNimsController extends ApplicationController {
private String apiHost;
@Resource(name="defaultOgdpBean")
DefaultOgdpBean defaultOgdpBean;
private DefaultOgdpBean defaultOgdpBean;
@Resource(name="dsuseMgtReceiptService")
private DsuseMgtReceiptService dsuseMgtReceiptService;
@ -39,6 +41,9 @@ public class AddsNimsController extends ApplicationController {
@Resource(name="dsuseMgtDocService")
private DsuseMgtDocService dsuseMgtDocService;
@Resource(name="fileService")
private FileService fileService;
//-------------------------------------------------------------------------------------------------
// 신청서 접수
//-------------------------------------------------------------------------------------------------
@ -46,13 +51,24 @@ public class AddsNimsController extends ApplicationController {
public ModelAndView getDsuseMgtReceiptList(DsuseMgtReceiptQuery query) {
setFetchSize(query);
return setCollectionInfo(new ModelAndView("jsonView"), dsuseMgtReceiptService.getdsuseMgtReceiptList(query),"","");
return setCollectionInfo(new ModelAndView("jsonView"), dsuseMgtReceiptService.getDsuseMgtReceiptList(query),"","");
}
@RequestMapping(value = "/dsuseMgtReceipt-info.do", name="신청서 접수 상세")
public ModelAndView getDsuseMgtReceiptInfo() {
ModelAndView mav = new ModelAndView("adds/nims/dsuseMgtReceipt-info");
public ModelAndView getDsuseMgtReceiptInfo(String dscdmngId) {
ModelAndView mav = new ModelAndView();
setCmmCode("ADDS04", mav);
if(!isEmpty(dscdmngId)){
mav.setViewName("adds/nims/dsuseMgtReceipt-detail");
mav.addObject("dsuseReceptInfo", toJson(dsuseMgtReceiptService.getDsuseMgtReceiptInfo(dscdmngId)));
DsuseMgtReceiptQuery query = new DsuseMgtReceiptQuery();
query.setDscdmngId(dscdmngId);
mav.addObject("dsuseReceptDetails", toJson(dsuseMgtReceiptService.getDsuseMgtReceiptList(query)));
}else{
mav.setViewName("adds/nims/dsuseMgtReceipt-info");
}
return mav
.addObject("pageName", "dsuseMgtReceiptInfo") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
@ -70,13 +86,17 @@ public class AddsNimsController extends ApplicationController {
public ModelAndView getDsuseMgtRsltList(DsuseMgtReceiptQuery query) {
setFetchSize(query);
return setCollectionInfo(new ModelAndView("jsonView"), dsuseMgtReceiptService.getdsuseMgtReceiptList(query),"","");
return setCollectionInfo(new ModelAndView("jsonView"), dsuseMgtReceiptService.getDsuseMgtReceiptList(query),"","");
}
@RequestMapping(value = "dsuseMgtRslt-info.do", name="결과[통보] 상세")
public ModelAndView getDsuseMgtRsltInfo(DsuseRsltInfo dsuseRsltInfo) {
ModelAndView mav = new ModelAndView("adds/nims/dsuseMgtRslt-info");
FileQuery fileQuery = new FileQuery().setInfoType("110").setInfoKeys(dsuseRsltInfo.getDscdmngId());
List<DataObject> fileInfos = fileService.getFileList(fileQuery);
mav.addObject("fileInfos", toJson(fileInfos));
return mav
.addObject("pageName", "dsuseMgtRsltInfo") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
.addObject("infoPrefix", "dsuseMgtRsltInfo") // prefix
@ -131,7 +151,7 @@ public class AddsNimsController extends ApplicationController {
public ModelAndView dsuseMgtReceiptMain() {
ModelAndView mav = new ModelAndView("adds/nims/dsuseMgtReceipt-main");
setCmmCodeAdds11(mav);
setCmmCode("ADDS11", mav);
List<DataObject> deptList = defaultOgdpBean.getDeptList(new OgdpQuery());
mav.addObject("DEPTList", deptList);
@ -146,7 +166,7 @@ public class AddsNimsController extends ApplicationController {
@RequestMapping(value = "dsuseMgtRslt.do", name="결과[통보] 처리 메인")
public ModelAndView dsuseMgtRsltMain() {
ModelAndView mav = new ModelAndView("adds/nims/dsuseMgtRslt-main");
setCmmCodeAdds11(mav);
setCmmCode("ADDS11", mav);
return mav
.addObject("pageName", "dsuseMgtRslt") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
@ -158,7 +178,7 @@ public class AddsNimsController extends ApplicationController {
@RequestMapping(value = "/dsuseMgtMapping.do", name="폐기 보고 확인 메인")
public ModelAndView dsuseMgtMapping() {
ModelAndView mav = new ModelAndView("adds/nims/dsuseMgtMapping-main");
setCmmCodeAdds11(mav);
setCmmCode("ADDS11", mav);
return mav
.addObject("pageName", "dsuseMgtMapping") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
@ -171,16 +191,11 @@ public class AddsNimsController extends ApplicationController {
public ModelAndView dsuseMgtDoc() {
ModelAndView mav = new ModelAndView();
mav.setViewName("adds/nims/dsuseDoc-main");
setCmmCodeAdds11(mav);
setCmmCode("ADDS11", mav);
mav.addObject("pageName", "dsuseMgtDoc");
return mav;
}
private void setCmmCodeAdds11(ModelAndView mav){
Map<String, List<CommonCode>> commonCodes = getCodesOf("ADDS11");
mav.addObject("ADDS11List", commonCodes.get("ADDS11"));
}
//-------------------------------------------------------------------------------------------------
// menu 호출 처리
//-------------------------------------------------------------------------------------------------
@ -216,4 +231,16 @@ public class AddsNimsController extends ApplicationController {
//-------------------------------------------------------------------------------------------------
// 마약류폐기보고 팝업
//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
// private method
//-------------------------------------------------------------------------------------------------
private void setCmmCode(String grpCode, ModelAndView mav){
Map<String, List<CommonCode>> commonCodes = getCodesOf(grpCode);
mav.addObject(grpCode, commonCodes.get(grpCode));
}
//-------------------------------------------------------------------------------------------------
// private method
//-------------------------------------------------------------------------------------------------
}

@ -46,7 +46,7 @@
</sql>
<select id="selectDsuseMgtReceiptList" parameterType="map" resultType="dataobject">
/* 폐기관리접수 목록 조회(dsuseMgtReceiptMapper.selectDsuseMgtReceiptList) */
/* 폐기관리접수 목록 조회(dsuseMgtReceiptMapper.selectDsuseMgtReceiptList) */
<include refid="utility.paging-prefix" />
<include refid="select" />
WHERE 1=1
@ -64,4 +64,9 @@
<include refid="utility.paging-suffix" />
</select>
<select id="selectDsuseMgtReceiptInfo" parameterType="string" resultType="dataobject">
/* 폐기관리접수 목록 조회(dsuseMgtReceiptMapper.selectDsuseMgtReceiptInfo) */
<include refid="select" />
WHERE A.DSCDMNG_ID = #{dscdmngId}
</select>
</mapper>

@ -44,8 +44,8 @@
<sql id="selectCategories"><include refid="utility.paging-prefix" />
SELECT *
FROM TB_CODE_CTGR
WHERE USE_YN = 'Y'
<if test="categoryIDs != null"> AND CTGR_ID IN (<foreach collection="categoryIDs" item="categoryID" separator=",">#{categoryID}</foreach>)</if>
<where><if test="!includeAll"> AND USE_YN = 'Y'</if>
<if test="categoryIDs != null"> AND CTGR_ID IN (<foreach collection="categoryIDs" item="categoryID" separator=",">#{categoryID}</foreach>)</if></where>
<include refid="utility.orderBy" />
<include refid="utility.paging-suffix" /></sql>
@ -94,9 +94,9 @@ UPDATE TB_CODE_CTGR SET
<sql id="selectGroups"><include refid="utility.paging-prefix" />
SELECT *
FROM TB_CODE_GRP
WHERE USE_YN = 'Y'
<if test="categoryIDs != null">AND CTGR_ID IN (<foreach collection="categoryIDs" item="categoryID" separator=",">#{categoryID}</foreach>)</if>
<if test="groupIDs != null">AND GRP_ID IN (<foreach collection="groupIDs" item="groupID" separator=",">#{groupID}</foreach>)</if>
<where><if test="!includeAll"> AND USE_YN = 'Y'</if>
<if test="categoryIDs != null"> AND CTGR_ID IN (<foreach collection="categoryIDs" item="categoryID" separator=",">#{categoryID}</foreach>)</if>
<if test="groupIDs != null"> AND GRP_ID IN (<foreach collection="groupIDs" item="groupID" separator=",">#{groupID}</foreach>)</if></where>
<include refid="utility.orderBy" />
<include refid="utility.paging-suffix" /></sql>
@ -151,9 +151,9 @@ UPDATE TB_CODE_GRP SET
<sql id="selectCodes"><include refid="utility.paging-prefix" />
SELECT *
FROM TB_CMN_CODE
WHERE USE_YN = 'Y'
<if test='groupIDs != null'>AND GRP_ID IN (<foreach collection="groupIDs" item="groupID" separator=",">#{groupID}</foreach>)</if>
<if test='codes != null'>AND CODE IN (<foreach collection="codes" item="code" separator=",">#{code}</foreach>)</if>
<where><if test="!includeAll"> AND USE_YN = 'Y'</if>
<if test='groupIDs != null'> AND GRP_ID IN (<foreach collection="groupIDs" item="groupID" separator=",">#{groupID}</foreach>)</if>
<if test='codes != null'> AND CODE IN (<foreach collection="codes" item="code" separator=",">#{code}</foreach>)</if></where>
<include refid="utility.orderBy" />
<include refid="utility.paging-suffix" /></sql>

@ -45,7 +45,7 @@
<label class="form-label fw-bold form-search-title text-end" for="schSttsCd--${pageName}">처리상태</label>
<select class="form-select" id="schSttsCd--${pageName}" name="schSttsCd">
<option value="">전체</option>
<c:forEach items="${ADDS11List}" var="item">
<c:forEach items="${ADDS11}" var="item">
<option value="${item.code}">${item.value}</option>
</c:forEach>
</select>

@ -45,7 +45,7 @@
<label class="form-label fw-bold form-search-title text-end" for="schSttsCd--${pageName}">처리상태</label>
<select class="form-select" id="schSttsCd--${pageName}" name="schSttsCd">
<option value="">전체</option>
<c:forEach items="${ADDS11List}" var="item">
<c:forEach items="${ADDS11}" var="item">
<option value="${item.code}">${item.value}</option>
</c:forEach>
</select>

@ -12,7 +12,7 @@
<!-- 입력 영역 -->
<form id="bssh--${pageName}" name="bssh">
<!-- hidden -->
<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="col-md-4">
<label for="bsshNm--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">업체명</label>
@ -38,21 +38,16 @@
<div class="col-md-8">
<label for="dsusePrvCd--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">폐기사유</label>
<select class="form-select" id="dsusePrvCd--${pageName}" name="dsusePrvCd">
<option value="01">사고마약류(파손)</option>
<option value="02">사고마약류(변질,부패)</option>
<option value="03">유효기한/사용기한 경과</option>
<option value="04">유효기한 임박</option>
<option value="05">사용중단</option>
<option value="07">폐업</option>
<option value="08">환자반납</option>
<option value="09">기타</option>
<option value="12">제조공정 중 폐기물</option></select>
<c:forEach items="${ADDS04}" var="item">
<option value="${item.code}">${item.value}</option>
</c:forEach>
</select>
</div>
</div>
<div class="row my-1 mx-1 g-1 border-card rounded"></div>
</form>
<form id="product--${pageName}" name="product">
<label for="product--${pageName}" style="margin-top: 10px; padding-left: 20px;"><strong>신청 정보</strong></label>
<label for="product--${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="col-md-4">
<label for="prductNm--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">제품명</label>
@ -515,8 +510,8 @@
$P.initForm();
// 3. Dataset 설정
$P.control.setData([${opnnDlbrMbrInfo}]);
$P.productControl.setData([${opnnDlbrMbrInfo}]);
//$P.control.setData([${dsuseReceptInfo}]);
//$P.productControl.setData([${opnnDlbrMbrInfo}]);
});
</script>

@ -48,7 +48,7 @@
<label class="form-label fw-bold form-search-title text-end" for="schSttsCd--${pageName}">처리상태</label>
<select class="form-select" id="schSttsCd--${pageName}" name="schSttsCd">
<option value="">전체</option>
<c:forEach items="${ADDS11List}" var="item">
<c:forEach items="${ADDS11}" var="item">
<option value="${item.code}">${item.value}</option>
</c:forEach>
</select>
@ -278,13 +278,13 @@
};
// 신청서 정보 dialog
$P.control.getInfo = (gdccId) => {
$P.control.getInfo = (dscdmngId) => {
let dialogTitle = "폐기 신청서 접수";
let params = {};
if(dscdmngId) dialogTitle = "폐기 신청서 접수 상세";
ajax.get({
url : wctx.url("/adds/nims/dsuseMgtReceipt-info.do")
, data : params || {}
, data : dscdmngId? {dscdmngId: dscdmngId} : {}
, success : resp => {
dialog.open({
id : "dsuseMgtReceiptDialog"
@ -317,9 +317,8 @@
//
let replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].control.setCurrent('" + dataItem.getValue("DSCDMNG_ID") + "');");
// .replace(/{ondblclick}/gi, "pageObject['${pageName}'].getTotalInfo('" + dataItem.getValue("DSCDMNG_ID") + "');");
.replace(/{onclick}/gi, "pageObject['${pageName}'].control.setCurrent('" + dataItem.getValue("DSCDMNG_ID") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].control.getInfo('" + dataItem.getValue("DSCDMNG_ID") + "');");
let trs = empty ? [document.getElementById("${infoPrefix}NotFound--${pageName}").content.outerHTML]
: ${infoPrefix}List.inStrings(foundTr.outerHTML, replacer);
@ -458,7 +457,7 @@
$P.control.query.fetchSize = $P.control.defaultFetchSize; // 한번에 조회되는 자료 건수
$P.control.query.delYn = "N"; // 삭제 여부
$P.control.load(1);
$P.control.load();
}
// 엑셀 버튼 클릭 이벤트
@ -560,5 +559,4 @@
$P.fnResetAndChangeBiz($("#layout-navbar input[name='taskSeCd']:checked").val());
});
</script>

@ -0,0 +1,438 @@
<%@ 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="bssh--${pageName}" name="bssh">
<!-- hidden -->
<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="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="bsshNm" 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="bsshCd" 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="rprsntvNm--${pageName}" name="rprsntvNm" data-map="rprsntvNm" 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="prmisnNo--${pageName}" name="prmisnNo" data-map="prmisnNo" 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="bizrno--${pageName}" name="bizrno" data-map="bizrno" readonly>
</div>
<div class="col-md-8">
<label for="dsusePrvCd--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">폐기사유</label>
<select class="form-select" id="dsusePrvCd--${pageName}" name="dsusePrvCd">
<c:forEach items="${ADDS04}" var="item">
<option value="${item.code}">${item.value}</option>
</c:forEach>
</select>
</div>
</div>
<div class="row my-1 mx-1 g-1 border-card rounded"></div>
</form>
<div>
</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.bsshFormFields = new AddsFormFields("#bssh--${pageName}");
$P.productFormFields = new AddsFormFields("#product--${pageName}");
/**************************************************************************
* DatasetControl
**************************************************************************/
$P.control = new DatasetControl({
prefix: "dsuseMgtReceiptBssh"
, prefixName: "마약류 취급업체 조회"
, keymapper: info => info ? info.bsshCd : ""
, dataGetter: obj => obj.${infoPrefix}Info
, infoSize: "xl"
});
$P.bsshList = new Dataset({
prefix: "dsuseMgtReceiptBsshList"
, prefixName: "마약류 취급업체 조회"
, keymapper: info => info ? info.bsshCd : ""
, dataGetter: obj => obj
, infoSize: "xl"
});
$P.productControl = new DatasetControl({
prefix: "dsuseMgtReceiptProduct"
, prefixName: "마약류 제품 조회"
, keymapper: info => info ? info.prductCd : ""
, dataGetter: obj => obj.${infoPrefix}Info
, infoSize: "xl"
});
$P.productList = new Dataset({
prefix: "dsuseMgtReceiptProductList"
, prefixName: "마약류 제품 조회"
, keymapper: info => info ? info.prductCd : ""
, dataGetter: obj => {
if (!obj.success){
dialog.alert(obj.message);
return false;
}
return obj.data;
}
, infoSize: "xl"
, formats: {
prdValidDe: dateFormat
}
});
$P.detailControl = new DatasetControl({
urls : {
load : wctx.url("/adds/nims/dsuseMgtDetail-list.do")
}
, prefix : "dsuseMgtDetail"
, prefixName : "신청서접수상세"
, keymapper : info => info ? info.DSCDMNG_SN : ""
, dataGetter : obj => obj.dsuseMgtDetailList
, formats : {
PRD_VALID_DE: dateFormat
}
});
$P.detailControl.query = { "schDscdmngId" : ${DSCDMNG_ID}};
$P.detailControl.load(1);
/**************************************************************************
* DatasetControl 이벤트
**************************************************************************/
// 현재 선택 자료 변경 이벤트
$P.control.onCurrentChange = item => {
if (!item) return;
$P.bsshFormFields.set($P.control, item);
// 업무구분에 따른 URL 변경
//$P.fnSetURL(item.data.bsshCd);
}
$P.productControl.onCurrentChange = item => {
if (!item) return;
// Dataset 셋팅
$P.productFormFields.set($P.productControl, item);
// 업무구분에 따른 URL 변경
//$P.fnSetURL(item.data.bsshCd);
}
// 저장 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 = () => {
let dialogTitle = "마약류 취급업체 조회";
let params = {openPage : "bssh--${pageName}"};
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.productControl.getProductInfo = () => {
let dialogTitle = "마약류 제품 조회";
let params = {openPage : "product--${pageName}"};
ajax.get({
url : wctx.url("/adds/nims/product-popup.do")
, data : params
, success : resp => {
dialog.open({
id : "productMainDialog"
, title : dialogTitle
, content : resp
, size : $P.productControl.infoSize
, onClose : () => { $P.productControl.setData(); }
});
}
});
}
// 저장
$P.control.save = (jsonBssh, datasetListPrd, fileArr) => {
let saveBsshData = {
...jsonBssh,
rndDtlRptCnt: datasetListPrd.length,
userId: "${currentUser.account}"
}
let create = (jsonBssh.dscdmngId == "");
upload({
url: '<c:url value="${apiHost}/api/biz/nims/v1/saveDsuseMgtReceipt" />'
, data: {
dsuseMgtJsonStr: JSON.stringify(saveBsshData),
dsuseMgtDtlsJsonStr: JSON.stringify(datasetListPrd),
// 폐기상품이미지목록
dsusePrdImgFiles: fileArr
}
, success: resp => {
if(!resp.success){
dialog.alert({
content: resp.message
});
return;
}
//$P.control.onSave(resp)
dialog.alert("저장됐습니다.");
dialog.close("dsuseMgtReceiptDialog");
//this._load();
}
});
}
$P.productList.onDatasetChange = item => {
if (!item) return;
let empty = $P.productList.empty;
// 업무별 DataTables(그리드) tr, td
let foundContent = document.getElementById("productListRow--productList").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}'].productList.setCurrent('" + dataItem.getValue("prductCd") + "');");
let trs = empty ? [document.getElementById("$productListNotFound--productList").content.outerHTML]
: $P.productList.inStrings(foundTr.outerHTML, replacer);
$("#table-responsive--${pageName}")[0].changeContent(trs.join(), true, true);
fnMakeGridImageViewer($("#tbody--productList").find("td.prdDsuseImg").get(), "dsusePrdImgFiles");
}
/**************************************************************************
* DataTables 이벤트
**************************************************************************/
/**************************************************************************
* 사용자 함수(function)
**************************************************************************/
// 검색 자료 재조회
$P.fnRefreshList = () => {
$P.control.untilPageNum = $P.control.query.pageNum;
$P.control.query.fetchSize = $P.control.defaultFetchSize * $P.control.query.pageNum;
$P.control.load(1);
}
// 업무구분에 따른 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();
}
$P.fnSearchProduct = (title) => {
$P.productControl.getProductInfo();
}
/**************************************************************************
* 버튼 clickEvent
**************************************************************************/
// 저장
$P.fnSave = () => {
// validate 확인
if (!customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return;
let bsshData = $P.bsshFormFields.get();
if(bsshData.bsshCd == ""){
dialog.alert({
content: "마약류 취급업체 정보를 입력해주세요."
});
return false;
}
let dsProd = $P.productList.getDataset();
if(dsProd.length == 0){
dialog.alert({
content: "폐기 제품 정보를 입력해주세요."
});
return false;
}
let fileArr = [];
$("#tbody--productList").find("input[type='file'][name='dsusePrdImgFiles']").each(function() {
fileArr.push(this.files[0]);
});
if(dsProd.length != fileArr.length){
dialog.alert({
content: "입력되지 않은 폐기 제품 이미지가 있습니다."
});
return false;
}
dialog.alert({
content: "현재 " + $P.control.prefixName + " 정보를 저장하시겠습니까?"
, init: () => { setDialogZindex(); }
, onOK: () => {
$P.control.save(bsshData, dsProd, fileArr); // formFields
}
});
}
//추가
$P.fnAdd = () => {
if(!$P.productFormFields.get().prductCd){
dialog.alert({
content: "제품 정보를 입력해주세요."
});
return false;
}
if(!$P.productFormFields.get().dsuseQy){
dialog.alert({
content: "폐기수량을 입력해 주세요"
});
return false;
}
let isDup = $P.productList
.getDataset()
.filter(item => item.prductCd == $P.productFormFields.get().prductCd)
.length > 0;
if(isDup){
dialog.alert({
content: "등록한 상품[" + $P.productFormFields.get().prductCd + "]입니다"
});
return false;
}
$P.productList.addData([$P.productFormFields.get()]);
// FIXME: 상품필드 초기화 코드 추가
//
}
$P.fnDel = () => {
// validate 확인
if (!customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return;
dialog.alert({
content: "현재 " + $P.control.prefixName + " 정보를 저장하시겠습니까?"
, init: () => { setDialogZindex(); }
, onOK: () => {
$P.control.save($P.bsshFormFields.get()); // formFields
}
});
}
/**************************************************************************
* 초기 셋팅
**************************************************************************/
// 이벤트 설정
$P.setEvent = () => {
// 안내문 등록 버튼 이벤트
$("#btnBsshSearch--${pageName}").on("click", function() {
$P.fnSearchBssh($(this).attr("title"));
});
$("#btnProductSearch--${pageName}").on("click", function() {
$P.fnSearchProduct($(this).attr("title"));
});
// 버튼 이벤트
$("#btnSave--${pageName}").on("click", () => $P.fnSave()); // 저장
$("#btnAdd--${pageName}").on("click", () => $P.fnAdd()); // 추가
$("#btnDel--${pageName}").on("click", () => $P.fnDel()); // 추가
}
// 초기 화면 설정
$P.initForm = () => {
fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollDataList);
}
/**************************************************************************
* 최초 실행 함수
**************************************************************************/
// 1. 이벤트 설정
$P.setEvent();
// 2. 초기 화면 설정
$P.initForm();
// 3. Dataset 설정
$P.control.setData([${dsuseReceptInfo}]);
$P.productControl.setData([${opnnDlbrMbrInfo}]);
});
</script>

@ -236,6 +236,7 @@
upload({
url: '<c:url value="${apiHost}/api/biz/nims/v1/saveDsuseMgtRslt" />'
, data: {
fileChangeYn: "Y",
dsuseMgtRsltJsonStr: JSON.stringify(saveData),
dsuseDsuseImgFiles: fileArr
}
@ -475,6 +476,22 @@
// 3. Dataset 설정
$P.control.setData([${dsuseRsltInfo}]);
});
let fileInfos = ${fileInfos};
if(fileInfos.length > 0){
let promiseArr = [];
fileInfos.forEach(f => promiseArr.push(fnCreateFileFromFileInfo(f)));
Promise.all(promiseArr).then((values) => {
$P.fileArr = $P.fileArr.concat(values);
$P.fnDisplay();
}).catch((error) => {
alert(error);
dialog.close($P.control.prefix + "Dialog--${openerPageName}");
});
}
});
</script>

@ -46,7 +46,7 @@
<label class="form-label fw-bold form-search-title text-end" for="schSttsCd--${pageName}">처리상태</label>
<select class="form-select" id="schSttsCd--${pageName}" name="schSttsCd">
<option value="">전체</option>
<c:forEach items="${ADDS11List}" var="item">
<c:forEach items="${ADDS11}" var="item">
<option value="${item.code}">${item.value}</option>
</c:forEach>
</select>
@ -136,15 +136,15 @@
<table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer"
id="DataTables_Table_1--${pageName}" aria-describedby="DataTables_Table_0_info">
<thead class="sticky-thead">
<tr>
<th class="cmn" style="width: 72px;">No.</th>
<th class="sorting sorting_asc" aria-sort="ascending" style="width: 350.719px;">제품명</th>
<th class="sorting" style="width: 146.156px;">제품코드</th>
<th class="sorting" style="width: 130.141px;">폐기수량</th>
<th class="sorting" style="width: 130.469px;">유효기간</th>
<th class="sorting" style="width: 180.469px;">유통단위 수량</th>
<th class="sorting" style="width: 180.469px;">낱개단위 수량</th>
</tr>
<tr>
<th class="cmn" style="width: 72px;">No.</th>
<th class="sorting sorting_asc" aria-sort="ascending" style="width: 350.719px;">제품명</th>
<th class="sorting" style="width: 146.156px;">제품코드</th>
<th class="sorting" style="width: 130.141px;">폐기수량</th>
<th class="sorting" style="width: 130.469px;">유효기간</th>
<th class="sorting" style="width: 180.469px;">유통단위 수량</th>
<th class="sorting" style="width: 180.469px;">낱개단위 수량</th>
</tr>
</thead>
<tbody id="tbody--${pageName}Detail">
</tbody>
@ -197,8 +197,6 @@
$P.control = new DatasetControl({
urls : {
load : wctx.url("/adds/nims/dsuseMgtRslt-list.do")
// FIXME: POST로 변경
//load : '<c:url value="${apiHost}/api/biz/nims/v1/getDsuseMgts" />'
}
, prefix: "dsuseMgtRslt"
, prefixName: "결과(통보)처리"
@ -207,8 +205,7 @@
, appendData: true
, infoSize: "xl"
, formats: {
RPT_DE: dateFormat
, HDR_DE: dateFormat
HDR_DE: dateFormat
, DSUSE_DE: dateFormat
}
});
@ -221,11 +218,7 @@
$P.detailControl = new DatasetControl({
urls : {
load : wctx.url("/adds/nims/dsuseMgtDetail-list.do")
// FIXME: POST로 변경
//load : '<c:url value="${apiHost}/api/biz/nims/v1/getDsuseMgts" />'
}
// , query.schDscdmngId : $P.control.getValue("DSCDMNG_ID")
// , data : {"schDscdmngId" : $P.control.getValue("DSCDMNG_ID")}
}
, prefix : "dsuseMgtDetail"
, prefixName : "신청서접수상세"
, keymapper : info => info ? info.DSCDMNG_SN : ""
@ -265,8 +258,7 @@
let key = item.data.DSCDMNG_ID;
$("#tbody--${pageName}").setCurrentRow(key);
var dscdmngId = item.data.DSCDMNG_ID;
$P.detailControl.query = { "schDscdmngId" : dscdmngId};
$P.detailControl.query = { "schDscdmngId" : item.data.DSCDMNG_ID};
$P.detailControl.load(1);
};
@ -283,6 +275,7 @@
// 신청서 정보 dialog
$P.control.getInfo = (isDtl) => {
let dialogTitle = "폐기 결과[통보] 등록";
if(isDtl) dialogTitle = "폐기 결과[통보] 상세";
let row = $P.control.dataset.getCurrent();
if (typeof row == "undefined" || row == null || row == "") return;
let params = {

@ -35,7 +35,7 @@
<tbody id="groupList">
</tbody>
<template id="groupRow">
<tr data-key="{GRP_ID}">
<tr data-key="{GRP_ID}"{notUsed}>
<td style="text-align:center;"><input value="{GRP_ID}" onchange="codeControl.groups.select('{GRP_ID}', this.checked);" type="checkbox" class="form-check-input"></td>
<td onclick="codeControl.groups.setCurrent('{GRP_ID}')" ondblclick="codeControl.groups.getInfo({})">{GRP_ID}</td>
<td onclick="codeControl.groups.setCurrent('{GRP_ID}')" ondblclick="codeControl.groups.getInfo({})">{GRP_NM}</td>
@ -73,7 +73,7 @@
<tbody id="codeList">
</tbody>
<template id="codeRow">
<tr data-key="{CODE}">
<tr data-key="{CODE}"{notUsed}>
<td style="text-align:center;"><input value="{CODE}" onchange="codeControl.codes.select('{CODE}', this.checked);" type="checkbox" class="form-check-input"></td>
<td onclick="codeControl.codes.setCurrent('{CODE}')" ondblclick="codeControl.codes.getInfo({})">{CODE}</td>
<td onclick="codeControl.codes.setCurrent('{CODE}')" ondblclick="codeControl.codes.getInfo({})">{CODE_VAL}</td>
@ -131,7 +131,10 @@ function renderGroupList() {
let trs = empty ?
[document.getElementById("groupNotFound").innerHTML] : <%-- from template#groupNotFound --%>
groupList.inStrings(document.getElementById("groupRow").innerHTML); <%-- from template#groupRow --%>
groupList.inStrings(
document.getElementById("groupRow").innerHTML,
(tmpl, item) => tmpl.replace(/{notUsed}/gi, item.getValue("USE_YN") == "N" ? "class=\"not-used\"" : "")
); <%-- from template#groupRow --%>
$("#groupList").html(trs.join());
$("th input[type='checkbox']").prop("checked", false);
}
@ -174,7 +177,10 @@ function renderCodeList() {
let trs = empty ?
[document.getElementById("codeNotFound").innerHTML] : <%-- from template#groupNotFound --%>
codeList.inStrings(document.getElementById("codeRow").innerHTML); <%-- from template#groupRow --%>
codeList.inStrings(
document.getElementById("codeRow").innerHTML,
(tmpl, item) => tmpl.replace(/{notUsed}/gi, item.getValue("USE_YN") == "N" ? "class=\"not-used\"" : "")
); <%-- from template#groupRow --%>
$("#codeList").html(trs.join());
$("#codeToggler").prop("checked", false);
}

@ -39,6 +39,7 @@
<!-- 공통 유틸 -->
<script src="<c:url value="/webjars/applib/js/cmmnUtil.js?${ver}"/>"></script>
<script src="<c:url value="/resources/js/adds/cmmn/adds-cmmnUtil.js?${ver}"/>"></script>
<!-- 날짜 관련 유틸 -->
<script src="<c:url value="/webjars/applib/js/cmmnDateUtil.js?${ver}"/>"></script>
<!-- 초기화 유틸 -->

@ -0,0 +1,16 @@
/**************************************************************************
* 서버의 파일 정보로 javascript File 객체 생성
**************************************************************************/
async function fnCreateFileFromFileInfo(fileInfo){
let response = await fetch(fileInfo.URL);
let data = await response.blob();
let metadata = {
type: fileInfo.MIME_TYPE
};
let file = new File([data], fileInfo.FILE_NM, metadata);
file.id = fileInfo.FILE_ID;
file.url = fileInfo.URL;
return new Promise(resolve => { resolve(file); });
}
Loading…
Cancel
Save