From b98a61c0c707c9fc3a51e68fe67909cb06aaafcd Mon Sep 17 00:00:00 2001
From: lizijie <lzjiiie@163.com>
Date: Thu, 17 Jun 2021 11:45:17 +0800
Subject: [PATCH] Merge branch 'dev' of http://blit.7drlb.com:8888/r/moral into dev

---
 screen-manage/src/main/java/com/moral/api/service/impl/ManageRoleServiceImpl.java |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/screen-manage/src/main/java/com/moral/api/service/impl/ManageRoleServiceImpl.java b/screen-manage/src/main/java/com/moral/api/service/impl/ManageRoleServiceImpl.java
index 72b79bc..4877afb 100644
--- a/screen-manage/src/main/java/com/moral/api/service/impl/ManageRoleServiceImpl.java
+++ b/screen-manage/src/main/java/com/moral/api/service/impl/ManageRoleServiceImpl.java
@@ -4,16 +4,15 @@
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.moral.api.entity.*;
 import com.moral.api.mapper.*;
-import com.moral.api.pojo.dto.login.AccountInfoDTO;
 import com.moral.api.service.ManageRoleService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.moral.api.util.LogUtils;
 import com.moral.constant.Constants;
 import com.moral.constant.ResponseCodeEnum;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.ObjectUtils;
 import org.springframework.util.StringUtils;
 import org.springframework.web.context.request.RequestContextHolder;
 import org.springframework.web.context.request.ServletRequestAttributes;
@@ -239,6 +238,21 @@
         return resultMap;
     }
 
+    @Override
+    public ManageRole getRoleByAccountId(Integer accountId) {
+        QueryWrapper<ManageAccountRole> queryAccountRoleWrapper = new QueryWrapper<>();
+        queryAccountRoleWrapper.eq("is_delete",Constants.NOT_DELETE);
+        queryAccountRoleWrapper.eq("account_id",accountId);
+        ManageAccountRole accountRole = manageAccountRoleMapper.selectOne(queryAccountRoleWrapper);
+        if(ObjectUtils.isEmpty(accountRole))
+            return null;
+        Integer roleId = accountRole.getRoleId();
+        QueryWrapper<ManageRole> queryRoleWrapper = new QueryWrapper();
+        queryRoleWrapper.eq("is_delete", Constants.NOT_DELETE);
+        queryRoleWrapper.eq("id", roleId);
+        return  manageRoleMapper.selectOne(queryRoleWrapper);
+    }
+
     /**
      * @Description: ���������������
      * @Param: [list, menuId]list���menuId������

--
Gitblit v1.8.0