From 8f7b53a6c94992822492c391abc695a8ab0a1ae6 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Fri, 19 Jan 2024 11:09:25 +0900 Subject: [PATCH] =?UTF-8?q?1.=20=EB=AF=BC=EC=9B=90,=EB=8B=A8=EC=86=8D=20?= =?UTF-8?q?=ED=99=94=EB=A9=B4=20=EC=88=98=EC=A0=95(=EA=B7=B8=EB=A6=AC?= =?UTF-8?q?=EB=93=9C=EC=9D=98=20=ED=8A=B9=EC=A0=95=20=EC=97=B4=EC=9D=84=20?= =?UTF-8?q?=EA=B8=B0=EC=A4=80=20=EC=A0=95=EB=A0=AC=ED=95=98=EB=8A=94=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80)=202.=20=EB=AF=BC?= =?UTF-8?q?=EC=9B=90=20=EB=B3=B5=EC=82=AC=20=EB=93=B1=EB=A1=9D=EC=8B=9C=20?= =?UTF-8?q?=EB=B3=B5=EC=82=AC=EC=9E=90=EB=A3=8C=EA=B0=80=20=EC=9B=90?= =?UTF-8?q?=EB=B3=B8=EC=9E=90=EB=A3=8C=20=EB=B0=91=EC=97=90=20=ED=91=9C?= =?UTF-8?q?=EC=8B=9C=EB=90=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95=203.?= =?UTF-8?q?=20=EB=AF=BC=EC=9B=90=20=EB=B3=B5=EC=82=AC=20=EB=93=B1=EB=A1=9D?= =?UTF-8?q?=EC=8B=9C=20=EB=AA=A8=EC=9E=90=EC=9D=B4=ED=81=AC=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=EB=8F=84=20=EB=B3=B5=EC=82=AC=EB=90=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EC=88=98=EC=A0=95=ED=95=A8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../crdn/service/bean/CrdnServiceBean.java | 28 +++++++++++-- .../service/bean/CrdnCvlcptServiceBean.java | 29 ++++++++++++-- .../cvlc/service/bean/CrdnCvlcptSubBean.java | 14 +++++++ .../cokr/xit/fims/sprt/dao/MediaMapper.java | 3 ++ .../xit/fims/sprt/service/bean/MediaBean.java | 13 +++++++ .../mapper/fims/cvlc/crdnCvlcpt-mapper.xml | 1 + .../sql/mapper/fims/sprt/media-mapper.xml | 39 +++++++++++++++++++ 7 files changed, 121 insertions(+), 6 deletions(-) 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 a656babe..a4c29049 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 @@ -12,6 +12,7 @@ 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; import cokr.xit.fims.cmmn.service.bean.CrdnPayerHstryBean; import cokr.xit.fims.cmmn.service.bean.CrdnSttsHstryBean; import cokr.xit.fims.crdn.Crdn; @@ -91,10 +92,24 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService List dataObjectList = new ArrayList(); switch (ifEmpty(query.getGridType(), () -> "")) { case "tagInformationUndefinedData": - dataObjectList = crdnListMapper.selectTagInformationUndefinedDataList(query.setOrderBy("CRDN_ID")); + if (query.getOrderBy() == null) { + if (query.getBy() == null) { + query.setOrderBy("CRDN_ID"); + } else { + query.setOrderBy(CmmnUtil.convertCamelCaseToSnakeCase(query.getBy())); + } + } + dataObjectList = crdnListMapper.selectTagInformationUndefinedDataList(query); break; case "photo": - dataObjectList = crdnListMapper.selectPhotoInspectionDataList(query.setOrderBy("VHRNO, CRDN_PLC, CRDN_ID")); + if (query.getOrderBy() == null) { + if (query.getBy() == null) { + query.setOrderBy("VHRNO, CRDN_PLC, CRDN_ID"); + } else { + query.setOrderBy(CmmnUtil.convertCamelCaseToSnakeCase(query.getBy())); + } + } + dataObjectList = crdnListMapper.selectPhotoInspectionDataList(query); break; case "sameVehicleMain": if(ifEmpty(query.getSchOnlySamePlace(),() -> "").equals("on")) { @@ -112,7 +127,14 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService dataObjectList = crdnListMapper.selectTodayCrackdownList(query); break; default: - dataObjectList = crdnListMapper.selectCrackdownList(query.setOrderBy("CRDN_ID")); + if (query.getOrderBy() == null) { + if (query.getBy() == null) { + query.setOrderBy("CRDN_ID"); + } else { + query.setOrderBy(CmmnUtil.convertCamelCaseToSnakeCase(query.getBy())); + } + } + dataObjectList = crdnListMapper.selectCrackdownList(query); break; } 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 eee02c6a..a6c507cd 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 @@ -107,13 +107,36 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv List dataObjectList = new ArrayList(); switch (ifEmpty(query.getGridType(), () -> "")) { case "receiptData": - dataObjectList = crdnCvlcptMapper.selectCivilComplaintReceiptDataList(query.setOrderBy("CVLCPT_RCPT_YMD, CRDN_ID")); + String appendCopyToOriginal = "CVLCPT_RCPT_YMD, CVLCPT_RCPT_NO, CVLCPT_LIST_NO, CVLCPT_LINK_ID, CRDN_REG_SE_CD, CRDN_ID"; + + if(query.getOrderBy() == null) { + if (ifEmpty(query.getBy(), "").equals("")) { + query.setOrderBy(appendCopyToOriginal); + } else { + query.setOrderBy(CmmnUtil.convertCamelCaseToSnakeCase(query.getBy()+","+appendCopyToOriginal)); + } + } + dataObjectList = crdnCvlcptMapper.selectCivilComplaintReceiptDataList(query); break; case "answerTargetData": - dataObjectList = crdnCvlcptMapper.selectCivilComplaintAnswerTargetDataList(query.setOrderBy("CRDN_ID")); + if (query.getOrderBy() == null) { + if (query.getBy() == null) { + query.setOrderBy("CRDN_ID"); + } else { + query.setOrderBy(CmmnUtil.convertCamelCaseToSnakeCase(query.getBy())); + } + } + dataObjectList = crdnCvlcptMapper.selectCivilComplaintAnswerTargetDataList(query); break; default: - dataObjectList = crdnCvlcptMapper.selectCivilComplaintList(query.setOrderBy("CRDN_ID")); + if (query.getOrderBy() == null) { + if (query.getBy() == null) { + query.setOrderBy("CRDN_ID"); + } else { + query.setOrderBy(CmmnUtil.convertCamelCaseToSnakeCase(query.getBy())); + } + } + dataObjectList = crdnCvlcptMapper.selectCivilComplaintList(query); break; } 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 49bf6f90..07b8d3fb 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 @@ -33,6 +33,7 @@ import cokr.xit.fims.cvlc.dao.CrdnCvlcptMapper; import cokr.xit.fims.cvlc.dao.WarningWordsMapper; import cokr.xit.fims.excl.LevyExcl; import cokr.xit.fims.excl.dao.LevyExclMapper; +import cokr.xit.fims.sprt.service.bean.MediaBean; import cokr.xit.foundation.AbstractComponent; import cokr.xit.foundation.UserInfo; import cokr.xit.foundation.data.DataObject; @@ -58,6 +59,9 @@ public class CrdnCvlcptSubBean extends AbstractComponent { @Resource(name = "fileBean") private FileBean fileBean; + @Resource(name = "mediaBean") + private MediaBean mediaBean; + @Resource(name = "codeMapper") private CodeMapper codeMapper; @@ -297,13 +301,23 @@ public class CrdnCvlcptSubBean extends AbstractComponent { relation.setInfoType(Crdn.INF_TYPE); relation.setInfoKey(newCrdnId); fileInfoList = new FileInfoFactory().createFileInfos(relation, files); + ArrayList oldFileIdList = new ArrayList<>(); for (int iLoop = 0; iLoop < fileInfoList.size(); iLoop++) { + oldFileIdList.add(orgnlCrdnFileList.get(iLoop).string("FILE_ID")); fileInfoList.get(iLoop).setName(orgnlCrdnFileList.get(iLoop).string("FILE_NM")); } int effected = fileBean.create(fileInfoList); if(effected == 0) { throw new RuntimeException("단속민원 복사 등록 중 파일복사에 실패하였습니다."); } + + try { + for (int iLoop = 0; iLoop < fileInfoList.size(); iLoop++) { + mediaBean.copyMosaicInfo(oldFileIdList.get(iLoop), fileInfoList.get(iLoop).getId()); + } + } catch (Exception e) { + throw new RuntimeException("단속민원 복사 등록 중 사진 모자이크 정보 복사에 실패하였습니다."); + } } return true; 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 81ff4337..3ad99d33 100644 --- a/src/main/java/cokr/xit/fims/sprt/dao/MediaMapper.java +++ b/src/main/java/cokr/xit/fims/sprt/dao/MediaMapper.java @@ -19,4 +19,7 @@ public interface MediaMapper { int reorder(Map params); + + int copyMosaicInfo(Map param); + } 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 7793ba58..77f17d34 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 @@ -148,4 +148,17 @@ public class MediaBean extends AbstractComponent { params.put("srtOrd", i); return mediaMapper.reorder(params); } + + public void copyMosaicInfo(String oldFileId, String newFileId) { + + DataObject param = new DataObject().set("currentUser", currentUser()); + param.put("oldFileId", oldFileId); + param.put("newFileId", newFileId); + + List mosaicInfos = this.getMosaicList(oldFileId); + for(DataObject mosaicInfo : mosaicInfos) { + param.set("oldMoscId", mosaicInfo.string("MOSC_ID")); + mediaMapper.copyMosaicInfo(param); + } + } } 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 62de560e..ed6e41e5 100644 --- a/src/main/resources/sql/mapper/fims/cvlc/crdnCvlcpt-mapper.xml +++ b/src/main/resources/sql/mapper/fims/cvlc/crdnCvlcpt-mapper.xml @@ -220,6 +220,7 @@ AND (SELECT VLTN_ARTCL FROM TB_VLTN WHERE VLTN_ID = C.VLTN_ID) LIKE CONCAT('%', /* 민원접수자료 목록 조회(crdnCvlcptMapper.selectCivilComplaintReceiptDataList) */ SELECT C.CRDN_ID + , CC.CVLCPT_LINK_ID , C.SGG_CD , C.TASK_SE_CD , C.CRDN_REG_SE_CD 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 27fe6af1..5e251c21 100644 --- a/src/main/resources/sql/mapper/fims/sprt/media-mapper.xml +++ b/src/main/resources/sql/mapper/fims/sprt/media-mapper.xml @@ -22,4 +22,43 @@ UPDATE TB_FILE WHERE FILE_ID = #{fileId} + +/* 모자이크 정보 복사(mediaMapper.copyMosaicInfo) */ + +SELECT + LPAD(CAST(IFNULL(MAX(MOSC_ID) + 1, 1) AS INT), 10, '0') + AS NEW_ID + FROM TB_FILE_MOSC + +INSERT + INTO TB_FILE_MOSC ( + MOSC_ID + , FILE_ID + , X_AXS + , Y_AXS + , MOSC_LT + , MOSC_HG + , DEL_YN + , REG_DT + , RGTR + , MDFCN_DT + , MDFR +) +SELECT #{newMoscId} + , #{newFileId} + , X_AXS + , Y_AXS + , MOSC_LT + , MOSC_HG + , 'N' + , + , #{currentUser.id} + , + , #{currentUser.id} + FROM TB_FILE_MOSC + WHERE FILE_ID = #{oldFileId} + AND MOSC_ID = #{oldMoscId} + AND DEL_YN = 'N' + + \ No newline at end of file