차량번호 체크 기능 프로젝트 이동(app-support-java)

main
이범준 2 weeks ago
parent 16fdc88bdd
commit 279895dee4

@ -16,7 +16,7 @@
<name>external-system-test</name>
<description>외부시스템 테스트</description>
<packaging>war</packaging>
<properties>
<java.version>17</java.version>
</properties>
@ -29,7 +29,7 @@
</repositories>
<dependencies>
<dependency>
<groupId>cokr.xit.base</groupId>
<artifactId>xit-foundation</artifactId>
@ -51,7 +51,13 @@
<artifactId>app-support-web</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cokr.xit.app</groupId>
<artifactId>app-support-java</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
@ -68,20 +74,20 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
@ -92,20 +98,20 @@
<artifactId>mariadb-java-client</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-spring-boot-starter-jaxws</artifactId>
<version>3.6.1</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>8.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
@ -123,7 +129,7 @@
<artifactId>jakarta.activation-api</artifactId>
<version>2.0.1</version>
</dependency>
</dependencies>
<build>

@ -15,11 +15,11 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import cokr.xit.applib.AppCmmnUtil;
import cokr.xit.foundation.data.DataObject;
import cokr.xit.foundation.web.AbstractController;
import externalsystem.car.dao.CarMapper;
import externalsystem.testpool.dao.TestPoolMapper;
import testserver.wsdlserver.lvisserver.CarRegBasicInfoImpl;
@Controller
@RequestMapping(name="행정정보공동이용시스템 연계", value="/", method = RequestMethod.POST)
@ -49,7 +49,7 @@ public class PissController extends AbstractController {
DataObject carInfo = carMapper.selectCar(vhrno);
if(carInfo == null && !vhrno.equals("")) {
if(CarRegBasicInfoImpl.isValidCarNumber(vhrno)) {
if(AppCmmnUtil.isValidCarNumber(vhrno)) {
DataObject randMber = testPoolMapper.selectRandomMber();
DataObject randAddr= testPoolMapper.selectRandomAddr();
DataObject randCarBasic = testPoolMapper.selectRandomCarBasic();

@ -21,11 +21,10 @@ 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.applib.AppCmmnUtil;
import cokr.xit.foundation.data.DataObject;
import externalsystem.car.dao.CarMapper;
import externalsystem.testpool.dao.TestPoolMapper;
@ -63,7 +62,7 @@ public class CarRegBasicInfoImpl implements CarRegBasicInfo {
DataObject carInfo = carMapper.selectCar(vhrno);
if(carInfo == null && !vhrno.equals("")) {
if(isValidCarNumber(vhrno)) {
if(AppCmmnUtil.isValidCarNumber(vhrno)) {
DataObject randMber = testPoolMapper.selectRandomMber();
DataObject randAddr= testPoolMapper.selectRandomAddr();
DataObject randCarBasic = testPoolMapper.selectRandomCarBasic();
@ -132,32 +131,6 @@ 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;
}
}
}
Loading…
Cancel
Save