diff --git a/frontend/src/assets/css/style.css b/frontend/src/assets/css/style.css index ce66934..5fdc794 100644 --- a/frontend/src/assets/css/style.css +++ b/frontend/src/assets/css/style.css @@ -1914,6 +1914,32 @@ textarea:focus{ padding-top: 8px; } +.contents .search_check input[type="checkbox"] { + display: none; +} + +.contents .search_check input[type="checkbox"] + div > label:first-child { + width: 20px; + height: 30px; + display: block; + background: url(../images/icon-chk-n-square.png) no-repeat center/100% auto; + margin-right: 10px; +} + +.contents .search_check input[type="checkbox"]:checked + div > label:first-child { + background: url(../images/icon-chk-square.png) no-repeat center/100% auto; + margin-right: 10px; +} + +.contents .search_check .label_group { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} + @keyframes spScaleAlpha { 0% { opacity: 1; diff --git a/frontend/src/modules/sysMgt/components/MenuPop.vue b/frontend/src/modules/sysMgt/components/MenuPop.vue new file mode 100644 index 0000000..c4e5803 --- /dev/null +++ b/frontend/src/modules/sysMgt/components/MenuPop.vue @@ -0,0 +1,292 @@ + + + diff --git a/frontend/src/modules/sysMgt/router/index.js b/frontend/src/modules/sysMgt/router/index.js index 7e3af13..5280c2d 100644 --- a/frontend/src/modules/sysMgt/router/index.js +++ b/frontend/src/modules/sysMgt/router/index.js @@ -6,6 +6,8 @@ import BatchList from '../views/BatchList' import BatchDetail from '../views/BatchDetail' import NotiList from '../views/NotiList' import WorkState from '../views/WorkState' +import PartitionList from '../views/PartitionList' +import MenuList from '../views/MenuList' export default [ { @@ -56,6 +58,18 @@ export default [ component: WorkState, name: 'workState', meta: { public: false } + }, + { + path: '/sysMgt/partition', + component: PartitionList, + name: 'partitionList', + meta: { public: false } + }, + { + path: '/sysMgt/menuList', + component: MenuList, + name: 'menuList', + meta: { public: false } } ] diff --git a/frontend/src/modules/sysMgt/service/sysMgtApi.js b/frontend/src/modules/sysMgt/service/sysMgtApi.js index e4d4d4c..83de5e2 100644 --- a/frontend/src/modules/sysMgt/service/sysMgtApi.js +++ b/frontend/src/modules/sysMgt/service/sysMgtApi.js @@ -97,6 +97,37 @@ const athMenuList = (params) => { return httpClient.post('/api/v1/bo/sysMgt/selectAuthMemuListForAddAuth', params, { withCredentials: false }) } +const partitionCate = (params) => { + return httpClient.post('/api/v1/bo/sysMgt/partitionCate', params, { withCredentials: false }) +} + +const deletePartition = (params) => { + return httpClient.post('/api/v1/bo/sysMgt/deletePartition', params, { withCredentials: false }) +} + +const menuList = (params) => { + return httpClient.post('/api/v1/bo/sysMgt/menuList', params, { withCredentials: false }) +} + +const menuCate = (params) => { + return httpClient.post('/api/v1/bo/sysMgt/menuCate', params, { withCredentials: false }) +} + +const getMenuDetail = (params) => { + return httpClient.post('/api/v1/bo/sysMgt/menuDetail', params, { withCredentials: false }) +} + +const insertMenu = (params) => { + return httpClient.post('/api/v1/bo/sysMgt/insertMenu', params, { withCredentials: false }) +} + +const updateMenu = (params) => { + return httpClient.post('/api/v1/bo/sysMgt/updateMenu', params, { withCredentials: false }) +} + +const deleteMenu = (params) => { + return httpClient.post('/api/v1/bo/sysMgt/deleteMenu', params, { withCredentials: false }) +} export default { insertAdmin, @@ -119,5 +150,13 @@ export default { notiList, setWorkState, svcCheckList, - athMenuList + athMenuList, + partitionCate, + deletePartition, + menuList, + menuCate, + getMenuDetail, + insertMenu, + updateMenu, + deleteMenu } diff --git a/frontend/src/modules/sysMgt/views/MenuList.vue b/frontend/src/modules/sysMgt/views/MenuList.vue new file mode 100644 index 0000000..3a85790 --- /dev/null +++ b/frontend/src/modules/sysMgt/views/MenuList.vue @@ -0,0 +1,195 @@ + + + diff --git a/frontend/src/modules/sysMgt/views/PartitionList.vue b/frontend/src/modules/sysMgt/views/PartitionList.vue new file mode 100644 index 0000000..eec4305 --- /dev/null +++ b/frontend/src/modules/sysMgt/views/PartitionList.vue @@ -0,0 +1,219 @@ + + + diff --git a/frontend/src/router.js b/frontend/src/router.js index 4589580..a7e595c 100644 --- a/frontend/src/router.js +++ b/frontend/src/router.js @@ -177,6 +177,8 @@ router.beforeEach((to, from, next) => { nextUrl == '/sysMgt/authAdd' || nextUrl == '/sysMgt/authModify' || nextUrl == '/sysMgt/authModify' || + nextUrl == '/sysMgt/partition' || + nextUrl == '/sysMgt/menuList' || nextUrl.indexOf('/sysMgt/batchDetail') > -1 ) { for (var i = 0; i < menuUrls.length; i++) { diff --git a/src/main/java/kr/co/uplus/ez/api/sysMgt/SysMgtController.java b/src/main/java/kr/co/uplus/ez/api/sysMgt/SysMgtController.java index 11ea7ab..db512ef 100644 --- a/src/main/java/kr/co/uplus/ez/api/sysMgt/SysMgtController.java +++ b/src/main/java/kr/co/uplus/ez/api/sysMgt/SysMgtController.java @@ -507,7 +507,176 @@ public class SysMgtController { return sysService.selectAuthMemuListForAddAuth(); } - - + /** + * date : 2023. 7. 18. + * auth : Jeon + * desc : 삭제 대상(3년 경과) 파티션 목록 조회 + * @param partitionListReqDto + * @param bindingResult + * @param response + * @return + */ + @ApiOperation(value = "partitionList", notes = "파티션 목록 조회") + @ApiResponses({ @ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS") }) + @RequestMapping(value = "/partitionList", method = { RequestMethod.POST }) + @ResponseBody + public PartitionListResDto partitionList(@RequestBody @Valid PartitionListReqDto partitionListReqDto, BindingResult bindingResult, HttpServletResponse response) { + if (validComponents.validParameter(bindingResult)) { + return new PartitionListResDto(ApiResponseCode.CM_PARAMETER_ERROR); + } + + return sysService.partitionList(partitionListReqDto); + } + + /** + * date : 2023. 7. 18. + * auth : Jeon + * desc : 삭제 대상(3년 경과) 파티션 조회를 위한 테이블 명의 카테고리(조회용 셀렉트 박스) + * @return + */ + @ApiOperation(value = "partitionCate", notes = "파티션 테이블 목록 조회") + @ApiResponses({ @ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS") }) + @RequestMapping(value = "/partitionCate", method = { RequestMethod.POST }) + @ResponseBody + public PartitionListResDto partitionCate() { + return sysService.partitionCate(); + } + + /** + * date : 2023. 7. 18. + * auth : Jeon + * desc : 삭제 대상(3년 경과) 파티션 삭제 실행 + * @param deletePartitionReqDto + * @param bindingResult + * @return + */ + @ApiOperation(value = "deletePartition", notes = "관리자 삭제") + @ApiResponses({ @ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS") }) + @RequestMapping(value = "/deletePartition", method = { RequestMethod.POST }) + @ResponseBody + public DeletePartitionResDto deletePartition(@RequestBody @Valid DeletePartitionReqDto deletePartitionReqDto, + BindingResult bindingResult) { + + if (validComponents.validParameter(bindingResult)) { + return new DeletePartitionResDto(ApiResponseCode.CM_PARAMETER_ERROR); + } + + return sysService.deletePartition(deletePartitionReqDto); + } + + /** + * date : 2023. 7. 18. + * auth : Jeon + * desc : 메뉴 목록 + * @param menuListReqDto + * @param bindingResult + * @param response + * @return + */ + @ApiOperation(value = "menuList", notes = "메뉴 목록 조회") + @ApiResponses({ @ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS") }) + @RequestMapping(value = "/menuList", method = { RequestMethod.POST }) + @ResponseBody + public MenuListResDto menuList(@RequestBody @Valid MenuListReqDto menuListReqDto, BindingResult bindingResult, HttpServletResponse response) { + if (validComponents.validParameter(bindingResult)) { + return new MenuListResDto(ApiResponseCode.CM_PARAMETER_ERROR); + } + return sysService.menuList(menuListReqDto); + } + + /** + * date : 2023. 7. 18. + * auth : Jeon + * desc : 상위 메뉴 목록 + * @return + */ + @ApiOperation(value = "menuCate", notes = "메뉴 상위 목록") + @ApiResponses({ @ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS") }) + @RequestMapping(value = "/menuCate", method = { RequestMethod.POST }) + @ResponseBody + public MenuListResDto menuCate() { + return sysService.menuCate(); + } + + /** + * date : 2023. 7. 18. + * auth : Jeon + * desc : 메뉴 상세 + * @param menuListReqDto + * @param bindingResult + * @param response + * @return + */ + @ApiOperation(value = "menuDetail", notes = "메뉴 상위 목록") + @ApiResponses({ @ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS") }) + @RequestMapping(value = "/menuDetail", method = { RequestMethod.POST }) + @ResponseBody + public MenuListResDto menuDetail(@RequestBody @Valid MenuListReqDto menuListReqDto, BindingResult bindingResult, HttpServletResponse response) { + if (validComponents.validParameter(bindingResult)) { + return new MenuListResDto(ApiResponseCode.CM_PARAMETER_ERROR); + } + return sysService.menuDetail(menuListReqDto); + } + + /** + * date : 2023. 7. 18. + * auth : Jeon + * desc : 메뉴 입력 + * @param menuListReqDto + * @param bindingResult + * @param response + * @return + */ + @ApiOperation(value = "insertMenu", notes = "메뉴 상위 목록") + @ApiResponses({ @ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS") }) + @RequestMapping(value = "/insertMenu", method = { RequestMethod.POST }) + @ResponseBody + public MenuListResDto insertMenu(@RequestBody @Valid MenuListReqDto menuListReqDto, BindingResult bindingResult, HttpServletResponse response) { + if (validComponents.validParameter(bindingResult)) { + return new MenuListResDto(ApiResponseCode.CM_PARAMETER_ERROR); + } + return sysService.insertMenu(menuListReqDto); + } + + /** + * date : 2023. 7. 18. + * auth : Jeon + * desc : 메뉴 삭제 + * @param menuListReqDto + * @param bindingResult + * @param response + * @return + */ + @ApiOperation(value = "deleteMenu", notes = "메뉴 상위 목록") + @ApiResponses({ @ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS") }) + @RequestMapping(value = "/deleteMenu", method = { RequestMethod.POST }) + @ResponseBody + public MenuListResDto deleteMenu(@RequestBody @Valid MenuListReqDto menuListReqDto, BindingResult bindingResult, HttpServletResponse response) { + if (validComponents.validParameter(bindingResult)) { + return new MenuListResDto(ApiResponseCode.CM_PARAMETER_ERROR); + } + return sysService.deleteMenu(menuListReqDto); + } + + /** + * date : 2023. 7. 18. + * auth : Jeon + * desc : 메뉴 수정 + * @param menuListReqDto + * @param bindingResult + * @param response + * @return + */ + @ApiOperation(value = "updateMenu", notes = "메뉴 상위 목록") + @ApiResponses({ @ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS") }) + @RequestMapping(value = "/updateMenu", method = { RequestMethod.POST }) + @ResponseBody + public MenuListResDto updateMenu(@RequestBody @Valid MenuListReqDto menuListReqDto, BindingResult bindingResult, HttpServletResponse response) { + if (validComponents.validParameter(bindingResult)) { + return new MenuListResDto(ApiResponseCode.CM_PARAMETER_ERROR); + } + return sysService.updateMenu(menuListReqDto); + } + } diff --git a/src/main/java/kr/co/uplus/ez/api/sysMgt/SysMgtMapper.java b/src/main/java/kr/co/uplus/ez/api/sysMgt/SysMgtMapper.java index 5ee3a36..a3c8f55 100644 --- a/src/main/java/kr/co/uplus/ez/api/sysMgt/SysMgtMapper.java +++ b/src/main/java/kr/co/uplus/ez/api/sysMgt/SysMgtMapper.java @@ -64,5 +64,34 @@ public interface SysMgtMapper { List selectAuthMemuUpperList(); //권한 추가를 위한 메뉴 조회 List selectAuthMemuChdList(AuthMenuUpper authMenuUpper); //권한 추가를 위한 메뉴 조회 - + + int selectPartitionTotalCnt(PartitionListReqDto partitionListReqDto); + + List selectPartitionList(PartitionListReqDto partitionListReqDto); + + List selectPartitionCate(); + + DeletePartition selectDeletePartition(DeletePartition deletePartition); + + int deletePartition(DeletePartition deletePartition); + + int selectMenuTotalCnt(MenuListReqDto menuListReqDto); + + List selectMenuList(MenuListReqDto menuListReqDto); + + List selectMenuCate(); + + Menu selectMenuDetail(MenuListReqDto menuListReqDto); + + int insertMenu(MenuListReqDto menuListReqDto); + + String getMenuNo(); + + int deleteMenu(MenuListReqDto menuListReqDto); + + int updateMenuOdrg(MenuListReqDto menuListReqDto); + + int updateMenu(MenuListReqDto menuListReqDto); + + int deleteAuthMenuFromMenu(MenuListReqDto menuListReqDto); } \ No newline at end of file diff --git a/src/main/java/kr/co/uplus/ez/api/sysMgt/SysMgtService.java b/src/main/java/kr/co/uplus/ez/api/sysMgt/SysMgtService.java index 94d70de..6633c4f 100644 --- a/src/main/java/kr/co/uplus/ez/api/sysMgt/SysMgtService.java +++ b/src/main/java/kr/co/uplus/ez/api/sysMgt/SysMgtService.java @@ -6,6 +6,7 @@ import kr.co.uplus.ez.api.homeMgt.dto.NoticeListReqDto; import kr.co.uplus.ez.api.sysMgt.dto.*; import kr.co.uplus.ez.common.data.ApiResponseCode; import kr.co.uplus.ez.common.data.Paging; +import kr.co.uplus.ez.common.data.UserAuthCode; import kr.co.uplus.ez.common.utils.EncryptionUtil; import lombok.extern.slf4j.Slf4j; @@ -18,6 +19,8 @@ import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; import org.springframework.core.io.Resource; import org.springframework.core.io.UrlResource; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.core.userdetails.UserDetails; import org.springframework.stereotype.Service; import java.io.BufferedReader; @@ -792,4 +795,279 @@ public class SysMgtService { return new AuthMenuResDto(ApiResponseCode.SUCCESS, authMenuData); } + + /** + * date : 2023. 7. 18. + * auth : Jeon + * desc : 삭제 대상(3년 경과) 파티션 목록 조회 + * @param partitionListReqDto + * @return + */ + public PartitionListResDto partitionList(PartitionListReqDto partitionListReqDto) { + SysMgtMapper sysMgtMapper = sqlSessionSlave.getMapper(SysMgtMapper.class); + + String nowPage = String.valueOf(partitionListReqDto.getPage()); + int totalCnt = sysMgtMapper.selectPartitionTotalCnt(partitionListReqDto); + + if(totalCnt == 0) { + Paging paging = new Paging(); + paging.setPage(nowPage); + paging.setTotalCnt(String.valueOf(totalCnt)); + PartitionListRes partitionListRes = new PartitionListRes(); + partitionListRes.setList(new ArrayList<>()); + partitionListRes.setPaging(paging); + return new PartitionListResDto(ApiResponseCode.CM_NOT_FOUND, partitionListRes); + } + + int page = partitionListReqDto.getPage(); + int pagePerRows = partitionListReqDto.getPagePerRows(); + page = (page -1) * pagePerRows; + partitionListReqDto.setPage(page); + + List partitions = sysMgtMapper.selectPartitionList(partitionListReqDto); + + Paging paging = new Paging(); + paging.setPage(nowPage); + paging.setTotalCnt(String.valueOf(totalCnt)); + + PartitionListRes partitionListRes = new PartitionListRes(); + partitionListRes.setList(partitions); + partitionListRes.setPaging(paging); + + return new PartitionListResDto(ApiResponseCode.SUCCESS, partitionListRes); + } + + /** + * date : 2023. 7. 18. + * auth : Jeon + * desc : 삭제 대상(3년 경과) 파티션 조회를 위한 테이블 명의 카테고리(조회용 셀렉트 박스) + * @return + */ + public PartitionListResDto partitionCate() { + SysMgtMapper sysMgtMapper = sqlSessionSlave.getMapper(SysMgtMapper.class); + + List partitions = sysMgtMapper.selectPartitionCate(); + + PartitionListRes partitionListRes = new PartitionListRes(); + partitionListRes.setList(partitions); + + return new PartitionListResDto(ApiResponseCode.SUCCESS, partitionListRes); + } + + /** + * date : 2023. 7. 18. + * auth : Jeon + * desc : 삭제 대상(3년 경과) 파티션 삭제 실행 + * @param deletePartitionReqDto + * @return + */ + public DeletePartitionResDto deletePartition(DeletePartitionReqDto deletePartitionReqDto) { + + SysMgtMapper sysMgtMapper = sqlSessionMaster.getMapper(SysMgtMapper.class); + + try { + + if(deletePartitionReqDto.getList() == null || deletePartitionReqDto.getList().size() == 0) { + return new DeletePartitionResDto(ApiResponseCode.CM_MISSING_REQUIRED); + } + + for(DeletePartition partition : deletePartitionReqDto.getList()) { + + DeletePartition target = sysMgtMapper.selectDeletePartition(partition); + + if(target == null) { + return new DeletePartitionResDto(ApiResponseCode.CM_NOT_FOUND); + } + + sysMgtMapper.deletePartition(target); + } + } catch (Exception e) { + return new DeletePartitionResDto(ApiResponseCode.CM_DB_QUERY_ERR); + } + + DeletePartitionResDto result = new DeletePartitionResDto(ApiResponseCode.SUCCESS); + return result; + } + + /** + * date : 2023. 7. 18. + * auth : Jeon + * desc : 메뉴 목록 + * @param menuListReqDto + * @return + */ + public MenuListResDto menuList(MenuListReqDto menuListReqDto) { + SysMgtMapper sysMgtMapper = sqlSessionSlave.getMapper(SysMgtMapper.class); + + int totalCnt = sysMgtMapper.selectMenuTotalCnt(menuListReqDto); + + if(totalCnt == 0) { + + MenuListRes menuListRes = new MenuListRes(); + menuListRes.setList(new ArrayList<>()); + return new MenuListResDto(ApiResponseCode.CM_NOT_FOUND, menuListRes); + } + + + List menus = sysMgtMapper.selectMenuList(menuListReqDto); + + MenuListRes menuListRes = new MenuListRes(); + menuListRes.setList(menus); + menuListRes.setTotalCnt(totalCnt); + + return new MenuListResDto(ApiResponseCode.SUCCESS, menuListRes); + } + + /** + * date : 2023. 7. 18. + * auth : Jeon + * desc : 상위 메뉴 목록 + * @return + */ + public MenuListResDto menuCate() { + SysMgtMapper sysMgtMapper = sqlSessionSlave.getMapper(SysMgtMapper.class); + + List menus = sysMgtMapper.selectMenuCate(); + + MenuListRes menuListRes = new MenuListRes(); + menuListRes.setList(menus); + + return new MenuListResDto(ApiResponseCode.SUCCESS, menuListRes); + } + + /** + * date : 2023. 7. 18. + * auth : Jeon + * desc : 메뉴 상세(수정 시 사용) + * @param menuListReqDto + * @return + */ + public MenuListResDto menuDetail(MenuListReqDto menuListReqDto) { + SysMgtMapper sysMgtMapper = sqlSessionSlave.getMapper(SysMgtMapper.class); + + Menu menu = sysMgtMapper.selectMenuDetail(menuListReqDto); + + MenuListRes menuListRes = new MenuListRes(); + menuListRes.setData(menu); + + return new MenuListResDto(ApiResponseCode.SUCCESS, menuListRes); + } + + /** + * date : 2023. 7. 18. + * auth : Jeon + * desc : 메뉴 입력 + * @param menuListReqDto + * @return + */ + public MenuListResDto insertMenu(MenuListReqDto menuListReqDto) { + SysMgtMapper sysMgtMapper = sqlSessionSlave.getMapper(SysMgtMapper.class); + + Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal(); + UserDetails userDetails = (UserDetails) principal; + + menuListReqDto.setRegId(userDetails.getUsername()); + menuListReqDto.setChgId(userDetails.getUsername()); + + String menuNo = sysMgtMapper.getMenuNo(); + + menuListReqDto.setMenuNo(menuNo); + + int result = sysMgtMapper.insertMenu(menuListReqDto); + + if(result < 1 ) { + return new MenuListResDto(ApiResponseCode.CM_DB_QUERY_ERR); + } + + HashMap authMenuParamMap = new HashMap(); + authMenuParamMap.put("authCd", UserAuthCode.SUPER_ADMIN_USER.getValue()); + authMenuParamMap.put("regId", menuListReqDto.getRegId()); + authMenuParamMap.put("menuNo", menuListReqDto.getMenuNo()); + + result = sysMgtMapper.insertAuthMenu(authMenuParamMap); + + if(result < 1 ) { + return new MenuListResDto(ApiResponseCode.CM_DB_QUERY_ERR); + } + + return new MenuListResDto(ApiResponseCode.SUCCESS); + } + + /** + * date : 2023. 7. 18. + * auth : Jeon + * desc : 메뉴 삭제 + * @param menuListReqDto + * @return + */ + public MenuListResDto deleteMenu(MenuListReqDto menuListReqDto) { + SysMgtMapper sysMgtMapper = sqlSessionSlave.getMapper(SysMgtMapper.class); + + Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal(); + UserDetails userDetails = (UserDetails) principal; + + menuListReqDto.setChgId(userDetails.getUsername()); + + + Menu menu = sysMgtMapper.selectMenuDetail(menuListReqDto); + + int result = sysMgtMapper.deleteMenu(menuListReqDto); + + if(result < 1 ) { + return new MenuListResDto(ApiResponseCode.CM_DB_QUERY_ERR); + } + + menuListReqDto.setPrntsMenuNo(menu.getPrntsMenuNo()); + menuListReqDto.setMenuOdrg(menu.getMenuOdrg()); + + if(!menu.getMenuOdrg().equals(String.valueOf(menu.getMaxMenuOdrg()))) { + result = sysMgtMapper.updateMenuOdrg(menuListReqDto); + + if(result < 1 ) { + return new MenuListResDto(ApiResponseCode.CM_DB_QUERY_ERR); + } + } + + sysMgtMapper.deleteAuthMenuFromMenu(menuListReqDto); + + return new MenuListResDto(ApiResponseCode.SUCCESS); + } + + /** + * date : 2023. 7. 18. + * auth : Jeon + * desc : 메뉴 수정 + * @param menuListReqDto + * @return + */ + public MenuListResDto updateMenu(MenuListReqDto menuListReqDto) { + SysMgtMapper sysMgtMapper = sqlSessionSlave.getMapper(SysMgtMapper.class); + + Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal(); + UserDetails userDetails = (UserDetails) principal; + + menuListReqDto.setChgId(userDetails.getUsername()); + + + Menu menu = sysMgtMapper.selectMenuDetail(menuListReqDto); + menuListReqDto.setPrntsMenuNo(menu.getPrntsMenuNo()); + menuListReqDto.setOldMenuOdrg(menu.getMenuOdrg()); + + int result = 0; + + if(!(menuListReqDto.getMenuOdrg().equals(menuListReqDto.getOldMenuOdrg()))) { + result = sysMgtMapper.updateMenuOdrg(menuListReqDto); + if(result < 1 ) { + return new MenuListResDto(ApiResponseCode.CM_DB_QUERY_ERR); + } + } + + result = sysMgtMapper.updateMenu(menuListReqDto); + if(result < 1 ) { + return new MenuListResDto(ApiResponseCode.CM_DB_QUERY_ERR); + } + + return new MenuListResDto(ApiResponseCode.SUCCESS); + } + } diff --git a/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/DeletePartition.java b/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/DeletePartition.java new file mode 100644 index 0000000..cc7109f --- /dev/null +++ b/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/DeletePartition.java @@ -0,0 +1,23 @@ +package kr.co.uplus.ez.api.sysMgt.dto; + +import java.io.Serializable; + +import javax.validation.constraints.NotNull; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@SuppressWarnings("serial") +@Data +public class DeletePartition implements Serializable { + + @ApiModelProperty(example = "테이블명", name = "테이블명", dataType = "String") + private String tableName; + + @ApiModelProperty(example = "테이블스키마", name = "테이블스키마", dataType = "String") + private String tableSchema; + + @NotNull + @ApiModelProperty(example = "파티션명", name = "파티션명", dataType = "String") + private String partitionName; +} \ No newline at end of file diff --git a/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/DeletePartitionReqDto.java b/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/DeletePartitionReqDto.java new file mode 100644 index 0000000..ae08e5d --- /dev/null +++ b/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/DeletePartitionReqDto.java @@ -0,0 +1,15 @@ +package kr.co.uplus.ez.api.sysMgt.dto; + +import java.io.Serializable; +import java.util.List; + +import lombok.Data; + +@SuppressWarnings("serial") +@Data +public class DeletePartitionReqDto implements Serializable { + + // 삭제 대상 List. + private List list; + +} diff --git a/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/DeletePartitionResDto.java b/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/DeletePartitionResDto.java new file mode 100644 index 0000000..f767a39 --- /dev/null +++ b/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/DeletePartitionResDto.java @@ -0,0 +1,31 @@ +package kr.co.uplus.ez.api.sysMgt.dto; + +import java.io.Serializable; + +import kr.co.uplus.ez.common.data.ApiResponseCode; +import kr.co.uplus.ez.common.data.ResponseMessage; +import lombok.Data; + +@SuppressWarnings("serial") +@Data +public class DeletePartitionResDto extends ResponseMessage implements Serializable{ + + // 데이터. + private Object data; + + public DeletePartitionResDto() { + this.retCode = ApiResponseCode.SUCCESS.getResultCode(); + this.retMsg = ApiResponseCode.SUCCESS.getResultMsg(); + } + + public DeletePartitionResDto(ApiResponseCode returnStr) { + this.retCode = returnStr.getResultCode(); + this.retMsg = returnStr.getResultMsg(); + } + + public DeletePartitionResDto(ApiResponseCode returnStr, Object data) { + this.retCode = returnStr.getResultCode(); + this.retMsg = returnStr.getResultMsg(); + this.data = data; + } +} \ No newline at end of file diff --git a/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/Menu.java b/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/Menu.java new file mode 100644 index 0000000..ac4b52f --- /dev/null +++ b/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/Menu.java @@ -0,0 +1,32 @@ +package kr.co.uplus.ez.api.sysMgt.dto; + +import java.io.Serializable; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@SuppressWarnings("serial") +@Data +public class Menu implements Serializable { + + @ApiModelProperty(example = "메뉴번호", name = "메뉴번호", dataType = "String") + private String menuNo; + @ApiModelProperty(example = "메뉴명", name = "메뉴명", dataType = "String") + private String menuNm; + @ApiModelProperty(example = "상위 메뉴명", name = "상위 메뉴명", dataType = "String") + private String prntsMenuNm; + @ApiModelProperty(example = "상위 메뉴번호", name = "상위 메뉴번호", dataType = "String") + private String prntsMenuNo; + @ApiModelProperty(example = "URL", name = "URL", dataType = "String") + private String menuUrl; + @ApiModelProperty(example = "메뉴순번", name = "메뉴순번", dataType = "String") + private String menuOdrg; + @ApiModelProperty(example = "상태", name = "상태", dataType = "String") + private String useYn; + @ApiModelProperty(example = "입력일자", name = "입력일자", dataType = "String") + private String regDt; + @ApiModelProperty(example = "마지막메뉴순번", name = "마지막메뉴순번", dataType = "String") + private int maxMenuOdrg; + @ApiModelProperty(example = "그룹", name = "그룹", dataType = "String") + private String autchkGrpno; +} \ No newline at end of file diff --git a/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/MenuListReqDto.java b/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/MenuListReqDto.java new file mode 100644 index 0000000..9812d62 --- /dev/null +++ b/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/MenuListReqDto.java @@ -0,0 +1,55 @@ +package kr.co.uplus.ez.api.sysMgt.dto; + +import java.io.Serializable; + +import javax.validation.constraints.NotNull; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@SuppressWarnings("serial") +@Data +public class MenuListReqDto implements Serializable { + + @ApiModelProperty(example = "검색값", name = "검색값", dataType = "String") + private String searchText; + + @ApiModelProperty(example = "메뉴번호", name = "메뉴번호", dataType = "String") + private String menuNo; + + @ApiModelProperty(example = "메뉴명", name = "메뉴명", dataType = "String") + private String menuNm; + + @ApiModelProperty(example = "URL", name = "URL", dataType = "String") + private String menuUrl; + + @ApiModelProperty(example = "사용여부", name = "사용여부", dataType = "String") + private String useYn; + + @ApiModelProperty(example = "상위 메뉴 번호", name = "상위 메뉴 번호", dataType = "String") + private String prntsMenuNo; + + @ApiModelProperty(example = "메뉴순번", name = "메뉴순번", dataType = "String") + private String menuOdrg; + + @ApiModelProperty(example = "변경전 메뉴순번", name = "변경전 메뉴순번", dataType = "String") + private String oldMenuOdrg; + + @ApiModelProperty(example = "그룹", name = "그룹", dataType = "String") + private String autchkGrpno; + + @ApiModelProperty(example = "입력자", name = "입력자", dataType = "String") + private String regId; + + @ApiModelProperty(example = "수정자", name = "수정자", dataType = "String") + private String chgId; + + @NotNull + @ApiModelProperty(example = "페이지당 조회할 목록 수",notes = "페이지당 조회할 목록 수", name = "페이지당 조회할 목록 수", dataType = "int") + private int pagePerRows; + + @NotNull + @ApiModelProperty(example = "현재 페이지", name = "현재 페이지", dataType = "int") + private int page; + +} \ No newline at end of file diff --git a/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/MenuListRes.java b/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/MenuListRes.java new file mode 100644 index 0000000..b88ee23 --- /dev/null +++ b/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/MenuListRes.java @@ -0,0 +1,16 @@ +package kr.co.uplus.ez.api.sysMgt.dto; + +import java.io.Serializable; +import java.util.List; + +import kr.co.uplus.ez.common.data.Paging; +import lombok.Data; + +@SuppressWarnings("serial") +@Data +public class MenuListRes implements Serializable{ + + private int totalCnt; + private List list; + private Menu data; +} diff --git a/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/MenuListResDto.java b/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/MenuListResDto.java new file mode 100644 index 0000000..a5d1ff9 --- /dev/null +++ b/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/MenuListResDto.java @@ -0,0 +1,31 @@ +package kr.co.uplus.ez.api.sysMgt.dto; + +import java.io.Serializable; + +import kr.co.uplus.ez.common.data.ApiResponseCode; +import kr.co.uplus.ez.common.data.ResponseMessage; +import lombok.Data; + +@SuppressWarnings("serial") +@Data +public class MenuListResDto extends ResponseMessage implements Serializable{ + + // 데이터. + private MenuListRes data; + + public MenuListResDto() { + this.retCode = ApiResponseCode.SUCCESS.getResultCode(); + this.retMsg = ApiResponseCode.SUCCESS.getResultMsg(); + } + + public MenuListResDto(ApiResponseCode returnStr) { + this.retCode = returnStr.getResultCode(); + this.retMsg = returnStr.getResultMsg(); + } + + public MenuListResDto(ApiResponseCode returnStr, MenuListRes data) { + this.retCode = returnStr.getResultCode(); + this.retMsg = returnStr.getResultMsg(); + this.data = data; + } +} \ No newline at end of file diff --git a/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/Partition.java b/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/Partition.java new file mode 100644 index 0000000..30151b3 --- /dev/null +++ b/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/Partition.java @@ -0,0 +1,25 @@ +package kr.co.uplus.ez.api.sysMgt.dto; + +import java.io.Serializable; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@SuppressWarnings("serial") +@Data +public class Partition implements Serializable { + + @ApiModelProperty(example = "리스트번호", name = "리스트번호", dataType = "String") + private Integer no; + @ApiModelProperty(example = "테이블명", name = "테이블명", dataType = "String") + private String tableName; + @ApiModelProperty(example = "파티션명", name = "파티션명", dataType = "String") + private String partitionName; + @ApiModelProperty(example = "분할비교대상", name = "분할비교대상", dataType = "String") + private String partitionExp; + @ApiModelProperty(example = "분할비교값", name = "분할비교값", dataType = "String") + private String partitionDesc; + @ApiModelProperty(example = "분할순번", name = "분할순번", dataType = "String") + private String partitionOrdPos; + +} \ No newline at end of file diff --git a/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/PartitionListReqDto.java b/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/PartitionListReqDto.java new file mode 100644 index 0000000..70111f7 --- /dev/null +++ b/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/PartitionListReqDto.java @@ -0,0 +1,28 @@ +package kr.co.uplus.ez.api.sysMgt.dto; + +import java.io.Serializable; + +import javax.validation.constraints.NotNull; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@SuppressWarnings("serial") +@Data +public class PartitionListReqDto implements Serializable { + + @ApiModelProperty(example = "검색값", name = "검색값", dataType = "String") + private String searchText; + + @ApiModelProperty(example = "조회 종류", name = "조회 종류", dataType = "String") + private String deleteListView; + + @NotNull + @ApiModelProperty(example = "페이지당 조회할 목록 수",notes = "페이지당 조회할 목록 수", name = "페이지당 조회할 목록 수", dataType = "int") + private int pagePerRows; + + @NotNull + @ApiModelProperty(example = "현재 페이지", name = "현재 페이지", dataType = "int") + private int page; + +} \ No newline at end of file diff --git a/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/PartitionListRes.java b/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/PartitionListRes.java new file mode 100644 index 0000000..9f468e1 --- /dev/null +++ b/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/PartitionListRes.java @@ -0,0 +1,15 @@ +package kr.co.uplus.ez.api.sysMgt.dto; + +import java.io.Serializable; +import java.util.List; + +import kr.co.uplus.ez.common.data.Paging; +import lombok.Data; + +@SuppressWarnings("serial") +@Data +public class PartitionListRes implements Serializable{ + + private Paging paging; + private List list; +} diff --git a/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/PartitionListResDto.java b/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/PartitionListResDto.java new file mode 100644 index 0000000..210d599 --- /dev/null +++ b/src/main/java/kr/co/uplus/ez/api/sysMgt/dto/PartitionListResDto.java @@ -0,0 +1,31 @@ +package kr.co.uplus.ez.api.sysMgt.dto; + +import java.io.Serializable; + +import kr.co.uplus.ez.common.data.ApiResponseCode; +import kr.co.uplus.ez.common.data.ResponseMessage; +import lombok.Data; + +@SuppressWarnings("serial") +@Data +public class PartitionListResDto extends ResponseMessage implements Serializable{ + + // 데이터. + private PartitionListRes data; + + public PartitionListResDto() { + this.retCode = ApiResponseCode.SUCCESS.getResultCode(); + this.retMsg = ApiResponseCode.SUCCESS.getResultMsg(); + } + + public PartitionListResDto(ApiResponseCode returnStr) { + this.retCode = returnStr.getResultCode(); + this.retMsg = returnStr.getResultMsg(); + } + + public PartitionListResDto(ApiResponseCode returnStr, PartitionListRes data) { + this.retCode = returnStr.getResultCode(); + this.retMsg = returnStr.getResultMsg(); + this.data = data; + } +} \ No newline at end of file diff --git a/src/main/java/kr/co/uplus/ez/common/data/UserAuthCode.java b/src/main/java/kr/co/uplus/ez/common/data/UserAuthCode.java new file mode 100644 index 0000000..5795371 --- /dev/null +++ b/src/main/java/kr/co/uplus/ez/common/data/UserAuthCode.java @@ -0,0 +1,30 @@ +package kr.co.uplus.ez.common.data; + +import java.util.HashMap; +import java.util.Map; + +public enum UserAuthCode { + SUPER_ADMIN_USER("1001"); + + private String value; + private String desc; + private UserAuthCode(String value) { + this.value = value; + } + public String getValue() { + return value; + } + public String getDesc() { + return desc; + } + + private static final Map lookup = new HashMap(); + static { + for (UserAuthCode e : UserAuthCode.values()) { + lookup.put(e.getValue(), e); + } + } + public static UserAuthCode find(String value) { + return lookup.get(value); + } +} \ No newline at end of file diff --git a/src/main/resources/mapper/mysql/sysMgt/sysMgt-mapper.xml b/src/main/resources/mapper/mysql/sysMgt/sysMgt-mapper.xml index cbbdfd3..7dedb14 100644 --- a/src/main/resources/mapper/mysql/sysMgt/sysMgt-mapper.xml +++ b/src/main/resources/mapper/mysql/sysMgt/sysMgt-mapper.xml @@ -551,4 +551,263 @@ ORDER BY A.MENU_ODRG ASC + + + + + + WHERE PARTITION_NAME IS NOT NULL + AND PARTITION_DESCRIPTION IS NOT NULL + AND PARTITION_DESCRIPTION IS NOT NULL + AND (SUBSTRING_INDEX(PARTITION_NAME,'_',-1) REGEXP '^2[0-9]{3}$' OR SUBSTRING_INDEX(PARTITION_NAME,'_',-1) REGEXP '^2[0-9]{3}0[0-9]|^2[0-9]{3}1[0-2]') + + AND STR_TO_DATE(IF(SUBSTRING_INDEX(PARTITION_NAME,'_',-1) REGEXP '^2[0-9]{3}$',CONCAT(SUBSTRING_INDEX(PARTITION_NAME,'_',-1),'0101'),CONCAT(SUBSTRING_INDEX(PARTITION_NAME,'_',-1),'01')),'%Y%m%d') DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -3 YEAR),'%Y%m%d') + + + AND TABLE_NAME = #{searchText} + + + + + + + + + /* sysMgt-mapper.xml(deletePartition) */ + ALTER TABLE ${tableSchema}.${tableName} DROP PARTITION ${partitionName} + + + + + + + + + + AND A.PRNTS_MENU_NO = #{searchText} + + + + + + + + + + + /* sysMgt-mapper.xml(insertMenu) */ + INSERT INTO hubez_admin.EZ_ADM_MENU + ( + MENU_NO + , PRNTS_MENU_NO + , MENU_NM + , MENU_ODRG + , USE_YN + , MENU_LVL + , MENU_URL + + , AUTCHK_GRPNO + + , REG_ID + , REG_DT + , CHG_ID + , CHG_DT + ) + VALUES + ( + #{menuNo} + , #{prntsMenuNo} + , #{menuNm} + , (SELECT MAX(MENU_ODRG)+1 FROM hubez_admin.EZ_ADM_MENU A WHERE PRNTS_MENU_NO = #{prntsMenuNo}) + , #{useYn} + , 2 + , #{menuUrl} + + , #{autchkGrpno} + + , #{regId} + , NOW() + , #{regId} + , NOW() + ) + + + + /* sysMgt-mapper.xml(deleteMenu) */ + DELETE FROM hubez_admin.EZ_ADM_MENU + WHERE MENU_NO = #{menuNo} + + + + /* sysMgt-mapper.xml(deleteAuthMenuFromMenu) */ + DELETE FROM hubez_admin.EZ_ADM_AUTMENU + WHERE MENU_NO = #{menuNo} + + + + /* sysMgt-mapper.xml(updateMenuOdrg) */ + UPDATE hubez_admin.EZ_ADM_MENU + SET + + + + + MENU_ODRG = IF(MENU_ODRG #{menuOdrg} AND MENU_ODRG ]]> #{oldMenuOdrg}, MENU_ODRG-1, IF(MENU_ODRG = #{oldMenuOdrg} , #{menuOdrg},MENU_ODRG)) + + + MENU_ODRG = IF(MENU_ODRG #{oldMenuOdrg} AND MENU_ODRG = ]]> #{menuOdrg}, MENU_ODRG+1, IF(MENU_ODRG = #{oldMenuOdrg} , #{menuOdrg},MENU_ODRG)) + + + + + MENU_ODRG = MENU_ODRG - 1 + + + ,CHG_ID = #{chgId} + ,CHG_DT = NOW() + WHERE PRNTS_MENU_NO = #{prntsMenuNo} + + AND MENU_ODRG ]]> #{menuOdrg} + + + + + /* sysMgt-mapper.xml(updateMenu) */ + UPDATE hubez_admin.EZ_ADM_MENU + SET + MENU_NM = #{menuNm} + ,MENU_URL = #{menuUrl} + ,USE_YN = #{useYn} + + + ,AUTCHK_GRPNO = #{autchkGrpno} + + + ,AUTCHK_GRPNO = null + + + ,CHG_ID = #{chgId} + ,CHG_DT = NOW() + WHERE MENU_NO = #{menuNo} + + \ No newline at end of file