통계 관련 java파일 추가

main
이범준 1 year ago
parent 9965e0de70
commit 0b774d635b

@ -0,0 +1,51 @@
package cokr.xit.fims.stat;
import java.util.List;
import cokr.xit.foundation.data.DataObject;
import lombok.Getter;
import lombok.Setter;
/**
* @author leebj
*/
@Getter
@Setter
public class Stat {
/**
*
*/
private String statTitle;
/**
*
*/
private String statSubTitle;
/**
*
*/
private String[] compositeItemNameTitle;
/**
*
*/
private String[] compositeValueTitle;
/**
*
*/
private String groupYn;
/**
* ()
*/
private List<StatItem> statItems;
/**
* ()
*/
private List<DataObject> resultList;
}

@ -0,0 +1,37 @@
package cokr.xit.fims.stat;
import java.util.List;
import cokr.xit.foundation.data.DataObject;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class StatItem {
/**
*
*/
private String itemName;;
/**
*
*/
private String[] compositeItemName;
/**
*
*/
private String value;
/**
*
*/
private String[] compositeValue;
/**
*
*/
private List<DataObject> refList;
}

@ -0,0 +1,20 @@
package cokr.xit.fims.stat;
import cokr.xit.fims.cmmn.CmmnQuery;
/**
*
* <p> :
*
* <pre>
* ============ ============
* 2023-10-24 leebj
* ================================
* </pre>
*/
public class StatQuery extends CmmnQuery {
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,10 @@
package cokr.xit.fims.stat.service;
import cokr.xit.fims.stat.Stat;
import cokr.xit.fims.stat.StatQuery;
public interface StatService {
Stat getStatistics(StatQuery query);
}

@ -0,0 +1,39 @@
package cokr.xit.fims.stat.service.bean;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import cokr.xit.fims.crdn.service.CrdnService;
import cokr.xit.fims.excl.service.OpnnSbmsnService;
import cokr.xit.fims.sndb.service.SndngService;
import cokr.xit.fims.stat.Stat;
import cokr.xit.fims.stat.StatQuery;
import cokr.xit.fims.stat.service.StatService;
import cokr.xit.foundation.component.AbstractServiceBean;
@Service("statService")
public class StatServiceBean extends AbstractServiceBean implements StatService {
@Resource(name = "crdnService")
private CrdnService crdnService;
@Resource(name = "opnnSbmsnService")
private OpnnSbmsnService opnnSbmsnService;
@Resource(name = "sndngService")
private SndngService sndngService;
@Override
public Stat getStatistics(StatQuery query) {
Stat stat = new Stat();
return stat;
}
}

@ -0,0 +1,29 @@
package cokr.xit.fims.stat.web;
import javax.annotation.Resource;
import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.stat.Stat;
import cokr.xit.fims.stat.StatQuery;
import cokr.xit.fims.stat.service.StatService;
/** .<br />
* { }/stat .
* @author leebj
*/
public class StatController extends ApplicationController {
@Resource(name="statService")
private StatService statService;
public ModelAndView getStatistics(StatQuery query) {
ModelAndView mav = new ModelAndView("jsonView");
Stat stat = statService.getStatistics(query);
mav.addObject("stat", stat);
return mav;
}
}

@ -177,45 +177,46 @@ function fnLoadStatisticsData(){
data = { data = {
statItems : [ statItems : [
{ itemName : "고정형CCTV", completeCnt : 2, totalCnt : 10}, { itemName : "고정형CCTV", compositeValue : [2,10] },
{ itemName : "도보단속", completeCnt : 2, totalCnt : 3}, { itemName : "도보단속", compositeValue : [2,3] },
{ itemName : "이동형CCTV", completeCnt : 2, totalCnt : 3}, { itemName : "이동형CCTV", compositeValue : [2,3] },
{ itemName : "민원(즉시단속)", completeCnt : 10, totalCnt : 10} { itemName : "민원(즉시단속)", compositeValue : [10,10] }
] ]
}; };
fnRenderDashboardContents(data, "card1" , "progressAndTotal"); fnRenderDashboardContents(data, "card1" , "progressAndTotal");
data = { data = {
statItems : [ statItems : [
{ itemName : "등록대상", completeCnt : 45, totalCnt : 50}, { itemName : "등록대상", compositeValue : [45,50] },
{ itemName : "이첩대상", completeCnt : 35, totalCnt : 40} { itemName : "이첩대상", compositeValue : [35,40] }
] ]
}; };
fnRenderDashboardContents(data, "card2" , "progressAndTotal"); fnRenderDashboardContents(data, "card2" , "progressAndTotal");
data = { data = {
statItems : [ statItems : [
{ itemName : "계도장", completeCnt : 4, totalCnt : 10}, { itemName : "계도장", compositeValue : [4,10] },
{ itemName : "사전통보", completeCnt : 5, totalCnt : 11}, { itemName : "사전통보", compositeValue : [5,11] },
{ itemName : "고지서", completeCnt : 6, totalCnt : 12} { itemName : "고지서", compositeValue : [6,12] }
] ]
}; };
fnRenderDashboardContents(data, "card3" , "progressAndTotal"); fnRenderDashboardContents(data, "card3" , "progressAndTotal");
data = { data = {
statItems : [ statItems : [
{ itemName : "접수", completeCnt : 49, totalCnt : 100}, { itemName : "접수", compositeValue : [49,100] },
{ itemName : "수용/미수용", completeCnt : 50, totalCnt : 98}, { itemName : "수용/미수용", compositeValue : [50,98] },
{ itemName : "자진취하", completeCnt : 51, totalCnt : 97} { itemName : "자진취하", compositeValue : [51,97] }
] ]
}; };
fnRenderDashboardContents(data, "card4" , "progressAndTotal"); fnRenderDashboardContents(data, "card4" , "progressAndTotal");
data = { data = {
compositeValueTitle : [14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, "금일"],
statItems : [ statItems : [
{ itemName : "고정형", valueByTime : [80, 150, 180, 270, 210, 160, 160, 202, 265, 210, 270, 255, 290, 360, 375] }, { itemName : "고정형", compositeValue : [80, 150, 180, 270, 210, 160, 160, 202, 265, 210, 270, 255, 290, 360, 375] },
{ itemName : "도보", valueByTime : [80, 125, 105, 130, 215, 195, 140, 160, 230, 300, 220, 170, 210, 200, 280] }, { itemName : "도보", compositeValue : [80, 125, 105, 130, 215, 195, 140, 160, 230, 300, 220, 170, 210, 200, 280] },
{ itemName : "민원", valueByTime : [80, 99, 82, 90, 115, 115, 74, 75, 130, 155, 125, 90, 140, 130, 180] } { itemName : "민원", compositeValue : [80, 99, 82, 90, 115, 115, 74, 75, 130, 155, 125, 90, 140, 130, 180] }
] ]
}; };
fnRenderDashboardContents(data, "lineChart" , "line"); fnRenderDashboardContents(data, "lineChart" , "line");
@ -275,7 +276,7 @@ function fnRenderProgressAndTotal(returnData, cursor){
$("#"+cursor) $("#"+cursor)
.find("p") .find("p")
.eq(i) .eq(i)
.html(returnData.statItems[i].completeCnt + "/" + returnData.statItems[i].totalCnt); .html(returnData.statItems[i].compositeValue[0] + "/" + returnData.statItems[i].compositeValue[1]);
} }
if(cursor == "card1"){ if(cursor == "card1"){
@ -318,7 +319,7 @@ function fnRenderLine(returnData, cursor){
defaultObject.label = returnData.statItems[i].itemName; defaultObject.label = returnData.statItems[i].itemName;
defaultObject.data = returnData.statItems[i].valueByTime; defaultObject.data = returnData.statItems[i].compositeValue;
if(i % 3 == 0){ if(i % 3 == 0){
defaultObject.backgroundColor = config.colors.danger; defaultObject.backgroundColor = config.colors.danger;
@ -339,12 +340,15 @@ function fnRenderLine(returnData, cursor){
datasets.push(defaultObject); datasets.push(defaultObject);
} }
var xAxisLabels = returnData.compositeValueTitle;
var lineChart = document.getElementById(cursor); var lineChart = document.getElementById(cursor);
if (lineChart) { if (lineChart) {
var lineChartVar = new Chart(lineChart, { var lineChartVar = new Chart(lineChart, {
type: 'line', type: 'line',
data: { data: {
labels: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], labels: xAxisLabels,
datasets: datasets datasets: datasets
}, },
options: { options: {

Loading…
Cancel
Save