Browse Source

Merge remote-tracking branch 'origin/master'

三七 1 week ago
parent
commit
707ee0c33c

+ 20 - 3
fs-company/src/main/java/com/fs/company/controller/qw/QwUserController.java

@@ -115,10 +115,10 @@ public class QwUserController extends BaseController
     public TableDataInfo staffList(QwUserListParam qwUser) {
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         qwUser.setCompanyId(loginUser.getCompany().getCompanyId());
-        // 添加部门查询条件
-        //本部门
+
+        // 添加企微部门查询条件
         Long deptId = qwUser.getDeptId();
-        if(deptId!=null){
+        if(deptId!=null && qwUser.getCorpId()!=null){
             List<Long> qwDeptIdList = new ArrayList<>();
             if (deptId!=null){
                 qwDeptIdList.add(deptId);
@@ -203,6 +203,23 @@ public class QwUserController extends BaseController
         if (!deptList.isEmpty()){
             combinedList.addAll(deptList);
         }
+
+        // 添加企微部门查询条件
+        Long qwDeptId = qwUser.getDeptId();
+        if(qwDeptId!=null && qwUser.getCorpId()!=null){
+            List<Long> qwDeptIdList = new ArrayList<>();
+            if (qwDeptId!=null){
+                qwDeptIdList.add(qwDeptId);
+            }
+            // 本部门的下级部门
+            List<Long> qwDeptList = qwUserService.selectDeptByParentId(qwDeptId,qwUser.getCorpId());
+            if (!qwDeptList.isEmpty()){
+                qwDeptIdList.addAll(qwDeptList);
+            }
+            qwUser.setQwDeptIdList(qwDeptIdList);
+        }
+
+
         qwUser.setCuDeptIdList(combinedList);
         qwUser.setUserType(loginUser.getUser().getUserType());
 

+ 1 - 1
fs-service/src/main/java/com/fs/qw/mapper/QwUserMapper.java

@@ -164,7 +164,7 @@ public interface QwUserMapper extends BaseMapper<QwUser>
             "                       #{item} " +
             "                   </foreach> " +
             "            </if>" +
-            "            <if test=\"qwDeptIdList != null and !qwDeptIdList.isEmpty() and  userType != '00' \">" +
+            "            <if test=\"qwDeptIdList != null and !qwDeptIdList.isEmpty() \">" +
             "               AND qd.dept_id IN " +
             "                   <foreach collection='qwDeptIdList' item='item' open='(' separator=',' close=')'> " +
             "                       #{item} " +