From c8d058fd6656d0f09ab695d732dd2f3fd3ceae44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=84=9D=20=EC=B5=9C?= Date: Tue, 5 Dec 2023 17:03:40 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B8=B0=EC=A4=80=EC=BD=94=EB=93=9C=EB=B7=B0?= =?UTF-8?q?=EC=96=B4=20=20-=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=ED=81=AC?= =?UTF-8?q?=EA=B8=B0=20=EC=A1=B0=EC=A0=95=20=20-=20=EC=97=90=EB=9F=AC=20?= =?UTF-8?q?=EB=AC=B8=EA=B5=AC=20=ED=8E=B8=EC=A7=91=20=ED=9B=84=20=EB=8F=99?= =?UTF-8?q?=EC=9E=91=20=EC=9D=B4=EC=83=81=20=EC=88=98=EC=A0=95.=20=20-=20?= =?UTF-8?q?=EC=83=88=20=EB=AC=B8=EC=84=9C=20=EC=97=B4=EB=9E=8C=20=EB=8F=99?= =?UTF-8?q?=EC=9E=91=20=EC=97=90=EB=9F=AC=20=EC=88=98=EC=A0=95.=20=20-=20?= =?UTF-8?q?=EC=83=88=20=EB=AC=B8=EC=84=9C=20=EC=97=B4=EB=9E=8C=20=EC=8B=9C?= =?UTF-8?q?=20=EC=8A=A4=ED=81=AC=EB=A1=A4=20=EB=A6=AC=EC=85=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/css/page.css | 2 +- .../src/pages/standardCode/viewer.js | 12 ++++++++---- .../repository/TnDocumentContentRepository.java | 2 ++ .../standardCode/service/StandardCodeService.java | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) 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()); }