build: 중간저장

thkim
thkim 2024-01-24 18:02:10 +09:00
parent 811e914666
commit 22a185a3ab
6 changed files with 144 additions and 24 deletions

View File

@ -168,7 +168,7 @@ public class EgovIndvdlSchdulManageServiceImpl extends EgovAbstractServiceImpl i
); );
// 유효성 검사 실시 // 유효성 검사 실시
int isValid = tnCmtEventRepository.sp_is_valid_tn_cmt_event_id( updateScheduleVO.getEvtSeq() ); int isValid = tnCmtEventRepository.spIsValidTnCmtEventId( updateScheduleVO.getEvtSeq() );
if( isValid == 0 ) { if( isValid == 0 ) {
throw new Exception("대상이 존재하지 않습니다."); throw new Exception("대상이 존재하지 않습니다.");
@ -253,7 +253,7 @@ public class EgovIndvdlSchdulManageServiceImpl extends EgovAbstractServiceImpl i
); );
int isValid = tnCmtEventRepository.sp_is_valid_tn_cmt_event_id( scheduleId.intValue() ); int isValid = tnCmtEventRepository.spIsValidTnCmtEventId( scheduleId.intValue() );
if( isValid == 0 ) { if( isValid == 0 ) {
throw new Exception("대상이 존재하지 않습니다."); throw new Exception("대상이 존재하지 않습니다.");
@ -282,9 +282,6 @@ public class EgovIndvdlSchdulManageServiceImpl extends EgovAbstractServiceImpl i
dto.put("schdulBgnde", tnCmtEvent.getEvtStartDt().plusHours(9).format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); // 날짜/시간의 시작 일시 - yyyyMMddHHmmss dto.put("schdulBgnde", tnCmtEvent.getEvtStartDt().plusHours(9).format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); // 날짜/시간의 시작 일시 - yyyyMMddHHmmss
dto.put("schdulEndde", tnCmtEvent.getEvtEndDt().plusHours(9).format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); // 날짜/시간의 종료 일시 dto.put("schdulEndde", tnCmtEvent.getEvtEndDt().plusHours(9).format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); // 날짜/시간의 종료 일시
// 문자열로 리턴하도록 수정해야 함.
resultVO.setResult(dto); resultVO.setResult(dto);
resultVO.setResultCode(ResponseCode.SUCCESS.getCode()); resultVO.setResultCode(ResponseCode.SUCCESS.getCode());

View File

@ -120,6 +120,84 @@ public class PopUpApiController {
} }
@Operation(
summary = "팝업 수정 API",
description = "관리자 단에서 '컨텐츠 관리' > '팝업 관리' 페이지에서 팝업을 수정하는 API",
tags = {"PopUpApiController"}
)
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "등록 성공"),
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님"),
@ApiResponse(responseCode = "900", description = "입력값 무결성 오류")
})
@PutMapping(value = "/contents/api/popup-manage/{popupId}")
public ResultVO contentsApiPopUpManageUpdate(
HttpServletRequest request,
@AuthenticationPrincipal LoginVO loginVO,
@PathVariable("popupId") Long popupId
) throws Exception {
ResultVO resultVO = new ResultVO();
try {
resultVO = popUpApiService.contentsApiPopUpManageUpdate(resultVO, request, loginVO, popupId);
} 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;
}
@Operation(
summary = "팝업 내용 불러오기 API",
description = "관리자 단에서 '컨텐츠 관리' > '팝업 관리' 페이지에서 저장된 팝업을 불러오는 API",
tags = {"PopUpApiController"}
)
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "조회 성공")
})
@GetMapping(value = "/contents/api/popup-manage/{popupId}")
public ResultVO contentsApiPopUpManageRead(
HttpServletRequest request,
@AuthenticationPrincipal LoginVO loginVO,
@PathVariable("popupId") Long popupId
) throws Exception {
ResultVO resultVO = new ResultVO();
try {
resultVO = popUpApiService.contentsApiPopUpManageRead(resultVO, request, loginVO, popupId);
} 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;
}
} }

View File

@ -11,4 +11,7 @@ import javax.servlet.http.HttpServletRequest;
public interface PopUpApiService { public interface PopUpApiService {
public ResultVO contentsApiPopUpManageList(ResultVO resultVO, HttpServletRequest request, LoginVO user, Pageable pageable) throws Exception; public ResultVO contentsApiPopUpManageList(ResultVO resultVO, HttpServletRequest request, LoginVO user, Pageable pageable) throws Exception;
public ResultVO contentsApiPopUpManageCreate(ResultVO resultVO, HttpServletRequest request, LoginVO user, final MultipartHttpServletRequest multiRequest, CreatePopupVO createPopupVO) throws Exception; public ResultVO contentsApiPopUpManageCreate(ResultVO resultVO, HttpServletRequest request, LoginVO user, final MultipartHttpServletRequest multiRequest, CreatePopupVO createPopupVO) throws Exception;
public ResultVO contentsApiPopUpManageRead(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long popupId) throws Exception;
public ResultVO contentsApiPopUpManageUpdate(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long popupId) throws Exception;
public ResultVO contentsApiPopUpManageDelete(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long popupId) throws Exception;
} }

View File

