From 6c85dbc6ed7eebf73b2e647e336683b661e07237 Mon Sep 17 00:00:00 2001 From: jjh Date: Wed, 13 Sep 2023 18:30:44 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B0=9C=EB=B3=84=EC=B4=9D=EC=A0=95=EB=B3=B4?= =?UTF-8?q?=20-=20=EB=8B=A8=EC=86=8D=20=EC=82=AC=EC=A7=84=20=EB=B3=B4?= =?UTF-8?q?=EA=B8=B0,=20=EC=B6=94=EA=B0=80=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xit/fims/excl/web/Excl02Controller.java | 4 +- .../xit/fims/sprt/dao/TotalInfoMapper.java | 23 ++ .../xit/fims/sprt/service/Sprt02Service.java | 11 + .../fims/sprt/service/bean/Sprt02Bean.java | 18 + .../sprt/service/bean/Sprt02ServiceBean.java | 89 ++++- .../xit/fims/sprt/web/Sprt02Controller.java | 67 ++++ .../sql/mapper/fims/sprt/totalInfo-mapper.xml | 9 + .../WEB-INF/jsp/fims/excl/excl01010-main.jsp | 2 +- .../WEB-INF/jsp/fims/excl/excl02010-main.jsp | 9 +- .../WEB-INF/jsp/fims/excl/excl02020-info.jsp | 2 +- .../WEB-INF/jsp/fims/excl/excl02030-info.jsp | 241 ++++++------- .../WEB-INF/jsp/fims/excl/excl03010-main.jsp | 9 +- .../WEB-INF/jsp/fims/sprt/sprt02010-main.jsp | 4 +- .../WEB-INF/jsp/fims/sprt/sprt02020-info.jsp | 317 ++++++++++++++++-- .../WEB-INF/jsp/fims/sprt/sprt02030-info.jsp | 8 +- 15 files changed, 654 insertions(+), 159 deletions(-) diff --git a/src/main/java/cokr/xit/fims/excl/web/Excl02Controller.java b/src/main/java/cokr/xit/fims/excl/web/Excl02Controller.java index 94591d7a..7531b39d 100644 --- a/src/main/java/cokr/xit/fims/excl/web/Excl02Controller.java +++ b/src/main/java/cokr/xit/fims/excl/web/Excl02Controller.java @@ -118,7 +118,7 @@ public class Excl02Controller extends ApplicationController { } /**의견제출 대장를 등록한다. - * @param opnnSbmsn 의견제출 대장 정보 + * @param opnnSbmsn 의견제출 정보, 이미지 파일 uploadFiles * @return jsonView *
 {
 	 *     "saved": 등록되었으면 true, 그렇지 않으면 false
@@ -148,7 +148,7 @@ public class Excl02Controller extends ApplicationController {
 	}
 
 	/**의견제출 대장 정보를 수정한다.
-	 * @param opnnSbmsn 의견제출 대장 정보
+	 * @param opnnSbmsn 의견제출 정보, 이미지 파일 uploadFiles
 	 * @return jsonView
 	 * 
 {
 	 *     "saved": 수정되었으면 true, 그렇지 않으면 false
diff --git a/src/main/java/cokr/xit/fims/sprt/dao/TotalInfoMapper.java b/src/main/java/cokr/xit/fims/sprt/dao/TotalInfoMapper.java
index 6ec9deb5..5a423234 100644
--- a/src/main/java/cokr/xit/fims/sprt/dao/TotalInfoMapper.java
+++ b/src/main/java/cokr/xit/fims/sprt/dao/TotalInfoMapper.java
@@ -1,7 +1,10 @@
 package cokr.xit.fims.sprt.dao;
 
+import java.util.Map;
+
 import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
 
+import cokr.xit.fims.crdn.Crdn;
 import cokr.xit.fims.sprt.SprtQuery;
 import cokr.xit.foundation.component.AbstractMapper;
 import cokr.xit.foundation.data.DataObject;
@@ -31,4 +34,24 @@ public interface TotalInfoMapper extends AbstractMapper {
 	 */
 	DataObject selectCrdnPayerInfo(SprtQuery req);
 
