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