From cb1d4cdb7f8d73885c3c82fa8a27e36c18ff0cfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9C=A0=EB=AF=BC=ED=98=95?= Date: Thu, 26 Oct 2023 11:30:13 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B8=B0=EC=A4=80=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EC=9E=91=EC=97=85=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../standardCode/StandardCodeController.java | 48 +++++ .../standardCode/entity/TnDocumentInfo.java | 88 ++++++++ .../standardCode/entity/TnDocumentInfoVO.java | 92 ++++++++ .../mapper/StandardCodeMapper.java | 15 ++ .../repository/TnDocumentInfoRepository.java | 8 + .../service/StandardCodeListService.java | 40 ++++ .../service/StandardCodeService.java | 13 +- .../service/impl/StandardCodeListDAO.java | 55 +++++ .../impl/StandardCodeListServiceImpl.java | 64 ++++++ .../std/list/StandardCode_SQL_postgresql.xml | 85 ++++++++ .../src/constants/url.js | 1 + .../src/pages/main/EgovMain.jsx | 2 +- .../pages/standardCode/StandardCodeList.jsx | 200 ++++++++++++++++++ .../src/routes/index.jsx | 4 + 14 files changed, 713 insertions(+), 2 deletions(-) create mode 100644 egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/entity/TnDocumentInfo.java create mode 100644 egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/entity/TnDocumentInfoVO.java create mode 100644 egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/mapper/StandardCodeMapper.java create mode 100644 egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/repository/TnDocumentInfoRepository.java create mode 100644 egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/service/StandardCodeListService.java create mode 100644 egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/service/impl/StandardCodeListDAO.java create mode 100644 egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/service/impl/StandardCodeListServiceImpl.java create mode 100644 egovframe-template-simple-backend-contribution/src/main/resources/egovframework/mapper/let/std/list/StandardCode_SQL_postgresql.xml create mode 100644 egovframe-template-simple-react-contribution/src/pages/standardCode/StandardCodeList.jsx 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 4a55081..e85c2c5 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 @@ -3,7 +3,11 @@ package egovframework.dbnt.kcsc.standardCode; import egovframework.com.cmm.ResponseCode; import egovframework.com.cmm.service.ResultVO; import egovframework.com.cmm.LoginVO; +import egovframework.dbnt.kcsc.standardCode.entity.TnDocumentInfoVO; +import egovframework.dbnt.kcsc.standardCode.service.StandardCodeListService; import egovframework.dbnt.kcsc.standardCode.service.StandardCodeService; +import egovframework.let.cop.bbs.service.BoardVO; +import org.egovframe.rte.fdl.property.EgovPropertyService; import org.egovframe.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; import egovframework.dbnt.kcsc.standardCode.service.StandardCodeVO; @@ -16,6 +20,7 @@ import lombok.RequiredArgsConstructor; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; import java.util.HashMap; import java.util.Map; @@ -210,8 +215,14 @@ public class StandardCodeController { resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage()); return resultVO; }*/ + + @Resource(name = "propertiesService") + protected EgovPropertyService propertyService; + private final StandardCodeService standardCodeService; + private final StandardCodeListService standardCodeListService; + @Operation( summary = "건설기준코드 트리 조회", @@ -232,6 +243,7 @@ public class StandardCodeController { return resultVO; } + @Operation( summary = "건설기준코드 내용 조회", description = "건설기준코드 내용 조회", @@ -250,4 +262,40 @@ public class StandardCodeController { resultVO.setResult(resultMap); return resultVO; } + + + @Operation( + summary = "건설기준코드 리스트 조회", + description = "건설기준코드 리스트 조회", + tags = {"StandardCodeController"} + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "조회 성공"), + @ApiResponse(responseCode = "403", description = "인가된 사용자가 아님") + }) + @PostMapping(value = "/selectStandardCodeList.do", consumes = MediaType.APPLICATION_JSON_VALUE) + public ResultVO selectStandardCodeList(@RequestBody TnDocumentInfoVO tnDocumentInfoVO, @AuthenticationPrincipal LoginVO user) + throws Exception { + ResultVO resultVO = new ResultVO(); + + PaginationInfo paginationInfo = new PaginationInfo(); + paginationInfo.setCurrentPageNo(tnDocumentInfoVO.getPageIndex()); + paginationInfo.setRecordCountPerPage(propertyService.getInt("Globals.pageUnit")); + paginationInfo.setPageSize(propertyService.getInt("Globals.pageSize")); + + Map resultMap = standardCodeListService.selectStandardCodeList(tnDocumentInfoVO); + + int totCnt = Integer.parseInt((String)resultMap.get("resultCnt")); + paginationInfo.setTotalRecordCount(totCnt); + + resultMap.put("codeList", standardCodeListService.selectStandardCodeList(tnDocumentInfoVO)); + resultMap.put("codeListCnt", totCnt); + 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/TnDocumentInfo.java b/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/entity/TnDocumentInfo.java new file mode 100644 index 0000000..879a1e3 --- /dev/null +++ b/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/entity/TnDocumentInfo.java @@ -0,0 +1,88 @@ +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 javax.persistence.*; +import java.util.Date; + +@Getter +@Setter +@Entity +@NoArgsConstructor +@DynamicInsert +@DynamicUpdate +@Table(name = "tn_document_info") +public class TnDocumentInfo { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "doc_info_seq") + private int docInfoSeq; + @Column(name = "group_seq", nullable = false) + private int groupSeq; + @Column(name = "kcsc_cd") + private String kcscCd; + @Column(name = "old_kcsc_cd") + private String oldKcscCd; + @Column(name = "doc_nm", nullable = false) + private String docNm; + @Column(name = "doc_yr", nullable = false) + private String docYr; + @Column(name = "doc_cycl", nullable = false) + private int docCycl; + @Column(name = "doc_er", nullable = false) + private String docEr; + @Column(name = "estb_ymd") + @Temporal(TemporalType.DATE) + private Date estbYmd; + @Column(name = "rvsn_ymd") + @Temporal(TemporalType.DATE) + private Date rvsnYmd; + @Column(name = "doc_rev_hist_seq") + private int docRevHistSeq; + @Column(name = "doc_brief", length = 1000) + private String docBrief; + @Column(name = "doc_rvsn_remark", length = 1000) + private String docRvsnRemark; + @Column(name = "doc_consider", length = 255) + private String docConsider; + @Column(name = "doc_advice", length = 255) + private String docAdvice; + @Column(name = "doc_dept", length = 255) + private String docDept; + @Column(name = "doc_relation", length = 255) + private String docRelation; + @Column(name = "doc_publish", length = 255) + private String docPublish; + @Column(name = "aplcn_bgng_ymd") + @Temporal(TemporalType.DATE) + private Date aplcnBgngYmd; + @Column(name = "aplcn_end_ymd") + @Temporal(TemporalType.DATE) + private Date aplcnEndYmd; + @Column(name = "doc_order", nullable = false) + private int docOrder; + @Column(name = "last_yn", nullable = false) + private char lastYn; + @Column(name = "doc_file_grp_id") + private String docFileGrpId; + @Column(name = "rvsn_file_grp_id") + private String rvsnFileGrpId; + @Column(name = "frst_crt_id", nullable = false) + private String frstCrtId; + @Column(name = "frst_crt_dt", nullable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date frstCrtDt; + @Column(name = "last_chg_id") + private String lastChgId; + @Column(name = "last_chg_dt") + @Temporal(TemporalType.TIMESTAMP) + private Date lastChgDt; + @Column(name = "use_yn", nullable = false) + private char useYn; + @Column(name = "old_seq") + private Integer oldSeq; +} \ No newline at end of file diff --git a/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/entity/TnDocumentInfoVO.java b/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/entity/TnDocumentInfoVO.java new file mode 100644 index 0000000..2e55465 --- /dev/null +++ b/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/entity/TnDocumentInfoVO.java @@ -0,0 +1,92 @@ +package egovframework.dbnt.kcsc.standardCode.entity; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.hibernate.annotations.DynamicInsert; +import org.hibernate.annotations.DynamicUpdate; + +import javax.persistence.*; +import java.util.Date; + +@Getter +@Setter +@Entity +@NoArgsConstructor +@DynamicInsert +@DynamicUpdate +@Table(name = "tn_document_info") +public class TnDocumentInfoVO { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "doc_info_seq") + private int docInfoSeq; + @Column(name = "group_seq", nullable = false) + private int groupSeq; + @Column(name = "kcsc_cd") + private String kcscCd; + @Column(name = "old_kcsc_cd") + private String oldKcscCd; + @Column(name = "doc_nm", nullable = false) + private String docNm; + @Column(name = "doc_yr", nullable = false) + private String docYr; + @Column(name = "doc_cycl", nullable = false) + private int docCycl; + @Column(name = "doc_er", nullable = false) + private String docEr; + @Column(name = "estb_ymd") + @Temporal(TemporalType.DATE) + private Date estbYmd; + @Column(name = "rvsn_ymd") + @Temporal(TemporalType.DATE) + private Date rvsnYmd; + @Column(name = "doc_rev_hist_seq") + private int docRevHistSeq; + @Column(name = "doc_brief", length = 1000) + private String docBrief; + @Column(name = "doc_rvsn_remark", length = 1000) + private String docRvsnRemark; + @Column(name = "doc_consider", length = 255) + private String docConsider; + @Column(name = "doc_advice", length = 255) + private String docAdvice; + @Column(name = "doc_dept", length = 255) + private String docDept; + @Column(name = "doc_relation", length = 255) + private String docRelation; + @Column(name = "doc_publish", length = 255) + private String docPublish; + @Column(name = "aplcn_bgng_ymd") + @Temporal(TemporalType.DATE) + private Date aplcnBgngYmd; + @Column(name = "aplcn_end_ymd") + @Temporal(TemporalType.DATE) + private Date aplcnEndYmd; + @Column(name = "doc_order", nullable = false) + private int docOrder; + @Column(name = "last_yn", nullable = false) + private char lastYn; + @Column(name = "doc_file_grp_id") + private String docFileGrpId; + @Column(name = "rvsn_file_grp_id") + private String rvsnFileGrpId; + @Column(name = "frst_crt_id", nullable = false) + private String frstCrtId; + @Column(name = "frst_crt_dt", nullable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date frstCrtDt; + @Column(name = "last_chg_id") + private String lastChgId; + @Column(name = "last_chg_dt") + @Temporal(TemporalType.TIMESTAMP) + private Date lastChgDt; + @Column(name = "use_yn", nullable = false) + private char useYn; + @Column(name = "old_seq") + private Integer oldSeq; + + @Schema(description = "현재페이지") + private int pageIndex = 1; +} \ No newline at end of file diff --git a/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/mapper/StandardCodeMapper.java b/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/mapper/StandardCodeMapper.java new file mode 100644 index 0000000..f13aa8d --- /dev/null +++ b/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/mapper/StandardCodeMapper.java @@ -0,0 +1,15 @@ +package egovframework.dbnt.kcsc.standardCode.mapper; + +import egovframework.dbnt.kcsc.standardCode.entity.TnDocumentInfo; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface StandardCodeMapper { + + List selectStandardCodeList(TnDocumentInfo tnDocumentInfo); + + Integer selectStandardCodeListCnt(TnDocumentInfo tnDocumentInfo); + +} diff --git a/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/repository/TnDocumentInfoRepository.java b/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/repository/TnDocumentInfoRepository.java new file mode 100644 index 0000000..22cd411 --- /dev/null +++ b/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/repository/TnDocumentInfoRepository.java @@ -0,0 +1,8 @@ +package egovframework.dbnt.kcsc.standardCode.repository; + +import egovframework.dbnt.kcsc.standardCode.entity.TnDocumentInfo; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface TnDocumentInfoRepository extends JpaRepository { + +} diff --git a/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/service/StandardCodeListService.java b/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/service/StandardCodeListService.java new file mode 100644 index 0000000..98f1acd --- /dev/null +++ b/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/service/StandardCodeListService.java @@ -0,0 +1,40 @@ +package egovframework.dbnt.kcsc.standardCode.service; + +import egovframework.dbnt.kcsc.standardCode.entity.TnDocumentInfo; +import egovframework.dbnt.kcsc.standardCode.entity.TnDocumentInfoVO; +import egovframework.let.cop.bbs.service.Board; +import egovframework.let.cop.bbs.service.BoardVO; + +import java.util.Map; + +/** + * 게시물 관리를 위한 서비스 인터페이스 클래스 + * @author 공통 서비스 개발팀 이삼섭 + * @since 2009.03.19 + * @version 1.0 + * @see + * + *
+ * << 개정이력(Modification Information) >>
+ * 
+ *   수정일      수정자          수정내용
+ *  -------    --------    ---------------------------
+ *  2009.03.19  이삼섭          최초 생성
+ *  2011.08.31  JJY            경량환경 템플릿 커스터마이징버전 생성 
+ *  
+ *  
+ */ +public interface StandardCodeListService { + + /** + * 조건에 맞는 게시물 목록을 조회 한다. + * @return + * + * @param + * @param + * @exception Exception Exception + */ + public Map selectStandardCodeList(TnDocumentInfoVO tnDocumentInfoVO) + throws Exception; + +} \ No newline at end of file diff --git a/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/service/StandardCodeService.java b/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/service/StandardCodeService.java index 913b425..732e10d 100644 --- a/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/service/StandardCodeService.java +++ b/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/service/StandardCodeService.java @@ -1,14 +1,16 @@ package egovframework.dbnt.kcsc.standardCode.service; -import egovframework.dbnt.kcsc.standardCode.entity.TnDocumentGroup; +import egovframework.dbnt.kcsc.standardCode.entity.TnDocumentInfo; import egovframework.dbnt.kcsc.standardCode.repository.TnDocumentContentRepository; import egovframework.dbnt.kcsc.standardCode.repository.TnDocumentGroupRepository; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.List; @Service +@Transactional @RequiredArgsConstructor public class StandardCodeService { private final TnDocumentGroupRepository tnDocumentGroupRepository; @@ -21,4 +23,13 @@ public class StandardCodeService { public List selectStandardCodeDocument(StandardCodeVO param) { return tnDocumentContentRepository.getRecentFullContextByContent(param.getDocCode(), param.getDocPart()); } + + /*public List selectStandardCodeList(TnDocumentInfo tnDocumentInfo) { + return standardCodeMapper.selectStandardCodeList(tnDocumentInfo); + } + + public Integer selectStandardCodeListCnt(TnDocumentInfo tnDocumentInfo) { + return standardCodeMapper.selectStandardCodeListCnt(tnDocumentInfo); + }*/ + } diff --git a/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/service/impl/StandardCodeListDAO.java b/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/service/impl/StandardCodeListDAO.java new file mode 100644 index 0000000..6e0bf0b --- /dev/null +++ b/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/service/impl/StandardCodeListDAO.java @@ -0,0 +1,55 @@ +package egovframework.dbnt.kcsc.standardCode.service.impl; + +import egovframework.dbnt.kcsc.standardCode.entity.TnDocumentInfoVO; +import egovframework.let.cop.bbs.service.Board; +import egovframework.let.cop.bbs.service.BoardVO; +import org.egovframe.rte.psl.dataaccess.EgovAbstractMapper; +import org.springframework.stereotype.Repository; + +import java.util.Iterator; +import java.util.List; + +/** + * 게시물 관리를 위한 데이터 접근 클래스 + * @author 공통 서비스 개발팀 이삼섭 + * @since 2009.03.19 + * @version 1.0 + * @see + * + *
+ * << 개정이력(Modification Information) >>
+ *
+ *   수정일      수정자          수정내용
+ *  -------    --------    ---------------------------
+ *  2009.03.19  이삼섭          최초 생성
+ *  2011.08.31  JJY            경량환경 템플릿 커스터마이징버전 생성
+ *
+ *  
+ */ +@Repository("StandardCodeListDAO") +public class StandardCodeListDAO extends EgovAbstractMapper { + + /** + * 조건에 맞는 게시물 목록을 조회 한다. + * + * @param + * @return + * @throws Exception + */ + @SuppressWarnings("unchecked") + public List selectStandardCodeList(TnDocumentInfoVO tnDocumentInfoVO) throws Exception { + return (List) list("StandardCodeListDAO.selectStandardCodeList", tnDocumentInfoVO); + } + + /** + * 조건에 맞는 게시물 목록에 대한 전체 건수를 조회 한다. + * + * @param + * @return + * @throws Exception + */ + public int selectStandardCodeListCnt(TnDocumentInfoVO tnDocumentInfoVO) throws Exception { + return (Integer)selectOne("StandardCodeListDAO.selectStandardCodeListCnt", tnDocumentInfoVO); + } + +} diff --git a/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/service/impl/StandardCodeListServiceImpl.java b/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/service/impl/StandardCodeListServiceImpl.java new file mode 100644 index 0000000..85b7a31 --- /dev/null +++ b/egovframe-template-simple-backend-contribution/src/main/java/egovframework/dbnt/kcsc/standardCode/service/impl/StandardCodeListServiceImpl.java @@ -0,0 +1,64 @@ +package egovframework.dbnt.kcsc.standardCode.service.impl; + +import egovframework.com.cmm.service.EgovFileMngService; +import egovframework.com.cmm.service.FileVO; +import egovframework.dbnt.kcsc.standardCode.entity.TnDocumentInfoVO; +import egovframework.dbnt.kcsc.standardCode.service.StandardCodeListService; +import egovframework.let.cop.bbs.service.Board; +import egovframework.let.cop.bbs.service.BoardVO; +import egovframework.let.cop.bbs.service.EgovBBSManageService; +import egovframework.let.cop.bbs.service.impl.BBSManageDAO; +import egovframework.let.utl.fcc.service.EgovDateUtil; +import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; +import org.egovframe.rte.fdl.property.EgovPropertyService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.*; + +/** + * 게시물 관리를 위한 서비스 구현 클래스 + * @author 공통 서비스 개발팀 한성곤 + * @since 2009.03.19 + * @version 1.0 + * @see + * + *
+ * << 개정이력(Modification Information) >>
+ *
+ *   수정일      수정자          수정내용
+ *  -------    --------    ---------------------------
+ *  2009.03.19  이삼섭          최초 생성
+ *  2011.08.31  JJY            경량환경 템플릿 커스터마이징버전 생성
+ *
+ *  
+ */ +@Service("StandardCodeListService") +public class StandardCodeListServiceImpl extends EgovAbstractServiceImpl implements StandardCodeListService { + + @Resource(name = "StandardCodeListDAO") + private StandardCodeListDAO standardCodeListDAO; + + /** + * 조건에 맞는 게시물 목록을 조회 한다. + * + * @see + */ + @Override + public Map selectStandardCodeList(TnDocumentInfoVO tnDocumentInfoVO) throws Exception { + List list = standardCodeListDAO.selectStandardCodeList(tnDocumentInfoVO); + List result = new ArrayList(); + + result = list; + + int cnt = standardCodeListDAO.selectStandardCodeListCnt(tnDocumentInfoVO); + + Map map = new HashMap(); + + map.put("resultList", result); + map.put("resultCnt", Integer.toString(cnt)); + + return map; + } + +} diff --git a/egovframe-template-simple-backend-contribution/src/main/resources/egovframework/mapper/let/std/list/StandardCode_SQL_postgresql.xml b/egovframe-template-simple-backend-contribution/src/main/resources/egovframework/mapper/let/std/list/StandardCode_SQL_postgresql.xml new file mode 100644 index 0000000..72e17e1 --- /dev/null +++ b/egovframe-template-simple-backend-contribution/src/main/resources/egovframework/mapper/let/std/list/StandardCode_SQL_postgresql.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/egovframe-template-simple-react-contribution/src/constants/url.js b/egovframe-template-simple-react-contribution/src/constants/url.js index e4ca5e2..220a62b 100644 --- a/egovframe-template-simple-react-contribution/src/constants/url.js +++ b/egovframe-template-simple-react-contribution/src/constants/url.js @@ -77,6 +77,7 @@ const URL = { //기준코드 STANDARD_CODE_LIST : "/standardCode/list", //건설기준코드/리스트 + STANDARD_CODE_DETAIL : "/standardCode/detail", //건설기준코드/리스트 STANDARD_CODE_VIEWER : "/standardCode/viewer", //건설기준코드/뷰어 STANDARD_CODE_VIEWER_LINK : "/standardCode/viewer/:linkedDocCode", //건설기준코드/뷰어/새 창 링크 } diff --git a/egovframe-template-simple-react-contribution/src/pages/main/EgovMain.jsx b/egovframe-template-simple-react-contribution/src/pages/main/EgovMain.jsx index 94f7c6b..675d0c0 100644 --- a/egovframe-template-simple-react-contribution/src/pages/main/EgovMain.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/main/EgovMain.jsx @@ -108,7 +108,7 @@ function EgovMain(props) { {/*단순 홈페이지 전자정부 표준프레임워크의 경량환경 내부업무에 대한 최신 정보와 기술을 제공하고 있습니다.*/}

건설기준코드 검색

- + diff --git a/egovframe-template-simple-react-contribution/src/pages/standardCode/StandardCodeList.jsx b/egovframe-template-simple-react-contribution/src/pages/standardCode/StandardCodeList.jsx new file mode 100644 index 0000000..d8f1179 --- /dev/null +++ b/egovframe-template-simple-react-contribution/src/pages/standardCode/StandardCodeList.jsx @@ -0,0 +1,200 @@ +import React, { useState, useEffect, useCallback, useRef } from 'react'; +import { Link, useLocation } from 'react-router-dom'; + +import * as EgovNet from 'api/egovFetch'; +import URL from 'constants/url'; +import { NOTICE_BBS_ID } from 'config'; + +import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavInform'; +import EgovPaging from 'components/EgovPaging'; + +import { itemIdxByPage } from 'utils/calc'; + +function StandardCodeList(props) { + console.group("StandardCodeList"); + console.log("[Start] StandardCodeList ------------------------------"); + console.log("StandardCodeList [props] : ", props); + + const location = useLocation(); + console.log("StandardCodeList [location] : ", location); + + const cndRef = useRef(); + const wrdRef = useRef(); + + const bbsId = location.state?.bbsId || NOTICE_BBS_ID; + + // eslint-disable-next-line no-unused-vars + const [searchCondition, setSearchCondition] = useState(location.state?.searchCondition || { bbsId: bbsId, pageIndex: 1, searchCnd: '0', searchWrd: '' });// 기존 조회에서 접근 했을 시 || 신규로 접근 했을 시 + const [masterBoard, setMasterBoard] = useState({}); + const [paginationInfo, setPaginationInfo] = useState({}); + + const [listTag, setListTag] = useState([]); + + const retrieveList = useCallback((searchCondition) => { + console.groupCollapsed("StandardCodeList.retrieveList()"); + + const retrieveListURL = '/standardCode/selectStandardCodeList.do'; + const requestOptions = { + method: "POST", + headers: { + 'Content-type': 'application/json', + }, + body: JSON.stringify(searchCondition) + } + + EgovNet.requestFetch(retrieveListURL, + requestOptions, + (resp) => { + setMasterBoard(resp.result.codeList); + setPaginationInfo(resp.result.paginationInfo); + + let mutListTag = []; + mutListTag.push(

검색된 결과가 없습니다.

); // 게시판 목록 초기값 + + const resultCnt = parseInt(resp.result.codeListCnt); + const currentPageNo = resp.result.paginationInfo.currentPageNo; + const pageSize = resp.result.paginationInfo.pageSize; + + // 리스트 항목 구성 + resp.result.codeList.forEach(function (item, index) { + if (index === 0) mutListTag = []; // 목록 초기화 + const listIdx = itemIdxByPage(resultCnt , currentPageNo, pageSize, index); + + mutListTag.push( + +
{listIdx}
+ {(item.replyLc * 1 ? true : false) && +
+ {item.docNm} +
} + {(item.replyLc * 1 ? false : true) && +
+ {item.docNm} +
} +
{item.frstRegisterNm}
+
{item.frstRegisterPnttm}
+
{item.inqireCo}
+ + ); + }); + setListTag(mutListTag); + }, + function (resp) { + console.log("err response : ", resp); + } + ); + console.groupEnd("StandardCodeList.retrieveList()"); + },[]); + + useEffect(() => { + retrieveList(searchCondition); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + console.log("------------------------------StandardCodeList [End]"); + console.groupEnd("StandardCodeList"); + return ( +
+
+ {/* */} +
+
    +
  • Home
  • +
  • 건설기준코드
  • +
  • {masterBoard && masterBoard.bbsNm}
  • +
+
+ {/* */} + +
+ {/* */} + + {/* */} + +
+ {/* */} + +
+

건설기준코드

+
+ +

설계기준, 표준시방서 내용을 열람할 수 있습니다.

+ + {/* */} +
+
    +
  • + +
  • +
  • + + { + wrdRef.current.value = e.target.value; + }} + /> + + +
  • +
  • + 등록 +
  • +
+
+ {/* */} + + {/* */} +
+
+ 번호 + 제목 + 작성자 + 작성일 + 조회수 +
+
+ {listTag} +
+
+ {/* */} + +
+ {/* */} + { + retrieveList({ ...searchCondition, pageIndex: passedPage, searchCnd: cndRef.current.value, searchWrd: wrdRef.current.value }) + }} /> + {/* */} +
+ + {/* */} +
+
+
+
+ ); +} + + +export default StandardCodeList; + diff --git a/egovframe-template-simple-react-contribution/src/routes/index.jsx b/egovframe-template-simple-react-contribution/src/routes/index.jsx index 37deb01..b0cd134 100644 --- a/egovframe-template-simple-react-contribution/src/routes/index.jsx +++ b/egovframe-template-simple-react-contribution/src/routes/index.jsx @@ -70,6 +70,7 @@ import CodeViewer from 'pages/standardCode/viewer'; import * as EgovNet from 'api/egovFetch'; // jwt토큰 위조 검사 때문에 추가 import initPage from 'js/ui'; +import StandardCodeList from "../pages/standardCode/StandardCodeList"; const RootRoutes = () => { //useLocation객체를 이용하여 정규표현식을 사용한 /admin/~ 으로 시작하는 경로와 비교에 사용(아래 1줄) */} @@ -229,6 +230,9 @@ const SecondRoutes = () => { } /> } /> + {/*기준코드리스트*/} + } /> +