forked from gzzfw/backEnd/gz-dyh

liyj
2024-09-10 47fa44a60a9dffee1e122a72b61badc36726b300
dyh-service/dyh-cust/src/main/java/cn/huge/module/ctrole/service/CtRoleService.java
@@ -7,9 +7,10 @@
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.rsoper.domain.dto.RoleMenuTreeDTO;
import cn.huge.module.ctuser.service.CtUserService;
import cn.huge.module.cust.dto.CtUserDTO;
import cn.huge.module.rsoper.domain.po.RsRole;
import cn.huge.module.rsoper.service.RsRolefunService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.BeanUtils;
@@ -43,12 +44,12 @@
    @Autowired
    private UtilsClientImpl utilsClient;
    @Autowired
    private CtUserService ctUserService;
    @Autowired
    private CtRolefunService ctRolefunService;
    @Autowired
    private RsRolefunService rsRolefunService;
    /**
    * 更新对象
@@ -151,28 +152,5 @@
        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;
    }
}