diff --git a/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer.js b/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer.js
index 932dc01..159feb3 100644
--- a/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer.js
+++ b/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer.js
@@ -16,8 +16,10 @@ function CodeViewer(props) {
const [treeLoading, setTreeLoading] = useState(true);
const [docLoading, setDocLoading] = useState(true);
const {linkedDocCode} = useParams();
+ const [docInfoSeq, setDocInfoSeq] = useState()
const [docCode, setDocCode] = useState(linkedDocCode !== undefined?linkedDocCode:props.docCode);
const [docName, setDocName] = useState(props.docName);
+ const [docInfo, setDocInfo] = useState();
const [codeTree, setCodeTree] = useState();
const [docSummary, setDocSummary] = useState();
const [docDetail, setDocDetail] = useState();
@@ -42,7 +44,7 @@ function CodeViewer(props) {
const updateDocCode = (docCode, docName)=>{
setDocCode(docCode);
setDocName(docName);
- getCodeDetailInfo(docCode);
+ getCodeDetailInfo(null, docCode);
}
const getCodeTree = ()=>{
@@ -84,8 +86,43 @@ function CodeViewer(props) {
);
}
+ const getCodeInfo = useCallback((docCode) => {
+ console.groupCollapsed("EgovMain.getCodeInfo()");
+ EgovNet.requestFetch(
+ '/standardCode/getCodeInfo.do',
+ {
+ method: "POST",
+ headers: {
+ 'Content-type': 'application/json'
+ },
+ body: JSON.stringify({
+ docCode: docCode
+ })
+ },
+ (resp) => {
+ const docInfo = resp.result.docInfo;
+ // 헤더 연도 선택지 구성
+ let headTag = [];
+ if(docInfo.length>0){
+ let optionTag = [];
+ docInfo.forEach(function (item, index){
+ optionTag.push(
+
+ )
+ })
+ headTag.push()
+ }else{
+ headTag.push(
검색된 결과가 없습니다.
); // 코드 목록 초기값
+ }
+ setDocInfo(headTag);
+ }
+ )
+ })
- const getCodeDetailInfo = useCallback((docCode) => {
+ const getCodeDetailInfo = useCallback((docInfoSeq, docCode) => {
console.groupCollapsed("EgovMain.getCodeDetailInfo()");
EgovNet.requestFetch(
'/standardCode/getCodeDetailInfo.do',
@@ -95,6 +132,7 @@ function CodeViewer(props) {
'Content-type': 'application/json'
},
body: JSON.stringify({
+ docInfoSeq: docInfoSeq,
docCode: docCode
})
},
@@ -213,6 +251,9 @@ function CodeViewer(props) {
console.groupEnd("EgovMain.getCodeDetailInfo()");
},[]);
+ const docInfoSelectorChange = (el) => {
+ getCodeDetailInfo(el.target.value, null);
+ }
const actionAppend = (el) => {
if(!el) return;
if(el.childNodes.length===0){
@@ -311,7 +352,8 @@ function CodeViewer(props) {
useEffect(() => {
getCodeTree();
- getCodeDetailInfo(docCode);
+ getCodeInfo(docCode);
+ getCodeDetailInfo(null, docCode);
}, []);
console.log("------------------------------viewer [End]");
@@ -323,7 +365,7 @@ function CodeViewer(props) {
- {docCode} {docName}
+ {docInfo}
@@ -345,7 +387,7 @@ function CodeViewer(props) {
}
CodeViewer.defaultProps = {
- docCode: 'KDS 24 10 11',
+ docCode: 'KDS 24 14 21',
docName: '교량 설계 일반사항(한계상태설계법)'
}
diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/StandardCodeController.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/StandardCodeController.java
index cdffffe..bb385a7 100644
--- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/StandardCodeController.java
+++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/StandardCodeController.java
@@ -90,8 +90,27 @@ public class StandardCodeController extends BaseController {
}
@Operation(
- summary = "건설기준코드 트리 조회",
- description = "건설기준코드 트리 조회",
+ summary = "건설기준코드 이력 조회",
+ description = "건설기준코드 이력 조회",
+ tags = {"StandardCodeController"}
+ )
+ @ApiResponses(value = {
+ @ApiResponse(responseCode = "200", description = "조회 성공"),
+ @ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
+ })
+ @PostMapping(value = "/getCodeInfo.do", consumes = MediaType.APPLICATION_JSON_VALUE)
+ public ResultVO getCodeInfo(@RequestBody StandardCodeVO param, @AuthenticationPrincipal LoginVO user)
+ throws Exception {
+ ResultVO resultVO = new ResultVO();
+ Map resultMap = new HashMap<>();
+ resultMap.put("docInfo", standardCodeService.selectStandardCodeDocInfo(param));
+ resultVO.setResult(resultMap);
+ return resultVO;
+ }
+
+ @Operation(
+ summary = "건설기준코드 에러 문구 수정",
+ description = "건설기준코드 에러 문구 수정",
tags = {"StandardCodeController"}
)
@ApiResponses(value = {
diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/repository/TnDocumentContentRepository.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/repository/TnDocumentContentRepository.java
index e30e1b0..70a0780 100644
--- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/repository/TnDocumentContentRepository.java
+++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/repository/TnDocumentContentRepository.java
@@ -11,8 +11,11 @@ import java.util.Optional;
public interface TnDocumentContentRepository extends JpaRepository {
+ @Query(value = "select * from get_recent_full_context_by_content(:docCode, :docPart)", nativeQuery = true)
+ List getRecentFullContextByContent(String docCode, String docPart);
+
@Query(value = "select * from get_year_full_context_by_content(:docInfoSeq, :docCode, :docPart, null, null)", nativeQuery = true)
- List getRecentFullContextByContent(Integer docInfoSeq, String docCode, String docPart);
+ List getYearFullContextByContent(Integer docInfoSeq, String docCode, String docPart);
Optional findByContTypeCd(String contTypeCd);
diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/repository/TnDocumentGroupRepository.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/repository/TnDocumentGroupRepository.java
index 0b744bc..e4394fd 100644
--- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/repository/TnDocumentGroupRepository.java
+++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/repository/TnDocumentGroupRepository.java
@@ -10,6 +10,5 @@ import java.util.List;
public interface TnDocumentGroupRepository extends JpaRepository {
@Query(value = "select * from sp_get_tn_document_code_by_tree()", nativeQuery = true)
- public List spGetTnDocumentCodeByTree();
-
+ List spGetTnDocumentCodeByTree();
}
diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/repository/TnDocumentInfoRepository.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/repository/TnDocumentInfoRepository.java
index d346e01..1ab2c1a 100644
--- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/repository/TnDocumentInfoRepository.java
+++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/repository/TnDocumentInfoRepository.java
@@ -1,8 +1,13 @@
package com.dbnt.kcscbackend.standardCode.repository;
import com.dbnt.kcscbackend.standardCode.entity.TnDocumentInfo;
+import com.dbnt.kcscbackend.standardCode.service.TnDocumentInfoInterface;
import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+
+import java.util.List;
public interface TnDocumentInfoRepository extends JpaRepository {
-
+ @Query(value = "select * from sp_get_tn_document_info_by_group_cd(null, :docCode)", nativeQuery = true)
+ List spGetTnDocumentInfoByGroupCd(String docCode);
}
diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/service/StandardCodeService.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/service/StandardCodeService.java
index 0ad53c9..8c978ae 100644
--- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/service/StandardCodeService.java
+++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/service/StandardCodeService.java
@@ -6,6 +6,7 @@ import com.dbnt.kcscbackend.standardCode.entity.TnDocumentInfo;
import com.dbnt.kcscbackend.standardCode.mapper.StandardCodeMapper;
import com.dbnt.kcscbackend.standardCode.repository.TnDocumentContentRepository;
import com.dbnt.kcscbackend.standardCode.repository.TnDocumentGroupRepository;
+import com.dbnt.kcscbackend.standardCode.repository.TnDocumentInfoRepository;
import lombok.RequiredArgsConstructor;
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
import org.springframework.stereotype.Service;
@@ -20,6 +21,7 @@ public class StandardCodeService extends EgovAbstractServiceImpl {
private final TnDocumentGroupRepository tnDocumentGroupRepository;
private final TnDocumentContentRepository tnDocumentContentRepository;
+ private final TnDocumentInfoRepository tnDocumentInfoRepository;
private final StandardCodeMapper standardCodeMapper;
@Transactional
@@ -35,7 +37,11 @@ public class StandardCodeService extends EgovAbstractServiceImpl {
}
public List selectStandardCodeDocument(StandardCodeVO param) {
- return tnDocumentContentRepository.getRecentFullContextByContent(param.getDocInfoSeq(), param.getDocCode(), param.getDocPart());
+ return tnDocumentContentRepository.getYearFullContextByContent(param.getDocInfoSeq(), param.getDocCode(), param.getDocPart());
+ }
+
+ public List selectStandardCodeDocInfo(StandardCodeVO param) {
+ return tnDocumentInfoRepository.spGetTnDocumentInfoByGroupCd(param.getDocCode());
}
public List selectStandardCodeList(TnDocumentInfo tnDocumentInfo){ return standardCodeMapper.selectStandardCodeList(tnDocumentInfo); }
@@ -47,5 +53,4 @@ public class StandardCodeService extends EgovAbstractServiceImpl {
public List selectStandardCodeRevisionhistoryList(Integer groupseq) {
return standardCodeMapper.selectStandardCodeRevisionhistoryList(groupseq);
}
-
}
diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/service/TnDocumentInfoInterface.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/service/TnDocumentInfoInterface.java
new file mode 100644
index 0000000..d4d6b57
--- /dev/null
+++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/service/TnDocumentInfoInterface.java
@@ -0,0 +1,33 @@
+package com.dbnt.kcscbackend.standardCode.service;
+
+public interface TnDocumentInfoInterface {
+ Integer getDoc_info_seq();
+ Integer getGroup_seq();
+ String getKcsc_cd();
+ String getOld_kcsc_cd();
+ String getDoc_nm();
+ String getDoc_yr();
+ Integer getDoc_cycl();
+ String getDoc_er();
+ String getEstb_ymd();
+ String getRvsn_ymd();
+ Integer getDoc_rev_hist_seq();
+ String getDoc_brief();
+ String getDoc_rvsn_remark();
+ String getDoc_consider();
+ String getDoc_advice();
+ String getDoc_dept();
+ String getDoc_relation();
+ String getDoc_publish();
+ String getAplcn_bgng_ymd();
+ String getAplcn_end_ymd();
+ Integer getDoc_order();
+ String getLast_yn();
+ String getDoc_file_grp_id();
+ String getRvsn_file_grp_id();
+ String getFrst_crt_id();
+ String getFrst_crt_dt();
+ String getLast_chg_id();
+ String getLast_chg_dt();
+ String getUse_yn();
+}