통계 수정

main
이범준 1 year ago
parent 2a12a67278
commit 24a53a263d

@ -16,6 +16,7 @@ import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.regex.Pattern;
import java.util.stream.Collectors; import java.util.stream.Collectors;
public class CmmnUtil { public class CmmnUtil {
@ -34,6 +35,16 @@ public class CmmnUtil {
return str; return str;
} }
public static boolean isNumeric(String str) {
String REGEXP_PATTERN_NUMBER = "^[\\d]*$";
return Pattern.matches(REGEXP_PATTERN_NUMBER, str);
}
public static boolean isKorean(String str) {
String REGEXP_PATTERN_KOR = "^[가-힣]*$";
return Pattern.matches(REGEXP_PATTERN_KOR, str);
}
/** /**
* substring * substring
* *

@ -7,6 +7,7 @@ import javax.annotation.Resource;
import org.assertj.core.util.Arrays; import org.assertj.core.util.Arrays;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.ExmptnVhcl; import cokr.xit.fims.crdn.ExmptnVhcl;
@ -224,6 +225,161 @@ public class CrdnStngBean extends AbstractComponent {
} }
/** .
* @param vhrno
* @return
*/
public String getCarGb(String vhrno) {
if(vhrno.equals("")) {
return "차량번호 없음";
}
boolean first3isNumber = CmmnUtil.isNumeric(vhrno.substring(0, 3));
if(first3isNumber) {
int first3 = Integer.parseInt(vhrno.substring(0, 3));
if(first3 >= 0 && first3 <= 99) {
return "중기";
} else if(first3 >= 100 && first3 <= 997) {
return "일반";
} else if(first3 >= 998 && first3 <= 999) {
return "기타";
}
}
if(!(this.getHeavyEquipmentCarkind(vhrno).equals(""))) {
return "중기";
}
if(vhrno.contains("외교")) {
return "외교";
}
if(vhrno.contains("준외")) {
return "준외";
}
if(vhrno.contains("영사")) {
return "영사";
}
if(vhrno.contains("준영")) {
return "준영";
}
if(vhrno.contains("국기") || vhrno.contains("협정") || vhrno.contains("대표") || vhrno.contains("외빈")) {
return "국제";
}
if(vhrno.substring(0,1).equals("임")) {
return "임시";
}
if(vhrno.length() == 7
&& vhrno.substring(0, 3).equals("16다")
&& CmmnUtil.isNumeric(vhrno.substring(3, 7))) {
return "미군";
}
if(vhrno.length() == 10
&& this.isBiefSidoName(vhrno.substring(0, 2))
&& CmmnUtil.isNumeric(vhrno.substring(2, 5))
&& vhrno.substring(5, 6).equals("-")
&& CmmnUtil.isNumeric(vhrno.substring(6, 10))) {
return "미군";
}
int vhrnoLength = vhrno.length();
if(this.isBiefSidoName(vhrno.substring(0, 2))) {
//서울 0 가 0000
//서울 00 가 0000
//서울 중 가 0000
//서울 마포 가 0000
//서울 영등포 가 0000
if(vhrnoLength >= 8 && vhrnoLength <= 10) {
String suffix1 = vhrno.substring(vhrnoLength-5, vhrnoLength-4);
String suffix2 = vhrno.substring(vhrnoLength-4);
String middle = vhrno.substring(2, vhrnoLength-5);
if(CmmnUtil.isKorean(suffix1) && CmmnUtil.isNumeric(suffix2)) {
if(CmmnUtil.isNumeric(middle) && (middle.length() == 1 || middle.length() == 2)) {
return "일반";
}
if(CmmnUtil.isKorean(middle) && (middle.length() >= 1 && middle.length() <= 3)) {
return "일반";
}
}
}
} else {
//00가0000
if(vhrnoLength == 7
&& CmmnUtil.isNumeric(vhrno.substring(0, 2))
&& CmmnUtil.isKorean(vhrno.substring(2, 3))
&& CmmnUtil.isNumeric(vhrno.substring(3, 7))) {
return "일반";
}
}
return "";
}
public String getHeavyEquipmentCarkind(String vhrno) {
if(this.isBiefSidoName(vhrno.substring(0, 2))
&& CmmnUtil.isKorean(vhrno.substring(4, 5))
&& CmmnUtil.isNumeric(vhrno.substring(5, 9))
) {
switch(vhrno.substring(2, 4)) {
case "01" : return "불도저";
case "02" : return "굴삭기";
case "03" : return "로더";
case "04" : return "지게차";
case "05" : return "스크레이퍼";
case "06" : return "덤프트럭";
case "07" : return "기중기";
case "08" : return "콘크리트믹서트럭";
case "14" :
if(!vhrno.substring(4,5).equals("허")) {
return "콘크리트믹서트럭";
}
}
switch(vhrno.substring(2, 5)) {
case "26거" : return "도로보수트럭";
case "26너" : return "노면파쇄기";
case "26버" : return "터널고소용자동차";
case "26어" : return "수목이식기";
}
}
return "";
}
public boolean isBiefSidoName(String str) {
String[] sidoNames = {
"서울","대전","대구","부산","광주","인천","울산","세종",
"경기","강원","충북","충남","전북","전남","경북","경남","제주"
};
if(Arrays.asList(sidoNames).contains(str)) {
return true;
} else {
return false;
}
}
/** . /** .
* @param query * @param query
* @return * @return

@ -232,6 +232,11 @@ public class StatBean extends AbstractComponent {
String vhrno = item.string("VHRNO"); String vhrno = item.string("VHRNO");
key = crdnStngBean.getBusinessYnOfCar(ffnlgCarmdlCd, vhrno); key = crdnStngBean.getBusinessYnOfCar(ffnlgCarmdlCd, vhrno);
} else if(addOption.equals("carGb")){
String vhrno = item.string("VHRNO");
key = crdnStngBean.getCarGb(vhrno);
} else { } else {
key = colValue; key = colValue;
} }

@ -22,17 +22,17 @@
</div> </div>
<div class="col-6"> <div class="col-6">
<label class="form-label fw-bold form-search-title text-end">차량구분</label> <label class="form-label fw-bold form-search-title text-end">차량구분</label>
<select name="carSe" class="form-select"> <select name="carGb" class="form-select">
<option value="">전체</option> <option value="">전체</option>
<option value="일반">일반</option> <option value="일반">일반</option>
<option value="중기">중기</option> <option value="중기">중기</option>
<option value="임시">임시</option> <option value="임시">임시</option>
<option value="외교">외교</option> <option value="외교">외교</option>
<option value="준외">준외</option>
<option value="영사">영사</option> <option value="영사">영사</option>
<option value="준영">준영</option> <option value="준영">준영</option>
<option value="미군">미군</option>
<option value="국제">국제</option> <option value="국제">국제</option>
<option value="준외">준외</option> <option value="미군">미군</option>
<option value="기타">기타</option> <option value="기타">기타</option>
</select> </select>
</div> </div>
@ -106,8 +106,8 @@
<option value="businessCar" <option value="businessCar"
data-ref-col="" data-ctgr-type="method" data-dtl-ctgr="businessYnOfCar" data-ref-col="" data-ctgr-type="method" data-dtl-ctgr="businessYnOfCar"
>사업용차량구분</option> >사업용차량구분</option>
<option value="carSe" <option value="carGb"
data-ref-col="" data-ctgr-type="" data-dtl-ctgr="" data-ref-col="" data-ctgr-type="method" data-dtl-ctgr="carGb"
>차량구분</option> >차량구분</option>
</datalist> </datalist>

@ -22,17 +22,17 @@
</div> </div>
<div class="col-6"> <div class="col-6">
<label class="form-label fw-bold form-search-title text-end">차량구분</label> <label class="form-label fw-bold form-search-title text-end">차량구분</label>
<select name="carSe" class="form-select"> <select name="carGb" class="form-select">
<option value="">전체</option> <option value="">전체</option>
<option value="일반">일반</option> <option value="일반">일반</option>
<option value="중기">중기</option> <option value="중기">중기</option>
<option value="임시">임시</option> <option value="임시">임시</option>
<option value="외교">외교</option> <option value="외교">외교</option>
<option value="준외">준외</option>
<option value="영사">영사</option> <option value="영사">영사</option>
<option value="준영">준영</option> <option value="준영">준영</option>
<option value="미군">미군</option>
<option value="국제">국제</option> <option value="국제">국제</option>
<option value="준외">준외</option> <option value="미군">미군</option>
<option value="기타">기타</option> <option value="기타">기타</option>
</select> </select>
</div> </div>
@ -97,8 +97,8 @@
<option value="businessCar" <option value="businessCar"
data-ref-col="" data-ctgr-type="method" data-dtl-ctgr="businessYnOfCar" data-ref-col="" data-ctgr-type="method" data-dtl-ctgr="businessYnOfCar"
>사업용차량구분</option> >사업용차량구분</option>
<option value="carSe" <option value="carGb"
data-ref-col="" data-ctgr-type="" data-dtl-ctgr="" data-ref-col="" data-ctgr-type="method" data-dtl-ctgr="carGb"
>차량구분</option> >차량구분</option>
</datalist> </datalist>
@ -110,3 +110,5 @@
>전체건수,총금액,부과필요건수,부과유예건수,의견진술수용건수,경찰서이첩건수,서손건수,면제차량건수,부과건수,부과금액,징수건수,징수금액,감액건수,감액금액,미납건수,미납금액 >전체건수,총금액,부과필요건수,부과유예건수,의견진술수용건수,경찰서이첩건수,서손건수,면제차량건수,부과건수,부과금액,징수건수,징수금액,감액건수,감액금액,미납건수,미납금액
</option> </option>
</datalist> </datalist>
<script src="<c:url value="/resources/js/fims/stat/sprtPreset.js?${ver}"/>"></script>

@ -0,0 +1,4 @@
var ffnlgCarmdlCd_codeSubsetInfoList = [
{ sourceGroup : "FIM009", sourceCodes : ["15","21"],
targetCode : "etc", targetCodeVal : "특수,건설기계" }
];
Loading…
Cancel
Save