From c3258630dcd795ce93a25addfcecc077573eba62 Mon Sep 17 00:00:00 2001 From: thkim Date: Thu, 11 Jan 2024 18:01:02 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EA=B4=80=EB=A6=AC=EC=9E=90=20=EB=8B=A8?= =?UTF-8?q?=EC=97=90=EC=84=9C=20'=EC=9C=84=EC=9B=90=ED=9A=8C=20=EA=B4=80?= =?UTF-8?q?=EB=A6=AC'=20>=20'=EC=9C=84=EC=9B=90=ED=9A=8C=20=EC=9D=BC?= =?UTF-8?q?=EC=A0=95=20=EA=B4=80=EB=A6=AC'=EC=97=90=20'=EB=93=B1=EB=A1=9D'?= =?UTF-8?q?=20=EB=B2=84=ED=8A=BC=EC=9D=84=20=EB=88=84=EB=A5=B8=20=ED=9B=84?= =?UTF-8?q?=20'=EC=9C=84=EC=9B=90=ED=9A=8C=20=EC=9D=BC=EC=A0=95=20?= =?UTF-8?q?=EB=93=B1=EB=A1=9D'=20=ED=8E=98=EC=9D=B4=EC=A7=80=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=ED=95=AD=EB=AA=A9=20=EC=9E=85=EB=A0=A5=20=ED=9B=84?= =?UTF-8?q?=20'=EC=A0=80=EC=9E=A5'=EC=9D=84=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=EB=88=84=EB=A5=B8=20=ED=9B=84=20=EC=83=81=EC=84=B8=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=EA=B0=80=EC=A0=B8=EC=98=A4=EA=B8=B0=20=EC=A4=91?= =?UTF-8?q?=EA=B0=84=20=EC=A0=80=EC=9E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/committee/Schedules/Detail.jsx | 7 ++- .../pages/admin/committee/Schedules/Edit.jsx | 5 ++- .../controller/SchedulesApiController.java | 42 ++++++++++++++++++ .../EgovIndvdlSchdulManageService.java | 6 ++- .../EgovIndvdlSchdulManageServiceImpl.java | 43 +++++++++++++++++-- .../repository/TnCmtEventRepository.java | 24 +++++------ .../resources/application-local.properties | 4 +- 7 files changed, 107 insertions(+), 24 deletions(-) diff --git a/egovframe-template-simple-react-contribution/src/pages/admin/committee/Schedules/Detail.jsx b/egovframe-template-simple-react-contribution/src/pages/admin/committee/Schedules/Detail.jsx index 530cde9..b226544 100644 --- a/egovframe-template-simple-react-contribution/src/pages/admin/committee/Schedules/Detail.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/admin/committee/Schedules/Detail.jsx @@ -111,7 +111,8 @@ function SchedulesDetail(props) { {/* */} @@ -125,11 +126,9 @@ function SchedulesDetail(props) { {/* */}
-

사이트관리

+

일정관리 상세보기

-

일정관리 상세보기

- {/* */}
diff --git a/egovframe-template-simple-react-contribution/src/pages/admin/committee/Schedules/Edit.jsx b/egovframe-template-simple-react-contribution/src/pages/admin/committee/Schedules/Edit.jsx index f7e392a..bd04488 100644 --- a/egovframe-template-simple-react-contribution/src/pages/admin/committee/Schedules/Edit.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/admin/committee/Schedules/Edit.jsx @@ -187,8 +187,9 @@ function SchedulesEdit(props) { EgovNet.requestFetch(modeInfo.editURL, requestOptions, (resp) => { - if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) { - navigate({ pathname: URL.ADMIN_SCHEDULE }); + 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}}); } diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/controller/SchedulesApiController.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/controller/SchedulesApiController.java index b786d74..a4fa7bd 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/controller/SchedulesApiController.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/controller/SchedulesApiController.java @@ -4,6 +4,8 @@ package com.dbnt.kcscbackend.admin.committee.schedules.controller; import com.dbnt.kcscbackend.admin.committee.schedules.model.CreateScheduleVO; 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 io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.Operation; @@ -11,6 +13,7 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.MediaType; +import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -93,6 +96,45 @@ 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; + } + + } \ No newline at end of file diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovIndvdlSchdulManageService.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovIndvdlSchdulManageService.java index 3338407..8715cbc 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovIndvdlSchdulManageService.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovIndvdlSchdulManageService.java @@ -2,7 +2,9 @@ package com.dbnt.kcscbackend.admin.committee.schedules.service; import com.dbnt.kcscbackend.admin.committee.schedules.model.CreateScheduleVO; +import com.dbnt.kcscbackend.auth.entity.LoginVO; import com.dbnt.kcscbackend.config.common.ResultVO; +import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.web.bind.annotation.RequestBody; import springfox.documentation.annotations.ApiIgnore; @@ -26,11 +28,13 @@ import javax.servlet.http.HttpServletRequest; public interface EgovIndvdlSchdulManageService { - public ResultVO scheduleInit(ResultVO resultVO) throws Exception; public ResultVO scheduleApiOrgApiDepthList(ResultVO resultVO, Long paramCodeGroup) 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; + + } \ No newline at end of file diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/impl/EgovIndvdlSchdulManageServiceImpl.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/impl/EgovIndvdlSchdulManageServiceImpl.java index da6cd78..10eeeff 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/impl/EgovIndvdlSchdulManageServiceImpl.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/impl/EgovIndvdlSchdulManageServiceImpl.java @@ -6,6 +6,8 @@ import com.dbnt.kcscbackend.admin.committee.schedules.service.EgovIndvdlSchdulMa import com.dbnt.kcscbackend.admin.config.repository.TcCodeItemRepository; import com.dbnt.kcscbackend.admin.config.repository.TnCmtEventRepository; import com.dbnt.kcscbackend.admin.config.repository.TnCmtOrgRepository; +import com.dbnt.kcscbackend.auth.entity.LoginVO; +import com.dbnt.kcscbackend.config.common.ResponseCode; import com.dbnt.kcscbackend.config.common.ResultVO; import lombok.RequiredArgsConstructor; import org.apache.tomcat.util.json.JSONParser; @@ -86,6 +88,8 @@ public class EgovIndvdlSchdulManageServiceImpl extends EgovAbstractServiceImpl i resultMap.put("listSubOrg", listSubOrg); resultMap.put("listTopOrg", listTopOrg); resultVO.setResult(resultMap); + resultVO.setResultCode(ResponseCode.SUCCESS.getCode()); + resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage()); return resultVO; } @@ -140,12 +144,45 @@ public class EgovIndvdlSchdulManageServiceImpl extends EgovAbstractServiceImpl i null ); - //resultVO.setResult(); - resultVO.setResultMessage("OK"); - resultVO.setResultCode(0); + Map dto = new HashMap(); + dto.put("schdulId", response.get("_evt_seq") ); + + resultVO.setResult(dto); + resultVO.setResultCode(ResponseCode.SUCCESS.getCode()); + resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage()); 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 ); + + Map dto = new HashMap(); + //dto.put("schdulId", response.get("_evt_seq") ); + + 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/admin/config/repository/TnCmtEventRepository.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/repository/TnCmtEventRepository.java index b7580e3..4cc3627 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/repository/TnCmtEventRepository.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/repository/TnCmtEventRepository.java @@ -80,20 +80,20 @@ public interface TnCmtEventRepository extends JpaRepository sp_is_valid_tn_cmt_event_id( @Param("_evt_seq") Long evtSeq ); + @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 + int sp_is_valid_tn_cmt_event_id( Long evtSeq ); + + @Query(value = "CALL sp_is_valid_tn_cmt_event_id ( :_evt_seq )", + nativeQuery = true) + int spIsValidTnCmtEventId( + @Param("_evt_seq") Long evtSeq ); - */ + + } diff --git a/kcsc-back-end/src/main/resources/application-local.properties b/kcsc-back-end/src/main/resources/application-local.properties index ffcfe5b..e8d6360 100644 --- a/kcsc-back-end/src/main/resources/application-local.properties +++ b/kcsc-back-end/src/main/resources/application-local.properties @@ -13,8 +13,8 @@ spring.datasource.hikari.maximum-pool-size=4 #spring.datasource.username=kcsc #spring.datasource.password=dbnt0928! spring.datasource.driverClassName=net.sf.log4jdbc.sql.jdbcapi.DriverSpy -#spring.datasource.url=jdbc:log4jdbc:postgresql://127.0.0.1:5432/kcsc -spring.datasource.url=jdbc:log4jdbc:postgresql://118.219.150.34:50503/kcsc +spring.datasource.url=jdbc:log4jdbc:postgresql://127.0.0.1:5432/kcsc +#spring.datasource.url=jdbc:log4jdbc:postgresql://118.219.150.34:50503/kcsc spring.datasource.username=dbnt0031 spring.datasource.password=dbnt0928!