From 8dc17acb06b517932d040fb2a0cce56b0039388c Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Sat, 20 Jul 2024 23:06:18 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=8F=90=EA=B8=B0=EA=B2=B0=EA=B3=BC=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=20:=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20?= =?UTF-8?q?=EA=B3=B5=EC=9C=A0=20=EA=B4=80=EB=A6=AC=EB=B2=88=ED=98=B8=20?= =?UTF-8?q?=EC=B6=9C=EB=A0=A5=20=EB=B0=8F=20=EA=B1=B4=EC=88=98=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sql/mapper/adds/nims/dsuseMgtRslt-mapper.xml | 10 +++++----- .../WEB-INF/jsp/adds/nims/dsuseMgtRslt-info.jsp | 12 ++++++++---- 2 files changed, 13 insertions(+), 9 deletions(-) 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 cacd758..cb34202 100644 --- a/src/main/resources/sql/mapper/adds/nims/dsuseMgtRslt-mapper.xml +++ b/src/main/resources/sql/mapper/adds/nims/dsuseMgtRslt-mapper.xml @@ -10,13 +10,13 @@ , tdm.DSUSE_MTH_CD , tcc.CODE_VAL AS DSUSE_MTH_NM , tdm.DSUSE_DE - , IF(#{dscdmngId} = tdm.DSCDMNG_ID, 'Y', 'N') AS SEL_YN - , (SELECT count(dscdmng_id) - FROM tb_dsuse_mgt - WHERE use_yn = 'Y' + , IF(#{dscdmngId} = tdm.DSCDMNG_ID, 'Y', 'N') AS SELF_YN + , (SELECT GROUP_CONCAT(dscdmng_id SEPARATOR ',') + FROM tb_dsuse_mgt + WHERE use_yn = 'Y' AND dept_cd = #{deptCd} AND dsuse_mth_cd = #{dsuseMthCd} - AND dsuse_de = #{dsuseDe}) AS SAVE_CNT + AND dsuse_de = #{dsuseDe}) AS DSCDMNG_IDS FROM tb_dsuse_mgt tdm JOIN tb_cmn_code tcc ON (tdm.dsuse_mth_cd = tcc.code 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 3f0bae3..3bf8d6a 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 @@ -183,19 +183,23 @@ */ const fnRsltImgList = (list, isOnload) => { // onload시 이미지가 있는지 여부 체크 - if(isOnload) isOnloadExistRsltImg = list.length > 0; + if(isOnload) isOnloadExistRsltImg = list[0].SELF_YN === 'Y'; if(!list || list.length === 0) return; // 폐기결과 이미지를 등록한 폐기관리 ID면 skip - 이미지 추가 삭제 가능 - let isSelf = list.filter(item => item.SEL_YN == 'Y') + let isSelf = list.filter(item => item.SELF_YN === 'Y') if(isSelf.length > 0){ // 등록된 폐기 관리가 2개 이상이면 폐기일자, 폐기방법 변경 불가 - if(list[0].SAVE_CNT > 1){ + let dscnmngIds = list[0].DSCDMNG_IDS.split(','); + if(dscnmngIds.length > 1){ $('#dsuseDe--${pageName}').prop('disabled', true); $('#dsuseMthCd--${pageName}').prop('disabled', true); $('#spnDsuseDe').show(); $('#spnDsuseMthCd').show(); + + + document.getElementById("rsltImgList").innerHTML = '총 ' + dscnmngIds.length + '건 에서 이미지 공유
이미지 공유 폐기관리번호 : [' + dscnmngIds.filter(item => item != $("#dscdmngId--${pageName}").val()).join(', ') + ']'; } return; } @@ -207,7 +211,7 @@ for(let idx = 0; idx < list.length; idx++){ let item = list[idx]; - tagsTextArr.push('폐기관리번호 : [ ' + item.DSCDMNG_ID + ' ]
폐기일자 : [ ' + item.DSUSE_DE + ' ] 폐기방법 : [ ' + item.DSUSE_MTH_NM + ' ] 의 폐기 이미지 공유(사용)'); + tagsTextArr.push('폐기관리번호 : [ ' + item.DSCDMNG_ID + ' ]
폐기일자 : [ ' + item.DSUSE_DE + ' ] 폐기방법 : [ ' + item.DSUSE_MTH_NM + ' ] 의 폐기 이미지 공유'); } document.getElementById("rsltImgList").innerHTML = tagsTextArr.join(""); if(isOnloadExistRsltImg && list.length > 0) isRsltImgRemove = true;