wangyangyang il y a 4 ans
Parent
commit
c2b9206020

+ 1 - 1
user_center/src/main/java/com/huaxu/dao/UserMapper.java

@@ -38,7 +38,7 @@ public interface UserMapper extends BaseMapper<UserEntity> {
 
     List<UserEntity> findUserList(@Param("user")UserEntity userEntity);
 
-    List<UserEntity> findUserIdsForOrg(@Param("compayId")Integer compayId, @Param("deptId")Integer deptId,@Param("ids")String ids);
+    List<UserEntity> findUserIdsForOrg(@Param("compayId")Integer compayId, @Param("deptId")Integer deptId,@Param("ids")List<Long> ids);
 
 
 

+ 7 - 2
user_center/src/main/java/com/huaxu/service/UserService.java

@@ -346,11 +346,16 @@ public class UserService extends ServiceImpl<UserMapper,UserEntity> {
 		LoginUser currentUser = UserUtil.getCurrentUser();
 		Integer compayId = currentUser.getCompanyId();
 		Integer deptId = currentUser.getDepartmentId();
-		compayId = 262;
 		String ids = "";
 		if (deptId != null)
 			ids = orgMapper.findParentOrgByChildId(deptId);
-		List<UserEntity> list = userMapper.findUserIdsForOrg(compayId, deptId, ids);
+		List<Long> idList = new ArrayList<>();
+		String[] as = ids.split(",");
+		for(String item : as)
+		{
+			idList.add(Long.valueOf(item));
+		}
+		List<UserEntity> list = userMapper.findUserIdsForOrg(compayId, deptId, idList);
 		return list;
 	}
 	public List<Integer> findUserIdsByPermissonOrg(String tenantId,Integer companyOrgId,Integer deptOrgId){

+ 4 - 1
user_center/src/main/resources/mapper/UserMapper.xml

@@ -225,7 +225,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             and (
                a.COMPANY_ORG_ID = #{compayId}
                 <if test="deptId != null and deptId != ''">
-                   and a.DEPT_ORG_ID in (#{ids})
+                   and a.DEPT_ORG_ID in
+                    <foreach collection="ids" item="item" open="(" close=")" separator=",">
+                        #{item}
+                    </foreach>
                 </if>
             )
         </if>