From d3d2e3e9febb0d6973389e6e9d209fe0062d9875 Mon Sep 17 00:00:00 2001 From: jjh Date: Thu, 25 Jan 2024 14:38:47 +0900 Subject: [PATCH] =?UTF-8?q?=EB=82=A9=EB=B6=80=EC=9E=90=20=EC=88=98?= =?UTF-8?q?=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fims/payer/service/bean/PayerBean.java | 30 +++++++++++++++---- .../sql/mapper/fims/payer-mapper.xml | 2 +- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/main/java/cokr/xit/fims/payer/service/bean/PayerBean.java b/src/main/java/cokr/xit/fims/payer/service/bean/PayerBean.java index 0ecf90b3..29734869 100644 --- a/src/main/java/cokr/xit/fims/payer/service/bean/PayerBean.java +++ b/src/main/java/cokr/xit/fims/payer/service/bean/PayerBean.java @@ -102,6 +102,19 @@ public class PayerBean extends AbstractComponent { * */ public boolean update(Payer payer) { + DataObject params = new DataObject() + .set("roadNmCd", payer.getRoadNmCd()) + .set("udgdSeCd", payer.getUdgdSeCd()) + .set("bmno", payer.getBmno()) + .set("bsno", payer.getBsno()); + DataObject info = payerMapper.selectAddrInfo(params); + if (info != null) { + payer.setAddrSeCd("02"); + payer.setZip(info.string("ZIP")); + payer.setBldgMngNo(info.string("BLDG_MNG_NO")); + payer.setStdgCd(info.string("STDG_CD")); + payer.setDongCd(info.string("DONG_CD")); + } return payerMapper.update(payer); } @@ -149,11 +162,10 @@ public class PayerBean extends AbstractComponent { payer.setRtpyrTelno(basicInfo.getTelno()); payer.setRoadNmCd(basicInfo.getUse_strnghld_road_nm_code()); String str = basicInfo.getUsgsrhld_undgrnd_buld_se_code(); - if (str.equals("")) { + if (str.equals("")) payer.setUdgdSeCd("0"); - } else { + else payer.setUdgdSeCd(basicInfo.getUsgsrhld_undgrnd_buld_se_code()); - } str = basicInfo.getUse_strnghld_buld_main_no(); if (!isEmpty(str)) payer.setBmno(toInt(str)); @@ -173,7 +185,15 @@ public class PayerBean extends AbstractComponent { payer.setDtlAddr(basicInfo.getUse_strnghld_adres_nm()); payer.setWholAddr(basicInfo.getRoad_nm_adres() + ", " + basicInfo.getUse_strnghld_adres_nm()); - Payer result = create(payer) ? payer : getPayer(vhrno, rtpyrNo); +// Payer result = create(payer) ? payer : getPayer(vhrno, rtpyrNo); + Payer result = getPayer(vhrno, rtpyrNo); + if (isEmpty(result)) { + create(payer); // 등록 + } else { + update(payer); // 수정 + } + + result = getPayer(vhrno, rtpyrNo); if (result != null) result.setVehicleInfo(basicInfo); @@ -193,7 +213,7 @@ public class PayerBean extends AbstractComponent { * @return 단속 정보 */ public DataObject getCrdnInfo(PayerQuery req) { - DataObject dataCrdn = payerMapper.selectCrdn(req); // 단속 조회 + DataObject dataCrdn = payerMapper.selectCrdn(req); // 단속 조회 return dataCrdn; } diff --git a/src/main/resources/sql/mapper/fims/payer-mapper.xml b/src/main/resources/sql/mapper/fims/payer-mapper.xml index b3100103..77d9b49c 100644 --- a/src/main/resources/sql/mapper/fims/payer-mapper.xml +++ b/src/main/resources/sql/mapper/fims/payer-mapper.xml @@ -223,7 +223,7 @@ INSERT INTO TB_PAYER_HSTRY ( ) VALUES ( #{payer.rtpyrId} , #{historySeq} - , '41480' + , #{payer.sggCd} , #{payer.vhrno} , #{payer.rtpyrInptSeCd} , #{payer.rtpyrSeCd}