diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnStngBean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnStngBean.java index 9bf809fa..1ee2602a 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnStngBean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnStngBean.java @@ -204,6 +204,27 @@ public class CrdnStngBean extends AbstractComponent { return amt; } + /** 차량번호로 렌트카 여부를 확인한다. + * @param vhrno 차량번호 + * @return 렌트카 여부 + */ + public boolean isRent(String vhrno) { + int len = vhrno.length(); + if(len >= 7) { + + String fifthFromLast = vhrno.substring(len-5, len-4); + + if(fifthFromLast.equals("하") + || fifthFromLast.equals("허") + || fifthFromLast.equals("호") + || fifthFromLast.equals("후")) { + return true; + } + } + + return false; + } + /** 차종과 차량번호로 영업용 차량 여부를 확인한다. * @param ffnlgCarmdlCd 차종, vhrno 차량번호 * @return 영업용 차량 여부 판단 결과 @@ -551,4 +572,6 @@ public class CrdnStngBean extends AbstractComponent { } + + } diff --git a/src/main/java/cokr/xit/fims/stat/StatQuery.java b/src/main/java/cokr/xit/fims/stat/StatQuery.java index f09df09f..63d99c6e 100644 --- a/src/main/java/cokr/xit/fims/stat/StatQuery.java +++ b/src/main/java/cokr/xit/fims/stat/StatQuery.java @@ -98,6 +98,17 @@ public class StatQuery extends CmmnQuery { */ private String carGb; + /** + * 서손자료 제외 + */ + private String schExclEnd; + + /** + * 렌트카 차량만 조회 + */ + private String schOnlyRent; + + public String getStructureType() { return ifEmpty(structureType, () -> null); } @@ -243,4 +254,22 @@ public class StatQuery extends CmmnQuery { return self(); } + public String getSchExclEnd() { + return ifEmpty(schExclEnd, () -> null); + } + + public T setSchExclEnd(String schExclEnd) { + this.schExclEnd = schExclEnd; + return self(); + } + + public String getSchOnlyRent() { + return ifEmpty(schOnlyRent, () -> null); + } + + public T setSchOnlyRent(String schOnlyRent) { + this.schOnlyRent = schOnlyRent; + return self(); + } + } diff --git a/src/main/java/cokr/xit/fims/stat/service/bean/StatServiceBean.java b/src/main/java/cokr/xit/fims/stat/service/bean/StatServiceBean.java index a3cda2b1..32142749 100644 --- a/src/main/java/cokr/xit/fims/stat/service/bean/StatServiceBean.java +++ b/src/main/java/cokr/xit/fims/stat/service/bean/StatServiceBean.java @@ -201,9 +201,18 @@ public class StatServiceBean extends AbstractServiceBean implements StatService } + //차량구분 지정 if(!ifEmpty(statQuery.getCarGb(), ()->"").equals("")) { queryResult.removeIf(item -> !(crdnStngBean.getCarGb(item.string("VHRNO")).equals(statQuery.getCarGb()))); } + //서손자료 제외 + if(!ifEmpty(statQuery.getSchExclEnd(), ()->"").equals("")) { + queryResult.removeIf(item -> item.string("CRDN_STTS_CD").equals("81")); + } + //렌트카만 조회 + if(!ifEmpty(statQuery.getSchOnlyRent(), ()->"").equals("")) { + queryResult.removeIf(item -> !crdnStngBean.isRent(item.string("VHRNO"))); + } //통계 생성 stat = statBean.groupByCartegory(queryResult, statQuery); diff --git a/src/main/webapp/WEB-INF/jsp/fims/stat/stat01010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/stat/stat01010-main.jsp index 41bb67ab..b24ac08f 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/stat/stat01010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/stat/stat01010-main.jsp @@ -379,6 +379,8 @@ $(document).ready(function(){ statQuery.lastDay = formFieldsData.lastDay; statQuery.carGb = formFieldsData.carGb; + statQuery.schExclEnd = formFieldsData.schExclEnd; + statQuery.schOnlyRent = formFieldsData.schOnlyRent; //통계 유형 var preset = $("#preset--${pageName}").find(":selected");