@ -6,6 +6,10 @@ import com.dbnt.kcscbackend.admin.contents.popUp.model.FileVO;
import com.dbnt.kcscbackend.admin.contents.popUp.repository.TnPopupMngRepositoryWithoutPopupContents; import com.dbnt.kcscbackend.admin.contents.popUp.repository.TnPopupMngRepositoryWithoutPopupContents;
import com.dbnt.kcscbackend.admin.contents.popUp.service.PopUpApiService; import com.dbnt.kcscbackend.admin.contents.popUp.service.PopUpApiService;
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.TnCmtEvent;
import com.dbnt.kcscbackend.commonCode.entity.TnCmtOrg;
import com.dbnt.kcscbackend.commonCode.entity.TnPopupMng;
import com.dbnt.kcscbackend.commonCode.repository.TnPopupMngRepository; import com.dbnt.kcscbackend.commonCode.repository.TnPopupMngRepository;
import com.dbnt.kcscbackend.config.common.ResponseCode; import com.dbnt.kcscbackend.config.common.ResponseCode;
import com.dbnt.kcscbackend.config.common.ResultVO; import com.dbnt.kcscbackend.config.common.ResultVO;
@ -112,19 +116,6 @@ public class PopUpApiServiceImpl extends EgovAbstractServiceImpl implements PopU
//_atchFileId = fileMngService.insertFileInfs(_result); //파일이 생성되고나면 생성된 첨부파일 ID를 리턴한다. //_atchFileId = fileMngService.insertFileInfs(_result); //파일이 생성되고나면 생성된 첨부파일 ID를 리턴한다.
} }
// 리턴받은 첨부파일ID를 셋팅한다..
//createPopupVO.setAtchFileId(_atchFileId); // 첨부파일 ID
//아이디 설정
//createPopupVO.setFrstRegisterId(loginVO.getUniqId());
//createPopupVO.setLastUpdusrId(loginVO.getUniqId());
//createPopupVO.setSchdulDeptName("관리자부서");
//createPopupVO.setSchdulDeptId("ORGNZT_0000000000000");
//createPopupVO.setSchdulChargerName("관리자");
//createPopupVO.setSchdulChargerId("USRCNFRM_00000000000");
//egovIndvdlSchdulManageService.insertIndvdlSchdulManage(indvdlSchdulManageVO);
//call kcsc.sp_add_tn_popup_mng ('팝업제목','2023-08-17 10:00:00','2023-08-23 10:00:00',NULL,'이러저런 내용 ','kcsc_admin',NULL,NULL,NULL,NULL); //call kcsc.sp_add_tn_popup_mng ('팝업제목','2023-08-17 10:00:00','2023-08-23 10:00:00',NULL,'이러저런 내용 ','kcsc_admin',NULL,NULL,NULL,NULL);
Map<String, Object> response = tnPopupMngRepository.spAddTnPopupMng( Map<String, Object> response = tnPopupMngRepository.spAddTnPopupMng(
createPopupVO.getTitle(), createPopupVO.getTitle(),
@ -151,5 +142,53 @@ public class PopUpApiServiceImpl extends EgovAbstractServiceImpl implements PopU
} }
@Override
public ResultVO contentsApiPopUpManageRead(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long popupId) throws Exception {
System.out.println(
"\n--------------------------------------------------------------\n" +
request.getRequestURI() + " IN:" +
"\n--------------------------------------------------------------\n" +
"user.getEmail():" + "\n" +
user.getEmail() + "\n" +
"popupId:" + "\n" +
popupId + "\n" +
"\n--------------------------------------------------------------\n"
);
int isValid = tnPopupMngRepository.spIsValidTnCmtEventId( popupId.intValue() );
if( isValid == 0 ) {
throw new Exception("대상이 존재하지 않습니다.");
}
TnPopupMng tnPopupMng = tnPopupMngRepository.findByPopupSeq(popupId);
Map<String, Object> dto = new HashMap<String, Object>();
dto.put("title", tnPopupMng.getPopupTitle()); // 팝업 제목
dto.put("contents", tnPopupMng.getPopupContents()); // 팝업 내용
dto.put("schdulBgnde", tnPopupMng.getPopupStartDate().plusHours(9).format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); // 날짜/시간의 시작 일시 - yyyyMMddHHmmss
dto.put("schdulEndde", tnPopupMng.getPopupEndDate().plusHours(9).format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); // 날짜/시간의 종료 일시 - yyyyMMddHHmmss
resultVO.setResult(dto);
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage());
return resultVO;
}
@Override
public ResultVO contentsApiPopUpManageUpdate(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long popupId) throws Exception {
return null;
}
@Override
public ResultVO contentsApiPopUpManageDelete(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long popupId) throws Exception {
return null;
}
} }

View File

@ -110,12 +110,8 @@ public interface TnCmtEventRepository extends JpaRepository<TnCmtEvent, TnCmtEve
@Param("_error_message") String errorMessage @Param("_error_message") String errorMessage
); );
@Procedure("sp_is_valid_tn_cmt_event_id")
//@Procedure int spIsValidTnCmtEventId( Integer evtSeq );
//Map<String, Object> sp_is_valid_tn_cmt_event_id( @Param("_evt_seq") Long evtSeq );
@Procedure
int sp_is_valid_tn_cmt_event_id( Integer evtSeq );

View File

@ -1,8 +1,10 @@
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.TnPopupMng; import com.dbnt.kcscbackend.commonCode.entity.TnPopupMng;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import org.springframework.data.jpa.repository.query.Procedure;
import org.springframework.data.repository.query.Param; import org.springframework.data.repository.query.Param;
import java.util.List; import java.util.List;
@ -43,5 +45,10 @@ public interface TnPopupMngRepository extends JpaRepository<TnPopupMng, TnPopupM
); );
@Procedure("sp_is_valid_tn_popup_mng_id")
int spIsValidTnCmtEventId( Integer popupSeq );
TnPopupMng findByPopupSeq(Long popupSeq);
} }