| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | import org.springblade.core.tool.support.Kv; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springblade.modules.house.dto.UserHouseLabelDTO; |
| | | import org.springblade.modules.house.service.IUserHouseLabelService; |
| | | import org.springblade.modules.system.dto.MenuDTO; |
| | | import org.springblade.modules.system.entity.*; |
| | | import org.springblade.modules.system.mapper.MenuMapper; |
| | |
| | | private final ITopMenuSettingService topMenuSettingService; |
| | | private final static String PARENT_ID = "parentId"; |
| | | private final static Integer MENU_CATEGORY = 1; |
| | | |
| | | @Resource |
| | | private IUserHouseLabelService iUserHouseLabelService; |
| | | |
| | | @Override |
| | | public List<MenuVO> lazyList(Long parentId, Map<String, Object> param) { |
| | |
| | | roleMenus = tenantPackageMenu(baseMapper.roleMenuByRoleId(Func.toLongList(roleId), menuType)); |
| | | // 1:居民,居民需要通过人的标签来显示取保候审 |
| | | if (CommonConstant.RESIDENT.equals(roleName)) { |
| | | extracted(labelType, roleMenus); |
| | | // extracted(labelType, roleMenus); |
| | | } |
| | | } |
| | | // 顶部菜单请求返回对应角色权限菜单 |
| | |
| | | * @param labelType |
| | | */ |
| | | private void extracted(Integer labelType, List<Menu> roleMenus) { |
| | | UserHouseLabelDTO userHouseLabelDTO = new UserHouseLabelDTO(); |
| | | userHouseLabelDTO.setUserId(AuthUtil.getUserId()); |
| | | userHouseLabelDTO.setLableType(labelType); |
| | | List<Integer> integers = iUserHouseLabelService.selectUserLabelList(userHouseLabelDTO); |
| | | Iterator<Menu> iterator = roleMenus.iterator(); |
| | | while (iterator.hasNext()) { |
| | | Menu next = iterator.next(); |
| | | if (!next.getParentId().equals(0)) { |
| | | if (StringUtils.isNotBlank(next.getLabelId())) { |
| | | String[] split = next.getLabelId().split(","); |
| | | List<Integer> integerList = Arrays.stream(split).map(Integer::valueOf).collect(Collectors.toList()); |
| | | Collection<? extends Serializable> union = CollectionUtils.intersection(integerList, integers); |
| | | if (union.size() == 0) { |
| | | iterator.remove(); |
| | | // 场所的时候,删除取保候审 |
| | | } else if (CommonConstant.NUMBER_TWO.equals(labelType)) { |
| | | if (next.getName().trim().equals("取保候审")) { |
| | | iterator.remove(); |
| | | } |
| | | } |
| | | } else { |
| | | if (next.getName().trim().equals("取保候审")) { |
| | | iterator.remove(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |