개별총정보 - 단속 사진 보기, 추가 기능 수정.

main
jjh 1 year ago
parent d2534cc1f3
commit 6c85dbc6ed

@ -118,7 +118,7 @@ public class Excl02Controller extends ApplicationController {
} }
/** . /** .
* @param opnnSbmsn * @param opnnSbmsn , uploadFiles
* @return jsonView * @return jsonView
* <pre><code> { * <pre><code> {
* "saved": true, false * "saved": true, false
@ -148,7 +148,7 @@ public class Excl02Controller extends ApplicationController {
} }
/** . /** .
* @param opnnSbmsn * @param opnnSbmsn , uploadFiles
* @return jsonView * @return jsonView
* <pre><code> { * <pre><code> {
* "saved": true, false * "saved": true, false

@ -1,7 +1,10 @@
package cokr.xit.fims.sprt.dao; package cokr.xit.fims.sprt.dao;
import java.util.Map;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper; import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.sprt.SprtQuery; import cokr.xit.fims.sprt.SprtQuery;
import cokr.xit.foundation.component.AbstractMapper; import cokr.xit.foundation.component.AbstractMapper;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
@ -31,4 +34,24 @@ public interface TotalInfoMapper extends AbstractMapper {
*/ */
DataObject selectCrdnPayerInfo(SprtQuery req); DataObject selectCrdnPayerInfo(SprtQuery req);
/** .
* @param params
* <ul><li>"crdn" - </li>
* <li>"currentUser" - </li>
* </ul>
* @return
*/
int updateCrdnAtchFileCnt(Map<String, Object> params);
/** .
* @param crdn
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
default boolean updateCrdnAtchFileCnt(Crdn crdn) {
return crdn != null && updateCrdnAtchFileCnt(params().set("crdn", crdn)) == 1;
}
} }

@ -1,5 +1,10 @@
package cokr.xit.fims.sprt.service; package cokr.xit.fims.sprt.service;
import java.util.List;
import java.util.Map;
import cokr.xit.base.file.FileInfo;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.sprt.SprtQuery; import cokr.xit.fims.sprt.SprtQuery;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
@ -27,4 +32,10 @@ public interface Sprt02Service {
*/ */
DataObject getCrdnPayerInfo(SprtQuery req); DataObject getCrdnPayerInfo(SprtQuery req);
/** .
* @param nonQueryRequest , crdn , newFileInfoList
* @return
*/
String updateCrdnImageFile(Map<String, Object> nonQueryRequest, Crdn crdn, List<FileInfo> newFileInfoList);
} }

@ -4,6 +4,7 @@ import javax.annotation.Resource;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.sprt.SprtQuery; import cokr.xit.fims.sprt.SprtQuery;
import cokr.xit.fims.sprt.dao.TotalInfoMapper; import cokr.xit.fims.sprt.dao.TotalInfoMapper;
import cokr.xit.foundation.AbstractComponent; import cokr.xit.foundation.AbstractComponent;
@ -42,4 +43,21 @@ public class Sprt02Bean extends AbstractComponent {
return totalInfoMapper.selectCrdnPayerInfo(req); return totalInfoMapper.selectCrdnPayerInfo(req);
} }
public String updateCrdnAtchFileCnt(Crdn crdn) {
// 변수 선언
boolean retSuccess = false; // DB 처리 결과
String retMessage = ""; // 처리 결과 메시지
// 의견제출 대장을 수정 한다.
retSuccess = totalInfoMapper.updateCrdnAtchFileCnt(crdn);
if (!retSuccess) {
// 예외를 발생시켜서 오류메세지를 보내고 DB Rollback
throw new RuntimeException("단속 첨부 파일 갯수 수정에 실패하였습니다.");
}
retMessage = "[S] 작업이 정상 처리 되었습니다.";
return retMessage;
}
} }

