From 073f6114e01277a9c8c9c63b619472387b86baeb Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Fri, 10 Nov 2023 11:24:44 +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 --- .../fims/crdn/parsing/AttachedTxtParser.java | 2 +- .../xit/fims/crdn/parsing/LayoutParser.java | 2 +- .../xit/fims/stat/service/bean/StatBean.java | 8 ++- .../WEB-INF/jsp/fims/stat/stat01010-main.jsp | 69 +++++++++++++++++-- .../WEB-INF/jsp/fims/stat/stat02010-main.jsp | 1 + .../resources/js/fims/stat/crdnGroupSubset.js | 4 ++ 6 files changed, 76 insertions(+), 10 deletions(-) create mode 100644 src/main/webapp/resources/js/fims/stat/crdnGroupSubset.js diff --git a/src/main/java/cokr/xit/fims/crdn/parsing/AttachedTxtParser.java b/src/main/java/cokr/xit/fims/crdn/parsing/AttachedTxtParser.java index 01299491..d8757c3b 100644 --- a/src/main/java/cokr/xit/fims/crdn/parsing/AttachedTxtParser.java +++ b/src/main/java/cokr/xit/fims/crdn/parsing/AttachedTxtParser.java @@ -51,7 +51,7 @@ public class AttachedTxtParser extends LayoutParser{ String key = jsonObject.keySet().iterator().next(); - if(Arrays.asList(descriptor.getSecondSeperatorStarterItems().split(",")).contains(key)) { + if(Arrays.asList(descriptor.getSecondSeperatorStarterItems().split(",",-1)).contains(key)) { contentDivisionIndex++; partSplitCursor = 0; if(contentDivision.length > contentDivisionIndex) { diff --git a/src/main/java/cokr/xit/fims/crdn/parsing/LayoutParser.java b/src/main/java/cokr/xit/fims/crdn/parsing/LayoutParser.java index be9e3fba..dc8d231d 100644 --- a/src/main/java/cokr/xit/fims/crdn/parsing/LayoutParser.java +++ b/src/main/java/cokr/xit/fims/crdn/parsing/LayoutParser.java @@ -324,7 +324,7 @@ abstract public class LayoutParser { public boolean isChangeCrackdown(DataObject currentItem, DataObject beforeItem) { boolean isSameItemChange = false; String sameItems = descriptor.getSameItemsInFileGroup(); - String[] sameItemsSplit = sameItems.split(","); + String[] sameItemsSplit = sameItems.split(",",-1); for(int i=0; i < sameItemsSplit.length; i++) { if(!currentItem.string(sameItemsSplit[i]).equals(beforeItem.string(sameItemsSplit[i]))) { isSameItemChange = true; 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 03217b3c..21f15b6f 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 @@ -121,7 +121,7 @@ public class StatBean extends AbstractComponent { String key = it.next(); StatItem statItem = new StatItem(); - statItem.setItemId(key.split(",")); + statItem.setItemId(key.split(",", -1)); List listByKey = group.get(key); @@ -219,14 +219,16 @@ public class StatBean extends AbstractComponent { String vhrno = item.string("VHRNO"); result += crdnStngBean.getBusinessYnOfCar(ffnlgCarmdlCd, vhrno); + } else { + result += colValue; } - } - else { + } else { result += colValue; } } + return result; } ) diff --git a/src/main/webapp/WEB-INF/jsp/fims/stat/stat01010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/stat/stat01010-main.jsp index b9522b7e..c5a834ca 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/stat/stat01010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/stat/stat01010-main.jsp @@ -181,7 +181,7 @@ $(document).ready(function(){ } - + //그룹핑 요청 정보 추출 $P.getGroupInfoList = () => { var groupInfoLiost = []; @@ -228,6 +228,7 @@ $(document).ready(function(){ return groupInfoLiost; } + //수치값 요청 정보 추출 $P.getNumberValueInfoList = () => { var numberValuefoLiost = []; @@ -243,18 +244,70 @@ $(document).ready(function(){ return numberValuefoLiost; } + //코드서브셋 요청 정보 추출 $P.getCodeSubsetInfoList = () => { var codeSubsetInfoList = []; - var preset = $("#preset--${pageName}").find(":selected"); + var groupLevel1subset = $P.getCodeSubsetInfo("groupLevel1--${pageName}"); + var groupLevel2subset = $P.getCodeSubsetInfo("groupLevel2--${pageName}"); + var groupLevel3subset = $P.getCodeSubsetInfo("groupLevel3--${pageName}"); + var groupLevel4subset = $P.getCodeSubsetInfo("groupLevel4--${pageName}"); + var subsetForGroup = []; + subsetForGroup = subsetForGroup.concat(groupLevel1subset); + if($("#groupLevel2--${pageName}").val() != ""){ + subsetForGroup = subsetForGroup.concat(groupLevel2subset); + if($("#groupLevel3--${pageName}").val() != ""){ + subsetForGroup = subsetForGroup.concat(groupLevel3subset); + if($("#groupLevel4--${pageName}").val() != ""){ + subsetForGroup = subsetForGroup.concat(groupLevel4subset); + } + } + } + + var subsetForPreset = $P.getCodeSubsetInfo("preset--${pageName}"); + + codeSubsetInfoList = subsetForGroup.concat(subsetForPreset); - if(window[preset.val()+"_codeSubsetInfoList"] != undefined){ - codeSubsetInfoList = window[preset.val()+"_codeSubsetInfoList"]; + if(codeSubsetInfoList.length > 1){ + codeSubsetInfoList = $P.subsetDeduplication(codeSubsetInfoList); } return codeSubsetInfoList; } + //특정 요소의 코드서브셋 정보 추출 + $P.getCodeSubsetInfo = (elementId) => { + var result = []; + + var selected = $("#"+elementId).find(":selected"); + if(window[selected.val()+"_codeSubsetInfoList"] != undefined){ + result = window[selected.val()+"_codeSubsetInfoList"]; + } + return result; + } + + //중복 서브셋정보 제거 + $P.subsetDeduplication = (arr) => { + + var resultArr = []; + + var iterator = arr.values(); + + for(var element of iterator) { + var testFunc = function(resultElement){ + return (resultElement.sourceGroup == element.sourceGroup && resultElement.targetCode == element.targetCode); + }; + var testResult = resultArr.findIndex(testFunc); + + if(testResult == -1){ + resultArr.push(element); + } + } + + return resultArr; + } + + //그리드 모양 변경 $P.changeGrid = () => { $("#masterThead--${pageName}").html(""); @@ -289,6 +342,7 @@ $(document).ready(function(){ $("#masterThead--${pageName}").append(""); } + //상세 그리드 표시 $P.showDetailGrid = () => { if($("#refListYn--${pageName}").val() == "Y"){ $("#detailArea--${pageName}").removeAttr("hidden"); @@ -297,6 +351,7 @@ $(document).ready(function(){ } } + //통계 검색 $P.searchStat = () => { @@ -360,6 +415,7 @@ $(document).ready(function(){ } + //통계 그리드 렌더링 $P.renderStat = (stat) => { $("#masterTbody--${pageName}").html(""); @@ -417,7 +473,10 @@ $(document).ready(function(){ } initDatepicker("frmSearch--${pageName}"); //달력 초기화 - + $("#firstDay--${pageName}").datepicker('setDate', new Date()); + $("#lastDay--${pageName}").datepicker('setDate', new Date()); + + $("#dayColumn--${pageName}").append(document.getElementById("dayColumnDatalist--${pageName}").innerHTML); $("#searchForMenu--${pageName}").append(document.getElementById("searchForMenuTemplate--${pageName}").innerHTML); diff --git a/src/main/webapp/WEB-INF/jsp/fims/stat/stat02010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/stat/stat02010-main.jsp index 1ce748f4..ac004f41 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/stat/stat02010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/stat/stat02010-main.jsp @@ -117,4 +117,5 @@ + \ No newline at end of file diff --git a/src/main/webapp/resources/js/fims/stat/crdnGroupSubset.js b/src/main/webapp/resources/js/fims/stat/crdnGroupSubset.js new file mode 100644 index 00000000..dcc2f1ff --- /dev/null +++ b/src/main/webapp/resources/js/fims/stat/crdnGroupSubset.js @@ -0,0 +1,4 @@ +var ffnlgCarmdlCd_codeSubsetInfoList = [ + { sourceGroup : "FIM009", sourceCodes : ["15","21"], + targetCode : "etc", targetCodeVal : "특수/건설기계" } +]; \ No newline at end of file