fix: 폐기결과이미지 중복 방지 처리 반영

dev
Jonguk. Lim 4 months ago
parent 1ea113d222
commit d2de757967

@ -81,4 +81,6 @@ public class DsuseRsltInfo {
private String dsuseLoc; private String dsuseLoc;
private String prgrsSttsCd; private String prgrsSttsCd;
private String deptCd;
} }

@ -3,8 +3,10 @@ package cokr.xit.adds.nims.service;
import java.util.List; import java.util.List;
import cokr.xit.adds.nims.DsuseMgtDetailQuery; import cokr.xit.adds.nims.DsuseMgtDetailQuery;
import cokr.xit.adds.nims.DsuseMgtRsltQuery;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
public interface AddsNimsService { public interface AddsNimsService {
List<DataObject> getDsuseMgtDetailList(DsuseMgtDetailQuery query); List<DataObject> getDsuseMgtDetailList(DsuseMgtDetailQuery query);
List<DataObject> getDsuseMgtRsltImgList(DsuseMgtRsltQuery query);
} }

@ -7,7 +7,9 @@ import javax.annotation.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import cokr.xit.adds.nims.DsuseMgtDetailQuery; 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.DsuseMgtDetailMapper;
import cokr.xit.adds.nims.dao.DsuseMgtRsltMapper;
import cokr.xit.adds.nims.service.AddsNimsService; import cokr.xit.adds.nims.service.AddsNimsService;
import cokr.xit.foundation.component.AbstractServiceBean; import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
@ -18,8 +20,16 @@ public class AddsNimsServiceBean extends AbstractServiceBean implements AddsNims
@Resource(name = "dsuseMgtDetailMapper") @Resource(name = "dsuseMgtDetailMapper")
private DsuseMgtDetailMapper dsuseMgtDetailMapper; private DsuseMgtDetailMapper dsuseMgtDetailMapper;
@Resource(name = "dsuseMgtRsltMapper")
private DsuseMgtRsltMapper dsuseMgtRsltMapper;
@Override @Override
public List<DataObject> getDsuseMgtDetailList(DsuseMgtDetailQuery query){ public List<DataObject> getDsuseMgtDetailList(DsuseMgtDetailQuery query){
return dsuseMgtDetailMapper.selectDsuseMgtDetailList(query); return dsuseMgtDetailMapper.selectDsuseMgtDetailList(query);
} }
@Override
public List<DataObject> getDsuseMgtRsltImgList(DsuseMgtRsltQuery query) {
return dsuseMgtRsltMapper.selectDsuseMgtRsltImgList(query);
}
} }

@ -34,6 +34,7 @@ import cokr.xit.adds.cmmn.hwp.format.DisposeResultReport;
import cokr.xit.adds.nims.DsuseMgtDetailQuery; import cokr.xit.adds.nims.DsuseMgtDetailQuery;
import cokr.xit.adds.nims.DsuseMgtDocQuery; 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.service.AddsNimsService; import cokr.xit.adds.nims.service.AddsNimsService;
import cokr.xit.adds.nims.service.DsuseMgtDocService; import cokr.xit.adds.nims.service.DsuseMgtDocService;
import cokr.xit.adds.nims.service.DsuseMgtReceiptService; import cokr.xit.adds.nims.service.DsuseMgtReceiptService;
@ -174,6 +175,8 @@ public class AddsNimsController extends ApplicationController {
//------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------
@RequestMapping(value = "dsuseMgtRslt-list.do", name="결과[통보] 처리 조회") @RequestMapping(value = "dsuseMgtRslt-list.do", name="결과[통보] 처리 조회")
public ModelAndView getDsuseMgtRsltList(DsuseMgtReceiptQuery query) { public ModelAndView getDsuseMgtRsltList(DsuseMgtReceiptQuery query) {
query.setOrderBy("DSUSE_DE DESC, DSUSE_MTH_CD, DSCDMNG_ID");
//query.setOrderBy("DSUSE_MTH_CD");
setFetchSize(query); setFetchSize(query);
return setCollectionInfo(new ModelAndView("jsonView"), dsuseMgtReceiptService.getDsuseMgtReceiptList(query),"",""); return setCollectionInfo(new ModelAndView("jsonView"), dsuseMgtReceiptService.getDsuseMgtReceiptList(query),"","");
@ -198,6 +201,27 @@ public class AddsNimsController extends ApplicationController {
}) })
.toList(); .toList();
mav.addObject("fileInfos", toJson(fileInfos)); 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 return mav
.addObject("pageName", "dsuseMgtRsltInfo") // View(jsp)에서 사용할 id 뒤에 붙일 suffix .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) { public ModelAndView getDsuseMgtDocList(DsuseMgtDocQuery query) {
query.setOrderBy("dsuse_de DESC, dsuse_mth_cd, dscdmng_id DESC"); query.setOrderBy("dsuse_de DESC, dsuse_mth_cd, dscdmng_id DESC");
setFetchSize(query); setFetchSize(query);

