|
|
@@ -35,18 +35,18 @@ public class TbUserGropMenuAthrService {
|
|
|
List<TbUserGropMenuAthr> userGropMenuAthrList = this.userGropMenuAthrRepo.findAll();
|
|
|
|
|
|
// 메뉴 중에 최상위 메뉴 선택
|
|
|
- HashMap<String, String> systMenuMap = new HashMap<>();
|
|
|
- for (TbOperSystMenu systMenu : operSystMenuList) {
|
|
|
- if (("N").equals(systMenu.getDelYn()) & systMenu.getMenuLevl() == 1) {
|
|
|
+ HashMap<String, String> operSystMenuMap = new HashMap<>();
|
|
|
+ for (TbOperSystMenu operSystMenu : operSystMenuList) {
|
|
|
+ if (("N").equals(operSystMenu.getDelYn()) & operSystMenu.getMenuLevl() == 1) {
|
|
|
// 레벨이 1 인 것이 최상위 메뉴이다, OPERSYST_MENU_ID, OPER_SYST_ID 는 NULL 로 들어가 있다.
|
|
|
- systMenuMap.put(systMenu.getOperSystId() + "*" + systMenu.getMenuId(), systMenu.getMenuName());
|
|
|
+ operSystMenuMap.put(operSystMenu.getOperSystId() + "*" + operSystMenu.getMenuId(), operSystMenu.getMenuName());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 등록되어 있는 권한 메모리 저장
|
|
|
- HashMap<String, TbUserGropMenuAthr> authMap = new HashMap<>();
|
|
|
+ HashMap<String, TbUserGropMenuAthr> userGropMenuAthrMap = new HashMap<>();
|
|
|
for (TbUserGropMenuAthr menuAthr : userGropMenuAthrList) {
|
|
|
- authMap.put(menuAthr.getOperSystId() + "*" + menuAthr.getGropId() + "*" + menuAthr.getMenuId(), menuAthr);
|
|
|
+ userGropMenuAthrMap.put(menuAthr.getOperSystId() + "*" + menuAthr.getGropId() + "*" + menuAthr.getMenuId(), menuAthr);
|
|
|
}
|
|
|
|
|
|
// 권한별로 모든 메뉴 생성
|
|
|
@@ -56,22 +56,22 @@ public class TbUserGropMenuAthrService {
|
|
|
}
|
|
|
|
|
|
// 모든 메뉴에 대해서
|
|
|
- for (TbOperSystMenu systMenu : operSystMenuList) {
|
|
|
- if (("Y").equals(systMenu.getDelYn()) || systMenu.getMenuLevl() == 1) {
|
|
|
+ for (TbOperSystMenu operSystMenu : operSystMenuList) {
|
|
|
+ if (("Y").equals(operSystMenu.getDelYn()) || operSystMenu.getMenuLevl() == 1) {
|
|
|
// 메뉴레벨이 1인 최상위 메뉴는 제외한다.
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
// 최상위 메뉴명을 업데이트
|
|
|
- systMenu.setOperSystNm(systMenuMap.get(systMenu.getOperSystId() + "*" + systMenu.getParentMenuId()));
|
|
|
+ operSystMenu.setOperSystNm(operSystMenuMap.get(operSystMenu.getOperSystId() + "*" + operSystMenu.getParentMenuId()));
|
|
|
// 메뉴권한 등록
|
|
|
- TbUserGropMenuAthrDto menuAthr = TbUserGropMenuAthr.toDtoByMenu(userGrop, systMenu);
|
|
|
- TbUserGropMenuAthr auth = authMap.get(menuAthr.getOperSystId() + "*" + userGrop.getGropId() + "*" + systMenu.getMenuId());
|
|
|
+ TbUserGropMenuAthrDto userGropMenuAthr = TbUserGropMenuAthr.toDtoByMenu(userGrop, operSystMenu);
|
|
|
+ TbUserGropMenuAthr auth = userGropMenuAthrMap.get(userGropMenuAthr.getOperSystId() + "*" + userGrop.getGropId() + "*" + operSystMenu.getMenuId());
|
|
|
if (auth != null) {
|
|
|
// 메뉴권한이 등록되어 있으면 업데이트
|
|
|
- menuAthr.updateMenuAuth(auth);
|
|
|
+ userGropMenuAthr.updateMenuAuth(auth);
|
|
|
}
|
|
|
- result.add(menuAthr);
|
|
|
+ result.add(userGropMenuAthr);
|
|
|
}
|
|
|
}
|
|
|
return result;
|
|
|
@@ -88,7 +88,6 @@ public class TbUserGropMenuAthrService {
|
|
|
this.userGropMenuAthrRepo.save(obj);
|
|
|
result.add(obj.toDto());
|
|
|
}
|
|
|
-
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
@@ -100,18 +99,4 @@ public class TbUserGropMenuAthrService {
|
|
|
return obj.toDto();
|
|
|
}
|
|
|
|
|
|
-// // 정보 삭제-목록, 존재하는 데이터 만 삭제
|
|
|
-// @Transactional
|
|
|
-// public List<TbUserGropMenuAthrDto> deleteByIds(List<TbUserGropMenuAthrKey> ids) {
|
|
|
-// List<TbUserGropMenuAthrDto> result = new ArrayList<>();
|
|
|
-// for (TbUserGropMenuAthrKey id : ids) {
|
|
|
-// Optional<TbUserGropMenuAthr> obj = this.userGropMenuAthrRepo.findById(id);
|
|
|
-// if (obj.isPresent()) {
|
|
|
-// this.userGropMenuAthrRepo.deleteById(id);
|
|
|
-// result.add(obj.get().toDto());
|
|
|
-// }
|
|
|
-// }
|
|
|
-// return result;
|
|
|
-// }
|
|
|
-
|
|
|
}
|