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 b1cee8f..652437d 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 @@ -49,15 +49,22 @@ public class VehicleInfoBean extends AbstractComponent { @Resource(name = "vehicleInfoMapper") private VehicleInfoMapper vehicleInfoMapper; + /**주어진 조건의 자동차 기본정보를 반환한다. + * @param req 자동차 기본정보 조회 조건 + * @return 자동차 기본정보 + */ public BasicInfoResponse getBasicInfo(BasicInfoRequest req) { try { req.validate(); if (lvisHost.isLocal()) return getLocalBasicInfo(req); - FindRegBasicReturn resp = new CarRegBasicInfoProxy(lvisHost.getAddress()).findRegBasic(req.getParams(), getRequestContext(req.getServiceID())); + 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()); log().debug("자동차 기본정보를 {}", (success ? "찾았습니다." : "찾지 못했습니다.")); boolean keepLog = properties.getBoolean("lvis.log.basicInfo", false); @@ -82,24 +89,34 @@ public class VehicleInfoBean extends AbstractComponent { List list = vehicleInfoMapper.selectBasicInfo(req); boolean empty = list.isEmpty(); BasicInfoResponse.BasicInfo basicInfo = !empty ? list.get(0) : new BasicInfoResponse.BasicInfo(); - if (!empty) + if (!empty) { basicInfo.setProcess_imprty_resn_code("00"); + basicInfo.setSggCd(req.getSggCd()); + } BasicInfoResponse response = new BasicInfoResponse(); response.setBasicInfo(basicInfo); return response; } - public Map getBasicInfo(List reqs) { + /**주어진 조건의 자동차 기본정보들을 반환한다. + * @param reqs 자동차 기본정보 조회 조건 + * @return 자동차 기본정보 + */ + public List getBasicInfo(List reqs) { return reqs.stream() .map(this::getBasicInfo) .filter(resp -> resp.getBasicInfo().isSuccess()) - .collect(Collectors.toMap( - resp -> resp.getBasicInfo().getVhrno(), - resp -> resp - )); + .collect(Collectors.groupingBy(resp -> resp.getBasicInfo().getKey())) + .entrySet().stream() + .map(entry -> entry.getValue().get(0)) + .toList(); } + /**주어진 조건의 자동차 등록원부(갑)를 반환한다. + * @param req 자동차 등록원부(갑) 조회 조건 + * @return 자동차 등록원부(갑) + */ public FrmrWlthReadngResponse getFrmrWlthReadng(FrmrWlthReadngRequest req) { try { req.validate(); @@ -114,6 +131,10 @@ public class VehicleInfoBean extends AbstractComponent { } } + /**주어진 조건의 자동차 등록원부(을)를 반환한다. + * @param req 자동차 등록원부(을) 조회 조건 + * @return 자동차 등록원부(을) + */ public ScldgrReadngResponse getScldgrReadng(ScldgrReadngRequest req) { try { req.validate(); @@ -128,6 +149,10 @@ public class VehicleInfoBean extends AbstractComponent { } } + /**주어진 조건의 압류내역을 반환한다. + * @param req 압류내역 조회 조건 + * @return 압류내역 + */ public SeizureByVhrNoResponse getSeizureByVhrNo(SeizureByVhrNoRequest req) { try { req.validate(); @@ -142,6 +167,10 @@ public class VehicleInfoBean extends AbstractComponent { } } + /**주어진 압류내역을 등록한다. + * @param req 등록할 압류내역 + * @return 압류내역 등록 결과 + */ public SeizureByEttffResponse addAutoSeizureByEttff(SeizureByEttffRequest req) { try { req.validate(); @@ -156,6 +185,10 @@ public class VehicleInfoBean extends AbstractComponent { } } + /**주어진 조건의 대체압류차량 정보를 반환한다. + * @param req 대체압류차량 조회조건 + * @return 대체압류차량 정보 + */ public AltrtvSeizureVhrnoResponse getAltrtvSeizureVhrno(AltrtvSeizureVhrnoRequest req) { try { req.validate(); @@ -170,6 +203,10 @@ public class VehicleInfoBean extends AbstractComponent { } } + /**주어진 조건의 번호판 영치대상 정보를 반환한다. + * @param req 번호판 영치대상 조회조건 + * @return 번호판 영치대상 정보 + */ public CustodyTrgetResponse getCustodyTrget(CustodyTrgetRequest req) { try { req.validate(); diff --git a/src/main/java/cokr/xit/interfaces/lvis/service/reg/BasicInfoRequest.java b/src/main/java/cokr/xit/interfaces/lvis/service/reg/BasicInfoRequest.java index c4b3624..0f615e0 100644 --- a/src/main/java/cokr/xit/interfaces/lvis/service/reg/BasicInfoRequest.java +++ b/src/main/java/cokr/xit/interfaces/lvis/service/reg/BasicInfoRequest.java @@ -36,6 +36,8 @@ public class BasicInfoRequest extends LvisRequest { private String inqire_se_code; /** 부과기준일자 */ private String levy_stdde; + /** 시군구 코드 */ + private String sggCd; @Override public String getServiceID() { 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 aa036a8..20addef 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 @@ -302,6 +302,8 @@ public class BasicInfoResponse extends LvisResponse { private String cbd_hg; /** 최초최대적재량 */ private String frst_mxmm_ldg; + /** 시군구 코드 */ + private String sggCd; /**자동차 기본정보 조회 결과를 설정한다. * @param resp 자동차 기본정보 조회 결과 @@ -398,5 +400,12 @@ public class BasicInfoResponse extends LvisResponse { return this; } + + /**"차량번호-소유자 회원번호"를 반환한다. + * @return "차량번호-소유자 회원번호" + */ + public String getKey() { + return String.format("%s-%s", vhrno, mber_se_no); + } } } \ No newline at end of file