diff --git a/Copying b/Copying new file mode 100644 index 00000000..7ec2c2b9 --- /dev/null +++ b/Copying @@ -0,0 +1 @@ + - to "C:\Users\dbnt\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\geoinfo_eGov_work\WEB-INF\views\drilling\statistics\drilling_statistics.jsp" diff --git a/SUCCESS b/SUCCESS new file mode 100644 index 00000000..e3d49c45 --- /dev/null +++ b/SUCCESS @@ -0,0 +1 @@ + - diff --git a/pom.xml b/pom.xml index 33ed0de5..864c4a73 100644 --- a/pom.xml +++ b/pom.xml @@ -455,13 +455,6 @@ commons-lang3 3.12.0 - - - - com.oracle.database.jdbc - ojdbc8 - 23.2.0.0 - diff --git a/src/main/java/geoinfo/drilling/input/service/DrillingInputMapper.java b/src/main/java/geoinfo/drilling/input/service/DrillingInputMapper.java index bc6d0ef7..e47b33aa 100644 --- a/src/main/java/geoinfo/drilling/input/service/DrillingInputMapper.java +++ b/src/main/java/geoinfo/drilling/input/service/DrillingInputMapper.java @@ -23,6 +23,14 @@ public interface DrillingInputMapper { public int updateProjectCodeAndProjectStateCodeByCid(HashMap params) throws SQLException; public int updateProjectCodeAndProjectStateCodeByProjectCode(HashMap params) throws SQLException; + + /** + * 건설현장 정보 상태 변경 이력을 등록합니다. + * @param params + * @return + * @throws SQLException + */ + public int insertConstructSiteHist(HashMap params) throws SQLException; } diff --git a/src/main/java/geoinfo/drilling/input/service/impl/DrillingInputServiceImpl.java b/src/main/java/geoinfo/drilling/input/service/impl/DrillingInputServiceImpl.java index 0fda949b..cae37cbf 100644 --- a/src/main/java/geoinfo/drilling/input/service/impl/DrillingInputServiceImpl.java +++ b/src/main/java/geoinfo/drilling/input/service/impl/DrillingInputServiceImpl.java @@ -137,14 +137,6 @@ public class DrillingInputServiceImpl implements DrillingInputService { params.put("userId", userId); try { - /* - List sPGetTblCsiByCidParams = drillingInputMapper.sPGetTblCsiByCid( params ); - - if( sPGetTblCsiByCidParams.size() == 0 ) { - return params; - } - EgovMap tbl = sPGetTblCsiByCidParams.get(0); - */ EgovMap tbl = drillingInputMapper.getItemByCid( params ); if( tbl != null ) { @@ -161,7 +153,22 @@ public class DrillingInputServiceImpl implements DrillingInputService { throw new Exception( "해당 프로젝트는 이미 다른 프로젝트와 연결되어 있습니다." ); } } - + + if (nResult > 0) { // 업데이트가 성공했을 경우에만 이력 기록 + HashMap histParams = new HashMap(); + + // 이전 상태값 (EgovMap은 보통 camelCase로 키를 반환합니다) + Object preStateCode = tbl.get("projectStateCode"); + + histParams.put("CID", params.get("CID")); + histParams.put("PROJECT_CODE", params.get("PROJECT_CODE")); + histParams.put("PRE_PROJECT_STATE_CODE", preStateCode != null ? preStateCode.toString() : null); // 이전 상태 + histParams.put("PROJECT_STATE_CODE", params.get("PROJECT_STATE_CODE")); // 현재 변경된 상태 + histParams.put("MOD_REASON", "지반정보 등록 프로젝트 연결"); // 변경 사유 (필요에 따라 파라미터로 받아서 설정 가능) + histParams.put("userId", userId); + + drillingInputMapper.insertConstructSiteHist(histParams); + } } return params; } catch (SQLException e) { diff --git a/src/main/java/geoinfo/drilling/statistics/DrillingStatisticsController.java b/src/main/java/geoinfo/drilling/statistics/DrillingStatisticsController.java index aac91080..d595ed98 100644 --- a/src/main/java/geoinfo/drilling/statistics/DrillingStatisticsController.java +++ b/src/main/java/geoinfo/drilling/statistics/DrillingStatisticsController.java @@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; import geoinfo.drilling.inquiry.service.DrillingInquiryService; +import geoinfo.drilling.statistics.service.DrillingStatisticsService; import geoinfo.util.MyUtil; @Controller @@ -31,6 +32,9 @@ public class DrillingStatisticsController { @Autowired DrillingInquiryService drillingInquiryService; + + @Autowired + DrillingStatisticsService drillingStatisticsService; @RequestMapping(value = "/drilling/statistics.do") public String drillingStatistics(@RequestParam HashMap params, ModelMap model, HttpServletRequest request, HttpServletResponse response) throws Exception { @@ -50,4 +54,37 @@ public class DrillingStatisticsController { return "/drilling/statistics/drilling_notice"; } + + @RequestMapping(value = "/drilling/statistics/hist-list.do", method = RequestMethod.GET, produces = { "application/json; charset=utf-8" }) + @ResponseBody + public ResponseEntity drillingStatisticsHistList ( + HttpServletRequest request, + @RequestParam HashMap params, + HttpServletResponse response + ) { + JSONObject jSONOResponse = null; + try { + jSONOResponse = drillingStatisticsService.getConstructSiteHistList(request, params); + jSONOResponse.put("resultCode", 200); + jSONOResponse.put("resultMessage", "OK"); + + } catch (Exception e) { + jSONOResponse = new JSONObject(); + jSONOResponse.put("resultCode", -1); + jSONOResponse.put("resultMessage", e.getMessage()); + LOGGER.error("drillingStatisticsHistList Error: ", e); + } + + response.setStatus(HttpServletResponse.SC_OK); + response.setCharacterEncoding("UTF-8"); + response.setHeader("Content-Type", "application/json; charset=utf-8"); + + try { + response.getWriter().print(jSONOResponse); + } catch (IOException e) { + LOGGER.error("Response Write Error: ", e); + } + + return null; + } } diff --git a/src/main/java/geoinfo/drilling/statistics/service/DrillingStatisticsMapper.java b/src/main/java/geoinfo/drilling/statistics/service/DrillingStatisticsMapper.java index 0c28e9bb..e2434fdd 100644 --- a/src/main/java/geoinfo/drilling/statistics/service/DrillingStatisticsMapper.java +++ b/src/main/java/geoinfo/drilling/statistics/service/DrillingStatisticsMapper.java @@ -8,8 +8,7 @@ import egovframework.rte.psl.dataaccess.mapper.Mapper; import egovframework.rte.psl.dataaccess.util.EgovMap; @Mapper("drillingStatisticsMapper") -public interface DrillingStatisticsMapper { -} - - - +public interface DrillingStatisticsMapper { + public List selectConstructSiteHistList(HashMap params) throws SQLException; + public Long selectConstructSiteHistListCnt(HashMap params) throws SQLException; +} \ No newline at end of file diff --git a/src/main/java/geoinfo/drilling/statistics/service/DrillingStatisticsService.java b/src/main/java/geoinfo/drilling/statistics/service/DrillingStatisticsService.java index 37bf4970..e11edcfd 100644 --- a/src/main/java/geoinfo/drilling/statistics/service/DrillingStatisticsService.java +++ b/src/main/java/geoinfo/drilling/statistics/service/DrillingStatisticsService.java @@ -12,5 +12,5 @@ import egovframework.rte.psl.dataaccess.util.EgovMap; public interface DrillingStatisticsService { - + public JSONObject getConstructSiteHistList(HttpServletRequest request, HashMap params) throws Exception; } diff --git a/src/main/java/geoinfo/drilling/statistics/service/impl/DrillingStatisticsServiceImpl.java b/src/main/java/geoinfo/drilling/statistics/service/impl/DrillingStatisticsServiceImpl.java index eceb5008..506034bd 100644 --- a/src/main/java/geoinfo/drilling/statistics/service/impl/DrillingStatisticsServiceImpl.java +++ b/src/main/java/geoinfo/drilling/statistics/service/impl/DrillingStatisticsServiceImpl.java @@ -4,6 +4,7 @@ import geoinfo.drilling.input.service.DrillingInputMapper; import geoinfo.drilling.input.service.DrillingInputService; import geoinfo.drilling.inquiry.service.DrillingInquiryMapper; import geoinfo.drilling.inquiry.service.DrillingInquiryService; +import geoinfo.drilling.statistics.service.DrillingStatisticsMapper; import geoinfo.drilling.statistics.service.DrillingStatisticsService; import geoinfo.main.login.service.LoginMapper; import geoinfo.main.login.service.LoginService; @@ -32,12 +33,16 @@ import egovframework.rte.psl.dataaccess.util.EgovMap; public class DrillingStatisticsServiceImpl implements DrillingStatisticsService { + @Resource(name="drillingInquiryMapper") private DrillingInquiryMapper drillingInquiryMapper; @Resource(name="drillingInputMapper") private DrillingInputMapper drillingInputMapper; + @Resource(name="drillingStatisticsMapper") + private DrillingStatisticsMapper drillingStatisticsMapper; + @Autowired DrillingInputService drillingInputService; @@ -50,4 +55,45 @@ public class DrillingStatisticsServiceImpl implements DrillingStatisticsService private LoginMapper loginMapper; + @Override + public JSONObject getConstructSiteHistList(HttpServletRequest request, HashMap params) + throws Exception { + // TODO Auto-generated method stub + JSONObject jsonResponse = new JSONObject(); + String userId = MyUtil.getStringFromObject(request.getSession().getAttribute("USERID")); + + if (userId == null) { + throw new Exception("로그인이 필요한 서비스입니다."); + } + + // 1. 현재 로그인한 사용자의 지역(영역) 코드 조회 + HashMap userAreaCodes = drillingInputService.getOrganizationUserGlGmGsGfCodes(userId); + + params.put("masterCompanyOCode", MyUtil.getStringFromObject(userAreaCodes.get("v_gl"))); + params.put("masterCompanyTwCode", MyUtil.getStringFromObject(userAreaCodes.get("v_gm"))); + params.put("masterCompanyThCode", MyUtil.getStringFromObject(userAreaCodes.get("v_gs"))); + + // 2. 페이징 처리를 위한 파라미터 설정 + int page = params.get("page") == null ? 1 : Integer.parseInt(params.get("page").toString()); + int rows = params.get("rows") == null ? 10 : Integer.parseInt(params.get("rows").toString()); + params.put("firstIndex", (page - 1) * rows + 1); + params.put("lastIndex", page * rows); + + try { + // 3. 총 카운트 및 목록 조회 + Long count = drillingStatisticsMapper.selectConstructSiteHistListCnt(params); + List datas = drillingStatisticsMapper.selectConstructSiteHistList(params); + + jsonResponse.put("count", count); + jsonResponse.put("datas", datas); + + return jsonResponse; + + } catch (SQLException e) { + System.out.println("Error at getConstructSiteHistList: " + e.getMessage()); + throw new Exception("이력 조회 중 오류가 발생하였습니다."); + } + } + + } diff --git a/src/main/java/geoinfo/main/main/MainController.java b/src/main/java/geoinfo/main/main/MainController.java index a0d0c10d..65715694 100644 --- a/src/main/java/geoinfo/main/main/MainController.java +++ b/src/main/java/geoinfo/main/main/MainController.java @@ -5,6 +5,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.io.PrintWriter; +import java.io.UnsupportedEncodingException; import java.net.InetAddress; import java.net.MalformedURLException; import java.net.URLEncoder; @@ -2213,7 +2214,8 @@ public class MainController response.setContentType("application/octet-stream"); response.setContentLength(fileByte.length); - response.setHeader("Content-Disposition", "attachment; fileName=\"" + URLEncoder.encode(filenameDn, "utf-8") + "\";"); + String headerFilename = getContentDispositionHeader( request, filenameDn); + response.setHeader("Content-Disposition", headerFilename); response.setHeader("Content-Transfer-Encoding", "binary"); response.getOutputStream().write(fileByte); @@ -2223,6 +2225,7 @@ public class MainController else { mv.addObject("msg", ""); + response.setContentType("text/html; charset=utf-8"); response.setCharacterEncoding("utf-8"); PrintWriter writer = response.getWriter(); writer.println(" <% @@ -15,9 +12,7 @@ if (request.getSession().getAttribute("USERID") == null) { } %> <% - if (request.getSession().getAttribute("CLS") == null || "2".equals(request.getSession().getAttribute("CLS") ) == false ) { - %> <% @@ -25,24 +20,15 @@ if (request.getSession().getAttribute("CLS") == null || "2".equals(request.getSe } %> - - <%@ include file="/include/inc_head_2021_new.jsp" %> - - - - - - - - - - + + + + + - - - - - -
-
@@ -158,12 +120,8 @@ if (request.getSession().getAttribute("CLS") == null || "2".equals(request.getSe
- - -
-
  • @@ -171,231 +129,261 @@ if (request.getSession().getAttribute("CLS") == null || "2".equals(request.getSe
도움말
-

통계

-
- -
- - -
+
+

통계 보고서 다운로드

+

발주기관 통계 기능을 보고서 형태로 다운로드 받을 수 있습니다.

+ +
+
+

위험도 현황

+
+ +
+
+
+

프로젝트 재정 현황

+
+ +
+
+
+
+ +
+
+ + - + }); + // 3. Financial Status Bar Chart + var ctxFinancial = document.getElementById('financialChart').getContext('2d'); + new Chart(ctxFinancial, { + type: 'bar', + data: { + labels: ['프로젝트 A', '프로젝트 B', '프로젝트 C', '프로젝트 D'], + datasets: [{ + label: '예산', + data: [65, 59, 80, 81], + backgroundColor: 'rgba(59, 130, 246, 0.7)', + borderColor: 'rgba(59, 130, 246, 1)', + borderWidth: 1 + }, { + label: '실제 비용', + data: [45, 49, 60, 70], + backgroundColor: 'rgba(239, 68, 68, 0.7)', + borderColor: 'rgba(239, 68, 68, 1)', + borderWidth: 1 + },{ + label: '예상 비용', + data: [75, 69, 90, 91], + backgroundColor: 'rgba(16, 185, 129, 0.7)', + borderColor: 'rgba(16, 185, 129, 1)', + borderWidth: 1 + }] + }, + options: { + responsive: true, + maintainAspectRatio: false, + scales: { y: { beginAtZero: true, ticks: { callback: function(value) { return value + '억'; } } } }, + plugins: { legend: { display: false } } + } + }); + }); + +
- -
- - +
- -
-<%@ include file="/include/inc_footer_2021_new.jsp" %> + + +<%@ include file="/include/inc_footer_2021_new.jsp" %> \ No newline at end of file diff --git a/src/main/webapp/com/js/drilling/drilling-common.js b/src/main/webapp/com/js/drilling/drilling-common.js index 25cea9b4..6cf236e7 100644 --- a/src/main/webapp/com/js/drilling/drilling-common.js +++ b/src/main/webapp/com/js/drilling/drilling-common.js @@ -1,11 +1,3 @@ -let xhr; -if(window.XMLHttpRequest) { - xhr = new XMLHttpRequest(); -} else { - // IE5, IE6 일때 - xhr = new ActiveXObject("Microsoft.XMLHTTP"); -} - function onClickBtnViewOnMap() { const projectMasterCompanyName = '${mbr.projectMasterCompanyName}'; let projectCode = '${mbr.ProjectCode}'; diff --git a/src/main/webapp/include/inc_head_2021_new.jsp b/src/main/webapp/include/inc_head_2021_new.jsp index e8c27ceb..7dfbebbe 100644 --- a/src/main/webapp/include/inc_head_2021_new.jsp +++ b/src/main/webapp/include/inc_head_2021_new.jsp @@ -43,6 +43,7 @@ ============================================================== --> +