fix: 폐기결과[통보] 처리 이미지 처리

-> 폐기일자 & 폐기방법별로 단 한개의 폐기보고에서만 이미지 업로드 및 변경 처리하도록 변경
dev
Jonguk. Lim 4 months ago
parent b6d173324b
commit 47e8a24e45

@ -210,7 +210,7 @@ public class AddsNimsController extends ApplicationController {
mav.addObject( mav.addObject(
"dsuseRsltImgList", "dsuseRsltImgList",
toJson( toJson(
addsNimsService.getDsuseMgtRsltImgList( getDsuseMgtRsltImgDscdmngList(
new DsuseMgtRsltQuery() new DsuseMgtRsltQuery()
.setDscdmngId(dsuseRsltInfo.getDscdmngId()) .setDscdmngId(dsuseRsltInfo.getDscdmngId())
.setDeptCd(dsuseRsltInfo.getDeptCd()) .setDeptCd(dsuseRsltInfo.getDeptCd())
@ -229,6 +229,11 @@ public class AddsNimsController extends ApplicationController {
.addObject("dsuseRsltInfo", toJson(dsuseRsltInfo)) // View(jsp)에서 사용할 id 뒤에 붙일 suffix .addObject("dsuseRsltInfo", toJson(dsuseRsltInfo)) // View(jsp)에서 사용할 id 뒤에 붙일 suffix
.addObject("apiHost", apiHost); .addObject("apiHost", apiHost);
} }
@RequestMapping(value = "/getDsuseMgtRsltImgDscdmngList.do", name="결과[통보] 처리 등록 이미지 폐기관리 목록 조회")
public @ResponseBody List<DataObject> getDsuseMgtRsltImgDscdmngList(DsuseMgtRsltQuery query) {
return addsNimsService.getDsuseMgtRsltImgList(query);
}
//------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------
// 결과[통보] 처리 // 결과[통보] 처리
//------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------
@ -248,10 +253,7 @@ public class AddsNimsController extends ApplicationController {
return mav return mav
.addObject("pageName", "dsuseMgtMappingInfo") // View(jsp)에서 사용할 id 뒤에 붙일 suffix .addObject("pageName", "dsuseMgtMappingInfo") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
.addObject("apiHost", apiHost) .addObject("apiHost", apiHost)
.addObject("dsuseMappingInfo", toJson(dsuseMappingInfo)) // View(jsp)에서 사용할 id 뒤에 붙일 suffix .addObject("dsuseMappingInfo", toJson(dsuseMappingInfo)) /* View(jsp)에서 사용할 id 뒤에 붙일 suffix */;
// .addObject("infoPrefix", "dsuseMgtReceipt") // prefix
// .addObject("infoPrefixUrl", "/adds/nims") // prefixUrl
;
} }
@RequestMapping(value = "/updatePrgsSttusOfDsuseMgt.do", name = "페기 보고 확인 등록") @RequestMapping(value = "/updatePrgsSttusOfDsuseMgt.do", name = "페기 보고 확인 등록")
public ModelAndView updatePrgsSttusOfDsuseMgt(DsuseMgtReceiptQuery qry) { public ModelAndView updatePrgsSttusOfDsuseMgt(DsuseMgtReceiptQuery qry) {
@ -339,11 +341,7 @@ public class AddsNimsController extends ApplicationController {
List<DataObject> deptList = sggDeptService.getDepartmentList(new DepartmentQuery()); List<DataObject> deptList = sggDeptService.getDepartmentList(new DepartmentQuery());
mav.addObject("DEPTList", deptList); mav.addObject("DEPTList", deptList);
return mav return mav.addObject("pageName", "dsuseMgtReceipt") /* View(jsp)에서 사용할 id 뒤에 붙일 suffix */;
.addObject("pageName", "dsuseMgtReceipt") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
// .addObject("infoPrefix", "dsuseMgtReceipt") // prefix
// .addObject("infoPrefixUrl", "/adds/nims") // prefixUrl
;
} }
@RequestMapping(value = "dsuseMgtRslt.do", name="결과[통보] 처리 메인") @RequestMapping(value = "dsuseMgtRslt.do", name="결과[통보] 처리 메인")
@ -353,11 +351,7 @@ public class AddsNimsController extends ApplicationController {
List<DataObject> deptList = sggDeptService.getDepartmentList(new DepartmentQuery()); List<DataObject> deptList = sggDeptService.getDepartmentList(new DepartmentQuery());
mav.addObject("DEPTList", deptList); mav.addObject("DEPTList", deptList);
return mav return mav.addObject("pageName", "dsuseMgtRslt") /* View(jsp)에서 사용할 id 뒤에 붙일 suffix */;
.addObject("pageName", "dsuseMgtRslt") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
// .addObject("infoPrefix", "dsuseMgtReceipt") // prefix
// .addObject("infoPrefixUrl", "/adds/nims") // prefixUrl
;
} }
@RequestMapping(value = "/dsuseMgtMapping.do", name="폐기 보고 확인 메인") @RequestMapping(value = "/dsuseMgtMapping.do", name="폐기 보고 확인 메인")
@ -367,11 +361,7 @@ public class AddsNimsController extends ApplicationController {
List<DataObject> deptList = sggDeptService.getDepartmentList(new DepartmentQuery()); List<DataObject> deptList = sggDeptService.getDepartmentList(new DepartmentQuery());
mav.addObject("DEPTList", deptList); mav.addObject("DEPTList", deptList);
return mav return mav.addObject("pageName", "dsuseMgtMapping") /* View(jsp)에서 사용할 id 뒤에 붙일 suffix */;
.addObject("pageName", "dsuseMgtMapping") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
// .addObject("infoPrefix", "dsuseMgtReceipt") // prefix
// .addObject("infoPrefixUrl", "/adds/nims") // prefixUrl
;
} }
@RequestMapping(name = "폐기보고 문서 관리 메인", value = {"/dsuseMgtDoc.do"}) @RequestMapping(name = "폐기보고 문서 관리 메인", value = {"/dsuseMgtDoc.do"})
@ -525,7 +515,7 @@ public class AddsNimsController extends ApplicationController {
//3.DB 저장, 스토리지 저장 //3.DB 저장, 스토리지 저장
List<String> dscdmngIds = IntStream.rangeClosed(1, dataForDoc.size()).boxed().map(i -> { List<String> dscdmngIds = IntStream.rangeClosed(1, dataForDoc.size()).boxed().map(i -> {
return dataForDoc.get(i-1).string("dscdmngId"); return dataForDoc.get(i-1).string("dscdmngId");
}).collect(Collectors.toList()); }).toList();
boolean allEqual = dscdmngIds.stream().distinct().count() <= 1; boolean allEqual = dscdmngIds.stream().distinct().count() <= 1;
if(allEqual) { if(allEqual) {
String resultFilePath = form.andGetPath(); String resultFilePath = form.andGetPath();

@ -51,12 +51,12 @@
<input type="text" class="form-control w-45 form-date" id="hdrDe--${pageName}" name="hdrDe" data-fmt-type="day" data-map="hdrDe" autocomplete="off" title="종료 날짜 선택" /> <input type="text" class="form-control w-45 form-date" id="hdrDe--${pageName}" name="hdrDe" data-fmt-type="day" data-map="hdrDe" autocomplete="off" title="종료 날짜 선택" />
<button type="button" class="bx bx-lg bx-calendar bg-white"></button> <button type="button" class="bx bx-lg bx-calendar bg-white"></button>
</div> </div>
<div class="col-md-4"> <div class="col-md-8">
<label for="dsuseDe--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">폐기일자</label> <label for="dsuseDe--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">폐기일자</label>
<input type="text" class="form-control w-45 form-date" id="dsuseDe--${pageName}" name="dsuseDe" data-fmt-type="day" data-map="dsuseDe" autocomplete="off" title="종료 날짜 선택" /> <input type="text" class="form-control w-px-130 form-date" id="dsuseDe--${pageName}" name="dsuseDe" data-fmt-type="day" data-map="dsuseDe" autocomplete="off" title="종료 날짜 선택" />
<button type="button" class="bx bx-lg bx-calendar bg-white"></button> <button type="button" class="bx bx-lg bx-calendar bg-white"></button>
<span style="padding-left: 10px; font-weight: bold; color: red; align-items: center" id="spnDsuseDe">폐기일자는 등록후 변경이 불가 합니다</span>
</div> </div>
<div class="col-md-4"></div>
<div class="col-md-4"> <div class="col-md-4">
<label for="dsuseSeCd--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">폐기구분</label> <label for="dsuseSeCd--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">폐기구분</label>
<select class="form-select" id="dsuseSeCd--${pageName}" name="dsuseSeCd"> <select class="form-select" id="dsuseSeCd--${pageName}" name="dsuseSeCd">
@ -65,13 +65,14 @@
</c:forEach> </c:forEach>
</select> </select>
</div> </div>
<div class="col-md-4"> <div class="col-md-8">
<label for="dsuseMthCd--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">폐기방법</label> <label for="dsuseMthCd--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">폐기방법</label>
<select class="form-select" id="dsuseMthCd--${pageName}" name="dsuseMthCd"> <select class="form-select" id="dsuseMthCd--${pageName}" name="dsuseMthCd">
<c:forEach items="${ADDS05}" var="item"> <c:forEach items="${ADDS05}" var="item">
<option value="${item.code}">${item.value}</option> <option value="${item.code}">${item.value}</option>
</c:forEach> </c:forEach>
</select> </select>
<span style="padding-left: 10px; font-weight: bold; color: red; align-items: center" id="spnDsuseMthCd">폐기방법은 등록후 변경이 불가 합니다</span>
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
<label for="dsuseLoc--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">폐기장소</label> <label for="dsuseLoc--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">폐기장소</label>
@ -80,8 +81,8 @@
<div class="col-md-12"> <div class="col-md-12">
<span class="d-inline-flex"> <span class="d-inline-flex">
<label for="dsuseImg--${pageName}" class="w-px-130 h-px-30 bg-lighter pe-2 col-form-label text-sm-end">폐기(진행) 사진</label> <label for="dsuseImg--${pageName}" 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" id="btnImgAdd--${pageName}" onclick="$('#inputUploadSet--${pageName}').trigger('click');">추가</button>
<button type="button" class="btn btn-primary mx-1" id="btnImageDel--${pageName}" hidden>삭제</button> <button type="button" class="btn btn-primary mx-1" id="btnImgDel--${pageName}" hidden>삭제</button>
<span style="padding-left: 10px; font-weight: bold; color: #696cff; align-items: center" id="rsltImgList"></span> <span style="padding-left: 10px; font-weight: bold; color: #696cff; align-items: center" id="rsltImgList"></span>
</span> </span>
</div> </div>
@ -137,23 +138,29 @@
* script 진입 * script 진입
**************************************************************************/ **************************************************************************/
$(document).ready(function() { $(document).ready(function() {
// 최초(load) 여부
let initDataset = false; let initDataset = false;
// 변경 화면
let isEditData = false;
const searchRsltImgList = () => { const searchRsltImgList = () => {
alert('ddd'); document.getElementById("rsltImgList").innerHTML = "";
return; $('#btnImgAdd--${pageName}').prop('disabled', false);
$('#btnImgDel--${pageName}').prop('disabled', false);
let param = { let param = {
dscdmngId: $("#dscdmngId--${pageName}").val(), dscdmngId: $("#dscdmngId--${pageName}").val(),
dsuseDe: $("#dsuseDe--${pageName}").val(), dsuseDe: $("#dsuseDe--${pageName}").val().replace(/-/g, ""),
dsuseMthCd: $("#dsuseMthCd--${pageName}").val(), dsuseMthCd: $("#dsuseMthCd--${pageName}").val(),
deptCd: "${currentUser.deptCode}" deptCd: "${currentUser.deptCode}"
}; };
$.ajax({ $.ajax({
url :wctx.url("/adds/nims/getDsuseMgtRsltImgList.do") url :wctx.url("/adds/nims/getDsuseMgtRsltImgDscdmngList.do")
,type:"post" ,type: "get"
,data:{ dtls : JSON.stringify(dtls) } ,data: param
,dataType:"json" ,dataType:"json"
,success:function(jsonStr){ ,success:function(jsonStr){
fnRsltImgList(jsonStr);
} }
}); });
@ -166,7 +173,8 @@
let isSelf = list.filter(item => item.SEL_YN == 'Y') let isSelf = list.filter(item => item.SEL_YN == 'Y')
if(isSelf.length > 0) return; if(isSelf.length > 0) return;
$('#btnImgAdd').prop('disabled', true); $('#btnImgAdd--${pageName}').prop('disabled', true);
$('#btnImgDel--${pageName}').prop('disabled', true);
let tagsTextArr = []; let tagsTextArr = [];
for(let idx = 0; idx < list.length; idx++){ for(let idx = 0; idx < list.length; idx++){
@ -223,19 +231,16 @@
$P.control.onCurrentChange = item => { $P.control.onCurrentChange = item => {
if (!item) return; if (!item) return;
if(!initDataset && item.data.dsuseDe){
//$("#dsuseDe--${pageName}, #dsuseMthCd--${pageName}").on("change", () => { isEditData = true;
alert("item : "+item.data.dsuseDe) $('#dsuseDe--${pageName}').prop('disabled', true);
alert($("#dsuseDe--${pageName}").val()) $('#dsuseMthCd--${pageName}').prop('disabled', true);
//}); $('#spnDsuseDe').hide();
$('#spnDsuseMthCd').hide();
}
// Dataset 셋팅 // Dataset 셋팅
$P.formFields.set($P.control, item); $P.formFields.set($P.control, item);
alert("item : "+item.data.dsuseDe)
alert($("#dsuseDe--${pageName}").val())
// 보고완료 상태인 경우 저장 버튼 비활성화 // 보고완료 상태인 경우 저장 버튼 비활성화
if($("input[name='prgrsSttsCd']").val() == '99') { if($("input[name='prgrsSttsCd']").val() == '99') {
$("#btnSave--${pageName}").prop("disabled", true); $("#btnSave--${pageName}").prop("disabled", true);
@ -280,13 +285,6 @@
// 저장 // 저장
$P.control.save = (info, fileArr) => { $P.control.save = (info, fileArr) => {
// if(fileArr.length == 0){
// dialog.alert({
// content: "폐기(진행) 사진을 1개 이상 등록해 주세요."
// });
// return;
// }
let saveData = { let saveData = {
...info, ...info,
prgrsSttsCd: "06", prgrsSttsCd: "06",
@ -388,10 +386,10 @@
if($P.fileArr.length > 0){ if($P.fileArr.length > 0){
let tagsText = $P.fnMakeImgTags($P.fileArr); let tagsText = $P.fnMakeImgTags($P.fileArr);
document.querySelector("#dragAndDrop--${pageName}").innerHTML = tagsText; document.querySelector("#dragAndDrop--${pageName}").innerHTML = tagsText;
$("#btnImageDel--${pageName}").removeAttr("hidden"); $("#btnImgDel--${pageName}").removeAttr("hidden");
} else { } else {
document.querySelector("#dragAndDrop--${pageName}").innerHTML = ""; document.querySelector("#dragAndDrop--${pageName}").innerHTML = "";
$("#btnImageDel--${pageName}").attr("hidden","hidden"); $("#btnImgDel--${pageName}").attr("hidden","hidden");
} }
} }
@ -469,7 +467,7 @@
}); });
//이미지 삭제 버튼 //이미지 삭제 버튼
$("#btnImageDel--${pageName}").on("click", function() { $("#btnImgDel--${pageName}").on("click", function() {
let checkeds = $("#dragAndDrop--${pageName}").find(":checkbox[name='dsuseDsuseImgFilesSelector']:checked"); let checkeds = $("#dragAndDrop--${pageName}").find(":checkbox[name='dsuseDsuseImgFilesSelector']:checked");
if(checkeds.length > 0){ if(checkeds.length > 0){
let keys = []; let keys = [];
@ -486,7 +484,11 @@
$("#btnSave--${pageName}").on("click", () => $P.fnSave()); // 저장 $("#btnSave--${pageName}").on("click", () => $P.fnSave()); // 저장
$("#dsuseDe--${pageName}, #dsuseMthCd--${pageName}").on("change", () => { $("#dsuseDe--${pageName}, #dsuseMthCd--${pageName}").on("change", () => {
if(initDataset) fnRsltImgList(); if(!initDataset){
initDataset = true;
return;
}
if(!isEditData) searchRsltImgList();
}); });
} }

Loading…
Cancel
Save