From fce771801aa1ee4534e3e3befe754b034eb073ee Mon Sep 17 00:00:00 2001 From: "xitpc\\xituser" Date: Mon, 14 Oct 2024 17:37:49 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9E=84=EB=8C=80=EC=B0=A8=EA=B3=84=EC=95=BD?= =?UTF-8?q?=20=EB=A7=A4=ED=95=91=20=EC=83=81=EC=84=B8=20=EC=A0=95=EB=B3=B4?= =?UTF-8?q?=20=EC=88=98=EC=A0=95.=20=20=20-=20=EB=8B=A8=EC=86=8D=20?= =?UTF-8?q?=EC=B2=A8=EB=B6=80=ED=8C=8C=EC=9D=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cokr/xit/fims/rent/LsctAprv.java | 5 +++ .../fims/rent/service/bean/LsctMpngBean.java | 37 ++++++++----------- .../service/bean/LsctMpngServiceBean.java | 23 +++++++++++- .../xit/fims/rent/web/Rent02Controller.java | 15 ++++++-- .../sql/mapper/fims/rent/lsctMpng-mapper.xml | 13 ++++--- 5 files changed, 61 insertions(+), 32 deletions(-) diff --git a/src/main/java/cokr/xit/fims/rent/LsctAprv.java b/src/main/java/cokr/xit/fims/rent/LsctAprv.java index 4376ca91..83f90fb3 100644 --- a/src/main/java/cokr/xit/fims/rent/LsctAprv.java +++ b/src/main/java/cokr/xit/fims/rent/LsctAprv.java @@ -267,4 +267,9 @@ public class LsctAprv extends AbstractEntity { */ private String linkTableName; + /** + * 변경 요청 IP + */ + private String chgDmndIp; + } diff --git a/src/main/java/cokr/xit/fims/rent/service/bean/LsctMpngBean.java b/src/main/java/cokr/xit/fims/rent/service/bean/LsctMpngBean.java index 28372b9c..064fc2b5 100644 --- a/src/main/java/cokr/xit/fims/rent/service/bean/LsctMpngBean.java +++ b/src/main/java/cokr/xit/fims/rent/service/bean/LsctMpngBean.java @@ -544,6 +544,15 @@ public class LsctMpngBean extends AbstractBean { lsctAprv.setRentEntDtlAddr(lsctMpngInfo.string("ENT_DTL_ADDR")); // 임대 기업 상세 주소 lsctAprv.setAtchFileCnt(lsctMpngInfo.number("ATCH_FILE_CNT").intValue()); // 첨부 파일 수 + // 서버 IP Address + InetAddress localIP = null; + try { + localIP = InetAddress.getLocalHost(); + } catch (UnknownHostException e) { + e.printStackTrace(); + } + String serverIP = localIP.getHostAddress(); + // 임차인 ID로 파일(TB_FILE) 정보 조회 List fileList = fileBean.getFileList(new FileQuery().setInfoType(Lsct.INF_TYPE) .setInfoKeys(lsctMpngInfo.string("LSCT_ID")) @@ -587,19 +596,11 @@ public class LsctMpngBean extends AbstractBean { throw new RuntimeException("[F] 등록 작업에 실패하였습니다."); // 예외를 발생시켜서 DB Rollback } - // IP Address - InetAddress local = null; - try { - local = InetAddress.getLocalHost(); - } catch (UnknownHostException e) { - e.printStackTrace(); - } - // 임대차계약(TB_LSCT) 대장의 변경요청 정보를 수정한다. LsctMpng lsctMpng = new LsctMpng(); - lsctMpng.setLsctMpngId(lsctAprv.getLsctMpngId()); // 임대차계약 매핑 ID - lsctMpng.setChgDmndYn("Y"); // 변경 요청 여부 - lsctMpng.setChgDmndIp(local.getHostAddress()); // 변경 요청 IP + lsctMpng.setLsctMpngId(lsctAprv.getLsctMpngId()); // 임대차계약 매핑 ID + lsctMpng.setChgDmndYn("Y"); // 변경 요청 여부 + lsctMpng.setChgDmndIp(lsctAprv.getChgDmndIp()); // 변경 요청 IP rtnNocs = lsctMpngMapper.updateLsctMpngChgDmnd(lsctMpng); if (rtnNocs < 1) { @@ -662,19 +663,11 @@ public class LsctMpngBean extends AbstractBean { // 임대차계약 승인(TB_LSCT_APRV) 대장을 삭제한다. lsctAprvMapper.deleteLsctAprv(lsctAprv); - // IP Address - InetAddress local = null; - try { - local = InetAddress.getLocalHost(); - } catch (UnknownHostException e) { - e.printStackTrace(); - } - // 임대차계약(TB_LSCT) 대장의 변경요청 정보를 수정한다. LsctMpng lsctMpng = new LsctMpng(); - lsctMpng.setLsctMpngId(lsctAprv.getLsctMpngId()); // 임대차계약 매핑 ID - lsctMpng.setChgDmndYn("N"); // 변경 요청 여부 - lsctMpng.setChgDmndRtrcnIp(local.getHostAddress()); // 변경 요청 수정 IP + lsctMpng.setLsctMpngId(lsctAprv.getLsctMpngId()); // 임대차계약 매핑 ID + lsctMpng.setChgDmndYn("N"); // 변경 요청 여부 + lsctMpng.setChgDmndIp(lsctAprv.getChgDmndIp()); // 변경 요청 IP rtnNocs = lsctMpngMapper.updateLsctMpngChgDmnd(lsctMpng); if (rtnNocs < 1) { diff --git a/src/main/java/cokr/xit/fims/rent/service/bean/LsctMpngServiceBean.java b/src/main/java/cokr/xit/fims/rent/service/bean/LsctMpngServiceBean.java index 80d2863b..e303dc91 100644 --- a/src/main/java/cokr/xit/fims/rent/service/bean/LsctMpngServiceBean.java +++ b/src/main/java/cokr/xit/fims/rent/service/bean/LsctMpngServiceBean.java @@ -6,6 +6,9 @@ import javax.annotation.Resource; import org.springframework.stereotype.Service; +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.rent.LsctAprv; import cokr.xit.fims.rent.LsctMpng; import cokr.xit.fims.rent.RentQuery; @@ -30,6 +33,10 @@ public class LsctMpngServiceBean extends AbstractServiceBean implements LsctMpng @Resource(name = "lsctMpngBean") private LsctMpngBean lsctMpngBean; + /** 파일 Bean */ + @Resource(name="fileBean") + private FileBean fileBean; + @Override public DataObject getCrdnInfo(RentQuery req) { return lsctMpngBean.getCrdnInfo(req); @@ -42,7 +49,21 @@ public class LsctMpngServiceBean extends AbstractServiceBean implements LsctMpng @Override public DataObject getCrdnLsctMpngInfo(RentQuery req) { - return lsctMpngBean.getCrdnLsctMpngInfo(req); + // 단속 조회 + DataObject dataObject = lsctMpngBean.getCrdnLsctMpngInfo(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); + } + + return dataObject; } @Override diff --git a/src/main/java/cokr/xit/fims/rent/web/Rent02Controller.java b/src/main/java/cokr/xit/fims/rent/web/Rent02Controller.java index e9ed7245..62199777 100644 --- a/src/main/java/cokr/xit/fims/rent/web/Rent02Controller.java +++ b/src/main/java/cokr/xit/fims/rent/web/Rent02Controller.java @@ -24,6 +24,7 @@ import cokr.xit.base.file.FileInfo; import cokr.xit.base.file.web.FileInfoFactory; import cokr.xit.base.web.ApplicationController; import cokr.xit.fims.base.FimsUser; +import cokr.xit.fims.cmmn.CmmnUtil; import cokr.xit.fims.cmmn.service.bean.StngBean; import cokr.xit.fims.cmmn.xls.FormatMaker; import cokr.xit.fims.cmmn.xls.StyleMaker; @@ -160,9 +161,9 @@ public class Rent02Controller extends ApplicationController { valueMap.put("납부자구분", format.of("RTPYR_SE_NM").style(center)); valueMap.put("납부자번호", format.of("RTPYR_NO").style(center)); valueMap.put("납부자명", format.of("RTPYR_NM")); - valueMap.put("위반항목", format.of("VLTN_ARTCL")); valueMap.put("단속법정동", format.of("CRDN_STDG_NM").style(center)); valueMap.put("단속장소", format.of("CRDN_PLC")); + valueMap.put("위반항목", format.of("VLTN_ARTCL")); valueMap.put("단속원금", format.of("FFNLG_CRDN_AMT").style(numeric)); valueMap.put("처리상태", format.of("CRDN_STTS_NM")); valueMap.put("등록일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "REG_DT").style(dateDT)); @@ -591,10 +592,14 @@ public class Rent02Controller extends ApplicationController { */ @Task("CMN") @RequestMapping(name = "임대차계약 승인 대장 등록", value = METHOD_URL.createLeaseContractApproval) - public ModelAndView createLeaseContractApproval(LsctAprv lsctAprv) { + public ModelAndView createLeaseContractApproval(HttpServletRequest hreq, LsctAprv lsctAprv) { boolean saved = false; String rtnMsg = ""; + // 클라이언트 IP 확인 + String remoteAddr = CmmnUtil.getClientIpAddr(hreq); + lsctAprv.setChgDmndIp(remoteAddr); // 변경 요청 IP + // 단건 if (lsctAprv.getLsctMpngIds() == null || lsctAprv.getLsctMpngIds().length < 1) { rtnMsg = lsctMpngService.createLsctAprv(lsctAprv); // 등록 @@ -632,10 +637,14 @@ public class Rent02Controller extends ApplicationController { */ @Task("CMN") @RequestMapping(name = "임대차계약 승인 대장 삭제", value = METHOD_URL.removeLeaseContractApproval) - public ModelAndView removeLeaseContractApproval(LsctAprv lsctAprv) { + public ModelAndView removeLeaseContractApproval(HttpServletRequest hreq, LsctAprv lsctAprv) { boolean saved = false; String rtnMsg = ""; + // 클라이언트 IP 확인 + String remoteAddr = CmmnUtil.getClientIpAddr(hreq); + lsctAprv.setChgDmndIp(remoteAddr); // 변경 요청 IP + // 단건 if (lsctAprv.getLsctMpngIds() == null || lsctAprv.getLsctMpngIds().length < 1) { rtnMsg = lsctMpngService.removeLsctAprv(lsctAprv); // 삭제 diff --git a/src/main/resources/sql/mapper/fims/rent/lsctMpng-mapper.xml b/src/main/resources/sql/mapper/fims/rent/lsctMpng-mapper.xml index 3eb86b90..8fcc757e 100644 --- a/src/main/resources/sql/mapper/fims/rent/lsctMpng-mapper.xml +++ b/src/main/resources/sql/mapper/fims/rent/lsctMpng-mapper.xml @@ -373,10 +373,6 @@ , (SELECT GET_CODE_NM('FIM011', P.RTPYR_SE_CD) FROM DUAL) AS RTPYR_SE_NM , P.RTPYR_NO , P.RTPYR_NM - , PA.ADDR_SN - , PA.ZIP - , PA.ADDR - , PA.DTL_ADDR , LM.LSCT_MPNG_ID , (CASE WHEN LM.CHG_APRV_YN = 'Y' AND LM.CHG_DMND_YN = 'Y' AND C.NXRP_CRDN_LINK_YN = 'N' THEN '기타(승인완료)' WHEN LM.CHG_APRV_YN = 'N' AND LM.CHG_DMND_YN = 'Y' AND C.NXRP_CRDN_LINK_YN = 'N' THEN '기타(승인요청)' @@ -411,10 +407,15 @@ , (SELECT GET_CODE_NM('FIM089', L.HIRER_SE_CD) FROM DUAL) AS HIRER_SE_NM , L.HIRER_REG_NO , L.HIRER_NM + , L.HIRER_TELNO + , L.HIRER_MBL_TELNO + , L.HIRER_EML_ADDR + , L.HIRER_ZIP + , L.HIRER_ADDR + , L.HIRER_DTL_ADDR FROM TB_CRDN C LEFT OUTER JOIN TB_VLTN V ON (C.VLTN_ID = V.VLTN_ID) LEFT OUTER JOIN TB_PAYER P ON (C.RTPYR_ID = P.RTPYR_ID) - LEFT OUTER JOIN TB_PAYER_ADDR PA ON (C.RTPYR_ID = PA.RTPYR_ID AND C.ADDR_SN = PA.ADDR_SN) LEFT OUTER JOIN TB_LSCT_MPNG LM ON (C.CRDN_ID = LM.CRDN_ID AND LM.DEL_YN = 'N') LEFT OUTER JOIN TB_LSCT L ON (LM.LSCT_ID = L.LSCT_ID AND L.DEL_YN = 'N') @@ -445,7 +446,7 @@ AND LM.LSCT_MPNG_ID IS NOT NULL - AND (LM.CHG_DMND_YN = 'Y' OR LM.CHG_APRV_YN = 'Y' OR C.NXRP_CRDN_LINK_YN = 'Y') + AND (LM.CHG_DMND_YN = 'Y' OR LM.CHG_APRV_YN = 'Y' OR C.NXRP_CRDN_LINK_YN = 'Y')