@ -1,9 +1,18 @@
package cokr.xit.fims.sprt.service.bean; package cokr.xit.fims.sprt.service.bean;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import cokr.xit.base.file.FileInfo;
import cokr.xit.base.file.service.FileQuery;
import cokr.xit.base.file.service.bean.FileBean;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.excl.OpnnSbmsn;
import cokr.xit.fims.sprt.SprtQuery; import cokr.xit.fims.sprt.SprtQuery;
import cokr.xit.fims.sprt.service.Sprt02Service; import cokr.xit.fims.sprt.service.Sprt02Service;
import cokr.xit.foundation.component.AbstractServiceBean; import cokr.xit.foundation.component.AbstractServiceBean;
@ -26,6 +35,10 @@ public class Sprt02ServiceBean extends AbstractServiceBean implements Sprt02Serv
@Resource(name="sprt02Bean") @Resource(name="sprt02Bean")
protected Sprt02Bean sprt02Bean; protected Sprt02Bean sprt02Bean;
/** 파일 Bean */
@Resource(name="fileBean")
private FileBean fileBean;
@Override @Override
public DataObject getCrdnInfo(SprtQuery req) { public DataObject getCrdnInfo(SprtQuery req) {
return sprt02Bean.getCrdnInfo(req); return sprt02Bean.getCrdnInfo(req);
@ -33,7 +46,81 @@ public class Sprt02ServiceBean extends AbstractServiceBean implements Sprt02Serv
@Override @Override
public DataObject getCrdnPayerInfo(SprtQuery req) { public DataObject getCrdnPayerInfo(SprtQuery req) {
return sprt02Bean.getCrdnPayerInfo(req); // 단속, 납부자 조회
DataObject dataObject = sprt02Bean.getCrdnPayerInfo(req);
// 첨부파일 조회
FileQuery fileQuery = new FileQuery();
fileQuery.setInfoType(Crdn.INF_TYPE);
fileQuery.setInfoKeys(req.getCrdnId());
List<DataObject> fileList = fileBean.getFileList(fileQuery);
if (fileList != null && !fileList.isEmpty()) {
dataObject.set("fileList", fileList);
}
// 동영상 존재 여부 확인
// dataObject.set("videoExist", "N");
// String linkTblNm = dataObject.string("LINK_TBL_NM");
//
// if (!linkTblNm.equals("")) {
// if (linkTblNm.equals("TB_ESB_INTERFACE")) {
// fileQuery.setInfoType("010");
// } else if(linkTblNm.equals("TB_SAEOL")) {
// fileQuery.setInfoType("020");
// } else {
// throw new RuntimeException("파일 조회 중 오류가 발생하였습니다.");
// }
//
// fileQuery.setInfoKeys(dataObject.string("LINK_ID"));
//
// List<DataObject> linkFileList = fileBean.getFileList(fileQuery);
//
// if (linkFileList != null && !linkFileList.isEmpty()) {
// for (int iLoop = 0; iLoop < linkFileList.size(); iLoop++) {
// String mimeType = linkFileList.get(iLoop).string("MIME_TYPE");
// if (Arrays.asList(Sprt.VIDEO_MIME_TYPE).contains(mimeType)) {
// dataObject.set("videoExist", "Y");
// }
// }
// }
// }
return dataObject;
}
@Override
public String updateCrdnImageFile(Map<String, Object> nonQueryRequest, Crdn crdn, List<FileInfo> newFileInfoList) {
// 변수 선언
String retMessage = ""; // 처리 결과 메시지
// 첨부파일 등록
if (newFileInfoList != null && !newFileInfoList.isEmpty()) {
// 파일 등록
int fileInsertEffected = fileBean.create(newFileInfoList);
// 단속 ID로 파일(TB_FILE) 정보 조회
List<DataObject> infoFileList = fileBean.getFileList(new FileQuery().setInfoType(Crdn.INF_TYPE)
.setInfoKeys(crdn.getCrdnId()).setOrderBy("FILE_ID"));
if (infoFileList != null && infoFileList.size() > 0) {
String[] fileIDs = new String[infoFileList.size()];
for (int iLoop = 0; iLoop < infoFileList.size(); iLoop++) {
fileIDs[iLoop] = infoFileList.get(iLoop).string("FILE_ID");
}
fileBean.reorder(fileIDs); // 첨부파일 재 정렬
}
crdn.setAtchFileCnt(crdn.getAtchFileCnt() + fileInsertEffected);
retMessage = sprt02Bean.updateCrdnAtchFileCnt(crdn);
}
return retMessage;
} }
} }

