| | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.mapper.MenuMapper; |
| | | import com.dsh.course.model.node.MenuNode; |
| | | import com.dsh.course.model.node.ZTreeNode; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.modular.system.model.Relation; |
| | | import com.dsh.guns.modular.system.service.IRelationService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.dsh.guns.modular.system.model.Menu; |
| | |
| | | return this.baseMapper.getMenuIdsByRoleId(roleId); |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private IRelationService relationService; |
| | | @Override |
| | | public List<ZTreeNode> menuTreeList() { |
| | | return this.baseMapper.menuTreeList(); |
| | | List<ZTreeNode> zTreeNodes = this.baseMapper.menuTreeList(); |
| | | if(UserExt.getUser().getObjectType()==3){ |
| | | List<Relation> list = relationService.list(new LambdaQueryWrapper<Relation>().eq(Relation::getRoleid, 3)); |
| | | List<Long> collect = list.stream().map(Relation::getMenuid).collect(Collectors.toList()); |
| | | zTreeNodes= zTreeNodes.stream().filter(e -> collect.contains(e.getId())).collect(Collectors.toList()); |
| | | } |
| | | return zTreeNodes; |
| | | } |
| | | |
| | | @Override |