From 274ade0af0e4403affa6e8db2666ffd25d01f3ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9C=A0=EB=AF=BC=ED=98=95?= Date: Fri, 8 Mar 2024 09:17:01 +0900 Subject: [PATCH 1/5] =?UTF-8?q?=EA=B2=8C=EC=8B=9C=ED=8C=90=EA=B4=80?= =?UTF-8?q?=EB=A6=AC=20=EC=B5=9C=EC=A2=85=EC=88=98=EC=A0=95=EC=9D=BC,=20?= =?UTF-8?q?=EC=82=AC=EC=9A=A9=EC=97=AC=EB=B6=80=20=ED=91=9C=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pages/admin/boards/List.jsx | 54 +++---------------- 1 file changed, 6 insertions(+), 48 deletions(-) diff --git a/egovframe-template-simple-react-contribution/src/pages/admin/boards/List.jsx b/egovframe-template-simple-react-contribution/src/pages/admin/boards/List.jsx index 2a1381b..27d39a3 100644 --- a/egovframe-template-simple-react-contribution/src/pages/admin/boards/List.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/admin/boards/List.jsx @@ -53,6 +53,8 @@ function EgovAdminBoardList(props) { // 리스트 항목 구성 resp.result.boardList.forEach(function (item, index) { if (index === 0) mutListTag = []; // 목록 초기화 + const finalModifiedDate = item.lastChgDt ? item.lastChgDt : item.frstCrtDt; + const formattedDate = finalModifiedDate ? format(finalModifiedDate, "yyyy-MM-dd HH:mm") : ""; mutListTag.push(
@@ -60,8 +62,8 @@ function EgovAdminBoardList(props) {
{item.bbsId}
{item.bbsTitle}
{item.frstCrtId}
-
{item.frstCrtDt ? format(item.frstCrtDt, "yyyy-MM-dd HH:mm") : ""}
-
{item.lastChgDt ? format(item.lastChgDt, "yyyy-MM-dd HH:mm") : ""}
+
{formattedDate}
+
{item.useYn}
); @@ -79,7 +81,6 @@ function EgovAdminBoardList(props) { useEffect(() => { retrieveList(searchCondition); - // eslint-disable-next-line react-hooks/exhaustive-deps }, []); function editBoard(item){ @@ -118,44 +119,6 @@ function EgovAdminBoardList(props) {

게시판 관리

- - {/* */} - {/*
- -
*/} - {/* */} - {/* */}
@@ -163,8 +126,8 @@ function EgovAdminBoardList(props) { 아이디 제목 작성자 - 작성일 - 수정일 + 최종수정일 + 사용여부
@@ -174,11 +137,6 @@ function EgovAdminBoardList(props) { {/* */}
- {/* */} - {/* { - retrieveList({ ...searchCondition, pageIndex: passedPage, searchCnd: cndRef.current.value, searchWrd: wrdRef.current.value }) - }} />*/} - {/* */}
{/* */} From 31e8d91c15902618632def7f90cd9d7987e63c1c Mon Sep 17 00:00:00 2001 From: thkim Date: Fri, 8 Mar 2024 09:20:10 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=EA=B4=80=EB=A6=AC=EC=9E=90=20-=20=EC=9C=84?= =?UTF-8?q?=EC=9B=90=ED=9A=8C=EA=B4=80=EB=A6=AC>=20=EC=A7=84=ED=96=89?= =?UTF-8?q?=ED=98=84=ED=99=A9=20=EA=B4=80=EB=A6=AC>=20=EC=9E=90=EC=84=B8?= =?UTF-8?q?=ED=9E=88=20=EB=B3=B4=EA=B8=B0=20=EB=8C=80=EB=9E=B5=EC=A0=81?= =?UTF-8?q?=EC=9D=B8=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/constants/url.js | 3 + .../pages/admin/committee/ProgressStatus.jsx | 2 +- .../admin/committee/ProgressStatus/Detail.jsx | 173 +++++++ .../admin/committee/ProgressStatus/Edit.jsx | 483 ++++++++++++++++++ .../src/routes/index.jsx | 10 +- 5 files changed, 669 insertions(+), 2 deletions(-) create mode 100644 egovframe-template-simple-react-contribution/src/pages/admin/committee/ProgressStatus/Detail.jsx create mode 100644 egovframe-template-simple-react-contribution/src/pages/admin/committee/ProgressStatus/Edit.jsx diff --git a/egovframe-template-simple-react-contribution/src/constants/url.js b/egovframe-template-simple-react-contribution/src/constants/url.js index 561f959..22f6ce3 100644 --- a/egovframe-template-simple-react-contribution/src/constants/url.js +++ b/egovframe-template-simple-react-contribution/src/constants/url.js @@ -109,6 +109,9 @@ const URL = { // 관리자 - 위원회 관리 ADMIN__COMMITTEE__PROGRESS_STATUS : "/admin/committee/progress-status", // 위원회 관리/진행현황 관리 + ADMIN__COMMITTEE__PROGRESS_STATUS__DETAIL : "/admin/committee/progress-status/detail", // 위원회 관리/진행현황 관리/진행현황 관리 상세 + ADMIN__COMMITTEE__PROGRESS_STATUS__CREATE : "/admin/committee/progress-status/create", // 위원회 관리/진행현황 관리/진행현황 관리 생성 + ADMIN__COMMITTEE__PROGRESS_STATUS__MODIFY : "/admin/committee/progress-status/modify", // 위원회 관리/진행현황 관리/진행현황 관리 수정 ADMIN__COMMITTEE__SCHEDULES : "/admin/committee/schedules", // 위원회 관리/위원회 일정 관리 ADMIN__COMMITTEE__SCHEDULES__DETAIL : "/admin/committee/schedules/detail", // 위원회 관리/위원회 일정 관리/일정관리상세 ADMIN__COMMITTEE__SCHEDULES__CREATE : "/admin/committee/schedules/create", // 위원회 관리/위원회 일정 관리/일정관리생성 diff --git a/egovframe-template-simple-react-contribution/src/pages/admin/committee/ProgressStatus.jsx b/egovframe-template-simple-react-contribution/src/pages/admin/committee/ProgressStatus.jsx index 94ff4e8..840a9b3 100644 --- a/egovframe-template-simple-react-contribution/src/pages/admin/committee/ProgressStatus.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/admin/committee/ProgressStatus.jsx @@ -190,7 +190,7 @@ function ProgressStatus(props) {
{it.number}
{it.drftTypeNm}
-
{it.categoryNm}
{it.title}
+
{it.categoryNm}
{it.title}
{it.orgNm}
진행단계표시
{it.regDate}
diff --git a/egovframe-template-simple-react-contribution/src/pages/admin/committee/ProgressStatus/Detail.jsx b/egovframe-template-simple-react-contribution/src/pages/admin/committee/ProgressStatus/Detail.jsx new file mode 100644 index 0000000..79f2bf4 --- /dev/null +++ b/egovframe-template-simple-react-contribution/src/pages/admin/committee/ProgressStatus/Detail.jsx @@ -0,0 +1,173 @@ +import React, { useState, useEffect } from 'react'; +import { Link, useLocation, useNavigate } from 'react-router-dom'; + +import * as EgovNet from 'api/egovFetch'; +import URL from 'constants/url'; +import CODE from 'constants/code'; + +import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin'; + +function SchedulesDetail(props) { + console.group("EgovAdmindetailItem"); + console.log("EgovAdmindetailItem [props] : ", props); + + const navigate = useNavigate(); + const location = useLocation(); + + const [detailItem, setDetailItem] = useState({}); + + const retrieveDetail = () => { + + const retrieveDetailURL = `/admin/committee/progress-status/${location.state?.drftSeq}`; + const requestOptions = { + method: "GET", + headers: { + 'Content-type': 'application/json', + } + } + EgovNet.requestFetch(retrieveDetailURL, + requestOptions, + function (resp) { + setDetailItem(resp.result.item); + } + ); + } + + const onClickDeleteSchedule = (drftSeq) => { + const deleteBoardURL = `/admin/committee/progress-status/${drftSeq}`; + + const requestOptions = { + method: "DELETE", + headers: { + 'Content-type': 'application/json', + } + } + + EgovNet.requestFetch(deleteBoardURL, + requestOptions, + (resp) => { + console.log("====>>> Schdule delete= ", resp); + if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) { + alert("게시글이 삭제되었습니다.") + navigate(URL.ADMIN__COMMITTEE__SCHEDULES ,{ replace: true }); + } else { + // alert("ERR : " + resp.message); + navigate({pathname: URL.ERROR}, {state: {msg : resp.resultMessage}}); + } + + } + ); + } + + useEffect(function () { + retrieveDetail(); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + console.groupEnd("EgovAdmindetailItem"); + return ( +
+
+ {/* */} +
+
    +
  • Home
  • +
  • 사이트관리
  • +
  • 위원회관리
  • +
  • 진행현황 관리
  • +
+
+ {/* */} + +
+ {/* */} + + {/* */} + +
+ {/* */} + +
+

진행현황 관리

+
+ + {/* */} +
+
+
안건
+
{detailItem.title}
+
+
+
기준코드
+
{detailItem.standardCode}
+
+
+
구분
+
{detailItem.drftTypeNm}
+
+
+
회의일자
+
{detailItem.regDate}
+
+
+
위원회
+
{detailItem.orgNm}
+
+
+
회의담당자
+
{detailItem.drftConfeCharger}
+
+
+
회의실 비밀번호
+
{detailItem.drftConfePw}
+
+
+
사전검토자료
+
{detailItem.seq}
+
+
+
사전검토양식
+
{detailItem.seq}
+
+
+
관계기관의견
+
{detailItem.seq}
+
+
+
조치계획서
+
{detailItem.seq}
+
+
+
조치결과서
+
{detailItem.seq}
+
+
+
회의 안건
+
{detailItem.drftSummery}
+
+
+
회의 내용
+
{detailItem.seq}
+
+ + {/* */} +
+
+ 목록 +
+
+ {/* */} + + +
+ {/* */} + + {/* */} +
+
+
+
+ ); +} + +export default SchedulesDetail; \ No newline at end of file diff --git a/egovframe-template-simple-react-contribution/src/pages/admin/committee/ProgressStatus/Edit.jsx b/egovframe-template-simple-react-contribution/src/pages/admin/committee/ProgressStatus/Edit.jsx new file mode 100644 index 0000000..b5b570b --- /dev/null +++ b/egovframe-template-simple-react-contribution/src/pages/admin/committee/ProgressStatus/Edit.jsx @@ -0,0 +1,483 @@ +import React, { useState, useEffect } from 'react'; +import { Link, useLocation, useNavigate } from 'react-router-dom'; +import DatePicker from "react-datepicker"; + + + +import * as EgovNet from 'api/egovFetch'; +import URL from 'constants/url'; +import CODE from 'constants/code'; + +import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin'; + +import 'react-datepicker/dist/react-datepicker.css'; + +import styled from "styled-components"; +import { makeStyles } from "@mui/styles"; + +const useStyles = makeStyles(() => ({ + shake: { + animation: "$description 15s", + animationIterationCount: "1" + }, + "@keyframes description": { + "0%": { opacity: 0, transform: "translateY(0)" }, + "15%": { transform: "translateY(-4px, 0)" }, + "30%": { transform: "translateY(6px, 0)" }, + "45%": { transform: "translateY(-4px, 0)" }, + "60%": { transform: "translateY(6px, 0)" }, + "100%": { opacity: 1, transform: "translateY(0)" } + } + })); + +const StyledDiv = styled.div` + .org-under-id { + margin-left: 20px; + @media only screen and (max-width: 768px) { + display: block; + margin-left: 0px; + margin-top: 20px; + } + } + + .f_select.w_250 { + @media only screen and (max-width: 768px) { + width: 100%; + } + } + + .f_input { + @media only screen and (max-width: 768px) { + width: 100%; + } + } +`; + +function SchedulesEdit(props) { + console.group("EgovAdminScheduleEdit"); + console.log("[Start] EgovAdminScheduleEdit ------------------------------"); + console.log("EgovAdminScheduleEdit [props] : ", props); + + const classes = useStyles(); + const [isShake, setShake] = useState(false); + + //${location.state?.schdulId + + const getDateFourteenDigit = (date) => { + return `${getYYYYMMDD(date).toString()}${makeTwoDigit(date.getHours())}${makeTwoDigit(date.getMinutes())}${makeTwoDigit(date.getSeconds())}`; + } + const getYYYYMMDD = (date) => { + return date.getFullYear().toString() + makeTwoDigit(Number(date.getMonth() + 1)) + makeTwoDigit(date.getDate()); + } + const makeTwoDigit = (number) => { + return number < 10 ? "0" + number : number.toString(); + } + + + const navigate = useNavigate(); + const location = useLocation(); + console.log("EgovAdminScheduleEdit [location] : ", location); + + const [modeInfo, setModeInfo] = useState({ mode: props.mode }); + const [scheduleDetail, setScheduleDetail] = useState + ( + { + startDate: new Date(), + endDate: new Date(), + eventId : 0, + } + ); + + const [schdulBgndeHH, setSchdulBgndeHH] = useState(); + const [schdulBgndeMM, setSchdulBgndeMM] = useState(); + const [schdulEnddeHH, setSchdulEnddeHH] = useState(); + const [schdulEnddeMM, setSchdulEnddeMM] = useState(); + + const [scheduleInit, setScheduleInit] = useState({}); + const [scheduleApiOrgApiDepthList, setScheduleApiOrgApiDepthList] = useState({ }); + + + const initMode = () => { + + // props.mode 값이 없으면 에러가 발생한다. + switch (props.mode) { + case CODE.MODE_CREATE: + setModeInfo({ + ...modeInfo, + modeTitle: "등록", + method : "POST", + editURL: '/schedule' + }); + break; + case CODE.MODE_MODIFY: + setModeInfo({ + ...modeInfo, + modeTitle: "수정", + method : "PUT", + editURL: '/schedule' + }); + break; + default: + navigate({pathname: URL.ERROR}, {state: {msg : ""}}); + } + retrieveDetail(); + } + + const convertDate = (str) => { + let year = str.substring(0, 4); + let month = str.substring(4, 6); + let date = str.substring(6, 8); + let hour = str.substring(8, 10); + let minute = str.substring(10, 12); + return new Date(year, month - 1, date, hour, minute) + } + + const requestOptions = { + method: "GET", + headers: { + 'Content-type': 'application/json' + } + } + + const retrieveDetail = () => { + + EgovNet.requestFetch("/schedule/init", + requestOptions, + function (resp) { + setScheduleInit( + resp + ); + + if (modeInfo.mode === CODE.MODE_CREATE) {// 조회/등록이면 조회 안함 + setScheduleDetail({ + ...scheduleDetail, + schdulBgnde: location.state.iUseDate, + schdulEndde: location.state.iUseDate, + startDate: convertDate(location.state.iUseDate), + endDate: convertDate(location.state.iUseDate), + }); + return; + } + + const retrieveDetailURL = `/schedule/${location.state?.schdulId}`; + const requestOptions = { + method: "GET", + headers: { + 'Content-type': 'application/json' + } + } + EgovNet.requestFetch(retrieveDetailURL, + requestOptions, + function (resp) { + + let rawScheduleDetail = resp.result; + //기본값 설정 + setScheduleDetail({ + ...scheduleDetail, + ...rawScheduleDetail, + startDate: convertDate(rawScheduleDetail.schdulBgnde), + endDate: convertDate(rawScheduleDetail.schdulEndde), + }); + } + ); + } + ); + + } + + const updateSchedule = () => { + const formData = new FormData(); + + for (let key in scheduleDetail) { + if ( key === 'startDate' ) { + formData.append(key, getDateFourteenDigit( scheduleDetail[key] )); + } else if( key === 'endDate' ) { + formData.append(key, getDateFourteenDigit( scheduleDetail[key] )); + } else { + formData.append(key, scheduleDetail[key]); + } + + console.log("scheduleDetail [%s] ", key, scheduleDetail[key]); + } + + if ( formValidator(formData) ) { + const requestOptions = { + method: modeInfo.method, + body: formData + } + + if (modeInfo.mode === CODE.MODE_MODIFY) { + modeInfo.editURL = `${modeInfo.editURL}/${location.state?.schdulId}`; + } + EgovNet.requestFetch(modeInfo.editURL, + requestOptions, + (resp) => { + if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) { + alert('일정이 등록되었습니다.'); + navigate({ pathname: URL.ADMIN__COMMITTEE__SCHEDULES__DETAIL }, {state: {schdulId : resp.result?.schdulId}}); + } else { + navigate({pathname: URL.ERROR}, {state: {msg : resp.resultMessage}}); + } + } + ); + } + + } + + const formValidator = (formData) => { + + if (formData.get('divMeet') === null || formData.get('divMeet') === "") { + alert("구분을 선택해 주세요."); + return false; + } + if (formData.get('upCommittee') === null || formData.get('upCommittee') === "") { + alert("심의위원회 첫 번째 값을 선택해 주세요."); + return false; + } + if (formData.get('committee') === null || formData.get('committee') === "") { + alert("심의위원회 두 번째 값을 선택해 주세요."); + return false; + } + if (formData.get('title') === null || formData.get('title') === "") { + alert("제목을 입력해 주세요."); + return false; + } + if (formData.get('location') === null ||formData.get('location') === "") { + alert("장소를 입력해 주세요."); + return false; + } + if (formData.get('contents') === null ||formData.get('contents') === "") { + alert("내용을 입력해 주세요."); + return false; + } + if (formData.get('schdulBgnde') > formData.get('schdulEndde')) { + alert("종료일시는 시작일시보다 앞 설 수 없습니다."); + //return false; + } + return true; + } + + useEffect(function () { + initMode(); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + useEffect(function () { + console.log("------------------------------EgovAdminScheduleEdit [%o]", scheduleDetail); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [scheduleDetail]); + + useEffect(function () { + + EgovNet.requestFetch(`/schedule/api/org-api/depth/list?paramCodeGroup=${scheduleDetail.upCommittee}`, + requestOptions, + function (resp) { + setScheduleApiOrgApiDepthList( + resp + ); + } + ); + console.log("------------------------------EgovAdminScheduleEdit [%o]", scheduleDetail); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [scheduleDetail && scheduleDetail.upCommittee]); + + + const onClickDeleteSchedule = (schdulId) => { + const deleteBoardURL = `/schedule/${schdulId}`; + + const requestOptions = { + method: "DELETE", + headers: { + 'Content-type': 'application/json', + } + } + + EgovNet.requestFetch(deleteBoardURL, + requestOptions, + (resp) => { + console.log("====>>> Schdule delete= ", resp); + if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) { + alert("게시글이 삭제되었습니다.") + navigate(URL.ADMIN__COMMITTEE__SCHEDULES ,{ replace: true }); + } else { + navigate({pathname: URL.ERROR}, {state: {msg : resp.resultMessage}}); + } + + } + ); + } + + console.log("------------------------------EgovAdminScheduleEdit [End]"); + console.groupEnd("EgovAdminScheduleEdit"); + return ( +
+
+ {/* */} +
+
    +
  • Home
  • +
  • 사이트 관리
  • +
  • 위원회 관리
  • +
  • 위원회 일정 관리
  • +
+
+ {/* */} + +
+ {/* */} + + {/* */} + +
+ {/* */} + +
+

위원회 일정 관리

+
+ + {/* */} + + {/* */} + +
+
구분필수
+
+ +
+
+
+
심의위원회필수
+
+ + +
+
+
+
필수
+
+ setScheduleDetail({ ...scheduleDetail, title: e.target.value })} + /> +
+
+
+
필수
+
+ setScheduleDetail({ ...scheduleDetail, location: e.target.value })} /> +
+
+
+
날짜/시간필수
+
+ + { + console.log("setStartDate : ", date); + setScheduleDetail({ ...scheduleDetail, schdulBgnde: getDateFourteenDigit(date), schdulBgndeYYYMMDD: getYYYYMMDD(date), schdulBgndeHH: date.getHours(), schdulBgndeMM: date.getMinutes(), startDate: date }); + setSchdulBgndeHH(date.getHours()); + setSchdulBgndeMM(date.getMinutes()); + }} /> + + + ~ + + + { + console.log("setEndDate: ", date); + setScheduleDetail({ ...scheduleDetail, schdulEndde: getDateFourteenDigit(date), schdulEnddeYYYMMDD: getYYYYMMDD(date), schdulEnddeHH: date.getHours(), schdulEnddeMM: date.getMinutes(), endDate: date }); + setSchdulEnddeHH(date.getHours()); + setSchdulEnddeMM(date.getMinutes()); + } + } /> + + + +
+
+
+
필수
+
+ +
+
+ + {/* */} +
+
+ + {modeInfo.mode === CODE.MODE_MODIFY && + + } + +
+ +
+ 목록 +
+
+ {/* */} +
+ {/* */} + + {/* */} +
+
+
+
+ ); +} + +export default SchedulesEdit; \ No newline at end of file diff --git a/egovframe-template-simple-react-contribution/src/routes/index.jsx b/egovframe-template-simple-react-contribution/src/routes/index.jsx index d3dc967..10e53ce 100644 --- a/egovframe-template-simple-react-contribution/src/routes/index.jsx +++ b/egovframe-template-simple-react-contribution/src/routes/index.jsx @@ -97,7 +97,11 @@ import AdminContentsStandardResearchEditor from 'pages/admin/contents/StandardRe // import AdminContentsTextMessages from 'pages/admin/contents/TextMessages'; // 관리자 - 컨텐츠 관리/문자 발송 // 관리자 - 위원회 관리 -import AdminCommitteeProgressStatus from 'pages/admin/committee/ProgressStatus'; // 관리자 - 위원회 관리/진행현황 관리 +import AdminCommitteeProgressStatus from 'pages/admin/committee/ProgressStatus'; // 관리자 - 위원회 관리/진행현황 관리 +import AdminCommitteeProgressStatusDetail from 'pages/admin/committee/ProgressStatus/Detail'; // 관리자 - 위원회 관리/진행현황 관리/진행현황 관리 상세 +import AdminCommitteeProgressStatusEdit from 'pages/admin/committee/ProgressStatus/Edit'; // 관리자 - 위원회 관리/진행현황 관리/진행현황 관리 생성 또는 수정 + + import AdminCommitteeSchedules from 'pages/admin/committee/Schedules'; // 관리자 - 위원회 관리/위원회 일정 관리 import AdminCommitteeSchedulesDetail from 'pages/admin/committee/Schedules/Detail'; // 관리자 - 위원회 관리/위원회 일정 관리/일정관리상세 import AdminCommitteeSchedulesEdit from 'pages/admin/committee/Schedules/Edit'; // 관리자 - 위원회 관리/위원회 일정 관리/일정관리생성 또는 수정 @@ -313,6 +317,10 @@ const SecondRoutes = () => { {/* 관리자 - 위원회 관리 */} } /> + } /> + } /> + } /> + } /> } /> } /> From 92b2b44d6e33c9c4077649a957135bb7832cbf9b Mon Sep 17 00:00:00 2001 From: thkim Date: Fri, 8 Mar 2024 09:56:54 +0900 Subject: [PATCH 3/5] =?UTF-8?q?feat:=20=EA=B4=80=EB=A6=AC=EC=9E=90=20-=20?= =?UTF-8?q?=EC=9C=84=EC=9B=90=ED=9A=8C=EA=B4=80=EB=A6=AC>=20=EC=A7=84?= =?UTF-8?q?=ED=96=89=ED=98=84=ED=99=A9=20=EA=B4=80=EB=A6=AC>=20=EC=9E=90?= =?UTF-8?q?=EC=84=B8=ED=9E=88=20=EB=B3=B4=EA=B8=B0=20-=20back-end?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../committee/AdminCommitteeController.java | 38 ++++++++++ .../AdminCommitteeProgressStatusService.java | 5 +- ...minCommitteeProgressStatusServiceImpl.java | 24 ++++++ .../repository/TnCmtDraftRepository.java | 73 +++++++++++++++++++ 4 files changed, 138 insertions(+), 2 deletions(-) diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/AdminCommitteeController.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/AdminCommitteeController.java index c57b67a..5aac4b0 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/AdminCommitteeController.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/AdminCommitteeController.java @@ -88,5 +88,43 @@ public class AdminCommitteeController extends BaseController { return resultVO; } + @Operation( + summary = "'진행현황 관리' 페이지에서 코드명 눌렀을 때 보여질 상세 페이지 불러오는 API", + description = "관리자 단에서 '위원회관리' > '진행현황 관리' 페이지에서 코드명 눌렀을 때 보여질 상세 페이지 목록 불러오는 API", + tags = {"AdminCommitteeController"} + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "조회 성공") + }) + @GetMapping(value = "/progress-status/{drftSeq}") + public ResultVO getCommitteeProgressStatusDetail( + HttpServletRequest request, + @AuthenticationPrincipal LoginVO user, + @PathVariable("drftSeq") Long drftSeq + ) + throws Exception { + + ResultVO resultVO = new ResultVO(); + + try { + resultVO = adminCommitteeProgressStatusService.getCommitteeProgressStatusDetail(resultVO, request, user, drftSeq); + } catch (Exception e) { + resultVO.setResultCode(ResponseCode.FAILED.getCode()); + resultVO.setResultMessage(e.getMessage()); + } + + + System.out.println( + "\n--------------------------------------------------------------\n" + + request.getRequestURI() + " OUT:" + + "\n--------------------------------------------------------------\n" + + "resultVO.toString():" + "\n" + + resultVO.toString() + "\n" + + "\n--------------------------------------------------------------\n" + ); + + return resultVO; + } + } diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/service/AdminCommitteeProgressStatusService.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/service/AdminCommitteeProgressStatusService.java index be7a069..13871cd 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/service/AdminCommitteeProgressStatusService.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/service/AdminCommitteeProgressStatusService.java @@ -11,8 +11,9 @@ import javax.servlet.http.HttpServletRequest; public interface AdminCommitteeProgressStatusService { public ResultVO createCommitteeProgressStatus(ResultVO resultVO, HttpServletRequest request, LoginVO user, CreateCommitteeCodeManagementVO createCommitteeCodeManagementVO) throws Exception; public ResultVO getCommitteeProgressStatus(ResultVO resultVO, HttpServletRequest request, LoginVO user, Pageable pageable) throws Exception; - public ResultVO setCommitteeProgressStatus(ResultVO resultVO, HttpServletRequest request, LoginVO user, SetCommitteeCodeManagementVO setCommitteeCodeManagementVO, Long cmtSeq) throws Exception; - public ResultVO deleteCommitteeProgressStatus(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long cmtSeq) throws Exception; + public ResultVO setCommitteeProgressStatus(ResultVO resultVO, HttpServletRequest request, LoginVO user, SetCommitteeCodeManagementVO setCommitteeCodeManagementVO, Long drftSeq) throws Exception; + public ResultVO deleteCommitteeProgressStatus(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long drftSeq) throws Exception; + public ResultVO getCommitteeProgressStatusDetail(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long drftSeq) throws Exception; } \ No newline at end of file diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/service/impl/AdminCommitteeProgressStatusServiceImpl.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/service/impl/AdminCommitteeProgressStatusServiceImpl.java index d90dce0..8e70936 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/service/impl/AdminCommitteeProgressStatusServiceImpl.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/service/impl/AdminCommitteeProgressStatusServiceImpl.java @@ -221,4 +221,28 @@ public class AdminCommitteeProgressStatusServiceImpl extends EgovAbstractService return resultVO; } + @Override + public ResultVO getCommitteeProgressStatusDetail(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long drftSeq) throws Exception { + System.out.println( + "\n--------------------------------------------------------------\n" + + request.getRequestURI() + " IN:" + + "\n--------------------------------------------------------------\n" + + "user.getEmail():" + "\n" + + user.getEmail() + "\n" + + "drftSeq:" + "\n" + + drftSeq + "\n" + + "\n--------------------------------------------------------------\n" + ); + + Map item = tnCmtDraftRepository.getCommitteeProgressStatusDetail(drftSeq); + Map dto = new HashMap(); + + dto.put("item", item); + resultVO.setResult(dto); + resultVO.setResultCode(ResponseCode.SUCCESS.getCode()); + resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage()); + + return resultVO; + } + } diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/repository/TnCmtDraftRepository.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/repository/TnCmtDraftRepository.java index 43e5a38..038ffd5 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/repository/TnCmtDraftRepository.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/repository/TnCmtDraftRepository.java @@ -208,5 +208,78 @@ public interface TnCmtDraftRepository extends JpaRepository { @Param("offset") Integer offset ); + @Query(value = + "select " + + " tcd.drft_seq as \"seq\", " + + " tcd.doc_info_seq as \"categoryId\", " + + " tcd.drft_dt as \"drftDatetime\", " + + " tcd.drft_title as \"title\", " + + " null as \"drftCharger\", " + + " null as \"drftChargerEmail\", " + + " null as \"drftChargerPhone\", " + + " null as \"drftStatCode\", " + + " tcd.drft_type_cd as \"drftTypeCode\", " + + " tcd.cmt_seq as \"orgId\", " + + " null as \"startDatetime\", " + + " null as \"endDatetime\", " + + " null as \"closeDatetime\", " + + " tcd.frst_crt_dt as \"createDate\", " + + " tcd.last_chg_dt as \"updateDate\", " + + " null as \"createUserId\", " + + " null as \"updateUserId\", " + + " case when UPPER(tcd.use_yn) = 'Y' then 'N' else 'Y' end as \"delYn\", " + + " tcd.drft_summery as \"drftSummery\", " + + " tcd.drft_confe_charger as \"drftConfeCharger\", " + + " tcd.drft_confe_pw as \"drftConfePw\", " + + " tcd.drft_confe_room as \"drftConfeRoom\", " + + " null as \"drftMeasurePlanFileSeq\", " + + " null as \"drftMeasureResultFileSeq\", " + + " null as \"drftMeasurePlanFileName\", " + + " null as \"drftMeasureResultFileName\", " + + " null as \"drftMeasurePreDataFileName\", " + + " null as \"drftMeasurePreDataFileSeq\", " + + " null as \"drftMeasurePreFormFileName\", " + + " null as \"drftMeasurePreFormFileSeq\", " + + " null as \"drftMeasurePartnerFileName\", " + + " null as \"drftMeasurePartnerFileSeq\", " + + " null as \"drftProcess\", " + + " ( " + + " select tci.item_nm " + + " from tc_code_item tci " + + " where tci.item_cd = tcd.drft_type_cd " + + " limit 1 offset 0 " + + " ) as \"drftTypeNm\", " + + " concat(tdi.kcsc_cd, ' ', tdi.doc_nm) as \"categoryNm\", " + + " tco.cmt_nm as \"orgNm\", " + + " ( " + + " select tci.item_nm " + + " from tc_code_item tci " + + " where tci.item_cd = tcd.drft_stat_cd " + + " limit 1 offset 0 " + + " ) as \"drftStatNm\", " + + " null as \"categoryInfo\", " + + " null as \"orgType\", " + + " null as \"upOrgId\", " + + " null as \"orgList\", " + + " null as \"orgList1\", " + + " null as \"orgList2\", " + + " null as \"orgList3\", " + + " null as \"depthOrgId\", " + + " null as \"depthOrgId1\", " + + " null as \"depthOrgId2\", " + + " null as \"depthOrgId3\", " + + " tdi.kcsc_cd as \"standardCode\", " + + " to_char(tcd.frst_crt_dt, 'yyyy-mm-dd') as \"regDate\" " + + "from tn_cmt_draft tcd " + + "left join tn_document_info tdi on tcd.doc_info_seq = tdi.doc_info_seq " + + "left join tn_document_group tdg on tdi.group_seq = tdg.group_seq " + + "left join tn_cmt_org tco on tcd.cmt_seq = tco.cmt_seq " + + "where tcd.drft_seq = :drftSeq " + + "order by tcd.drft_seq desc ", + nativeQuery = true) + Map getCommitteeProgressStatusDetail( + @Param("drftSeq") Long drftSeq + ); + } From 8ee3517f6be4695e12a5419d206ec947febf6f18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9C=A0=EB=AF=BC=ED=98=95?= Date: Fri, 8 Mar 2024 17:56:00 +0900 Subject: [PATCH 4/5] =?UTF-8?q?=EA=B2=8C=EC=8B=9C=EB=AC=BC=20=EA=B4=80?= =?UTF-8?q?=EB=A6=AC=20=EB=93=B1=EB=A1=9D,=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/admin/board/AdminPostMgtEdit.jsx | 104 ++++++++++++++---- .../pages/admin/board/AdminPostMgtList.jsx | 20 ++-- .../pages/admin/board/EgovAdminBoardEdit.jsx | 6 +- .../admin/boards/AdminBoardsController.java | 85 +++++++++++++- .../admin/boards/entity/TnBbsContents.java | 21 ++-- .../repository/TnBbsContentsRepository.java | 10 ++ .../boards/repository/TnBbsRepository.java | 2 - .../boards/service/AdminBoardsService.java | 45 +++++++- 8 files changed, 243 insertions(+), 50 deletions(-) diff --git a/egovframe-template-simple-react-contribution/src/pages/admin/board/AdminPostMgtEdit.jsx b/egovframe-template-simple-react-contribution/src/pages/admin/board/AdminPostMgtEdit.jsx index 0335671..05ae684 100644 --- a/egovframe-template-simple-react-contribution/src/pages/admin/board/AdminPostMgtEdit.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/admin/board/AdminPostMgtEdit.jsx @@ -1,4 +1,4 @@ -import React, {useState, useEffect, useRef} from 'react'; +import React, {useState, useEffect, useRef, useCallback} from 'react'; import {Link, useNavigate, useLocation, useParams} from 'react-router-dom'; import Modal from "react-bootstrap/Modal"; @@ -9,6 +9,7 @@ import CODE from 'constants/code'; import {default as EgovLeftNav} from 'components/leftmenu/EgovLeftNavAdmin'; import EgovRadioButtonGroup from 'components/EgovRadioButtonGroup'; import {Form} from "react-bootstrap"; +import RichTextEditor from "../../../components/editor/RichTextEditor"; function AdminPostMgtEdit({props, reloadFunction}) { @@ -30,7 +31,33 @@ function AdminPostMgtEdit({props, reloadFunction}) { const [boardDetail, setBoardDetail] = useState({}); console.log("@@@ mode : " + modeInfo.mode); + const [categoryList, setCategoryList] = useState([]); + + const retrieveList = useCallback(() => { + const retrieveListURL = '/admin/boards/get-category-list'; + + const requestOptions = { + method: "GET", + headers: { + 'Content-type': 'application/json', + }, + body: JSON.stringify() + } + + EgovNet.requestFetch(retrieveListURL, + requestOptions, + (resp) => { + setCategoryList(resp.result.categoryList); + console.log("@@@ categoryList : " + JSON.stringify(resp.result.categoryList)); + }, + function (resp) { + console.log("err response : ", resp); + } + ); + },[]); + useEffect(() => { + retrieveList(); initMode(); // eslint-disable-next-line react-hooks/exhaustive-deps }, []); @@ -41,22 +68,24 @@ function AdminPostMgtEdit({props, reloadFunction}) { } } - function editPartnerSite(e) { + function editPost(e) { e.preventDefault(); e.stopPropagation(); const form = e.target; const info = { - siteTitle: form.siteTitle.value, - siteUrl: form.siteUrl.value, + fixedYn: defaultFixedYn, + secretYn: defaultSecretYn, + bbsId: form.bbsId.value, + bbsSeq: selectedBbsSeq, + bbsContTitle: form.bbsContTitle.value, fileGrpId: form.fileGrpId.value, - siteOrder: form.siteOrder.value, - useYn: form.useYn.value + bbsContents: text } if (modeInfo.mode === CODE.MODE_MODIFY) { - info.siteSeq = props.siteSeq; + info.bbsContSeq = props.bbsContSeq; } EgovNet.requestFetch( - '/admin/config/partner-site-mgt', + '/admin/boards/post-mgt', { method: "PUT", headers: { @@ -77,16 +106,16 @@ function AdminPostMgtEdit({props, reloadFunction}) { ) } - function deletePartnerSite(partnerSite){ + function deletePost(post){ if(window.confirm("삭제하시겠습니까?")) { EgovNet.requestFetch( - '/admin/config/partner-site-mgt', + '/admin/boards/post-mgt', { method: "DELETE", headers: { 'Content-type': 'application/json' }, - body: JSON.stringify(partnerSite) + body: JSON.stringify(post) }, (resp) => { if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) { @@ -106,9 +135,25 @@ function AdminPostMgtEdit({props, reloadFunction}) { console.groupEnd("AdminPostMgtEdit"); const [defaultFixedYn, setDefaultFixedYn] = useState(props?.fixedYn || "N"); + const [defaultSecretYn, setDefaultSecretYn] = useState(props?.secretYn || "N"); + const [text, setText] = useState(props?.bbsContents); + const [selectedBbsSeq, setSelectedBbsSeq] = useState(null); + + const handleSelectChange = (e) => { + const selectedBbsId = e.target.value; + const selectedOption = categoryList.find((item) => item.bbsId === selectedBbsId); + setSelectedBbsSeq(selectedOption.bbsSeq); + } return ( <> + {/* */} @@ -119,13 +164,13 @@ function AdminPostMgtEdit({props, reloadFunction}) {
-
{editPartnerSite(e)}} noValidate> + {editPost(e)}} noValidate>
필수
setDefaultFixedYn(e.target.checked ? 'Y' : 'N')} @@ -135,29 +180,44 @@ function AdminPostMgtEdit({props, reloadFunction}) {
필수
- + setDefaultSecretYn(e.target.checked ? 'Y' : 'N')} + /> +
+
+
+
필수
+
+ + + {categoryList.map((item) => ( + + ))} +
필수
- +
필수
- +
필수
- +
@@ -167,7 +227,7 @@ function AdminPostMgtEdit({props, reloadFunction}) { {modeInfo.mode === CODE.MODE_MODIFY && - + }
diff --git a/egovframe-template-simple-react-contribution/src/pages/admin/board/AdminPostMgtList.jsx b/egovframe-template-simple-react-contribution/src/pages/admin/board/AdminPostMgtList.jsx index 4f65a0d..53ad99b 100644 --- a/egovframe-template-simple-react-contribution/src/pages/admin/board/AdminPostMgtList.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/admin/board/AdminPostMgtList.jsx @@ -12,6 +12,7 @@ import CODE from "../../../constants/code"; import AboutSiteModal from "../config/aboutSiteMgt/AboutSiteModal"; import AdminPostMgtEdit from "./AdminPostMgtEdit"; import Modal from "react-bootstrap/Modal"; +import {format} from "date-fns"; function AdminPostMgtList(props) { console.group("EgovAdminPostList"); @@ -36,6 +37,7 @@ function AdminPostMgtList(props) { const handleShow = () => setShow(true); const retrieveList = useCallback(() => { + handleClose(); console.groupCollapsed("EgovAdminPostList.retrieveList()"); const retrieveListURL = '/admin/boards/post-list'; @@ -60,15 +62,18 @@ function AdminPostMgtList(props) { // 리스트 항목 구성 resp.result.postList.forEach(function (item, index) { if (index === 0) mutListTag = []; // 목록 초기화 + const finalModifiedDate = item.lastChgDt ? item.lastChgDt : item.frstCrtDt; + const formattedDate = finalModifiedDate ? format(finalModifiedDate, "yyyy-MM-dd HH:mm") : ""; mutListTag.push(
-
{item.bbsContSeq}
-
{item.bbsSeq}
+
{item.bbsContTitle}
-
{item.bbsContents}
+
{item.frstCrtId}
+
{formattedDate}
{item.bbsReadCnt}
-
{item.bbsContLevel}
+
{item.fileGrpId}
+
); }); @@ -131,7 +136,7 @@ function AdminPostMgtList(props) {