From 927ef830ac2f28335539f77b1dee07d8b27483ea Mon Sep 17 00:00:00 2001 From: eastargh Date: Mon, 31 Aug 2026 10:47:15 +0900 Subject: [PATCH] =?UTF-8?q?API=20=ED=86=B5=EA=B3=84=20=ED=99=94=EB=A9=B4?= =?UTF-8?q?=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../onl/admin/authserver/clientManDetail.jsp | 13 ++- .../jsp/onl/kjb/statistics/apiStatsDayMan.jsp | 9 +- .../onl/kjb/statistics/apiStatsHourMan.jsp | 7 +- .../onl/kjb/statistics/apiStatsMinuteMan.jsp | 9 +- .../onl/kjb/statistics/apiStatsMonthMan.jsp | 27 +++-- .../onl/kjb/statistics/apiStatsYearMan.jsp | 11 +- .../jsp/onl/kjb/statistics/apiUseStatsMan.jsp | 46 ++++++-- .../transaction/online/transactionStatus.jsp | 3 + .../online/transactionStatusDetail.jsp | 3 + .../tracking/trackingManDetail.jsp | 106 ++++++++++++------ .../djb/statistics/ApiUseStatsService.java | 34 +++--- .../kjb/statistics/ApiStatsDayController.java | 35 ++++++ .../statistics/ApiStatsHourController.java | 35 ++++++ .../statistics/ApiStatsMinuteController.java | 35 ++++++ .../statistics/ApiStatsMonthController.java | 35 ++++++ .../statistics/ApiStatsYearController.java | 35 ++++++ .../ext/kjb/statistics/ui/ApiStatsUI.java | 1 + 17 files changed, 354 insertions(+), 90 deletions(-) diff --git a/WebContent/jsp/onl/admin/authserver/clientManDetail.jsp b/WebContent/jsp/onl/admin/authserver/clientManDetail.jsp index 289f994..8461bdb 100644 --- a/WebContent/jsp/onl/admin/authserver/clientManDetail.jsp +++ b/WebContent/jsp/onl/admin/authserver/clientManDetail.jsp @@ -190,6 +190,8 @@ var key = "${param.clientId}"; if (key != "" && key != "null") { isDetail = true; + } else { + $('input[name="grantTypes_"]').prop('checked', true); } init(key, detail); @@ -506,18 +508,17 @@ - <%= localeMessage.getString("clntManDtl.grntTp") %> - (<%= localeMessage.getString("clntManDtl.sprt") %> ,) (*) + <%= localeMessage.getString("clntManDtl.grntTp") %> (*) client_credentials <%-- authorization_code--%> <%-- password--%> - refresh_token + - + REDIRECT URI @@ -538,7 +539,7 @@ - + <%= localeMessage.getString("clntManDtl.rfrshTknExprtnDt") %> @@ -555,7 +556,7 @@ - + Security Key diff --git a/WebContent/jsp/onl/kjb/statistics/apiStatsDayMan.jsp b/WebContent/jsp/onl/kjb/statistics/apiStatsDayMan.jsp index 8da16c3..220fadf 100644 --- a/WebContent/jsp/onl/kjb/statistics/apiStatsDayMan.jsp +++ b/WebContent/jsp/onl/kjb/statistics/apiStatsDayMan.jsp @@ -416,12 +416,13 @@ mtype: 'POST', postData: gridPostData, colNames: [ - 'API명', + 'API ID', 'API 명', '총건수', '성공', 'Timeout', '시스템오류', '평균응답(ms)', '최소응답(ms)', '최대응답(ms)' ], colModel: [ - { name: 'apiName', align: 'left', width: '250', sortable: false }, + { name: 'apiName', align: 'left', width: '150', sortable: false }, + { name: 'apiDesc', align: 'left', width: '250', sortable: false }, { name: 'totalCnt', align: 'right', width: '80', formatter: numberFormatter, sortable: false }, { name: 'successCnt', align: 'right', width: '80', formatter: numberFormatter, sortable: false }, { name: 'timeoutCnt', align: 'right', width: '80', formatter: numberFormatter, sortable: false }, @@ -458,7 +459,7 @@ mtype: 'POST', postData: gridPostData, colNames: [ - '통계시간', 'API명', '인스턴스', '업무구분', '클라이언트ID', + '통계시간', 'API ID', '인스턴스', '업무구분', '클라이언트ID', 'Inbound Adapter', 'Outbound Adapter', '총건수', '성공', 'Timeout', '시스템오류', '평균응답(ms)', '최소응답(ms)', '최대응답(ms)' @@ -602,7 +603,7 @@ - API명 + API ID diff --git a/WebContent/jsp/onl/kjb/statistics/apiStatsHourMan.jsp b/WebContent/jsp/onl/kjb/statistics/apiStatsHourMan.jsp index 0ff3a34..0c70059 100644 --- a/WebContent/jsp/onl/kjb/statistics/apiStatsHourMan.jsp +++ b/WebContent/jsp/onl/kjb/statistics/apiStatsHourMan.jsp @@ -418,12 +418,13 @@ mtype: 'POST', postData: gridPostData, colNames: [ - 'API명', + 'API ID', 'API 명', '총건수', '성공', 'Timeout', '시스템오류', '평균응답(ms)', '최소응답(ms)', '최대응답(ms)' ], colModel: [ - { name: 'apiName', align: 'left', width: '250', sortable: false }, + { name: 'apiName', align: 'left', width: '150', sortable: false }, + { name: 'apiDesc', align: 'left', width: '250', sortable: false }, { name: 'totalCnt', align: 'right', width: '80', formatter: numberFormatter, sortable: false }, { name: 'successCnt', align: 'right', width: '80', formatter: numberFormatter, sortable: false }, { name: 'timeoutCnt', align: 'right', width: '80', formatter: numberFormatter, sortable: false }, @@ -580,7 +581,7 @@ - API명 + API ID diff --git a/WebContent/jsp/onl/kjb/statistics/apiStatsMinuteMan.jsp b/WebContent/jsp/onl/kjb/statistics/apiStatsMinuteMan.jsp index 9f99261..21070c4 100644 --- a/WebContent/jsp/onl/kjb/statistics/apiStatsMinuteMan.jsp +++ b/WebContent/jsp/onl/kjb/statistics/apiStatsMinuteMan.jsp @@ -431,12 +431,13 @@ mtype: 'POST', postData: gridPostData, colNames: [ - 'API명', - '총건수', '성공', 'Timeout', '시스템오류', + 'API ID', 'API 명', + '총건수', '성공', 'Timeout', '시스템오류', '평균응답(ms)', '최소응답(ms)', '최대응답(ms)' ], colModel: [ - { name: 'apiName', align: 'left', width: '250', sortable: false }, + { name: 'apiName', align: 'left', width: '150', sortable: false }, + { name: 'apiDesc', align: 'left', width: '250', sortable: false }, { name: 'totalCnt', align: 'right', width: '80', formatter: numberFormatter, sortable: false }, { name: 'successCnt', align: 'right', width: '80', formatter: numberFormatter, sortable: false }, { name: 'timeoutCnt', align: 'right', width: '80', formatter: numberFormatter, sortable: false }, @@ -609,7 +610,7 @@ (최대 1시간, 초과시 자동 조정) - API명 + API ID diff --git a/WebContent/jsp/onl/kjb/statistics/apiStatsMonthMan.jsp b/WebContent/jsp/onl/kjb/statistics/apiStatsMonthMan.jsp index 9b5a8ed..1e58e84 100644 --- a/WebContent/jsp/onl/kjb/statistics/apiStatsMonthMan.jsp +++ b/WebContent/jsp/onl/kjb/statistics/apiStatsMonthMan.jsp @@ -421,12 +421,13 @@ mtype: 'POST', postData: gridPostData, colNames: [ - 'API명', + 'API ID', 'API 명', '총건수', '성공', 'Timeout', '시스템오류', '평균응답(ms)', '최소응답(ms)', '최대응답(ms)' ], colModel: [ - { name: 'apiName', align: 'left', width: '250', sortable: false }, + { name: 'apiName', align: 'left', width: '150', sortable: false }, + { name: 'apiDesc', align: 'left', width: '250', sortable: false }, { name: 'totalCnt', align: 'right', width: '80', formatter: numberFormatter, sortable: false }, { name: 'successCnt', align: 'right', width: '80', formatter: numberFormatter, sortable: false }, { name: 'timeoutCnt', align: 'right', width: '80', formatter: numberFormatter, sortable: false }, @@ -463,7 +464,7 @@ mtype: 'POST', postData: gridPostData, colNames: [ - '통계시간', 'API명', '인스턴스', '업무구분', '클라이언트ID', + '통계시간', 'API ID', '인스턴스', '업무구분', '클라이언트ID', 'Inbound Adapter', 'Outbound Adapter', '총건수', '성공', 'Timeout', '시스템오류', '평균응답(ms)', '최소응답(ms)', '최대응답(ms)' @@ -510,11 +511,21 @@ $("input[name=searchStartDateTime]").inputmask("9999-99", { 'autoUnmask': true }); $("input[name=searchEndDateTime]").inputmask("9999-99", { 'autoUnmask': true }); - // 기본값 설정 (최근 12개월) + // 기본값 설정: 올해 1월 ~ 지난달 (현재가 1월이면 작년 1월 ~ 작년 12월) var today = new Date(); - var endMonth = today.getFullYear() + '-' + (today.getMonth() + 1 < 10 ? '0' : '') + (today.getMonth() + 1); - var startDate = new Date(today.getFullYear(), today.getMonth() - 11, 1); - var startMonth = startDate.getFullYear() + '-' + (startDate.getMonth() + 1 < 10 ? '0' : '') + (startDate.getMonth() + 1); + var startDate, endDate; + if (today.getMonth() === 0) { // 1월 + startDate = new Date(today.getFullYear() - 1, 0, 1); + endDate = new Date(today.getFullYear() - 1, 11, 1); + } else { + startDate = new Date(today.getFullYear(), 0, 1); + endDate = new Date(today.getFullYear(), today.getMonth() - 1, 1); + } + function toMonthStr(d) { + return d.getFullYear() + '-' + (d.getMonth() + 1 < 10 ? '0' : '') + (d.getMonth() + 1); + } + var startMonth = toMonthStr(startDate); + var endMonth = toMonthStr(endDate); if (!$("input[name=searchStartDateTime]").val()) { $("input[name=searchStartDateTime]").val(startMonth); @@ -593,7 +604,7 @@ - API명 + API ID diff --git a/WebContent/jsp/onl/kjb/statistics/apiStatsYearMan.jsp b/WebContent/jsp/onl/kjb/statistics/apiStatsYearMan.jsp index ad17a8c..70a8bd0 100644 --- a/WebContent/jsp/onl/kjb/statistics/apiStatsYearMan.jsp +++ b/WebContent/jsp/onl/kjb/statistics/apiStatsYearMan.jsp @@ -397,12 +397,13 @@ mtype: 'POST', postData: gridPostData, colNames: [ - 'API명', - '총건수', '성공', 'Timeout', '시스템오류', + 'API ID', 'API 명', + '총건수', '성공', 'Timeout', '시스템오류', '평균응답(ms)', '최소응답(ms)', '최대응답(ms)' ], colModel: [ - { name: 'apiName', align: 'left', width: '250', sortable: false }, + { name: 'apiName', align: 'left', width: '150', sortable: false }, + { name: 'apiDesc', align: 'left', width: '250', sortable: false }, { name: 'totalCnt', align: 'right', width: '80', formatter: numberFormatter, sortable: false }, { name: 'successCnt', align: 'right', width: '80', formatter: numberFormatter, sortable: false }, { name: 'timeoutCnt', align: 'right', width: '80', formatter: numberFormatter, sortable: false }, @@ -439,7 +440,7 @@ mtype: 'POST', postData: gridPostData, colNames: [ - '통계시간', 'API명', '인스턴스', '업무구분', '클라이언트ID', + '통계시간', 'API ID', '인스턴스', '업무구분', '클라이언트ID', 'Inbound Adapter', 'Outbound Adapter', '총건수', '성공', 'Timeout', '시스템오류', '평균응답(ms)', '최소응답(ms)', '최대응답(ms)' @@ -563,7 +564,7 @@ - API명 + API ID diff --git a/WebContent/jsp/onl/kjb/statistics/apiUseStatsMan.jsp b/WebContent/jsp/onl/kjb/statistics/apiUseStatsMan.jsp index e6cdf7a..59acf9c 100644 --- a/WebContent/jsp/onl/kjb/statistics/apiUseStatsMan.jsp +++ b/WebContent/jsp/onl/kjb/statistics/apiUseStatsMan.jsp @@ -65,9 +65,27 @@ } + // 조회구분(searchType)에 따라 '구분' / '구분명' 컬럼의 헤더명·폭·표시여부를 조정 + function applyGridColumnsByType(type) { + var $g = $("#grid"); + if (type === 'API') { + $g.jqGrid('setLabel', 'orgName', 'API ID'); + $g.jqGrid('setLabel', 'apiDesc', 'API명'); + $g.jqGrid('setColProp', 'orgName', { widthOrg: 150, width: 150 }); + $g.jqGrid('setColProp', 'apiDesc', { widthOrg: 250, width: 250 }); + $g.jqGrid('showCol', 'apiDesc'); + } else { + $g.jqGrid('setLabel', 'orgName', (type === 'DATE') ? '사용일' : '제휴사'); + $g.jqGrid('setColProp', 'orgName', { widthOrg: 250, width: 250 }); + $g.jqGrid('hideCol', 'apiDesc'); + } + $g.jqGrid('setGridWidth', $('#content_middle').width(), true); + } + function search() { var postData = getPostData("cmd", "LIST"); if (postData) { + applyGridColumnsByType($('input[name="searchType"]:checked').val()); $("#grid").setGridParam({ url: url, postData: postData }).trigger("reloadGrid"); } } @@ -186,12 +204,13 @@ mtype: 'POST', postData: gridPostData, colNames: [ - '구분', - '총건수', '성공', '성공율(%)', '실패율(%)', 'Timeout', '시스템오류', + '제휴사', 'API명', + '총건수', '성공', '성공율(%)', '실패율(%)', 'Timeout', '시스템오류', '평균응답(ms)', '최소응답(ms)', '최대응답(ms)' ], colModel: [ { name: 'orgName', align: 'left', width: '250', sortable: false }, + { name: 'apiDesc', align: 'left', width: '250', sortable: false, hidden: true }, { name: 'totalCnt', align: 'right', width: '80', formatter: numberFormatter, sortable: false }, { name: 'successCnt', align: 'right', width: '80', formatter: numberFormatter, sortable: false }, { name: 'successRate', align: 'right', width: '80', formatter: decimalFormatter, sortable: false }, @@ -225,10 +244,23 @@ $("input[name=searchStartDate], input[name=searchEndDate]").inputmask("9999-99-99", { 'autoUnmask': true }); $("input[name=searchStartDate], input[name=searchEndDate]").datepicker(); + // 기본값 설정: 이번달 1일 ~ 어제 (오늘이 1일이면 지난달 1일 ~ 지난달 말일) var today = getToday(); - var startDate = today.substring(0,6)+"01"; - var endDate = today; - + var now = new Date(); + function toYmd(d) { + var m = d.getMonth() + 1; + var day = d.getDate(); + return d.getFullYear() + '' + (m < 10 ? '0' : '') + m + (day < 10 ? '0' : '') + day; + } + var startDate, endDate; + if (now.getDate() === 1) { + startDate = toYmd(new Date(now.getFullYear(), now.getMonth() - 1, 1)); + endDate = toYmd(new Date(now.getFullYear(), now.getMonth(), 0)); + } else { + startDate = today.substring(0,6) + "01"; + endDate = toYmd(new Date(now.getFullYear(), now.getMonth(), now.getDate() - 1)); + } + if (!$("input[name=searchStartDate]").val()) { $("input[name=searchStartDate]").val(startDate); @@ -302,11 +334,11 @@ - API명 + API ID - + diff --git a/WebContent/jsp/onl/transaction/online/transactionStatus.jsp b/WebContent/jsp/onl/transaction/online/transactionStatus.jsp index abdd478..cb108e2 100644 --- a/WebContent/jsp/onl/transaction/online/transactionStatus.jsp +++ b/WebContent/jsp/onl/transaction/online/transactionStatus.jsp @@ -281,6 +281,9 @@ $(document).ready(function() { <%-- " level="W" status="DETAIL"/> --%>
<%= localeMessage.getString("tranStat.title") %><%= localeMessage.getString("tranStat.tooltip") %>
+
+ ※ 100 : 송신>APIM   200 : APIM>수신   300 : 수신>APIM   400 : APIM>송신 +
diff --git a/WebContent/jsp/onl/transaction/online/transactionStatusDetail.jsp b/WebContent/jsp/onl/transaction/online/transactionStatusDetail.jsp index 5a4fa0a..1fe1304 100644 --- a/WebContent/jsp/onl/transaction/online/transactionStatusDetail.jsp +++ b/WebContent/jsp/onl/transaction/online/transactionStatusDetail.jsp @@ -437,6 +437,9 @@ $( document ).ready(function() { <%-- " alt="" id="btn_search" level="R" /> --%>
<%= localeMessage.getString("tranStatDetail.title") %><%= localeMessage.getString("tranStat.tooltip") %>
+
+ ※ 100 : 송신>APIM   200 : APIM>수신   300 : 수신>APIM   400 : APIM>송신 +
diff --git a/WebContent/jsp/onl/transaction/tracking/trackingManDetail.jsp b/WebContent/jsp/onl/transaction/tracking/trackingManDetail.jsp index 18e3d05..2b35276 100644 --- a/WebContent/jsp/onl/transaction/tracking/trackingManDetail.jsp +++ b/WebContent/jsp/onl/transaction/tracking/trackingManDetail.jsp @@ -253,7 +253,7 @@ var name = $(this).attr("name"); if ("${rmsMenuAuth}" =="W"){ //2020.07.08 admin 만 버튼보이게 수정 $("#"+name).show(); - $("input[name="+name+"]").css("width","185px"); + $("input[name="+name+"]").css("width","calc(100% - 60px)"); } }); @@ -261,7 +261,7 @@ var name = $(this).attr("name"); if($("input[name="+name+"]").val().trim() != ""){ $("#"+name).show(); - $("input[name="+name+"]").css("width","185px"); + $("input[name="+name+"]").css("width","calc(100% - 60px)"); } }); @@ -977,15 +977,21 @@ html,hbody {
<%=localeMessage.getString("trackingDetail.common")%>
+ + + + + + - - - - + + + +
<%=localeMessage.getString("trackingDetail.eaiSvcSerno")%>
<%=localeMessage.getString("trackingDetail.eaiBzwkDstcd")%> <%=localeMessage.getString("trackingDetail.msgDpstYMS")%> <%=localeMessage.getString("trackingDetail.eaiBzwkDstcd")%> <%=localeMessage.getString("trackingDetail.msgDpstYMS")%>
<%= localeMessage.getString("eaiMessage.eaiSvcName")%> @@ -1019,11 +1025,17 @@ html,hbody {
API 정보
+ + + + + + - - - - + + + + @@ -1145,20 +1157,27 @@ html,hbody {
<%=localeMessage.getString("trackingDetail.inbound")%>
APP(Client) ID APP 명 APP(Client) ID APP 명
법인 ID
+ + + + + + - - + <%-- + --%> - - - - - + <%-- + + + --%> + <%-- @@ -1169,39 +1188,52 @@ html,hbody { - + --%>
<%=localeMessage.getString("trackingDetail.svcMotivUseDstcd")%> <%=localeMessage.getString("trackingDetail.svcMotivUseDstcd")%> <%=localeMessage.getString("trackingDetail.gstatSysAdptrBzwkGroupName")%> + <%-- " alt="" id="gstatSysAdptrBzwkGroupName" class="adapter_btn" level="W"/> --%>
<%=localeMessage.getString("trackingDetail.flowCtrlRoutName")%> <%=localeMessage.getString("trackingDetail.stndMsgUseYn")%>
<%=localeMessage.getString("trackingDetail.flowCtrlRoutName")%>
<%=localeMessage.getString("trackingDetail.svcPrcssDsticName")%> <%=localeMessage.getString("trackingDetail.svcBfClmnLogYn")%>
<%=localeMessage.getString("trackingDetail.gstatSvcDsticName")%> <%=localeMessage.getString("trackingDetail.prsntMsgIdName")%>
<%=localeMessage.getString("trackingDetail.outbound")%>
+ + + + + + - - + <%-- --%> + <%-- --%> - + - - - - - + <%-- + + + --%> + <%-- - + --%>
<%=localeMessage.getString("trackingDetail.psvIntfacDsticName")%> <%=localeMessage.getString("trackingDetail.psvIntfacDsticName")%> <%=localeMessage.getString("trackingDetail.psvSysAdptrBzwkGroupName")%> + <%-- " alt="" id="psvSysAdptrBzwkGroupName" class="adapter_btn" level="W"/> --%> <%=localeMessage.getString("trackingDetail.psvBzwkSysName")%>
<%=localeMessage.getString("trackingDetail.outbndRoutName")%> <%=localeMessage.getString("trackingDetail.toutVal")%>
<%=localeMessage.getString("trackingDetail.psvSysSvcDsticName")%> <%=localeMessage.getString("trackingDetail.psvBzwkSysName")%>
<%=localeMessage.getString("trackingDetail.psvSysSvcDsticName")%>
<%=localeMessage.getString("trackingDetail.rspnsErrFldName")%> <%=localeMessage.getString("trackingDetail.psvSysIdName")%>
<%=localeMessage.getString("trackingDetail.MAPPING")%>
+ + + + + + - - - - + + + @@ -1210,7 +1242,7 @@ html,hbody { @@ -1220,10 +1252,10 @@ html,hbody { - + <%-- - + --%>
<%=localeMessage.getString("trackingDetail.chngYn")%> <%=localeMessage.getString("trackingDetail.chngMsgIdName")%> + <%=localeMessage.getString("trackingDetail.chngYn")%> <%=localeMessage.getString("trackingDetail.chngMsgIdName")%> <%=localeMessage.getString("trackingDetail.bascRspnsChngYn")%> <%=localeMessage.getString("trackingDetail.bascRspnsChngMsgIdName")%> - + <%=localeMessage.getString("trackingDetail.errRspnsChngYn")%> <%=localeMessage.getString("trackingDetail.errRspnsChngMsgIdName")%> - + " alt="" id="errRspnsChngMsgIdName" class="layout_btn" />
<%=localeMessage.getString("trackingDetail.inptMsgIDName")%> @@ -1233,9 +1265,9 @@ html,hbody {
<%=localeMessage.getString("trackingDetail.bascRspnsMsgCmprCtnt")%> <%=localeMessage.getString("trackingDetail.flovrYn")%>
-
<%=localeMessage.getString("trackingDetail.etc")%>
+ <%--
<%=localeMessage.getString("trackingDetail.etc")%>
@@ -1267,7 +1299,7 @@ html,hbody { -
<%=localeMessage.getString("trackingDetail.rspnsErrcdName")%><%=localeMessage.getString("trackingDetail.trackAsisKey3Ctnt")%> <%=localeMessage.getString("trackingDetail.trackAsisKey4Ctnt")%>
+ --%>
diff --git a/src/main/java/com/eactive/eai/rms/ext/djb/statistics/ApiUseStatsService.java b/src/main/java/com/eactive/eai/rms/ext/djb/statistics/ApiUseStatsService.java index 1ad6122..0e6d751 100644 --- a/src/main/java/com/eactive/eai/rms/ext/djb/statistics/ApiUseStatsService.java +++ b/src/main/java/com/eactive/eai/rms/ext/djb/statistics/ApiUseStatsService.java @@ -57,19 +57,19 @@ public class ApiUseStatsService String dataSql = ""; if ("ORG".equals(search.getSearchType())) { - dataSql = "SELECT NVL(NVL(B.ORGNAME, D.ORG_NAME),'미분류') AS ORGNAME"; + dataSql = "SELECT NVL(NVL(B.ORGNAME, D.ORG_NAME),'미분류') AS ORGNAME, '' AS APIDESC"; dataSql += getQueryBody(search); dataSql += " GROUP BY NVL(NVL(B.ORGNAME, D.ORG_NAME),'미분류')"; dataSql += " ORDER BY ORGNAME"; } else if ("API".equals(search.getSearchType())) { - dataSql = "SELECT A.API_NAME "; + dataSql = "SELECT A.API_NAME, A.EAISVCDESC "; dataSql += getQueryBody(search); - dataSql += " GROUP BY A.API_NAME"; + dataSql += " GROUP BY A.API_NAME, A.EAISVCDESC "; dataSql += " ORDER BY API_NAME"; } else if ("DATE".equals(search.getSearchType())) { - dataSql = "SELECT TO_CHAR(STAT_TIME,'YYYY-MM-DD') AS STAT_TIME "; + dataSql = "SELECT TO_CHAR(STAT_TIME,'YYYY-MM-DD') AS STAT_TIME, '' AS APIDESC "; dataSql += getQueryBody(search); dataSql += " GROUP BY TO_CHAR(STAT_TIME,'YYYY-MM-DD')"; dataSql += " ORDER BY STAT_TIME"; @@ -85,7 +85,7 @@ public class ApiUseStatsService StringBuilder where = buildNativeWhere(search); String totalSql; - totalSql = "SELECT '합계' AS ORGNAME "; + totalSql = "SELECT '합계' AS ORGNAME, '' AS APIDESC "; totalSql += getQueryBody(search); Query totalQuery = entityManager.createNativeQuery(totalSql); @@ -109,6 +109,7 @@ public class ApiUseStatsService + " FROM (" + " SELECT A.STAT_TIME " + " , A.API_NAME" + + " , C.EAISVCDESC" + " , A.CLIENT_ID " + " , A.TOTAL_CNT" + " , A.SUCCESS_CNT" @@ -118,13 +119,13 @@ public class ApiUseStatsService + " , A.MIN_RESP_TIME" + " , A.MAX_RESP_TIME" + " , CASE WHEN API_NAME LIKE '%1' THEN SUBSTR(OUTBOUND_ADAPTER,2,3) ELSE SUBSTR(INBOUND_ADAPTER,2,3) END AS ORG_CODE" - + " FROM API_STATS_DAY A " + + " FROM API_STATS_DAY A LEFT OUTER JOIN TSEAIHE01 C ON A.API_NAME = C.EAISVCNAME " + " WHERE A.STAT_TIME >= :searchStartDate " + " AND A.STAT_TIME <= :searchEndDate "; if (StringUtils.isNotBlank(search.getSearchApiName())) { - dataSql += " AND A.API_NAME LIKE :searchApiName "; + dataSql += " AND UPPER(A.API_NAME) LIKE :searchApiName "; } dataSql += " ) A" @@ -160,15 +161,16 @@ public class ApiUseStatsService private ApiStatsUI toVO(Object[] row) { ApiStatsUI vo = new ApiStatsUI(); vo.setOrgName(StringUtils.toString(row[0])); - vo.setTotalCnt(StringUtils.toLong(row[1])); - vo.setSuccessCnt(StringUtils.toLong(row[2])); - vo.setSuccessRate(StringUtils.toDecimal(row[3]).setScale(2, RoundingMode.HALF_UP)); - vo.setFailRate(StringUtils.toDecimal(row[4]).setScale(2, RoundingMode.HALF_UP)); - vo.setTimeoutCnt(StringUtils.toLong(row[5])); - vo.setSystemErrCnt(StringUtils.toLong(row[6])); - vo.setAvgRespTime(StringUtils.toDecimal(row[7])); - vo.setMinRespTime(StringUtils.toDecimal(row[8])); - vo.setMaxRespTime(StringUtils.toDecimal(row[9])); + vo.setApiDesc(StringUtils.toString(row[1])); + vo.setTotalCnt(StringUtils.toLong(row[2])); + vo.setSuccessCnt(StringUtils.toLong(row[3])); + vo.setSuccessRate(StringUtils.toDecimal(row[4]).setScale(2, RoundingMode.HALF_UP)); + vo.setFailRate(StringUtils.toDecimal(row[5]).setScale(2, RoundingMode.HALF_UP)); + vo.setTimeoutCnt(StringUtils.toLong(row[6])); + vo.setSystemErrCnt(StringUtils.toLong(row[7])); + vo.setAvgRespTime(StringUtils.toDecimal(row[8])); + vo.setMinRespTime(StringUtils.toDecimal(row[9])); + vo.setMaxRespTime(StringUtils.toDecimal(row[10])); return vo; } diff --git a/src/main/java/com/eactive/ext/kjb/statistics/ApiStatsDayController.java b/src/main/java/com/eactive/ext/kjb/statistics/ApiStatsDayController.java index 01bba22..a178f00 100644 --- a/src/main/java/com/eactive/ext/kjb/statistics/ApiStatsDayController.java +++ b/src/main/java/com/eactive/ext/kjb/statistics/ApiStatsDayController.java @@ -4,6 +4,8 @@ import java.io.IOException; import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.List; +import java.util.Map; +import java.util.Set; import java.util.stream.Collectors; import javax.servlet.http.HttpServletResponse; @@ -18,7 +20,10 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; +import com.eactive.eai.rms.common.datasource.DataSourceContextHolder; +import com.eactive.eai.rms.common.datasource.DataSourceTypeManager; import com.eactive.eai.rms.common.vo.GridResponse; +import com.eactive.eai.rms.data.entity.onl.apim.obp.ObpGwMetricJpaDAO; import com.eactive.eai.rms.data.entity.onl.kjb.statistics.ApiStatsDay; import com.eactive.eai.rms.data.entity.onl.kjb.statistics.ApiStatsDayService; import com.eactive.ext.kjb.statistics.mapping.ApiStatsUIMapper; @@ -38,6 +43,7 @@ public class ApiStatsDayController { private final ApiStatsDayService service; private final ApiStatsUIMapper mapper; private final ApiStatsExcelExportService excelExportService; + private final ObpGwMetricJpaDAO apiNameDao; @GetMapping(value = "/onl/kjb/statistics/apiStatsDayMan.view") public String view() { @@ -66,9 +72,38 @@ public class ApiStatsDayController { @PostMapping(value = "/onl/kjb/statistics/apiStatsDayMan.json", params = "cmd=LIST_SUMMARY") public ResponseEntity> selectSummaryList(ApiStatsSearch search, Pageable pageable) { Page page = service.selectSummaryList(search, pageable); + fillApiDesc(page.getContent()); return ResponseEntity.ok(new GridResponse<>(page)); } + /** + * 요약 통계 행의 apiName(=API ID)으로 TSEAIHE01 을 조회하여 API 명(EAISVCDESC)을 채운다. + * 매칭되는 항목이 없으면 공란으로 둔다. + */ + private void fillApiDesc(List rows) { + if (rows == null || rows.isEmpty()) { + return; + } + + Set apiIds = rows.stream() + .map(ApiStatsUI::getApiName) + .filter(id -> id != null && !id.isEmpty()) + .collect(Collectors.toSet()); + + if (apiIds.isEmpty()) { + return; + } + + // API_STATS_DAY 와 동일한 APIGW 스키마에서 조회 + DataSourceContextHolder.setDataSourceType( + DataSourceTypeManager.getDataSourceType(DataSourceTypeManager.APIGW)); + + Map nameMap = apiNameDao.selectApiNames(apiIds); + for (ApiStatsUI row : rows) { + row.setApiDesc(nameMap.get(row.getApiName())); + } + } + @PostMapping(value = "/onl/kjb/statistics/apiStatsDayMan.json", params = "cmd=EXCEL_EXPORT") public void exportToExcel(ApiStatsSearch search, HttpServletResponse response) throws IOException { log.info("Excel export started - search: {}", search); diff --git a/src/main/java/com/eactive/ext/kjb/statistics/ApiStatsHourController.java b/src/main/java/com/eactive/ext/kjb/statistics/ApiStatsHourController.java index 20b2a9b..b02d003 100644 --- a/src/main/java/com/eactive/ext/kjb/statistics/ApiStatsHourController.java +++ b/src/main/java/com/eactive/ext/kjb/statistics/ApiStatsHourController.java @@ -4,6 +4,8 @@ import java.io.IOException; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.List; +import java.util.Map; +import java.util.Set; import java.util.stream.Collectors; import javax.servlet.http.HttpServletResponse; @@ -18,7 +20,10 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; +import com.eactive.eai.rms.common.datasource.DataSourceContextHolder; +import com.eactive.eai.rms.common.datasource.DataSourceTypeManager; import com.eactive.eai.rms.common.vo.GridResponse; +import com.eactive.eai.rms.data.entity.onl.apim.obp.ObpGwMetricJpaDAO; import com.eactive.eai.rms.data.entity.onl.kjb.statistics.ApiStatsHour; import com.eactive.eai.rms.data.entity.onl.kjb.statistics.ApiStatsHourService; import com.eactive.ext.kjb.statistics.mapping.ApiStatsUIMapper; @@ -38,6 +43,7 @@ public class ApiStatsHourController { private final ApiStatsHourService service; private final ApiStatsUIMapper mapper; private final ApiStatsExcelExportService excelExportService; + private final ObpGwMetricJpaDAO apiNameDao; @GetMapping(value = "/onl/kjb/statistics/apiStatsHourMan.view") public String view() { @@ -66,9 +72,38 @@ public class ApiStatsHourController { @PostMapping(value = "/onl/kjb/statistics/apiStatsHourMan.json", params = "cmd=LIST_SUMMARY") public ResponseEntity> selectSummaryList(ApiStatsSearch search, Pageable pageable) { Page page = service.selectSummaryList(search, pageable); + fillApiDesc(page.getContent()); return ResponseEntity.ok(new GridResponse<>(page)); } + /** + * 요약 통계 행의 apiName(=API ID)으로 TSEAIHE01 을 조회하여 API 명(EAISVCDESC)을 채운다. + * 매칭되는 항목이 없으면 공란으로 둔다. + */ + private void fillApiDesc(List rows) { + if (rows == null || rows.isEmpty()) { + return; + } + + Set apiIds = rows.stream() + .map(ApiStatsUI::getApiName) + .filter(id -> id != null && !id.isEmpty()) + .collect(Collectors.toSet()); + + if (apiIds.isEmpty()) { + return; + } + + // API_STATS_HOUR 와 동일한 APIGW 스키마에서 조회 + DataSourceContextHolder.setDataSourceType( + DataSourceTypeManager.getDataSourceType(DataSourceTypeManager.APIGW)); + + Map nameMap = apiNameDao.selectApiNames(apiIds); + for (ApiStatsUI row : rows) { + row.setApiDesc(nameMap.get(row.getApiName())); + } + } + @PostMapping(value = "/onl/kjb/statistics/apiStatsHourMan.json", params = "cmd=EXCEL_EXPORT") public void exportToExcel(ApiStatsSearch search, HttpServletResponse response) throws IOException { log.info("Excel export started - search: {}", search); diff --git a/src/main/java/com/eactive/ext/kjb/statistics/ApiStatsMinuteController.java b/src/main/java/com/eactive/ext/kjb/statistics/ApiStatsMinuteController.java index a153172..c8bc366 100644 --- a/src/main/java/com/eactive/ext/kjb/statistics/ApiStatsMinuteController.java +++ b/src/main/java/com/eactive/ext/kjb/statistics/ApiStatsMinuteController.java @@ -4,6 +4,8 @@ import java.io.IOException; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.List; +import java.util.Map; +import java.util.Set; import java.util.stream.Collectors; import javax.servlet.http.HttpServletResponse; @@ -18,7 +20,10 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; +import com.eactive.eai.rms.common.datasource.DataSourceContextHolder; +import com.eactive.eai.rms.common.datasource.DataSourceTypeManager; import com.eactive.eai.rms.common.vo.GridResponse; +import com.eactive.eai.rms.data.entity.onl.apim.obp.ObpGwMetricJpaDAO; import com.eactive.eai.rms.data.entity.onl.kjb.statistics.ApiStatsMinute; import com.eactive.eai.rms.data.entity.onl.kjb.statistics.ApiStatsMinuteService; import com.eactive.ext.kjb.statistics.mapping.ApiStatsUIMapper; @@ -38,6 +43,7 @@ public class ApiStatsMinuteController { private final ApiStatsMinuteService service; private final ApiStatsUIMapper mapper; private final ApiStatsExcelExportService excelExportService; + private final ObpGwMetricJpaDAO apiNameDao; @GetMapping(value = "/onl/kjb/statistics/apiStatsMinuteMan.view") public String view() { @@ -66,9 +72,38 @@ public class ApiStatsMinuteController { @PostMapping(value = "/onl/kjb/statistics/apiStatsMinuteMan.json", params = "cmd=LIST_SUMMARY") public ResponseEntity> selectSummaryList(ApiStatsSearch search, Pageable pageable) { Page page = service.selectSummaryList(search, pageable); + fillApiDesc(page.getContent()); return ResponseEntity.ok(new GridResponse<>(page)); } + /** + * 요약 통계 행의 apiName(=API ID)으로 TSEAIHE01 을 조회하여 API 명(EAISVCDESC)을 채운다. + * 매칭되는 항목이 없으면 공란으로 둔다. + */ + private void fillApiDesc(List rows) { + if (rows == null || rows.isEmpty()) { + return; + } + + Set apiIds = rows.stream() + .map(ApiStatsUI::getApiName) + .filter(id -> id != null && !id.isEmpty()) + .collect(Collectors.toSet()); + + if (apiIds.isEmpty()) { + return; + } + + // API_STATS_MINUTE 와 동일한 APIGW 스키마에서 조회 + DataSourceContextHolder.setDataSourceType( + DataSourceTypeManager.getDataSourceType(DataSourceTypeManager.APIGW)); + + Map nameMap = apiNameDao.selectApiNames(apiIds); + for (ApiStatsUI row : rows) { + row.setApiDesc(nameMap.get(row.getApiName())); + } + } + @PostMapping(value = "/onl/kjb/statistics/apiStatsMinuteMan.json", params = "cmd=EXCEL_EXPORT") public void exportToExcel(ApiStatsSearch search, HttpServletResponse response) throws IOException { log.info("Excel export started - search: {}", search); diff --git a/src/main/java/com/eactive/ext/kjb/statistics/ApiStatsMonthController.java b/src/main/java/com/eactive/ext/kjb/statistics/ApiStatsMonthController.java index 5f18d85..18ce3ea 100644 --- a/src/main/java/com/eactive/ext/kjb/statistics/ApiStatsMonthController.java +++ b/src/main/java/com/eactive/ext/kjb/statistics/ApiStatsMonthController.java @@ -4,6 +4,8 @@ import java.io.IOException; import java.time.YearMonth; import java.time.format.DateTimeFormatter; import java.util.List; +import java.util.Map; +import java.util.Set; import java.util.stream.Collectors; import javax.servlet.http.HttpServletResponse; @@ -18,7 +20,10 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; +import com.eactive.eai.rms.common.datasource.DataSourceContextHolder; +import com.eactive.eai.rms.common.datasource.DataSourceTypeManager; import com.eactive.eai.rms.common.vo.GridResponse; +import com.eactive.eai.rms.data.entity.onl.apim.obp.ObpGwMetricJpaDAO; import com.eactive.eai.rms.data.entity.onl.kjb.statistics.ApiStatsMonth; import com.eactive.eai.rms.data.entity.onl.kjb.statistics.ApiStatsMonthService; import com.eactive.ext.kjb.statistics.mapping.ApiStatsUIMapper; @@ -38,6 +43,7 @@ public class ApiStatsMonthController { private final ApiStatsMonthService service; private final ApiStatsUIMapper mapper; private final ApiStatsExcelExportService excelExportService; + private final ObpGwMetricJpaDAO apiNameDao; @GetMapping(value = "/onl/kjb/statistics/apiStatsMonthMan.view") public String view() { @@ -66,9 +72,38 @@ public class ApiStatsMonthController { @PostMapping(value = "/onl/kjb/statistics/apiStatsMonthMan.json", params = "cmd=LIST_SUMMARY") public ResponseEntity> selectSummaryList(ApiStatsSearch search, Pageable pageable) { Page page = service.selectSummaryList(search, pageable); + fillApiDesc(page.getContent()); return ResponseEntity.ok(new GridResponse<>(page)); } + /** + * 요약 통계 행의 apiName(=API ID)으로 TSEAIHE01 을 조회하여 API 명(EAISVCDESC)을 채운다. + * 매칭되는 항목이 없으면 공란으로 둔다. + */ + private void fillApiDesc(List rows) { + if (rows == null || rows.isEmpty()) { + return; + } + + Set apiIds = rows.stream() + .map(ApiStatsUI::getApiName) + .filter(id -> id != null && !id.isEmpty()) + .collect(Collectors.toSet()); + + if (apiIds.isEmpty()) { + return; + } + + // API_STATS_MONTH 와 동일한 APIGW 스키마에서 조회 + DataSourceContextHolder.setDataSourceType( + DataSourceTypeManager.getDataSourceType(DataSourceTypeManager.APIGW)); + + Map nameMap = apiNameDao.selectApiNames(apiIds); + for (ApiStatsUI row : rows) { + row.setApiDesc(nameMap.get(row.getApiName())); + } + } + @PostMapping(value = "/onl/kjb/statistics/apiStatsMonthMan.json", params = "cmd=EXCEL_EXPORT") public void exportToExcel(ApiStatsSearch search, HttpServletResponse response) throws IOException { log.info("Excel export started - search: {}", search); diff --git a/src/main/java/com/eactive/ext/kjb/statistics/ApiStatsYearController.java b/src/main/java/com/eactive/ext/kjb/statistics/ApiStatsYearController.java index 8b2fb2a..8915357 100644 --- a/src/main/java/com/eactive/ext/kjb/statistics/ApiStatsYearController.java +++ b/src/main/java/com/eactive/ext/kjb/statistics/ApiStatsYearController.java @@ -3,6 +3,8 @@ package com.eactive.ext.kjb.statistics; import java.io.IOException; import java.time.Year; import java.util.List; +import java.util.Map; +import java.util.Set; import java.util.stream.Collectors; import javax.servlet.http.HttpServletResponse; @@ -17,7 +19,10 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; +import com.eactive.eai.rms.common.datasource.DataSourceContextHolder; +import com.eactive.eai.rms.common.datasource.DataSourceTypeManager; import com.eactive.eai.rms.common.vo.GridResponse; +import com.eactive.eai.rms.data.entity.onl.apim.obp.ObpGwMetricJpaDAO; import com.eactive.eai.rms.data.entity.onl.kjb.statistics.ApiStatsYear; import com.eactive.eai.rms.data.entity.onl.kjb.statistics.ApiStatsYearService; import com.eactive.ext.kjb.statistics.mapping.ApiStatsUIMapper; @@ -37,6 +42,7 @@ public class ApiStatsYearController { private final ApiStatsYearService service; private final ApiStatsUIMapper mapper; private final ApiStatsExcelExportService excelExportService; + private final ObpGwMetricJpaDAO apiNameDao; @GetMapping(value = "/onl/kjb/statistics/apiStatsYearMan.view") public String view() { @@ -65,9 +71,38 @@ public class ApiStatsYearController { @PostMapping(value = "/onl/kjb/statistics/apiStatsYearMan.json", params = "cmd=LIST_SUMMARY") public ResponseEntity> selectSummaryList(ApiStatsSearch search, Pageable pageable) { Page page = service.selectSummaryList(search, pageable); + fillApiDesc(page.getContent()); return ResponseEntity.ok(new GridResponse<>(page)); } + /** + * 요약 통계 행의 apiName(=API ID)으로 TSEAIHE01 을 조회하여 API 명(EAISVCDESC)을 채운다. + * 매칭되는 항목이 없으면 공란으로 둔다. + */ + private void fillApiDesc(List rows) { + if (rows == null || rows.isEmpty()) { + return; + } + + Set apiIds = rows.stream() + .map(ApiStatsUI::getApiName) + .filter(id -> id != null && !id.isEmpty()) + .collect(Collectors.toSet()); + + if (apiIds.isEmpty()) { + return; + } + + // API_STATS_YEAR 와 동일한 APIGW 스키마에서 조회 + DataSourceContextHolder.setDataSourceType( + DataSourceTypeManager.getDataSourceType(DataSourceTypeManager.APIGW)); + + Map nameMap = apiNameDao.selectApiNames(apiIds); + for (ApiStatsUI row : rows) { + row.setApiDesc(nameMap.get(row.getApiName())); + } + } + @PostMapping(value = "/onl/kjb/statistics/apiStatsYearMan.json", params = "cmd=EXCEL_EXPORT") public void exportToExcel(ApiStatsSearch search, HttpServletResponse response) throws IOException { log.info("Excel export started - search: {}", search); diff --git a/src/main/java/com/eactive/ext/kjb/statistics/ui/ApiStatsUI.java b/src/main/java/com/eactive/ext/kjb/statistics/ui/ApiStatsUI.java index 83ee405..4f8fa2b 100644 --- a/src/main/java/com/eactive/ext/kjb/statistics/ui/ApiStatsUI.java +++ b/src/main/java/com/eactive/ext/kjb/statistics/ui/ApiStatsUI.java @@ -11,6 +11,7 @@ import lombok.Data; public class ApiStatsUI { private String statTime; private String apiName; + private String apiDesc; private String gwInstanceId; private String bizDivCode; private String clientId;