From a554f0bf746d9712b50d3cb4071dfca93a507986 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Fri, 19 Jan 2024 09:00:24 +0900 Subject: [PATCH] =?UTF-8?q?=EB=8B=A8=EC=86=8D=EC=82=AC=EC=A7=84=20?= =?UTF-8?q?=EC=88=9C=EC=84=9C=20=EB=B3=80=EA=B2=BD=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cokr/xit/fims/base/FileController.java | 195 ++++++- .../xit/fims/crdn/service/CrdnService.java | 2 + .../xit/fims/crdn/service/bean/CrdnBean.java | 3 + .../crdn/service/bean/CrdnServiceBean.java | 65 +++ .../fims/cvlc/service/CrdnCvlcptService.java | 5 +- .../service/bean/CrdnCvlcptServiceBean.java | 15 +- .../cvlc/service/bean/CrdnCvlcptSubBean.java | 33 +- .../xit/fims/cvlc/web/Cvlc01Controller.java | 56 +- .../cokr/xit/fims/sprt/dao/MediaMapper.java | 4 + .../xit/fims/sprt/service/bean/MediaBean.java | 36 ++ .../cokr/xit/fims/task/web/BpvController.java | 6 +- .../cokr/xit/fims/task/web/DpvController.java | 6 +- .../cokr/xit/fims/task/web/EcaController.java | 6 +- .../cokr/xit/fims/task/web/PvsController.java | 6 +- .../mapper/fims/cvlc/crdnCvlcpt-mapper.xml | 1 - .../sql/mapper/fims/sprt/media-mapper.xml | 7 + .../WEB-INF/jsp/fims/cvlc/cvlc01020-info.jsp | 514 ++++-------------- .../webapp/WEB-INF/jsp/fims/photo-main.jsp | 58 ++ src/main/webapp/WEB-INF/jsp/index.jsp | 24 + .../webapp/resources/js/fims/photo-main.js | 288 ++++++++++ 20 files changed, 821 insertions(+), 509 deletions(-) create mode 100644 src/main/webapp/WEB-INF/jsp/fims/photo-main.jsp create mode 100644 src/main/webapp/resources/js/fims/photo-main.js diff --git a/src/main/java/cokr/xit/fims/base/FileController.java b/src/main/java/cokr/xit/fims/base/FileController.java index d567f974..e96e6e45 100644 --- a/src/main/java/cokr/xit/fims/base/FileController.java +++ b/src/main/java/cokr/xit/fims/base/FileController.java @@ -8,8 +8,11 @@ import java.io.StringWriter; import java.net.URISyntaxException; import java.net.URLDecoder; import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; import java.util.Date; import java.util.List; +import java.util.Map; import java.util.regex.Matcher; import javax.annotation.Resource; @@ -39,9 +42,16 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.SAXException; +import cokr.xit.base.file.FileInfo; +import cokr.xit.base.file.FileInfo.Relation; import cokr.xit.base.file.dao.FileMapper; import cokr.xit.base.file.service.FileQuery; import cokr.xit.base.file.service.bean.FileBean; +import cokr.xit.base.file.web.FileInfoFactory; +import cokr.xit.fims.crdn.Crdn; +import cokr.xit.fims.crdn.dao.CrdnInfoMapper; +import cokr.xit.fims.crdn.service.CrdnService; +import cokr.xit.fims.sprt.Sprt; import cokr.xit.fims.sprt.service.bean.MediaBean; import cokr.xit.foundation.data.DataObject; @@ -50,15 +60,26 @@ public class FileController extends cokr.xit.base.file.web.FileController { @Resource(name = "fileMapper") private FileMapper fileMapper; + @Resource(name = "crdnInfoMapper") + private CrdnInfoMapper crdnInfoMapper; + @Resource(name="fileBean") private FileBean fileBean; @Resource(name="mediaBean") private MediaBean mediaBean; + @Resource(name="crdnService") + private CrdnService crdnService; + @Override public ModelAndView getFileList(FileQuery req) { ModelAndView mav = new ModelAndView("jsonView"); + + String infoType = ifEmpty(req.getInfoType(), () -> ""); + boolean singleKey = (req.getInfoKeys() != null && req.getInfoKeys().length == 1); + + //파일 목록 List fileInfoList = fileService().getFileList(req); for(DataObject fileInfo : fileInfoList) { List mosaicInfos = mediaBean.getMosaicList(fileInfo.string("FILE_ID")); @@ -80,10 +101,181 @@ public class FileController extends cokr.xit.base.file.web.FileController { } } - mav = setCollectionInfo(mav,fileInfoList,"file"); + mav = setCollectionInfo(mav, fileInfoList, "file"); + + //민원 동영상파일 첨부 여부 + String cvlcptVideoExistYn = "N"; + if(infoType.equals(Crdn.INF_TYPE) && singleKey) { + + DataObject dataObject = crdnInfoMapper.selectCrdnInfo(req.getInfoKeys()[0]); + + String linkTblNm = dataObject.string("LINK_TBL_NM"); + if(!linkTblNm.equals("")) { //민원연계자료 + FileQuery cvlcptFileQuery = new FileQuery(); + if(linkTblNm.equals("TB_ESB_INTERFACE")) { + cvlcptFileQuery.setInfoType("010"); + } else if(linkTblNm.equals("TB_SAEOL")) { + cvlcptFileQuery.setInfoType("020"); + } else { + throw new RuntimeException("파일 조회 중 오류가 발생하였습니다."); + } + + cvlcptFileQuery.setInfoKeys(dataObject.string("LINK_ID")); + List linkFileList = fileBean.getFileList(cvlcptFileQuery); + if(linkFileList != null && !linkFileList.isEmpty()) { + for(int i=0; i < linkFileList.size(); i++) { + String mimeType = linkFileList.get(i).string("MIME_TYPE"); + if(Arrays.asList(Sprt.VIDEO_MIME_TYPE).contains(mimeType)) { + cvlcptVideoExistYn = "Y"; + } + } + } + } + } + mav.addObject("cvlcptVideoExistYn", cvlcptVideoExistYn); + return mav; } + + @PostMapping(name= "단속 사진 추가", value = "/insertCrdnImageFile.do") + public ModelAndView insertCrdnImageFile(String crdnId, int atchFileCnt, MultipartFile[] newFileList) { + + boolean saved = false; + String retMessage = "[F] "; + if(newFileList == null || newFileList.length == 0 || newFileList[0] == null || newFileList[0].isEmpty()) { + throw new RuntimeException("파일 업로드 오류"); + } + + Relation relation = new Relation().setInfoType(Crdn.INF_TYPE).setInfoKey(crdnId); + List newFileInfoList = new FileInfoFactory().makeFileInfos(relation, newFileList); + + List> processList = new ArrayList<>(); + + int newFileSort = 999; + for(FileInfo newFileInfo : newFileInfoList) { + newFileInfo.setSortOrder(newFileSort++); + processList.add(Map.of("process", "insert", "obj", newFileInfo)); + } + + Crdn crdn = new Crdn(); + crdn.setCrdnId(crdnId); + crdn.setAtchFileCnt(atchFileCnt); + retMessage = crdnService.changeCrdnImageFile(crdn, processList); + + if (retMessage.contains("[S]")) { + saved = true; + } else { + saved = false; + } + + return new ModelAndView("jsonView") + .addObject("saved", saved) + .addObject("retMessage", retMessage); + + } + + @PostMapping(name= "단속 사진 수정", value = "/updateCrdnImageFile.do") + public ModelAndView updateCrdnImageFile(String crdnId, int atchFileCnt, + String beforeKey, int beforeOrder, MultipartFile modifyFile) { + + boolean saved = false; + String retMessage = "[F] "; + + if(modifyFile == null || modifyFile.isEmpty()) { + throw new RuntimeException("파일 업로드 오류"); + } + + Relation relation = new Relation().setInfoType(Crdn.INF_TYPE).setInfoKey(crdnId); + FileInfo modifyFileInfo = new FileInfoFactory().make(relation, modifyFile); + modifyFileInfo.setSortOrder(beforeOrder); + + List> processList = new ArrayList<>(); + processList.add(Map.of("process", "delete", "key", beforeKey)); + processList.add(Map.of("process", "insert", "obj", modifyFileInfo)); + + Crdn crdn = new Crdn(); + crdn.setCrdnId(crdnId); + crdn.setAtchFileCnt(atchFileCnt); + retMessage = crdnService.changeCrdnImageFile(crdn, processList); + + if (retMessage.contains("[S]")) { + saved = true; + } else { + saved = false; + } + + return new ModelAndView("jsonView") + .addObject("saved", saved) + .addObject("retMessage", retMessage); + + } + + @PostMapping(name= "단속 사진 삭제", value = "/deleteCrdnImageFile.do") + public ModelAndView deleteCrdnImageFile(String crdnId, int atchFileCnt, String[] deleteKeys) { + + boolean saved = false; + String retMessage = "[F] "; + + if(deleteKeys == null || deleteKeys.length == 0 || deleteKeys[0] == null || deleteKeys[0].isEmpty()) { + throw new RuntimeException("파일 삭제 오류"); + } + + List> processList = new ArrayList<>(); + for(String deleteKey : deleteKeys) { + processList.add(Map.of("process", "delete", "key", deleteKey)); + } + + Crdn crdn = new Crdn(); + crdn.setCrdnId(crdnId); + crdn.setAtchFileCnt(atchFileCnt); + retMessage = crdnService.changeCrdnImageFile(crdn, processList); + + if (retMessage.contains("[S]")) { + saved = true; + } else { + saved = false; + } + + return new ModelAndView("jsonView") + .addObject("saved", saved) + .addObject("retMessage", retMessage); + + } + + @PostMapping(name= "단속 사진 순서 변경", value = "/changeOrderCrdnImageFile.do") + public ModelAndView changeOrderCrdnImageFile(String crdnId, int atchFileCnt, String[] orderedKeys) { + + boolean saved = false; + String retMessage = "[F] "; + + if(orderedKeys == null || orderedKeys.length == 0 || orderedKeys[0] == null || orderedKeys[0].isEmpty()) { + throw new RuntimeException("파일 순서 변경 오류"); + } + + List> processList = new ArrayList<>(); + for(String orderedKey : orderedKeys) { + processList.add(Map.of("process", "order", "key", orderedKey)); + } + + Crdn crdn = new Crdn(); + crdn.setCrdnId(crdnId); + crdn.setAtchFileCnt(atchFileCnt); + retMessage = crdnService.changeCrdnImageFile(crdn, processList); + + if (retMessage.contains("[S]")) { + saved = true; + } else { + saved = false; + } + + return new ModelAndView("jsonView") + .addObject("saved", saved) + .addObject("retMessage", retMessage); + + } + + /** 메뉴얼을 다운로드한다. * @return 메뉴얼 파일 * @throws Exception @@ -199,6 +391,7 @@ public class FileController extends cokr.xit.base.file.web.FileController { } } + @PostMapping(name = "처리 전 파일업로드", value = "/uploadBeforeProcess.do") public ModelAndView uploadBeforeProcess(MultipartFile[] uploadFiles) { ModelAndView mav = new ModelAndView("jsonView"); diff --git a/src/main/java/cokr/xit/fims/crdn/service/CrdnService.java b/src/main/java/cokr/xit/fims/crdn/service/CrdnService.java index 20175b35..38ffba56 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/CrdnService.java +++ b/src/main/java/cokr/xit/fims/crdn/service/CrdnService.java @@ -79,4 +79,6 @@ public interface CrdnService { */ boolean removeEquipmentLinkFile(String workPath, String fileName); + String changeCrdnImageFile(Crdn crdn, List> processList); + } diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnBean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnBean.java index 93c9b6ac..0e4a9c17 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnBean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnBean.java @@ -33,6 +33,7 @@ import cokr.xit.fims.crdn.dao.CrdnTeamMapper; import cokr.xit.fims.crdn.dao.CrdnUpdtMapper; import cokr.xit.fims.excl.LevyExcl; import cokr.xit.fims.excl.service.bean.LevyExclBean; +import cokr.xit.fims.sprt.dao.TotalInfoMapper; import cokr.xit.foundation.AbstractComponent; import cokr.xit.foundation.UserInfo; import cokr.xit.foundation.data.DataObject; @@ -70,6 +71,8 @@ public class CrdnBean extends AbstractComponent { @Resource(name = "crdnTeamMapper") private CrdnTeamMapper crdnTeamMapper; + @Resource(name = "totalInfoMapper") + private TotalInfoMapper totalInfoMapper; public boolean create(Map nonQueryRequest, Crdn crdn, List fileInfoList) { if(fileInfoList != null && !fileInfoList.isEmpty()) { diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnServiceBean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnServiceBean.java index e1827e74..a656babe 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnServiceBean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnServiceBean.java @@ -10,6 +10,7 @@ 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.cmmn.service.bean.CrdnPayerHstryBean; import cokr.xit.fims.cmmn.service.bean.CrdnSttsHstryBean; @@ -25,6 +26,8 @@ import cokr.xit.fims.crdn.service.CrdnService; import cokr.xit.fims.cvlc.dao.CrdnCvlcptMapper; import cokr.xit.fims.cvlc.service.bean.CrdnCvlcptMainBean; import cokr.xit.fims.excl.service.bean.LevyExclBean; +import cokr.xit.fims.sprt.dao.TotalInfoMapper; +import cokr.xit.fims.sprt.service.bean.MediaBean; import cokr.xit.foundation.component.AbstractServiceBean; import cokr.xit.foundation.data.DataObject; @@ -49,9 +52,15 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService @Resource(name="globalStngMapper") protected GlobalStngMapper globalStngMapper; + @Resource(name="totalInfoMapper") + private TotalInfoMapper totalInfoMapper; + @Resource(name="fileBean") private FileBean fileBean; + @Resource(name="mediaBean") + private MediaBean mediaBean; + @Resource(name="importBean") private ImportBean importBean; @@ -245,4 +254,60 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService public boolean removeEquipmentLinkFile(String workPath, String fileName) { return crdnBean.removeEquipmentLinkFile(workPath, fileName); } + + @Override + public String changeCrdnImageFile(Crdn crdn, List> processList) { + + int createdCount = 0; + int deletedCount = 0; + boolean orderChange = false; + + // 변수 선언 + boolean rtnScs = false; // DB 처리 결과 + String rtnMsg = "[F] "; // 처리 결과 메시지 + + int order = 0; + for(Map process : processList) { + if(process.get("process").equals("insert")) { + createdCount += fileBean.create(List.of((FileInfo)process.get("obj"))); + } + if(process.get("process").equals("delete")) { + deletedCount += fileBean.deleteByIDs((String)process.get("key")); + } + if(process.get("process").equals("order")) { + mediaBean.reorder((String)process.get("key"), order++); + orderChange = true; + } + } + + + if(!orderChange) { + // 단속 ID로 파일(TB_FILE) 정보 조회 + List infoFileList = fileBean.getFileList(new FileQuery().setInfoType(Crdn.INF_TYPE) + .setInfoKeys(crdn.getCrdnId()) + .setOrderBy("SRT_ORD,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() + createdCount - deletedCount); + rtnScs = totalInfoMapper.updateCrdnAtchFileCnt(crdn); + if (!rtnScs) { + throw new RuntimeException("단속 첨부 파일 갯수 수정에 실패하였습니다."); + } + + rtnMsg = "[S] 작업이 정상 처리 되었습니다."; + + return rtnMsg; + + } } diff --git a/src/main/java/cokr/xit/fims/cvlc/service/CrdnCvlcptService.java b/src/main/java/cokr/xit/fims/cvlc/service/CrdnCvlcptService.java index 95019910..c0cabeb7 100644 --- a/src/main/java/cokr/xit/fims/cvlc/service/CrdnCvlcptService.java +++ b/src/main/java/cokr/xit/fims/cvlc/service/CrdnCvlcptService.java @@ -3,7 +3,6 @@ package cokr.xit.fims.cvlc.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.crdn.CrdnQuery; import cokr.xit.fims.cvlc.CrdnCvlcpt; @@ -51,10 +50,10 @@ public interface CrdnCvlcptService { boolean sendBackCivilComplaintInfo(String crdnId); /** 부과요청 민원에 대한 수용 처리구분을 변경한다. - * @param nonQueryRequest 처리 요청, crdnCvlcpt 단속민원정보, crdn 단속정보, newFileInfoList 업로드 파일 목록 + * @param nonQueryRequest 처리 요청, crdnCvlcpt 단속민원정보, crdn 단속정보 * @return 저장여부 */ - boolean updateCvlcptProcessSection(Map nonQueryRequest, CrdnCvlcpt crdnCvlcpt, Crdn crdn, List newFileInfoList); + boolean updateCvlcptProcessSection(Map nonQueryRequest, CrdnCvlcpt crdnCvlcpt, Crdn crdn); /** 단속민원 자료를 복사하여 신규단속자료를 생성한다. * @param crdnId 단속 ID diff --git a/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptServiceBean.java b/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptServiceBean.java index 8b6e29be..eee02c6a 100644 --- a/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptServiceBean.java +++ b/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptServiceBean.java @@ -16,7 +16,6 @@ import javax.annotation.Resource; import org.springframework.core.io.ClassPathResource; 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.cmmn.CmmnUtil; @@ -40,6 +39,7 @@ import cokr.xit.fims.cvlc.service.CrdnCvlcptService; import cokr.xit.fims.excl.dao.LevyExclMapper; import cokr.xit.fims.excl.service.bean.LevyExclBean; import cokr.xit.fims.sprt.Sprt; +import cokr.xit.fims.sprt.service.bean.MediaBean; import cokr.xit.foundation.component.AbstractServiceBean; import cokr.xit.foundation.data.DataObject; import cokr.xit.interfaces.disabledparking.service.bean.DisabledParkingBean; @@ -54,6 +54,9 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv @Resource(name="fileBean") private FileBean fileBean; + @Resource(name="mediaBean") + private MediaBean mediaBean; + @Resource(name = "disabledParkingBean") private DisabledParkingBean disabledParkingBean; @@ -271,13 +274,13 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv FileQuery fileQuery = new FileQuery(); fileQuery.setInfoType(Crdn.INF_TYPE); fileQuery.setInfoKeys(query.getCrdnId()); - List fileList = fileBean.getFileList(fileQuery); + List fileList = mediaBean.getFileAndMosaic(fileQuery); if(fileList != null && !fileList.isEmpty()) { dataObject.set("fileList", fileList); } //동영상 존재 여부 확인 - dataObject.set("videoExist", "N"); + dataObject.set("VIDEO_EXIST_YN", "N"); String linkTblNm = dataObject.string("LINK_TBL_NM"); if(!linkTblNm.equals("")) { @@ -295,7 +298,7 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv for(int i=0; i < linkFileList.size(); i++) { String mimeType = linkFileList.get(i).string("MIME_TYPE"); if(Arrays.asList(Sprt.VIDEO_MIME_TYPE).contains(mimeType)) { - dataObject.set("videoExist", "Y"); + dataObject.set("VIDEO_EXIST_YN", "Y"); } } } @@ -341,13 +344,13 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv } @Override - public boolean updateCvlcptProcessSection(Map nonQueryRequest, CrdnCvlcpt crdnCvlcpt, Crdn crdn, List newFileInfoList) { + public boolean updateCvlcptProcessSection(Map nonQueryRequest, CrdnCvlcpt crdnCvlcpt, Crdn crdn) { boolean saved = false; DataObject crdnInfo = crdnInfoMapper.selectCrdnInfo(crdn.getCrdnId()); String acceptType = (String)ifEmpty(nonQueryRequest.get("acceptType"), ""); - saved = crdnCvlcptSubBean.updateSubInfo(nonQueryRequest, crdn, newFileInfoList); + saved = crdnCvlcptSubBean.updateSubInfo(nonQueryRequest, crdn); if(!saved) { throw new RuntimeException("민원자료 저장 중 오류가 발생하였습니다."); } diff --git a/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptSubBean.java b/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptSubBean.java index c474cdaa..49bf6f90 100644 --- a/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptSubBean.java +++ b/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptSubBean.java @@ -152,37 +152,22 @@ public class CrdnCvlcptSubBean extends AbstractComponent { } /** 민원초기자료 상세화면에서 입력한 값대로 단속정보,납부자정보를 수정한다. - * @param nonQueryRequest 수정 요청, crdn 단속정보, 파일정보 newFileInfoList + * @param nonQueryRequest 수정 요청, crdn 단속정보 * @return 저장 여부 *
  • 저장됐으면 true
  • *
  • 그렇지 않으면 false
  • *
*/ - public boolean updateSubInfo(Map nonQueryRequest, Crdn crdn, - List newFileInfoList) { + public boolean updateSubInfo(Map nonQueryRequest, Crdn crdn) { boolean saved = false; DataObject crdnInfo = crdnInfoMapper.selectCrdnInfo(crdn.getCrdnId()); - String acceptType = (String)ifEmpty(nonQueryRequest.get("acceptType"), ""); - //첨수파일 수 변경 - int fileInsertCnt = 0; - int fileDeleteCnt = 0; - if(newFileInfoList != null && !newFileInfoList.isEmpty()) { - fileInsertCnt = newFileInfoList.size(); - } - String[] deleteFileKeyList = (String[])ifEmpty(nonQueryRequest.get("deleteFileKeyList"), new String[] {}); - if(deleteFileKeyList.length > 0) { - fileDeleteCnt = deleteFileKeyList.length; - } - int changeFileCnt = (fileInsertCnt - fileDeleteCnt); - nonQueryRequest.put("changeFileCnt", changeFileCnt); - //금액 변경 if(crdnInfo.string("TASK_SE_CD").equals("PVS") && "Y".equals(crdnInfo.string("OVTIME_PRTTN_YN"))) { nonQueryRequest.put("changeAmountYn","N"); @@ -282,20 +267,6 @@ public class CrdnCvlcptSubBean extends AbstractComponent { } } - //파일 처리 - if(newFileInfoList != null && !newFileInfoList.isEmpty()) { - int fileInsertEffected = fileBean.create(newFileInfoList); - if(fileInsertCnt != fileInsertEffected) { - throw new RuntimeException("단속민원답변 수정 중 파일 등록에 실패하였습니다."); - } - } - if(deleteFileKeyList.length > 0) { - int fileDeleteEffected = fileBean.remove((String[])nonQueryRequest.get("deleteFileKeyList")); - if(fileDeleteCnt != fileDeleteEffected) { - throw new RuntimeException("단속민원답변 수정 중 파일 삭제에 실패하였습니다."); - } - } - return true; } diff --git a/src/main/java/cokr/xit/fims/cvlc/web/Cvlc01Controller.java b/src/main/java/cokr/xit/fims/cvlc/web/Cvlc01Controller.java index 13d75451..4110595b 100644 --- a/src/main/java/cokr/xit/fims/cvlc/web/Cvlc01Controller.java +++ b/src/main/java/cokr/xit/fims/cvlc/web/Cvlc01Controller.java @@ -4,21 +4,16 @@ 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.apache.poi.ss.usermodel.CellStyle; -import org.springframework.web.multipart.MultipartFile; import org.springframework.web.servlet.ModelAndView; import com.fasterxml.jackson.core.type.TypeReference; import cokr.xit.base.code.CommonCode; -import cokr.xit.base.file.FileInfo; -import cokr.xit.base.file.FileInfo.Relation; -import cokr.xit.base.file.web.FileInfoFactory; import cokr.xit.base.file.xls.XLSWriter; import cokr.xit.base.file.xls.XLSWriter.CellDef; import cokr.xit.base.file.xls.XLSWriter.Styler; @@ -46,15 +41,15 @@ public class Cvlc01Controller extends ApplicationController { public class METHOD_URL { public static final String - civilComplaintReceiptDataMain = "/010/main.do", - getCivilComplaintReceiptDataList = "/010/list.do", - removeCivilComplaint = "/010/remove.do", + civilComplaintReceiptDataMain = "/010/main.do", + getCivilComplaintReceiptDataList = "/010/list.do", + removeCivilComplaint = "/010/remove.do", getCivilComplaintReceiptInitialDataInfo = "/020/info.do", - saveCivilComplaintProcessSection = "/020/update.do", - copyCivilComplaintInfo = "/020/create.do", - sendBackCivilComplaintInfo = "/020/remove.do", - getCivilComplaintOriginalInfo = "/050/info.do", - makeFileFromHwpFormat = "/050/makeFileFromHwpFormat.do" + saveCivilComplaintProcessSection = "/020/update.do", + copyCivilComplaintInfo = "/020/create.do", + sendBackCivilComplaintInfo = "/020/remove.do", + getCivilComplaintOriginalInfo = "/050/info.do", + makeFileFromHwpFormat = "/050/makeFileFromHwpFormat.do" ; } @@ -263,14 +258,14 @@ public class Cvlc01Controller extends ApplicationController { } /**지정한 민원 초기자료를 수정한다. - * @param hReq 수정 요청, crdnCvlcpt 민원 정보, crdn 단속 정보, 추가한 이미지 파일 newFileList, modifyFileList 편집한 이미지 파일 + * @param hReq 수정 요청, crdnCvlcpt 민원 정보, crdn 단속 정보 * @return jsonView *
 {
 	 *     "affected": 저장된 정보수
 	 *     "saved": 저장되었으면 true, 그렇지 않으면 false
 	 * }
*/ - public ModelAndView saveCivilComplaintProcessSection(HttpServletRequest hReq, CrdnCvlcpt crdnCvlcpt, Crdn crdn, MultipartFile[] newFileList, MultipartFile[] modifyFileList) { + public ModelAndView saveCivilComplaintProcessSection(HttpServletRequest hReq, CrdnCvlcpt crdnCvlcpt, Crdn crdn) { ManagedUser currentUser = userMapper.getUser(currentUser().getAccount(), currentUser().getInstitute()); String deptCd = currentUser.getDeptCode(); @@ -280,36 +275,7 @@ public class Cvlc01Controller extends ApplicationController { boolean saved = false; - 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); - String acceptYn = hReq.getParameter("acceptYn"); if(ifEmpty(acceptYn, () -> "").equals("Y")) { nonQueryRequest.put("acceptType", "accept"); @@ -321,7 +287,7 @@ public class Cvlc01Controller extends ApplicationController { } } - saved = crdnCvlcptService.updateCvlcptProcessSection(nonQueryRequest, crdnCvlcpt, crdn, newFileInfoList); + saved = crdnCvlcptService.updateCvlcptProcessSection(nonQueryRequest, crdnCvlcpt, crdn); return new ModelAndView("jsonView") diff --git a/src/main/java/cokr/xit/fims/sprt/dao/MediaMapper.java b/src/main/java/cokr/xit/fims/sprt/dao/MediaMapper.java index 7536ca0a..81ff4337 100644 --- a/src/main/java/cokr/xit/fims/sprt/dao/MediaMapper.java +++ b/src/main/java/cokr/xit/fims/sprt/dao/MediaMapper.java @@ -1,6 +1,7 @@ package cokr.xit.fims.sprt.dao; import java.util.List; +import java.util.Map; import org.egovframe.rte.psl.dataaccess.mapper.Mapper; @@ -15,4 +16,7 @@ public interface MediaMapper { */ List selectMosaicList(String fileId); + + int reorder(Map params); + } diff --git a/src/main/java/cokr/xit/fims/sprt/service/bean/MediaBean.java b/src/main/java/cokr/xit/fims/sprt/service/bean/MediaBean.java index f5effd6a..7793ba58 100644 --- a/src/main/java/cokr/xit/fims/sprt/service/bean/MediaBean.java +++ b/src/main/java/cokr/xit/fims/sprt/service/bean/MediaBean.java @@ -3,7 +3,9 @@ package cokr.xit.fims.sprt.service.bean; import java.awt.image.BufferedImage; import java.io.InputStream; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import javax.annotation.Resource; import javax.imageio.ImageIO; @@ -69,6 +71,33 @@ public class MediaBean extends AbstractComponent { return fileInfo; } + public List getFileAndMosaic(FileQuery fileQuery){ + + List fileList = fileBean.getFileList(fileQuery); + for(DataObject fileInfo : fileList) { + List mosaicInfos = this.getMosaicList(fileInfo.string("FILE_ID")); + if(mosaicInfos != null) { + String mosaic = ""; + for(int i=0; i < mosaicInfos.size(); i++) { + DataObject mosaicInfo = mosaicInfos.get(i); + if(i != 0) { + mosaic += "|"; + } + mosaic += mosaicInfo.string("X_AXS") + + "," + mosaicInfo.string("Y_AXS") + + "," + mosaicInfo.string("MOSC_LT") + + "," + mosaicInfo.string("MOSC_HG"); + } + fileInfo.set("MOSAIC", mosaic); + } else { + fileInfo.set("MOSAIC", ""); + } + + } + + return fileList; + } + /**파일의 모자이크 정보를 조회한다.
* @param fileId 파일ID * @return 모자이크 정보 @@ -112,4 +141,11 @@ public class MediaBean extends AbstractComponent { return result; } + + public int reorder(String fileId, int i) { + Map params = new HashMap<>(); + params.put("fileId", fileId); + params.put("srtOrd", i); + return mediaMapper.reorder(params); + } } diff --git a/src/main/java/cokr/xit/fims/task/web/BpvController.java b/src/main/java/cokr/xit/fims/task/web/BpvController.java index b5b04b94..d039e79a 100644 --- a/src/main/java/cokr/xit/fims/task/web/BpvController.java +++ b/src/main/java/cokr/xit/fims/task/web/BpvController.java @@ -13,8 +13,8 @@ import cokr.xit.fims.crdn.ExmptnVhcl; import cokr.xit.fims.crdn.Team; import cokr.xit.fims.cvlc.CrdnCvlcpt; import cokr.xit.fims.excl.CrdnReReg; -import cokr.xit.fims.excl.LevyExclQuery; import cokr.xit.fims.excl.LevyExcl; +import cokr.xit.fims.excl.LevyExclQuery; import cokr.xit.fims.excl.OpnnSbmsn; import cokr.xit.fims.levy.LevyQuery; import cokr.xit.fims.levy.Rduct; @@ -53,8 +53,8 @@ public class BpvController { @Override @RequestMapping(name="전용차로과태료업무 민원 정보 수정", value=METHOD_URL.saveCivilComplaintProcessSection) - public ModelAndView saveCivilComplaintProcessSection(HttpServletRequest hReq, CrdnCvlcpt crdnCvlcpt, Crdn crdn, MultipartFile[] newFileList, MultipartFile[] modifyFileList) { - return super.saveCivilComplaintProcessSection(hReq, crdnCvlcpt, crdn, newFileList, modifyFileList); + public ModelAndView saveCivilComplaintProcessSection(HttpServletRequest hReq, CrdnCvlcpt crdnCvlcpt, Crdn crdn) { + return super.saveCivilComplaintProcessSection(hReq, crdnCvlcpt, crdn); } @Override diff --git a/src/main/java/cokr/xit/fims/task/web/DpvController.java b/src/main/java/cokr/xit/fims/task/web/DpvController.java index f305e073..abe795c8 100644 --- a/src/main/java/cokr/xit/fims/task/web/DpvController.java +++ b/src/main/java/cokr/xit/fims/task/web/DpvController.java @@ -14,8 +14,8 @@ import cokr.xit.fims.epst.EpostGdcc; import cokr.xit.fims.epst.EpostQuery; import cokr.xit.fims.epst.EpostRcptReg; import cokr.xit.fims.excl.CrdnReReg; -import cokr.xit.fims.excl.LevyExclQuery; import cokr.xit.fims.excl.LevyExcl; +import cokr.xit.fims.excl.LevyExclQuery; import cokr.xit.fims.excl.OpnnSbmsn; import cokr.xit.fims.levy.LevyQuery; import cokr.xit.fims.levy.Rduct; @@ -63,8 +63,8 @@ public class DpvController { @Override @RequestMapping(name="장애인과태료업무 민원 정보 수정", value=METHOD_URL.saveCivilComplaintProcessSection) - public ModelAndView saveCivilComplaintProcessSection(HttpServletRequest hReq, CrdnCvlcpt crdnCvlcpt, Crdn crdn, MultipartFile[] newFileList, MultipartFile[] modifyFileList) { - return super.saveCivilComplaintProcessSection(hReq, crdnCvlcpt, crdn, newFileList, modifyFileList); + public ModelAndView saveCivilComplaintProcessSection(HttpServletRequest hReq, CrdnCvlcpt crdnCvlcpt, Crdn crdn) { + return super.saveCivilComplaintProcessSection(hReq, crdnCvlcpt, crdn); } @Override diff --git a/src/main/java/cokr/xit/fims/task/web/EcaController.java b/src/main/java/cokr/xit/fims/task/web/EcaController.java index a957e3e4..d956f260 100644 --- a/src/main/java/cokr/xit/fims/task/web/EcaController.java +++ b/src/main/java/cokr/xit/fims/task/web/EcaController.java @@ -11,8 +11,8 @@ import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.cvlc.CrdnCvlcpt; import cokr.xit.fims.excl.CrdnReReg; -import cokr.xit.fims.excl.LevyExclQuery; import cokr.xit.fims.excl.LevyExcl; +import cokr.xit.fims.excl.LevyExclQuery; import cokr.xit.fims.excl.OpnnSbmsn; import cokr.xit.fims.levy.LevyQuery; import cokr.xit.fims.levy.Rduct; @@ -51,8 +51,8 @@ public class EcaController { @Override @RequestMapping(name="전기차과태료업무 민원 정보 수정", value=METHOD_URL.saveCivilComplaintProcessSection) - public ModelAndView saveCivilComplaintProcessSection(HttpServletRequest hReq, CrdnCvlcpt crdnCvlcpt, Crdn crdn, MultipartFile[] newFileList, MultipartFile[] modifyFileList) { - return super.saveCivilComplaintProcessSection(hReq, crdnCvlcpt, crdn, newFileList, modifyFileList); + public ModelAndView saveCivilComplaintProcessSection(HttpServletRequest hReq, CrdnCvlcpt crdnCvlcpt, Crdn crdn) { + return super.saveCivilComplaintProcessSection(hReq, crdnCvlcpt, crdn); } @Override diff --git a/src/main/java/cokr/xit/fims/task/web/PvsController.java b/src/main/java/cokr/xit/fims/task/web/PvsController.java index 4cea4205..5d34155f 100644 --- a/src/main/java/cokr/xit/fims/task/web/PvsController.java +++ b/src/main/java/cokr/xit/fims/task/web/PvsController.java @@ -12,8 +12,8 @@ import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.Team; import cokr.xit.fims.cvlc.CrdnCvlcpt; import cokr.xit.fims.excl.CrdnReReg; -import cokr.xit.fims.excl.LevyExclQuery; import cokr.xit.fims.excl.LevyExcl; +import cokr.xit.fims.excl.LevyExclQuery; import cokr.xit.fims.excl.OpnnSbmsn; import cokr.xit.fims.levy.LevyQuery; import cokr.xit.fims.levy.Rduct; @@ -52,8 +52,8 @@ public class PvsController { @Override @RequestMapping(name="주정차과태료업무 민원 정보 수정", value=METHOD_URL.saveCivilComplaintProcessSection) - public ModelAndView saveCivilComplaintProcessSection(HttpServletRequest hReq, CrdnCvlcpt crdnCvlcpt, Crdn crdn, MultipartFile[] newFileList, MultipartFile[] modifyFileList) { - return super.saveCivilComplaintProcessSection(hReq, crdnCvlcpt, crdn, newFileList, modifyFileList); + public ModelAndView saveCivilComplaintProcessSection(HttpServletRequest hReq, CrdnCvlcpt crdnCvlcpt, Crdn crdn) { + return super.saveCivilComplaintProcessSection(hReq, crdnCvlcpt, crdn); } @Override diff --git a/src/main/resources/sql/mapper/fims/cvlc/crdnCvlcpt-mapper.xml b/src/main/resources/sql/mapper/fims/cvlc/crdnCvlcpt-mapper.xml index a0603fab..62de560e 100644 --- a/src/main/resources/sql/mapper/fims/cvlc/crdnCvlcpt-mapper.xml +++ b/src/main/resources/sql/mapper/fims/cvlc/crdnCvlcpt-mapper.xml @@ -577,7 +577,6 @@ SELECT CC.CVLCPT_LINK_ID /* 민원 연계 ID */ UPDATE TB_CRDN SET MDFCN_DT = /* 수정일시 */ , MDFR = #{currentUser.id} /* 수정자 */ - , ATCH_FILE_CNT = ATCH_FILE_CNT + (#{changeFileCnt}) , RTPYR_ID = #{crdn.rtpyrId} /* 납부자 ID */ , CRDN_YMD = #{crdn.crdnYmd} /* 단속 일자 */ , CRDN_TM = #{crdn.crdnTm} /* 단속 시각 */ diff --git a/src/main/resources/sql/mapper/fims/sprt/media-mapper.xml b/src/main/resources/sql/mapper/fims/sprt/media-mapper.xml index a7e76984..27fe6af1 100644 --- a/src/main/resources/sql/mapper/fims/sprt/media-mapper.xml +++ b/src/main/resources/sql/mapper/fims/sprt/media-mapper.xml @@ -15,4 +15,11 @@ SELECT MOSC_ID AND DEL_YN = 'N' + +/* 이미지파일 순서 변경 (mediaMapper.reorder) */ +UPDATE TB_FILE + SET SRT_ORD = #{srtOrd} + WHERE FILE_ID = #{fileId} + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01020-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01020-info.jsp index 42da899e..0861f658 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01020-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01020-info.jsp @@ -368,79 +368,14 @@ -
-
- - -
- -
-
등록된 사진
-
- - -
-
-
-
- -
- -
-
-
추가한 사진
-
- - - -
-
-
-
-
+ + - - - - \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/fims/photo-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/photo-main.jsp new file mode 100644 index 00000000..addf33b1 --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/fims/photo-main.jsp @@ -0,0 +1,58 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%> +<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%> +
+
+ + +
+ +
등록된 사진
+
+
+ + + + +
+
+ +
+
    +
+
+ +
+ +
+ +
+ + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/index.jsp b/src/main/webapp/WEB-INF/jsp/index.jsp index 96861fd2..10bfe837 100644 --- a/src/main/webapp/WEB-INF/jsp/index.jsp +++ b/src/main/webapp/WEB-INF/jsp/index.jsp @@ -66,6 +66,30 @@ pageObject.childReq = []; pageObject.parentRes = []; + function LoadScript(scriptId, scriptPath){ + if(document.getElementById(scriptId) == null){ + $("body").append("