diff --git a/egovframe-template-simple-react-contribution/src/css/page.css b/egovframe-template-simple-react-contribution/src/css/page.css
index 6e217f9..c1ba2c6 100644
--- a/egovframe-template-simple-react-contribution/src/css/page.css
+++ b/egovframe-template-simple-react-contribution/src/css/page.css
@@ -320,7 +320,7 @@
.calendar_info ul li a {color: #222; font-size: 16px; font-weight: 300;}
.calendar_info ul li span {position: absolute; right: 15px; top: 15px; color: #808080; font-size: 16px; font-weight: 300;}
- .viewerDiv{height: calc(100vh - 180px); overflow-y: auto;}
+ .viewerDiv{height: calc(100vh - 190px); overflow-y: auto;}
.openDoc{background-color: bisque;}
.docLink{
color: black;
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 6fe1303..acd4e32 100644
--- a/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer.js
+++ b/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer.js
@@ -47,6 +47,8 @@ function CodeViewer(props) {
const updateDocCode = (docCode, docName)=>{
setDocCode(docCode);
setDocName(docName);
+ getCodeInfo(docCode);
+ setErrorSelector([])
getCodeDetailInfo(null, docCode);
}
@@ -116,7 +118,7 @@ function CodeViewer(props) {
)
})
- headTag.push(
{optionTag})
+ headTag.push({optionTag})
}else{
headTag.push(검색된 결과가 없습니다.
); // 코드 목록 초기값
}
@@ -254,6 +256,7 @@ function CodeViewer(props) {
}
setDocLoading(false);
setSelectFlag(false);
+ document.querySelector(".detailInfoDiv").scrollTop = 0
},
function (resp) {
console.log("err response : ", resp);
@@ -321,11 +324,11 @@ function CodeViewer(props) {
saveBtn.onclick = (e) => {
const errorEditDiv = e.target.parentElement;
const content = {
+ docInfoSeq: document.querySelector("#docInfoSelector").value,
contTypeCd: errorEditDiv.querySelector(".contTypeCd").value,
errorCd: errorEditDiv.querySelector(".errorCd").value
}
- saveErrorCd(content)
- errorEditDiv.parentElement.querySelector(".errorText").innerText = content.errorCd
+ saveErrorCd(content, errorEditDiv)
hideErrorEditDiv(e)
}
}
@@ -350,7 +353,7 @@ function CodeViewer(props) {
window.location.href = window.location.origin+window.location.pathname+"#error"+e.target.value
}
- function saveErrorCd(content){
+ function saveErrorCd(content, errorEditDiv){
EgovNet.requestFetch(
'/standardCode/saveErrorCd.do',
{
@@ -363,6 +366,7 @@ function CodeViewer(props) {
(resp) => {
if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) {
alert("저장되었습니다.")
+ errorEditDiv.parentElement.querySelector(".errorText").innerText = content.errorCd
}else{
alert("저장에 실패하였습니다.")
}
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 70a0780..f87b0eb 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
@@ -19,4 +19,6 @@ public interface TnDocumentContentRepository extends JpaRepository findByContTypeCd(String contTypeCd);
+ Optional findByDocInfoSeqAndContTypeCd(Integer docInfoSeq, String contTypeCd);
+
}
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 361f809..7bab361 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
@@ -26,7 +26,7 @@ public class StandardCodeService extends EgovAbstractServiceImpl {
@Transactional
public void saveErrorCd(TnDocumentContent content) {
- TnDocumentContent saveContent = tnDocumentContentRepository.findByContTypeCd(content.getContTypeCd()).orElse(null);
+ TnDocumentContent saveContent = tnDocumentContentRepository.findByDocInfoSeqAndContTypeCd(content.getDocInfoSeq(), content.getContTypeCd()).orElse(null);
if(saveContent!=null){
saveContent.setErrorCd(content.getErrorCd());
}