@ -1,17 +1,28 @@
package cokr.xit.fims.sprt.web; package cokr.xit.fims.sprt.web;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Stream;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.file.FileInfo;
import cokr.xit.base.file.FileInfo.Relation;
import cokr.xit.base.file.web.FileInfoFactory;
import cokr.xit.base.web.ApplicationController; import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.cmmn.CrdnPayerHstryQuery; import cokr.xit.fims.cmmn.CrdnPayerHstryQuery;
import cokr.xit.fims.cmmn.CrdnSttsHstryQuery; import cokr.xit.fims.cmmn.CrdnSttsHstryQuery;
import cokr.xit.fims.cmmn.service.CrdnPayerHstryService; import cokr.xit.fims.cmmn.service.CrdnPayerHstryService;
import cokr.xit.fims.cmmn.service.CrdnSttsHstryService; import cokr.xit.fims.cmmn.service.CrdnSttsHstryService;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.cvlc.CrdnCvlcpt;
import cokr.xit.fims.excl.ExclQuery; import cokr.xit.fims.excl.ExclQuery;
import cokr.xit.fims.excl.service.Excl01Service; import cokr.xit.fims.excl.service.Excl01Service;
import cokr.xit.fims.excl.service.Excl02Service; import cokr.xit.fims.excl.service.Excl02Service;
@ -119,6 +130,61 @@ public class Sprt02Controller extends ApplicationController {
; ;
} }
/** , .
* @param crdn , newFileList, modifyFileList
* @return jsonView
* <pre><code> {
* "affected":
* "saved": true, false
* }</code></pre>
*/
@RequestMapping(name="단속 이미지 파일 저장", value="/020/update.do")
public ModelAndView updateCrdnImageFile(HttpServletRequest hReq, Crdn crdn, MultipartFile[] newFileList, MultipartFile[] modifyFileList) {
boolean saved = false;
String retMessage = "[F] ";
String[] deleteFileKeyList = hReq.getParameterValues("deleteFileKeyList");
String[] modifyFileKeyList = hReq.getParameterValues("modifyFileKeyList");
List<FileInfo> newFileInfoList = new ArrayList<FileInfo>();
if (newFileList != null || modifyFileList != null) {
Relation relation = new Relation();
relation.setInfoType(Crdn.INF_TYPE);
relation.setInfoKey(crdn.getCrdnId());
if (newFileList != null) {
newFileInfoList = new FileInfoFactory().makeFileInfos(relation, newFileList);
}
if (modifyFileList != null) {
newFileInfoList.addAll(new FileInfoFactory().makeFileInfos(relation, modifyFileList));
if (deleteFileKeyList == null) {
deleteFileKeyList = modifyFileKeyList;
} else {
String[] arr1 = deleteFileKeyList;
String[] arr2 = modifyFileKeyList;
String[] sumArr = Stream.of(arr1, arr2).flatMap(Stream::of).toArray(String[]::new);
deleteFileKeyList = (sumArr);
}
}
}
Map<String, Object> nonQueryRequest = new HashMap<String, Object>();
nonQueryRequest.put("deleteFileKeyList", deleteFileKeyList);
retMessage = sprt02Service.updateCrdnImageFile(nonQueryRequest, crdn, newFileInfoList);
if (retMessage.contains("[S]")) {
saved = true;
} else {
saved = false;
}
return new ModelAndView("jsonView")
.addObject("saved", saved)
.addObject("retMessage", retMessage);
}
/** ID . /** ID .
* @param crdnId ID * @param crdnId ID
* @return fims/sprt/sprt02030-main jsonView * @return fims/sprt/sprt02030-main jsonView
@ -139,6 +205,7 @@ public class Sprt02Controller extends ApplicationController {
exclQuery.setCrdnId(req.getCrdnId()); exclQuery.setCrdnId(req.getCrdnId());
exclQuery.setDelYn(req.getDelYn()); exclQuery.setDelYn(req.getDelYn());
// 의견 제출(TB_OPNN_SBMSN) 대장 조회
DataObject opnnSbmsn = excl02Service.getOpnnSbmsnInfo(exclQuery); DataObject opnnSbmsn = excl02Service.getOpnnSbmsnInfo(exclQuery);
// 단속(TB_CRDN) 대장 조회 // 단속(TB_CRDN) 대장 조회

@ -170,4 +170,13 @@
</if> </if>
</select> </select>
<update id="updateCrdnAtchFileCnt" parameterType="map">/* 단속 첨부 파일갯수 수정 (sprt02Mapper.updateCrdnAtchFileCnt) */
UPDATE TB_CRDN
SET ATCH_FILE_CNT = #{crdn.atchFileCnt} /* 첨부 파일 수 */
, MDFCN_DT = #{crdn.lastModified} /* 수정 일시 */
, MDFR = #{crdn.modifiedBy} /* 수정자 */
WHERE CRDN_ID = #{crdn.crdnId} /* 단속 ID */
AND DEL_YN = 'N' /* 삭제 여부 */
</update>
</mapper> </mapper>

