| | |
| | | import cn.huge.base.common.utils.IdUtils; |
| | | import cn.huge.module.client.api.impl.UtilsClientImpl; |
| | | import cn.huge.module.ctrole.dao.mapper.CtRoleMapper; |
| | | import cn.huge.module.ctrole.domain.bo.CtRoleBO; |
| | | import cn.huge.module.ctrole.domain.po.CtRole; |
| | | import cn.huge.module.ctuser.domain.bo.RoleTreeBO; |
| | | import cn.huge.module.ctuser.service.CtUserService; |
| | | import cn.huge.module.cust.dto.CtUserDTO; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | |
| | | @Autowired |
| | | private UtilsClientImpl utilsClient; |
| | | |
| | | @Autowired |
| | | private CtUserService ctUserService; |
| | | |
| | | @Autowired |
| | | private CtRolefunService ctRolefunService; |
| | | |
| | | /** |
| | | * 更新对象 |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据单位编号和角色编号查询 |
| | | * @param unitId 单位编号 |
| | | * @param roleId 角色编号 |
| | | * @return |
| | | */ |
| | | public CtRole getByUnitIdAndRoleId(String unitId, String roleId){ |
| | | QueryWrapper<CtRole> ctRoleQueryWrapper = new QueryWrapper<>(); |
| | | ctRoleQueryWrapper.eq("unit_id", unitId).eq("role_code", roleId); |
| | | CtRole ctRole = mapper.selectOne(ctRoleQueryWrapper); |
| | | return ctRole; |
| | | } |
| | | |
| | | /** |
| | | * 根据单位编号和角色编号查询 |
| | | * @param id |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | public CtRoleBO webGetById(String id, String userId){ |
| | | // 临时-演示用户赋予超级管理员角色 |
| | | // 获取当前登录用户 |
| | | CtUserDTO loginUser = ctUserService.clientGetUserAll(userId); |
| | | String acc = loginUser.getAcc(); |
| | | if ("yanstjy".equals(acc) || "yansjdb".equals(acc)){ |
| | | id = "2303191513151003"; |
| | | } |
| | | CtRole ctRole = this.getById(id); |
| | | CtRoleBO bo = new CtRoleBO(); |
| | | BeanUtils.copyProperties(ctRole,bo); |
| | | //查询角色权限 |
| | | List<RoleTreeBO> roleTrees = ctRolefunService.getRolefunTree(ctRole.getId()); |
| | | bo.setRoleTreeBOS(roleTrees); |
| | | return bo; |
| | | } |
| | | } |