diff --git a/src/main/java/cokr/xit/fims/stat/StatQuery.java b/src/main/java/cokr/xit/fims/stat/StatQuery.java index 32ee6f61..47e3df34 100644 --- a/src/main/java/cokr/xit/fims/stat/StatQuery.java +++ b/src/main/java/cokr/xit/fims/stat/StatQuery.java @@ -39,7 +39,12 @@ public class StatQuery extends CmmnQuery { private List numberValueInfoList; /** - * 고정 항목 ID (항목이 단일키일 경우) + * 코드 서브셋 정보 + */ + List codeSubsetInfoList; + + /** + * 고정적으로 표시할 항목 ID (항목이 단일키일 경우) */ private String[] fixedItemId; @@ -69,14 +74,20 @@ public class StatQuery extends CmmnQuery { private String dayColumn; /** - * 날짜 범위 + * 시작일자 */ - private int dayRange; + private String firstDay; /** - * 코드 서브셋 정보 + * 종료일자 */ - List codeSubsetInfoList; + private String lastDay; + + /** + * 날짜 범위 + */ + private int dayRange; + public String getStructureType() { return ifEmpty(structureType, () -> null); @@ -178,6 +189,24 @@ public class StatQuery extends CmmnQuery { return self(); } + public String getFirstDay() { + return ifEmpty(firstDay, () -> null); + } + + public T setFirstDay(String firstDay) { + this.firstDay = firstDay; + return self(); + } + + public String getLastDay() { + return ifEmpty(lastDay, () -> null); + } + + public T setLastDay(String lastDay) { + this.lastDay = lastDay; + return self(); + } + public List getCodeSubsetInfoList() { return this.codeSubsetInfoList; } diff --git a/src/main/java/cokr/xit/fims/stat/service/bean/StatBean.java b/src/main/java/cokr/xit/fims/stat/service/bean/StatBean.java index 605ac79e..bf8e030d 100644 --- a/src/main/java/cokr/xit/fims/stat/service/bean/StatBean.java +++ b/src/main/java/cokr/xit/fims/stat/service/bean/StatBean.java @@ -49,6 +49,11 @@ public class StatBean extends AbstractComponent { m1.invoke(someQuery, from); Method m2 = someQuery.getClass().getDeclaredMethod("setSchCrdnYmdTo", String.class); m2.invoke(someQuery, to); + } else if(dayCol.equals("SNDNG_YMD")) { + Method m1 = someQuery.getClass().getDeclaredMethod("setSchSndngYmdFrom", String.class); + m1.invoke(someQuery, from); + Method m2 = someQuery.getClass().getDeclaredMethod("setSchSndngYmdTo", String.class); + m2.invoke(someQuery, to); } } 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 683a1c50..2ab23a66 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 @@ -57,14 +57,20 @@ public class StatServiceBean extends AbstractServiceBean implements StatService if(statQuery.getStructureType().equals("aggregate")) { + String dayColumn = ifEmpty(statQuery.getDayColumn(), () -> ""); + String lastDay = ifEmpty(statQuery.getLastDay(), () -> ""); + String firstDay = ifEmpty(statQuery.getFirstDay(), () -> ""); + + if(!dayColumn.equals("")) { + daySetting = true; + } String[] numberValueLabel = null; - int dayRange = statQuery.getDayRange() == 0 ? 15 : statQuery.getDayRange(); - String firstDay = CmmnUtil.addDay(today, (-1 * (dayRange-1))); - String dayColumn = statQuery.getDayColumn() == null ? "REG_DT" : statQuery.getDayColumn(); + String namedNumberValueSeperator = ifEmpty(statQuery.getNamedNumberValueSeperator(), () -> ""); + + if(namedNumberValueSeperator.equals("completeAndTotal")) { //완료자료 및 전체자료 - if(statQuery.getNamedNumberValueSeperator().equals("completeAndTotal")) { //완료자료 및 전체자료 String globalAggregate = statQuery.getGlobalAggregate(); String globalSumRefCol = ifEmpty(statQuery.getGlobalSumRefCol(), () -> "") ; @@ -86,7 +92,17 @@ public class StatServiceBean extends AbstractServiceBean implements StatService daySetting = true; - } else if(statQuery.getNamedNumberValueSeperator().equals("lastFewDays")) { + } else if(namedNumberValueSeperator.equals("lastFewDays")) { + daySetting = true; + + int dayRange = statQuery.getDayRange() == 0 ? 15 : statQuery.getDayRange(); + + if(dayColumn.equals("")) { + dayColumn = "REG_DT"; + } + + lastDay = today; + firstDay = CmmnUtil.addDay(lastDay, (-1 * (dayRange-1))); String globalAggregate = statQuery.getGlobalAggregate(); @@ -113,7 +129,6 @@ public class StatServiceBean extends AbstractServiceBean implements StatService } } - daySetting = true; } String domain = ""; @@ -156,9 +171,10 @@ public class StatServiceBean extends AbstractServiceBean implements StatService CrdnQuery crdnQuery = new CrdnQuery(); crdnQuery.setSggCd(statQuery.getSggCd()); + crdnQuery.setTaskSeCd(statQuery.getTaskSeCd()); if(daySetting) { - statBean.daySetting(crdnQuery, dayColumn, firstDay, today); + statBean.daySetting(crdnQuery, dayColumn, firstDay, lastDay); } queryResult = crdnService.getCrackdownList(crdnQuery); @@ -167,18 +183,22 @@ public class StatServiceBean extends AbstractServiceBean implements StatService else if(domain.equals("sndb")) { SndbQuery sndbQuery = new SndbQuery(); + sndbQuery.setSggCd(statQuery.getSggCd()); + sndbQuery.setTaskSeCd(statQuery.getTaskSeCd()); if(daySetting) { - statBean.daySetting(sndbQuery, dayColumn, firstDay, today); + statBean.daySetting(sndbQuery, dayColumn, firstDay, lastDay); } - //queryResult = sndngService.getList(sndbQuery) + queryResult = sndngService.getSndngList(sndbQuery); } else if(domain.equals("excl")) { LevyExclQuery levyExclQuery = new LevyExclQuery(); + levyExclQuery.setSggCd(statQuery.getSggCd()); + levyExclQuery.setTaskSeCd(statQuery.getTaskSeCd()); if(daySetting) { - statBean.daySetting(levyExclQuery, dayColumn, firstDay, today); + statBean.daySetting(levyExclQuery, dayColumn, firstDay, lastDay); } //queryResult = opnnSbmsnService.getList(levyExclQuery) diff --git a/src/main/webapp/WEB-INF/jsp/include/dashboard.jsp b/src/main/webapp/WEB-INF/jsp/include/dashboard.jsp index 6289873b..71de3ad6 100644 --- a/src/main/webapp/WEB-INF/jsp/include/dashboard.jsp +++ b/src/main/webapp/WEB-INF/jsp/include/dashboard.jsp @@ -175,7 +175,7 @@ height="250" viewBox="0 0 24 24" style="fill: rgba(0, 0, 0, 1);transform: ;msFil `; fnMakeSkeleton(); -sleep(3000).then(() => fnLoadStatisticsDatas()); +sleep(3000).then(() => fnLoadStatisticsDatas($("#layout-navbar input[name='taskSeCd']:checked").val())); //데이터 로딩 전 이미지 표시 @@ -194,8 +194,10 @@ function fnMakeSkeleton(){ //통계 데이터 조회(여러 건) -function fnLoadStatisticsDatas(){ - +function fnLoadStatisticsDatas(taskSeCd){ + var lastDay = DateUtil.getDate().date.replace("-",""); + var firstDay = DateUtil.getDateDay(-14).date.replaceAll("-",""); + var mergedQuery = {}; var groupInfoList = []; @@ -212,7 +214,11 @@ function fnLoadStatisticsDatas(){ structureType : "aggregate", fixedItemId : ["01","02","minwon","dobo"], namedNumberValueSeperator : "completeAndTotal", - globalAggregate : "count" + globalAggregate : "count", + taskSeCd : taskSeCd, + dayColumn : "REG_DT", + firstDay : firstDay, + lastDay : lastDay }; groupInfoList = [ @@ -244,14 +250,18 @@ function fnLoadStatisticsDatas(){ mergedQuery = {...defaultQuery, ...queryInQuery1, ...queryInQuery3}; - fnLoadStatisticsData(mergedQuery, "card1", "progressAndTotal"); + //fnLoadStatisticsData(mergedQuery, "card1", "progressAndTotal"); //초기자료처리별 전체/완료건수 defaultQuery = { structureType : "aggregate", fixedItemId : ["등록대상","이첩대상"], namedNumberValueSeperator : "completeAndTotal", - globalAggregate : "count" + globalAggregate : "count", + taskSeCd : taskSeCd, + dayColumn : "REG_DT", + firstDay : firstDay, + lastDay : lastDay }; groupInfoList = [ @@ -273,7 +283,11 @@ function fnLoadStatisticsDatas(){ structureType : "aggregate", fixedItemId : ["01", "02", "03"], namedNumberValueSeperator : "completeAndTotal", - globalAggregate : "count" + globalAggregate : "count", + taskSeCd : taskSeCd, + dayColumn : "REG_DT", + firstDay : firstDay, + lastDay : lastDay }; groupInfoList = [ @@ -295,7 +309,11 @@ function fnLoadStatisticsDatas(){ structureType : "aggregate", fixedItemId : ["00", "acceptOrNonAccept", "03"], namedNumberValueSeperator : "completeAndTotal", - globalAggregate : "count" + globalAggregate : "count", + taskSeCd : taskSeCd, + dayColumn : "REG_DT", + firstDay : firstDay, + lastDay : lastDay }; groupInfoList = [ @@ -329,8 +347,9 @@ function fnLoadStatisticsDatas(){ fixedItemId : ["01","02","dobo","minwon"], namedNumberValueSeperator : "lastFewDays", globalAggregate : "count", - dayRange : 15, - dayColumn : "CRDN_YMD" + taskSeCd : taskSeCd, + dayColumn : "CRDN_YMD", + dayRange : 15 }; groupInfoList = [ @@ -366,8 +385,12 @@ function fnLoadStatisticsDatas(){ //초기자료처리별 건수 차트 defaultQuery = { - structureType : "aggregate", - fixedItemId : ["단속","계고","서손"] + structureType : "aggregate", + fixedItemId : ["단속","계고","서손"], + taskSeCd : taskSeCd, + dayColumn : "REG_DT", + firstDay : firstDay, + lastDay : lastDay }; groupInfoList = [ @@ -395,13 +418,17 @@ function fnLoadStatisticsDatas(){ //발송문서종류별 건수 차트 defaultQuery = { - structureType : "aggregate", - fixedItemId : ["01", "02", "03"] + structureType : "aggregate", + fixedItemId : ["01", "02", "03"], + taskSeCd : taskSeCd, + dayColumn : "SNDNG_YMD", + firstDay : firstDay, + lastDay : lastDay }; groupInfoList = [ { - refCol : "SNDNG_SE_CD", + refCol : "SNDNG_SE_CD", ctgrType : ["code"], dtlCtgr : ["FIM047"] } @@ -419,12 +446,16 @@ function fnLoadStatisticsDatas(){ mergedQuery = {...defaultQuery, ...queryInQuery1, ... queryInQuery2}; - //fnLoadStatisticsData(mergedQuery, "doughnutChart2", "doughnut"); + fnLoadStatisticsData(mergedQuery, "doughnutChart2", "doughnut"); //의견진술결과별 건수 차트 defaultQuery = { - structureType : "aggregate", - fixedItemId : ["01", "02", "03"] + structureType : "aggregate", + fixedItemId : ["01", "02", "03"], + taskSeCd : taskSeCd, + dayColumn : "REG_DT", + firstDay : firstDay, + lastDay : lastDay }; groupInfoList = [ @@ -700,7 +731,7 @@ function fnRenderDoughnut(returnData, cursor){ label: function (context) { const label = context.label || ''; const value = context.parsed; - const output = ' ' + label + ' : ' + value + ' %'; + const output = ' ' + label + ' : ' + value + ' 건'; return output; } },