yumeng 2 лет назад
Родитель
Сommit
3e1e6dca2d

+ 13 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/controller/KuaishouItemCollectSamplesController.java

@@ -148,6 +148,19 @@ public class KuaishouItemCollectSamplesController extends BaseController {
     }
 
 
+    @GetMapping("/getUserList")
+    public JSONObject getUserList(Long userId){
+        JSONObject returnJson = new JSONObject();
+        Long deptId = sysDeptService.getDeptIdByUserId(userId);
+        List<JSONObject> userIds = sysDeptService.getUserListByDeptId(deptId);
+        returnJson.put("code",0);
+        returnJson.put("message","查询成功");
+        returnJson.put("data",userIds);
+        return returnJson;
+    }
+
+
+
     /**
      * 领样预览
      */

+ 4 - 0
ruixuan-system/src/main/java/com/ruixuan/system/mapper/SysDeptMapper.java

@@ -1,6 +1,8 @@
 package com.ruixuan.system.mapper;
 
 import java.util.List;
+
+import com.alibaba.fastjson.JSONObject;
 import org.apache.ibatis.annotations.Param;
 import com.ruixuan.common.core.domain.entity.SysDept;
 
@@ -119,4 +121,6 @@ public interface SysDeptMapper
     Long getDeptIdByUserId(Long userId);
 
     List<Long> getDeptUserListByDeptId(Long deptId);
+
+    List<JSONObject> getUserListByDeptId(@Param("deptId") Long deptId);
 }

+ 3 - 0
ruixuan-system/src/main/java/com/ruixuan/system/service/ISysDeptService.java

@@ -2,6 +2,7 @@ package com.ruixuan.system.service;
 
 import java.util.List;
 
+import com.alibaba.fastjson.JSONObject;
 import com.ruixuan.common.core.domain.TreeSelect;
 import com.ruixuan.common.core.domain.entity.SysDept;
 
@@ -134,4 +135,6 @@ public interface ISysDeptService {
      * @return 结果
      */
     public int deleteDeptById(Long deptId);
+
+    List<JSONObject> getUserListByDeptId(Long deptId);
 }

+ 7 - 0
ruixuan-system/src/main/java/com/ruixuan/system/service/impl/SysDeptServiceImpl.java

@@ -4,6 +4,8 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.stream.Collectors;
+
+import com.alibaba.fastjson.JSONObject;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruixuan.common.annotation.DataScope;
@@ -294,6 +296,11 @@ public class SysDeptServiceImpl implements ISysDeptService
         return deptMapper.deleteDeptById(deptId);
     }
 
+    @Override
+    public List<JSONObject> getUserListByDeptId(Long deptId) {
+        return deptMapper.getUserListByDeptId(deptId);
+    }
+
     /**
      * 递归列表
      */

+ 4 - 0
ruixuan-system/src/main/resources/mapper/system/SysDeptMapper.xml

@@ -92,6 +92,10 @@
     <select id="getDeptUserListByDeptId" resultType="java.lang.Long" parameterType="java.lang.Long">
 		select  user_id from sys_user  where  dept_id = #{deptId}
 	</select>
+    <select id="getUserListByDeptId" resultType="com.alibaba.fastjson.JSONObject"
+            parameterType="java.lang.Long">
+        select  user_id as 'userId',nick_name as 'userName' from sys_user  where  dept_id = #{deptId}
+    </select>
 
     <insert id="insertDept" parameterType="SysDept">
         insert into sys_dept(