From d2de757967ccf76488fd8ecc3413121b2392211a Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Wed, 17 Jul 2024 11:25:45 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=8F=90=EA=B8=B0=EA=B2=B0=EA=B3=BC?= =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EC=A4=91=EB=B3=B5=20=EB=B0=A9?= =?UTF-8?q?=EC=A7=80=20=EC=B2=98=EB=A6=AC=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xit/adds/cmm/model/DsuseRsltInfo.java | 2 + .../adds/nims/service/AddsNimsService.java | 2 + .../service/bean/AddsNimsServiceBean.java | 10 +++++ .../xit/adds/nims/web/AddsNimsController.java | 26 ++++++++++- .../adds/nims/dsuseMgtReceipt-mapper.xml | 4 +- .../mapper/adds/nims/dsuseMgtRslt-mapper.xml | 26 ++++++----- .../jsp/adds/nims/dsuseMgtMapping-main.jsp | 26 +++++------ .../jsp/adds/nims/dsuseMgtReceipt-main.jsp | 4 +- .../jsp/adds/nims/dsuseMgtRslt-info.jsp | 45 ++++++++++++++----- .../jsp/adds/nims/dsuseMgtRslt-main.jsp | 7 +-- 10 files changed, 109 insertions(+), 43 deletions(-) diff --git a/src/main/java/cokr/xit/adds/cmm/model/DsuseRsltInfo.java b/src/main/java/cokr/xit/adds/cmm/model/DsuseRsltInfo.java index 9c94d88..af795b8 100644 --- a/src/main/java/cokr/xit/adds/cmm/model/DsuseRsltInfo.java +++ b/src/main/java/cokr/xit/adds/cmm/model/DsuseRsltInfo.java @@ -81,4 +81,6 @@ public class DsuseRsltInfo { private String dsuseLoc; private String prgrsSttsCd; + + private String deptCd; } diff --git a/src/main/java/cokr/xit/adds/nims/service/AddsNimsService.java b/src/main/java/cokr/xit/adds/nims/service/AddsNimsService.java index bed8597..a028d51 100644 --- a/src/main/java/cokr/xit/adds/nims/service/AddsNimsService.java +++ b/src/main/java/cokr/xit/adds/nims/service/AddsNimsService.java @@ -3,8 +3,10 @@ package cokr.xit.adds.nims.service; import java.util.List; import cokr.xit.adds.nims.DsuseMgtDetailQuery; +import cokr.xit.adds.nims.DsuseMgtRsltQuery; import cokr.xit.foundation.data.DataObject; public interface AddsNimsService { List getDsuseMgtDetailList(DsuseMgtDetailQuery query); + List getDsuseMgtRsltImgList(DsuseMgtRsltQuery query); } diff --git a/src/main/java/cokr/xit/adds/nims/service/bean/AddsNimsServiceBean.java b/src/main/java/cokr/xit/adds/nims/service/bean/AddsNimsServiceBean.java index c648a14..b2f3005 100644 --- a/src/main/java/cokr/xit/adds/nims/service/bean/AddsNimsServiceBean.java +++ b/src/main/java/cokr/xit/adds/nims/service/bean/AddsNimsServiceBean.java @@ -7,7 +7,9 @@ import javax.annotation.Resource; import org.springframework.stereotype.Service; import cokr.xit.adds.nims.DsuseMgtDetailQuery; +import cokr.xit.adds.nims.DsuseMgtRsltQuery; import cokr.xit.adds.nims.dao.DsuseMgtDetailMapper; +import cokr.xit.adds.nims.dao.DsuseMgtRsltMapper; import cokr.xit.adds.nims.service.AddsNimsService; import cokr.xit.foundation.component.AbstractServiceBean; import cokr.xit.foundation.data.DataObject; @@ -18,8 +20,16 @@ public class AddsNimsServiceBean extends AbstractServiceBean implements AddsNims @Resource(name = "dsuseMgtDetailMapper") private DsuseMgtDetailMapper dsuseMgtDetailMapper; + @Resource(name = "dsuseMgtRsltMapper") + private DsuseMgtRsltMapper dsuseMgtRsltMapper; + @Override public List getDsuseMgtDetailList(DsuseMgtDetailQuery query){ return dsuseMgtDetailMapper.selectDsuseMgtDetailList(query); } + + @Override + public List getDsuseMgtRsltImgList(DsuseMgtRsltQuery query) { + return dsuseMgtRsltMapper.selectDsuseMgtRsltImgList(query); + } } 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 dd2a393..cb92726 100644 --- a/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java +++ b/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java @@ -34,6 +34,7 @@ import cokr.xit.adds.cmmn.hwp.format.DisposeResultReport; import cokr.xit.adds.nims.DsuseMgtDetailQuery; import cokr.xit.adds.nims.DsuseMgtDocQuery; import cokr.xit.adds.nims.DsuseMgtReceiptQuery; +import cokr.xit.adds.nims.DsuseMgtRsltQuery; import cokr.xit.adds.nims.service.AddsNimsService; import cokr.xit.adds.nims.service.DsuseMgtDocService; import cokr.xit.adds.nims.service.DsuseMgtReceiptService; @@ -174,6 +175,8 @@ public class AddsNimsController extends ApplicationController { //------------------------------------------------------------------------------------------------- @RequestMapping(value = "dsuseMgtRslt-list.do", name="결과[통보] 처리 조회") public ModelAndView getDsuseMgtRsltList(DsuseMgtReceiptQuery query) { + query.setOrderBy("DSUSE_DE DESC, DSUSE_MTH_CD, DSCDMNG_ID"); + //query.setOrderBy("DSUSE_MTH_CD"); setFetchSize(query); return setCollectionInfo(new ModelAndView("jsonView"), dsuseMgtReceiptService.getDsuseMgtReceiptList(query),"",""); @@ -198,6 +201,27 @@ public class AddsNimsController extends ApplicationController { }) .toList(); mav.addObject("fileInfos", toJson(fileInfos)); + // 폐기증거사진 - 폐기증거사진 등록 정보 조회 + mav.addObject("dsuseRsltImgList", + toJson("[]") + ); + + // 폐기일자가 있는 경우 - 폐기증거사진 등록 정보 조회 + if(!isEmpty(dsuseRsltInfo.getDsuseDe())) { + mav.addObject( + "dsuseRsltImgList", + toJson( + addsNimsService.getDsuseMgtRsltImgList( + new DsuseMgtRsltQuery() + .setDscdmngId(dsuseRsltInfo.getDscdmngId()) + .setDeptCd(dsuseRsltInfo.getDeptCd()) + .setDsuseDe(dsuseRsltInfo.getDsuseDe().replaceAll("-", "")) + .setDsuseMthCd(dsuseRsltInfo.getDsuseMthCd() + ) + ) + ) + ); + } return mav .addObject("pageName", "dsuseMgtRsltInfo") // View(jsp)에서 사용할 id 뒤에 붙일 suffix @@ -249,7 +273,7 @@ public class AddsNimsController extends ApplicationController { //------------------------------------------------------------------------------------------------- // 보고 문서 관리 //------------------------------------------------------------------------------------------------- - @RequestMapping(value = "dsuseMgtDoc-list.do", name="결과[통보] 처리 조회") + @RequestMapping(value = "dsuseMgtDoc-list.do", name="보고문서관리 목록 조회") public ModelAndView getDsuseMgtDocList(DsuseMgtDocQuery query) { query.setOrderBy("dsuse_de DESC, dsuse_mth_cd, dscdmng_id DESC"); setFetchSize(query); diff --git a/src/main/resources/sql/mapper/adds/nims/dsuseMgtReceipt-mapper.xml b/src/main/resources/sql/mapper/adds/nims/dsuseMgtReceipt-mapper.xml index 90d4747..3917b3a 100644 --- a/src/main/resources/sql/mapper/adds/nims/dsuseMgtReceipt-mapper.xml +++ b/src/main/resources/sql/mapper/adds/nims/dsuseMgtReceipt-mapper.xml @@ -46,8 +46,8 @@ , B.PRMISN_NO /* 허가번호 */ FROM TB_DSUSE_MGT A JOIN tb_dept td ON A.dept_cd = td.dept_cd - LEFT OUTER JOIN TB_BSSH_INFO B ON A.BSSH_CD = B.BSSH_CD - WHERE A.USE_YN = "Y" + LEFT JOIN TB_BSSH_INFO B ON A.BSSH_CD = B.BSSH_CD + WHERE A.USE_YN = 'Y' diff --git a/src/main/resources/sql/mapper/adds/nims/dsuseMgtRslt-mapper.xml b/src/main/resources/sql/mapper/adds/nims/dsuseMgtRslt-mapper.xml index fedc1d2..9e393fc 100644 --- a/src/main/resources/sql/mapper/adds/nims/dsuseMgtRslt-mapper.xml +++ b/src/main/resources/sql/mapper/adds/nims/dsuseMgtRslt-mapper.xml @@ -8,18 +8,22 @@ /* 폐기 결과 이미지 등록 조회(dsuseMgtRsltMapper.selectDsuseMgtRsltImgList) */ SELECT tdm.DSCDMNG_ID , tdm.DSUSE_MTH_CD + , tcc.CODE_VAL AS DSUSE_MTH_NM , tdm.DSUSE_DE - , tf.FILE_ID - -- , tf.FILE_NM - -- , IF(tf.FILE_ID IS NULL, 'Y', 'N') AS ins_yn - -- , IFNULL(tf.FILE_ID, 'N') AS ins_yn + , IF(#{dscdmngId} = tdm.DSCDMNG_ID, 'Y', 'N') AS SEL_YN FROM tb_dsuse_mgt tdm - LEFT JOIN tb_file tf - ON tdm.dscdmng_id = tf.inf_key - AND tf.INF_TYPE = '110' - WHERE tdm.use_yn = 'Y' - AND tdm.dept_cd = '4050149' - AND tdm.dsuse_mth_cd = '3' - AND tdm.dsuse_de = '20240709' + JOIN tb_cmn_code tcc + ON (tdm.dsuse_mth_cd = tcc.code + AND tcc.grp_id = 'ADDS05') + WHERE EXISTS ( + SELECT 1 + FROM tb_file + WHERE tdm.dscdmng_id = inf_key + AND INF_TYPE = '110' + ) + AND tdm.use_yn = 'Y' + AND tdm.dept_cd = #{deptCd} + AND tdm.dsuse_mth_cd = #{dsuseMthCd} + AND tdm.dsuse_de = #{dsuseDe} diff --git a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtMapping-main.jsp b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtMapping-main.jsp index da69541..82e15f8 100644 --- a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtMapping-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtMapping-main.jsp @@ -87,17 +87,17 @@ data-by="by--${pageName}" data-by-output="byOutput--${pageName}" data-main-option="mainOption--${pageName}" data-sub-option="subOption--${pageName}"> No. 관할관청 - 취급일자 - 관리번호 - 업체명 - 보고건수 - 처리상태 + 취급일자 + 폐기관리번호 + 업체명 + 보고건수 + 처리상태 NIMS보고ID - 폐기구분 - 폐기사유 - 폐기방법 - 폐기장소 - 폐기일자 + 폐기일자 + 폐기방법 + 폐기사유 + 폐기구분 + 폐기장소 @@ -114,11 +114,11 @@ {USR_RPT_ID_NO} - {DSUSE_SE_NM} - {DSUSE_PRV_NM} + {DSUSE_DE} {DSUSE_MTH_NM} + {DSUSE_PRV_NM} + {DSUSE_SE_NM} {DSUSE_LOC} - {DSUSE_DE} diff --git a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtRslt-info.jsp b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtRslt-info.jsp index cb5b076..53c4b14 100644 --- a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtRslt-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtRslt-info.jsp @@ -80,12 +80,10 @@
- - - + + + +
@@ -134,10 +132,28 @@ **************************************************************************/ pageObject["${pageName}"] = {}; + + /************************************************************************** * script 진입 **************************************************************************/ $(document).ready(function() { + const fnRsltImgList = (list) => { + if(!list || list.length === 0) return; + + // 폐기결과 이미지를 등록한 폐기관리 ID면 skip - 이미지 추가 삭제 가능 + let isSelf = list.filter(item => item.SEL_YN == 'Y') + if(isSelf.length > 0) return; + + $('#btnImgAdd').prop('disabled', true); + let tagsTextArr = []; + + for(let idx = 0; idx < list.length; idx++){ + let item = list[idx]; + tagsTextArr.push('기등록 폐기 사진 - 폐기관리ID: [' + item.DSCDMNG_ID + ']
폐기일자: ' + item.DSUSE_DE + ', 폐기방법: ' + item.DSUSE_MTH_NM); + } + document.getElementById("rsltImgList").innerHTML = tagsTextArr.join(""); + } // pageObject let $P = pageObject["${pageName}"]; @@ -147,6 +163,7 @@ // FormFields $P.formFields = new AddsFormFields("#frmEdit--${pageName}"); + //$P.rsltImgList = fnRsltImgList(list); /************************************************************************** * DatasetControl **************************************************************************/ @@ -170,7 +187,12 @@ $P.control.defaultFetchSize = FETCH_XS; // 1 페이지당 조회되는 자료 건수 index.jsp에서 확인 FETCH_XS = 30 $P.control.beforeCurrent = null; - + + + $P.rsltImgDs = new Dataset({ + keymapper: info => info ? info.DSCDMNG_ID : "", + onDatasetChange: (list) => fnRsltImgList(list) + }); /************************************************************************** * DatasetControl 이벤트 @@ -276,7 +298,7 @@ dialog.close("dsuseMgtRsltDialog"); } }); - } + } //uploadSupport 생성 $P.uploadSet = uploadSupport("#inputUploadSet--${pageName}"); @@ -486,6 +508,7 @@ r.hdrDe = r.hdrDe ? r.hdrDe.replace("-","").replace("-","") : ""; } $P.control.setData(dsuseRsltInfo); + $P.rsltImgDs.setData(${dsuseRsltImgList}); // 취급일자 및 페기일자에 값이 없는 경우 당일로 초기화. if (($P.control.getValue("dsuseDe") == null || $P.control.getValue("dsuseDe") == "") && @@ -516,11 +539,11 @@ $P.fnDisplay(); }).catch((error) => { - //alert(error); - //dialog.close($P.control.prefix + "Dialog--${openerPageName}"); }); } + + }); - + diff --git a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtRslt-main.jsp b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtRslt-main.jsp index fec8c2a..352a7fc 100644 --- a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtRslt-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtRslt-main.jsp @@ -90,11 +90,11 @@ 업체명 취급일자 폐기일자 + 폐기방법 폐기건수 폐기사유 사고발생일 폐기구분 - 폐기방법 폐기장소 @@ -109,11 +109,11 @@ {BSSH_NM} {HDR_DE} {DSUSE_DE} + {DSUSE_MTH_NM} {RND_DTL_RPT_CNT} {DSUSE_PRV_NM} {DSUSE_ACDT_DE} {DSUSE_SE_NM} - {DSUSE_MTH_NM} {DSUSE_LOC} @@ -315,7 +315,8 @@ dsuseSeCd: row.DSUSE_SE_CD, dsuseMthCd: row.DSUSE_MTH_CD, dsuseLoc: row.DSUSE_LOC, - dsuseAcdtDe: row.DSUSE_ACDT_DE + dsuseAcdtDe: row.DSUSE_ACDT_DE, + deptCd: '${currentUser.deptCode}' } }