|
|
@@ -264,27 +264,27 @@ public class KwsMenuService {
|
|
|
extracted(reqVo.getUserId(), findMenuTreePojo);
|
|
|
|
|
|
List<KwsMenuResVo> menuList = kwsMenuDao.findList(findMenuTreePojo);
|
|
|
+ if (CollectionUtils.isEmpty(menuList)) {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
+
|
|
|
List<KwsMenuResVo> finalList = new ArrayList<>();
|
|
|
//app菜单特殊处理
|
|
|
if (SystemTypeEnum.COMPANY.getCode().equals(LoginUserHolder.getSystemType()) &&
|
|
|
ClientTypeEnum.app.getValue().equals(LoginUserHolder.getClientType()) &&
|
|
|
- Objects.equals(LoginUserHolder.getIsMain(), Global.NO) &&
|
|
|
- Objects.equals(LoginUserHolder.getEntId(), 156382319450525696L)) {
|
|
|
- for (KwsMenuResVo kwsMenuResVo : menuList) {
|
|
|
- List<KwsMenuMapping> kwsMenuMappings = kwsMenuMappingDao.selectByMenuId(kwsMenuResVo.getId());
|
|
|
- if (CollectionUtils.isEmpty(kwsMenuMappings)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- List<Long> mapIds = kwsMenuMappings.stream().map(KwsMenuMapping::getMappingId).toList();
|
|
|
- List<KwsMenu> kwsMenus = kwsMenuDao.selectByKeys(mapIds);
|
|
|
- if (CollectionUtils.isEmpty(kwsMenus)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
+ Objects.equals(LoginUserHolder.getIsMain(), Global.NO)) {
|
|
|
+ List<KwsMenuMapping> kwsMenuMappings = kwsMenuMappingDao.selectByMenuIds(menuList.stream().map(KwsMenuResVo::getId).toList());
|
|
|
+ if (CollectionUtils.isEmpty(kwsMenuMappings)) {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
|
|
|
- List<KwsMenuResVo> kwsMenuResVos = BeanUtils.copyToList(kwsMenus, KwsMenuResVo.class);
|
|
|
- finalList.addAll(kwsMenuResVos);
|
|
|
+ List<Long> mapIds = kwsMenuMappings.stream().map(KwsMenuMapping::getMappingId).toList();
|
|
|
+ List<KwsMenu> kwsMenus = kwsMenuDao.selectByKeys(mapIds);
|
|
|
+ if (CollectionUtils.isEmpty(kwsMenus)) {
|
|
|
+ return Collections.emptyList();
|
|
|
}
|
|
|
+
|
|
|
+ finalList = BeanUtils.copyToList(kwsMenus, KwsMenuResVo.class);
|
|
|
} else {
|
|
|
finalList = menuList;
|
|
|
}
|
|
|
@@ -335,6 +335,8 @@ public class KwsMenuService {
|
|
|
if (CollectionUtils.isEmpty(allByUserId)) {
|
|
|
throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.ROLE_NOT_EXISTS);
|
|
|
}
|
|
|
+ //特殊处理,员工账号先查pc端的菜单,后面会做菜单关联
|
|
|
+ findMenuTreePojo.setClientType(String.valueOf(SystemTypeEnum.COMPANY.getCode()));
|
|
|
findMenuTreePojo.setRoleIds(allByUserId.stream().map(KwsUserRole::getRoleId).toList());
|
|
|
}
|
|
|
|