+	/**단속 대장 첨부 파일수 정보를 수정한다.
+	 * @param params 파라미터
+	 * 
  • "crdn" - 단속 대장
  • + *
  • "currentUser" - 현재 접속한 사용자
  • + *
+ * @return 저장된 정보수 + */ + int updateCrdnAtchFileCnt(Map params); + + /**단속 대장 첨부 파일수 정보를 수정한다. + * @param crdn 단속 대장 + * @return 저장 여부 + *
  • 저장됐으면 true
  • + *
  • 그렇지 않으면 false
  • + *
+ */ + default boolean updateCrdnAtchFileCnt(Crdn crdn) { + return crdn != null && updateCrdnAtchFileCnt(params().set("crdn", crdn)) == 1; + } + } diff --git a/src/main/java/cokr/xit/fims/sprt/service/Sprt02Service.java b/src/main/java/cokr/xit/fims/sprt/service/Sprt02Service.java index ea56186f..7924b955 100644 --- a/src/main/java/cokr/xit/fims/sprt/service/Sprt02Service.java +++ b/src/main/java/cokr/xit/fims/sprt/service/Sprt02Service.java @@ -1,5 +1,10 @@ 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.foundation.data.DataObject; @@ -27,4 +32,10 @@ public interface Sprt02Service { */ DataObject getCrdnPayerInfo(SprtQuery req); + /** 단속 사진에 대한 정보를 수정한다. + * @param nonQueryRequest 처리 요청, crdn 단속정보, newFileInfoList 업로드 파일 목록 + * @return 저장여부 + */ + String updateCrdnImageFile(Map nonQueryRequest, Crdn crdn, List newFileInfoList); + } diff --git a/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt02Bean.java b/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt02Bean.java index 00af0257..44ee6afd 100644 --- a/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt02Bean.java +++ b/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt02Bean.java @@ -4,6 +4,7 @@ import javax.annotation.Resource; import org.springframework.stereotype.Component; +import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.sprt.SprtQuery; import cokr.xit.fims.sprt.dao.TotalInfoMapper; import cokr.xit.foundation.AbstractComponent; @@ -42,4 +43,21 @@ public class Sprt02Bean extends AbstractComponent { 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; + } + } diff --git a/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt02ServiceBean.java b/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt02ServiceBean.java index 5643ccc9..49c92af7 100644 --- a/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt02ServiceBean.java +++ b/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt02ServiceBean.java @@ -1,9 +1,18 @@ package cokr.xit.fims.sprt.service.bean; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + import javax.annotation.Resource; 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.service.Sprt02Service; import cokr.xit.foundation.component.AbstractServiceBean; @@ -26,6 +35,10 @@ public class Sprt02ServiceBean extends AbstractServiceBean implements Sprt02Serv @Resource(name="sprt02Bean") protected Sprt02Bean sprt02Bean; + /** 파일 Bean */ + @Resource(name="fileBean") + private FileBean fileBean; + @Override public DataObject getCrdnInfo(SprtQuery req) { return sprt02Bean.getCrdnInfo(req); @@ -33,7 +46,81 @@ public class Sprt02ServiceBean extends AbstractServiceBean implements Sprt02Serv @Override 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 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 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 nonQueryRequest, Crdn crdn, List newFileInfoList) { + // 변수 선언 + String retMessage = ""; // 처리 결과 메시지 + + // 첨부파일 등록 + if (newFileInfoList != null && !newFileInfoList.isEmpty()) { + // 파일 등록 + int fileInsertEffected = fileBean.create(newFileInfoList); + + // 단속 ID로 파일(TB_FILE) 정보 조회 + List 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; } } diff --git a/src/main/java/cokr/xit/fims/sprt/web/Sprt02Controller.java b/src/main/java/cokr/xit/fims/sprt/web/Sprt02Controller.java index 0d04e4dc..1df9390d 100644 --- a/src/main/java/cokr/xit/fims/sprt/web/Sprt02Controller.java +++ b/src/main/java/cokr/xit/fims/sprt/web/Sprt02Controller.java @@ -1,17 +1,28 @@ package cokr.xit.fims.sprt.web; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.stream.Stream; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.multipart.MultipartFile; 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.fims.cmmn.CrdnPayerHstryQuery; import cokr.xit.fims.cmmn.CrdnSttsHstryQuery; import cokr.xit.fims.cmmn.service.CrdnPayerHstryService; 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.service.Excl01Service; import cokr.xit.fims.excl.service.Excl02Service; @@ -119,6 +130,61 @@ public class Sprt02Controller extends ApplicationController { ; } + /**단속 정보, 이미지 파일 정보를 수정한다. + * @param crdn 단속 정보, 추가한 이미지 파일 newFileList, modifyFileList 편집한 이미지 파일 + * @return jsonView + *
 {
+	 *     "affected": 저장된 정보수
+	 *     "saved": 저장되었으면 true, 그렇지 않으면 false
+	 * }
+ */ + @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 newFileInfoList = new ArrayList(); + 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 nonQueryRequest = new HashMap(); + + 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의 의견제출 정보를 반환한다. * @param crdnId 단속ID * @return fims/sprt/sprt02030-main 또는 jsonView @@ -139,6 +205,7 @@ public class Sprt02Controller extends ApplicationController { exclQuery.setCrdnId(req.getCrdnId()); exclQuery.setDelYn(req.getDelYn()); + // 의견 제출(TB_OPNN_SBMSN) 대장 조회 DataObject opnnSbmsn = excl02Service.getOpnnSbmsnInfo(exclQuery); // 단속(TB_CRDN) 대장 조회 diff --git a/src/main/resources/sql/mapper/fims/sprt/totalInfo-mapper.xml b/src/main/resources/sql/mapper/fims/sprt/totalInfo-mapper.xml index 50470162..9b32c37a 100644 --- a/src/main/resources/sql/mapper/fims/sprt/totalInfo-mapper.xml +++ b/src/main/resources/sql/mapper/fims/sprt/totalInfo-mapper.xml @@ -170,4 +170,13 @@ + /* 단속 첨부 파일갯수 수정 (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' /* 삭제 여부 */ + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/fims/excl/excl01010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/excl/excl01010-main.jsp index 73794109..d877ac07 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/excl/excl01010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/excl/excl01010-main.jsp @@ -5,7 +5,7 @@
- 부과제외 + 부과제외 관리
diff --git a/src/main/webapp/WEB-INF/jsp/fims/excl/excl02010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/excl/excl02010-main.jsp index 8961ef12..e2e654ee 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/excl/excl02010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/excl/excl02010-main.jsp @@ -5,7 +5,7 @@
- 의견제출 + 의견제출 관리
@@ -350,9 +350,14 @@ return; } + let params = { + callControlName : "${pageName}Control" + , crdnId : crdnId + } + ajax.get({ url : ${pageName}Control.urls.getInfo - , data : { crdnId : crdnId } + , data : params , success : resp => { dialog.open({ id : "totalInfoMainDialog" diff --git a/src/main/webapp/WEB-INF/jsp/fims/excl/excl02020-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/excl/excl02020-info.jsp index 97e196e8..835e3689 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/excl/excl02020-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/excl/excl02020-info.jsp @@ -233,7 +233,7 @@ formData.append("uploadFiles" , $fileListArr[iLoop]); } - for(let key in info) { + for (let key in info) { let value = info[key]; formData.append(key, value); diff --git a/src/main/webapp/WEB-INF/jsp/fims/excl/excl02030-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/excl/excl02030-info.jsp index 754323ab..63d165be 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/excl/excl02030-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/excl/excl02030-info.jsp @@ -1,123 +1,136 @@ <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%> <%@ include file="/WEB-INF/jsp/include/taglib.jsp"%> - -
- -
- - - - - - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - - -
- -
- - -
- -
- - -
+ +
+ +
+ 단속 재등록 관리 + + +
+ + + + + + + + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + + +
+ +
+ + +
+ +
+ + +
+
+ +
- - -
- - - -
- - - - + +
+ + + +
+ + + + + - +
+ + + + +
-