@ -46,8 +46,8 @@
, B.PRMISN_NO /* 허가번호 */ , B.PRMISN_NO /* 허가번호 */
FROM TB_DSUSE_MGT A FROM TB_DSUSE_MGT A
JOIN tb_dept td ON A.dept_cd = td.dept_cd 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 LEFT JOIN TB_BSSH_INFO B ON A.BSSH_CD = B.BSSH_CD
WHERE A.USE_YN = "Y" WHERE A.USE_YN = 'Y'
</sql> </sql>

@ -8,18 +8,22 @@
/* 폐기 결과 이미지 등록 조회(dsuseMgtRsltMapper.selectDsuseMgtRsltImgList) */ /* 폐기 결과 이미지 등록 조회(dsuseMgtRsltMapper.selectDsuseMgtRsltImgList) */
SELECT tdm.DSCDMNG_ID SELECT tdm.DSCDMNG_ID
, tdm.DSUSE_MTH_CD , tdm.DSUSE_MTH_CD
, tcc.CODE_VAL AS DSUSE_MTH_NM
, tdm.DSUSE_DE , tdm.DSUSE_DE
, tf.FILE_ID , IF(#{dscdmngId} = tdm.DSCDMNG_ID, 'Y', 'N') AS SEL_YN
-- , tf.FILE_NM
-- , IF(tf.FILE_ID IS NULL, 'Y', 'N') AS ins_yn
-- , IFNULL(tf.FILE_ID, 'N') AS ins_yn
FROM tb_dsuse_mgt tdm FROM tb_dsuse_mgt tdm
LEFT JOIN tb_file tf JOIN tb_cmn_code tcc
ON tdm.dscdmng_id = tf.inf_key ON (tdm.dsuse_mth_cd = tcc.code
AND tf.INF_TYPE = '110' AND tcc.grp_id = 'ADDS05')
WHERE tdm.use_yn = 'Y' WHERE EXISTS (
AND tdm.dept_cd = '4050149' SELECT 1
AND tdm.dsuse_mth_cd = '3' FROM tb_file
AND tdm.dsuse_de = '20240709' 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}
</select> </select>
</mapper> </mapper>

@ -87,17 +87,17 @@
data-by="by--${pageName}" data-by-output="byOutput--${pageName}" data-main-option="mainOption--${pageName}" data-sub-option="subOption--${pageName}"> data-by="by--${pageName}" data-by-output="byOutput--${pageName}" data-main-option="mainOption--${pageName}" data-sub-option="subOption--${pageName}">
<th class="cmn" style="width: 72px;">No.</th> <th class="cmn" style="width: 72px;">No.</th>
<th class="cmn" style="width: 170.141px;">관할관청</th> <th class="cmn" style="width: 170.141px;">관할관청</th>
<th class="cmn" style="width: 160.141px;">취급일자</th> <th class="cmn" style="width: 120.141px;">취급일자</th>
<th class="cmn" style="width: 160.141px;">관리번호</th> <th class="cmn" style="width: 130.141px;">폐기관리번호</th>
<th class="cmn" style="width: 230.469px;">업체명</th> <th class="cmn" style="width: 300.469px;">업체명</th>
<th class="cmn" style="width: 100px;">보고건수</th> <th class="cmn" style="width: 90px;">보고건수</th>
<th class="cmn" style="width: 230.469px;">처리상태</th> <th class="cmn" style="width: 170.469px;">처리상태</th>
<th class="cmn" style="width: 270.469px;">NIMS보고ID</th> <th class="cmn" style="width: 270.469px;">NIMS보고ID</th>
<th class="cmn" style="width: 180px;">폐기구분</th> <th class="cmn" style="width: 120.469px;">폐기일자</th>
<th class="cmn" style="width: 230.469px;">폐기사유</th> <th class="cmn" style="width: 150px;">폐기방법</th>
<th class="cmn" style="width: 180px;">폐기방법</th> <th class="cmn" style="width: 180.469px;">폐기사유</th>
<th class="cmn" style="width: 230.469px;">폐기장소</th> <th class="cmn" style="width: 150px;">폐기구분</th>
<th class="cmn" style="width: 230.469px;">폐기일자</th> <th class="cmn" style="width: 200.469px;">폐기장소</th>
</tr> </tr>
</thead> </thead>
<tbody id="tbody--${pageName}"> <tbody id="tbody--${pageName}">
@ -114,11 +114,11 @@
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}"> <td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">
<a href="#">{USR_RPT_ID_NO}</a> <a href="#">{USR_RPT_ID_NO}</a>
</td> </td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_SE_NM}</td> <td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_DE}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_PRV_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_MTH_NM}</td> <td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_MTH_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_PRV_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_SE_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_LOC}</td> <td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_LOC}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_DE}</td>
</tr> </tr>
</template> </template>
<template id="${infoPrefix}NotFound--${pageName}"> <template id="${infoPrefix}NotFound--${pageName}">

