도로명 주소 조회 추가

master
mjkhan21 1 year ago
parent fa31643fba
commit 7430d9056c

@ -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<String, Object> params);
/** .
* @param params
* <ul><li>roadNmCd - </li>
* <li>bmno - </li>
* <li>bsno - </li>
* </ul>
* @return
*/
DataObject selectRoadNmAdres(Map<String, Object> 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)
);
}
}

@ -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<BasicInfoResponse.BasicInfo> 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();

@ -55,6 +55,8 @@ public class BasicInfoResponse extends LvisResponse {
* <li>usgsrhld_undgrnd_buld_se_code - </li>
* <li>use_strnghld_buld_main_no - </li>
* <li>use_strnghld_buld_sub_no - </li>
* <li>road_nm_adres - </li>
* <li>zip_code - </li>
* <li>mber_se_code - </li>
* <li>mber_nm - </li>
* <li>mber_se_no - </li>
@ -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;
/** 대표소유자성명 */

@ -188,6 +188,13 @@ SELECT PRYE <!-- 연식 -->
<if test='inqire_se_code == "3"'> AND VHRNO = #{vhrno}</if> <!-- 차량번호 -->
</where></select>
<select id="selectRoadNmAdres" parameterType="map" resultType="dataobject">/* vehicleInfoMapper.selectRoadNmAdres(도로명 주소 조회) */
SELECT CONCAT(CTPV_NM, ' ', SGG_NM, ' ', ROAD_NM, ' ', BMNO, '-', BSNO) ROAD_NM_ADRES, ZIP
FROM TB_ROAD_ADDR
WHERE ROAD_NM_CD = #{roadNmCd}
AND BMNO = #{bmno}
AND BSNO = #{bsno}</select>
<insert id="insertBasicInfo" parameterType="map">/* vehicleInfoMapper.insertBasicInfo(자동차 기본사항 조회 로그 등록) */
<selectKey keyProperty="info.bsc_mttr_id" resultType="string" order="BEFORE">
SELECT CONCAT(

Loading…
Cancel
Save