|
@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.constant.CacheConstant;
|
|
@@ -16,6 +18,7 @@ import org.jeecg.common.system.vo.SysUserCacheInfo;
|
|
|
import org.jeecg.common.util.PasswordUtil;
|
|
|
import org.jeecg.common.util.UUIDGenerator;
|
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
|
+import org.jeecg.modules.bytedance.common.utils.Check;
|
|
|
import org.jeecg.modules.system.entity.*;
|
|
|
import org.jeecg.modules.system.mapper.*;
|
|
|
import org.jeecg.modules.system.model.SysUserSysDepartModel;
|
|
@@ -438,8 +441,45 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|
|
public List<SysUser> queryByDepIds(List<String> departIds, String username) {
|
|
|
return userMapper.queryByDepIds(departIds,username);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public List<SysUser> queryPageList(SysUser user) {
|
|
|
+ SysUser sysUser = queryUserInfoById(user.getId());
|
|
|
+ if(Check.isNull(sysUser.getLeaderId())){
|
|
|
+ List<SysUser> mulUserList = new ArrayList<>();
|
|
|
+ mulUserList.add(sysUser);
|
|
|
+ return mulUserList;
|
|
|
+ }
|
|
|
+ List<SysUser> allList = userMapper.selectAllUser();
|
|
|
+ List<SysUser> mulUserList = treeCategoryData(allList, sysUser.getId());
|
|
|
+ mulUserList.add(sysUser);
|
|
|
+ return mulUserList;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<SysUser> queryAdminPageList(SysUser user) {
|
|
|
return userMapper.queryPageList(user);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ public SysUser queryUserInfoById(String id){
|
|
|
+ SysUser nullValueUser = new SysUser();
|
|
|
+ nullValueUser.setId(id);
|
|
|
+ List<SysUser> mulUserList = userMapper.queryPageList(nullValueUser);
|
|
|
+ return Check.isNull(mulUserList) ? null : mulUserList.get(0);
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<SysUser> treeCategoryData(List<SysUser> allList, String leaderId) {
|
|
|
+ List<SysUser> mapList = new ArrayList<>();
|
|
|
+ for (SysUser vo : allList) {
|
|
|
+ if (leaderId.equals(vo.getLeaderId())){
|
|
|
+ mapList.add(vo);
|
|
|
+ mapList.addAll(treeCategoryData(allList,vo.getId()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return mapList;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|