Compare commits
No commits in common. "201698ccd957ea374490d71a06fce7b408a0089f" and "9bbb1c1d71af57b199ea575e9e88d7d987f91853" have entirely different histories.
201698ccd9
...
9bbb1c1d71
|
|
@ -30,6 +30,3 @@ yarn-error.log*
|
||||||
|
|
||||||
# code
|
# code
|
||||||
.history
|
.history
|
||||||
|
|
||||||
# Develop environment
|
|
||||||
.env.development.local
|
|
||||||
|
|
@ -19,7 +19,6 @@ function Schedules(props) {
|
||||||
|
|
||||||
const DATE = new Date();
|
const DATE = new Date();
|
||||||
const TODAY = new Date(DATE.getFullYear(), DATE.getMonth(), DATE.getDate());
|
const TODAY = new Date(DATE.getFullYear(), DATE.getMonth(), DATE.getDate());
|
||||||
//const TODAY = new Date(2023, 2, DATE.getDate());
|
|
||||||
|
|
||||||
const [searchCondition, setSearchCondition] = useState(location.state?.searchCondition || { schdulSe: '', year: TODAY.getFullYear(), month: TODAY.getMonth(), date: TODAY.getDate() });
|
const [searchCondition, setSearchCondition] = useState(location.state?.searchCondition || { schdulSe: '', year: TODAY.getFullYear(), month: TODAY.getMonth(), date: TODAY.getDate() });
|
||||||
const [calendarTag, setCalendarTag] = useState([]);
|
const [calendarTag, setCalendarTag] = useState([]);
|
||||||
|
|
@ -151,39 +150,23 @@ function Schedules(props) {
|
||||||
if (day !== 0) {//당월 일별 구현
|
if (day !== 0) {//당월 일별 구현
|
||||||
let sDate = day.toString().length === 1 ? "0" + day.toString() : day.toString();
|
let sDate = day.toString().length === 1 ? "0" + day.toString() : day.toString();
|
||||||
let iUseDate = Number(mutsUseYearMonth + sDate);
|
let iUseDate = Number(mutsUseYearMonth + sDate);
|
||||||
if (scheduleList.length > 0) {//일정 있는 경우
|
if (scheduleList.length > 0 || sDate === "01") {//일정 있는 경우
|
||||||
return (
|
return (
|
||||||
<td key={keyIdx++}>
|
<td key={keyIdx++}>
|
||||||
<Link to={{pathname: URL.ADMIN__COMMITTEE__SCHEDULES__CREATE}} state={{iUseDate: mutsUseYearMonth + sDate + "000000"}} className="day"
|
<Link to={{pathname: URL.ADMIN__COMMITTEE__SCHEDULES__CREATE}} state={{iUseDate : mutsUseYearMonth + sDate + "000000"}} className="day" key={keyIdx++}>{day}</Link><br />
|
||||||
key={keyIdx++}>{day}</Link><br/>
|
|
||||||
{
|
{
|
||||||
scheduleList.map((schedule, scheduleIdx) => {
|
<div>
|
||||||
let test = schedule.evt_start_dt.replace('-','');
|
<div>오후 03:00 [P] 해양경찰청</div>
|
||||||
console.log( test );
|
<div>오후 05:00 [P] 미팅...</div>
|
||||||
let iBeginDate = Number(schedule.evt_start_dt.substring(0, 8));
|
</div>
|
||||||
let iEndDate = Number(schedule.evt_end_dt.substring(0, 8));
|
|
||||||
innerConsole("scheduleList ", day, scheduleIdx, iBeginDate, iUseDate, iEndDate, iUseDate >= iBeginDate && iUseDate <= iEndDate);
|
|
||||||
innerConsole("schedule.schdulId ", schedule.schdulId);
|
|
||||||
if (iUseDate >= iBeginDate && iUseDate <= iEndDate) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Link to={{pathname: URL.ADMIN__COMMITTEE__SCHEDULES__DETAIL}}
|
|
||||||
state={{schdulId: schedule.schdulId}}
|
|
||||||
key={keyIdx++}>{schedule.schdulNm}
|
|
||||||
</Link>
|
|
||||||
<br/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
} else return <></>
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
</td>
|
</td>
|
||||||
);
|
);
|
||||||
} else {//일정 없는 경우
|
} else {//일정 없는 경우
|
||||||
return (
|
return (
|
||||||
<td key={keyIdx++}>
|
<td key={keyIdx++}>
|
||||||
<Link to={{pathname: URL.ADMIN__COMMITTEE__SCHEDULES__CREATE}} state={{iUseDate: mutsUseYearMonth + sDate + "000000"}} className="day"
|
<Link to={{pathname: URL.ADMIN__COMMITTEE__SCHEDULES__CREATE}} state={{iUseDate : mutsUseYearMonth + sDate + "000000"}} className="day" key={keyIdx++}>{day}</Link><br />
|
||||||
key={keyIdx++}>{day}</Link><br/>
|
|
||||||
</td>);
|
</td>);
|
||||||
}
|
}
|
||||||
} else if (day === 0) {// 이전달/다음달 구현
|
} else if (day === 0) {// 이전달/다음달 구현
|
||||||
|
|
|
||||||
|
|
@ -33,23 +33,42 @@ function SchedulesDetail(props) {
|
||||||
EgovNet.requestFetch(retrieveDetailURL,
|
EgovNet.requestFetch(retrieveDetailURL,
|
||||||
requestOptions,
|
requestOptions,
|
||||||
function (resp) {
|
function (resp) {
|
||||||
/**
|
let rawScheduleDetail = resp.result.scheduleDetail;
|
||||||
* dto.put("evtSeq", tnCmtEvent.getEvtSeq()); // sequence
|
rawScheduleDetail.startDateTime = convertDate(rawScheduleDetail.schdulBgnde);
|
||||||
dto.put("divMeet", tnCmtEvent.getEvtType()); // 구분
|
rawScheduleDetail.endDateTime = convertDate(rawScheduleDetail.schdulEndde);
|
||||||
dto.put("upCommittee", tnCmtEvent.getUpCmtSeq()); // 심의위원회 상위 코드 번호
|
rawScheduleDetail.reptitSeCodeNm = getCodeName(resp.result.reptitSeCode, resp.result.scheduleDetail.reptitSeCode);
|
||||||
dto.put("committee", tnCmtEvent.getCmtSeq()); // 심의위원회 하위 코드 번호
|
rawScheduleDetail.schdulIpcrCodeNm = getCodeName(resp.result.schdulIpcrCode, resp.result.scheduleDetail.schdulIpcrCode);
|
||||||
dto.put("title", tnCmtEvent.getEvtTitle()); // 제목
|
rawScheduleDetail.schdulSeNm = getCodeName(resp.result.schdulSe, resp.result.scheduleDetail.schdulSe);
|
||||||
dto.put("location", tnCmtEvent.getEvtLocation()); // 장소
|
setScheduleDetail(rawScheduleDetail);
|
||||||
dto.put("contents", tnCmtEvent.getEvtContents()); // 내용
|
setUser(resp.result.user);
|
||||||
dto.put("startDate", tnCmtEvent.getEvtStartDt()); // 날짜/시간의 시작 일시
|
setBoardAttachFiles(resp.result.resultFiles);
|
||||||
dto.put("endDate", tnCmtEvent.getEvtEndDt()); // 날짜/시간의 종료 일시
|
|
||||||
*/
|
|
||||||
setScheduleDetail(resp.result);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
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 {
|
||||||
|
year: year,
|
||||||
|
month: month,
|
||||||
|
date: date,
|
||||||
|
hour: hour,
|
||||||
|
minute: minute,
|
||||||
|
dateForm: year + "년 " + month + "월 " + date + "일 " + hour + "시 " + minute + "분 "
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const getCodeName = (codeArr, code) => {
|
||||||
|
return (
|
||||||
|
codeArr.map((codeObj) => {
|
||||||
|
if (codeObj.code === code.trim()) return codeObj.codeNm
|
||||||
|
else return "";
|
||||||
|
})
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const onClickDeleteSchedule = (schdulId) => {
|
const onClickDeleteSchedule = (schdulId) => {
|
||||||
const deleteBoardURL = `/schedule/${schdulId}`;
|
const deleteBoardURL = `/schedule/${schdulId}`;
|
||||||
|
|
@ -92,8 +111,7 @@ function SchedulesDetail(props) {
|
||||||
<ul>
|
<ul>
|
||||||
<li><Link to={URL.MAIN} className="home">Home</Link></li>
|
<li><Link to={URL.MAIN} className="home">Home</Link></li>
|
||||||
<li><Link to={URL.ADMIN}>사이트관리</Link></li>
|
<li><Link to={URL.ADMIN}>사이트관리</Link></li>
|
||||||
<li>위원회관리</li>
|
<li>일정관리</li>
|
||||||
<li>일정관리 상세보기</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{/* <!--// Location --> */}
|
{/* <!--// Location --> */}
|
||||||
|
|
@ -107,36 +125,48 @@ function SchedulesDetail(props) {
|
||||||
{/* <!-- 본문 --> */}
|
{/* <!-- 본문 --> */}
|
||||||
|
|
||||||
<div className="top_tit">
|
<div className="top_tit">
|
||||||
<h1 className="tit_1">일정관리 상세보기</h1>
|
<h1 className="tit_1">사이트관리</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<h2 className="tit_2">일정관리 상세보기</h2>
|
||||||
|
|
||||||
{/* <!-- 게시판 상세보기 --> */}
|
{/* <!-- 게시판 상세보기 --> */}
|
||||||
<div className="board_view2">
|
<div className="board_view2">
|
||||||
<dl>
|
<dl>
|
||||||
<dt>구분</dt>
|
<dt>일정구분</dt>
|
||||||
<dd>{scheduleDetail.divMeetNm}</dd>
|
<dd>{scheduleDetail.schdulSeNm}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>심의위원회</dt>
|
<dt>중요도</dt>
|
||||||
<dd>{scheduleDetail.upCommitteeNm} - {scheduleDetail.committeeNm}</dd>
|
<dd>{scheduleDetail.schdulIpcrCodeNm}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>제목</dt>
|
<dt>부서</dt>
|
||||||
<dd>{scheduleDetail.title}</dd>
|
<dd>{scheduleDetail.schdulDeptName}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>장소</dt>
|
<dt>일정명</dt>
|
||||||
<dd>{scheduleDetail.location}</dd>
|
<dd>{scheduleDetail.schdulNm}</dd>
|
||||||
|
</dl>
|
||||||
|
<dl>
|
||||||
|
<dt>일정내용</dt>
|
||||||
|
<dd>{scheduleDetail.schdulCn}</dd>
|
||||||
|
</dl>
|
||||||
|
<dl>
|
||||||
|
<dt>반복구분</dt>
|
||||||
|
<dd>{scheduleDetail.reptitSeCodeNm}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>날짜/시간</dt>
|
<dt>날짜/시간</dt>
|
||||||
<dd> {scheduleDetail.startDate} ~ {scheduleDetail.endDate}</dd>
|
<dd> {scheduleDetail.startDateTime?.dateForm} ~ {scheduleDetail.endDateTime?.dateForm}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>내용</dt>
|
<dt>담당자</dt>
|
||||||
<dd>{scheduleDetail.contents}</dd>
|
<dd>{scheduleDetail.schdulChargerName}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
|
<EgovAttachFile boardFiles={boardAttachFiles} />
|
||||||
|
|
||||||
{/* <!-- 버튼영역 --> */}
|
{/* <!-- 버튼영역 --> */}
|
||||||
<div className="board_btn_area">
|
<div className="board_btn_area">
|
||||||
{user.id &&
|
{user.id &&
|
||||||
|
|
@ -150,10 +180,11 @@ function SchedulesDetail(props) {
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
onClickDeleteSchedule(location.state?.schdulId);
|
onClickDeleteSchedule(location.state?.schdulId);
|
||||||
}}>삭제</button>
|
}}>삭제</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
<div className="right_col btn1">
|
<div className="right_col btn1">
|
||||||
<Link to={URL.ADMIN__COMMITTEE__SCHEDULES} className="btn btn_blue_h46 w_100">목록</Link>
|
<Link to={URL.ADMIN_SCHEDULE} className="btn btn_blue_h46 w_100">목록</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* <!--// 버튼영역 --> */}
|
{/* <!--// 버튼영역 --> */}
|
||||||
|
|
|
||||||
|
|
@ -61,32 +61,12 @@ function SchedulesEdit(props) {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
const [isShake, setShake] = useState(false);
|
const [isShake, setShake] = useState(false);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const getDateFourteenDigit = (date) => {
|
|
||||||
return `${getYYYY_MM_DD(date).toString()} ${makeTwoDigit(date.getHours())}:${makeTwoDigit(date.getMinutes())}:${makeTwoDigit(date.getSeconds())}`;
|
|
||||||
}
|
|
||||||
const getYYYY_MM_DD = (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 navigate = useNavigate();
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
console.log("EgovAdminScheduleEdit [location] : ", location);
|
console.log("EgovAdminScheduleEdit [location] : ", location);
|
||||||
|
|
||||||
const [modeInfo, setModeInfo] = useState({ mode: props.mode });
|
const [modeInfo, setModeInfo] = useState({ mode: props.mode });
|
||||||
const [scheduleDetail, setScheduleDetail] = useState
|
const [scheduleDetail, setScheduleDetail] = useState({ startDate: new Date(), endDate: new Date() });
|
||||||
(
|
|
||||||
{
|
|
||||||
startDate: new Date(),
|
|
||||||
endDate: new Date(),
|
|
||||||
eventId : 0,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
const [schdulBgndeHH, setSchdulBgndeHH] = useState();
|
const [schdulBgndeHH, setSchdulBgndeHH] = useState();
|
||||||
const [schdulBgndeMM, setSchdulBgndeMM] = useState();
|
const [schdulBgndeMM, setSchdulBgndeMM] = useState();
|
||||||
|
|
@ -158,20 +138,33 @@ function SchedulesEdit(props) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const retrieveDetailURL = `/schedule/${location.state?.schdulId}`;
|
||||||
|
|
||||||
|
EgovNet.requestFetch(retrieveDetailURL,
|
||||||
|
requestOptions,
|
||||||
|
function (resp) {
|
||||||
|
let rawScheduleDetail = resp.result.scheduleDetail;
|
||||||
|
//기본값 설정
|
||||||
|
setScheduleDetail({
|
||||||
|
...scheduleDetail,
|
||||||
|
...rawScheduleDetail,
|
||||||
|
startDate: convertDate(rawScheduleDetail.schdulBgnde),
|
||||||
|
endDate: convertDate(rawScheduleDetail.schdulEndde),
|
||||||
|
atchFileId : rawScheduleDetail.atchFileId.trim(),
|
||||||
|
schdulIpcrCode : "B",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateSchedule = () => {
|
const updateSchedule = () => {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
|
|
||||||
for (let key in scheduleDetail) {
|
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]);
|
formData.append(key, scheduleDetail[key]);
|
||||||
}
|
|
||||||
|
|
||||||
console.log("scheduleDetail [%s] ", key, scheduleDetail[key]);
|
console.log("scheduleDetail [%s] ", key, scheduleDetail[key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -188,8 +181,7 @@ function SchedulesEdit(props) {
|
||||||
requestOptions,
|
requestOptions,
|
||||||
(resp) => {
|
(resp) => {
|
||||||
if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) {
|
if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) {
|
||||||
alert('일정이 등록되었습니다.');
|
navigate({ pathname: URL.ADMIN_SCHEDULE });
|
||||||
navigate({ pathname: URL.ADMIN__COMMITTEE__SCHEDULES__DETAIL }, {state: {schdulId : resp.result?.schdulId}});
|
|
||||||
} else {
|
} else {
|
||||||
navigate({pathname: URL.ERROR}, {state: {msg : resp.resultMessage}});
|
navigate({pathname: URL.ERROR}, {state: {msg : resp.resultMessage}});
|
||||||
}
|
}
|
||||||
|
|
@ -202,38 +194,40 @@ function SchedulesEdit(props) {
|
||||||
const formValidator = (formData) => {
|
const formValidator = (formData) => {
|
||||||
|
|
||||||
if (formData.get('divMeet') === null || formData.get('divMeet') === "") {
|
if (formData.get('divMeet') === null || formData.get('divMeet') === "") {
|
||||||
alert("구분을 선택해 주세요.");
|
alert("일정구분은 필수 값입니다.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (formData.get('upCommittee') === null || formData.get('upCommittee') === "") {
|
if (formData.get('schdulNm') === null || formData.get('schdulNm') === "") {
|
||||||
alert("심의위원회 첫 번째 값을 선택해 주세요.");
|
alert("일정명은 필수 값입니다.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (formData.get('committee') === null || formData.get('committee') === "") {
|
if (formData.get('schdulCn') === null || formData.get('schdulCn') === "") {
|
||||||
alert("심의위원회 두 번째 값을 선택해 주세요.");
|
alert("일정내용은 필수 값입니다.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (formData.get('title') === null || formData.get('title') === "") {
|
if (formData.get('schdulIpcrCode') === null || formData.get('schdulIpcrCode') === "") {
|
||||||
alert("제목을 입력해 주세요.");
|
alert("중요도는 필수 값입니다.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (formData.get('location') === null ||formData.get('location') === "") {
|
if (formData.get('reptitSeCode') === null ||formData.get('reptitSeCode') === "") {
|
||||||
alert("장소를 입력해 주세요.");
|
alert("반복구분은 필수 값입니다.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (formData.get('contents') === null ||formData.get('contents') === "") {
|
if (formData.get('schdulBgnde') > formData.get('schdulEndde')) {
|
||||||
alert("내용을 입력해 주세요.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
if (formData.get('contents') > formData.get('schdulEndde')) {
|
|
||||||
alert("종료일시는 시작일시보다 앞 설 수 없습니다.");
|
alert("종료일시는 시작일시보다 앞 설 수 없습니다.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(function () {
|
useEffect(function () {
|
||||||
initMode();
|
initMode();
|
||||||
|
|
@ -242,7 +236,7 @@ function SchedulesEdit(props) {
|
||||||
|
|
||||||
useEffect(function () {
|
useEffect(function () {
|
||||||
|
|
||||||
EgovNet.requestFetch(`/schedule/api/org-api/depth/list?paramCodeGroup=${scheduleDetail.upCommittee}`,
|
EgovNet.requestFetch(`/schedule/api/org-api/depth/list?paramCodeGroup=${scheduleDetail.orgGroupId}`,
|
||||||
requestOptions,
|
requestOptions,
|
||||||
function (resp) {
|
function (resp) {
|
||||||
setScheduleApiOrgApiDepthList(
|
setScheduleApiOrgApiDepthList(
|
||||||
|
|
@ -251,8 +245,9 @@ function SchedulesEdit(props) {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
console.log( `kimtheho %o`, scheduleDetail);
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [scheduleDetail && scheduleDetail.upCommittee]);
|
}, [scheduleDetail && scheduleDetail.orgGroupId]);
|
||||||
|
|
||||||
|
|
||||||
console.log("------------------------------EgovAdminScheduleEdit [End]");
|
console.log("------------------------------EgovAdminScheduleEdit [End]");
|
||||||
|
|
@ -359,7 +354,7 @@ function SchedulesEdit(props) {
|
||||||
showTimeInput
|
showTimeInput
|
||||||
onChange={(date) => {
|
onChange={(date) => {
|
||||||
console.log("setStartDate : ", date);
|
console.log("setStartDate : ", date);
|
||||||
setScheduleDetail({ ...scheduleDetail, startDate: date });
|
setScheduleDetail({ ...scheduleDetail, schdulBgnde: getDateFourteenDigit(date), schdulBgndeYYYMMDD: getYYYYMMDD(date), schdulBgndeHH: date.getHours(), schdulBgndeMM: date.getMinutes(), startDate: date });
|
||||||
setSchdulBgndeHH(date.getHours());
|
setSchdulBgndeHH(date.getHours());
|
||||||
setSchdulBgndeMM(date.getMinutes());
|
setSchdulBgndeMM(date.getMinutes());
|
||||||
}} />
|
}} />
|
||||||
|
|
@ -377,7 +372,7 @@ function SchedulesEdit(props) {
|
||||||
minDate={scheduleDetail.startDate}
|
minDate={scheduleDetail.startDate}
|
||||||
onChange={(date) => {
|
onChange={(date) => {
|
||||||
console.log("setEndDate: ", date);
|
console.log("setEndDate: ", date);
|
||||||
setScheduleDetail({ ...scheduleDetail, endDate: date });
|
setScheduleDetail({ ...scheduleDetail, schdulEndde: getDateFourteenDigit(date), schdulEnddeYYYMMDD: getYYYYMMDD(date), schdulEnddeHH: date.getHours(), schdulEnddeMM: date.getMinutes(), endDate: date });
|
||||||
setSchdulEnddeHH(date.getHours());
|
setSchdulEnddeHH(date.getHours());
|
||||||
setSchdulEnddeMM(date.getMinutes());
|
setSchdulEnddeMM(date.getMinutes());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,6 @@ package com.dbnt.kcscbackend.admin.committee.schedules.controller;
|
||||||
|
|
||||||
import com.dbnt.kcscbackend.admin.committee.schedules.model.CreateScheduleVO;
|
import com.dbnt.kcscbackend.admin.committee.schedules.model.CreateScheduleVO;
|
||||||
import com.dbnt.kcscbackend.admin.committee.schedules.service.EgovIndvdlSchdulManageService;
|
import com.dbnt.kcscbackend.admin.committee.schedules.service.EgovIndvdlSchdulManageService;
|
||||||
import com.dbnt.kcscbackend.auth.entity.LoginVO;
|
|
||||||
import com.dbnt.kcscbackend.config.common.ResponseCode;
|
|
||||||
import com.dbnt.kcscbackend.config.common.ResultVO;
|
import com.dbnt.kcscbackend.config.common.ResultVO;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
@ -13,7 +11,6 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
@ -96,92 +93,6 @@ public class SchedulesApiController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Operation(
|
|
||||||
summary = "일정 상세조회",
|
|
||||||
description = "일정 목록을 상세조회",
|
|
||||||
tags = {"SchedulesApiController"}
|
|
||||||
)
|
|
||||||
@ApiResponses(value = {
|
|
||||||
@ApiResponse(responseCode = "200", description = "조회 성공")
|
|
||||||
})
|
|
||||||
@GetMapping(value = "/schedule/{scheduleId}")
|
|
||||||
public ResultVO scheduleDetail(
|
|
||||||
HttpServletRequest request,
|
|
||||||
@AuthenticationPrincipal LoginVO user,
|
|
||||||
@PathVariable("scheduleId") Long scheduleId
|
|
||||||
)
|
|
||||||
throws Exception {
|
|
||||||
|
|
||||||
ResultVO resultVO = new ResultVO();
|
|
||||||
|
|
||||||
try {
|
|
||||||
resultVO = egovIndvdlSchdulManageService.scheduleDetail(resultVO, request, user, scheduleId);
|
|
||||||
} catch (Exception e) {
|
|
||||||
resultVO.setResultCode(-1);
|
|
||||||
resultVO.setResultMessage(e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
System.out.println(
|
|
||||||
"\n--------------------------------------------------------------\n" +
|
|
||||||
request.getRequestURI() + " OUT:" +
|
|
||||||
"\n--------------------------------------------------------------\n" +
|
|
||||||
"resultVO.toString():" + "\n" +
|
|
||||||
resultVO.toString() + "\n" +
|
|
||||||
"\n--------------------------------------------------------------\n"
|
|
||||||
);
|
|
||||||
|
|
||||||
return resultVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 일정(월별) 목록을 조회한다.
|
|
||||||
* @param request
|
|
||||||
* @param commandMap
|
|
||||||
* @return resultVO
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
@Operation(
|
|
||||||
summary = "월별 일정 조회",
|
|
||||||
description = "일정(월별) 목록을 조회",
|
|
||||||
tags = {"EgovIndvdlSchdulManageApiController"}
|
|
||||||
)
|
|
||||||
@ApiResponses(value = {
|
|
||||||
@ApiResponse(responseCode = "200", description = "조회 성공"),
|
|
||||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
|
||||||
})
|
|
||||||
@GetMapping(value = "/schedule/month")
|
|
||||||
public ResultVO scheduleMonth(@AuthenticationPrincipal LoginVO user,
|
|
||||||
HttpServletRequest request,
|
|
||||||
@RequestParam Map<String, Object> commandMap) throws Exception {
|
|
||||||
|
|
||||||
|
|
||||||
ResultVO resultVO = new ResultVO();
|
|
||||||
|
|
||||||
try {
|
|
||||||
resultVO = egovIndvdlSchdulManageService.scheduleMonth(resultVO, request, user, commandMap);
|
|
||||||
} catch (Exception e) {
|
|
||||||
resultVO.setResultCode(-1);
|
|
||||||
resultVO.setResultMessage(e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
System.out.println(
|
|
||||||
"\n--------------------------------------------------------------\n" +
|
|
||||||
request.getRequestURI() + " OUT:" +
|
|
||||||
"\n--------------------------------------------------------------\n" +
|
|
||||||
"resultVO.toString():" + "\n" +
|
|
||||||
resultVO.toString() + "\n" +
|
|
||||||
"\n--------------------------------------------------------------\n"
|
|
||||||
);
|
|
||||||
|
|
||||||
return resultVO;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -2,14 +2,11 @@ package com.dbnt.kcscbackend.admin.committee.schedules.service;
|
||||||
|
|
||||||
|
|
||||||
import com.dbnt.kcscbackend.admin.committee.schedules.model.CreateScheduleVO;
|
import com.dbnt.kcscbackend.admin.committee.schedules.model.CreateScheduleVO;
|
||||||
import com.dbnt.kcscbackend.auth.entity.LoginVO;
|
|
||||||
import com.dbnt.kcscbackend.config.common.ResultVO;
|
import com.dbnt.kcscbackend.config.common.ResultVO;
|
||||||
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import springfox.documentation.annotations.ApiIgnore;
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일정관리를 처리하는 서비스인터페이스 클래스
|
* 일정관리를 처리하는 서비스인터페이스 클래스
|
||||||
|
|
@ -29,16 +26,11 @@ import java.util.Map;
|
||||||
public interface EgovIndvdlSchdulManageService {
|
public interface EgovIndvdlSchdulManageService {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public ResultVO scheduleInit(ResultVO resultVO) throws Exception;
|
public ResultVO scheduleInit(ResultVO resultVO) throws Exception;
|
||||||
|
|
||||||
public ResultVO scheduleApiOrgApiDepthList(ResultVO resultVO, Long paramCodeGroup) throws Exception;
|
public ResultVO scheduleApiOrgApiDepthList(ResultVO resultVO, Long paramCodeGroup) throws Exception;
|
||||||
|
|
||||||
public ResultVO createSchedule(ResultVO resultVO, HttpServletRequest request, CreateScheduleVO createScheduleVO) throws Exception;
|
public ResultVO createSchedule(ResultVO resultVO, HttpServletRequest request, CreateScheduleVO createScheduleVO) throws Exception;
|
||||||
|
|
||||||
public ResultVO scheduleDetail(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long scheduleId) throws Exception;
|
|
||||||
|
|
||||||
public ResultVO scheduleMonth(ResultVO resultVO, HttpServletRequest request, LoginVO user, Map<String, Object> scheduleId) throws Exception;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -3,11 +3,6 @@ package com.dbnt.kcscbackend.admin.committee.schedules.service.impl;
|
||||||
|
|
||||||
import com.dbnt.kcscbackend.admin.committee.schedules.model.CreateScheduleVO;
|
import com.dbnt.kcscbackend.admin.committee.schedules.model.CreateScheduleVO;
|
||||||
import com.dbnt.kcscbackend.admin.committee.schedules.service.EgovIndvdlSchdulManageService;
|
import com.dbnt.kcscbackend.admin.committee.schedules.service.EgovIndvdlSchdulManageService;
|
||||||
import com.dbnt.kcscbackend.auth.entity.LoginVO;
|
|
||||||
import com.dbnt.kcscbackend.commonCode.entity.TcCodeItem;
|
|
||||||
import com.dbnt.kcscbackend.commonCode.entity.TnCmtEvent;
|
|
||||||
import com.dbnt.kcscbackend.commonCode.entity.TnCmtOrg;
|
|
||||||
import com.dbnt.kcscbackend.config.common.ResponseCode;
|
|
||||||
import com.dbnt.kcscbackend.commonCode.repository.TcCodeItemRepository;
|
import com.dbnt.kcscbackend.commonCode.repository.TcCodeItemRepository;
|
||||||
import com.dbnt.kcscbackend.commonCode.repository.TnCmtEventRepository;
|
import com.dbnt.kcscbackend.commonCode.repository.TnCmtEventRepository;
|
||||||
import com.dbnt.kcscbackend.commonCode.repository.TnCmtOrgRepository;
|
import com.dbnt.kcscbackend.commonCode.repository.TnCmtOrgRepository;
|
||||||
|
|
@ -15,9 +10,15 @@ import com.dbnt.kcscbackend.config.common.ResultVO;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.sql.Timestamp;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.Instant;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.ZoneId;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
@ -82,8 +83,6 @@ public class EgovIndvdlSchdulManageServiceImpl extends EgovAbstractServiceImpl i
|
||||||
resultMap.put("listSubOrg", listSubOrg);
|
resultMap.put("listSubOrg", listSubOrg);
|
||||||
resultMap.put("listTopOrg", listTopOrg);
|
resultMap.put("listTopOrg", listTopOrg);
|
||||||
resultVO.setResult(resultMap);
|
resultVO.setResult(resultMap);
|
||||||
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
|
||||||
resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage());
|
|
||||||
|
|
||||||
return resultVO;
|
return resultVO;
|
||||||
}
|
}
|
||||||
|
|
@ -110,6 +109,7 @@ public class EgovIndvdlSchdulManageServiceImpl extends EgovAbstractServiceImpl i
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
public ResultVO createSchedule(ResultVO resultVO, HttpServletRequest request, CreateScheduleVO createScheduleVO) throws Exception {
|
public ResultVO createSchedule(ResultVO resultVO, HttpServletRequest request, CreateScheduleVO createScheduleVO) throws Exception {
|
||||||
|
|
||||||
System.out.println(
|
System.out.println(
|
||||||
|
|
@ -121,16 +121,29 @@ public class EgovIndvdlSchdulManageServiceImpl extends EgovAbstractServiceImpl i
|
||||||
"\n--------------------------------------------------------------\n"
|
"\n--------------------------------------------------------------\n"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Locale currentLocale = new Locale("KOREAN", "KOREA");
|
||||||
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", currentLocale);
|
||||||
|
Date date = formatter.parse(createScheduleVO.getStartDate());
|
||||||
|
|
||||||
Map<String, Object> response = tnCmtEventRepository.spAddTnCmtEvent(
|
LocalDate startDate = date.toInstant()
|
||||||
createScheduleVO.getDivMeet(), // 구분
|
.atZone(ZoneId.systemDefault())
|
||||||
createScheduleVO.getUpCommittee(), // 심의위원회 상위 코드 번호
|
.toLocalDate();
|
||||||
createScheduleVO.getCommittee(), // 심의위원회 하위 코드 번호
|
|
||||||
createScheduleVO.getTitle(), // 제목
|
LocalDateTime endDate = Instant.ofEpochMilli(date.getTime())
|
||||||
createScheduleVO.getLocation(), // 장소
|
.atZone(ZoneId.systemDefault())
|
||||||
createScheduleVO.getContents(), // 내용
|
.toLocalDateTime();
|
||||||
createScheduleVO.getStartDate(), // 날짜/시간의 시작 일시
|
|
||||||
createScheduleVO.getEndDate(), // 날짜/시간의 종료 일시
|
Timestamp ts=new Timestamp(date.getTime());
|
||||||
|
|
||||||
|
tnCmtEventRepository.sp_add_tn_cmt_event(
|
||||||
|
createScheduleVO.getDivMeet(),
|
||||||
|
createScheduleVO.getUpCommittee(),
|
||||||
|
createScheduleVO.getCommittee(),
|
||||||
|
createScheduleVO.getTitle(),
|
||||||
|
createScheduleVO.getLocation(),
|
||||||
|
createScheduleVO.getContents(),
|
||||||
|
date,
|
||||||
|
date,
|
||||||
"admin",
|
"admin",
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
|
|
@ -138,142 +151,12 @@ public class EgovIndvdlSchdulManageServiceImpl extends EgovAbstractServiceImpl i
|
||||||
null
|
null
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, Object> dto = new HashMap<String, Object>();
|
//resultVO.setResult();
|
||||||
dto.put("schdulId", response.get("_evt_seq") );
|
resultVO.setResultMessage("OK");
|
||||||
|
resultVO.setResultCode(0);
|
||||||
resultVO.setResult(dto);
|
|
||||||
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
|
||||||
resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage());
|
|
||||||
|
|
||||||
return resultVO;
|
return resultVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ResultVO scheduleDetail(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long scheduleId) throws Exception {
|
|
||||||
|
|
||||||
System.out.println(
|
|
||||||
"\n--------------------------------------------------------------\n" +
|
|
||||||
request.getRequestURI() + " IN:" +
|
|
||||||
"\n--------------------------------------------------------------\n" +
|
|
||||||
"scheduleId:" + "\n" +
|
|
||||||
scheduleId + "\n" +
|
|
||||||
"\n--------------------------------------------------------------\n"
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
int isValid = tnCmtEventRepository.sp_is_valid_tn_cmt_event_id( scheduleId.intValue() );
|
|
||||||
|
|
||||||
if( isValid == 0 ) {
|
|
||||||
throw new Exception("대상이 존재하지 않습니다.");
|
|
||||||
}
|
|
||||||
|
|
||||||
TnCmtEvent tnCmtEvent = tnCmtEventRepository.findByEvtSeq(scheduleId);
|
|
||||||
|
|
||||||
TcCodeItem tcCodeItem = tcCodeItemRepository.findByItemCdAndUseYn(tnCmtEvent.getEvtType(), "Y");
|
|
||||||
|
|
||||||
TnCmtOrg tnCmtOrgForUpCommitteeNm = tnCmtOrgRepository.findByUseYnAndCmtSeq("Y", tnCmtEvent.getUpCmtSeq());
|
|
||||||
TnCmtOrg tnCmtOrgForCommitteeNm = tnCmtOrgRepository.findByUseYnAndCmtSeq("Y", tnCmtEvent.getCmtSeq());
|
|
||||||
|
|
||||||
Map<String, Object> dto = new HashMap<String, Object>();
|
|
||||||
dto.put("evtSeq", tnCmtEvent.getEvtSeq()); // sequence
|
|
||||||
dto.put("divMeetNm", tcCodeItem.getItemNm()); // 구분
|
|
||||||
dto.put("upCommitteeNm", tnCmtOrgForUpCommitteeNm.getCmtNm()); // 심의위원회 상위 이름
|
|
||||||
dto.put("committeeNm", tnCmtOrgForCommitteeNm.getCmtNm()); // 심의위원회 하위 이름
|
|
||||||
dto.put("title", tnCmtEvent.getEvtTitle()); // 제목
|
|
||||||
dto.put("location", tnCmtEvent.getEvtLocation()); // 장소
|
|
||||||
dto.put("contents", tnCmtEvent.getEvtContents()); // 내용
|
|
||||||
dto.put("startDate", tnCmtEvent.getEvtStartDt()); // 날짜/시간의 시작 일시
|
|
||||||
dto.put("endDate", tnCmtEvent.getEvtEndDt()); // 날짜/시간의 종료 일시
|
|
||||||
|
|
||||||
// 문자열로 리턴하도록 수정해야 함.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
resultVO.setResult(dto);
|
|
||||||
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
|
||||||
resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage());
|
|
||||||
|
|
||||||
return resultVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ResultVO scheduleMonth(ResultVO resultVO, HttpServletRequest request, LoginVO user, Map<String, Object> commandMap) throws Exception {
|
|
||||||
|
|
||||||
System.out.println(
|
|
||||||
"\n--------------------------------------------------------------\n" +
|
|
||||||
request.getRequestURI() + " IN:" +
|
|
||||||
"\n--------------------------------------------------------------\n" +
|
|
||||||
"String.valueOf(commandMap.get(\"year\")):" + "\n" +
|
|
||||||
String.valueOf(commandMap.get("year")) + "\n" +
|
|
||||||
"String.valueOf(commandMap.get(\"month\")):" + "\n" +
|
|
||||||
String.valueOf(commandMap.get("month")) + "\n" +
|
|
||||||
"\n--------------------------------------------------------------\n"
|
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, Object> dto = new HashMap<String, Object>();
|
|
||||||
|
|
||||||
//일정구분 검색 유지
|
|
||||||
dto.put("searchKeyword",
|
|
||||||
commandMap.get("searchKeyword") == null ? "" : (String)commandMap.get("searchKeyword"));
|
|
||||||
dto.put("searchCondition",
|
|
||||||
commandMap.get("searchCondition") == null ? "" : (String)commandMap.get("searchCondition"));
|
|
||||||
|
|
||||||
Calendar cal = Calendar.getInstance();
|
|
||||||
|
|
||||||
String sYear = String.valueOf(commandMap.get("year")); // 예 "2024"
|
|
||||||
String sMonth = String.valueOf(commandMap.get("month")); // 예 "2" zeo-base. 0= 1월, 1=2월, 2=3월. 즉 "2"라면 3월
|
|
||||||
|
|
||||||
int iYear = cal.get(Calendar.YEAR);
|
|
||||||
int iMonth = cal.get(Calendar.MONTH);
|
|
||||||
//int iDate = cal.get(java.util.Calendar.DATE);
|
|
||||||
|
|
||||||
//검색 설정
|
|
||||||
String sSearchDate = "";
|
|
||||||
if (sYear == null || sMonth == null) {
|
|
||||||
sSearchDate += Integer.toString(iYear);
|
|
||||||
sSearchDate += Integer.toString(iMonth + 1).length() == 1 ? "0" + Integer.toString(iMonth + 1)
|
|
||||||
: Integer.toString(iMonth + 1);
|
|
||||||
} else {
|
|
||||||
iYear = Integer.parseInt(sYear);
|
|
||||||
iMonth = Integer.parseInt(sMonth);
|
|
||||||
sSearchDate += sYear;
|
|
||||||
sSearchDate += Integer.toString(iMonth + 1).length() == 1 ? "0" + Integer.toString(iMonth + 1)
|
|
||||||
: Integer.toString(iMonth + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// sSearchDate는 검색할 월. 예 202403
|
|
||||||
commandMap.put("searchMonth", sSearchDate);
|
|
||||||
commandMap.put("searchMode", "MONTH");
|
|
||||||
|
|
||||||
List<Map<String, Object>> resultList = tnCmtEventRepository.getByYyyyMm(sSearchDate)
|
|
||||||
.stream()
|
|
||||||
.map(item -> {
|
|
||||||
Map<String, Object> mapDto = new HashMap<>();
|
|
||||||
mapDto.put("evt_start_dt", item.getEvtStartDt().format(DateTimeFormatter.ofPattern("yyyyMMdd HH:mm:ss.SSS")));
|
|
||||||
mapDto.put("evt_end_dt", item.getEvtEndDt().format(DateTimeFormatter.ofPattern("yyyyMMdd HH:mm:ss.SSS")));
|
|
||||||
mapDto.put("schdulId", item.getEvtSeq());
|
|
||||||
mapDto.put("schdulNm", item.getEvtTitle());
|
|
||||||
|
|
||||||
return mapDto;
|
|
||||||
})
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
dto.put("prevRequest", commandMap);
|
|
||||||
dto.put("resultList", resultList);
|
|
||||||
|
|
||||||
resultVO.setResult(dto);
|
|
||||||
|
|
||||||
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
|
||||||
resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage());
|
|
||||||
|
|
||||||
return resultVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,57 +21,57 @@ public class TnCmtEvent {
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
@Column(name = "evt_seq")
|
@Column(name = "evt_seq")
|
||||||
private Long evtSeq;
|
private Long evt_seq;
|
||||||
|
|
||||||
@Column(name = "evt_type")
|
@Column(name = "evt_type")
|
||||||
private String evtType;
|
private String evt_type;
|
||||||
|
|
||||||
@Column(name = "up_cmt_seq")
|
@Column(name = "up_cmt_seq")
|
||||||
private Long upCmtSeq;
|
private Long up_cmt_seq;
|
||||||
|
|
||||||
@Column(name = "cmt_seq")
|
@Column(name = "cmt_seq")
|
||||||
private Long cmtSeq;
|
private Long cmt_seq;
|
||||||
|
|
||||||
@Column(name = "evt_title")
|
@Column(name = "evt_title")
|
||||||
private String evtTitle;
|
private String evt_title;
|
||||||
|
|
||||||
@Column(name = "evt_location")
|
@Column(name = "evt_location")
|
||||||
private String evtLocation;
|
private String evt_location;
|
||||||
|
|
||||||
@Column(name = "evt_contents")
|
@Column(name = "evt_contents")
|
||||||
private String evtContents;
|
private String evt_contents;
|
||||||
|
|
||||||
@Column(name = "evt_start_dt")
|
@Column(name = "evt_start_dt")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime evtStartDt;
|
private LocalDateTime evt_start_dt;
|
||||||
|
|
||||||
@Column(name = "evt_end_dt")
|
@Column(name = "evt_end_dt")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime evtEndDt;
|
private LocalDateTime evt_end_dt;
|
||||||
|
|
||||||
@Column(name = "frst_crt_id")
|
@Column(name = "frst_crt_id")
|
||||||
private String frstCrtId;
|
private String frst_crt_id;
|
||||||
|
|
||||||
@Column(name = "frst_crt_dt")
|
@Column(name = "frst_crt_dt")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime frstCrtDt;
|
private LocalDateTime frst_crt_dt;
|
||||||
|
|
||||||
@Column(name = "last_chg_id")
|
@Column(name = "last_chg_id")
|
||||||
private String lastChgId;
|
private String last_chg_id;
|
||||||
|
|
||||||
@Column(name = "last_chg_dt")
|
@Column(name = "last_chg_dt")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime lastChgDt;
|
private LocalDateTime last_chg_dt;
|
||||||
|
|
||||||
@Column(name = "use_yn")
|
@Column(name = "use_yn")
|
||||||
private String useYn;
|
private String use_yn;
|
||||||
|
|
||||||
@Embeddable
|
@Embeddable
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class TnCmtEventId implements Serializable {
|
public static class TnCmtEventId implements Serializable {
|
||||||
private Long evtSeq;
|
private Long evt_seq;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -7,5 +7,4 @@ import java.util.List;
|
||||||
|
|
||||||
public interface TcCodeItemRepository extends JpaRepository<TcCodeItem, TcCodeItem.TcCodeItemId> {
|
public interface TcCodeItemRepository extends JpaRepository<TcCodeItem, TcCodeItem.TcCodeItemId> {
|
||||||
List<TcCodeItem> findByGrpCdAndUseYnOrderByGrpOrder(String grpCd, String useYn);
|
List<TcCodeItem> findByGrpCdAndUseYnOrderByGrpOrder(String grpCd, String useYn);
|
||||||
TcCodeItem findByItemCdAndUseYn(String itemCd, String useYn);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,93 +1,43 @@
|
||||||
package com.dbnt.kcscbackend.commonCode.repository;
|
package com.dbnt.kcscbackend.commonCode.repository;
|
||||||
|
|
||||||
|
|
||||||
import com.dbnt.kcscbackend.commonCode.entity.TnCmtEvent;
|
import com.dbnt.kcscbackend.commonCode.entity.TnCmtEvent;
|
||||||
import com.dbnt.kcscbackend.commonCode.entity.TnCmtOrg;
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.data.jpa.repository.Modifying;
|
|
||||||
import org.springframework.data.jpa.repository.Query;
|
|
||||||
import org.springframework.data.jpa.repository.query.Procedure;
|
import org.springframework.data.jpa.repository.query.Procedure;
|
||||||
import org.springframework.data.repository.query.Param;
|
|
||||||
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
|
|
||||||
public interface TnCmtEventRepository extends JpaRepository<TnCmtEvent, TnCmtEvent.TnCmtEventId> {
|
public interface TnCmtEventRepository extends JpaRepository<TnCmtEvent, TnCmtEvent.TnCmtEventId> {
|
||||||
|
|
||||||
@Query(value = "CALL sp_add_tn_cmt_event (" +
|
|
||||||
":_evt_type, " +
|
|
||||||
":_up_cmt_seq, " +
|
|
||||||
":_cmt_seq, " +
|
|
||||||
":_evt_title, " +
|
|
||||||
":_evt_location, " +
|
|
||||||
":_evt_contents, " +
|
|
||||||
"TO_TIMESTAMP(" +
|
|
||||||
" :_evt_start_dt," +
|
|
||||||
" 'YYYY-MM-DD HH24:MI:SS'" +
|
|
||||||
")::::timestamptz AT TIME ZONE 'UTC', " +
|
|
||||||
"TO_TIMESTAMP(" +
|
|
||||||
" :_evt_end_dt," +
|
|
||||||
" 'YYYY-MM-DD HH24:MI:SS'" +
|
|
||||||
")::::timestamptz AT TIME ZONE 'UTC', " +
|
|
||||||
":_modi_id, " +
|
|
||||||
":_evt_seq, " +
|
|
||||||
":_result_count, " +
|
|
||||||
":_result_code, " +
|
|
||||||
":_error_message)",
|
|
||||||
nativeQuery = true)
|
|
||||||
Map<String, Object> spAddTnCmtEvent(
|
|
||||||
@Param("_evt_type") String evtType,
|
|
||||||
@Param("_up_cmt_seq") Integer upCmtSeq,
|
|
||||||
@Param("_cmt_seq") Integer cmtSeq,
|
|
||||||
@Param("_evt_title") String evtTitle,
|
|
||||||
@Param("_evt_location") String evtLocation,
|
|
||||||
@Param("_evt_contents") String evtContents,
|
|
||||||
@Param("_evt_start_dt") String evtStartDt,
|
|
||||||
@Param("_evt_end_dt") String evtEndDt,
|
|
||||||
@Param("_modi_id") String modiId,
|
|
||||||
@Param("_evt_seq") Integer evtSeq,
|
|
||||||
@Param("_result_count") Integer resultCount,
|
|
||||||
@Param("_result_code") String resultCode,
|
|
||||||
@Param("_error_message") String errorMessage
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//@Procedure
|
|
||||||
//Map<String, Object> sp_is_valid_tn_cmt_event_id( @Param("_evt_seq") Long evtSeq );
|
|
||||||
|
|
||||||
@Procedure
|
@Procedure
|
||||||
int sp_is_valid_tn_cmt_event_id( Integer evtSeq );
|
int sp_add_tn_cmt_event(
|
||||||
|
String evtType,
|
||||||
|
Integer upCmtSeq,
|
||||||
|
Integer cmtSeq,
|
||||||
|
String evtTitle,
|
||||||
TnCmtEvent findByEvtSeq(Long evtSeq);
|
String evtLocation,
|
||||||
|
String evtContents,
|
||||||
@Query(value = "\n" +
|
Date evtStartDt,
|
||||||
"SELECT" + " \n" +
|
Date evtEndDt,
|
||||||
" *" + " \n" +
|
String modiId,
|
||||||
"FROM" + " \n" +
|
Integer _evt_seq,
|
||||||
" tn_cmt_event tce" + " \n" +
|
Integer _result_count,
|
||||||
"WHERE" + " " +
|
String _result_code,
|
||||||
" TO_TIMESTAMP(" + " \n" +
|
String _error_message
|
||||||
" :sSearchDate," + " \n" +
|
|
||||||
" 'YYYYMM'" + " \n" +
|
|
||||||
" ) <= tce.evt_start_dt AND" + " \n" +
|
|
||||||
|
|
||||||
" tce.evt_start_dt < TO_TIMESTAMP(" + " \n" +
|
|
||||||
" :sSearchDate," + " \n" +
|
|
||||||
" 'YYYYMM'" + " \n" +
|
|
||||||
" ) + INTERVAL '1 MONTH';\n",
|
|
||||||
nativeQuery = true)
|
|
||||||
List<TnCmtEvent> getByYyyyMm(
|
|
||||||
@Param("sSearchDate") String sSearchDate
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/*
|
||||||
|
@Procedure
|
||||||
|
int sp_add_tn_cmt_event(
|
||||||
|
String _evt_type,
|
||||||
|
Integer _up_cmt_seq,
|
||||||
|
Integer _cmt_seq,
|
||||||
|
String _evt_title,
|
||||||
|
String _evt_location,
|
||||||
|
String _evt_contents,
|
||||||
|
String _evt_start_dt,
|
||||||
|
String _evt_end_dt,
|
||||||
|
String _modi_id
|
||||||
|
);
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,5 @@ import java.util.List;
|
||||||
|
|
||||||
public interface TnCmtOrgRepository extends JpaRepository<TnCmtOrg, TnCmtOrg.TnCmtOrgId> {
|
public interface TnCmtOrgRepository extends JpaRepository<TnCmtOrg, TnCmtOrg.TnCmtOrgId> {
|
||||||
List<TnCmtOrg> findByUseYnAndUpCmtSeqOrderByCmtOrder(String useYn, Long upCmtSeq);
|
List<TnCmtOrg> findByUseYnAndUpCmtSeqOrderByCmtOrder(String useYn, Long upCmtSeq);
|
||||||
TnCmtOrg findByUseYnAndCmtSeq(String useYn, Long cmtSeq);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ spring.datasource.url=jdbc:log4jdbc:postgresql://127.0.0.1:5432/kcsc
|
||||||
spring.datasource.username=dbnt0031
|
spring.datasource.username=dbnt0031
|
||||||
spring.datasource.password=dbnt0928!
|
spring.datasource.password=dbnt0928!
|
||||||
|
|
||||||
|
|
||||||
#jpa
|
#jpa
|
||||||
spring.jpa.show-sql=true
|
spring.jpa.show-sql=true
|
||||||
spring.jpa.generate-ddl=false
|
spring.jpa.generate-ddl=false
|
||||||
|
|
@ -26,7 +25,6 @@ spring.jpa.hibernate.naming.physical-strategy = org.hibernate.boot.model.naming.
|
||||||
spring.jpa.properties.hibernate.proc.param_null_passing=true
|
spring.jpa.properties.hibernate.proc.param_null_passing=true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# MyBatis
|
# MyBatis
|
||||||
mybatis.mapper-locations: mybatisMapper/*.xml
|
mybatis.mapper-locations: mybatisMapper/*.xml
|
||||||
mybatis.configuration.map-underscore-to-camel-case=true
|
mybatis.configuration.map-underscore-to-camel-case=true
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue