대시보드 수정

main
이범준 1 year ago
parent defff182f2
commit e94ecffb9b

@ -200,21 +200,34 @@ function fnMakeStatReq(taskSeCd){
var lastDay = DateUtil.getDate().date.replace("-",""); var lastDay = DateUtil.getDate().date.replace("-","");
var firstDay = DateUtil.getDateDay(-14).date.replaceAll("-",""); var firstDay = DateUtil.getDateDay(-14).date.replaceAll("-","");
var mergedQuery = {};
var groupInfoList = [];
var numberValueInfoList = [];
var codeSubsetInfoList = [];
var defaultQuery = {}; var defaultQuery = {};
var queryInQuery1 = {};
var queryInQuery2 = {};
var queryInQuery3 = {};
//단속구분별 전체/완료 건수 //단속구분별 전체/완료 건수
defaultQuery = { defaultQuery = {
structureType : "dummy", structureType : "dummy",
statDomain : "crdn", statDomain : "crdn",
groupInfoList : [
{
refCol : "CRDN_SE_CD",
ctgrType : ["code"],
dtlCtgr : ["FIM002"]
}
],
codeSubsetInfoList : [
{
sourceGroup : "FIM002",
sourceCodes : ["08","09","10","11"],
targetCode : "minwon",
targetCodeVal : "민원"
},
{
sourceGroup : "FIM002",
sourceCodes : ["06","13"],
targetCode : "dobo",
targetCodeVal : "도보"
}
],
fixedItemId : ["01","02","minwon","dobo"], fixedItemId : ["01","02","minwon","dobo"],
namedNumberValueSeperator : "completeAndTotal", namedNumberValueSeperator : "completeAndTotal",
globalAggregate : "count", globalAggregate : "count",
@ -224,38 +237,12 @@ function fnMakeStatReq(taskSeCd){
lastDay : lastDay lastDay : lastDay
}; };
groupInfoList = [ defaultQuery = fnJsonToFormData(defaultQuery, "groupInfoList");
{ defaultQuery = fnJsonToFormData(defaultQuery, "numberValueInfoList");
refCol : "CRDN_SE_CD", defaultQuery = fnJsonToFormData(defaultQuery, "codeSubsetInfoList");
ctgrType : ["code"],
dtlCtgr : ["FIM002"]
}
];
queryInQuery1 = fnJsonArrayToFormData(groupInfoList, "groupInfoList");
codeSubsetInfoList = [
{
sourceGroup : "FIM002",
sourceCodes : ["08","09","10","11"],
targetCode : "minwon",
targetCodeVal : "민원"
},
{
sourceGroup : "FIM002",
sourceCodes : ["06","13"],
targetCode : "dobo",
targetCodeVal : "도보"
}
];
queryInQuery3 = fnJsonArrayToFormData(codeSubsetInfoList, "codeSubsetInfoList");
mergedQuery = {...defaultQuery, ...queryInQuery1, ...queryInQuery3};
statReqArr.push({ statReqArr.push({
query : mergedQuery, query : defaultQuery,
cursor : "card1", cursor : "card1",
statType : "progressAndTotal" statType : "progressAndTotal"
}); });
@ -264,6 +251,13 @@ function fnMakeStatReq(taskSeCd){
defaultQuery = { defaultQuery = {
structureType : "dummy", structureType : "dummy",
statDomain : "crdn", statDomain : "crdn",
groupInfoList : [
{
refCol : "등록대상이첩대상구분",
ctgrType : ["code"],
dtlCtgr : ["FIM999"]
}
],
fixedItemId : ["등록대상","이첩대상"], fixedItemId : ["등록대상","이첩대상"],
namedNumberValueSeperator : "completeAndTotal", namedNumberValueSeperator : "completeAndTotal",
globalAggregate : "count", globalAggregate : "count",
@ -273,20 +267,12 @@ function fnMakeStatReq(taskSeCd){
lastDay : lastDay lastDay : lastDay
}; };
groupInfoList = [ defaultQuery = fnJsonToFormData(defaultQuery, "groupInfoList");
{ defaultQuery = fnJsonToFormData(defaultQuery, "numberValueInfoList");
refCol : "등록대상이첩대상구분", defaultQuery = fnJsonToFormData(defaultQuery, "codeSubsetInfoList");
ctgrType : ["code"],
dtlCtgr : ["FIM999"]
}
];
queryInQuery1 = fnJsonArrayToFormData(groupInfoList, "groupInfoList");
mergedQuery = {...defaultQuery, ...queryInQuery1 };
statReqArr.push({ statReqArr.push({
query : mergedQuery, query : defaultQuery,
cursor : "card2", cursor : "card2",
statType : "progressAndTotal" statType : "progressAndTotal"
}); });
@ -295,6 +281,13 @@ function fnMakeStatReq(taskSeCd){
defaultQuery = { defaultQuery = {
structureType : "dummy", structureType : "dummy",
statDomain : "sndb", statDomain : "sndb",
groupInfoList : [
{
refCol : "SNDNG_SE_CD",
ctgrType : ["code"],
dtlCtgr : ["FIM047"]
}
],
fixedItemId : ["01", "02", "03"], fixedItemId : ["01", "02", "03"],
namedNumberValueSeperator : "completeAndTotal", namedNumberValueSeperator : "completeAndTotal",
globalAggregate : "count", globalAggregate : "count",
@ -304,20 +297,12 @@ function fnMakeStatReq(taskSeCd){
lastDay : lastDay lastDay : lastDay
}; };
groupInfoList = [ defaultQuery = fnJsonToFormData(defaultQuery, "groupInfoList");
{ defaultQuery = fnJsonToFormData(defaultQuery, "numberValueInfoList");
refCol : "SNDNG_SE_CD", defaultQuery = fnJsonToFormData(defaultQuery, "codeSubsetInfoList");
ctgrType : ["code"],
dtlCtgr : ["FIM047"]
}
];
queryInQuery1 = fnJsonArrayToFormData(groupInfoList, "groupInfoList");
mergedQuery = {...defaultQuery, ...queryInQuery1 };
statReqArr.push({ statReqArr.push({
query : mergedQuery, query : defaultQuery,
cursor : "card3", cursor : "card3",
statType : "progressAndTotal" statType : "progressAndTotal"
}); });
@ -326,6 +311,21 @@ function fnMakeStatReq(taskSeCd){
defaultQuery = { defaultQuery = {
structureType : "dummy", structureType : "dummy",
statDomain : "excl", statDomain : "excl",
groupInfoList : [
{
refCol : "OPNN_SBMSN_STTS_CD",
ctgrType : ["code"],
dtlCtgr : ["FIM031"]
}
],
codeSubsetInfoList : [
{
sourceGroup : "FIM031",
sourceCodes : ["01","02"],
targetCode : "acceptOrNonAccept",
targetCodeVal : "수용/미수용"
}
],
fixedItemId : ["00", "acceptOrNonAccept", "03"], fixedItemId : ["00", "acceptOrNonAccept", "03"],
namedNumberValueSeperator : "completeAndTotal", namedNumberValueSeperator : "completeAndTotal",
globalAggregate : "count", globalAggregate : "count",
@ -335,31 +335,12 @@ function fnMakeStatReq(taskSeCd){
lastDay : lastDay lastDay : lastDay
}; };
groupInfoList = [ defaultQuery = fnJsonToFormData(defaultQuery, "groupInfoList");
{ defaultQuery = fnJsonToFormData(defaultQuery, "numberValueInfoList");
refCol : "OPNN_SBMSN_STTS_CD", defaultQuery = fnJsonToFormData(defaultQuery, "codeSubsetInfoList");
ctgrType : ["code"],
dtlCtgr : ["FIM031"]
}
];
queryInQuery1 = fnJsonArrayToFormData(groupInfoList, "groupInfoList");
codeSubsetInfoList = [
{
sourceGroup : "FIM031",
sourceCodes : ["01","02"],
targetCode : "acceptOrNonAccept",
targetCodeVal : "수용/미수용"
}
];
queryInQuery3 = fnJsonArrayToFormData(codeSubsetInfoList, "codeSubsetInfoList");
mergedQuery = {...defaultQuery, ...queryInQuery1, ...queryInQuery3};
statReqArr.push({ statReqArr.push({
query : mergedQuery, query : defaultQuery,
cursor : "card4", cursor : "card4",
statType : "progressAndTotal" statType : "progressAndTotal"
}); });
@ -368,6 +349,27 @@ function fnMakeStatReq(taskSeCd){
defaultQuery = { defaultQuery = {
structureType : "aggregate", structureType : "aggregate",
statDomain : "crdn", statDomain : "crdn",
groupInfoList : [
{
refCol : "CRDN_SE_CD",
ctgrType : ["code"],
dtlCtgr : ["FIM002"]
}
],
codeSubsetInfoList : [
{
sourceGroup : "FIM002",
sourceCodes : ["08","09","10","11"],
targetCode : "minwon",
targetCodeVal : "민원"
},
{
sourceGroup : "FIM002",
sourceCodes : ["06","13"],
targetCode : "dobo",
targetCodeVal : "도보"
}
],
fixedItemId : ["01","02","dobo","minwon"], fixedItemId : ["01","02","dobo","minwon"],
namedNumberValueSeperator : "lastFewDays", namedNumberValueSeperator : "lastFewDays",
globalAggregate : "count", globalAggregate : "count",
@ -376,37 +378,12 @@ function fnMakeStatReq(taskSeCd){
dayRange : 15 dayRange : 15
}; };
groupInfoList = [ defaultQuery = fnJsonToFormData(defaultQuery, "groupInfoList");
{ defaultQuery = fnJsonToFormData(defaultQuery, "numberValueInfoList");
refCol : "CRDN_SE_CD", defaultQuery = fnJsonToFormData(defaultQuery, "codeSubsetInfoList");
ctgrType : ["code"],
dtlCtgr : ["FIM002"]
}
];
queryInQuery1 = fnJsonArrayToFormData(groupInfoList, "groupInfoList");
codeSubsetInfoList = [
{
sourceGroup : "FIM002",
sourceCodes : ["08","09","10","11"],
targetCode : "minwon",
targetCodeVal : "민원"
},
{
sourceGroup : "FIM002",
sourceCodes : ["06","13"],
targetCode : "dobo",
targetCodeVal : "도보"
}
];
queryInQuery3 = fnJsonArrayToFormData(codeSubsetInfoList, "codeSubsetInfoList");
mergedQuery = {...defaultQuery, ...queryInQuery1, ...queryInQuery3};
statReqArr.push({ statReqArr.push({
query : mergedQuery, query : defaultQuery,
cursor : "lineChart", cursor : "lineChart",
statType : "line" statType : "line"
}); });
@ -415,6 +392,26 @@ function fnMakeStatReq(taskSeCd){
defaultQuery = { defaultQuery = {
structureType : "aggregate", structureType : "aggregate",
statDomain : "crdnSttsHstry", statDomain : "crdnSttsHstry",
groupInfoList : [
{
refCol : "CRDN_STTS_CD",
ctgrType : ["code"],
dtlCtgr : ["FIM010"]
}
],
numberValueInfoList : [
{
aggregateType : "count"
}
],
codeSubsetInfoList : [
{
sourceGroup : "FIM010",
sourceCodes : ["21"],
targetCode : "dansokProcess",
targetCodeVal : "단속"
}
],
fixedItemId : ["dansokProcess","81","83"], fixedItemId : ["dansokProcess","81","83"],
taskSeCd : taskSeCd, taskSeCd : taskSeCd,
dayColumn : "REG_DT", dayColumn : "REG_DT",
@ -422,39 +419,12 @@ function fnMakeStatReq(taskSeCd){
lastDay : firstDay lastDay : firstDay
}; };
groupInfoList = [ defaultQuery = fnJsonToFormData(defaultQuery, "groupInfoList");
{ defaultQuery = fnJsonToFormData(defaultQuery, "numberValueInfoList");
refCol : "CRDN_STTS_CD", defaultQuery = fnJsonToFormData(defaultQuery, "codeSubsetInfoList");
ctgrType : ["code"],
dtlCtgr : ["FIM010"]
}
];
queryInQuery1 = fnJsonArrayToFormData(groupInfoList, "groupInfoList");
numberValueInfoList = [
{
aggregateType : "count"
}
];
queryInQuery2 = fnJsonArrayToFormData(numberValueInfoList, "numberValueInfoList");
codeSubsetInfoList = [
{
sourceGroup : "FIM010",
sourceCodes : ["21"],
targetCode : "dansokProcess",
targetCodeVal : "단속"
}
];
queryInQuery3 = fnJsonArrayToFormData(codeSubsetInfoList, "codeSubsetInfoList");
mergedQuery = {...defaultQuery, ...queryInQuery1, ...queryInQuery2, ...queryInQuery3};
statReqArr.push({ statReqArr.push({
query : mergedQuery, query : defaultQuery,
cursor : "doughnutChart1", cursor : "doughnutChart1",
statType : "doughnut" statType : "doughnut"
}); });
@ -463,6 +433,18 @@ function fnMakeStatReq(taskSeCd){
defaultQuery = { defaultQuery = {
structureType : "aggregate", structureType : "aggregate",
statDomain : "sndb", statDomain : "sndb",
groupInfoList : [
{
refCol : "SNDNG_SE_CD",
ctgrType : ["code"],
dtlCtgr : ["FIM047"]
}
],
numberValueInfoList : [
{
aggregateType : "count"
}
],
fixedItemId : ["01", "02", "03"], fixedItemId : ["01", "02", "03"],
taskSeCd : taskSeCd, taskSeCd : taskSeCd,
dayColumn : "SNDNG_YMD", dayColumn : "SNDNG_YMD",
@ -470,28 +452,12 @@ function fnMakeStatReq(taskSeCd){
lastDay : firstDay lastDay : firstDay
}; };
groupInfoList = [ defaultQuery = fnJsonToFormData(defaultQuery, "groupInfoList");
{ defaultQuery = fnJsonToFormData(defaultQuery, "numberValueInfoList");
refCol : "SNDNG_SE_CD", defaultQuery = fnJsonToFormData(defaultQuery, "codeSubsetInfoList");
ctgrType : ["code"],
dtlCtgr : ["FIM047"]
}
];
queryInQuery1 = fnJsonArrayToFormData(groupInfoList, "groupInfoList");
numberValueInfoList = [
{
aggregateType : "count"
}
];
queryInQuery2 = fnJsonArrayToFormData(numberValueInfoList, "numberValueInfoList");
mergedQuery = {...defaultQuery, ...queryInQuery1, ... queryInQuery2};
statReqArr.push({ statReqArr.push({
query : mergedQuery, query : defaultQuery,
cursor : "doughnutChart2", cursor : "doughnutChart2",
statType : "doughnut" statType : "doughnut"
}); });
@ -500,6 +466,18 @@ function fnMakeStatReq(taskSeCd){
defaultQuery = { defaultQuery = {
structureType : "aggregate", structureType : "aggregate",
statDomain : "excl", statDomain : "excl",
groupInfoList : [
{
refCol : "OPNN_SBMSN_STTS_CD",
ctgrType : ["code"],
dtlCtgr : ["FIM031"]
}
],
numberValueInfoList : [
{
aggregateType : "count"
}
],
fixedItemId : ["01", "02", "03"], fixedItemId : ["01", "02", "03"],
taskSeCd : taskSeCd, taskSeCd : taskSeCd,
dayColumn : "REG_DT", dayColumn : "REG_DT",
@ -507,28 +485,12 @@ function fnMakeStatReq(taskSeCd){
lastDay : firstDay lastDay : firstDay
}; };
groupInfoList = [ defaultQuery = fnJsonToFormData(defaultQuery, "groupInfoList");
{ defaultQuery = fnJsonToFormData(defaultQuery, "numberValueInfoList");
refCol : "OPNN_SBMSN_STTS_CD", defaultQuery = fnJsonToFormData(defaultQuery, "codeSubsetInfoList");
ctgrType : ["code"],
dtlCtgr : ["FIM031"]
}
];
queryInQuery1 = fnJsonArrayToFormData(groupInfoList, "groupInfoList");
numberValueInfoList = [
{
aggregateType : "count"
}
];
queryInQuery2 = fnJsonArrayToFormData(numberValueInfoList, "numberValueInfoList");
mergedQuery = {...defaultQuery, ...queryInQuery1, ...queryInQuery2 };
statReqArr.push({ statReqArr.push({
query : mergedQuery, query : defaultQuery,
cursor : "doughnutChart3", cursor : "doughnutChart3",
statType : "doughnut" statType : "doughnut"
}); });

@ -296,8 +296,8 @@ function camelToKebab(text){
* jsonArray를 FormData형식의 키를 갖는 json으로 치환한다. * jsonArray를 FormData형식의 키를 갖는 json으로 치환한다.
* @return FormData형식의 키를 갖는 json * @return FormData형식의 키를 갖는 json
*/ */
function fnJsonArrayToFormData(array, name){ function fnJsonArrayToFormData(array, arrayName){
newObj = {}; var newObj = {};
for(var i=0; i<array.length; i++){ for(var i=0; i<array.length; i++){
var json = array[i]; var json = array[i];
@ -305,9 +305,36 @@ function fnJsonArrayToFormData(array, name){
var keys = Object.keys(json); var keys = Object.keys(json);
for(var j=0; j<keys.length; j++){ for(var j=0; j<keys.length; j++){
var key = keys[j]; var key = keys[j];
newObj[name+"["+i+"]."+key] = json[key]; newObj[arrayName+"["+i+"]."+key] = json[key];
} }
} }
return newObj; return newObj;
} }
/**
* json객체 안의 jsonArray를 FormData형식의 키로 치환한다.
* @return FormData형식의 키를 갖는 json
*/
function fnJsonToFormData(originalJson, arrayName){
if(originalJson[arrayName] == undefined){
return originalJson;
} else {
var newObj = {};
var array = originalJson[arrayName];
for(var i=0; i<array.length; i++){
var json = array[i];
var keys = Object.keys(json);
for(var j=0; j<keys.length; j++){
var key = keys[j];
newObj[arrayName+"["+i+"]."+key] = json[key];
}
}
delete originalJson[arrayName];
return {...originalJson, ...newObj};
}
}
Loading…
Cancel
Save