From e1e8ae6eab08e65c5e1b0a1b261470d7c149bf21 Mon Sep 17 00:00:00 2001 From: leebj Date: Thu, 26 Sep 2024 13:09:15 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B0=A8=EC=A0=81=EC=A1=B0=ED=9A=8C(=ED=96=89?= =?UTF-8?q?=EC=A0=95=EC=A0=95=EB=B3=B4=EA=B3=B5=EB=8F=99=EC=9D=B4=EC=9A=A9?= =?UTF-8?q?=EC=84=BC=ED=84=B0)=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/cokr/xit/fims/payer/Payer.java | 6 +- .../fims/payer/service/bean/PayerBean.java | 101 +++++++++++++++++- 2 files changed, 103 insertions(+), 4 deletions(-) diff --git a/src/main/java/cokr/xit/fims/payer/Payer.java b/src/main/java/cokr/xit/fims/payer/Payer.java index 97302d2f..303f274c 100644 --- a/src/main/java/cokr/xit/fims/payer/Payer.java +++ b/src/main/java/cokr/xit/fims/payer/Payer.java @@ -1,7 +1,7 @@ package cokr.xit.fims.payer; import cokr.xit.foundation.AbstractEntity; -import cokr.xit.interfaces.lvis.service.reg.BasicInfoResponse; +import cokr.xit.interfaces.lvis.service.reg.BasicInfoExtResponse.ExtInfo; import lombok.Getter; import lombok.Setter; @@ -173,8 +173,8 @@ public class Payer extends AbstractEntity { */ private String wholAddr; - /** 차량 기본정보 */ - private BasicInfoResponse.BasicInfo vehicleInfo; + /** 차량 정보 */ + private ExtInfo vehicleInfo; /**"차량번호-납부자번호"를 반환한다. * @return "차량번호-납부자번호" 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 7ea5cb17..aa86884e 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 @@ -18,7 +18,11 @@ import cokr.xit.fims.payer.dao.PayerAddrMapper; import cokr.xit.fims.payer.dao.PayerMapper; import cokr.xit.foundation.component.AbstractBean; import cokr.xit.foundation.data.DataObject; +import cokr.xit.interfaces.lvis.dao.VehicleInfoMapper; import cokr.xit.interfaces.lvis.service.bean.VehicleInfoBean; +import cokr.xit.interfaces.lvis.service.reg.BasicInfoExtRequest; +import cokr.xit.interfaces.lvis.service.reg.BasicInfoExtResponse; +import cokr.xit.interfaces.lvis.service.reg.BasicInfoExtResponse.ExtInfo; import cokr.xit.interfaces.lvis.service.reg.BasicInfoRequest; import cokr.xit.interfaces.lvis.service.reg.BasicInfoResponse; @@ -47,6 +51,9 @@ public class PayerBean extends AbstractBean { @Resource(name = "vehicleInfoBean") private VehicleInfoBean vehicleInfoBean; + @Resource(name = "vehicleInfoMapper") + private VehicleInfoMapper vehicleInfoMapper; + /** 단속 상태 이력 정보 Bean */ @Resource(name = "crdnSttsHstryBean") private CrdnSttsHstryBean crdnSttsHstryBean; @@ -215,6 +222,33 @@ public class PayerBean extends AbstractBean { .toList(); } + public List getVehicleOwners(BasicInfoExtRequest req) { + Payer payper = null; + + //차적조회 + BasicInfoExtResponse bier = vehicleInfoBean.getBasicInfo(req); + + if(bier.getRecord() != null && !bier.getRecord().isEmpty() + && bier.getRecord().get(0) != null) { + //시군구코드 세팅 + bier.getRecord().get(0).setSggCd(req.getSigungu_code()); + //주소 세팅 + DataObject roadNameInfo = vehicleInfoMapper.selectRoadNmAdres( + bier.getRecord().get(0).getUse_strnghld_road_nm_code(), + bier.getRecord().get(0).getUse_strnghld_buld_main_no(), + bier.getRecord().get(0).getUse_strnghld_buld_sub_no()); + if(!isEmpty(roadNameInfo)) { + bier.getRecord().get(0).setRoad_nm_adres(roadNameInfo.string("ROAD_NM_ADRES")); + bier.getRecord().get(0).setZip_code(roadNameInfo.string("ZIP")); + } + + //납부자조회 + payper = getPayer(bier.getRecord().get(0)); + } + + return List.of(payper); + } + /**시군구 코드와 차량 기본정보에서 납부자 정보를 생성하거나, 등록정보에서 조회하여 반환한다.(차량번호 / 납부자 번호 / 시군구 기준) * @param basicInfo 차량 기본정보 * @return 납부자 정보 @@ -272,7 +306,71 @@ public class PayerBean extends AbstractBean { Payer result = create(payer) ? payer : getPayerAddrInfo(payer); if (result != null) - result.setVehicleInfo(basicInfo); + result.setVehicleInfo((ExtInfo) basicInfo); + + return result; + } + + /**시군구 코드와 차량 기본정보에서 납부자 정보를 생성하거나, 등록정보에서 조회하여 반환한다.(차량번호 / 납부자 번호 / 시군구 기준) + * @param extInfo 차량 기본정보 + * @return 납부자 정보 + */ + private Payer getPayer(BasicInfoExtResponse.ExtInfo extInfo) { + + Payer payer = new Payer(); + + payer.setSggCd(extInfo.getSggCd()); + payer.setVhrno(extInfo.getVhrno()); + payer.setRtpyrInptSeCd("02"); + payer.setAddrInptSeCd("02"); + payer.setRtpyrSeCd( + Map.of( + "11", "01", + "12", "02", + "13", "03", + "14", "04", + "15", "05" + ).getOrDefault(extInfo.getMber_se_code(), "05") + ); + + String rtpyrNo = extInfo.getMber_se_no(); + payer.setRtpyrNo(rtpyrNo); + payer.setRtpyrNm(extInfo.getMber_nm()); + payer.setRtpyrTelno(extInfo.getTelno()); + payer.setRoadNmCd(extInfo.getUse_strnghld_road_nm_code()); + String str = extInfo.getUsgsrhld_undgrnd_buld_se_code(); + if (str.equals("")) + payer.setUdgdSeCd("0"); + else + payer.setUdgdSeCd(extInfo.getUsgsrhld_undgrnd_buld_se_code()); + str = extInfo.getUse_strnghld_buld_main_no(); + if (!isEmpty(str)) + payer.setBmno(toInt(str)); + str = extInfo.getUse_strnghld_buld_sub_no(); + if (!isEmpty(str)) + payer.setBsno(toInt(str)); + payer.setStdgCd(extInfo.getUse_strnghld_legaldong_code()); + payer.setDongCd(extInfo.getUse_strnghld_adstrd_code()); + payer.setMtnSeCd(extInfo.getUse_strnghld_mntn()); + str = extInfo.getUse_strnghld_lnbr(); + if (!isEmpty(str)) + payer.setMno(toInt(str)); + str = extInfo.getUse_strnghld_ho(); + if (!isEmpty(str)) + payer.setSno(toInt(str)); + payer.setAddr(extInfo.getRoad_nm_adres()); + payer.setDtlAddr(extInfo.getUse_strnghld_adres_nm()); + // 전체 주소 + str = extInfo.getUse_strnghld_adres_nm(); + if (!isEmpty(str)) + payer.setWholAddr(extInfo.getRoad_nm_adres() + ", " + extInfo.getUse_strnghld_adres_nm()); + else + payer.setWholAddr(extInfo.getRoad_nm_adres()); + + Payer result = create(payer) ? payer : getPayerAddrInfo(payer); + + if (result != null) + result.setVehicleInfo(extInfo); return result; } @@ -406,4 +504,5 @@ public class PayerBean extends AbstractBean { return payerAddrMapper.selectPayerAddrHstrys(req); } + }