@ -98,8 +98,8 @@
<th class="cmn" style="width: 120.141px;">사고발생일</th> <th class="cmn" style="width: 120.141px;">사고발생일</th>
<th class="cmn" style="width: 120.141px;">취급일자</th> <th class="cmn" style="width: 120.141px;">취급일자</th>
<th class="cmn" style="width: 120.469px;">폐기일자</th> <th class="cmn" style="width: 120.469px;">폐기일자</th>
<th class="cmn" style="width: 150px;">폐기구분</th>
<th class="cmn" style="width: 150px;">폐기방법</th> <th class="cmn" style="width: 150px;">폐기방법</th>
<th class="cmn" style="width: 150px;">폐기구분</th>
<th class="cmn" style="width: 200.469px;">폐기장소</th> <th class="cmn" style="width: 200.469px;">폐기장소</th>
</tr> </tr>
</thead> </thead>
@ -117,8 +117,8 @@
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_ACDT_DE}</td> <td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_ACDT_DE}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{HDR_DE}</td> <td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{HDR_DE}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_DE}</td> <td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_DE}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_SE_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_MTH_NM}</td> <td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_MTH_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_SE_NM}</td>
<td class="cmn" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_LOC}</td> <td class="cmn" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_LOC}</td>
</tr> </tr>
</template> </template>

@ -80,12 +80,10 @@
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<span class="d-inline-flex"> <span class="d-inline-flex">
<label for="dsuseImg--${pageName}" <label for="dsuseImg--${pageName}" class="w-px-130 h-px-30 bg-lighter pe-2 col-form-label text-sm-end">폐기(진행) 사진</label>
class="w-px-130 h-px-30 bg-lighter pe-2 col-form-label text-sm-end">폐기(진행) 사진</label> <button type="button" class="btn btn-primary mx-1" id="btnImgAdd" onclick="$('#inputUploadSet--${pageName}').trigger('click');">추가</button>
<button type="button" class="btn btn-primary mx-1" <button type="button" class="btn btn-primary mx-1" id="btnImageDel--${pageName}" hidden>삭제</button>
onclick="$('#inputUploadSet--${pageName}').trigger('click');">추가</button> <span style="padding-left: 10px; font-weight: bold; color: #696cff; align-items: center" id="rsltImgList"></span>
<button type="button" class="btn btn-primary mx-1"
id="btnImageDel--${pageName}" hidden>삭제</button>
</span> </span>
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
@ -134,10 +132,28 @@
**************************************************************************/ **************************************************************************/
pageObject["${pageName}"] = {}; pageObject["${pageName}"] = {};
/************************************************************************** /**************************************************************************
* script 진입 * script 진입
**************************************************************************/ **************************************************************************/
$(document).ready(function() { $(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 + ']<br>폐기일자: ' + item.DSUSE_DE + ', 폐기방법: ' + item.DSUSE_MTH_NM);
}
document.getElementById("rsltImgList").innerHTML = tagsTextArr.join("");
}
// pageObject // pageObject
let $P = pageObject["${pageName}"]; let $P = pageObject["${pageName}"];
@ -147,6 +163,7 @@
// FormFields // FormFields
$P.formFields = new AddsFormFields("#frmEdit--${pageName}"); $P.formFields = new AddsFormFields("#frmEdit--${pageName}");
//$P.rsltImgList = fnRsltImgList(list);
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl
**************************************************************************/ **************************************************************************/
@ -172,6 +189,11 @@
$P.control.beforeCurrent = null; $P.control.beforeCurrent = null;
$P.rsltImgDs = new Dataset({
keymapper: info => info ? info.DSCDMNG_ID : "",
onDatasetChange: (list) => fnRsltImgList(list)
});
/************************************************************************** /**************************************************************************
* DatasetControl 이벤트 * DatasetControl 이벤트
**************************************************************************/ **************************************************************************/
@ -486,6 +508,7 @@
r.hdrDe = r.hdrDe ? r.hdrDe.replace("-","").replace("-","") : ""; r.hdrDe = r.hdrDe ? r.hdrDe.replace("-","").replace("-","") : "";
} }
$P.control.setData(dsuseRsltInfo); $P.control.setData(dsuseRsltInfo);
$P.rsltImgDs.setData(${dsuseRsltImgList});
// 취급일자 및 페기일자에 값이 없는 경우 당일로 초기화. // 취급일자 및 페기일자에 값이 없는 경우 당일로 초기화.
if (($P.control.getValue("dsuseDe") == null || $P.control.getValue("dsuseDe") == "") && if (($P.control.getValue("dsuseDe") == null || $P.control.getValue("dsuseDe") == "") &&
@ -516,10 +539,10 @@
$P.fnDisplay(); $P.fnDisplay();
}).catch((error) => { }).catch((error) => {
//alert(error);
//dialog.close($P.control.prefix + "Dialog--${openerPageName}");
}); });
} }
}); });

