|
|
|
@ -18,12 +18,17 @@
|
|
|
|
|
*/
|
|
|
|
|
package testserver.wsdlserver.lvisserver;
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.logging.Logger;
|
|
|
|
|
import java.util.regex.Matcher;
|
|
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
|
|
|
|
import cokr.xit.foundation.data.DataObject;
|
|
|
|
|
import externalsystem.car.dao.CarMapper;
|
|
|
|
|
import externalsystem.testpool.dao.TestPoolMapper;
|
|
|
|
|
|
|
|
|
|
@javax.jws.WebService(name = "CarRegBasicInfo", portName = "CarRegBasicInfoPort",serviceName = "CarRegBasicInfoImplService",
|
|
|
|
|
targetNamespace = "componentNs:carregbasicinfo.reg.service.lvis/service.reg.CarRegBasicInfo",
|
|
|
|
@ -35,6 +40,9 @@ public class CarRegBasicInfoImpl implements CarRegBasicInfo {
|
|
|
|
|
@Resource(name = "carMapper")
|
|
|
|
|
private CarMapper carMapper;
|
|
|
|
|
|
|
|
|
|
@Resource(name = "testPoolMapper")
|
|
|
|
|
private TestPoolMapper testPoolMapper;
|
|
|
|
|
|
|
|
|
|
private static final Logger LOG = Logger.getLogger(CarRegBasicInfoImpl.class.getName());
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -53,6 +61,37 @@ public class CarRegBasicInfoImpl implements CarRegBasicInfo {
|
|
|
|
|
String vhrno = findRegBasicParameter.getEaiRequestRs().get(0).getVHRNO();
|
|
|
|
|
|
|
|
|
|
DataObject carInfo = carMapper.selectCar(vhrno);
|
|
|
|
|
|
|
|
|
|
if(carInfo == null && !vhrno.equals("")) {
|
|
|
|
|
if(isValidCarNumber(vhrno)) {
|
|
|
|
|
DataObject randMber = testPoolMapper.selectRandomMber();
|
|
|
|
|
DataObject randAddr= testPoolMapper.selectRandomAddr();
|
|
|
|
|
DataObject randCarBasic = testPoolMapper.selectRandomCarBasic();
|
|
|
|
|
|
|
|
|
|
Map<String, Object> params = new HashMap<String, Object>();
|
|
|
|
|
params.put("vhrno", vhrno);
|
|
|
|
|
params.put("mberSeCode", randMber.string("MBER_SE_CODE"));
|
|
|
|
|
params.put("mberNm", randMber.string("MBER_NM"));
|
|
|
|
|
params.put("mberSeNo", randMber.string("MBER_SE_NO"));
|
|
|
|
|
params.put("useStrnghldRoadNmCode", randAddr.string("ROAD_NM_CODE"));
|
|
|
|
|
params.put("useStrnghldBuldSeCode", randAddr.string("BULD_SE_CODE"));
|
|
|
|
|
params.put("useStrnghldBuldMainNo", randAddr.string("BULD_MAIN_NO"));
|
|
|
|
|
params.put("useStrnghldBuldSubNo", randAddr.string("BULD_SUB_NO"));
|
|
|
|
|
params.put("useStrnghldAdresNm", randAddr.string("ADRES_NM"));
|
|
|
|
|
params.put("cnm", randCarBasic.string("CNM"));
|
|
|
|
|
params.put("colorNm", randCarBasic.string("COLOR_NM"));
|
|
|
|
|
params.put("vhctyAsortCode", randCarBasic.string("VHCTY_ASORT_CODE"));
|
|
|
|
|
params.put("mxmmLdg", randCarBasic.string("MXMM_LDG"));
|
|
|
|
|
params.put("vin", randCarBasic.string("VIN"));
|
|
|
|
|
params.put("ersrRegistDe", randCarBasic.string("ERSR_REGIST_DE"));
|
|
|
|
|
|
|
|
|
|
int effected = carMapper.insertCar(params);
|
|
|
|
|
if(effected == 1) {
|
|
|
|
|
carInfo = carMapper.selectCar(vhrno);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(carInfo != null) {
|
|
|
|
|
frbrerr.setPROCESSIMPRTYRESNCODE("00");
|
|
|
|
|
|
|
|
|
@ -72,6 +111,7 @@ public class CarRegBasicInfoImpl implements CarRegBasicInfo {
|
|
|
|
|
frbrerr.setVIN(carInfo.string("VIN"));
|
|
|
|
|
frbrerr.setERSRREGISTDE(carInfo.string("ERSR_REGIST_DE"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
r.getEaiResponseRs().add(frbrerr);
|
|
|
|
|
return r;
|
|
|
|
|
}
|
|
|
|
@ -92,5 +132,32 @@ public class CarRegBasicInfoImpl implements CarRegBasicInfo {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static boolean isValidCarNumber(String carNum){
|
|
|
|
|
|
|
|
|
|
boolean returnValue = false;
|
|
|
|
|
|
|
|
|
|
try{
|
|
|
|
|
String regex = "^\\d{2,3}[가|나|다|라|마|거|너|더|러|머|버|서|어|저|고|노|도|로|모|보|소|오|조|구|누|두|루|무|부|수|우|주|바|사|아|자|허|배|호|하\\x20]\\d{4}/*$";
|
|
|
|
|
|
|
|
|
|
Pattern p = Pattern.compile(regex);
|
|
|
|
|
Matcher m = p.matcher(carNum);
|
|
|
|
|
if (m.matches()) {
|
|
|
|
|
returnValue = true;
|
|
|
|
|
}else{
|
|
|
|
|
//2번째 패턴 처리
|
|
|
|
|
regex = "^[서울|부산|대구|인천|대전|광주|울산|제주|경기|강원|충남|전남|전북|경남|경북|세종]{2}\\d{2}[가|나|다|라|마|거|너|더|러|머|버|서|어|저|고|노|도|로|모|보|소|오|조|구|누|두|루|무|부|수|우|주|바|사|아|자|허|배|호|하\\x20]\\d{4}$";
|
|
|
|
|
p = Pattern.compile(regex);
|
|
|
|
|
m = p.matcher(carNum);
|
|
|
|
|
if (m.matches()) {
|
|
|
|
|
returnValue = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return returnValue;
|
|
|
|
|
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|