fix: 메뉴 삭제 시 메뉴 권한 존재하는지 확인 후 권한 삭제

main
sjh88 2 years ago
parent 4bea924e90
commit 41215a1126

@ -26,10 +26,12 @@ public interface IMenuMgtMapper {
<T> List<XitMenuInfoVO> selectMenuInfos(final T t, final RowBounds rowBounds);
<T> List<XitMenuInfoVO> selectMenuInfos(final T t);
<T> XitMenuInfoVO selectMenuInfo(final T t);
<T> List<XitMenuInfoVO> selectMenuCreatDtls(final T t);
int insertMenuInfo(final XitMenuInfoVO vo);
int updateMenuInfo(final XitMenuInfoVO vo);
int deleteMenuInfo(final String menuNo);
int deleteMenuCreatDtlsList(final String menuNo);

@ -78,8 +78,10 @@ public class MenuMgtService implements IMenuMgtService {
if(mapper.selectMenuInfos(XitMenuInfoVO.builder().upperMenuNo(menuNo).build()).size() > 0)
throw BizRuntimeException.create("fail.common.delete.upperMenuExist");
//권한별 메뉴 관리 조회 후 삭제
if(mapper.selectMenuCreatDtls(XitMenuInfoVO.builder().menuNo(menuNo).build()).size() > 0)
mapper.deleteMenuCreatDtlsList(menuNo);
//TODO: xit_menu_creat_dtls 해당 정보 삭제후 실행???
mapper.deleteMenuInfo(menuNo);
cacheService.evictAllMenuCache();
}

@ -39,6 +39,15 @@
<include refid="sqlMenuInfo"/>
</select>
<select id="selectMenuCreatDtls" resultType="kr.xit.framework.biz.mng.menu.model.XitMenuInfoVO">
/* menu-mysql-mapper|selectMenuCreatDtls-메뉴생성내역 권한 데이터 조회|julim */
SELECT menu_no
FROM xit_menu_creat_dtls
<where>
AND menu_no = #{menuNo}
</where>
</select>
<insert id="insertMenuInfo" parameterType="kr.xit.framework.biz.mng.menu.model.XitMenuInfoVO">
/* menu-mysql-mapper|insertMenuInfo-메뉴 정보 등록|julim */
INSERT
@ -90,6 +99,14 @@
</delete>
<delete id="deleteMenuCreatDtlsList">
/* menu-mysql-mapper|deleteMenuCreatDtlsList-메뉴생성내역 권한 데이터 삭제|julim */
DELETE
FROM xit_menu_creat_dtls
WHERE menu_no = #{menuNo}
</delete>
<delete id="deleteAllMenuCreatDtlsList">
/* menu-mysql-mapper|deleteAllMenuCreatDtlsList-메뉴생성내역 전체데이터 삭제|julim */
DELETE

Loading…
Cancel
Save