@ -90,11 +90,11 @@
<th class="cmn" style="width: 250.469px;">업체명</th> <th class="cmn" style="width: 250.469px;">업체명</th>
<th class="cmn" style="width: 120.141px;">취급일자</th> <th class="cmn" style="width: 120.141px;">취급일자</th>
<th class="cmn" style="width: 120.469px;">폐기일자</th> <th class="cmn" style="width: 120.469px;">폐기일자</th>
<th class="cmn" style="width: 150px;">폐기방법</th>
<th class="cmn" style="width: 90px;">폐기건수</th> <th class="cmn" style="width: 90px;">폐기건수</th>
<th class="cmn" style="width: 180.469px;">폐기사유</th> <th class="cmn" style="width: 180.469px;">폐기사유</th>
<th class="cmn" style="width: 120.141px;">사고발생일</th> <th class="cmn" style="width: 120.141px;">사고발생일</th>
<th class="cmn" style="width: 150px;">폐기구분</th> <th class="cmn" style="width: 150px;">폐기구분</th>
<th class="cmn" style="width: 150px;">폐기방법</th>
<th class="cmn" style="width: 200.469px;">폐기장소</th> <th class="cmn" style="width: 200.469px;">폐기장소</th>
</tr> </tr>
</thead> </thead>
@ -109,11 +109,11 @@
<td class="cmn text-start" onclick="{onclick}" ondblclick="{ondblclick}">{BSSH_NM}</td> <td class="cmn text-start" onclick="{onclick}" ondblclick="{ondblclick}">{BSSH_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{HDR_DE}</td> <td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{HDR_DE}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_DE}</td> <td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_DE}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_MTH_NM}</td>
<td class="cmn text-end" onclick="{onclick}" ondblclick="{ondblclick}">{RND_DTL_RPT_CNT}</td> <td class="cmn text-end" onclick="{onclick}" ondblclick="{ondblclick}">{RND_DTL_RPT_CNT}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_PRV_NM}</td> <td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_PRV_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_ACDT_DE}</td> <td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_ACDT_DE}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_SE_NM}</td> <td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_SE_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_MTH_NM}</td>
<td class="cmn" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_LOC}</td> <td class="cmn" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_LOC}</td>
</tr> </tr>
</template> </template>
@ -315,7 +315,8 @@
dsuseSeCd: row.DSUSE_SE_CD, dsuseSeCd: row.DSUSE_SE_CD,
dsuseMthCd: row.DSUSE_MTH_CD, dsuseMthCd: row.DSUSE_MTH_CD,
dsuseLoc: row.DSUSE_LOC, dsuseLoc: row.DSUSE_LOC,
dsuseAcdtDe: row.DSUSE_ACDT_DE dsuseAcdtDe: row.DSUSE_ACDT_DE,
deptCd: '${currentUser.deptCode}'
} }
} }

Loading…
Cancel
Save