@ -5,7 +5,7 @@
<div class="content-wrapper"> <div class="content-wrapper">
<!-- Content --> <!-- Content -->
<div class="container-xxl flex-grow-1 px-0"> <div class="container-xxl flex-grow-1 px-0">
<c:set var="prefixName" scope="request">부과제외</c:set> <c:set var="prefixName" scope="request">부과제외 관리</c:set>
<!-- Page Body --> <!-- Page Body -->
<div class="card"> <div class="card">

@ -5,7 +5,7 @@
<div class="content-wrapper"> <div class="content-wrapper">
<!-- Content --> <!-- Content -->
<div class="container-xxl flex-grow-1 px-0"> <div class="container-xxl flex-grow-1 px-0">
<c:set var="prefixName" scope="request">의견제출</c:set> <c:set var="prefixName" scope="request">의견제출 관리</c:set>
<!-- Page Body --> <!-- Page Body -->
<div class="card"> <div class="card">
@ -350,9 +350,14 @@
return; return;
} }
let params = {
callControlName : "${pageName}Control"
, crdnId : crdnId
}
ajax.get({ ajax.get({
url : ${pageName}Control.urls.getInfo url : ${pageName}Control.urls.getInfo
, data : { crdnId : crdnId } , data : params
, success : resp => { , success : resp => {
dialog.open({ dialog.open({
id : "totalInfoMainDialog" id : "totalInfoMainDialog"

@ -1,6 +1,12 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%> <%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<!-- inner page html -->
<div class="content-wrapper">
<!-- Content -->
<div class="container-xxl flex-grow-1 px-0">
<c:set var="prefixName" scope="request">단속 재등록 관리</c:set>
<!-- Page Body --> <!-- Page Body -->
<div class="card"> <div class="card">
<!-- 입력 영역 --> <!-- 입력 영역 -->
@ -107,6 +113,8 @@
<!-- /입력 영역 --> <!-- /입력 영역 -->
</div> </div>
<!-- <div class="card"> --> <!-- <div class="card"> -->
</div>
<!-- / Content -->
<!-- 업무 버튼 표시 --> <!-- 업무 버튼 표시 -->
<div> <div>
@ -119,6 +127,11 @@
</div> </div>
<!-- / 업무 버튼 표시 --> <!-- / 업무 버튼 표시 -->
<jsp:include page="/WEB-INF/jsp/include/bottom.jsp" />
<div class="content-backdrop fade"></div>
</div>
<script> <script>
/************************************************************************** /**************************************************************************
* Global Variable * Global Variable

@ -292,12 +292,17 @@
return; return;
} }
let params = {
callControlName : "${pageName}Control"
, crdnId : crdnId
}
ajax.get({ ajax.get({
url : ${pageName}Control.urls.getInfo url : ${pageName}Control.urls.getInfo
, data : { crdnId : crdnId } , data : params || {}
, success : resp => { , success : resp => {
dialog.open({ dialog.open({
id : ${pageName}Control.prefixed("dialog") id : "totalInfoMainDialog"
, title : "개별총정보" , title : "개별총정보"
, content : resp , content : resp
, size : "xxl" , size : "xxl"

@ -150,7 +150,7 @@
} }
/************************************************************************** /**************************************************************************
* function * 탭 clickEvent
**************************************************************************/ **************************************************************************/
// 건수 표기 // 건수 표기
fnChangeCountStauts = () => { fnChangeCountStauts = () => {
@ -458,7 +458,7 @@
// Dataset 셋팅 // Dataset 셋팅
${pageName}Control.setData([${totalInfo}]); ${pageName}Control.setData([${totalInfo}]);
// // 단속, 납부자 정보
fnCrdnPayerInfo${pageName}(); fnCrdnPayerInfo${pageName}();
}); });

@ -7,6 +7,8 @@
<div class="col-xl-9 mx-1"> <div class="col-xl-9 mx-1">
<!-- 입력 영역 --> <!-- 입력 영역 -->
<form id="frmEdit--${pageName}" name="frmEdit"> <form id="frmEdit--${pageName}" name="frmEdit">
<input type="hidden" id="crdnId--${pageName}" name="crdnId" data-map="CRDN_ID" />
<input type="hidden" id="atchFileCnt--${pageName}" name="atchFileCnt" data-map="ATCH_FILE_CNT" />
<input type="hidden" id="rtpyrId--${pageName}" name="rtpyrId" data-map="RTPYR_ID" /> <input type="hidden" id="rtpyrId--${pageName}" name="rtpyrId" data-map="RTPYR_ID" />
<!-- 단속 정보 --> <!-- 단속 정보 -->
@ -276,31 +278,32 @@
</div> <!-- <div class="col-xl-9 mx-1"> --> </div> <!-- <div class="col-xl-9 mx-1"> -->
<!-- 단속 이미지 --> <!-- 단속 이미지 -->
<div class="col-xl-3 mx-1"> <div class="card" style="width:500px;">
<div class="card">
<form id="frmFile--${pageName}" method="post" enctype="multipart/form-data"> <form id="frmFile--${pageName}" method="post" enctype="multipart/form-data">
<input type="file" id="newFileList--${pageName}" name="newFileList" multiple accept="image/*" hidden /> <input type="file" id="newFileList--${pageName}" name="newFileList" multiple accept="image/*" hidden />
<input type="file" id="modifyFileList--${pageName}" name="modifyFileList" multiple accept="image/*" hidden />
</form> </form>
<div class="col-md-12 d-flex justify-content-between">
<div>
<button type="button" class="btn btn-primary" id="btnEditPhoto--${pageName}" title="선택 사진 편집">편집</button>
</div>
<div>
<button type="button" class="btn btn-primary" id="btnSaveFile--${pageName}" title="저장" onclick="fnSaveFile${pageName}();">저장</button>
<button type="button" class="btn btn-primary" id="btnAddFile--${pageName}" title="사진 추가">추가</button>
<button type="button" class="btn btn-primary" id="btnDeleteFile--${pageName}" title="선택 사진 삭제">삭제</button>
</div>
</div>
<div id="displayForExist--${pageName}" style="overflow-y:scroll; min-height:80px; max-height:600px; border-style:solid;">
</div>
<form id="frmUploadSet--${pageName}" method="post" enctype="multipart/form-data"> <form id="frmUploadSet--${pageName}" method="post" enctype="multipart/form-data">
<input type="file" id="inputUploadSet--${pageName}" name="inputUploadSet" multiple accept="image/*" hidden /> <input type="file" id="inputUploadSet--${pageName}" name="inputUploadSet" multiple accept="image/*" hidden />
</form> </form>
<div class="col-md-12"> <div id="displayForNew--${pageName}" style="overflow-y:scroll; min-height:40px; max-height:80px; border-style:solid;">
<!-- 단속사진 버튼 -->
<div class="container-page-btn">
<!-- 버튼 우측 정렬 -->
<span class="container-window-btn-right">
<button type="button" id="btnAddFile--${pageName}" class="btn btn-primary">이미지 추가</button>
<button type="button" id="btnOpenVideoCapture--${pageName}" class="btn btn-primary">동영상 캡쳐</button>
<button type="button" id="btnCancelAddFile--${pageName}" class="btn btn-primary">선택 사진 삭제</button>
</span>
</div> </div>
</div> </div>
<div id="display--${pageName}" style="overflow-y: scroll;height: 600px;border-style: solid;">
</div>
</div> <!-- <div class="card"> -->
</div> <!-- 단속 이미지 <div class="col-xl-3 mx-1"> -->
</div> <!-- <div class="d-flex flex-row justify-content-evenly"> --> </div> <!-- <div class="d-flex flex-row justify-content-evenly"> -->
</div> <!-- <div class="content-wrapper"> --> </div> <!-- <div class="content-wrapper"> -->
@ -312,6 +315,16 @@
var ${pageName}PrefixUrl = "/sprt/sprt02"; var ${pageName}PrefixUrl = "/sprt/sprt02";
// FormFields // FormFields
var ${pageName}Fields = new FormFields("#frmEdit--${pageName}"); var ${pageName}Fields = new FormFields("#frmEdit--${pageName}");
// 단속 사진
var uploadSet = uploadSupport("#inputUploadSet--${pageName}");
var existFileArr = [];
var captureFileArr = [];
var localUploadArr = [];
var numberPlateArr = [];
// 파일 리스트
var fileListArr = [];
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl
@ -340,11 +353,139 @@
${pageName}Fields.set(item); // Dataset 셋팅 ${pageName}Fields.set(item); // Dataset 셋팅
} }
// 저장
${pageName}Control.onSave = (resp) => {
dialog.alert(resp.retMessage);
if (resp.saved) {
// fnDataRefreshInfo(); // 자료 재조회
}
};
${pageName}Control.save = (info) => {
if (!info) return;
let formData = new FormData(document.getElementById("frmFile--${pageName}"));
for (let key in info) {
let value = info[key];
formData.append(key, value);
}
formData.delete("newFileList");
formData.delete("modifyFileList");
// 추가 파일 등록
if (localUploadArr.length > 0) {
localUploadArr.forEach(item => formData.append("newFileList", item));
}
ajax.post({
url : wctx.url("/sprt/sprt02/020/update.do")
, data : formData
, contentType : false
, processData : false
, success : resp => {
${pageName}Control.onSave(resp);
}
});
}
uploadSet.onDatasetChange = () => {
let files = uploadSet.getDataset();
files.forEach(item => localUploadArr.push(item));
fnImageDisplay(false);
};
uploadSet.onRemove = () => {
};
/************************************************************************** /**************************************************************************
* * function 이미지 관련
**************************************************************************/
fnMakeImgForExistFile = (fileArr) => {
var tagsText = "";
for (var index = 0, j = 0; index < fileArr.length; index++) {
var item = fileArr[index];
if (item.status == "delete") {
continue;
}
tagsText += "<label class='mx-2'>";
tagsText += "<input type='radio' name='existPhoto' class='form-check-input' value='" + item.FILE_ID + "' ";
if (index == 0) {
tagsText += " checked='checked' ";
}
tagsText += " />";
tagsText += "<img src='"+ item.URL +"' width='280' height='150' />";
tagsText += "</label>";
if (j % 2 == 1) {
tagsText += "<br />";
}
j++;
}
return tagsText;
}
fnMakeImgForNewFile = (fileArr) => {
var tagsText = "";
for (var index = 0; index < fileArr.length; index++) {
var item = fileArr[index];
tagsText += "<label class='mx-2'>";
tagsText += "<input type='checkbox' name='newPhoto' class='form-check-input' value='"+item.id +"' ";
tagsText += " />";
tagsText += "<img src='"+ item.url +"' width='280' height='150' />";
tagsText += "</label>";
if (index % 2 == 1) {
tagsText += "<br />";
}
}
return tagsText;
}
fnImageDisplay = (isExist) => {
if (isExist) {
var displayArea = document.querySelector("#displayForExist--${pageName}");
var tagsText = fnMakeImgForExistFile(existFileArr);
if (tagsText == "") {
displayArea.innerHTML = "등록된 사진이 없습니다.";
$("#btnEditPhoto--${pageName}").hide();
} else {
displayArea.innerHTML = tagsText;
$("#btnEditPhoto--${pageName}").show();
}
} else {
var displayArea = document.querySelector("#displayForNew--${pageName}");
var concatArr = localUploadArr.concat(numberPlateArr).concat(captureFileArr);
var tagsText = fnMakeImgForNewFile(concatArr);
displayArea.innerHTML = tagsText;
}
};
/**************************************************************************
* function
**************************************************************************/ **************************************************************************/
// 민원 원본 보기 // 민원 원본 보기
openCvlcptOrgnl${pageName} = (params) => { openCvlcptOrgnl${pageName} = (params) => {
if (!params) return;
let dialogId = "cvlcptOrgnlDialog--${pageName}"; let dialogId = "cvlcptOrgnlDialog--${pageName}";
ajax.get({ ajax.get({
@ -377,6 +518,40 @@
}); });
} }
// 자료 재조회
fnDataRefreshInfo = () => {
let crdnId = $("#crdnId--${pageNameMain}").val();
// 단속 ID 가 없다면.. return
if (crdnId == null || crdnId == "") {
return;
}
let params = {
callPurpose : "view"
, crdnId : crdnId
, delYn : "N"
};
ajax.get({
url : wctx.url("/sprt/sprt02/020/info.do")
, headers: { Accept: "application/json; charset=utf-8" } // json
, data : params || {}
, success : resp => {
if (resp.crdnPayer) {
${pageName}Control.setData([resp.crdnPayer]);
} else {
$("#frmEdit--${pageName}")[0].reset();
}
// 최상단 단속 Data 셋팅
if (resp.crdnPayer) {
${pageNameMain}Control.setData([resp.crdnPayer]);
}
}
});
}
/************************************************************************** /**************************************************************************
* 초기 셋팅 * 초기 셋팅
**************************************************************************/ **************************************************************************/
@ -424,17 +599,77 @@
// 이벤트 설정 // 이벤트 설정
setEvent${pageName} = () => { setEvent${pageName} = () => {
// // 선택 사진 편집
$("#btnEditPhoto--${pageName}").on('click', () => {
let checked = $("#displayForExist--${pageName}").find("[name='existPhoto']:checked");
if (checked.length < 1) {
dialog.alert("선택된 사진이 없습니다.");
return;
}
let fileId = checked.val();
window.open(wctx.url("/sprt/sprt03/020/main.do?openerPageName=${pageName}&fileId=" + fileId)
,"editPhoto"
,"width=1400,height=750"
);
});
// 선택 사진 삭제
$("#btnDeleteExistPhoto--${pageName}").on('click', () => {
let checked = $("#displayForExist--${pageName}").find("[name='existPhoto']:checked");
if (checked.length < 1) {
dialog.alert("선택된 사진이 없습니다.");
return;
}
let target = checked[0].value;
existFileArr.forEach(function(item) {
if (item.FILE_ID == target) {
item.status = "delete";
}
});
fnImageDisplay(true);
});
// 사진 추가
$("#btnAddFile--${pageName}").on("click", () => {
$("#inputUploadSet--${pageName}").trigger("click");
});
// 사진 삭제
$("#btnCancelAddFile--${pageName}").on('click', () => {
let checked = $("#displayForNew--${pageName}").find("[name='newPhoto']:checked");
if (checked.length < 1) {
dialog.alert("선택된 사진이 없습니다.");
return;
}
let checkedArr = [];
for (let iLoop = 0; iLoop < checked.length; iLoop++) {
checkedArr.push(checked[iLoop].value);
}
captureFileArr = captureFileArr.filter(item => checkedArr.indexOf(item.id) == -1);
localUploadArr = localUploadArr.filter(item => checkedArr.indexOf(item.id) == -1);
numberPlateArr = numberPlateArr.filter(item => checkedArr.indexOf(item.id) == -1);
fnImageDisplay(false);
});
} }
/************************************************************************** /**************************************************************************
* function * 버튼 clickEvent
**************************************************************************/ **************************************************************************/
// 민원 원본 보기 // 민원 원본 보기
fnOpenCvlcptOrgnl${pageName} = () => { fnOpenCvlcptOrgnl${pageName} = () => {
let crdnId = ${pageName}Control.dataset.getValue("CRDN_ID"); let crdnId = ${pageName}Control.dataset.getValue("CRDN_ID");
let sggCd = $("#sggCd--${pageNameMain}").val(); let sggCd = ${pageName}Control.dataset.getValue("SGG_CD");
let taskSeCd = $("#taskSeCd--${pageNameMain}").val(); let taskSeCd = ${pageName}Control.dataset.getValue("TASK_SE_CD");
// 단속 ID 가 없다면.. return // 단속 ID 가 없다면.. return
if (crdnId == null || crdnId == "") { if (crdnId == null || crdnId == "") {
@ -503,6 +738,16 @@
console.log("단속 상태 변경"); console.log("단속 상태 변경");
} }
// 사진 변경 저장
fnSaveFile${pageName} = () => {
dialog.alert({
content : "현재 사진 정보를 저장하시겠습니까?"
, onOK : () => {
${pageName}Control.save(${pageName}Fields.get());
}
});
}
/************************************************************************** /**************************************************************************
* script 진입 * script 진입
**************************************************************************/ **************************************************************************/
@ -513,8 +758,20 @@
// 화면 초기 설정 // 화면 초기 설정
initForm${pageName}(); initForm${pageName}();
let crdnPayerInfo = ${crdnPayer};
// Dataset 셋팅 // Dataset 셋팅
${pageName}Control.setData([${crdnPayer}]); ${pageName}Control.setData([crdnPayerInfo]);
// 이미지 셋팅
if (crdnPayerInfo.fileList) {
crdnPayerInfo.fileList.forEach(function(item) {
item.status = "";
existFileArr.push(item);
});
}
fnImageDisplay(true);
}); });
// #sourceURL=sprt02020-info.jsp // #sourceURL=sprt02020-info.jsp

@ -265,10 +265,10 @@
} }
/************************************************************************** /**************************************************************************
* * function
**************************************************************************/ **************************************************************************/
// 심의 dialog // 심의 dialog
${pageName}Control.getInfoOpnnSbmsnDlbrt = (params) => { getInfoOpnnSbmsnDlbrt = (params) => {
ajax.get({ ajax.get({
url : wctx.url("/excl/excl02/030/info.do") url : wctx.url("/excl/excl02/030/info.do")
, data : params || {} , data : params || {}
@ -333,7 +333,7 @@
} }
/************************************************************************** /**************************************************************************
* function * 버튼 clickEvent
**************************************************************************/ **************************************************************************/
// 의견제출 등록 // 의견제출 등록
fnCreateOpnnSbmsn${pageName} = () => { fnCreateOpnnSbmsn${pageName} = () => {
@ -430,7 +430,7 @@
, crdnId : crdnId , crdnId : crdnId
}; };
${pageName}Control.getInfoOpnnSbmsnDlbrt(params); getInfoOpnnSbmsnDlbrt(params);
} }
// 심의의결서 출력 // 심의의결서 출력

Loading…
Cancel
Save