From defff182f2dc57173c5b9da95746cd9d0d318bc6 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Mon, 6 Nov 2023 18:03:51 +0900 Subject: [PATCH] =?UTF-8?q?=EB=8B=A8=EC=86=8D=EC=9E=90=EB=A3=8C=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=EC=9C=A0=ED=98=95=EB=B3=84=20=ED=86=B5?= =?UTF-8?q?=EA=B3=84=20=ED=91=9C=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cokr/xit/fims/stat/StatQuery.java | 14 +++++ .../xit/fims/stat/service/bean/StatBean.java | 10 ++-- .../stat/service/bean/StatServiceBean.java | 57 ++++++++----------- .../mapper/fims/cmmn/crdnSttsHstry-mapper.xml | 12 ++++ .../webapp/WEB-INF/jsp/include/dashboard.jsp | 30 ++++++++-- 5 files changed, 79 insertions(+), 44 deletions(-) diff --git a/src/main/java/cokr/xit/fims/stat/StatQuery.java b/src/main/java/cokr/xit/fims/stat/StatQuery.java index 47e3df34..8c6dffb7 100644 --- a/src/main/java/cokr/xit/fims/stat/StatQuery.java +++ b/src/main/java/cokr/xit/fims/stat/StatQuery.java @@ -23,6 +23,11 @@ public class StatQuery extends CmmnQuery { */ private String structureType; + /** + * 통계 영역 + */ + private String statDomain; + /** * 참조 리스트 추가 여부 */ @@ -98,6 +103,15 @@ public class StatQuery extends CmmnQuery { return self(); } + public String getStatDomain() { + return ifEmpty(statDomain, () -> null); + } + + public T setStatDomain(String statDomain) { + this.statDomain = statDomain; + return self(); + } + public String getRefListYn() { return ifEmpty(refListYn, () -> null); } 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 96992679..1e3ea0ec 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 @@ -35,14 +35,16 @@ public class StatBean extends AbstractComponent { public void daySetting(CmmnQuery someQuery, String className, String dayCol, String from, String to) { try { if(dayCol.equals("REG_DT")) { + if(className.equals("SndbQuery") || className.equals("LevyExclQuery")) { - Method m0 = someQuery.getClass().getDeclaredMethod("schDetailRegDtOpt", String.class); + Method m0 = someQuery.getClass().getDeclaredMethod("setSchDetailRegDtOpt", String.class); m0.invoke(someQuery, "regDt"); - Method m1 = someQuery.getClass().getDeclaredMethod("schDetailRegDtFrom", String.class); + Method m1 = someQuery.getClass().getDeclaredMethod("setSchDetailRegDtFrom", String.class); m1.invoke(someQuery, from); - Method m2 = someQuery.getClass().getDeclaredMethod("schDetailRegDtTo", String.class); + Method m2 = someQuery.getClass().getDeclaredMethod("setSchDetailRegDtTo", String.class); m2.invoke(someQuery, to); - } else if(className.equals("CrdnQuery")) { + } else if(className.equals("CrdnQuery") || className.equals("CrdnSttsHstryQuery")) { + Method m0 = CmmnQuery.class.getDeclaredMethod("setSchDateOpt", String.class); m0.invoke(someQuery, "regDt"); Method m1 = CmmnQuery.class.getDeclaredMethod("setSchDateFrom", String.class); 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 0dc2c7fe..18535a6c 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 @@ -12,13 +12,14 @@ import org.springframework.stereotype.Service; import cokr.xit.base.code.CommonCode; import cokr.xit.fims.cmmn.CmmnUtil; +import cokr.xit.fims.cmmn.CrdnSttsHstryQuery; +import cokr.xit.fims.cmmn.service.CrdnSttsHstryService; import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.service.CrdnService; import cokr.xit.fims.excl.LevyExclQuery; import cokr.xit.fims.excl.service.OpnnSbmsnService; import cokr.xit.fims.sndb.SndbQuery; import cokr.xit.fims.sndb.service.SndngService; -import cokr.xit.fims.stat.GroupInfo; import cokr.xit.fims.stat.NumberValueInfo; import cokr.xit.fims.stat.Stat; import cokr.xit.fims.stat.StatQuery; @@ -32,6 +33,9 @@ public class StatServiceBean extends AbstractServiceBean implements StatService @Resource(name = "crdnService") private CrdnService crdnService; + @Resource(name = "crdnSttsHstryService") + private CrdnSttsHstryService crdnSttsHstryService; + @Resource(name = "opnnSbmsnService") private OpnnSbmsnService opnnSbmsnService; @@ -131,36 +135,7 @@ public class StatServiceBean extends AbstractServiceBean implements StatService } - String domain = ""; - - List GroupInfoList = statQuery.getGroupInfoList(); - - for(GroupInfo groupInfo : GroupInfoList) { - - String categorization = groupInfo.getRefCol(); - - switch(categorization) { - case "CRDN_SE_CD" : - case "등록대상,이첩대상" : - case "초기자료처리" : - domain = "crdn"; - break; - case "SNDNG_SE_CD" : - domain = "sndb"; - break; - case "OPNN_SBMSN_STTS_CD" : - domain = "excl"; - break; - case "수납상태" : - domain = "levy"; - break; - } - - - if(!domain.equals("")) { - break; - } - } + String domain = statQuery.getStatDomain(); if(domain.equals("")) { throw new RuntimeException("통계 유형 확인 오류"); @@ -174,20 +149,34 @@ public class StatServiceBean extends AbstractServiceBean implements StatService crdnQuery.setTaskSeCd(statQuery.getTaskSeCd()); if(daySetting) { - statBean.daySetting(crdnQuery, crdnQuery.getClass().getName(), dayColumn, firstDay, lastDay); + statBean.daySetting(crdnQuery, crdnQuery.getClass().getSimpleName(), dayColumn, firstDay, lastDay); } queryResult = crdnService.getCrackdownList(crdnQuery); } + else if(domain.equals("crdnSttsHstry")) { + + CrdnSttsHstryQuery crdnSttsHstryQuery = new CrdnSttsHstryQuery(); + crdnSttsHstryQuery.setSggCd(statQuery.getSggCd()); + crdnSttsHstryQuery.setTaskSeCd(statQuery.getTaskSeCd()); + crdnSttsHstryQuery.setUseYN("Y"); + + if(daySetting) { + statBean.daySetting(crdnSttsHstryQuery, crdnSttsHstryQuery.getClass().getSimpleName(), dayColumn, firstDay, lastDay); + } + + queryResult = crdnSttsHstryService.getCrdnSttsHstryList(crdnSttsHstryQuery); + + } else if(domain.equals("sndb")) { SndbQuery sndbQuery = new SndbQuery(); sndbQuery.setSggCd(statQuery.getSggCd()); sndbQuery.setTaskSeCd(statQuery.getTaskSeCd()); if(daySetting) { - statBean.daySetting(sndbQuery, sndbQuery.getClass().getName(), dayColumn, firstDay, lastDay); + statBean.daySetting(sndbQuery, sndbQuery.getClass().getSimpleName(), dayColumn, firstDay, lastDay); } queryResult = sndngService.getSndngList(sndbQuery); } @@ -198,7 +187,7 @@ public class StatServiceBean extends AbstractServiceBean implements StatService levyExclQuery.setTaskSeCd(statQuery.getTaskSeCd()); if(daySetting) { - statBean.daySetting(levyExclQuery, levyExclQuery.getClass().getName(), dayColumn, firstDay, lastDay); + statBean.daySetting(levyExclQuery, levyExclQuery.getClass().getSimpleName(), dayColumn, firstDay, lastDay); } queryResult = opnnSbmsnService.getOpnnSbmsnList(levyExclQuery); diff --git a/src/main/resources/sql/mapper/fims/cmmn/crdnSttsHstry-mapper.xml b/src/main/resources/sql/mapper/fims/cmmn/crdnSttsHstry-mapper.xml index 528fe7f8..8ce3839e 100644 --- a/src/main/resources/sql/mapper/fims/cmmn/crdnSttsHstry-mapper.xml +++ b/src/main/resources/sql/mapper/fims/cmmn/crdnSttsHstry-mapper.xml @@ -41,6 +41,7 @@ , CSH.MDFR /* 수정자 */ , (SELECT USER_NM FROM TB_USER X WHERE X.USER_ID = CSH.MDFR) AS MDFR_NM /* 수정자 명 */ FROM TB_CRDN_STTS_HSTRY CSH + LEFT OUTER JOIN TB_CRDN C ON (CSH.CRDN_ID = C.CRDN_ID)