feat: 관리자 - 위원회관리 - 위원회 일정관리에서 일정 수정 시 저장 기능 구현 건
parent
6c3aa18b94
commit
f6d0399f82
|
|
@ -3,6 +3,7 @@ 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.model.UpdateScheduleVO;
|
||||||
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.auth.entity.LoginVO;
|
||||||
import com.dbnt.kcscbackend.config.common.ResponseCode;
|
import com.dbnt.kcscbackend.config.common.ResponseCode;
|
||||||
|
|
@ -95,6 +96,46 @@ public class SchedulesApiController {
|
||||||
return resultVO;
|
return resultVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(
|
||||||
|
summary = "'위원회 일정 등록' 페이지에서 일정 수정하는 API",
|
||||||
|
description = "관리자 단에서 '위원회 관리' > '위원회 일정 관리'에 특정 일정을 누른 후, '수정' > '저장' 버튼을 누르면 해당 일정을 수정하는 API",
|
||||||
|
tags = {"SchedulesApiController"}
|
||||||
|
)
|
||||||
|
@ApiResponses(value = {
|
||||||
|
@ApiResponse(responseCode = "200", description = "등록 성공"),
|
||||||
|
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
||||||
|
})
|
||||||
|
@PutMapping(value = "/schedule/{scheduleId}")
|
||||||
|
public ResultVO updateSchedule
|
||||||
|
(
|
||||||
|
@AuthenticationPrincipal LoginVO user,
|
||||||
|
HttpServletRequest request,
|
||||||
|
UpdateScheduleVO updateScheduleVO,
|
||||||
|
@PathVariable("scheduleId") Long scheduleId
|
||||||
|
) throws Exception {
|
||||||
|
|
||||||
|
ResultVO resultVO = new ResultVO();
|
||||||
|
|
||||||
|
try {
|
||||||
|
resultVO = egovIndvdlSchdulManageService.updateSchedule(resultVO, request, updateScheduleVO);
|
||||||
|
} 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Operation(
|
@Operation(
|
||||||
summary = "일정 상세조회",
|
summary = "일정 상세조회",
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ import java.time.LocalDateTime;
|
||||||
public class CreateScheduleVO implements Serializable {
|
public class CreateScheduleVO implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 6544623713351174876L;
|
private static final long serialVersionUID = 6544623713351174876L;
|
||||||
|
|
||||||
@ApiModelProperty(value = "eventId")
|
@ApiModelProperty(value = "eventId")
|
||||||
private Integer eventId;
|
private Integer eventId;
|
||||||
@ApiModelProperty(value = "startDate")
|
@ApiModelProperty(value = "startDate")
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
package com.dbnt.kcscbackend.admin.committee.schedules.model;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@ApiModel(value = "createScheduleVO", description =
|
||||||
|
"관리자 단에서 '위원회 관리' > '위원회 일정 관리'에서 일정을 수정할 때 사용된다." + ""
|
||||||
|
)
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
public class UpdateScheduleVO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 4730156840930491646L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "startDate")
|
||||||
|
private String startDate;
|
||||||
|
@ApiModelProperty(value = "endDate")
|
||||||
|
private String endDate;
|
||||||
|
@ApiModelProperty(value = "eventId")
|
||||||
|
private Integer eventId;
|
||||||
|
@ApiModelProperty(value = "upCommitteeNm")
|
||||||
|
private String upCommitteeNm;
|
||||||
|
@ApiModelProperty(value = "committee")
|
||||||
|
private Integer committee;
|
||||||
|
@ApiModelProperty(value = "committeeNm")
|
||||||
|
private String committeeNm;
|
||||||
|
@ApiModelProperty(value = "divMeet")
|
||||||
|
private String divMeet;
|
||||||
|
@ApiModelProperty(value = "title")
|
||||||
|
private String title;
|
||||||
|
@ApiModelProperty(value = "divMeetNm")
|
||||||
|
private String divMeetNm;
|
||||||
|
@ApiModelProperty(value = "schdulEndde")
|
||||||
|
private String schdulEndde;
|
||||||
|
@ApiModelProperty(value = "evtSeq")
|
||||||
|
private Integer evtSeq;
|
||||||
|
@ApiModelProperty(value = "contents")
|
||||||
|
private String contents;
|
||||||
|
@ApiModelProperty(value = "upCommittee")
|
||||||
|
private Integer upCommittee;
|
||||||
|
@ApiModelProperty(value = "location")
|
||||||
|
private String location;
|
||||||
|
@ApiModelProperty(value = "schdulBgnde")
|
||||||
|
private String schdulBgnde;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -2,6 +2,7 @@ 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.admin.committee.schedules.model.UpdateScheduleVO;
|
||||||
import com.dbnt.kcscbackend.auth.entity.LoginVO;
|
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.security.core.annotation.AuthenticationPrincipal;
|
||||||
|
|
@ -34,6 +35,8 @@ public interface EgovIndvdlSchdulManageService {
|
||||||
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 updateSchedule(ResultVO resultVO, HttpServletRequest request, UpdateScheduleVO updateScheduleVO) throws Exception;
|
||||||
|
|
||||||
|
|
||||||
public ResultVO scheduleDetail(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long scheduleId) throws Exception;
|
public ResultVO scheduleDetail(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long scheduleId) throws Exception;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ 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.model.UpdateScheduleVO;
|
||||||
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.auth.entity.LoginVO;
|
||||||
import com.dbnt.kcscbackend.commonCode.entity.TcCodeItem;
|
import com.dbnt.kcscbackend.commonCode.entity.TcCodeItem;
|
||||||
|
|
@ -149,6 +150,49 @@ public class EgovIndvdlSchdulManageServiceImpl extends EgovAbstractServiceImpl i
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultVO updateSchedule(ResultVO resultVO, HttpServletRequest request, UpdateScheduleVO updateScheduleVO) throws Exception {
|
||||||
|
|
||||||
|
System.out.println(
|
||||||
|
"\n--------------------------------------------------------------\n" +
|
||||||
|
request.getRequestURI() + " IN:" +
|
||||||
|
"\n--------------------------------------------------------------\n" +
|
||||||
|
"updateScheduleVO:" + "\n" +
|
||||||
|
updateScheduleVO.toString() + "\n" +
|
||||||
|
"\n--------------------------------------------------------------\n"
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
Map<String, Object> response = tnCmtEventRepository.spUpdateTnCmtEvent(
|
||||||
|
updateScheduleVO.getEvtSeq().intValue(),
|
||||||
|
updateScheduleVO.getDivMeet(), // 구분
|
||||||
|
updateScheduleVO.getUpCommittee().intValue(), // 심의위원회 상위 코드 번호
|
||||||
|
updateScheduleVO.getCommittee().intValue(), // 심의위원회 하위 코드 번호
|
||||||
|
updateScheduleVO.getTitle(), // 제목
|
||||||
|
updateScheduleVO.getLocation(), // 장소
|
||||||
|
updateScheduleVO.getContents(), // 내용
|
||||||
|
updateScheduleVO.getStartDate(), // 날짜/시간의 시작 일시
|
||||||
|
updateScheduleVO.getEndDate(), // 날짜/시간의 종료 일시
|
||||||
|
"admin",
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, Object> dto = new HashMap<String, Object>();
|
||||||
|
dto.put("errorMessage", response.get("_error_message") );
|
||||||
|
dto.put("schdulId", updateScheduleVO.getEvtSeq() );
|
||||||
|
|
||||||
|
resultVO.setResult(dto);
|
||||||
|
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
||||||
|
resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage());
|
||||||
|
|
||||||
|
return resultVO;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResultVO scheduleDetail(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long scheduleId) throws Exception {
|
public ResultVO scheduleDetail(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long scheduleId) throws Exception {
|
||||||
|
|
||||||
|
|
@ -177,14 +221,19 @@ public class EgovIndvdlSchdulManageServiceImpl extends EgovAbstractServiceImpl i
|
||||||
|
|
||||||
Map<String, Object> dto = new HashMap<String, Object>();
|
Map<String, Object> dto = new HashMap<String, Object>();
|
||||||
dto.put("evtSeq", tnCmtEvent.getEvtSeq()); // sequence
|
dto.put("evtSeq", tnCmtEvent.getEvtSeq()); // sequence
|
||||||
dto.put("divMeetNm", tcCodeItem.getItemNm()); // 구분
|
dto.put("divMeetNm", tcCodeItem.getItemNm()); // 구분 명
|
||||||
|
dto.put("divMeet", tnCmtEvent.getEvtType()); // 구분 코드
|
||||||
|
dto.put("upCommittee", tnCmtEvent.getUpCmtSeq()); // 심의위원회 상위 코드
|
||||||
dto.put("upCommitteeNm", tnCmtOrgForUpCommitteeNm.getCmtNm()); // 심의위원회 상위 이름
|
dto.put("upCommitteeNm", tnCmtOrgForUpCommitteeNm.getCmtNm()); // 심의위원회 상위 이름
|
||||||
|
dto.put("committee", tnCmtEvent.getCmtSeq()); // 심의위원회 하위 코드
|
||||||
dto.put("committeeNm", tnCmtOrgForCommitteeNm.getCmtNm()); // 심의위원회 하위 이름
|
dto.put("committeeNm", tnCmtOrgForCommitteeNm.getCmtNm()); // 심의위원회 하위 이름
|
||||||
dto.put("title", tnCmtEvent.getEvtTitle()); // 제목
|
dto.put("title", tnCmtEvent.getEvtTitle()); // 제목
|
||||||
dto.put("location", tnCmtEvent.getEvtLocation()); // 장소
|
dto.put("location", tnCmtEvent.getEvtLocation()); // 장소
|
||||||
dto.put("contents", tnCmtEvent.getEvtContents()); // 내용
|
dto.put("contents", tnCmtEvent.getEvtContents()); // 내용
|
||||||
dto.put("startDate", tnCmtEvent.getEvtStartDt().plusHours(9)); // 날짜/시간의 시작 일시
|
dto.put("startDate", tnCmtEvent.getEvtStartDt().plusHours(9)); // 날짜/시간의 시작 일시
|
||||||
dto.put("endDate", tnCmtEvent.getEvtEndDt().plusHours(9)); // 날짜/시간의 종료 일시
|
dto.put("endDate", tnCmtEvent.getEvtEndDt().plusHours(9)); // 날짜/시간의 종료 일시
|
||||||
|
dto.put("schdulBgnde", tnCmtEvent.getEvtStartDt().plusHours(9).format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); // 날짜/시간의 시작 일시 - yyyyMMddHHmmss
|
||||||
|
dto.put("schdulEndde", tnCmtEvent.getEvtEndDt().plusHours(9).format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); // 날짜/시간의 종료 일시
|
||||||
|
|
||||||
// 문자열로 리턴하도록 수정해야 함.
|
// 문자열로 리턴하도록 수정해야 함.
|
||||||
|
|
||||||
|
|
@ -251,8 +300,8 @@ public class EgovIndvdlSchdulManageServiceImpl extends EgovAbstractServiceImpl i
|
||||||
.stream()
|
.stream()
|
||||||
.map(item -> {
|
.map(item -> {
|
||||||
Map<String, Object> mapDto = new HashMap<>();
|
Map<String, Object> mapDto = new HashMap<>();
|
||||||
mapDto.put("evt_start_dt", item.getEvtStartDt().format(DateTimeFormatter.ofPattern("yyyyMMdd HH:mm:ss.SSS")));
|
mapDto.put("evt_start_dt", item.getEvtStartDt().plusHours(9).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("evt_end_dt", item.getEvtEndDt().plusHours(9).format(DateTimeFormatter.ofPattern("yyyyMMdd HH:mm:ss.SSS")));
|
||||||
mapDto.put("schdulId", item.getEvtSeq());
|
mapDto.put("schdulId", item.getEvtSeq());
|
||||||
mapDto.put("schdulNm", item.getEvtTitle());
|
mapDto.put("schdulNm", item.getEvtTitle());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,44 @@ public interface TnCmtEventRepository extends JpaRepository<TnCmtEvent, TnCmtEve
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
@Query(value = "CALL sp_update_tn_cmt_event (" +
|
||||||
|
":_evt_seq, " +
|
||||||
|
":_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, " +
|
||||||
|
":_result_count, " +
|
||||||
|
":_result_code, " +
|
||||||
|
":_error_message)",
|
||||||
|
nativeQuery = true)
|
||||||
|
Map<String, Object> spUpdateTnCmtEvent(
|
||||||
|
@Param("_evt_seq") Integer evtSeq,
|
||||||
|
@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("_result_count") Integer resultCount,
|
||||||
|
@Param("_result_code") String resultCode,
|
||||||
|
@Param("_error_message") String errorMessage
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
//@Procedure
|
//@Procedure
|
||||||
//Map<String, Object> sp_is_valid_tn_cmt_event_id( @Param("_evt_seq") Long evtSeq );
|
//Map<String, Object> sp_is_valid_tn_cmt_event_id( @Param("_evt_seq") Long evtSeq );
|
||||||
|
|
||||||
|
|
@ -76,12 +114,12 @@ public interface TnCmtEventRepository extends JpaRepository<TnCmtEvent, TnCmtEve
|
||||||
" TO_TIMESTAMP(" + " \n" +
|
" TO_TIMESTAMP(" + " \n" +
|
||||||
" :sSearchDate," + " \n" +
|
" :sSearchDate," + " \n" +
|
||||||
" 'YYYYMM'" + " \n" +
|
" 'YYYYMM'" + " \n" +
|
||||||
" ) <= tce.evt_start_dt AND" + " \n" +
|
" ) AT TIME ZONE 'UTC+9' <= tce.evt_start_dt AND" + " \n" +
|
||||||
|
|
||||||
" tce.evt_start_dt < TO_TIMESTAMP(" + " \n" +
|
" tce.evt_start_dt < TO_TIMESTAMP(" + " \n" +
|
||||||
" :sSearchDate," + " \n" +
|
" :sSearchDate," + " \n" +
|
||||||
" 'YYYYMM'" + " \n" +
|
" 'YYYYMM'" + " \n" +
|
||||||
" ) + INTERVAL '1 MONTH';\n",
|
" ) AT TIME ZONE 'UTC+9' + INTERVAL '1 MONTH' ;\n",
|
||||||
nativeQuery = true)
|
nativeQuery = true)
|
||||||
List<TnCmtEvent> getByYyyyMm(
|
List<TnCmtEvent> getByYyyyMm(
|
||||||
@Param("sSearchDate") String sSearchDate
|
@Param("sSearchDate") String sSearchDate
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue