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
@@ -5,8 +5,15 @@
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.rsoper.domain.dto.RoleMenuTreeDTO;
import cn.huge.module.ctuser.service.CtUserService;
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;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import lombok.extern.slf4j.Slf4j;
@@ -37,6 +44,12 @@
    @Autowired
    private UtilsClientImpl utilsClient;
    @Autowired
    private CtUserService ctUserService;
    @Autowired
    private CtRolefunService ctRolefunService;
    @Autowired
    private RsRolefunService rsRolefunService;
    /**
    * 更新对象
@@ -128,4 +141,16 @@
        }
    }
    /**
     * 根据单位编号和角色编号查询
     * @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;
    }
}