대시보드 수정

main
이범준 1 year ago
parent defff182f2
commit e94ecffb9b

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

@ -296,8 +296,8 @@ function camelToKebab(text){
* jsonArray를 FormData형식의 키를 갖는 json으로 치환한다.
* @return FormData형식의 키를 갖는 json
*/
function fnJsonArrayToFormData(array, name){
newObj = {};
function fnJsonArrayToFormData(array, arrayName){
var newObj = {};
for(var i=0; i<array.length; i++){
var json = array[i];
@ -305,9 +305,36 @@ function fnJsonArrayToFormData(array, name){
var keys = Object.keys(json);
for(var j=0; j<keys.length; j++){
var key = keys[j];
newObj[name+"["+i+"]."+key] = json[key];
newObj[arrayName+"["+i+"]."+key] = json[key];
}
}
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