From 510acbd7a7025f939de9da10f570b399ea15041f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=84=9D=20=EC=B5=9C?= Date: Thu, 11 Jan 2024 18:41:42 +0900 Subject: [PATCH] =?UTF-8?q?=EC=82=AC=EC=9A=A9=EC=9E=90=20=EB=AA=A9?= =?UTF-8?q?=EB=A1=9D=20=EC=9E=91=EC=97=85=EC=A4=91.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/commonCode/CheckBox.jsx | 61 ++++++++++++ .../components/commonCode/SelectOption.jsx | 42 ++++++++ .../src/pages/admin/users/List.jsx | 2 +- .../src/pages/admin/users/UserInfoModal.jsx | 97 +++++++++---------- .../EgovIndvdlSchdulManageServiceImpl.java | 9 +- .../admin/config/AdminConfigController.java | 4 +- .../config/service/AdminConfigService.java | 8 +- .../users/service/AdminUsersService.java | 3 +- .../commonCode/CommonCodeController.java | 43 ++++++++ .../entity/TcCodeGrp.java | 2 +- .../entity/TcCodeItem.java | 2 +- .../entity/TnCmtEvent.java | 2 +- .../entity/TnCmtOrg.java | 2 +- .../repository/TcCodeGrpRepository.java | 4 +- .../repository/TcCodeItemRepository.java | 4 +- .../repository/TnCmtEventRepository.java | 8 +- .../repository/TnCmtOrgRepository.java | 5 +- .../commonCode/service/CommonCodeService.java | 24 +++++ 18 files changed, 242 insertions(+), 80 deletions(-) create mode 100644 egovframe-template-simple-react-contribution/src/components/commonCode/CheckBox.jsx create mode 100644 egovframe-template-simple-react-contribution/src/components/commonCode/SelectOption.jsx create mode 100644 kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/CommonCodeController.java rename kcsc-back-end/src/main/java/com/dbnt/kcscbackend/{admin/config => commonCode}/entity/TcCodeGrp.java (95%) rename kcsc-back-end/src/main/java/com/dbnt/kcscbackend/{admin/config => commonCode}/entity/TcCodeItem.java (96%) rename kcsc-back-end/src/main/java/com/dbnt/kcscbackend/{admin/config => commonCode}/entity/TnCmtEvent.java (97%) rename kcsc-back-end/src/main/java/com/dbnt/kcscbackend/{admin/config => commonCode}/entity/TnCmtOrg.java (96%) rename kcsc-back-end/src/main/java/com/dbnt/kcscbackend/{admin/config => commonCode}/repository/TcCodeGrpRepository.java (65%) rename kcsc-back-end/src/main/java/com/dbnt/kcscbackend/{admin/config => commonCode}/repository/TcCodeItemRepository.java (70%) rename kcsc-back-end/src/main/java/com/dbnt/kcscbackend/{admin/config => commonCode}/repository/TnCmtEventRepository.java (78%) rename kcsc-back-end/src/main/java/com/dbnt/kcscbackend/{admin/config => commonCode}/repository/TnCmtOrgRepository.java (60%) create mode 100644 kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/service/CommonCodeService.java diff --git a/egovframe-template-simple-react-contribution/src/components/commonCode/CheckBox.jsx b/egovframe-template-simple-react-contribution/src/components/commonCode/CheckBox.jsx new file mode 100644 index 0000000..10c0822 --- /dev/null +++ b/egovframe-template-simple-react-contribution/src/components/commonCode/CheckBox.jsx @@ -0,0 +1,61 @@ +import React, {useCallback, useEffect, useState} from "react"; +import Form from "react-bootstrap/Form"; +import * as EgovNet from "api/egovFetch"; + +function CheckBox({name, grpCd, selectedValue}){ + + const [checkBox, setCheckBox] = useState(); + + useEffect(() => { + getCodeItemList() + }, []); + useEffect(() => { + setCheckedValue(selectedValue) + }, [checkBox]); + + function getCodeItemList() { + EgovNet.requestFetch( + '/commonCode/code-item?grpCd='+grpCd, + { + method: "GET" + }, + (resp) => { + let checkBoxTag = []; + resp.result.codeList.forEach(function (item, index) { + checkBoxTag.push( + {}} + /> + ); + }); + setCheckBox(checkBoxTag); + }, + function (resp) { + console.log("err response : ", resp); + } + ); + } + + function setCheckedValue(selectedValue){ + debugger + const checkBoxDiv = document.querySelector("#"+grpCd+"_checkBoxDiv") + checkBoxDiv.childNodes.forEach(function (input){ + if(selectedValue.includes(input.children[0].value)){ + input.checked = true; + } + }) + } + + return ( +
+ {checkBox} +
+ ) +} + +export default CheckBox; \ No newline at end of file diff --git a/egovframe-template-simple-react-contribution/src/components/commonCode/SelectOption.jsx b/egovframe-template-simple-react-contribution/src/components/commonCode/SelectOption.jsx new file mode 100644 index 0000000..4d07230 --- /dev/null +++ b/egovframe-template-simple-react-contribution/src/components/commonCode/SelectOption.jsx @@ -0,0 +1,42 @@ +import React, {useEffect, useState} from "react"; +import Form from "react-bootstrap/Form"; +import * as EgovNet from "api/egovFetch"; + +function SelectOption({name, grpCd, selectedValue}){ + + const [options, setOptions] = useState(); + + useEffect(() => { + getCodeItemList() + }, []); + + function getCodeItemList(){ + EgovNet.requestFetch( + '/commonCode/code-item?grpCd='+grpCd, + { + method: "GET" + }, + (resp) => { + let optionTag = []; + // 리스트 항목 구성 + resp.result.codeList.forEach(function (item, index) { + optionTag.push( + + ); + }); + setOptions(optionTag); + }, + function (resp) { + console.log("err response : ", resp); + } + ); + } + + return ( + {}}> + {options} + + ) +} + +export default SelectOption; \ No newline at end of file diff --git a/egovframe-template-simple-react-contribution/src/pages/admin/users/List.jsx b/egovframe-template-simple-react-contribution/src/pages/admin/users/List.jsx index 8e63171..15b2c51 100644 --- a/egovframe-template-simple-react-contribution/src/pages/admin/users/List.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/admin/users/List.jsx @@ -50,7 +50,7 @@ function List(props) { const listIdx = itemIdxByPage(resultCnt , currentPageNo, pageSize, index); mutListTag.push( -
+
{item.userSe}
{userInfoModal(item.userSeq)}}>{item.userId}
{item.userNm}
diff --git a/egovframe-template-simple-react-contribution/src/pages/admin/users/UserInfoModal.jsx b/egovframe-template-simple-react-contribution/src/pages/admin/users/UserInfoModal.jsx index cbd178d..92a519d 100644 --- a/egovframe-template-simple-react-contribution/src/pages/admin/users/UserInfoModal.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/admin/users/UserInfoModal.jsx @@ -1,14 +1,16 @@ -import React, {useEffect, useState} from "react" +import React, {useCallback, useEffect, useState} from "react" import Modal from "react-bootstrap/Modal"; -import * as EgovNet from "../../../api/egovFetch"; +import * as EgovNet from "api/egovFetch"; import Form from "react-bootstrap/Form"; import Row from "react-bootstrap/Row"; import Col from "react-bootstrap/Col"; import Button from "react-bootstrap/Button"; +import SelectOption from "components/commonCode/SelectOption"; +import CheckBox from "components/commonCode/CheckBox"; function UserInfoModal({userSeq}){ - const [userInfo, setUserInfo] = useState({ userId: '', password: '', passwordChk: '', userNm: '', email: '', phoneNum: ''}); + const [userInfo, setUserInfo] = useState({ userId: '', password: '', passwordChk: '', userNm: '', email: '', phoneNum: '', userSe:'', userRole:'', status:''}); function getModalContent(){ EgovNet.requestFetch( @@ -24,6 +26,9 @@ function UserInfoModal({userSeq}){ phoneNum: resp.result.userInfo.phoneNum, password: "", passwordChk: "", + userSe: resp.result.userInfo.userSe, + userRole: resp.result.userInfo.userRole, + status: resp.result.userInfo.status } setUserInfo(respInfo); }, @@ -33,8 +38,8 @@ function UserInfoModal({userSeq}){ ); } - function userInfoChange(){ - + function userInfoChange(e){ + debugger } useEffect(() => { @@ -43,89 +48,83 @@ function UserInfoModal({userSeq}){ return ( <> - + {userInfo.userNm} 상세정보 -
- + {userInfoChange(e)}} noValidate> + 아이디 - setUserInfo({ ...userInfo, userId: e.target.value })}/> + - - - 이름 - - - setUserInfo({ ...userInfo, userNm: e.target.value })}/> - - - - - 이메일 - - - setUserInfo({ ...userInfo, email: e.target.value })}/> - - - - - 연락처 - - - setUserInfo({ ...userInfo, phoneNum: e.target.value })}/> - - - + 비밀번호 - setUserInfo({ ...userInfo, password: e.target.value })}/> + - + 비밀번호 확인 - setUserInfo({ ...userInfo, passwordChk: e.target.value })}/> + - + + + 이름 + + + + + + + + 이메일 + + + + + + + + 연락처 + + + + + + 사용자 유형 - + - + 사용자 권한 - + - + 상태 - + diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/impl/EgovIndvdlSchdulManageServiceImpl.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/impl/EgovIndvdlSchdulManageServiceImpl.java index 014dc87..bf9ca42 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/impl/EgovIndvdlSchdulManageServiceImpl.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/service/impl/EgovIndvdlSchdulManageServiceImpl.java @@ -3,18 +3,15 @@ package com.dbnt.kcscbackend.admin.committee.schedules.service.impl; import com.dbnt.kcscbackend.admin.committee.schedules.model.CreateScheduleVO; import com.dbnt.kcscbackend.admin.committee.schedules.service.EgovIndvdlSchdulManageService; -import com.dbnt.kcscbackend.admin.config.repository.TcCodeItemRepository; -import com.dbnt.kcscbackend.admin.config.repository.TnCmtEventRepository; -import com.dbnt.kcscbackend.admin.config.repository.TnCmtOrgRepository; +import com.dbnt.kcscbackend.commonCode.repository.TcCodeItemRepository; +import com.dbnt.kcscbackend.commonCode.repository.TnCmtEventRepository; +import com.dbnt.kcscbackend.commonCode.repository.TnCmtOrgRepository; import com.dbnt.kcscbackend.config.common.ResultVO; import lombok.RequiredArgsConstructor; -import org.apache.tomcat.util.json.JSONParser; import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; -import org.springframework.boot.configurationprocessor.json.JSONObject; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.sql.Timestamp; import java.text.SimpleDateFormat; diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/AdminConfigController.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/AdminConfigController.java index 48b889d..eb3873c 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/AdminConfigController.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/AdminConfigController.java @@ -1,7 +1,7 @@ package com.dbnt.kcscbackend.admin.config; -import com.dbnt.kcscbackend.admin.config.entity.TcCodeGrp; -import com.dbnt.kcscbackend.admin.config.entity.TcCodeItem; +import com.dbnt.kcscbackend.commonCode.entity.TcCodeGrp; +import com.dbnt.kcscbackend.commonCode.entity.TcCodeItem; import com.dbnt.kcscbackend.admin.config.service.AdminConfigService; import com.dbnt.kcscbackend.auth.entity.LoginVO; import com.dbnt.kcscbackend.config.common.BaseController; diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/service/AdminConfigService.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/service/AdminConfigService.java index e42a300..00c5042 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/service/AdminConfigService.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/service/AdminConfigService.java @@ -1,9 +1,9 @@ package com.dbnt.kcscbackend.admin.config.service; -import com.dbnt.kcscbackend.admin.config.entity.TcCodeGrp; -import com.dbnt.kcscbackend.admin.config.entity.TcCodeItem; -import com.dbnt.kcscbackend.admin.config.repository.TcCodeGrpRepository; -import com.dbnt.kcscbackend.admin.config.repository.TcCodeItemRepository; +import com.dbnt.kcscbackend.commonCode.entity.TcCodeGrp; +import com.dbnt.kcscbackend.commonCode.entity.TcCodeItem; +import com.dbnt.kcscbackend.commonCode.repository.TcCodeGrpRepository; +import com.dbnt.kcscbackend.commonCode.repository.TcCodeItemRepository; import lombok.RequiredArgsConstructor; import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; import org.springframework.stereotype.Service; diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/users/service/AdminUsersService.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/users/service/AdminUsersService.java index ec0f721..7b1d7ca 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/users/service/AdminUsersService.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/users/service/AdminUsersService.java @@ -4,13 +4,14 @@ import com.dbnt.kcscbackend.admin.users.mapper.AdminUsersMapper; import com.dbnt.kcscbackend.auth.entity.UserInfo; import com.dbnt.kcscbackend.auth.repository.UserInfoRepository; import lombok.RequiredArgsConstructor; +import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; import org.springframework.stereotype.Service; import java.util.List; @Service @RequiredArgsConstructor -public class AdminUsersService { +public class AdminUsersService extends EgovAbstractServiceImpl { private final UserInfoRepository userInfoRepository; private final AdminUsersMapper usersMapper; diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/CommonCodeController.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/CommonCodeController.java new file mode 100644 index 0000000..9a49bb6 --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/CommonCodeController.java @@ -0,0 +1,43 @@ +package com.dbnt.kcscbackend.commonCode; + +import com.dbnt.kcscbackend.commonCode.entity.TcCodeItem; +import com.dbnt.kcscbackend.commonCode.service.CommonCodeService; +import com.dbnt.kcscbackend.config.common.ResultVO; +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.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.Map; + +@RestController +@RequiredArgsConstructor +@RequestMapping("/commonCode") +@Tag(name="CommonCodeController", description = "공통코드 컨트롤러") +public class CommonCodeController { + + private final CommonCodeService commonCodeService; + + @Operation( + summary = "코드 아이템 목록 조회", + description = "코드 아이템 목록 조회", + tags = {"CommonCodeController"} + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "조회 성공"), + @ApiResponse(responseCode = "403", description = "인가된 사용자가 아님") + }) + @RequestMapping(method = RequestMethod.GET, value = "/code-item") + public ResultVO getCodeItemList(TcCodeItem codeItem) throws Exception{ + ResultVO resultVO = new ResultVO(); + Map resultMap = new HashMap<>(); + resultMap.put("codeList", commonCodeService.selectCodeItemList(codeItem.getGrpCd())); + resultVO.setResult(resultMap); + return resultVO; + } +} diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/entity/TcCodeGrp.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/entity/TcCodeGrp.java similarity index 95% rename from kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/entity/TcCodeGrp.java rename to kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/entity/TcCodeGrp.java index b3255b3..53077eb 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/entity/TcCodeGrp.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/entity/TcCodeGrp.java @@ -1,4 +1,4 @@ -package com.dbnt.kcscbackend.admin.config.entity; +package com.dbnt.kcscbackend.commonCode.entity; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/entity/TcCodeItem.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/entity/TcCodeItem.java similarity index 96% rename from kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/entity/TcCodeItem.java rename to kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/entity/TcCodeItem.java index f263d04..4b76f7a 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/entity/TcCodeItem.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/entity/TcCodeItem.java @@ -1,4 +1,4 @@ -package com.dbnt.kcscbackend.admin.config.entity; +package com.dbnt.kcscbackend.commonCode.entity; import lombok.*; import org.hibernate.annotations.DynamicInsert; diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/entity/TnCmtEvent.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/entity/TnCmtEvent.java similarity index 97% rename from kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/entity/TnCmtEvent.java rename to kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/entity/TnCmtEvent.java index 7d87372..3439491 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/entity/TnCmtEvent.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/entity/TnCmtEvent.java @@ -1,4 +1,4 @@ -package com.dbnt.kcscbackend.admin.config.entity; +package com.dbnt.kcscbackend.commonCode.entity; import lombok.*; import org.hibernate.annotations.DynamicInsert; diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/entity/TnCmtOrg.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/entity/TnCmtOrg.java similarity index 96% rename from kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/entity/TnCmtOrg.java rename to kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/entity/TnCmtOrg.java index e2ec1a7..8e83ee1 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/entity/TnCmtOrg.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/entity/TnCmtOrg.java @@ -1,4 +1,4 @@ -package com.dbnt.kcscbackend.admin.config.entity; +package com.dbnt.kcscbackend.commonCode.entity; import lombok.*; import org.hibernate.annotations.DynamicInsert; diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/repository/TcCodeGrpRepository.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/repository/TcCodeGrpRepository.java similarity index 65% rename from kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/repository/TcCodeGrpRepository.java rename to kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/repository/TcCodeGrpRepository.java index 38b0492..40883a2 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/repository/TcCodeGrpRepository.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/repository/TcCodeGrpRepository.java @@ -1,6 +1,6 @@ -package com.dbnt.kcscbackend.admin.config.repository; +package com.dbnt.kcscbackend.commonCode.repository; -import com.dbnt.kcscbackend.admin.config.entity.TcCodeGrp; +import com.dbnt.kcscbackend.commonCode.entity.TcCodeGrp; import org.springframework.data.jpa.repository.JpaRepository; import java.util.List; diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/repository/TcCodeItemRepository.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/repository/TcCodeItemRepository.java similarity index 70% rename from kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/repository/TcCodeItemRepository.java rename to kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/repository/TcCodeItemRepository.java index 5852f71..e5d507c 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/repository/TcCodeItemRepository.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/repository/TcCodeItemRepository.java @@ -1,6 +1,6 @@ -package com.dbnt.kcscbackend.admin.config.repository; +package com.dbnt.kcscbackend.commonCode.repository; -import com.dbnt.kcscbackend.admin.config.entity.TcCodeItem; +import com.dbnt.kcscbackend.commonCode.entity.TcCodeItem; import org.springframework.data.jpa.repository.JpaRepository; import java.util.List; diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/repository/TnCmtEventRepository.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/repository/TnCmtEventRepository.java similarity index 78% rename from kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/repository/TnCmtEventRepository.java rename to kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/repository/TnCmtEventRepository.java index 2c8b149..b895514 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/repository/TnCmtEventRepository.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/repository/TnCmtEventRepository.java @@ -1,14 +1,10 @@ -package com.dbnt.kcscbackend.admin.config.repository; +package com.dbnt.kcscbackend.commonCode.repository; -import com.dbnt.kcscbackend.admin.config.entity.TnCmtEvent; -import com.dbnt.kcscbackend.admin.config.entity.TnCmtOrg; +import com.dbnt.kcscbackend.commonCode.entity.TnCmtEvent; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.query.Procedure; -import java.time.LocalDate; -import java.time.LocalDateTime; import java.util.Date; -import java.util.List; public interface TnCmtEventRepository extends JpaRepository { @Procedure diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/repository/TnCmtOrgRepository.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/repository/TnCmtOrgRepository.java similarity index 60% rename from kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/repository/TnCmtOrgRepository.java rename to kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/repository/TnCmtOrgRepository.java index 0ef6c2c..7c2d6c8 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/repository/TnCmtOrgRepository.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/repository/TnCmtOrgRepository.java @@ -1,7 +1,6 @@ -package com.dbnt.kcscbackend.admin.config.repository; +package com.dbnt.kcscbackend.commonCode.repository; -import com.dbnt.kcscbackend.admin.config.entity.TcCodeItem; -import com.dbnt.kcscbackend.admin.config.entity.TnCmtOrg; +import com.dbnt.kcscbackend.commonCode.entity.TnCmtOrg; import org.springframework.data.jpa.repository.JpaRepository; import java.util.List; diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/service/CommonCodeService.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/service/CommonCodeService.java new file mode 100644 index 0000000..0eef0bf --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/service/CommonCodeService.java @@ -0,0 +1,24 @@ +package com.dbnt.kcscbackend.commonCode.service; + + +import com.dbnt.kcscbackend.commonCode.entity.TcCodeItem; +import com.dbnt.kcscbackend.commonCode.repository.TcCodeGrpRepository; +import com.dbnt.kcscbackend.commonCode.repository.TcCodeItemRepository; +import lombok.RequiredArgsConstructor; +import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +@RequiredArgsConstructor +public class CommonCodeService extends EgovAbstractServiceImpl{ + + private final TcCodeGrpRepository codeGrpRepository; + private final TcCodeItemRepository codeItemRepository; + + + public List selectCodeItemList(String grpCd) { + return codeItemRepository.findByGrpCdAndUseYnOrderByGrpOrder(grpCd, "Y"); + } +}