From 1789718f58e3374ce85357524ef80a84f3d70d6f Mon Sep 17 00:00:00 2001
From: jiangqs <jiangqs>
Date: 星期日, 25 六月 2023 18:36:01 +0800
Subject: [PATCH] 商户端统计

---
 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/staff/SysStaffServiceImpl.java |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/staff/SysStaffServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/staff/SysStaffServiceImpl.java
index 73fae8e..c82f9cc 100644
--- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/staff/SysStaffServiceImpl.java
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/staff/SysStaffServiceImpl.java
@@ -1,14 +1,17 @@
 package com.ruoyi.system.service.impl.staff;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ruoyi.common.core.utils.uuid.IdUtils;
 import com.ruoyi.common.security.utils.SecurityUtils;
 import com.ruoyi.system.api.domain.dto.MgtBaseGetDto;
 import com.ruoyi.system.api.domain.poji.sys.SysUser;
 import com.ruoyi.system.domain.dto.MgtStaffEditDto;
+import com.ruoyi.system.domain.dto.MgtStaffPageDto;
 import com.ruoyi.system.domain.pojo.staff.SysStaff;
 import com.ruoyi.system.domain.vo.MgtDeptStaffListVo;
+import com.ruoyi.system.domain.vo.MgtStaffPageVo;
 import com.ruoyi.system.mapper.staff.SysStaffMapper;
 import com.ruoyi.system.service.staff.SysStaffService;
 import com.ruoyi.system.service.sys.ISysUserService;
@@ -44,6 +47,28 @@
     @Override
     public List<MgtDeptStaffListVo> listMgtDeptStaff(){
         return sysStaffMapper.listMgtDeptStaff();
+    }
+
+    /**
+     * @description 通过权限获取部门员工列表
+     * @author  jqs
+     * @date    2023/6/21 10:24
+     * @param userId
+     * @return  List<MgtDeptStaffListVo>
+     */
+    @Override
+    public List<MgtDeptStaffListVo>listMgtDeptStaffByPermission(Long userId){
+        SysUser sysUser = sysUserService.getById(userId);
+        String dataScope = sysUser.getDataScope();
+        List<MgtDeptStaffListVo> deptStaffListVoList;
+        if(dataScope.equals("4")){
+            deptStaffListVoList = sysStaffMapper.listMgtDeptStaffByDept(sysUser.getDeptId(),null);
+        }else if(dataScope.equals("5")){
+            deptStaffListVoList = sysStaffMapper.listMgtDeptStaffByDept(sysUser.getDeptId(),sysUser.getUserId());
+        }else{
+            deptStaffListVoList = sysStaffMapper.listMgtDeptStaff();
+        }
+        return deptStaffListVoList;
     }
 
     /**
@@ -125,4 +150,17 @@
         this.saveOrUpdate(sysStaff);
         sysUserService.deleteUserById(mgtBaseGetDto.getUserId());
     }
+
+    /**
+     * @description
+     * @author  jqs
+     * @date    2023/6/25 17:52
+     * @param page
+     * @param mgtStaffPageDto
+     * @return  List<MgtStaffPageVo>
+     */
+    @Override
+    public List<MgtStaffPageVo> pageMgtStaff(Page page, MgtStaffPageDto mgtStaffPageDto){
+        return sysStaffMapper.pageMgtStaff(page, mgtStaffPageDto);
+    }
 }

--
Gitblit v1.7.1