시군구코드 파라미터 추가

master
mjkhan21 1 year ago
parent 7d62ad18e3
commit fa31643fba

@ -49,15 +49,22 @@ public class VehicleInfoBean extends AbstractComponent {
@Resource(name = "vehicleInfoMapper") @Resource(name = "vehicleInfoMapper")
private VehicleInfoMapper vehicleInfoMapper; private VehicleInfoMapper vehicleInfoMapper;
/** .
* @param req
* @return
*/
public BasicInfoResponse getBasicInfo(BasicInfoRequest req) { public BasicInfoResponse getBasicInfo(BasicInfoRequest req) {
try { try {
req.validate(); req.validate();
if (lvisHost.isLocal()) if (lvisHost.isLocal())
return getLocalBasicInfo(req); 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); BasicInfoResponse result = BasicInfoResponse.getResult(resp);
boolean success = result.getBasicInfo().isSuccess(); boolean success = result.getBasicInfo().isSuccess();
if (success)
result.getBasicInfo().setSggCd(req.getSggCd());
log().debug("자동차 기본정보를 {}", (success ? "찾았습니다." : "찾지 못했습니다.")); log().debug("자동차 기본정보를 {}", (success ? "찾았습니다." : "찾지 못했습니다."));
boolean keepLog = properties.getBoolean("lvis.log.basicInfo", false); boolean keepLog = properties.getBoolean("lvis.log.basicInfo", false);
@ -82,24 +89,34 @@ public class VehicleInfoBean extends AbstractComponent {
List<BasicInfoResponse.BasicInfo> list = vehicleInfoMapper.selectBasicInfo(req); List<BasicInfoResponse.BasicInfo> list = vehicleInfoMapper.selectBasicInfo(req);
boolean empty = list.isEmpty(); boolean empty = list.isEmpty();
BasicInfoResponse.BasicInfo basicInfo = !empty ? list.get(0) : new BasicInfoResponse.BasicInfo(); BasicInfoResponse.BasicInfo basicInfo = !empty ? list.get(0) : new BasicInfoResponse.BasicInfo();
if (!empty) if (!empty) {
basicInfo.setProcess_imprty_resn_code("00"); basicInfo.setProcess_imprty_resn_code("00");
basicInfo.setSggCd(req.getSggCd());
}
BasicInfoResponse response = new BasicInfoResponse(); BasicInfoResponse response = new BasicInfoResponse();
response.setBasicInfo(basicInfo); response.setBasicInfo(basicInfo);
return response; return response;
} }
public Map<String, BasicInfoResponse> getBasicInfo(List<BasicInfoRequest> reqs) { /** .
* @param reqs
* @return
*/
public List<BasicInfoResponse> getBasicInfo(List<BasicInfoRequest> reqs) {
return reqs.stream() return reqs.stream()
.map(this::getBasicInfo) .map(this::getBasicInfo)
.filter(resp -> resp.getBasicInfo().isSuccess()) .filter(resp -> resp.getBasicInfo().isSuccess())
.collect(Collectors.toMap( .collect(Collectors.groupingBy(resp -> resp.getBasicInfo().getKey()))
resp -> resp.getBasicInfo().getVhrno(), .entrySet().stream()
resp -> resp .map(entry -> entry.getValue().get(0))
)); .toList();
} }
/** () .
* @param req ()
* @return ()
*/
public FrmrWlthReadngResponse getFrmrWlthReadng(FrmrWlthReadngRequest req) { public FrmrWlthReadngResponse getFrmrWlthReadng(FrmrWlthReadngRequest req) {
try { try {
req.validate(); req.validate();
@ -114,6 +131,10 @@ public class VehicleInfoBean extends AbstractComponent {
} }
} }
/** () .
* @param req ()
* @return ()
*/
public ScldgrReadngResponse getScldgrReadng(ScldgrReadngRequest req) { public ScldgrReadngResponse getScldgrReadng(ScldgrReadngRequest req) {
try { try {
req.validate(); req.validate();
@ -128,6 +149,10 @@ public class VehicleInfoBean extends AbstractComponent {
} }
} }
/** .
* @param req
* @return
*/
public SeizureByVhrNoResponse getSeizureByVhrNo(SeizureByVhrNoRequest req) { public SeizureByVhrNoResponse getSeizureByVhrNo(SeizureByVhrNoRequest req) {
try { try {
req.validate(); req.validate();
@ -142,6 +167,10 @@ public class VehicleInfoBean extends AbstractComponent {
} }
} }
/** .
* @param req
* @return
*/
public SeizureByEttffResponse addAutoSeizureByEttff(SeizureByEttffRequest req) { public SeizureByEttffResponse addAutoSeizureByEttff(SeizureByEttffRequest req) {
try { try {
req.validate(); req.validate();
@ -156,6 +185,10 @@ public class VehicleInfoBean extends AbstractComponent {
} }
} }
/** .
* @param req
* @return
*/
public AltrtvSeizureVhrnoResponse getAltrtvSeizureVhrno(AltrtvSeizureVhrnoRequest req) { public AltrtvSeizureVhrnoResponse getAltrtvSeizureVhrno(AltrtvSeizureVhrnoRequest req) {
try { try {
req.validate(); req.validate();
@ -170,6 +203,10 @@ public class VehicleInfoBean extends AbstractComponent {
} }
} }
/** .
* @param req
* @return
*/
public CustodyTrgetResponse getCustodyTrget(CustodyTrgetRequest req) { public CustodyTrgetResponse getCustodyTrget(CustodyTrgetRequest req) {
try { try {
req.validate(); req.validate();

@ -36,6 +36,8 @@ public class BasicInfoRequest extends LvisRequest {
private String inqire_se_code; private String inqire_se_code;
/** 부과기준일자 */ /** 부과기준일자 */
private String levy_stdde; private String levy_stdde;
/** 시군구 코드 */
private String sggCd;
@Override @Override
public String getServiceID() { public String getServiceID() {

@ -302,6 +302,8 @@ public class BasicInfoResponse extends LvisResponse {
private String cbd_hg; private String cbd_hg;
/** 최초최대적재량 */ /** 최초최대적재량 */
private String frst_mxmm_ldg; private String frst_mxmm_ldg;
/** 시군구 코드 */
private String sggCd;
/** . /** .
* @param resp * @param resp
@ -398,5 +400,12 @@ public class BasicInfoResponse extends LvisResponse {
return this; return this;
} }
/**"차량번호-소유자 회원번호" .
* @return "차량번호-소유자 회원번호"
*/
public String getKey() {
return String.format("%s-%s", vhrno, mber_se_no);
}
} }
} }
Loading…
Cancel
Save