【7.1.2】【user】更新通知列表获取通知人员重复的问题

pull/22/head
fengshuonan 2021-08-23 21:21:56 +08:00
parent 5cc90fecbf
commit 80e35c94c1
2 changed files with 17 additions and 6 deletions

View File

@ -218,7 +218,7 @@ public interface SysUserService extends IService<SysUser>, UserServiceApi {
* @author liuhanqing
* @date 2021/1/15 11:16
*/
List<UserSelectTreeNode> getUserTreeNodeList(Long orgId);
List<UserSelectTreeNode> getUserTreeNodeList(Long orgId, List<UserSelectTreeNode> treeNodeList);
/**
*

View File

@ -432,7 +432,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
orgTreeNode.setValue(String.valueOf(hrOrganization.getOrgId()));
orgTreeNode.setSort(hrOrganization.getOrgSort());
treeNodeList.add(orgTreeNode);
List<UserSelectTreeNode> userNodeList = this.getUserTreeNodeList(hrOrganization.getOrgId());
List<UserSelectTreeNode> userNodeList = this.getUserTreeNodeList(hrOrganization.getOrgId(), treeNodeList);
if (userNodeList.size() > 0) {
treeNodeList.addAll(userNodeList);
}
@ -477,9 +477,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
}
@Override
public List<UserSelectTreeNode> getUserTreeNodeList(Long orgId) {
public List<UserSelectTreeNode> getUserTreeNodeList(Long orgId, List<UserSelectTreeNode> treeNodeList) {
// 定义返回结果
List<UserSelectTreeNode> treeNodeList = CollectionUtil.newArrayList();
List<UserSelectTreeNode> newTreeNodeList = CollectionUtil.newArrayList();
SysUserRequest userRequest = new SysUserRequest();
userRequest.setOrgId(orgId);
List<SysUserDTO> userList = this.baseMapper.findUserList(userRequest);
@ -491,9 +491,20 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
userTreeNode.setName(user.getRealName());
userTreeNode.setNodeType(TreeNodeEnum.USER.getCode());
userTreeNode.setValue(String.valueOf(user.getUserId()));
treeNodeList.add(userTreeNode);
// 判断参数treeNodeList是否包含这个用户如果包含了就不用返回了
boolean fillThisUser = true;
for (UserSelectTreeNode userSelectTreeNode : treeNodeList) {
if (userSelectTreeNode.getNodeId().equals(userTreeNode.getId())) {
fillThisUser = false;
break;
}
}
if (fillThisUser) {
newTreeNodeList.add(userTreeNode);
}
}
return treeNodeList;
return newTreeNodeList;
}
@Override