From a799f454e251b8d05a86f3eb188136f51816cbab Mon Sep 17 00:00:00 2001 From: thkim Date: Fri, 5 Jan 2024 09:58:08 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20'=EC=9C=84=EC=9B=90=ED=9A=8C=20?= =?UTF-8?q?=EC=9D=BC=EC=A0=95=20=EB=93=B1=EB=A1=9D'=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20=EB=A1=9C=EB=94=A9=20API=EB=A5=BC=20=EA=B0=9C?= =?UTF-8?q?=EB=B0=9C=ED=95=98=EA=B8=B0=20=EC=9C=84=ED=95=9C=20=ED=8F=B4?= =?UTF-8?q?=EB=8D=94=20=EA=B5=AC=EC=A1=B0=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 관리자 단에서 '위원회 관리' > '위원회 일정 관리'에 '등록'버튼을 누른 후 '위원회 일정 등록' 페이지 로딩 시, 필요한 데이터 불러오는 API 제작 --- kcsc-back-end/build.gradle | 8 + .../schedules/config/EgovConfigAppMapper.java | 85 ++ .../EgovFileDownloadController.java | 192 ++++ .../controller/SchedulesApiController.java | 639 +++++++++++++ .../schedules/repository/CmmUseDAO.java | 64 ++ .../repository/ComDefaultCodeVO.java | 60 ++ .../schedules/repository/ComDefaultVO.java | 68 ++ .../schedules/repository/FileManageDAO.java | 182 ++++ .../schedules/repository/FileVO.java | 69 ++ .../repository/IndvdlSchdulManageDao.java | 122 +++ .../repository/IndvdlSchdulManageVO.java | 106 +++ .../schedules/repository/LoginVO.java | 79 ++ .../schedules/repository/ResponseCode.java | 50 + .../schedules/repository/ResultVO.java | 52 + .../schedules/service/CmmnDetailCode.java | 70 ++ .../schedules/service/EgovCmmUseService.java | 63 ++ .../service/EgovCmmUseServiceImpl.java | 92 ++ .../schedules/service/EgovComAbstractDAO.java | 32 + .../schedules/service/EgovFileMngService.java | 117 +++ .../service/EgovFileMngServiceImpl.java | 177 ++++ .../EgovIndvdlSchdulManageService.java | 105 +++ .../EgovIndvdlSchdulManageServiceImpl.java | 134 +++ .../schedules/util/EgovIdGnrBuilder.java | 96 ++ .../schedules/util/EgovStringUtil.java | 888 ++++++++++++++++++ .../config/egov/EgovConfigAppCommon.java | 26 + .../schedules/mapper/config/mapper-config.xml | 21 + .../src/main/resources/application.properties | 4 + 27 files changed, 3601 insertions(+) create mode 100644 kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/config/EgovConfigAppMapper.java create mode 100644 kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/controller/EgovFileDownloadController.java create mode 100644 kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/controller/SchedulesApiController.java create mode 100644 kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/CmmUseDAO.java create mode 100644 kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/ComDefaultCodeVO.java create mode 100644 kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/ComDefaultVO.java create mode 100644 kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/FileManageDAO.java create mode 100644 kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/FileVO.java create mode 100644 kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/IndvdlSchdulManageDao.java create mode 100644 kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/IndvdlSchdulManageVO.java create mode 100644 kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/LoginVO.java create mode 100644 kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/ResponseCode.java create mode 100644 kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/ResultVO.java create mode 100644 kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/CmmnDetailCode.java create mode 100644 kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovCmmUseService.java create mode 100644 kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovCmmUseServiceImpl.java create mode 100644 kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovComAbstractDAO.java create mode 100644 kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovFileMngService.java create mode 100644 kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovFileMngServiceImpl.java create mode 100644 kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovIndvdlSchdulManageService.java create mode 100644 kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovIndvdlSchdulManageServiceImpl.java create mode 100644 kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/util/EgovIdGnrBuilder.java create mode 100644 kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/util/EgovStringUtil.java create mode 100644 kcsc-back-end/src/main/resources/admin/committee/schedules/mapper/config/mapper-config.xml diff --git a/kcsc-back-end/build.gradle b/kcsc-back-end/build.gradle index e069284..fbba565 100644 --- a/kcsc-back-end/build.gradle +++ b/kcsc-back-end/build.gradle @@ -59,10 +59,16 @@ dependencies { /*전자정부*/ implementation(group: 'org.egovframe.rte', name: 'org.egovframe.rte.ptl.mvc', version:'4.1.0') { exclude(module: 'commons-logging') + exclude(module: 'spring-modules-validation') } implementation group: 'org.egovframe.rte', name: 'org.egovframe.rte.fdl.cmmn', version:'4.1.0' implementation group: 'org.egovframe.rte', name: 'org.egovframe.rte.fdl.property', version:'4.1.0' + implementation group: 'org.egovframe.rte', name: 'org.egovframe.rte.fdl.crypto', version:'4.1.0' + implementation group: 'org.egovframe.rte', name: 'org.egovframe.rte.fdl.idgnr', version:'4.1.0' + implementation group: 'org.egovframe.rte', name: 'org.egovframe.rte.psl.dataaccess', version:'4.1.0' + implementation group: 'org.springmodules', name: 'spring-modules-validation', version:'0.9' + // https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 implementation group: 'io.springfox', name: 'springfox-swagger2', version: '3.0.0' @@ -81,5 +87,7 @@ dependencies { // https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt-jackson runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.11.5' + implementation 'org.apache.commons:commons-lang3' + } diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/config/EgovConfigAppMapper.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/config/EgovConfigAppMapper.java new file mode 100644 index 0000000..6ab1398 --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/config/EgovConfigAppMapper.java @@ -0,0 +1,85 @@ +package com.dbnt.kcscbackend.admin.committee.schedules.config; + +import org.apache.ibatis.session.SqlSessionFactory; +import org.mybatis.spring.SqlSessionFactoryBean; +import org.mybatis.spring.SqlSessionTemplate; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.context.annotation.*; +import org.springframework.core.env.Environment; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; +import org.springframework.jdbc.support.lob.DefaultLobHandler; + +import javax.annotation.PostConstruct; +import javax.sql.DataSource; +import java.io.IOException; + +/** + * @ClassName : EgovConfigAppMapper.java + * @Description : Mapper 설정 + * + * @author : 윤주호 + * @since : 2021. 7. 20 + * @version : 1.0 + * + *
+ * << 개정이력(Modification Information) >>
+ *
+ *   수정일              수정자               수정내용
+ *  -------------  ------------   ---------------------
+ *   2021. 7. 20    윤주호               최초 생성
+ * 
+ * + */ +@Configuration +@PropertySources({ + @PropertySource("classpath:/application.properties") +}) +public class EgovConfigAppMapper { + @Autowired + DataSource dataSource; + + @Autowired + Environment env; + + private String dbType; + + @PostConstruct + void init() { + dbType = env.getProperty("Globals.DbType"); + } + + @Bean + @Lazy + public DefaultLobHandler lobHandler() { + return new DefaultLobHandler(); + } + + @Bean(name = {"sqlSession", "egov.sqlSession"}) + public SqlSessionFactoryBean sqlSession() { + SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean(); + sqlSessionFactoryBean.setDataSource(dataSource); + + PathMatchingResourcePatternResolver pathMatchingResourcePatternResolver = new PathMatchingResourcePatternResolver(); + + sqlSessionFactoryBean.setConfigLocation( + pathMatchingResourcePatternResolver + .getResource("classpath:/admin/committee/schedules/mapper/config/mapper-config.xml")); + + try { + sqlSessionFactoryBean.setMapperLocations( + pathMatchingResourcePatternResolver + .getResources("classpath:/egovframework/mapper/let/**/*_" + dbType + ".xml")); + } catch (IOException e) { + // TODO Exception 처리 필요 + } + + return sqlSessionFactoryBean; + } + + @Bean + public SqlSessionTemplate egovSqlSessionTemplate(@Qualifier("sqlSession") SqlSessionFactory sqlSession) { + SqlSessionTemplate sqlSessionTemplate = new SqlSessionTemplate(sqlSession); + return sqlSessionTemplate; + } +} diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/controller/EgovFileDownloadController.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/controller/EgovFileDownloadController.java new file mode 100644 index 0000000..48d46dd --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/controller/EgovFileDownloadController.java @@ -0,0 +1,192 @@ +package com.dbnt.kcscbackend.admin.committee.schedules.controller; + +import com.dbnt.kcscbackend.admin.committee.schedules.repository.FileVO; +import com.dbnt.kcscbackend.admin.committee.schedules.service.EgovFileMngService; +import com.dbnt.kcscbackend.config.egov.EgovProperties; +import com.dbnt.kcscbackend.config.egov.EgovWebUtil; +import io.swagger.v3.oas.annotations.Operation; +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 lombok.extern.slf4j.Slf4j; +import org.egovframe.rte.fdl.cmmn.exception.EgovBizException; +import org.egovframe.rte.fdl.cryptography.EgovCryptoService; +import org.springframework.stereotype.Controller; +import org.springframework.util.FileCopyUtils; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.net.URLEncoder; +import java.util.Base64; +import java.util.Map; + +/** + * 파일 다운로드를 위한 컨트롤러 클래스 + * @author 공통서비스개발팀 이삼섭 + * @since 2009.06.01 + * @version 1.0 + * @see + * + *
+ * << 개정이력(Modification Information) >>
+ *
+ *   수정일      수정자           수정내용
+ *  -------    --------    ---------------------------
+ *   2009.3.25  이삼섭          최초 생성
+ *
+ * Copyright (C) 2009 by MOPAS  All right reserved.
+ * 
+ */ +@Slf4j +@Controller +@Tag(name="EgovFileDownloadController",description = "파일 다운로드") +public class EgovFileDownloadController { + + @Resource(name = "EgovFileMngService") + private EgovFileMngService fileService; + + /** 암호화서비스 */ + @Resource(name="egovARIACryptoService") + EgovCryptoService cryptoService; + + public static final String ALGORITM_KEY = EgovProperties.getProperty("Globals.crypto.algoritm"); + + /** + * 브라우저 구분 얻기. + * + * @param request + * @return + */ + private String getBrowser(HttpServletRequest request) { + String header = request.getHeader("User-Agent"); + if (header.indexOf("MSIE") > -1) { + return "MSIE"; + } else if (header.indexOf("Trident") > -1) { // IE11 문자열 깨짐 방지 + return "Trident"; + } else if (header.indexOf("Chrome") > -1) { + return "Chrome"; + } else if (header.indexOf("Opera") > -1) { + return "Opera"; + } + return "Firefox"; + } + + /** + * Disposition 지정하기. + * + * @param filename + * @param request + * @param response + * @throws Exception + */ + private void setDisposition(String filename, HttpServletRequest request, HttpServletResponse response) + throws Exception { + String browser = getBrowser(request); + + String dispositionPrefix = "attachment; filename="; + String encodedFilename = null; + + if (browser.equals("MSIE")) { + encodedFilename = URLEncoder.encode(filename, "UTF-8").replaceAll("\\+", "%20"); + } else if (browser.equals("Trident")) { // IE11 문자열 깨짐 방지 + encodedFilename = URLEncoder.encode(filename, "UTF-8").replaceAll("\\+", "%20"); + } else if (browser.equals("Firefox")) { + encodedFilename = "\"" + new String(filename.getBytes("UTF-8"), "8859_1") + "\""; + } else if (browser.equals("Opera")) { + encodedFilename = "\"" + new String(filename.getBytes("UTF-8"), "8859_1") + "\""; + } else if (browser.equals("Chrome")) { + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < filename.length(); i++) { + char c = filename.charAt(i); + if (c > '~') { + sb.append(URLEncoder.encode("" + c, "UTF-8")); + } else { + sb.append(c); + } + } + encodedFilename = sb.toString(); + } else { + //throw new RuntimeException("Not supported browser"); + throw new IOException("Not supported browser"); + } + + response.setHeader("Content-Disposition", dispositionPrefix + encodedFilename); + + if ("Opera".equals(browser)) { + response.setContentType("application/octet-stream;charset=UTF-8"); + } + } + + /** + * 첨부파일로 등록된 파일에 대하여 다운로드를 제공한다. + * + * @param commandMap + * @param response + * @throws Exception + */ + + @Operation( + summary = "파일 다운로드", + description = "첨부파일로 등록된 파일에 대하여 다운로드를 제공", + tags = {"EgovFileDownloadController"} + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "성공") + }) + @GetMapping(value = "/cmm/fms/FileDown.do") + public void cvplFileDownload(@RequestParam Map commandMap, HttpServletRequest request, HttpServletResponse response) throws Exception { + + // 암호화된 atchFileId 를 복호화 (2022.12.06 추가) - 파일아이디가 유추 불가능하도록 조치 + String param_atchFileId = (String) commandMap.get("atchFileId"); + param_atchFileId = param_atchFileId.replaceAll(" ", "+"); + byte[] decodedBytes = Base64.getDecoder().decode(param_atchFileId); + String decodedFileId = new String(cryptoService.decrypt(decodedBytes,ALGORITM_KEY)); + String fileSn = (String) commandMap.get("fileSn"); + + FileVO fileVO = new FileVO(); + fileVO.setAtchFileId(decodedFileId); + fileVO.setFileSn(fileSn); + FileVO fvo = fileService.selectFileInf(fileVO); + + String fileStreCours = EgovWebUtil.filePathBlackList(fvo.getFileStreCours()); + String streFileNm = EgovWebUtil.filePathBlackList(fvo.getStreFileNm()); + + File uFile = new File(fileStreCours, streFileNm); + long fSize = uFile.length(); + + if (fSize > 0) { + //String mimetype = "application/x-msdownload"; + String mimetype = "application/x-stuff"; + + //response.setBufferSize(fSize); // OutOfMemeory 발생 + response.setContentType(mimetype); + //response.setHeader("Content-Disposition", "attachment; filename=\"" + URLEncoder.encode(fvo.getOrignlFileNm(), "utf-8") + "\""); + setDisposition(fvo.getOrignlFileNm(), request, response); + //response.setContentLength(fSize); + + /* + * FileCopyUtils.copy(in, response.getOutputStream()); + * in.close(); + * response.getOutputStream().flush(); + * response.getOutputStream().close(); + */ + + // Try-with-resources를 이용한 자원 해제 처리 (try 구문에 선언한 리소스를 자동 반납) + // try에 전달할 수 있는 자원은 java.lang.AutoCloseable 인터페이스의 구현 객체로 한정 + try (BufferedInputStream in = new BufferedInputStream(new FileInputStream(uFile)); + BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream());){ + FileCopyUtils.copy(in, out); + out.flush(); + } catch (FileNotFoundException ex) { + log.debug("IGNORED: {}", ex.getMessage()); + } + + } else { + throw new EgovBizException(); + } + } +} 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 new file mode 100644 index 0000000..2780aba --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/controller/SchedulesApiController.java @@ -0,0 +1,639 @@ +package com.dbnt.kcscbackend.admin.committee.schedules.controller; + + + +import com.dbnt.kcscbackend.admin.committee.schedules.repository.ComDefaultCodeVO; +import com.dbnt.kcscbackend.admin.committee.schedules.repository.FileVO; +import com.dbnt.kcscbackend.admin.committee.schedules.repository.IndvdlSchdulManageVO; +import com.dbnt.kcscbackend.admin.committee.schedules.service.EgovCmmUseService; +import com.dbnt.kcscbackend.admin.committee.schedules.service.EgovFileMngService; +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.egov.EgovMessageSource; +import io.swagger.v3.oas.annotations.Operation; +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.egovframe.rte.fdl.cryptography.EgovCryptoService; +import org.egovframe.rte.fdl.property.EgovPropertyService; +import org.springframework.security.core.annotation.AuthenticationPrincipal; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.text.SimpleDateFormat; +import java.util.*; + +/** + * 일정관리를 처리하는 Controller Class 구현 + * @since 2009.04.10 + * @see + *
+ * << 개정이력(Modification Information) >>
+ *   수정일      수정자           수정내용
+ *  -------    --------    ---------------------------
+ *  2009.04.10  장동한          최초 생성
+ *  2011.05.31  JJY           경량환경 커스터마이징버전 생성
+ * 
+ * @author 조재영 + * @version 1.0 + * @created 09-6-2011 오전 10:08:04 + */ +@RestController +@Tag(name="EgovIndvdlSchdulManageApiController",description = "일정관리") +public class SchedulesApiController { + + + /** EgovMessageSource */ + @Resource(name = "egovMessageSource") + EgovMessageSource egovMessageSource; + + @Resource(name = "egovIndvdlSchdulManageService") + private EgovIndvdlSchdulManageService egovIndvdlSchdulManageService; + + @Resource(name = "EgovCmmUseService") + private EgovCmmUseService cmmUseService; + + /** EgovPropertyService */ + @Resource(name = "propertiesService") + protected EgovPropertyService propertiesService; + + // 첨부파일 관련 + @Resource(name = "EgovFileMngService") + private EgovFileMngService fileMngService; + + /** 암호화서비스 */ + @Resource(name="egovARIACryptoService") + EgovCryptoService cryptoService; + + /** + * 일정(월별) 목록을 조회한다. + * @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 EgovIndvdlSchdulManageMonthList(@AuthenticationPrincipal LoginVO loginVO, HttpServletRequest request, + @RequestParam Map commandMap) throws Exception { + + ResultVO resultVO = new ResultVO(); + Map resultMap = new HashMap(); + + //일정구분 검색 유지 + resultMap.put("searchKeyword", + commandMap.get("searchKeyword") == null ? "" : (String)commandMap.get("searchKeyword")); + resultMap.put("searchCondition", + commandMap.get("searchCondition") == null ? "" : (String)commandMap.get("searchCondition")); + + Calendar cal = Calendar.getInstance(); + + String sYear = String.valueOf(commandMap.get("year")); + String sMonth = String.valueOf(commandMap.get("month")); + + 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); + } + + //공통코드 일정종류 + ComDefaultCodeVO voComCode = new ComDefaultCodeVO(); + voComCode = new ComDefaultCodeVO(); + voComCode.setCodeId("COM030"); + resultMap.put("schdulSe", cmmUseService.selectCmmCodeDetail(voComCode)); + + commandMap.put("searchMonth", sSearchDate); + commandMap.put("searchMode", "MONTH"); + resultMap.put("resultList", egovIndvdlSchdulManageService.selectIndvdlSchdulManageRetrieve(commandMap)); + + resultMap.put("prevRequest", commandMap); + + resultVO.setResult(resultMap); + resultVO.setResultCode(ResponseCode.SUCCESS.getCode()); + resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage()); + + return resultVO; + } + + /** + * 일정를 등록 처리 한다. + * @param request + * @param multiRequest + * @param indvdlSchdulManageVO + * @param bindingResult + * @return resultVO + * @throws Exception + */ + @Operation( + summary = "일정 등록", + description = "일정을 등록 처리", + tags = {"EgovIndvdlSchdulManageApiController"} + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "등록 성공"), + @ApiResponse(responseCode = "403", description = "인가된 사용자가 아님"), + @ApiResponse(responseCode = "900", description = "입력값 무결성 오류") + }) + @PostMapping(value = "/schedule") + public ResultVO IndvdlSchdulManageRegistActor( + HttpServletRequest request, + final MultipartHttpServletRequest multiRequest, + IndvdlSchdulManageVO indvdlSchdulManageVO, + BindingResult bindingResult, + @AuthenticationPrincipal LoginVO loginVO + ) throws Exception { + + ResultVO resultVO = new ResultVO(); + + //서버 validate 체크 + ////beanValidator.validate(indvdlSchdulManageVO, bindingResult); + if (bindingResult.hasErrors()) { + + resultVO.setResultCode(ResponseCode.INPUT_CHECK_ERROR.getCode()); + resultVO.setResultMessage(ResponseCode.INPUT_CHECK_ERROR.getMessage()); + return resultVO; + } + + // 첨부파일 관련 첨부파일ID 생성 + List _result = null; + String _atchFileId = ""; + + final Map files = multiRequest.getFileMap(); + + if (!files.isEmpty()) { + //_result = fileUtil.parseFileInf(files, "DSCH_", 0, "", ""); + _atchFileId = fileMngService.insertFileInfs(_result); //파일이 생성되고나면 생성된 첨부파일 ID를 리턴한다. + } + + // 리턴받은 첨부파일ID를 셋팅한다.. + indvdlSchdulManageVO.setAtchFileId(_atchFileId); // 첨부파일 ID + + //아이디 설정 + indvdlSchdulManageVO.setFrstRegisterId(loginVO.getUniqId()); + indvdlSchdulManageVO.setLastUpdusrId(loginVO.getUniqId()); + + indvdlSchdulManageVO.setSchdulDeptName("관리자부서"); + indvdlSchdulManageVO.setSchdulDeptId("ORGNZT_0000000000000"); + indvdlSchdulManageVO.setSchdulChargerName("관리자"); + indvdlSchdulManageVO.setSchdulChargerId("USRCNFRM_00000000000"); + egovIndvdlSchdulManageService.insertIndvdlSchdulManage(indvdlSchdulManageVO); + + resultVO.setResultCode(ResponseCode.SUCCESS.getCode()); + resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage()); + + return resultVO; + + } + + /** + * 일정 목록을 상세조회한다. + * @param schdulId + * @param user + * @return + * @throws Exception + */ + @Operation( + summary = "일정 상세조회", + description = "일정 목록을 상세조회", + tags = {"EgovIndvdlSchdulManageApiController"} + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "조회 성공") + }) + @GetMapping(value = "/schedule/{schdulId}") + public ResultVO EgovIndvdlSchdulManageDetail( + @PathVariable("schdulId") String schdulId, + @AuthenticationPrincipal LoginVO user) + throws Exception { + + ResultVO resultVO = new ResultVO(); + Map resultMap = new HashMap(); + + IndvdlSchdulManageVO indvdlSchdulManageVO = new IndvdlSchdulManageVO(); + indvdlSchdulManageVO.setSchdulId(schdulId); + + //일정시작일자(시) + resultMap.put("schdulBgndeHH", getTimeHH()); + //일정시작일자(분) + resultMap.put("schdulBgndeMM", getTimeMM()); + //일정종료일자(시) + resultMap.put("schdulEnddeHH", getTimeHH()); + //일정정료일자(분) + resultMap.put("schdulEnddeMM", getTimeMM()); + + //공통코드 중요도 조회 + ComDefaultCodeVO voComCode = new ComDefaultCodeVO(); + voComCode.setCodeId("COM019"); + resultMap.put("schdulIpcrCode", cmmUseService.selectCmmCodeDetail(voComCode)); + //공통코드 일정구분 조회 + voComCode = new ComDefaultCodeVO(); + voComCode.setCodeId("COM030"); + resultMap.put("schdulSe", cmmUseService.selectCmmCodeDetail(voComCode)); + //공통코드 반복구분 조회 + voComCode = new ComDefaultCodeVO(); + voComCode.setCodeId("COM031"); + resultMap.put("reptitSeCode", cmmUseService.selectCmmCodeDetail(voComCode)); + + IndvdlSchdulManageVO scheduleDetail = egovIndvdlSchdulManageService + .selectIndvdlSchdulManageDetail(indvdlSchdulManageVO); + resultMap.put("scheduleDetail", scheduleDetail); + + // 첨부파일 확인 + if (scheduleDetail.getAtchFileId() != null && !scheduleDetail.getAtchFileId().isEmpty()) { + FileVO fileVO = new FileVO(); + fileVO.setAtchFileId(scheduleDetail.getAtchFileId()); + List resultFiles = fileMngService.selectFileInfs(fileVO); + + // FileId를 유추하지 못하도록 암호화하여 표시한다. (2022.12.06 추가) - 파일아이디가 유추 불가능하도록 조치 + for (FileVO file : resultFiles) { + String toEncrypt = file.atchFileId; + file.setAtchFileId(Base64.getEncoder().encodeToString(cryptoService.encrypt(toEncrypt.getBytes(),EgovFileDownloadController.ALGORITM_KEY))); + } + + resultMap.put("resultFiles", resultFiles); + } + resultMap.put("user", user); + + resultVO.setResult(resultMap); + resultVO.setResultCode(ResponseCode.SUCCESS.getCode()); + resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage()); + + return resultVO; + } + + /** + * 일정을 삭제한다. + * @param schdulId + * @return + * @throws Exception + */ + @Operation( + summary = "일정 삭제", + description = "일정을 삭제 처리", + tags = {"EgovIndvdlSchdulManageApiController"} + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "등록 성공"), + @ApiResponse(responseCode = "403", description = "인가된 사용자가 아님") + }) + @DeleteMapping(value = "/schedule/{schdulId}") + public ResultVO EgovIndvdlSchdulManageDelete( + @PathVariable("schdulId") String schdulId + ) throws Exception { + + ResultVO resultVO = new ResultVO(); + + IndvdlSchdulManageVO indvdlSchdulManageVO = new IndvdlSchdulManageVO(); + indvdlSchdulManageVO.setSchdulId(schdulId); + + + egovIndvdlSchdulManageService.deleteIndvdlSchdulManage(indvdlSchdulManageVO);//schdulId + + resultVO.setResultCode(ResponseCode.SUCCESS.getCode()); + resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage()); + + + return resultVO; + } + + /** + * 일정를 수정 처리 한다. + * @param multiRequest + * @param indvdlSchdulManageVO + * @param bindingResult + * @return resultVO + * @throws Exception + */ + @Operation( + summary = "일정 수정", + description = "일정을 수정 처리", + tags = {"EgovIndvdlSchdulManageApiController"} + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "등록 성공"), + @ApiResponse(responseCode = "403", description = "인가된 사용자가 아님"), + @ApiResponse(responseCode = "900", description = "입력값 무결성 오류") + }) + @PutMapping(value = "/schedule/{schdulId}") + public ResultVO IndvdlSchdulManageModifyActor( + final MultipartHttpServletRequest multiRequest, + IndvdlSchdulManageVO indvdlSchdulManageVO, + BindingResult bindingResult, + @PathVariable("schdulId") String schdulId, + @AuthenticationPrincipal LoginVO user) + throws Exception { + + ResultVO resultVO = new ResultVO(); + Map resultMap = new HashMap(); + + //서버 validate 체크 + indvdlSchdulManageVO.setSchdulId(schdulId); + ////beanValidator.validate(indvdlSchdulManageVO, bindingResult); + if (bindingResult.hasErrors()) { + + resultVO.setResult(resultMap); + resultVO.setResultCode(ResponseCode.INPUT_CHECK_ERROR.getCode()); + resultVO.setResultMessage(ResponseCode.INPUT_CHECK_ERROR.getMessage()); + + return resultVO; + } + + /* ***************************************************************** + // 아이디 설정 + ****************************************************************** */ + indvdlSchdulManageVO.setFrstRegisterId(user.getUniqId()); + indvdlSchdulManageVO.setLastUpdusrId(user.getUniqId()); + /* ***************************************************************** + // 첨부파일 관련 ID 생성 start.... + ****************************************************************** */ + String _atchFileId = indvdlSchdulManageVO.getAtchFileId(); + + final Map files = multiRequest.getFileMap(); + + if (!files.isEmpty()) { + String atchFileAt = multiRequest.getAttribute("atchFileAt") == null ? "" : (String)multiRequest.getAttribute("atchFileAt"); + if ("N".equals(atchFileAt) || _atchFileId.equals("")) { + //기존 첨부 파일이 존재하지 않는 경우 + ////List _result = fileUtil.parseFileInf(files, "DSCH_", 0, _atchFileId, ""); + ////_atchFileId = fileMngService.insertFileInfs(_result); + + // 첨부파일 ID 셋팅 + indvdlSchdulManageVO.setAtchFileId(_atchFileId); // 첨부파일 ID + + } else { + //기존 첨부 파일이 하나라도 존재하는 경우 + FileVO fvo = new FileVO(); + fvo.setAtchFileId(_atchFileId); + int _cnt = fileMngService.getMaxFileSN(fvo); + ////List _result = fileUtil.parseFileInf(files, "DSCH_", _cnt, _atchFileId, ""); + ////fileMngService.updateFileInfs(_result); + } + } + + /* ***************************************************************** + // 일정관리정보 업데이트 처리 + ****************************************************************** */ + egovIndvdlSchdulManageService.updateIndvdlSchdulManage(indvdlSchdulManageVO); + + resultVO.setResult(resultMap); + resultVO.setResultCode(ResponseCode.SUCCESS.getCode()); + resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage()); + + return resultVO; + } + + /** + * 일정(일별) 목록을 조회한다. + * @param commandMap + * @return resultVO + * @throws Exception + */ + @Operation( + summary = "일별 일정 조회", + description = "일정(일별) 목록을 조회", + tags = {"EgovIndvdlSchdulManageApiController"} + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "조회 성공"), + @ApiResponse(responseCode = "403", description = "인가된 사용자가 아님") + }) + @GetMapping(value = "/schedule/daily") + public ResultVO EgovIndvdlSchdulManageDailyList(@RequestParam Map commandMap) throws Exception { + + ResultVO resultVO = new ResultVO(); + Map resultMap = new HashMap(); + + //일정구분 검색 유지 + resultMap.put("searchKeyword", + commandMap.get("searchKeyword") == null ? "" : (String)commandMap.get("searchKeyword")); + resultMap.put("searchCondition", + commandMap.get("searchCondition") == null ? "" : (String)commandMap.get("searchCondition")); + + //공통코드 일정종류 + ComDefaultCodeVO voComCode = new ComDefaultCodeVO(); + voComCode = new ComDefaultCodeVO(); + voComCode.setCodeId("COM030"); + resultMap.put("schdulSe", cmmUseService.selectCmmCodeDetail(voComCode)); + + /* ***************************************************************** + // 캘런더 설정 로직 + ****************************************************************** */ + Calendar calNow = Calendar.getInstance(); + + String strYear = String.valueOf(commandMap.get("year")); + String strMonth = String.valueOf(commandMap.get("month")); + String strDay = String.valueOf(commandMap.get("date")); + String strSearchDay = ""; + int iNowYear = calNow.get(Calendar.YEAR); + int iNowMonth = calNow.get(Calendar.MONTH); + int iNowDay = calNow.get(Calendar.DATE); + + if (strYear != null) { + iNowYear = Integer.parseInt(strYear); + iNowMonth = Integer.parseInt(strMonth); + iNowDay = Integer.parseInt(strDay); + } + + strSearchDay = Integer.toString(iNowYear); + strSearchDay += DateTypeIntForString(iNowMonth + 1); + strSearchDay += DateTypeIntForString(iNowDay); + + commandMap.put("searchMode", "DAILY"); + commandMap.put("searchDay", strSearchDay); + + resultMap.put("year", iNowYear); + resultMap.put("month", iNowMonth); + resultMap.put("day", iNowDay); + + resultMap.put("resultList", egovIndvdlSchdulManageService.selectIndvdlSchdulManageRetrieve(commandMap)); + + resultVO.setResult(resultMap); + resultVO.setResultCode(ResponseCode.SUCCESS.getCode()); + resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage()); + + return resultVO; + } + + /** + * 일정(주간별) 목록을 조회한다. + * @param commandMap + * @return resultVO + * @throws Exception + */ + @Operation( + summary = "주간별 일정 조회", + description = "일정(주간별) 목록을 조회", + tags = {"EgovIndvdlSchdulManageApiController"} + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "조회 성공"), + @ApiResponse(responseCode = "403", description = "인가된 사용자가 아님") + }) + @GetMapping(value = "/schedule/week") + public ResultVO EgovIndvdlSchdulManageWeekList( + @RequestParam Map commandMap) + throws Exception { + + ResultVO resultVO = new ResultVO(); + Map resultMap = new HashMap(); + + //일정구분 검색 유지 + resultMap.put("searchKeyword", + commandMap.get("searchKeyword") == null ? "" : (String)commandMap.get("searchKeyword")); + resultMap.put("searchCondition", + commandMap.get("searchCondition") == null ? "" : (String)commandMap.get("searchCondition")); + + //공통코드 일정종류 + ComDefaultCodeVO voComCode = new ComDefaultCodeVO(); + voComCode = new ComDefaultCodeVO(); + voComCode.setCodeId("COM030"); + resultMap.put("schdulSe", cmmUseService.selectCmmCodeDetail(voComCode)); + + /* ***************************************************************** + // 캘런더 설정 로직 + ****************************************************************** */ + Calendar calNow = Calendar.getInstance(); + + String strYear = String.valueOf(commandMap.get("year")); + String strMonth = String.valueOf(commandMap.get("month")); + String strDate = String.valueOf(commandMap.get("date")); + + int iNowMonth = calNow.get(Calendar.MONTH); + + if (strYear != null) { + iNowMonth = Integer.parseInt(strMonth); + } + + //프론트에서 넘어온 값은 1월을 0으로 간주하므로 1달 더해 줌 + int realMonth = iNowMonth + 1; + strMonth = String.valueOf(realMonth); + + //자릿수 보정 + strMonth = (strMonth.length() == 1) ? "0" + strMonth : strMonth; + strDate = (strDate.length() == 1) ? "0" + strDate : strDate; + + //시작일자 + String schdulBgnde = strYear + strMonth + strDate; + + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); + Calendar calNext = Calendar.getInstance(); + + calNext.set(Integer.parseInt(strYear), Integer.parseInt(strMonth)-1, Integer.parseInt(strDate)); + + calNext.add(Calendar.DATE, 6); + + //종료일자 + String schdulEndde = dateFormat.format(calNext.getTime()); + + commandMap.put("searchMode", "WEEK"); + + commandMap.put("schdulBgnde", schdulBgnde); + commandMap.put("schdulEndde", schdulEndde); + + resultMap.put("resultList", egovIndvdlSchdulManageService.selectIndvdlSchdulManageRetrieve(commandMap)); + + resultVO.setResult(resultMap); + resultVO.setResultCode(ResponseCode.SUCCESS.getCode()); + resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage()); + + return resultVO; + } + + /** + * 시간을 LIST를 반환한다. + * @return List + * @throws + */ + private List getTimeHH() { + ArrayList listHH = new ArrayList(); + //HashMap hmHHMM; + for (int i = 0; i < 24; i++) { + String sHH = ""; + String strI = String.valueOf(i); + if (i < 10) { + sHH = "0" + strI; + } else { + sHH = strI; + } + + ComDefaultCodeVO codeVO = new ComDefaultCodeVO(); + codeVO.setCode(sHH); + codeVO.setCodeNm(sHH); + + listHH.add(codeVO); + } + + return listHH; + } + + /** + * 분을 LIST를 반환한다. + * @return List + * @throws + */ + private List getTimeMM() { + ArrayList listMM = new ArrayList(); + //HashMap hmHHMM; + for (int i = 0; i < 60; i++) { + + String sMM = ""; + String strI = String.valueOf(i); + if (i < 10) { + sMM = "0" + strI; + } else { + sMM = strI; + } + + ComDefaultCodeVO codeVO = new ComDefaultCodeVO(); + codeVO.setCode(sMM); + codeVO.setCodeNm(sMM); + + listMM.add(codeVO); + } + return listMM; + } + + /** + * 0을 붙여 반환 + * @return String + * @throws + */ + public String DateTypeIntForString(int iInput) { + String sOutput = ""; + if (Integer.toString(iInput).length() == 1) { + sOutput = "0" + Integer.toString(iInput); + } else { + sOutput = Integer.toString(iInput); + } + + return sOutput; + } + +} \ No newline at end of file diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/CmmUseDAO.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/CmmUseDAO.java new file mode 100644 index 0000000..c16e3e1 --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/CmmUseDAO.java @@ -0,0 +1,64 @@ +package com.dbnt.kcscbackend.admin.committee.schedules.repository; + + +import com.dbnt.kcscbackend.admin.committee.schedules.repository.ComDefaultCodeVO; +import com.dbnt.kcscbackend.admin.committee.schedules.service.CmmnDetailCode; +import com.dbnt.kcscbackend.admin.committee.schedules.service.EgovComAbstractDAO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * @Class Name : CmmUseDAO.java + * @Description : 공통코드등 전체 업무에서 공용해서 사용해야 하는 서비스를 정의하기위한 데이터 접근 클래스 + * @Modification Information + * + * 수정일 수정자 수정내용 + * ------- ------- ------------------- + * 2009. 3. 11. 이삼섭 + * + * @author 공통 서비스 개발팀 이삼섭 + * @since 2009. 3. 11. + * @version + * @see + * + */ +@Repository("cmmUseDAO") +public class CmmUseDAO extends EgovComAbstractDAO { + + /** + * 주어진 조건에 따른 공통코드를 불러온다. + * + * @param vo + * @return + * @throws Exception + */ + @SuppressWarnings("unchecked") + public List selectCmmCodeDetail(ComDefaultCodeVO vo) throws Exception { + return (List) list("CmmUseDAO.selectCmmCodeDetail", vo); + } + + /** + * 공통코드로 사용할 조직정보를 를 불러온다. + * + * @param vo + * @return + * @throws Exception + */ + @SuppressWarnings("unchecked") + public List selectOgrnztIdDetail(ComDefaultCodeVO vo) throws Exception { + return (List) list("CmmUseDAO.selectOgrnztIdDetail", vo); + } + + /** + * 공통코드로 사용할그룹정보를 를 불러온다. + * + * @param vo + * @return + * @throws Exception + */ + @SuppressWarnings("unchecked") + public List selectGroupIdDetail(ComDefaultCodeVO vo) throws Exception { + return (List) list("CmmUseDAO.selectGroupIdDetail", vo); + } +} diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/ComDefaultCodeVO.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/ComDefaultCodeVO.java new file mode 100644 index 0000000..75e831f --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/ComDefaultCodeVO.java @@ -0,0 +1,60 @@ +package com.dbnt.kcscbackend.admin.committee.schedules.repository; + +import lombok.Getter; +import lombok.Setter; +import org.apache.commons.lang3.builder.ToStringBuilder; + +import java.io.Serializable; + +/** + * 클래스 + * @author 공통서비스개발팀 이삼섭 + * @since 2009.06.01 + * @version 1.0 + * @see + * + *
+ * << 개정이력(Modification Information) >>
+ *
+ *   수정일      수정자           수정내용
+ *  -------       --------    ---------------------------
+ *   2009.3.11   이삼섭          최초 생성
+ *
+ * 
+ */ +@Getter +@Setter +public class ComDefaultCodeVO implements Serializable { + /** + * serialVersion UID + */ + private static final long serialVersionUID = -2020648489890016404L; + + /** 코드 ID */ + private String codeId = ""; + + /** 상세코드 */ + private String code = ""; + + /** 코드명 */ + private String codeNm = ""; + + /** 코드설명 */ + private String codeDc = ""; + + /** 특정테이블명 */ + private String tableNm = ""; //특정테이블에서 코드정보를추출시 사용 + + /** 상세 조건 여부 */ + private String haveDetailCondition = "N"; + + /** 상세 조건 */ + private String detailCondition = ""; + + /** + * toString 메소드를 대치한다. + */ + public String toString() { + return ToStringBuilder.reflectionToString(this); + } +} diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/ComDefaultVO.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/ComDefaultVO.java new file mode 100644 index 0000000..7179481 --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/ComDefaultVO.java @@ -0,0 +1,68 @@ +package com.dbnt.kcscbackend.admin.committee.schedules.repository; + +import lombok.Getter; +import lombok.Setter; +import org.apache.commons.lang3.builder.ToStringBuilder; + +import java.io.Serializable; + +/** + * @Class Name : ComDefaultVO.java + * @Description : ComDefaultVO class + * @Modification Information + * @ + * @ 수정일 수정자 수정내용 + * @ ------- -------- --------------------------- + * @ 2009.02.01 조재영 최초 생성 + * + * @author 공통서비스 개발팀 조재영 + * @since 2009.02.01 + * @version 1.0 + * @see + * + */ +@Getter +@Setter +public class ComDefaultVO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** 검색조건 */ + private String searchCondition = ""; + + /** 검색Keyword */ + private String searchKeyword = ""; + + /** 검색사용여부 */ + private String searchUseYn = ""; + + /** 현재페이지 */ + private int pageIndex = 1; + + /** 페이지갯수 */ + private int pageUnit = 10; + + /** 페이지사이즈 */ + private int pageSize = 10; + + /** firstIndex */ + private int firstIndex = 1; + + /** lastIndex */ + private int lastIndex = 1; + + /** recordCountPerPage */ + private int recordCountPerPage = 10; + + /** 검색KeywordFrom */ + private String searchKeywordFrom = ""; + + /** 검색KeywordTo */ + private String searchKeywordTo = ""; + + public String toString() { + return ToStringBuilder.reflectionToString(this); + } + + +} diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/FileManageDAO.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/FileManageDAO.java new file mode 100644 index 0000000..afacb80 --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/FileManageDAO.java @@ -0,0 +1,182 @@ +package com.dbnt.kcscbackend.admin.committee.schedules.repository; + +import com.dbnt.kcscbackend.admin.committee.schedules.repository.FileVO; +import com.dbnt.kcscbackend.admin.committee.schedules.service.EgovComAbstractDAO; +import org.springframework.stereotype.Repository; + +import java.util.Iterator; +import java.util.List; + +/** + * @Class Name : EgovFileMngDAO.java + * @Description : 파일정보 관리를 위한 데이터 처리 클래스 + * @Modification Information + * + * 수정일 수정자 수정내용 + * ------- ------- ------------------- + * 2009. 3. 25. 이삼섭 최초생성 + * + * @author 공통 서비스 개발팀 이삼섭 + * @since 2009. 3. 25. + * @version + * @see + * + */ +@Repository("FileManageDAO") +public class FileManageDAO extends EgovComAbstractDAO { + + /** + * 여러 개의 파일에 대한 정보(속성 및 상세)를 등록한다. + * + * @param fileList + * @return + * @throws Exception + */ + public String insertFileInfs(List fileList) throws Exception { + FileVO vo = (FileVO) fileList.get(0); + String atchFileId = vo.getAtchFileId(); + + insert("FileManageDAO.insertFileMaster", vo); + + Iterator iter = fileList.iterator(); + while (iter.hasNext()) { + vo = (FileVO) iter.next(); + + insert("FileManageDAO.insertFileDetail", vo); + } + + return atchFileId; + } + + /** + * 하나의 파일에 대한 정보(속성 및 상세)를 등록한다. + * + * @param vo + * @throws Exception + */ + public void insertFileInf(FileVO vo) throws Exception { + insert("FileManageDAO.insertFileMaster", vo); + insert("FileManageDAO.insertFileDetail", vo); + } + + /** + * 여러 개의 파일에 대한 정보(속성 및 상세)를 수정한다. + * + * @param fileList + * @throws Exception + */ + public void updateFileInfs(List fileList) throws Exception { + FileVO vo; + Iterator iter = fileList.iterator(); + while (iter.hasNext()) { + vo = (FileVO) iter.next(); + + insert("FileManageDAO.insertFileDetail", vo); + } + } + + /** + * 여러 개의 파일을 삭제한다. + * + * @param fileList + * @throws Exception + */ + public void deleteFileInfs(List fileList) throws Exception { + Iterator iter = fileList.iterator(); + FileVO vo; + while (iter.hasNext()) { + vo = (FileVO) iter.next(); + + delete("FileManageDAO.deleteFileDetail", vo); + } + } + + /** + * 하나의 파일을 삭제한다. + * + * @param fvo + * @throws Exception + */ + public void deleteFileInf(FileVO fvo) throws Exception { + delete("FileManageDAO.deleteFileDetail", fvo); + } + + /** + * 파일에 대한 목록을 조회한다. + * + * @param vo + * @return + * @throws Exception + */ + @SuppressWarnings("unchecked") + public List selectFileInfs(FileVO vo) throws Exception { + return (List) list("FileManageDAO.selectFileList", vo); + } + + /** + * 파일 구분자에 대한 최대값을 구한다. + * + * @param fvo + * @return + * @throws Exception + */ + public int getMaxFileSN(FileVO fvo) throws Exception { + return (Integer) selectOne("FileManageDAO.getMaxFileSN", fvo); + } + + /** + * 파일에 대한 상세정보를 조회한다. + * + * @param fvo + * @return + * @throws Exception + */ + public FileVO selectFileInf(FileVO fvo) throws Exception { + return (FileVO) selectOne("FileManageDAO.selectFileInf", fvo); + } + + /** + * 전체 파일을 삭제한다. + * + * @param fvo + * @throws Exception + */ + public void deleteAllFileInf(FileVO fvo) throws Exception { + update("FileManageDAO.deleteCOMTNFILE", fvo); + } + + /** + * 파일명 검색에 대한 목록을 조회한다. + * + * @param vo + * @return + * @throws Exception + */ + @SuppressWarnings("unchecked") + public List selectFileListByFileNm(FileVO fvo) throws Exception { + return (List) list("FileManageDAO.selectFileListByFileNm", fvo); + } + + /** + * 파일명 검색에 대한 목록 전체 건수를 조회한다. + * + * @param fvo + * @return + * @throws Exception + */ + public int selectFileListCntByFileNm(FileVO fvo) throws Exception { + return (Integer) selectOne("FileManageDAO.selectFileListCntByFileNm", fvo); + } + + /** + * 이미지 파일에 대한 목록을 조회한다. + * + * @param vo + * @return + * @throws Exception + */ + @SuppressWarnings("unchecked") + public List selectImageFileList(FileVO vo) throws Exception { + return (List) list("FileManageDAO.selectImageFileList", vo); + } +} diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/FileVO.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/FileVO.java new file mode 100644 index 0000000..c7a9e03 --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/FileVO.java @@ -0,0 +1,69 @@ +package com.dbnt.kcscbackend.admin.committee.schedules.repository; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; +import org.apache.commons.lang3.builder.ToStringBuilder; + +import java.io.Serializable; + +/** + * @Class Name : FileVO.java + * @Description : 파일정보 처리를 위한 VO 클래스 + * @Modification Information + * + * 수정일 수정자 수정내용 + * ------- ------- ------------------- + * 2009. 3. 25. 이삼섭 + * + * @author 공통 서비스 개발팀 이삼섭 + * @since 2009. 3. 25. + * @version + * @see + * + */ +@Schema(description = "파일 정보 VO") +@Getter +@Setter +public class FileVO implements Serializable { + + /** + * serialVersion UID + */ + private static final long serialVersionUID = -287950405903719128L; + + @Schema(description = "첨부파일 아이디") + public String atchFileId = ""; + + @Schema(description = "생성일자") + public String creatDt = ""; + + @Schema(description = "파일내용") + public String fileCn = ""; + + @Schema(description = "파일확장자") + public String fileExtsn = ""; + + @Schema(description = "파일크기") + public String fileMg = ""; + + @Schema(description = "파일연번") + public String fileSn = ""; + + @Schema(description = "파일저장경로") + public String fileStreCours = ""; + + @Schema(description = "원파일명") + public String orignlFileNm = ""; + + @Schema(description = "저장파일명") + public String streFileNm = ""; + + /** + * toString 메소드를 대치한다. + */ + public String toString() { + return ToStringBuilder.reflectionToString(this); + } + +} diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/IndvdlSchdulManageDao.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/IndvdlSchdulManageDao.java new file mode 100644 index 0000000..92c4c08 --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/IndvdlSchdulManageDao.java @@ -0,0 +1,122 @@ +package com.dbnt.kcscbackend.admin.committee.schedules.repository; + +import org.egovframe.rte.psl.dataaccess.EgovAbstractMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +/** + * 일정관리를 처리하는 Dao Class 구현 + * @since 2009.04.10 + * @see + *
+ * << 개정이력(Modification Information) >>  수정일      수정자           수정내용 -------    ---
+ * -----    --------------------------- 2009.04.10  장동한          최초 생성 2011.05.31
+ * JJY           경량환경 커스터마이징버전 생성
+ * 
+ * @author 조재영 + * @version 1.0 + * @created 09-6-2011 오전 10:08:07 + */ +@Repository("indvdlSchdulManageDao") +public class IndvdlSchdulManageDao extends EgovAbstractMapper { + + + /** + * 메인페이지/일정관리조회 목록을 Map(map)형식으로 조회한다. + * @param map + * @return + * @throws Exception + */ + public List selectIndvdlSchdulManageMainList(Map map) throws Exception { + return list("IndvdlSchdulManage.selectIndvdlSchdulManageMainList", map); + } + + + /** + * 일정 목록을 Map(map)형식으로 조회한다. + * @param map + * @return + * @throws Exception + */ + public List selectIndvdlSchdulManageRetrieve(Map map) throws Exception { + return list("IndvdlSchdulManage.selectIndvdlSchdulManageRetrieve", map); + } + + /** + * 일정 목록을 VO(model)형식으로 조회한다. + * @param indvdlSchdulManageVO - 조회할 정보가 담긴 VO + * @return IndvdlSchdulManageVO + * @throws Exception + */ + public IndvdlSchdulManageVO selectIndvdlSchdulManageDetailVO(IndvdlSchdulManageVO indvdlSchdulManageVO) + throws Exception { + return (IndvdlSchdulManageVO)selectOne("IndvdlSchdulManage.selectIndvdlSchdulManageDetailVO", + indvdlSchdulManageVO); + } + + /** + * 일정 목록을 조회한다. + * @param searchVO - 조회할 정보가 담긴 VO + * @return List + * @throws Exception + */ + public List selectIndvdlSchdulManageList(ComDefaultVO searchVO) throws Exception { + return list("IndvdlSchdulManage.selectIndvdlSchdulManage", searchVO); + } + + /** + * 일정를(을) 상세조회 한다. + * @param indvdlSchdulManageVO - 일정 정보 담김 VO + * @return List + * @throws Exception + */ + // public List selectIndvdlSchdulManageDetail(IndvdlSchdulManageVO indvdlSchdulManageVO) throws Exception{ + // return list("IndvdlSchdulManage.selectIndvdlSchdulManageDetail", indvdlSchdulManageVO); + //} + public IndvdlSchdulManageVO selectIndvdlSchdulManageDetail(IndvdlSchdulManageVO indvdlSchdulManageVO) throws Exception { + return selectOne("IndvdlSchdulManage.selectIndvdlSchdulManageDetailVO", indvdlSchdulManageVO); + } + + /** + * 일정를(을) 목록 전체 건수를(을) 조회한다. + * @param searchVO - 조회할 정보가 담긴 VO + * @return int + * @throws Exception + */ + public int selectIndvdlSchdulManageListCnt(ComDefaultVO searchVO) throws Exception { + return (Integer)selectOne("IndvdlSchdulManage.selectIndvdlSchdulManageCnt", searchVO); + } + + + /** + * 일정를(을) 등록한다. + * @param indvdlSchdulManageVO + * @throws Exception + */ + public void insertIndvdlSchdulManage(IndvdlSchdulManageVO indvdlSchdulManageVO) throws Exception { + insert("IndvdlSchdulManage.insertIndvdlSchdulManage", indvdlSchdulManageVO); + } + + /** + * 일정를(을) 수정한다. + * @param indvdlSchdulManageVO - 일정 정보 담김 VO + * @throws Exception + */ + public void updateIndvdlSchdulManage(IndvdlSchdulManageVO indvdlSchdulManageVO) throws Exception { + insert("IndvdlSchdulManage.updateIndvdlSchdulManage", indvdlSchdulManageVO); + } + + /** + * 일정를(을) 삭제한다. + * @param indvdlSchdulManageVO - 일정 정보 담김 VO + * @throws Exception + */ + public void deleteIndvdlSchdulManage(IndvdlSchdulManageVO indvdlSchdulManageVO) throws Exception { + // 일지 삭제 + //delete("IndvdlSchdulManage.deleteDiaryManage", indvdlSchdulManageVO); + // 일정관리 삭제 + delete("IndvdlSchdulManage.deleteIndvdlSchdulManage", indvdlSchdulManageVO); + } +} diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/IndvdlSchdulManageVO.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/IndvdlSchdulManageVO.java new file mode 100644 index 0000000..a33aa76 --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/IndvdlSchdulManageVO.java @@ -0,0 +1,106 @@ +package com.dbnt.kcscbackend.admin.committee.schedules.repository; + +import lombok.Getter; +import lombok.Setter; + +import java.io.Serializable; + +/** + * 일정관리 VO Class 구현 + * @since 2009.04.10 + * @see + *
+ * << 개정이력(Modification Information) >>  수정일      수정자           수정내용 -------    ---
+ * -----    --------------------------- 2009.04.10  장동한          최초 생성 2011.05.31
+ * JJY           경량환경 커스터마이징버전 생성
+ * 
+ * @author 조재영 + * @version 1.0 + * @created 09-6-2011 오전 10:08:07 + */ +@Getter +@Setter +public class IndvdlSchdulManageVO implements Serializable { + + /** + * serialVersionUID + */ + private static final long serialVersionUID = 1L; + + /** 일정ID */ + private String schdulId; + + /** 일정구분(회의/교육/세미나/강의 기타) */ + private String schdulSe; + + /** 일정부서ID */ + private String schdulDeptId; + + /** 일정종류(부서일정/개인일정) */ + private String schdulKindCode; + + /** 일정시작일자 */ + private String schdulBgnde; + + /** 일정종료일자 */ + private String schdulEndde; + + /** 일정명 */ + private String schdulNm; + + /** 일정내용 */ + private String schdulCn; + + /** 일정장소 */ + private String schdulPlace; + + /** 일정중요도코드 */ + private String schdulIpcrCode; + + /** 일정담담자ID */ + private String schdulChargerId; + + /** 첨부파일ID */ + private String atchFileId; + + /** 반복구분(반복, 연속, 요일반복) */ + private String reptitSeCode; + + /** 최초등록시점 */ + private String frstRegisterPnttm = ""; + + /** 최초등록자ID */ + private String frstRegisterId = ""; + + /** 최종수정시점 */ + private String lastUpdusrPnttm = ""; + + /** 최종수정ID */ + private String lastUpdusrId = ""; + + /** 일정시작일자(시간) */ + private String schdulBgndeHH = ""; + + /** 일정시작일자(분) */ + private String schdulBgndeMM = ""; + + /** 일정종료일자(시간) */ + private String schdulEnddeHH = ""; + + /** 일정종료일자(분) */ + private String schdulEnddeMM = ""; + + /** 일정시작일자(Year/Month/Day) */ + private String schdulBgndeYYYMMDD = ""; + + /** 일정종료일자(Year/Month/Day) */ + private String schdulEnddeYYYMMDD = ""; + + /** 담당부서 */ + private String schdulDeptName = ""; + + /** 담당자명 */ + private String schdulChargerName = ""; + + +} diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/LoginVO.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/LoginVO.java new file mode 100644 index 0000000..ba891bc --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/LoginVO.java @@ -0,0 +1,79 @@ +package com.dbnt.kcscbackend.admin.committee.schedules.repository; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +import javax.validation.constraints.Email; +import java.io.Serializable; + +/** + * @Class Name : LoginVO.java + * @Description : Login VO class + * @Modification Information + * @ + * @ 수정일 수정자 수정내용 + * @ ------- -------- --------------------------- + * @ 2009.03.03 박지욱 최초 생성 + * + * @author 공통서비스 개발팀 박지욱 + * @since 2009.03.03 + * @version 1.0 + * @see + * + */ +@Schema(description = "사용자 정보 VO") +@Getter +@Setter +public class LoginVO implements Serializable{ + + /** + * + */ + private static final long serialVersionUID = -8274004534207618049L; + + @Schema(description = "아이디") + private String id; + + @Schema(description = "이름") + private String name; + + @Schema(description = "주민등록번호") + private String ihidNum; + + @Email(regexp = "[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,3}") + @Schema(description = "이메일주소") + private String email; + + @Schema(description = "비밀번호") + private String password; + + @Schema(description = "비밀번호 힌트") + private String passwordHint; + + @Schema(description = "비밀번호 정답") + private String passwordCnsr; + + @Schema(description = "사용자 구분", allowableValues = {"GNR", "ENT", "USR"}, defaultValue = "USR") + private String userSe; + + @Schema(description = "조직(부서)ID") + private String orgnztId; + + @Schema(description = "조직(부서)명") + private String orgnztNm; + + @Schema(description = "고유아이디") + private String uniqId; + + @Schema(description = "로그인 후 이동할 페이지") + private String url; + + @Schema(description = "사용자 IP정보") + private String ip; + + @Schema(description = "GPKI인증 DN") + private String dn; + + +} diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/ResponseCode.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/ResponseCode.java new file mode 100644 index 0000000..bbe0674 --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/ResponseCode.java @@ -0,0 +1,50 @@ +package com.dbnt.kcscbackend.admin.committee.schedules.repository; + +/** + * + * @author : 정완배 + * @since : 2023. 8. 9. + * @version : 1.0 + * + * @package : egovframework.com.cmm + * @filename : ResponseCode.java + * @modificationInformation + * + *
+ * << 개정이력(Modification Information) >>
+ *
+ *  수정일            수정자             수정내용
+ *  ----------   ----------   ----------------------
+ *  2023. 8. 9.    정완배          주석추가
+ * 
+ * + * + */ +public enum ResponseCode { + + SUCCESS(200, "성공했습니다."), + AUTH_ERROR(403, "인가된 사용자가 아닙니다."), + DELETE_ERROR(700, "삭제 중 내부 오류가 발생했습니다."), + SAVE_ERROR(800, "저장시 내부 오류가 발생했습니다."), + INPUT_CHECK_ERROR(900, "입력값 무결성 오류 입니다."); + + private int code; + private String message; + + private ResponseCode(int code, String message) { + this.code = code; + this.message = message; + } + + public int getCode() { + return code; + } + + public String getMessage() { + return message; + } + + + + +} diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/ResultVO.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/ResultVO.java new file mode 100644 index 0000000..432909d --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/repository/ResultVO.java @@ -0,0 +1,52 @@ +package com.dbnt.kcscbackend.admin.committee.schedules.repository; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +import java.util.HashMap; +import java.util.Map; + +/** + * + * @author : 정완배 + * @since : 2023. 8. 9. + * @version : 1.0 + * + * @package : egovframework.com.cmm.service + * @filename : ResultVO.java + * @modificationInformation + * + *
+ * << 개정이력(Modification Information) >>
+ *
+ *  수정일            수정자             수정내용
+ *  ----------   ----------   ----------------------
+ *  2023. 8. 9.    정완배             주석추가
+ * 
+ * + * + */ + +@Schema(description = "응답 객체 VO") +@Getter +@Setter +public class ResultVO { + + @Schema(description = "응답 코드") + private int resultCode = 0; + + @Schema(description = "응답 메시지") + private String resultMessage = "OK"; + private Map result = new HashMap(); + + public void putResult(String key, Object value) { + result.put(key, value); + } + + public Object getResult(String key) { + return this.result.get(key); + } + + +} diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/CmmnDetailCode.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/CmmnDetailCode.java new file mode 100644 index 0000000..500160e --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/CmmnDetailCode.java @@ -0,0 +1,70 @@ +package com.dbnt.kcscbackend.admin.committee.schedules.service; + +import lombok.Getter; +import lombok.Setter; + +import java.io.Serializable; + +/** + * 공통상세코드 모델 클래스 + * @author 공통서비스 개발팀 이중호 + * @since 2009.04.01 + * @version 1.0 + * @see + * + *
+ * << 개정이력(Modification Information) >>
+ *
+ *   수정일      수정자           수정내용
+ *  -------    --------    ---------------------------
+ *   2009.04.01  이중호          최초 생성
+ *
+ * 
+ */ +@Getter +@Setter +public class CmmnDetailCode implements Serializable { + + private static final long serialVersionUID = -6508801327314181679L; + + /* + * 코드ID + */ + private String codeId = ""; + + /* + * 코드ID명 + */ + private String codeIdNm = ""; + + /* + * 코드 + */ + private String code = ""; + + /* + * 코드명 + */ + private String codeNm = ""; + + /* + * 코드설명 + */ + private String codeDc = ""; + + /* + * 사용여부 + */ + private String useAt = ""; + + /* + * 최초등록자ID + */ + private String frstRegisterId = ""; + + /* + * 최종수정자ID + */ + private String lastUpdusrId = ""; + +} diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovCmmUseService.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovCmmUseService.java new file mode 100644 index 0000000..7918c32 --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovCmmUseService.java @@ -0,0 +1,63 @@ +package com.dbnt.kcscbackend.admin.committee.schedules.service; + + +import com.dbnt.kcscbackend.admin.committee.schedules.repository.ComDefaultCodeVO; + +import java.util.List; +import java.util.Map; + +/** + * + * 공통코드등 전체 업무에서 공용해서 사용해야 하는 서비스를 정의하기 위한 서비스 인터페이스 + * @author 공통서비스 개발팀 이삼섭 + * @since 2009.04.01 + * @version 1.0 + * @see + * + *
+ * << 개정이력(Modification Information) >>
+ *
+ *   수정일      수정자           수정내용
+ *  -------    --------    ---------------------------
+ *   2009.03.11  이삼섭          최초 생성
+ *
+ * 
+ */ +public interface EgovCmmUseService { + + /** + * 공통코드를 조회한다. + * + * @param vo + * @return List(코드) + * @throws Exception + */ + public List selectCmmCodeDetail(ComDefaultCodeVO vo) throws Exception; + + /** + * ComDefaultCodeVO의 리스트를 받아서 여러개의 코드 리스트를 맵에 담아서 리턴한다. + * + * @param voList + * @return Map(코드) + * @throws Exception + */ + public Map> selectCmmCodeDetails(List voList) throws Exception; + + /** + * 조직정보를 코드형태로 리턴한다. + * + * @param 조회조건정보 vo + * @return 조직정보 List + * @throws Exception + */ + public List selectOgrnztIdDetail(ComDefaultCodeVO vo) throws Exception; + + /** + * 그룹정보를 코드형태로 리턴한다. + * + * @param 조회조건정보 vo + * @return 그룹정보 List + * @throws Exception + */ + public List selectGroupIdDetail(ComDefaultCodeVO vo) throws Exception; +} diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovCmmUseServiceImpl.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovCmmUseServiceImpl.java new file mode 100644 index 0000000..796c5be --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovCmmUseServiceImpl.java @@ -0,0 +1,92 @@ +package com.dbnt.kcscbackend.admin.committee.schedules.service; + + +import com.dbnt.kcscbackend.admin.committee.schedules.repository.CmmUseDAO; +import com.dbnt.kcscbackend.admin.committee.schedules.repository.ComDefaultCodeVO; +import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * @Class Name : EgovCmmUseServiceImpl.java + * @Description : 공통코드등 전체 업무에서 공용해서 사용해야 하는 서비스를 정의하기위한 서비스 구현 클래스 + * @Modification Information + * + * 수정일 수정자 수정내용 + * ------- ------- ------------------- + * 2009. 3. 11. 이삼섭 + * + * @author 공통 서비스 개발팀 이삼섭 + * @since 2009. 3. 11. + * @version + * @see + * + */ +@Service("EgovCmmUseService") +public class EgovCmmUseServiceImpl extends EgovAbstractServiceImpl implements EgovCmmUseService { + + @Resource(name = "cmmUseDAO") + private CmmUseDAO cmmUseDAO; + + /** + * 공통코드를 조회한다. + * + * @param vo + * @return + * @throws Exception + */ + @Override + public List selectCmmCodeDetail(ComDefaultCodeVO vo) throws Exception { + return cmmUseDAO.selectCmmCodeDetail(vo); + } + + /** + * ComDefaultCodeVO의 리스트를 받아서 여러개의 코드 리스트를 맵에 담아서 리턴한다. + * + * @param voList + * @return + * @throws Exception + */ + @Override + public Map> selectCmmCodeDetails(List voList) throws Exception { + ComDefaultCodeVO vo; + Map> map = new HashMap>(); + + Iterator iter = voList.iterator(); + while (iter.hasNext()) { + vo = (ComDefaultCodeVO) iter.next(); + map.put(vo.getCodeId(), cmmUseDAO.selectCmmCodeDetail(vo)); + } + + return map; + } + + /** + * 조직정보를 코드형태로 리턴한다. + * + * @param 조회조건정보 vo + * @return 조직정보 List + * @throws Exception + */ + @Override + public List selectOgrnztIdDetail(ComDefaultCodeVO vo) throws Exception { + return cmmUseDAO.selectOgrnztIdDetail(vo); + } + + /** + * 그룹정보를 코드형태로 리턴한다. + * + * @param 조회조건정보 vo + * @return 그룹정보 List + * @throws Exception + */ + @Override + public List selectGroupIdDetail(ComDefaultCodeVO vo) throws Exception { + return cmmUseDAO.selectGroupIdDetail(vo); + } +} diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovComAbstractDAO.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovComAbstractDAO.java new file mode 100644 index 0000000..5d7cae5 --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovComAbstractDAO.java @@ -0,0 +1,32 @@ +package com.dbnt.kcscbackend.admin.committee.schedules.service; + +import org.apache.ibatis.session.SqlSessionFactory; +import org.egovframe.rte.psl.dataaccess.EgovAbstractMapper; + +import javax.annotation.Resource; + +/** + * EgovComAbstractDAO.java 클래스 + * + * @author 서준식 + * @since 2011. 9. 23. + * @version 1.0 + * @see + * + *
+ * << 개정이력(Modification Information) >>
+ *
+ *   수정일      수정자           수정내용
+ *  -------    -------------    ----------------------
+ *   2011. 9. 23.   서준식        최초 생성
+ * 
+ */ +public abstract class EgovComAbstractDAO extends EgovAbstractMapper { + + @Override + @Resource(name = "egov.sqlSession") + public void setSqlSessionFactory(SqlSessionFactory sqlSession) { + super.setSqlSessionFactory(sqlSession); + } + +} diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovFileMngService.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovFileMngService.java new file mode 100644 index 0000000..43be25d --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovFileMngService.java @@ -0,0 +1,117 @@ +package com.dbnt.kcscbackend.admin.committee.schedules.service; + +import com.dbnt.kcscbackend.admin.committee.schedules.repository.FileVO; + +import java.util.List; +import java.util.Map; + +/** + * @Class Name : EgovFileMngService.java + * @Description : 파일정보의 관리를 위한 서비스 인터페이스 + * @Modification Information + * + * 수정일 수정자 수정내용 + * ------- ------- ------------------- + * 2009. 3. 25. 이삼섭 최초생성 + * + * @author 공통 서비스 개발팀 이삼섭 + * @since 2009. 3. 25. + * @version + * @see + * + */ +public interface EgovFileMngService { + + /** + * 파일에 대한 목록을 조회한다. + * + * @param fvo + * @return + * @throws Exception + */ + public List selectFileInfs(FileVO fvo) throws Exception; + + /** + * 하나의 파일에 대한 정보(속성 및 상세)를 등록한다. + * + * @param fvo + * @throws Exception + */ + public String insertFileInf(FileVO fvo) throws Exception; + + /** + * 여러 개의 파일에 대한 정보(속성 및 상세)를 등록한다. + * + * @param fvoList + * @throws Exception + */ + public String insertFileInfs(List fvoList) throws Exception; + + /** + * 여러 개의 파일에 대한 정보(속성 및 상세)를 수정한다. + * + * @param fvoList + * @throws Exception + */ + public void updateFileInfs(List fvoList) throws Exception; + + /** + * 여러 개의 파일을 삭제한다. + * + * @param fvoList + * @throws Exception + */ + public void deleteFileInfs(List fvoList) throws Exception; + + /** + * 하나의 파일을 삭제한다. + * + * @param fvo + * @throws Exception + */ + public void deleteFileInf(FileVO fvo) throws Exception; + + /** + * 파일에 대한 상세정보를 조회한다. + * + * @param fvo + * @return + * @throws Exception + */ + public FileVO selectFileInf(FileVO fvo) throws Exception; + + /** + * 파일 구분자에 대한 최대값을 구한다. + * + * @param fvo + * @return + * @throws Exception + */ + public int getMaxFileSN(FileVO fvo) throws Exception; + + /** + * 전체 파일을 삭제한다. + * + * @param fvo + * @throws Exception + */ + public void deleteAllFileInf(FileVO fvo) throws Exception; + + /** + * 파일명 검색에 대한 목록을 조회한다. + * + * @param fvo + * @return + * @throws Exception + */ + public Map selectFileListByFileNm(FileVO fvo) throws Exception; + + /** + * 이미지 파일에 대한 목록을 조회한다. + * + * @param vo + * @return + * @throws Exception + */ + public List selectImageFileList(FileVO vo) throws Exception; +} diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovFileMngServiceImpl.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovFileMngServiceImpl.java new file mode 100644 index 0000000..dcac5c2 --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovFileMngServiceImpl.java @@ -0,0 +1,177 @@ +package com.dbnt.kcscbackend.admin.committee.schedules.service; + +import com.dbnt.kcscbackend.admin.committee.schedules.repository.FileManageDAO; +import com.dbnt.kcscbackend.admin.committee.schedules.repository.FileVO; +import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Class Name : EgovFileMngServiceImpl.java + * @Description : 파일정보의 관리를 위한 구현 클래스 + * @Modification Information + * + * 수정일 수정자 수정내용 + * ------- ------- ------------------- + * 2009. 3. 25. 이삼섭 최초생성 + * + * @author 공통 서비스 개발팀 이삼섭 + * @since 2009. 3. 25. + * @version + * @see + * + */ +@Service("EgovFileMngService") +public class EgovFileMngServiceImpl extends EgovAbstractServiceImpl implements EgovFileMngService { + + @Resource(name = "FileManageDAO") + private FileManageDAO fileMngDAO; + + + /** + * 여러 개의 파일을 삭제한다. + * @param fvoList + * @throws Exception + */ + @Override + public void deleteFileInfs(List fvoList) throws Exception { + fileMngDAO.deleteFileInfs(fvoList); + } + + + /** + * 하나의 파일에 대한 정보(속성 및 상세)를 등록한다. + * @param fvo + * @return + * @throws Exception + */ + @Override + public String insertFileInf(FileVO fvo) throws Exception { + String atchFileId = fvo.getAtchFileId(); + + fileMngDAO.insertFileInf(fvo); + + return atchFileId; + } + + + /** + * 여러 개의 파일에 대한 정보(속성 및 상세)를 등록한다. + * @param fvoList + * @return + * @throws Exception + */ + @Override + public String insertFileInfs(List fvoList) throws Exception { + String atchFileId = ""; + + if (fvoList.size() != 0) { + atchFileId = fileMngDAO.insertFileInfs(fvoList); + } + if("".equals(atchFileId)){ + atchFileId = null; + } + return atchFileId; + } + + + /** + * 파일에 대한 목록을 조회한다. + * @param fvo + * @return + * @throws Exception + */ + @Override + public List selectFileInfs(FileVO fvo) throws Exception { + return fileMngDAO.selectFileInfs(fvo); + } + + /** + * 여러 개의 파일에 대한 정보(속성 및 상세)를 수정한다. + * @param fvoList + * @throws Exception + */ + @Override + public void updateFileInfs(List fvoList) throws Exception { + //Delete & Insert + fileMngDAO.updateFileInfs(fvoList); + } + + /** + * 하나의 파일을 삭제한다. + * @param fvo + * @throws Exception + */ + @Override + public void deleteFileInf(FileVO fvo) throws Exception { + fileMngDAO.deleteFileInf(fvo); + } + + /** + * 파일에 대한 상세정보를 조회한다. + * @param fvo + * @return + * @throws Exception + */ + @Override + public FileVO selectFileInf(FileVO fvo) throws Exception { + return fileMngDAO.selectFileInf(fvo); + } + + /** + * 파일 구분자에 대한 최대값을 구한다. + * @param fvo + * @return + * @throws Exception + */ + @Override + public int getMaxFileSN(FileVO fvo) throws Exception { + return fileMngDAO.getMaxFileSN(fvo); + } + + + /** + * 전체 파일을 삭제한다. + * @param fvo + * @throws Exception + */ + @Override + public void deleteAllFileInf(FileVO fvo) throws Exception { + fileMngDAO.deleteAllFileInf(fvo); + } + + + /** + * 파일명 검색에 대한 목록을 조회한다. + * @param fvo + * @return + * @throws Exception + */ + @Override + public Map selectFileListByFileNm(FileVO fvo) throws Exception { + List result = fileMngDAO.selectFileListByFileNm(fvo); + int cnt = fileMngDAO.selectFileListCntByFileNm(fvo); + + Map map = new HashMap(); + + map.put("resultList", result); + map.put("resultCnt", Integer.toString(cnt)); + + return map; + } + + /** + * 이미지 파일에 대한 목록을 조회한다. + * @param vo + * @return + * @throws Exception + */ + @Override + public List selectImageFileList(FileVO vo) throws Exception { + return fileMngDAO.selectImageFileList(vo); + } +} 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 new file mode 100644 index 0000000..7cadbfc --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovIndvdlSchdulManageService.java @@ -0,0 +1,105 @@ +package com.dbnt.kcscbackend.admin.committee.schedules.service; + + +import com.dbnt.kcscbackend.admin.committee.schedules.repository.ComDefaultVO; +import com.dbnt.kcscbackend.admin.committee.schedules.repository.IndvdlSchdulManageVO; + +import java.util.List; +import java.util.Map; + +/** + * 일정관리를 처리하는 서비스인터페이스 클래스 + * @since 2009.04.10 + * @see + *
+ * << 개정이력(Modification Information) >>
+ *   수정일      수정자           수정내용
+ *   -------    --------    ---------------------------
+ *   2009.04.10  장동한          최초 생성
+ *   2011.05.31  JJY           경량환경 커스터마이징버전 생성
+ * 
+ * @author 조재영 + * @version 1.0 + * @created 09-6-2011 오전 10:08:04 + */ +public interface EgovIndvdlSchdulManageService { + + /** + * 일정를(을) 삭제한다. + * + * @param indvdlSchdulManageVO - 일정 정보 담김 VO + * @exception Exception Exception + */ + public void deleteIndvdlSchdulManage(IndvdlSchdulManageVO indvdlSchdulManageVO) throws Exception; + + /** + * 일정를(을) 등록한다. + * + * @param indvdlSchdulManageVO - 일정 정보 담김 VO + * @exception Exception Exception + */ + public void insertIndvdlSchdulManage(IndvdlSchdulManageVO indvdlSchdulManageVO) throws Exception; + + /** + * 일정를(을) 상세조회 한다. + * @return List + * + * @param indvdlSchdulManageVO - 일정 정보 담김 VO + * @exception Exception Exception + */ + public IndvdlSchdulManageVO selectIndvdlSchdulManageDetail(IndvdlSchdulManageVO indvdlSchdulManageVO) throws Exception; + + /** + * 일정 목록을 VO(model)형식으로 조회한다. + * @return List + * + * @param indvdlSchdulManageVO - 조회할 정보가 담긴 VO + * @exception Exception Exception + */ + public IndvdlSchdulManageVO selectIndvdlSchdulManageDetailVO(IndvdlSchdulManageVO indvdlSchdulManageVO) throws Exception; + + /** + * 일정 목록을 조회한다. + * @return List + * + * @param searchVO - 조회할 정보가 담긴 VO + * @exception Exception Exception + */ + public List selectIndvdlSchdulManageList(ComDefaultVO searchVO) throws Exception; + + /** + * 일정를(을) 목록 전체 건수를(을) 조회한다. + * @return int + * + * @param searchVO - 조회할 정보가 담긴 VO + * @exception Exception Exception + */ + public int selectIndvdlSchdulManageListCnt(ComDefaultVO searchVO) throws Exception; + + /** + * 메인페이지/일정관리조회 + * @return List + * + * @param map - 조회할 정보가 담긴 map + * @exception Exception Exception + */ + public List selectIndvdlSchdulManageMainList(Map map) throws Exception; + + /** + * 일정 목록을 Map(map)형식으로 조회한다. + * @param Map(map) - 조회할 정보가 담긴 Map + * @return List + * + * @param map + * @exception Exception Exception + */ + public List selectIndvdlSchdulManageRetrieve(Map map) throws Exception; + + /** + * 일정를(을) 수정한다. + * + * @param indvdlSchdulManageVO - 일정 정보 담김 VO + * @exception Exception Exception + */ + public void updateIndvdlSchdulManage(IndvdlSchdulManageVO indvdlSchdulManageVO) throws Exception; +} \ No newline at end of file diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovIndvdlSchdulManageServiceImpl.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovIndvdlSchdulManageServiceImpl.java new file mode 100644 index 0000000..a5e8a97 --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/EgovIndvdlSchdulManageServiceImpl.java @@ -0,0 +1,134 @@ +package com.dbnt.kcscbackend.admin.committee.schedules.service; + + +import com.dbnt.kcscbackend.admin.committee.schedules.repository.ComDefaultVO; +import com.dbnt.kcscbackend.admin.committee.schedules.repository.IndvdlSchdulManageDao; +import com.dbnt.kcscbackend.admin.committee.schedules.repository.IndvdlSchdulManageVO; +import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; +import org.egovframe.rte.fdl.idgnr.EgovIdGnrService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +/** + * 일정관리를 처리하는 ServiceImpl Class 구현 + * @since 2009.04.10 + * @see + *
+ * << 개정이력(Modification Information) >>  수정일      수정자           수정내용 -------    ---
+ * -----    --------------------------- 2009.04.10  장동한          최초 생성 2011.05.31
+ * JJY           경량환경 커스터마이징버전 생성
+ * 
+ * @author 조재영 + * @version 1.0 + * @created 09-6-2011 오전 10:08:05 + */ +@Service("egovIndvdlSchdulManageService") +public class EgovIndvdlSchdulManageServiceImpl extends EgovAbstractServiceImpl implements EgovIndvdlSchdulManageService{ + + @Resource(name="indvdlSchdulManageDao") + private IndvdlSchdulManageDao dao; + + + + + /** + * 메인페이지/일정관리조회 + * @param map - 조회할 정보가 담긴 map + * @return List + * @throws Exception + */ + @Override + public List selectIndvdlSchdulManageMainList(Map map) throws Exception{ + return dao.selectIndvdlSchdulManageMainList(map); + } + + + /** + * 일정 목록을 Map(map)형식으로 조회한다. + * @param map + * @return + * @throws Exception + */ + @Override + public List selectIndvdlSchdulManageRetrieve(Map map) throws Exception{ + return dao.selectIndvdlSchdulManageRetrieve(map); + } + + /** + * 일정 목록을 VO(model)형식으로 조회한다. + * @param indvdlSchdulManageVO - 조회할 정보가 담긴 VO + * @return List + * @throws Exception + */ + @Override + public IndvdlSchdulManageVO selectIndvdlSchdulManageDetailVO(IndvdlSchdulManageVO indvdlSchdulManageVO) throws Exception{ + return dao.selectIndvdlSchdulManageDetailVO(indvdlSchdulManageVO); + } + + /** + * 일정 목록을 조회한다. + * @param searchVO - 조회할 정보가 담긴 VO + * @return List + * @throws Exception + */ + @Override + public List selectIndvdlSchdulManageList(ComDefaultVO searchVO) throws Exception{ + return dao.selectIndvdlSchdulManageList(searchVO); + } + + + /** + * 일정를(을) 상세조회 한다. + * @param indvdlSchdulManageVO - 일정 정보 담김 VO + * @return + * @throws Exception + */ + @Override + public IndvdlSchdulManageVO selectIndvdlSchdulManageDetail(IndvdlSchdulManageVO indvdlSchdulManageVO) throws Exception{ + return dao.selectIndvdlSchdulManageDetail(indvdlSchdulManageVO); + } + + /** + * 일정를(을) 목록 전체 건수를(을) 조회한다. + * @param searchVO - 조회할 정보가 담긴 VO + * @return int + * @throws Exception + */ + @Override + public int selectIndvdlSchdulManageListCnt(ComDefaultVO searchVO) throws Exception{ + return dao.selectIndvdlSchdulManageListCnt(searchVO); + } + + /** + * 일정를(을) 등록한다. + * @param indvdlSchdulManageVO - 조회할 정보가 담긴 VO + * @throws Exception + */ + @Override + public void insertIndvdlSchdulManage(IndvdlSchdulManageVO indvdlSchdulManageVO) throws Exception { + + } + + /** + * 일정를(을) 수정한다. + * @param indvdlSchdulManageVO - 조회할 정보가 담긴 VO + * @throws Exception + */ + @Override + public void updateIndvdlSchdulManage(IndvdlSchdulManageVO indvdlSchdulManageVO) throws Exception{ + dao.updateIndvdlSchdulManage(indvdlSchdulManageVO); + } + + /** + * 일정를(을) 삭제한다. + * @param indvdlSchdulManageVO - 조회할 정보가 담긴 VO + * @throws Exception + */ + @Override + public void deleteIndvdlSchdulManage(IndvdlSchdulManageVO indvdlSchdulManageVO) throws Exception{ + dao.deleteIndvdlSchdulManage(indvdlSchdulManageVO); + } +} diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/util/EgovIdGnrBuilder.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/util/EgovIdGnrBuilder.java new file mode 100644 index 0000000..c76197b --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/util/EgovIdGnrBuilder.java @@ -0,0 +1,96 @@ +package com.dbnt.kcscbackend.admin.committee.schedules.util; + +import org.egovframe.rte.fdl.idgnr.impl.EgovTableIdGnrServiceImpl; +import org.egovframe.rte.fdl.idgnr.impl.strategy.EgovIdGnrStrategyImpl; + +import javax.sql.DataSource; + +/** + * @ClassName : EgovIdGnrBuilder.java + * @Description : IdGen 정보 builder + * + * @author : 윤주호 + * @since : 2021. 7. 20 + * @version : 1.0 + * + *
+ * << 개정이력(Modification Information) >>
+ *
+ *   수정일              수정자               수정내용
+ *  -------------  ------------   ---------------------
+ *   2021. 7. 20    윤주호               최초 생성
+ * 
+ * + */ +public class EgovIdGnrBuilder { + + // TODO : 기본값 설정, 예외처리 필요 + + private DataSource dataSource; + private EgovIdGnrStrategyImpl egovIdGnrStrategyImpl; + + private String preFix; + private int cipers; + private char fillChar; + + private int blockSize; + private String table; + private String tableName; + + public EgovIdGnrBuilder setDataSource(DataSource dataSource) { + this.dataSource = dataSource; + return this; + } + + public EgovIdGnrBuilder setEgovIdGnrStrategyImpl(EgovIdGnrStrategyImpl egovIdGnrStrategyImpl) { + this.egovIdGnrStrategyImpl = egovIdGnrStrategyImpl; + return this; + } + + public EgovIdGnrBuilder setPreFix(String preFix) { + this.preFix = preFix; + return this; + } + public EgovIdGnrBuilder setCipers(int cipers) { + this.cipers = cipers; + return this; + } + public EgovIdGnrBuilder setFillChar(char fillChar) { + this.fillChar = fillChar; + return this; + } + public EgovIdGnrBuilder setBlockSize(int blockSize) { + this.blockSize = blockSize; + return this; + } + public EgovIdGnrBuilder setTable(String table) { + this.table = table; + return this; + } + public EgovIdGnrBuilder setTableName(String tableName) { + this.tableName = tableName; + return this; + } + + public EgovTableIdGnrServiceImpl build() { + + EgovTableIdGnrServiceImpl egovTableIdGnrServiceImpl = new EgovTableIdGnrServiceImpl(); + egovTableIdGnrServiceImpl.setDataSource(dataSource); + if(egovIdGnrStrategyImpl != null) { + egovIdGnrStrategyImpl = new EgovIdGnrStrategyImpl(); + egovIdGnrStrategyImpl.setPrefix(preFix); + egovIdGnrStrategyImpl.setCipers(cipers); + egovIdGnrStrategyImpl.setFillChar(fillChar); + + egovTableIdGnrServiceImpl.setStrategy(egovIdGnrStrategyImpl); + } + egovTableIdGnrServiceImpl.setBlockSize(blockSize); + egovTableIdGnrServiceImpl.setTable(table); + egovTableIdGnrServiceImpl.setTableName(tableName); + + return egovTableIdGnrServiceImpl; + } + + + +} diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/util/EgovStringUtil.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/util/EgovStringUtil.java new file mode 100644 index 0000000..c6b663a --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/util/EgovStringUtil.java @@ -0,0 +1,888 @@ +/** + * @Class Name : EgovStringUtil.java + * @Description : 문자열 데이터 처리 관련 유틸리티 + * @Modification Information + * + * 수정일 수정자 수정내용 + * ------- -------- --------------------------- + * 2009.01.13 박정규 최초 생성 + * 2009.02.13 이삼섭 내용 추가 + * + * @author 공통 서비스 개발팀 박정규 + * @since 2009. 01. 13 + * @version 1.0 + * @see + * + */ + +package com.dbnt.kcscbackend.admin.committee.schedules.util; + +/* + * Copyright 2001-2006 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the ";License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS"; BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import java.io.UnsupportedEncodingException; +import java.math.BigDecimal; +import java.security.SecureRandom; +import java.sql.Timestamp; +import java.text.SimpleDateFormat; +import java.util.Locale; + +public class EgovStringUtil { + + /** + * 빈 문자열 "". + */ + public static final String EMPTY = ""; + + /** + * 랜덤 객체 + */ + public static SecureRandom rnd = new SecureRandom(); + + /** + *

Padding을 할 수 있는 최대 수치

+ */ + // private static final int PAD_LIMIT = 8192; + /** + *

An array of Strings used for padding.

+ *

Used for efficient space padding. The length of each String expands as needed.

+ */ + /* + private static final String[] PADDING = new String[Character.MAX_VALUE]; + + static { + // space padding is most common, start with 64 chars + PADDING[32] = " "; + } + */ + + /** + * 문자열이 지정한 길이를 초과했을때 지정한길이에다가 해당 문자열을 붙여주는 메서드. + * @param source 원본 문자열 배열 + * @param output 더할문자열 + * @param slength 지정길이 + * @return 지정길이로 잘라서 더할분자열 합친 문자열 + */ + public static String cutString(String source, String output, int slength) { + String returnVal = null; + if (source != null) { + if (source.length() > slength) { + returnVal = source.substring(0, slength) + output; + } else { + returnVal = source; + } + } + return returnVal; + } + + /** + * 문자열이 지정한 길이를 초과했을때 해당 문자열을 삭제하는 메서드 + * @param source 원본 문자열 배열 + * @param slength 지정길이 + * @return 지정길이로 잘라서 더할분자열 합친 문자열 + */ + public static String cutString(String source, int slength) { + String result = null; + if (source != null) { + if (source.length() > slength) { + result = source.substring(0, slength); + } else { + result = source; + } + } + return result; + } + + /** + *

+ * String이 비었거나("") 혹은 null 인지 검증한다. + *

+ * + *
+	 *  StringUtil.isEmpty(null)      = true
+	 *  StringUtil.isEmpty("")        = true
+	 *  StringUtil.isEmpty(" ")       = false
+	 *  StringUtil.isEmpty("bob")     = false
+	 *  StringUtil.isEmpty("  bob  ") = false
+	 * 
+ * + * @param str - 체크 대상 스트링오브젝트이며 null을 허용함 + * @return true - 입력받은 String 이 빈 문자열 또는 null인 경우 + */ + public static boolean isEmpty(String str) { + return str == null || str.length() == 0; + } + + /** + *

기준 문자열에 포함된 모든 대상 문자(char)를 제거한다.

+ * + *
+	 * StringUtil.remove(null, *)       = null
+	 * StringUtil.remove("", *)         = ""
+	 * StringUtil.remove("queued", 'u') = "qeed"
+	 * StringUtil.remove("queued", 'z') = "queued"
+	 * 
+ * + * @param str 입력받는 기준 문자열 + * @param remove 입력받는 문자열에서 제거할 대상 문자열 + * @return 제거대상 문자열이 제거된 입력문자열. 입력문자열이 null인 경우 출력문자열은 null + */ + public static String remove(String str, char remove) { + if (isEmpty(str) || str.indexOf(remove) == -1) { + return str; + } + char[] chars = str.toCharArray(); + int pos = 0; + for (int i = 0; i < chars.length; i++) { + if (chars[i] != remove) { + chars[pos++] = chars[i]; + } + } + return new String(chars, 0, pos); + } + + /** + *

문자열 내부의 콤마 character(,)를 모두 제거한다.

+ * + *
+	 * StringUtil.removeCommaChar(null)       = null
+	 * StringUtil.removeCommaChar("")         = ""
+	 * StringUtil.removeCommaChar("asdfg,qweqe") = "asdfgqweqe"
+	 * 
+ * + * @param str 입력받는 기준 문자열 + * @return " , "가 제거된 입력문자열 + * 입력문자열이 null인 경우 출력문자열은 null + */ + public static String removeCommaChar(String str) { + return remove(str, ','); + } + + /** + *

문자열 내부의 마이너스 character(-)를 모두 제거한다.

+ * + *
+	 * StringUtil.removeMinusChar(null)       = null
+	 * StringUtil.removeMinusChar("")         = ""
+	 * StringUtil.removeMinusChar("a-sdfg-qweqe") = "asdfgqweqe"
+	 * 
+ * + * @param str 입력받는 기준 문자열 + * @return " - "가 제거된 입력문자열 + * 입력문자열이 null인 경우 출력문자열은 null + */ + public static String removeMinusChar(String str) { + return remove(str, '-'); + } + + /** + * 원본 문자열의 포함된 특정 문자열을 새로운 문자열로 변환하는 메서드 + * @param source 원본 문자열 + * @param subject 원본 문자열에 포함된 특정 문자열 + * @param object 변환할 문자열 + * @return sb.toString() 새로운 문자열로 변환된 문자열 + */ + public static String replace(String source, String subject, String object) { + StringBuffer rtnStr = new StringBuffer(); + String preStr = ""; + String nextStr = source; + String srcStr = source; + + while (srcStr.indexOf(subject) >= 0) { + preStr = srcStr.substring(0, srcStr.indexOf(subject)); + nextStr = srcStr.substring(srcStr.indexOf(subject) + subject.length(), srcStr.length()); + srcStr = nextStr; + rtnStr.append(preStr).append(object); + } + rtnStr.append(nextStr); + return rtnStr.toString(); + } + + /** + * 원본 문자열의 포함된 특정 문자열 첫번째 한개만 새로운 문자열로 변환하는 메서드 + * @param source 원본 문자열 + * @param subject 원본 문자열에 포함된 특정 문자열 + * @param object 변환할 문자열 + * @return sb.toString() 새로운 문자열로 변환된 문자열 / source 특정문자열이 없는 경우 원본 문자열 + */ + public static String replaceOnce(String source, String subject, String object) { + StringBuffer rtnStr = new StringBuffer(); + String preStr = ""; + String nextStr = source; + if (source.indexOf(subject) >= 0) { + preStr = source.substring(0, source.indexOf(subject)); + nextStr = source.substring(source.indexOf(subject) + subject.length(), source.length()); + rtnStr.append(preStr).append(object).append(nextStr); + return rtnStr.toString(); + } else { + return source; + } + } + + /** + * subject에 포함된 각각의 문자를 object로 변환한다. + * + * @param source 원본 문자열 + * @param subject 원본 문자열에 포함된 특정 문자열 + * @param object 변환할 문자열 + * @return sb.toString() 새로운 문자열로 변환된 문자열 + */ + public static String replaceChar(String source, String subject, String object) { + StringBuffer rtnStr = new StringBuffer(); + String preStr = ""; + String nextStr = source; + String srcStr = source; + + char chA; + + for (int i = 0; i < subject.length(); i++) { + chA = subject.charAt(i); + + if (srcStr.indexOf(chA) >= 0) { + preStr = srcStr.substring(0, srcStr.indexOf(chA)); + nextStr = srcStr.substring(srcStr.indexOf(chA) + 1, srcStr.length()); + srcStr = rtnStr.append(preStr).append(object).append(nextStr).toString(); + } + } + + return srcStr; + } + + /** + *

strsearchStr의 시작(index) 위치를 반환.

+ * + *

입력값 중 null이 있을 경우 -1을 반환.

+ * + *
+	 * StringUtil.indexOf(null, *)          = -1
+	 * StringUtil.indexOf(*, null)          = -1
+	 * StringUtil.indexOf("", "")           = 0
+	 * StringUtil.indexOf("aabaabaa", "a")  = 0
+	 * StringUtil.indexOf("aabaabaa", "b")  = 2
+	 * StringUtil.indexOf("aabaabaa", "ab") = 1
+	 * StringUtil.indexOf("aabaabaa", "")   = 0
+	 * 
+ * + * @param str 검색 문자열 + * @param searchStr 검색 대상문자열 + * @return 검색 문자열 중 검색 대상문자열이 있는 시작 위치 검색대상 문자열이 없거나 null인 경우 -1 + */ + public static int indexOf(String str, String searchStr) { + if (str == null || searchStr == null) { + return -1; + } + return str.indexOf(searchStr); + } + + /** + *

오라클의 decode 함수와 동일한 기능을 가진 메서드이다. + * sourStrcompareStr의 값이 같으면 + * returStr을 반환하며, 다르면 defaultStr을 반환한다. + *

+ * + *
+	 * StringUtil.decode(null, null, "foo", "bar")= "foo"
+	 * StringUtil.decode("", null, "foo", "bar") = "bar"
+	 * StringUtil.decode(null, "", "foo", "bar") = "bar"
+	 * StringUtil.decode("하이", "하이", null, "bar") = null
+	 * StringUtil.decode("하이", "하이  ", "foo", null) = null
+	 * StringUtil.decode("하이", "하이", "foo", "bar") = "foo"
+	 * StringUtil.decode("하이", "하이  ", "foo", "bar") = "bar"
+	 * 
+ * + * @param sourceStr 비교할 문자열 + * @param compareStr 비교 대상 문자열 + * @param returnStr sourceStr와 compareStr의 값이 같을 때 반환할 문자열 + * @param defaultStr sourceStr와 compareStr의 값이 다를 때 반환할 문자열 + * @return sourceStr과 compareStr의 값이 동일(equal)할 때 returnStr을 반환하며, + *
다르면 defaultStr을 반환한다. + */ + public static String decode(String sourceStr, String compareStr, String returnStr, String defaultStr) { + if (sourceStr == null && compareStr == null) { + return returnStr; + } + + else if (sourceStr != null && sourceStr.trim().equals(compareStr)) { + return returnStr; + } + + return defaultStr; + } + + /** + *

오라클의 decode 함수와 동일한 기능을 가진 메서드이다. + * sourStrcompareStr의 값이 같으면 + * returStr을 반환하며, 다르면 sourceStr을 반환한다. + *

+ * + *
+	 * StringUtil.decode(null, null, "foo") = "foo"
+	 * StringUtil.decode("", null, "foo") = ""
+	 * StringUtil.decode(null, "", "foo") = null
+	 * StringUtil.decode("하이", "하이", "foo") = "foo"
+	 * StringUtil.decode("하이", "하이 ", "foo") = "하이"
+	 * StringUtil.decode("하이", "바이", "foo") = "하이"
+	 * 
+ * + * @param sourceStr 비교할 문자열 + * @param compareStr 비교 대상 문자열 + * @param returnStr sourceStr와 compareStr의 값이 같을 때 반환할 문자열 + * @return sourceStr과 compareStr의 값이 동일(equal)할 때 returnStr을 반환하며, + *
다르면 sourceStr을 반환한다. + */ + public static String decode(String sourceStr, String compareStr, String returnStr) { + return decode(sourceStr, compareStr, returnStr, sourceStr); + } + + /** + * 객체가 null인지 확인하고 null인 경우 "" 로 바꾸는 메서드 + * @param object 원본 객체 + * @return resultVal 문자열 + */ + public static String isNullToString(Object object) { + String string = ""; + + if (object != null) { + string = object.toString().trim(); + } + + return string; + } + + /** + *
+	 * 인자로 받은 String이 null일 경우 ""로 리턴한다.
+	 * @param src null값일 가능성이 있는 String 값.
+	 * @return 만약 String이 null 값일 경우 ""로 바꾼 String 값.
+	 *
+ */ + public static String nullConvert(Object src) { + //if (src != null && src.getClass().getName().equals("java.math.BigDecimal")) { + if (src != null && src instanceof BigDecimal) { + return ((BigDecimal)src).toString(); + } + + if (src == null || src.equals("null")) { + return ""; + } else { + return ((String)src).trim(); + } + } + + /** + *
+	 * 인자로 받은 String이 null일 경우 ""로 리턴한다.
+	 * @param src null값일 가능성이 있는 String 값.
+	 * @return 만약 String이 null 값일 경우 ""로 바꾼 String 값.
+	 *
+ */ + public static String nullConvert(String src) { + + if (src == null || src.equals("null") || "".equals(src) || " ".equals(src)) { + return ""; + } else { + return src.trim(); + } + } + + /** + *
+	 * 인자로 받은 String이 null일 경우 "0"로 리턴한다.
+	 * @param src null값일 가능성이 있는 String 값.
+	 * @return 만약 String이 null 값일 경우 "0"로 바꾼 String 값.
+	 *
+ */ + public static int zeroConvert(Object src) { + + if (src == null || src.equals("null")) { + return 0; + } else { + return Integer.parseInt(((String)src).trim()); + } + } + + /** + *
+	 * 인자로 받은 String이 null일 경우 ""로 리턴한다.
+	 * @param src null값일 가능성이 있는 String 값.
+	 * @return 만약 String이 null 값일 경우 ""로 바꾼 String 값.
+	 *
+ */ + public static int zeroConvert(String src) { + + if (src == null || src.equals("null") || "".equals(src) || " ".equals(src)) { + return 0; + } else { + return Integer.parseInt(src.trim()); + } + } + + /** + *

문자열에서 {@link Character#isWhitespace(char)}에 정의된 + * 모든 공백문자를 제거한다.

+ * + *
+	 * StringUtil.removeWhitespace(null)         = null
+	 * StringUtil.removeWhitespace("")           = ""
+	 * StringUtil.removeWhitespace("abc")        = "abc"
+	 * StringUtil.removeWhitespace("   ab  c  ") = "abc"
+	 * 
+ * + * @param str 공백문자가 제거도어야 할 문자열 + * @return the 공백문자가 제거된 문자열, null이 입력되면 null이 리턴 + */ + public static String removeWhitespace(String str) { + if (isEmpty(str)) { + return str; + } + int sz = str.length(); + char[] chs = new char[sz]; + int count = 0; + for (int i = 0; i < sz; i++) { + if (!Character.isWhitespace(str.charAt(i))) { + chs[count++] = str.charAt(i); + } + } + if (count == sz) { + return str; + } + + return new String(chs, 0, count); + } + + /** + * Html 코드가 들어간 문서를 표시할때 태그에 손상없이 보이기 위한 메서드 + * + * @param strString + * @return HTML 태그를 치환한 문자열 + */ + public static String checkHtmlView(String strString) { + String strNew = ""; + + StringBuffer strTxt = new StringBuffer(""); + + char chrBuff; + int len = strString.length(); + + for (int i = 0; i < len; i++) { + chrBuff = strString.charAt(i); + + switch (chrBuff) { + case '<': + strTxt.append("<"); + break; + case '>': + strTxt.append(">"); + break; + case '"': + strTxt.append("""); + break; + case 10: + strTxt.append("
"); + break; + case ' ': + strTxt.append(" "); + break; + //case '&' : + //strTxt.append("&"); + //break; + default: + strTxt.append(chrBuff); + } + } + + strNew = strTxt.toString(); + + return strNew; + } + + /** + * 문자열을 지정한 분리자에 의해 배열로 리턴하는 메서드. + * @param source 원본 문자열 + * @param separator 분리자 + * @return result 분리자로 나뉘어진 문자열 배열 + */ + public static String[] split(String source, String separator) throws NullPointerException { + String[] returnVal = null; + int cnt = 1; + + int index = source.indexOf(separator); + int index0 = 0; + while (index >= 0) { + cnt++; + index = source.indexOf(separator, index + 1); + } + returnVal = new String[cnt]; + cnt = 0; + index = source.indexOf(separator); + while (index >= 0) { + returnVal[cnt] = source.substring(index0, index); + index0 = index + 1; + index = source.indexOf(separator, index + 1); + cnt++; + } + returnVal[cnt] = source.substring(index0); + + return returnVal; + } + + /** + *

{@link String#toLowerCase()}를 이용하여 소문자로 변환한다.

+ * + *
+	 * StringUtil.lowerCase(null)  = null
+	 * StringUtil.lowerCase("")    = ""
+	 * StringUtil.lowerCase("aBc") = "abc"
+	 * 
+ * + * @param str 소문자로 변환되어야 할 문자열 + * @return 소문자로 변환된 문자열, null이 입력되면 null 리턴 + */ + public static String lowerCase(String str) { + if (str == null) { + return null; + } + + return str.toLowerCase(); + } + + /** + *

{@link String#toUpperCase()}를 이용하여 대문자로 변환한다.

+ * + *
+	 * StringUtil.upperCase(null)  = null
+	 * StringUtil.upperCase("")    = ""
+	 * StringUtil.upperCase("aBc") = "ABC"
+	 * 
+ * + * @param str 대문자로 변환되어야 할 문자열 + * @return 대문자로 변환된 문자열, null이 입력되면 null 리턴 + */ + public static String upperCase(String str) { + if (str == null) { + return null; + } + + return str.toUpperCase(); + } + + /** + *

입력된 String의 앞쪽에서 두번째 인자로 전달된 문자(stripChars)를 모두 제거한다.

+ * + *
+	 * StringUtil.stripStart(null, *)          = null
+	 * StringUtil.stripStart("", *)            = ""
+	 * StringUtil.stripStart("abc", "")        = "abc"
+	 * StringUtil.stripStart("abc", null)      = "abc"
+	 * StringUtil.stripStart("  abc", null)    = "abc"
+	 * StringUtil.stripStart("abc  ", null)    = "abc  "
+	 * StringUtil.stripStart(" abc ", null)    = "abc "
+	 * StringUtil.stripStart("yxabc  ", "xyz") = "abc  "
+	 * 
+ * + * @param str 지정된 문자가 제거되어야 할 문자열 + * @param stripChars 제거대상 문자열 + * @return 지정된 문자가 제거된 문자열, null이 입력되면 null 리턴 + */ + public static String stripStart(String str, String stripChars) { + int strLen; + if (str == null || (strLen = str.length()) == 0) { + return str; + } + int start = 0; + if (stripChars == null) { + while ((start != strLen) && Character.isWhitespace(str.charAt(start))) { + start++; + } + } else if (stripChars.length() == 0) { + return str; + } else { + while ((start != strLen) && (stripChars.indexOf(str.charAt(start)) != -1)) { + start++; + } + } + + return str.substring(start); + } + + /** + *

입력된 String의 뒤쪽에서 두번째 인자로 전달된 문자(stripChars)를 모두 제거한다.

+ * + *
+	 * StringUtil.stripEnd(null, *)          = null
+	 * StringUtil.stripEnd("", *)            = ""
+	 * StringUtil.stripEnd("abc", "")        = "abc"
+	 * StringUtil.stripEnd("abc", null)      = "abc"
+	 * StringUtil.stripEnd("  abc", null)    = "  abc"
+	 * StringUtil.stripEnd("abc  ", null)    = "abc"
+	 * StringUtil.stripEnd(" abc ", null)    = " abc"
+	 * StringUtil.stripEnd("  abcyx", "xyz") = "  abc"
+	 * 
+ * + * @param str 지정된 문자가 제거되어야 할 문자열 + * @param stripChars 제거대상 문자열 + * @return 지정된 문자가 제거된 문자열, null이 입력되면 null 리턴 + */ + public static String stripEnd(String str, String stripChars) { + int end; + if (str == null || (end = str.length()) == 0) { + return str; + } + + if (stripChars == null) { + while ((end != 0) && Character.isWhitespace(str.charAt(end - 1))) { + end--; + } + } else if (stripChars.length() == 0) { + return str; + } else { + while ((end != 0) && (stripChars.indexOf(str.charAt(end - 1)) != -1)) { + end--; + } + } + + return str.substring(0, end); + } + + /** + *

입력된 String의 앞, 뒤에서 두번째 인자로 전달된 문자(stripChars)를 모두 제거한다.

+ * + *
+	 * StringUtil.strip(null, *)          = null
+	 * StringUtil.strip("", *)            = ""
+	 * StringUtil.strip("abc", null)      = "abc"
+	 * StringUtil.strip("  abc", null)    = "abc"
+	 * StringUtil.strip("abc  ", null)    = "abc"
+	 * StringUtil.strip(" abc ", null)    = "abc"
+	 * StringUtil.strip("  abcyx", "xyz") = "  abc"
+	 * 
+ * + * @param str 지정된 문자가 제거되어야 할 문자열 + * @param stripChars 제거대상 문자열 + * @return 지정된 문자가 제거된 문자열, null이 입력되면 null 리턴 + */ + public static String strip(String str, String stripChars) { + if (isEmpty(str)) { + return str; + } + + String srcStr = str; + srcStr = stripStart(srcStr, stripChars); + + return stripEnd(srcStr, stripChars); + } + + /** + * 문자열을 지정한 분리자에 의해 지정된 길이의 배열로 리턴하는 메서드. + * @param source 원본 문자열 + * @param separator 분리자 + * @param arraylength 배열 길이 + * @return 분리자로 나뉘어진 문자열 배열 + */ + public static String[] split(String source, String separator, int arraylength) throws NullPointerException { + String[] returnVal = new String[arraylength]; + int cnt = 0; + int index0 = 0; + int index = source.indexOf(separator); + while (index >= 0 && cnt < (arraylength - 1)) { + returnVal[cnt] = source.substring(index0, index); + index0 = index + 1; + index = source.indexOf(separator, index + 1); + cnt++; + } + returnVal[cnt] = source.substring(index0); + if (cnt < (arraylength - 1)) { + for (int i = cnt + 1; i < arraylength; i++) { + returnVal[i] = ""; + } + } + + return returnVal; + } + + /** + * 문자열 A에서 Z사이의 랜덤 문자열을 구하는 기능을 제공 시작문자열과 종료문자열 사이의 랜덤 문자열을 구하는 기능 + * + * @param startChr + * - 첫 문자 + * @param endChr + * - 마지막문자 + * @return 랜덤문자 + * @exception MyException + * @see + */ + public static String getRandomStr(char startChr, char endChr) { + + int randomInt; + String randomStr = null; + + // 시작문자 및 종료문자를 아스키숫자로 변환한다. + int startInt = Integer.valueOf(startChr); + int endInt = Integer.valueOf(endChr); + + // 시작문자열이 종료문자열보가 클경우 + if (startInt > endInt) { + throw new IllegalArgumentException("Start String: " + startChr + " End String: " + endChr); + } + + do { + // 시작문자 및 종료문자 중에서 랜덤 숫자를 발생시킨다. + randomInt = rnd.nextInt(endInt + 1); + } while (randomInt < startInt); // 입력받은 문자 'A'(65)보다 작으면 다시 랜덤 숫자 발생. + + // 랜덤 숫자를 문자로 변환 후 스트링으로 다시 변환 + randomStr = (char)randomInt + ""; + + // 랜덤문자열를 리턴 + return randomStr; + } + + /** + * 문자열을 다양한 문자셋(EUC-KR[KSC5601],UTF-8..)을 사용하여 인코딩하는 기능 역으로 디코딩하여 원래의 문자열을 + * 복원하는 기능을 제공함 String temp = new String(문자열.getBytes("바꾸기전 인코딩"),"바꿀 인코딩"); + * String temp = new String(문자열.getBytes("8859_1"),"KSC5601"); => UTF-8 에서 + * EUC-KR + * + * @param srcString + * - 문자열 + * @param srcCharsetNm + * - 원래 CharsetNm + * @param charsetNm + * - CharsetNm + * @return 인(디)코딩 문자열 + * @exception MyException + * @see + */ + public static String getEncdDcd(String srcString, String srcCharsetNm, String cnvrCharsetNm) { + + String rtnStr = null; + + if (srcString == null) { + return null; + } + + try { + rtnStr = new String(srcString.getBytes(srcCharsetNm), cnvrCharsetNm); + } catch (UnsupportedEncodingException e) { + rtnStr = null; + } + + return rtnStr; + } + + /** + * 특수문자를 웹 브라우저에서 정상적으로 보이기 위해 특수문자를 처리('<' -> & lT)하는 기능이다 + * @param srcString - '<' + * @return 변환문자열('<' -> "<" + * @exception MyException + * @see + */ + public static String getSpclStrCnvr(String srcString) { + + String rtnStr = null; + + StringBuffer strTxt = new StringBuffer(""); + + char chrBuff; + int len = srcString.length(); + + for (int i = 0; i < len; i++) { + chrBuff = srcString.charAt(i); + + switch (chrBuff) { + case '<': + strTxt.append("<"); + break; + case '>': + strTxt.append(">"); + break; + case '&': + strTxt.append("&"); + break; + default: + strTxt.append(chrBuff); + } + } + + rtnStr = strTxt.toString(); + + return rtnStr; + } + + /** + * 응용어플리케이션에서 고유값을 사용하기 위해 시스템에서17자리의TIMESTAMP값을 구하는 기능 + * + * @param + * @return Timestamp 값 + * @exception MyException + * @see + */ + public static String getTimeStamp() { + + String rtnStr = null; + + // 문자열로 변환하기 위한 패턴 설정(년도-월-일 시:분:초:초(자정이후 초)) + String pattern = "yyyyMMddhhmmssSSS"; + + SimpleDateFormat sdfCurrent = new SimpleDateFormat(pattern, Locale.KOREA); + Timestamp ts = new Timestamp(System.currentTimeMillis()); + + rtnStr = sdfCurrent.format(ts.getTime()); + + return rtnStr; + } + + /** + * html의 특수문자를 표현하기 위해 + * + * @param srcString + * @return String + * @exception Exception + * @see + */ + public static String getHtmlStrCnvr(String srcString) { + + String tmpString = srcString; + + tmpString = tmpString.replaceAll("<", "<"); + tmpString = tmpString.replaceAll(">", ">"); + tmpString = tmpString.replaceAll("&", "&"); + tmpString = tmpString.replaceAll(" ", " "); + tmpString = tmpString.replaceAll("'", "\'"); + tmpString = tmpString.replaceAll(""", "\""); + + return tmpString; + + } + + /** + *

날짜 형식의 문자열 내부에 마이너스 character(-)를 추가한다.

+ * + *
+	 *   StringUtil.addMinusChar("20100901") = "2010-09-01"
+	 * 
+ * + * @param date 입력받는 문자열 + * @return " - "가 추가된 입력문자열 + */ + public static String addMinusChar(String date) { + if (date.length() == 8) { + return date.substring(0, 4).concat("-").concat(date.substring(4, 6)).concat("-") + .concat(date.substring(6, 8)); + } else { + return ""; + } + } +} diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/config/egov/EgovConfigAppCommon.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/config/egov/EgovConfigAppCommon.java index b7e44dc..439d15b 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/config/egov/EgovConfigAppCommon.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/config/egov/EgovConfigAppCommon.java @@ -4,6 +4,8 @@ import org.egovframe.rte.fdl.cmmn.trace.LeaveaTrace; import org.egovframe.rte.fdl.cmmn.trace.handler.TraceHandler; import org.egovframe.rte.fdl.cmmn.trace.manager.DefaultTraceHandleManager; import org.egovframe.rte.fdl.cmmn.trace.manager.TraceHandlerService; +import org.egovframe.rte.fdl.cryptography.EgovPasswordEncoder; +import org.egovframe.rte.fdl.cryptography.impl.EgovARIACryptoServiceImpl; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @@ -80,4 +82,28 @@ public class EgovConfigAppCommon { return leaveaTrace; } + /** + * 암복호화 + * @return [EgovPasswordEncoder 설정] EgovPasswordEncoder 등록 + */ + @Bean + public EgovPasswordEncoder egovPasswordEncoder() { + EgovPasswordEncoder egovPasswordEncoder = new EgovPasswordEncoder(); + egovPasswordEncoder.setAlgorithm("SHA-256"); + egovPasswordEncoder.setHashedPassword("gdyYs/IZqY86VcWhT8emCYfqY1ahw2vtLG+/FzNqtrQ="); + return egovPasswordEncoder; + } + + /** + * 암복호화 + * @return [EgovARIACryptoServiceImpl 설정] EgovARIACryptoServiceImpl 등록 + */ + @Bean + public EgovARIACryptoServiceImpl egovARIACryptoService() { + EgovARIACryptoServiceImpl egovARIACryptoServiceImpl = new EgovARIACryptoServiceImpl(); + egovARIACryptoServiceImpl.setPasswordEncoder(egovPasswordEncoder()); + egovARIACryptoServiceImpl.setBlockSize(1024); + return egovARIACryptoServiceImpl; + } + } diff --git a/kcsc-back-end/src/main/resources/admin/committee/schedules/mapper/config/mapper-config.xml b/kcsc-back-end/src/main/resources/admin/committee/schedules/mapper/config/mapper-config.xml new file mode 100644 index 0000000..78fb306 --- /dev/null +++ b/kcsc-back-end/src/main/resources/admin/committee/schedules/mapper/config/mapper-config.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kcsc-back-end/src/main/resources/application.properties b/kcsc-back-end/src/main/resources/application.properties index a072886..294f14e 100644 --- a/kcsc-back-end/src/main/resources/application.properties +++ b/kcsc-back-end/src/main/resources/application.properties @@ -12,3 +12,7 @@ spring.redis.host=localhost spring.redis.port=6379 # secret key Globals.jwt.secret = qWwMroux3QtiIJcPSIZARNTZEBBnWVH0jZ2Lx7tfFChCYi0ViZllo1bekZdiU0B3FRjJI7g90n0ha120dwlz8JZU8rOkmNCe9Uq0 + +#?????? ???? ? +#?? : ??? ??? "egovframe"? ????? ???? ????? ????. +Globals.crypto.algoritm = egovframe \ No newline at end of file