feat: 관리자 단에서 '위원회 관리' > '위원회 일정 관리'에 '등록' 버튼을 누른 후 '위원회 일정 등록' 페이지에서 항목 입력 후 '저장'을 버튼 누를 때 저장되도록 구현

thkim
thkim 2024-01-11 16:36:30 +09:00
parent cdaaebd6d8
commit d00696c73e
3 changed files with 72 additions and 32 deletions

View File

@ -112,7 +112,6 @@ public class EgovIndvdlSchdulManageServiceImpl extends EgovAbstractServiceImpl i
}
@Override
@Transactional(rollbackFor = {Exception.class})
public ResultVO createSchedule(ResultVO resultVO, HttpServletRequest request, CreateScheduleVO createScheduleVO) throws Exception {
System.out.println(
@ -124,29 +123,16 @@ public class EgovIndvdlSchdulManageServiceImpl extends EgovAbstractServiceImpl i
"\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());
LocalDate startDate = date.toInstant()
.atZone(ZoneId.systemDefault())
.toLocalDate();
LocalDateTime endDate = Instant.ofEpochMilli(date.getTime())
.atZone(ZoneId.systemDefault())
.toLocalDateTime();
Timestamp ts=new Timestamp(date.getTime());
tnCmtEventRepository.sp_add_tn_cmt_event(
Map<String, Object> response = tnCmtEventRepository.spAddTnCmtEvent(
createScheduleVO.getDivMeet(),
createScheduleVO.getUpCommittee(),
createScheduleVO.getCommittee(),
createScheduleVO.getTitle(),
createScheduleVO.getLocation(),
createScheduleVO.getContents(),
date,
date,
createScheduleVO.getStartDate(),
createScheduleVO.getEndDate(),
"admin",
null,
null,

View File

@ -2,30 +2,82 @@ package com.dbnt.kcscbackend.admin.config.repository;
import com.dbnt.kcscbackend.admin.config.entity.TnCmtEvent;
import com.dbnt.kcscbackend.admin.config.entity.TnCmtOrg;
import com.fasterxml.jackson.annotation.JsonFormat;
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.repository.query.Param;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.transaction.annotation.Transactional;
import java.sql.Timestamp;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
import java.util.Map;
public interface TnCmtEventRepository extends JpaRepository<TnCmtEvent, TnCmtEvent.TnCmtEventId> {
@Transactional
@Modifying
@Query(value = "SET datestyle TO ISO, MDY", nativeQuery = true)
int setDateStyle();
@Procedure
int sp_add_tn_cmt_event(
String evtType,
Integer upCmtSeq,
Integer cmtSeq,
String evtTitle,
String evtLocation,
String evtContents,
Date evtStartDt,
Date evtEndDt,
String modiId,
Integer _evt_seq,
Integer _result_count,
String _result_code,
String _error_message
@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") Date evtStartDt,
@Param("_evt_end_dt") Date evtEndDt,
@Param("_modi_id") String modiId,
@Param("_evt_seq") Integer _evt_seq,
@Param("_result_count") Integer _result_count,
@Param("_result_code") String _result_code,
@Param("_error_message") String _error_message
);
@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
);
/*

View File

@ -13,11 +13,12 @@ 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!
#jpa
spring.jpa.show-sql=true
spring.jpa.generate-ddl=false
@ -25,6 +26,7 @@ spring.jpa.hibernate.naming.physical-strategy = org.hibernate.boot.model.naming.
spring.jpa.properties.hibernate.proc.param_null_passing=true
# MyBatis
mybatis.mapper-locations: mybatisMapper/*.xml
mybatis.configuration.map-underscore-to-camel-case=true