From 246aeed494063b70ec85124a8a1631cb22dcf877 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Mon, 6 Nov 2023 16:35:09 +0900 Subject: [PATCH] =?UTF-8?q?=ED=86=B5=EA=B3=84=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xit/fims/stat/service/bean/StatBean.java | 8 +- .../webapp/WEB-INF/jsp/include/dashboard.jsp | 93 ++++++++++++++----- 2 files changed, 75 insertions(+), 26 deletions(-) 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 8d506762..96992679 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 @@ -96,7 +96,7 @@ public class StatBean extends AbstractComponent { //고정 항목 설정 if(statQuery.getFixedItemId() != null) { - this.itemFix(group, statQuery.getFixedItemId()); + this.itemFix(group, statQuery); } //수치 값 추출 @@ -211,10 +211,12 @@ public class StatBean extends AbstractComponent { } /** 통계에 고정적으로 표시할 항목을 설정한다. - * @param group 그룹핑한 데이터 목록, fixedItemId 고정적으로 표시할 통계 항목 ID; + * @param group 그룹핑한 데이터 목록, statQuery 통계 요청; * @return */ - public void itemFix(Map> group, String[] fixedItemId) { + public void itemFix(Map> group, StatQuery statQuery) { + + String[] fixedItemId = statQuery.getFixedItemId(); for(int i=0; i < fixedItemId.length; i++) { if(!group.containsKey(fixedItemId[i])) { diff --git a/src/main/webapp/WEB-INF/jsp/include/dashboard.jsp b/src/main/webapp/WEB-INF/jsp/include/dashboard.jsp index 54190172..0e8d4cfd 100644 --- a/src/main/webapp/WEB-INF/jsp/include/dashboard.jsp +++ b/src/main/webapp/WEB-INF/jsp/include/dashboard.jsp @@ -174,8 +174,10 @@ height="250" viewBox="0 0 24 24" style="fill: rgba(0, 0, 0, 1);transform: ;msFil `; +var statReqArr = []; + fnMakeSkeleton(); -sleep(3000).then(() => fnLoadStatisticsDatas($("#layout-navbar input[name='taskSeCd']:checked").val())); +sleep(3000).then(() => fnMakeStatReq($("#layout-navbar input[name='taskSeCd']:checked").val())); //데이터 로딩 전 이미지 표시 @@ -193,8 +195,8 @@ function fnMakeSkeleton(){ } -//통계 데이터 조회(여러 건) -function fnLoadStatisticsDatas(taskSeCd){ +//통계 요청 데이터 생성(여러 건) +function fnMakeStatReq(taskSeCd){ var lastDay = DateUtil.getDate().date.replace("-",""); var firstDay = DateUtil.getDateDay(-14).date.replaceAll("-",""); @@ -211,7 +213,7 @@ function fnLoadStatisticsDatas(taskSeCd){ //단속구분별 전체/완료 건수 defaultQuery = { - structureType : "aggregate", + structureType : "dummy", fixedItemId : ["01","02","minwon","dobo"], namedNumberValueSeperator : "completeAndTotal", globalAggregate : "count", @@ -250,11 +252,16 @@ function fnLoadStatisticsDatas(taskSeCd){ mergedQuery = {...defaultQuery, ...queryInQuery1, ...queryInQuery3}; - //fnLoadStatisticsData(mergedQuery, "card1", "progressAndTotal"); + + statReqArr.push({ + query : mergedQuery, + cursor : "card1", + statType : "progressAndTotal" + }); //초기자료처리별 전체/완료건수 defaultQuery = { - structureType : "aggregate", + structureType : "dummy", fixedItemId : ["등록대상","이첩대상"], namedNumberValueSeperator : "completeAndTotal", globalAggregate : "count", @@ -276,11 +283,15 @@ function fnLoadStatisticsDatas(taskSeCd){ mergedQuery = {...defaultQuery, ...queryInQuery1 }; - //fnLoadStatisticsData(mergedQuery, "card2", "progressAndTotal"); + statReqArr.push({ + query : mergedQuery, + cursor : "card2", + statType : "progressAndTotal" + }); //발송문서별 전체/완료 건수 defaultQuery = { - structureType : "aggregate", + structureType : "dummy", fixedItemId : ["01", "02", "03"], namedNumberValueSeperator : "completeAndTotal", globalAggregate : "count", @@ -302,11 +313,15 @@ function fnLoadStatisticsDatas(taskSeCd){ mergedQuery = {...defaultQuery, ...queryInQuery1 }; - //fnLoadStatisticsData(mergedQuery, "card3" , "progressAndTotal"); + statReqArr.push({ + query : mergedQuery, + cursor : "card3", + statType : "progressAndTotal" + }); //의견진술자료상태 defaultQuery = { - structureType : "aggregate", + structureType : "dummy", fixedItemId : ["00", "acceptOrNonAccept", "03"], namedNumberValueSeperator : "completeAndTotal", globalAggregate : "count", @@ -339,8 +354,12 @@ function fnLoadStatisticsDatas(taskSeCd){ mergedQuery = {...defaultQuery, ...queryInQuery1, ...queryInQuery3}; - //fnLoadStatisticsData(mergedQuery, "card4" , "progressAndTotal"); - + statReqArr.push({ + query : mergedQuery, + cursor : "card4", + statType : "progressAndTotal" + }); + //단속구분별 최근n일 건수 defaultQuery = { structureType : "aggregate", @@ -381,16 +400,20 @@ function fnLoadStatisticsDatas(taskSeCd){ mergedQuery = {...defaultQuery, ...queryInQuery1, ...queryInQuery3}; - fnLoadStatisticsData(mergedQuery, "lineChart", "line"); + statReqArr.push({ + query : mergedQuery, + cursor : "lineChart", + statType : "line" + }); //초기자료처리별 건수 차트 defaultQuery = { - structureType : "aggregate", + structureType : "dummy", fixedItemId : ["단속","계고","서손"], taskSeCd : taskSeCd, dayColumn : "REG_DT", firstDay : firstDay, - lastDay : lastDay + lastDay : firstDay }; groupInfoList = [ @@ -414,7 +437,11 @@ function fnLoadStatisticsDatas(taskSeCd){ mergedQuery = {...defaultQuery, ...queryInQuery1, ...queryInQuery2 }; - //fnLoadStatisticsData(mergedQuery, "doughnutChart1", "doughnut"); + statReqArr.push({ + query : mergedQuery, + cursor : "doughnutChart1", + statType : "doughnut" + }); //발송문서종류별 건수 차트 defaultQuery = { @@ -423,7 +450,7 @@ function fnLoadStatisticsDatas(taskSeCd){ taskSeCd : taskSeCd, dayColumn : "SNDNG_YMD", firstDay : firstDay, - lastDay : lastDay + lastDay : firstDay }; groupInfoList = [ @@ -446,7 +473,11 @@ function fnLoadStatisticsDatas(taskSeCd){ mergedQuery = {...defaultQuery, ...queryInQuery1, ... queryInQuery2}; - fnLoadStatisticsData(mergedQuery, "doughnutChart2", "doughnut"); + statReqArr.push({ + query : mergedQuery, + cursor : "doughnutChart2", + statType : "doughnut" + }); //의견진술결과별 건수 차트 defaultQuery = { @@ -455,7 +486,7 @@ function fnLoadStatisticsDatas(taskSeCd){ taskSeCd : taskSeCd, dayColumn : "REG_DT", firstDay : firstDay, - lastDay : lastDay + lastDay : firstDay }; groupInfoList = [ @@ -478,19 +509,35 @@ function fnLoadStatisticsDatas(taskSeCd){ mergedQuery = {...defaultQuery, ...queryInQuery1, ...queryInQuery2 }; - fnLoadStatisticsData(mergedQuery, "doughnutChart3", "doughnut"); + statReqArr.push({ + query : mergedQuery, + cursor : "doughnutChart3", + statType : "doughnut" + }); + + fnLoadStatisticsData(); } //통계 데이터 조회 -function fnLoadStatisticsData(queryParam, cursor, statType){ +function fnLoadStatisticsData(){ + var statArr = statReqArr.pop(); + ajax.get({ url : wctx.url("/stat/stat01/010/info.do"), - data : queryParam, + data : statArr.query, success : (resp) => { var statData = resp.stat; - fnRenderDashboardContents(statData, cursor , statType); + + if(statData != null && statData.statItems != null){ + fnRenderDashboardContents(statData, statArr.cursor , statArr.statType); + } + + if(statReqArr.length != 0){ + fnLoadStatisticsData(); + } } }); + } //대시보드 콘텐츠 표시