diff --git a/src/main/java/geoinfo/main/main/MainController.java b/src/main/java/geoinfo/main/main/MainController.java index ad217a85..d1bed21e 100644 --- a/src/main/java/geoinfo/main/main/MainController.java +++ b/src/main/java/geoinfo/main/main/MainController.java @@ -996,21 +996,7 @@ public class MainController // 2017.10.17 dhlee session ip 브라우져 검증 추가 String ip = InetAddress.getLocalHost().toString(); // IP String agent = request.getHeader("User-Agent"); // 브라우져 -// String brower = ""; -// -// if (agent != null) { -// if (agent.indexOf("Trident") > -1) { -// brower = "MSIE"; -// } else if (agent.indexOf("Chrome") > -1) { -// brower = "Chrome"; -// } else if (agent.indexOf("Opera") > -1) { -// brower = "Opera"; -// } else if (agent.indexOf("iPhone") > -1 && agent.indexOf("Mobile") > -1) { -// brower = "iPhone"; -// } else if (agent.indexOf("Android") > -1 && agent.indexOf("Mobile") > -1) { -// brower = "Android"; -// } -// } + String id = request.getSession().getAttribute("USERID").toString(); String s_ip = request.getSession().getAttribute("USERIP").toString(); String s_agent = request.getSession().getAttribute("USERAGENT").toString(); @@ -1064,8 +1050,6 @@ public class MainController month = now.get(Calendar.MONTH) + 1; date = now.get(Calendar.DATE); - // System.out.println(year+"년 "+month+"월 "+date+"일 "+ hour + - // "시 "+mm+"분 "); dayofweek = now.get(Calendar.DAY_OF_WEEK); map.put("year", year); @@ -1105,634 +1089,16 @@ public class MainController String visitors = mainService.selectVisitors(); // 방문자수 String registrant = mainService.selectRegistrant(); // 등록자수 - int total_cnt = mainService.selecrTotal_cnt(); // 총 시추공수 -/* - * 20230216 사용하지 않는 부문으로 판단 - * int cnt01 = 0; - int cnt02 = 0; - int cnt03 = 0; - int cnt04 = 0; - int cnt05 = 0; - int cnt06 = 0; - int cnt11 = 0; - int cnt12 = 0; - int cnt13 = 0; - int cnt14 = 0; - int cnt15 = 0; - int cnt16 = 0; - int cnt17 = 0; - int cnt18 = 0; - int cnt201 = 0; - int cnt202 = 0; - int cnt203 = 0; - int cnt204 = 0; - int cnt205 = 0; - int cnt206 = 0; - int cnt207 = 0; - int cnt208 = 0; - int cnt209 = 0; - int cnt210 = 0; - int cnt211 = 0; - int cnt212 = 0; - int cnt213 = 0; - int cnt214 = 0; - int cnt215 = 0; - int cnt216 = 0; - int cnt_not = 0; - String code_ex1 = "070,363"; // 국토해양부 서울청 - String code_ex2 = "025,413"; // 국토해양부 부산청 - String code_ex3 = "001,394"; // 국토해양부 대전청 - String code_ex4 = "013,367"; // 국토해양부 익산청 - String code_ex5 = "056,365"; // 국토해양부 원주청 - // 11개 해양항만청 - String code_ex6 = "801,802,803,804,805,806,807,808,809,810,811,556,401,416,399,353"; - - String code_ex11 = "004,051,362"; // 한국토지주택공사 - String code_ex12 = "031"; // 한국도로공사 - String code_ex13 = "134"; // 한국수자원공사 - String code_ex14 = "400,703"; // 연안계획과 - String code_ex15 = "131"; // 한국철도시설공단 - String code_ex16 = "082"; // 한국수력원자력 - String code_ex17 = "305"; // 한국공항공사 - String code_ex18 = "702"; // 한국항만공사 - - String code_ex201 = "419"; // 서울특별시 - String code_ex202 = "088"; // 부산광역시 - String code_ex203 = "263"; // 대구광역시 - String code_ex204 = "412"; // 인천광역시 - String code_ex205 = "077"; // 광주광역시 - String code_ex206 = "391"; // 대전광역시 - String code_ex207 = "048"; // 울산광역시 - - String code_ex208 = "554"; // 경기도 - String code_ex209 = "065"; // 강원도 - String code_ex210 = "548"; // 충청남도 - String code_ex211 = "902"; // 충청북도 - String code_ex212 = "903"; // 경상남도 - String code_ex213 = "904"; // 경상북도 - String code_ex214 = "127"; // 전라남도 - String code_ex215 = "905"; // 전라북도 - String code_ex216 = "907"; // 제주도 -*/ - // //시추공수 - // ///////////////////////////////////////////////////////////////////////////////// - // 국토해양부 서울청 - /*try - { - map.put("code", code_ex1); - int resultinfo = cnt01 = mainService.selectInformationInfo(map); - cnt01 = resultinfo; - mv.addObject("CNT1", resultinfo); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - // 국토해양부 부산청 - try - { - map.put("code", code_ex2); - int resultinfo = cnt02 = mainService.selectInformationInfo(map); - mv.addObject("CNT2", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - - // 국토해양부 대전청 - try - { - map.put("code", code_ex3); - int resultinfo = cnt03 = mainService.selectInformationInfo(map); - mv.addObject("CNT3", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - - // 국토해양부 익산청 - try - { - map.put("code", code_ex4); - int resultinfo = cnt04 = mainService.selectInformationInfo(map); - mv.addObject("CNT4", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - - // 국토해양부 원주청 - try - { - map.put("code", code_ex5); - int resultinfo = cnt05 = mainService.selectInformationInfo(map); - mv.addObject("CNT5", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - - // 11개 해양항만청 - try - { - map.put("code", code_ex6); - int resultinfo = cnt06 = mainService.selectInformationInfo(map); - mv.addObject("CNT6", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - // 합계 - int sum1 = (cnt01) + (cnt02) + (cnt03) + (cnt04) + (cnt05) + (cnt06); - mv.addObject("SUM1", getFormattedMoney(Integer.toString(sum1))); - - // 한국토지주택공사 - try - { - map.put("code", code_ex11); - int resultinfo = cnt11 = mainService.selectInformationInfo(map); - mv.addObject("CNT11", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - - // 한국도로공사 - try - { - map.put("code", code_ex12); - int resultinfo = cnt12 = mainService.selectInformationInfo(map); - mv.addObject("CNT12", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - - // 한국수자원공사 - try - { - map.put("code", code_ex13); - int resultinfo = cnt13 = mainService.selectInformationInfo(map); - mv.addObject("CNT13", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - - // 연안계획과 - try - { - map.put("code", code_ex14); - int resultinfo = cnt14 = mainService.selectInformationInfo(map); - mv.addObject("CNT14", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - - // 한국철도시설공단 - try - { - map.put("code", code_ex15); - int resultinfo = cnt15 = mainService.selectInformationInfo(map); - mv.addObject("CNT15", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - - // 한국수력원자력 - try - { - map.put("code", code_ex16); - int resultinfo = cnt16 = mainService.selectInformationInfo(map); - mv.addObject("CNT16", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - - // 한국공항공사 - try - { - map.put("code", code_ex17); - int resultinfo = cnt17 = mainService.selectInformationInfo(map); - mv.addObject("CNT17", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - - // 한국항만공사 - try - { - map.put("code", code_ex18); - int resultinfo = cnt18 = mainService.selectInformationInfo(map); - mv.addObject("CNT18", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - // 합계 - int sum2 = (cnt11) + (cnt12) + (cnt13) + (cnt14) + (cnt15) + (cnt16) + (cnt17) + (cnt18); - mv.addObject("SUM2", getFormattedMoney(Integer.toString(sum2))); - int sum3 = sum1 + sum2; - mv.addObject("SUM3", getFormattedMoney(Integer.toString(sum3))); - - // 서울특별시 - try - { - map.put("code", code_ex201); - int resultinfo = cnt201 = mainService.selectInformationInfo(map); - mv.addObject("CNT201", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - - // 부산광역시 - try - { - map.put("code", code_ex202); - int resultinfo = cnt202 = mainService.selectInformationInfo(map); - mv.addObject("CNT202", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - - // 대구광역시 - try - { - map.put("code", code_ex203); - int resultinfo = cnt203 = mainService.selectInformationInfo(map); - mv.addObject("CNT203", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - - // 인천광역시 - try - { - map.put("code", code_ex204); - int resultinfo = cnt204 = mainService.selectInformationInfo(map); - mv.addObject("CNT204", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - - // 광주광역시 - try - { - map.put("code", code_ex205); - int resultinfo = cnt205 = mainService.selectInformationInfo(map); - mv.addObject("CNT205", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - - // 대전광역시 - try - { - map.put("code", code_ex206); - int resultinfo = cnt206 = mainService.selectInformationInfo(map); - mv.addObject("CNT206", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - - // 울산광역시 - try - { - map.put("code", code_ex207); - int resultinfo = cnt207 = mainService.selectInformationInfo(map); - mv.addObject("CNT207", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - - // 경기도 - try - { - map.put("code", code_ex208); - int resultinfo = cnt208 = mainService.selectInformationInfo(map); - mv.addObject("CNT208", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - // 강원도 - try - { - map.put("code", code_ex209); - int resultinfo = cnt209 = mainService.selectInformationInfo(map); - mv.addObject("CNT209", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - - // 충청남도 - try - { - map.put("code", code_ex210); - int resultinfo = cnt210 = mainService.selectInformationInfo(map); - mv.addObject("CNT210", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - // 충청북도 - try - { - map.put("code", code_ex211); - int resultinfo = cnt211 = mainService.selectInformationInfo(map); - mv.addObject("CNT211", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - - // 경상남도 - try - { - map.put("code", code_ex212); - int resultinfo = cnt212 = mainService.selectInformationInfo(map); - mv.addObject("CNT212", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - - // 경상북도 - try - { - map.put("code", code_ex213); - int resultinfo = cnt213 = mainService.selectInformationInfo(map); - mv.addObject("CNT213", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - - // 전라남도 - try - { - map.put("code", code_ex214); - int resultinfo = cnt214 = mainService.selectInformationInfo(map); - mv.addObject("CNT214", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - - // 전라북도 - try - { - map.put("code", code_ex215); - int resultinfo = cnt215 = mainService.selectInformationInfo(map); - mv.addObject("CNT215", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - - // 제주도 - try - { - map.put("code", code_ex216); - int resultinfo = cnt216 = mainService.selectInformationInfo(map); - mv.addObject("CNT216", getFormattedMoney(resultinfo)); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - } - - // 합계 - int sum4 = (cnt201) + (cnt202) + (cnt203) + (cnt204) + (cnt205) + (cnt206) + (cnt207) + (cnt208) + (cnt209) + (cnt210) + (cnt211) + (cnt212) + (cnt213) + (cnt214) + (cnt215) + (cnt216); - mv.addObject("SUM4", getFormattedMoney(Integer.toString(sum4))); - - // 미지정 - try - { - String code = code_ex1 + "," + code_ex2 + "," + code_ex3 + "," + code_ex4 + "," + code_ex5 + "," + code_ex6 + "," + code_ex11 + "," + code_ex12 + "," + code_ex13 + "," + code_ex14 + "," + code_ex15 + "," + code_ex16 + "," - + code_ex17 + "," + code_ex18 + "," + code_ex201 + "," + code_ex202 + "," + code_ex203 + "," + code_ex204 + "," + code_ex205 + "," + code_ex206 + "," + code_ex207 + "," + code_ex208 + "," + code_ex209 + "," + code_ex210 - + "," + code_ex211 + "," + code_ex212 + "," + code_ex213 + "," + code_ex214 + "," + code_ex215 + "," + code_ex216; - - map.put("code", code); - int resultinfo = cnt_not = mainService.selectInformationInfoNon(map); - mv.addObject("CNTNOT", getFormattedMoney(resultinfo)); - int cnt_not_temp = (cnt_not); - int sum5 = sum3 + sum4 + cnt_not_temp; - - mv.addObject("SUM5", getFormattedMoney(Integer.toString(sum5))); - } - catch (NumberFormatException e) { - log.debug("error", e); - } - catch (IndexOutOfBoundsException e) { - log.debug("error", e); - } - catch (Exception e) { - log.debug("error", e); - }*/ mv.addObject("cls", cls); mv.addObject("mod_cnt", mod_cnt); mv.addObject("input_cnt", input_cnt); mv.addObject("visitors", visitors); mv.addObject("registrant", registrant); - mv.addObject("total_cnt", total_cnt); mv.addObject("year", year); mv.addObject("month", month); mv.addObject("date", date); -// mv.addObject("sessionId", request.getSession().getId()); -// mv.addObject("name", request.getSession().getAttribute("userId")); if (flag) { mv.addObject("dupLogin", flag); diff --git a/src/main/resources/egovframework/egovProps/geoinfo.properties b/src/main/resources/egovframework/egovProps/geoinfo.properties index 642a8028..3faa9526 100644 --- a/src/main/resources/egovframework/egovProps/geoinfo.properties +++ b/src/main/resources/egovframework/egovProps/geoinfo.properties @@ -45,8 +45,8 @@ Globals.PAGELIST = 10 Globals.FileCreatePathZip = c:\\test2\\ # Active X # \uc9c0\ub3c4\uc11c\ubc84 -#Globals.OcxHostUrl = http://218.232.234.166/Server/ -Globals.OcxHostUrl = http://172.12.192.44/Server/ +Globals.OcxHostUrl = http://218.232.234.166/Server/ +#Globals.OcxHostUrl = http://172.12.192.44/Server/ Globals.OcxMapFileVer = 2,0,0,3 Globals.OcxMapClassID = CC13D8F5-F406-4833-855D-F44DA7875776 diff --git a/src/main/webapp/WEB-INF/views/home/index.jsp b/src/main/webapp/WEB-INF/views/home/index.jsp index 8988f40e..80b9008c 100644 --- a/src/main/webapp/WEB-INF/views/home/index.jsp +++ b/src/main/webapp/WEB-INF/views/home/index.jsp @@ -51,6 +51,10 @@ if(val) val.focus(); }); /* == 공지팝업 로드 끝 == */ + + const commaNumberEles = document.getElementsByClassName("comma-number"); + for (i = 0; i < commaNumberEles.length; i++) + commaNumberEles[i].textContent = addComma(commaNumberEles[i].textContent); }); function dupLoginCheck(flag) { @@ -239,6 +243,38 @@ // url = "noticeView.do?idx="+idx; parent.location.href="topMenuSelect.do?url=pdsView&idx="+idx; } + + function addComma( val ) { + val = String(val); + + if( typeof val == "undefined" || val == null || val == "" ) { + return "0"; + } + var decimal = ''; + var num = val.replace(/,/gi, ""); + + //음수이면 잠깐 부호를 떼었다가 나중에 붙여준다. + var isNegative = false; + if( num.indexOf('-') == 0 ) { + isNegative = true; + num = num.replace(/-/gi, ""); + } + + if( num.indexOf('.') > -1 ) { + var arrSplitDecimalPoint = num.split('.'); + num = arrSplitDecimalPoint[0]; + decimal = '.' + arrSplitDecimalPoint[1]; + } + + var num2 = num.split(/(?=(?:\d{3})+$)/).join(",") + decimal; + + //음수이면 잠깐 떼었던 부호를 붙여준다. + if( isNegative == true ) { + num2 = "-" + num2; + } + + return num2; // "1,234,567" + }
@@ -314,7 +356,7 @@