From 7430d9056ce61b1d30fd4ef6526b6f844af29090 Mon Sep 17 00:00:00 2001 From: mjkhan21 Date: Thu, 14 Sep 2023 16:21:55 +0900 Subject: [PATCH] =?UTF-8?q?=EB=8F=84=EB=A1=9C=EB=AA=85=20=EC=A3=BC?= =?UTF-8?q?=EC=86=8C=20=EC=A1=B0=ED=9A=8C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lvis/dao/VehicleInfoMapper.java | 28 ++++++++++++++++++- .../lvis/service/bean/VehicleInfoBean.java | 24 +++++++++++++--- .../lvis/service/reg/BasicInfoResponse.java | 6 ++++ .../sql/mapper/lvis/vehicleInfo-mapper.xml | 7 +++++ 4 files changed, 60 insertions(+), 5 deletions(-) diff --git a/src/main/java/cokr/xit/interfaces/lvis/dao/VehicleInfoMapper.java b/src/main/java/cokr/xit/interfaces/lvis/dao/VehicleInfoMapper.java index 9cfbb8f..862a797 100644 --- a/src/main/java/cokr/xit/interfaces/lvis/dao/VehicleInfoMapper.java +++ b/src/main/java/cokr/xit/interfaces/lvis/dao/VehicleInfoMapper.java @@ -5,6 +5,8 @@ import java.util.Map; import org.egovframe.rte.psl.dataaccess.mapper.Mapper; +import cokr.xit.foundation.component.AbstractMapper; +import cokr.xit.foundation.data.DataObject; import cokr.xit.interfaces.lvis.service.reg.BasicInfoRequest; import cokr.xit.interfaces.lvis.service.reg.BasicInfoResponse; @@ -12,7 +14,7 @@ import cokr.xit.interfaces.lvis.service.reg.BasicInfoResponse; * @author mjkhan */ @Mapper("vehicleInfoMapper") -public interface VehicleInfoMapper { +public interface VehicleInfoMapper extends AbstractMapper { /** * @param req * @return @@ -28,4 +30,28 @@ public interface VehicleInfoMapper { * @return 등록된 정보 수 */ int insertBasicInfo(Map params); + + /**도로명 주소를 조회한다. + * @param params 파라미터 + * + * @return 도로명 주소 + */ + DataObject selectRoadNmAdres(Map params); + + /**도로명 주소를 조회한다. + * @param roadNmCd 도로명 코드 + * @param bmno 본번 + * @param bsno 부번 + * @return 도로명 주소 + */ + default DataObject selectRoadNmAdres(String roadNmCd, String bmno, String bsno) { + return selectRoadNmAdres(params() + .set("roadNmCd", roadNmCd) + .set("bmno", bmno) + .set("bsno", bsno) + ); + } } \ No newline at end of file diff --git a/src/main/java/cokr/xit/interfaces/lvis/service/bean/VehicleInfoBean.java b/src/main/java/cokr/xit/interfaces/lvis/service/bean/VehicleInfoBean.java index 652437d..3995b48 100644 --- a/src/main/java/cokr/xit/interfaces/lvis/service/bean/VehicleInfoBean.java +++ b/src/main/java/cokr/xit/interfaces/lvis/service/bean/VehicleInfoBean.java @@ -10,6 +10,7 @@ import org.springframework.stereotype.Component; import cokr.xit.foundation.AbstractComponent; import cokr.xit.foundation.ApplicationException; +import cokr.xit.foundation.data.DataObject; import cokr.xit.interfaces.lvis.dao.VehicleInfoMapper; import cokr.xit.interfaces.lvis.service.reg.BasicInfoRequest; import cokr.xit.interfaces.lvis.service.reg.BasicInfoResponse; @@ -62,9 +63,11 @@ public class VehicleInfoBean extends AbstractComponent { FindRegBasicReturn resp = new CarRegBasicInfoProxy(lvisHost.getAddress()) .findRegBasic(req.getParams(), getRequestContext(req.getServiceID())); BasicInfoResponse result = BasicInfoResponse.getResult(resp); - boolean success = result.getBasicInfo().isSuccess(); - if (success) - result.getBasicInfo().setSggCd(req.getSggCd()); + BasicInfoResponse.BasicInfo basicInfo = result.getBasicInfo(); + boolean success = basicInfo.isSuccess(); + if (success) { + setRoadNameInfo(req, basicInfo); + } log().debug("자동차 기본정보를 {}", (success ? "찾았습니다." : "찾지 못했습니다.")); boolean keepLog = properties.getBoolean("lvis.log.basicInfo", false); @@ -85,13 +88,26 @@ public class VehicleInfoBean extends AbstractComponent { } } + private void setRoadNameInfo(BasicInfoRequest req, BasicInfoResponse.BasicInfo basicInfo) { + basicInfo.setSggCd(req.getSggCd()); + DataObject roadNameInfo = vehicleInfoMapper.selectRoadNmAdres( + basicInfo.getUse_strnghld_road_nm_code(), + basicInfo.getUse_strnghld_buld_main_no(), + basicInfo.getUse_strnghld_buld_sub_no() + ); + if (!isEmpty(roadNameInfo)) { + basicInfo.setRoad_nm_adres(roadNameInfo.string("ROAD_NM_ADRES")); + basicInfo.setZip_code(roadNameInfo.string("ZIP")); + } + } + private BasicInfoResponse getLocalBasicInfo(BasicInfoRequest req) { List list = vehicleInfoMapper.selectBasicInfo(req); boolean empty = list.isEmpty(); BasicInfoResponse.BasicInfo basicInfo = !empty ? list.get(0) : new BasicInfoResponse.BasicInfo(); if (!empty) { basicInfo.setProcess_imprty_resn_code("00"); - basicInfo.setSggCd(req.getSggCd()); + setRoadNameInfo(req, basicInfo); } BasicInfoResponse response = new BasicInfoResponse(); diff --git a/src/main/java/cokr/xit/interfaces/lvis/service/reg/BasicInfoResponse.java b/src/main/java/cokr/xit/interfaces/lvis/service/reg/BasicInfoResponse.java index 20addef..67eee77 100644 --- a/src/main/java/cokr/xit/interfaces/lvis/service/reg/BasicInfoResponse.java +++ b/src/main/java/cokr/xit/interfaces/lvis/service/reg/BasicInfoResponse.java @@ -55,6 +55,8 @@ public class BasicInfoResponse extends LvisResponse { *
  • usgsrhld_undgrnd_buld_se_code - 사용본거지지하건물구분코드
  • *
  • use_strnghld_buld_main_no - 사용본거지건물주요번호
  • *
  • use_strnghld_buld_sub_no - 사용본거지건물부번호
  • + *
  • road_nm_adres - 도로명 주소
  • + *
  • zip_code - 우편번호
  • *
  • mber_se_code - 대표소유자회원구분코드
  • *
  • mber_nm - 대표소유자성명
  • *
  • mber_se_no - 대표소유자회원번호
  • @@ -166,6 +168,10 @@ public class BasicInfoResponse extends LvisResponse { private String use_strnghld_buld_main_no; /** 사용본거지건물부번호 */ private String use_strnghld_buld_sub_no; + /** 도로명 주소 */ + private String road_nm_adres; + /** 우편번호 */ + private String zip_code; /** 대표소유자회원구분코드 */ private String mber_se_code; /** 대표소유자성명 */ diff --git a/src/main/resources/sql/mapper/lvis/vehicleInfo-mapper.xml b/src/main/resources/sql/mapper/lvis/vehicleInfo-mapper.xml index a682c92..70fa341 100644 --- a/src/main/resources/sql/mapper/lvis/vehicleInfo-mapper.xml +++ b/src/main/resources/sql/mapper/lvis/vehicleInfo-mapper.xml @@ -188,6 +188,13 @@ SELECT PRYE AND VHRNO = #{vhrno} + + /* vehicleInfoMapper.insertBasicInfo(자동차 기본사항 조회 로그 등록) */ SELECT CONCAT(