From b47d4a7accabce974e19d2a1ffb3c5c67507d74b Mon Sep 17 00:00:00 2001
From: wangwh <2397901735@qq.com>
Date: Wed, 28 Aug 2024 15:11:59 +0800
Subject: [PATCH] 1、组织架构的接口 2、事项登记接口

---
 dyh-service/dyh-cust/src/main/java/cn/huge/module/ctrole/service/CtRoleService.java |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctrole/service/CtRoleService.java b/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctrole/service/CtRoleService.java
index b7c0bc3..dbf45ca 100644
--- a/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctrole/service/CtRoleService.java
+++ b/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctrole/service/CtRoleService.java
@@ -5,9 +5,14 @@
 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;
@@ -38,6 +43,12 @@
 
     @Autowired
     private UtilsClientImpl utilsClient;
+
+    @Autowired
+    private CtUserService ctUserService;
+
+    @Autowired
+    private CtRolefunService ctRolefunService;
 
     /**
     * 更新对象
@@ -142,4 +153,26 @@
         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;
+    }
 }

--
Gitblit v1.8.0