From e5f1ff17e9e8378f028fb83f78efb04b4454e147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=84=9D=20=EC=B5=9C?= Date: Thu, 12 Oct 2023 17:05:49 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A4=91=EA=B0=84=EC=A0=80=EC=9E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../simpleHomePage.iml | 18 ++ .../standardCode/StandardCodeController.java | 61 ++++- .../standardCode/entity/TnDocumentGroup.java | 61 +++++ .../standardCode/service/StandardCodeVO.java | 9 + .../src/constants/url.js | 1 + .../src/pages/standardCode/viewer.js | 233 ++++++++++++++++++ .../src/routes/index.jsx | 8 + 7 files changed, 390 insertions(+), 1 deletion(-) create mode 100644 egovframe-template-simple-backend-contribution/simpleHomePage.iml create mode 100644 egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/entity/TnDocumentGroup.java create mode 100644 egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/service/StandardCodeVO.java create mode 100644 egovframe-template-simple-react-contribution/src/pages/standardCode/viewer.js diff --git a/egovframe-template-simple-backend-contribution/simpleHomePage.iml b/egovframe-template-simple-backend-contribution/simpleHomePage.iml new file mode 100644 index 0000000..c67cf22 --- /dev/null +++ b/egovframe-template-simple-backend-contribution/simpleHomePage.iml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/StandardCodeController.java b/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/StandardCodeController.java index 63702ca..f686f32 100644 --- a/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/StandardCodeController.java +++ b/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/StandardCodeController.java @@ -1,8 +1,22 @@ package egovframework.dbnt.kcsc.standardCode; +import egovframework.com.cmm.ResponseCode; +import egovframework.com.cmm.service.ResultVO; +import egovframework.com.cmm.LoginVO; +import org.egovframe.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; + +import egovframework.dbnt.kcsc.standardCode.service.StandardCodeVO; +import org.springframework.security.core.annotation.AuthenticationPrincipal; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.*; +import java.util.Map; + /** * 건설기준코드 관리를 위한 컨트롤러 클래스 * @@ -16,6 +30,8 @@ import org.springframework.web.bind.annotation.*; * */ @RestController +@RequiredArgsConstructor +@RequestMapping("/standardCode") @Tag(name="StandardCodeController",description = "건설기준코드 관리 컨트롤러") public class StandardCodeController { /* @@ -119,7 +135,6 @@ public class StandardCodeController { /** * 게시물에 대한 상세 정보를 조회한다. * - * @param boardVO * @return resultVO * @throws Exception */ @@ -191,5 +206,49 @@ public class StandardCodeController { resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage()); return resultVO; }*/ + @Operation( + summary = "건설기준코드 내용 조회", + description = "건설기준코드 내용 조회", + tags = {"StandardCodeController"} + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "조회 성공"), + @ApiResponse(responseCode = "403", description = "인가된 사용자가 아님") + }) + @PostMapping(value = "/viewer.do", consumes = MediaType.APPLICATION_JSON_VALUE) + public ResultVO selectStandardCode(@RequestBody StandardCodeVO codeVO, @AuthenticationPrincipal LoginVO user) + throws Exception { + ResultVO resultVO = new ResultVO(); + /*BoardMasterVO vo = new BoardMasterVO(); + vo.setBbsId(boardVO.getBbsId()); + vo.setUniqId(user.getUniqId()); + + BoardMasterVO master = bbsAttrbService.selectBBSMasterInf(vo); + + PaginationInfo paginationInfo = new PaginationInfo(); + paginationInfo.setCurrentPageNo(boardVO.getPageIndex()); + paginationInfo.setRecordCountPerPage(propertyService.getInt("Globals.pageUnit")); + paginationInfo.setPageSize(propertyService.getInt("Globals.pageSize")); + + boardVO.setFirstIndex(paginationInfo.getFirstRecordIndex()); + boardVO.setLastIndex(paginationInfo.getLastRecordIndex()); + boardVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); + + Map resultMap = bbsMngService.selectBoardArticles(boardVO, vo.getBbsAttrbCode()); + + int totCnt = Integer.parseInt((String)resultMap.get("resultCnt")); + paginationInfo.setTotalRecordCount(totCnt); + + resultMap.put("boardVO", boardVO); + resultMap.put("brdMstrVO", master); + resultMap.put("paginationInfo", paginationInfo); + resultMap.put("user", user); + + resultVO.setResultCode(ResponseCode.SUCCESS.getCode()); + resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage()); + resultVO.setResult(resultMap); +*/ + return resultVO; + } } \ No newline at end of file diff --git a/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/entity/TnDocumentGroup.java b/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/entity/TnDocumentGroup.java new file mode 100644 index 0000000..4ed3761 --- /dev/null +++ b/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/entity/TnDocumentGroup.java @@ -0,0 +1,61 @@ +package egovframework.dbnt.kcsc.standardCode.entity; + +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.hibernate.annotations.DynamicInsert; +import org.hibernate.annotations.DynamicUpdate; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.persistence.*; +import java.time.LocalDateTime; + +@Getter +@Setter +@Entity +@NoArgsConstructor +@DynamicInsert +@DynamicUpdate +@Table(name = "tn_document_group") +public class TnDocumentGroup { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "group_seq") + private Integer groupSeq; + @Column(name = "group_full_cd") + private String groupFullCd; + @Column(name = "kcsc_cd") + private String kcscCd; + @Column(name = "group_cur_cd") + private String groupCurCd; + @Column(name = "group_nm") + private String groupNm; + @Column(name = "group_type") + private String groupType; + @Column(name = "item_cd") + private String itemCd; + @Column(name = "doc_type") + private Integer docType; + @Column(name = "doc_level") + private Integer docLevel; + @Column(name = "doc_order") + private Integer docOrder; + @Column(name = "parent_group_seq") + private Integer parentGroupSeq; + @Column(name = "rvsn_remark") + private String rvsnRemark; + @Column(name = "frst_crt_id") + private String frstCrtId; + @Column(name = "frst_crt_dt") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime frstCrtDt; + @Column(name = "last_chg_id") + private String lastChgId; + @Column(name = "last_chg_dt") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime lastChgDt; + @Column(name = "use_yn") + private String useYn; + @Column(name = "old_seq") + private Integer oldSeq; +} diff --git a/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/service/StandardCodeVO.java b/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/service/StandardCodeVO.java new file mode 100644 index 0000000..1989c98 --- /dev/null +++ b/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/service/StandardCodeVO.java @@ -0,0 +1,9 @@ +package egovframework.dbnt.kcsc.standardCode.service; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class StandardCodeVO { +} diff --git a/egovframe-template-simple-react-contribution/src/constants/url.js b/egovframe-template-simple-react-contribution/src/constants/url.js index 768bbcc..0bc39ad 100644 --- a/egovframe-template-simple-react-contribution/src/constants/url.js +++ b/egovframe-template-simple-react-contribution/src/constants/url.js @@ -75,6 +75,7 @@ const URL = { ADMIN_MANAGER : "/admin/manager/", // 사이트관리/사이트관리자 암호변경 기능 추가 2023.04.15(토) 김일국 + //기준코드 STANDARD_CODE_LIST : "/standardCode/list", //건설기준코드/리스트 STANDARD_CODE_VIEWER : "/standardCode/viewer", //건설기준코드/뷰어 } diff --git a/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer.js b/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer.js new file mode 100644 index 0000000..ac2f884 --- /dev/null +++ b/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer.js @@ -0,0 +1,233 @@ +import React, { useState, useEffect, useCallback } from 'react'; +import { Link, useLocation } from 'react-router-dom'; +import Row from 'react-bootstrap/Row'; +import Col from 'react-bootstrap/Col'; +import Button from 'react-bootstrap/Button'; +import * as EgovNet from 'api/egovFetch'; +import URL from 'constants/url'; + +function CodeViewer(props) { + console.group("viewer"); + console.log("[Start] viewer ------------------------------"); + console.log("viewer [props] : ", props); + + const location = useLocation(); + console.log("viewer [location] : ", location); + + // eslint-disable-next-line no-unused-vars + const [noticeBoard, setNoticeBoard] = useState(); + // eslint-disable-next-line no-unused-vars + const [gallaryBoard, setGallaryBoard] = useState(); + const [noticeListTag, setNoticeListTag] = useState(); + const [gallaryListTag, setGallaryListTag] = useState(); + + const retrieveList = useCallback(() => { + console.groupCollapsed("EgovMain.retrieveList()"); + + const retrieveListURL = '/standardCode/viewer.do'; + const requestOptions = { + method: "POST", + headers: { + 'Content-type': 'application/json' + }, + body: JSON.stringify() + } + + EgovNet.requestFetch(retrieveListURL, + requestOptions, + (resp) => { + + setNoticeBoard(resp.result.notiList); + setGallaryBoard(resp.result.galList); + + let mutNotiListTag = []; + mutNotiListTag.push(
  • 검색된 결과가 없습니다.
  • ); // 게시판 목록 초기값 + + // 리스트 항목 구성 + resp.result.notiList.forEach(function (item, index) { + if (index === 0) mutNotiListTag = []; // 목록 초기화 + mutNotiListTag.push( +
  • + + {item.nttSj} + {item.frstRegisterPnttm} + +
  • + ); + }); + setNoticeListTag(mutNotiListTag); + + let mutGallaryListTag = []; + mutGallaryListTag.push(
  • 검색된 결과가 없습니다.
  • ); // 게시판 목록 초기값 + + // 리스트 항목 구성 + resp.result.galList.forEach(function (item, index) { + if (index === 0) mutGallaryListTag = []; // 목록 초기화 + mutGallaryListTag.push( +
  • + + {item.nttSj} + {item.frstRegisterPnttm} + +
  • + ); + }); + setGallaryListTag(mutGallaryListTag); + }, + function (resp) { + console.log("err response : ", resp); + } + ); + console.groupEnd("EgovMain.retrieveList()"); + },[]); + + useEffect(() => { + retrieveList(); + }, [retrieveList]); + + console.log("------------------------------viewer [End]"); + console.groupEnd("viewer"); + + return ( +
    +
    +
    +
    + {/*단순 홈페이지 전자정부 표준프레임워크의 경량환경 내부업무에 대한 최신 정보와 기술을 제공하고 있습니다.*/} +

    건설기준코드 검색

    + + + + + + + + + + + + + + + + + + + + {/* + + + + + + + + + + + + + + + + + + + */} + +
    + +
    +
    + +
    +
    +

    공지사항

    +
      + {noticeListTag} +
    + 더보기 +
    + +
    +

    갤러리

    +
      + {gallaryListTag} +
    + 더보기 +
    +
    +
    + +
    + + 자료실 + 다양한 자료를
    다운로드 받으실 수 있습니다.
    + + + 표준프레임워크센터 + 표준프레임워크센터의
    약도 등의 정보를 제공합니다.
    + +
    +
    +
    + +
    +
    +
    +

    주요사업 소개

    +

    표준프레임워크가 제공하는
    + 주요 사업을 소개합니다.

    +
    + 자세히 보기 +
    +
    +
    +

    대표서비스 소개

    +

    표준프레임워크 실행환경의
    + 서비스 그룹에서 제공하는
    + 대표서비스입니다.

    +
    + 자세히 보기 +
    +
    +
    +

    서비스 신청

    +

    표준프레임워크 경량환경
    + 홈페이지의 다양한 서비스를
    + 신청 하실 수 있습니다.

    +
    + 자세히 보기 +
    +
    +
    +

    일정 현황

    +

    표준프레임워크 경량환경
    + 홈페이지의 전체적인 일정
    + 현황을 조회하실 수 있습니다.

    +
    + 자세히 보기 +
    +
    +
    +
    + + ); +} + +export default CodeViewer; diff --git a/egovframe-template-simple-react-contribution/src/routes/index.jsx b/egovframe-template-simple-react-contribution/src/routes/index.jsx index 3c3f1ec..b649b45 100644 --- a/egovframe-template-simple-react-contribution/src/routes/index.jsx +++ b/egovframe-template-simple-react-contribution/src/routes/index.jsx @@ -64,6 +64,10 @@ import EgovAdminGalleryDetail from 'pages/admin/gallery/EgovAdminGalleryDetail'; import EgovAdminGalleryEdit from 'pages/admin/gallery/EgovAdminGalleryEdit'; //사이트관리자 암호 바꾸기 기능 추가 2023.04.15(토) 김일국 추가 import EgovAdminPasswordUpdate from 'pages/admin/manager/EgovAdminPasswordUpdate'; + +//건설기준코드 +import CodeViewer from 'pages/standardCode/viewer'; + import * as EgovNet from 'api/egovFetch'; // jwt토큰 위조 검사 때문에 추가 import initPage from 'js/ui'; @@ -220,6 +224,10 @@ const SecondRoutes = () => { } /> {/* 사이트관리자 암호 바꾸기 기능 추가 2023.04.15(토) 김일국 */} } /> + + {/*기준코드*/} + } /> +