Commit a839cf2c by 刘宇峰

Merge branch 'v1.5.0' into 'master'

V1.5.0

See merge request !1
2 parents d235712b 9460fa6a
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<packaging>war</packaging> <packaging>war</packaging>
<artifactId>glsx-ne-shield-usercenter</artifactId> <artifactId>ne-shield-usercenter</artifactId>
<properties> <properties>
<kaptcha.version>0.0.9</kaptcha.version> <kaptcha.version>0.0.9</kaptcha.version>
<shiro.version>1.6.0</shiro.version> <shiro.version>1.8.0</shiro.version>
</properties> </properties>
<dependencies> <dependencies>
...@@ -44,8 +44,8 @@ ...@@ -44,8 +44,8 @@
<dependency> <dependency>
<groupId>com.glsx</groupId> <groupId>com.glsx</groupId>
<artifactId>glsx-ne-shield-auth-client</artifactId> <artifactId>ne-shield-auth-client</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.1.0-SNAPSHOT</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
......
...@@ -2,7 +2,10 @@ package cn.com.glsx.shield.modules.api; ...@@ -2,7 +2,10 @@ package cn.com.glsx.shield.modules.api;
import cn.com.glsx.auth.api.AuthFeignClient; import cn.com.glsx.auth.api.AuthFeignClient;
import cn.com.glsx.auth.model.MenuPermission; import cn.com.glsx.auth.model.MenuPermission;
import cn.com.glsx.auth.model.SimpleUser;
import cn.com.glsx.auth.model.SyntheticUser; import cn.com.glsx.auth.model.SyntheticUser;
import cn.com.glsx.shield.common.exception.UserCenterException;
import cn.com.glsx.shield.modules.entity.User;
import cn.com.glsx.shield.modules.service.UserService; import cn.com.glsx.shield.modules.service.UserService;
import com.glsx.plat.core.web.R; import com.glsx.plat.core.web.R;
import com.glsx.plat.jwt.base.ComJwtUser; import com.glsx.plat.jwt.base.ComJwtUser;
...@@ -29,6 +32,34 @@ public class AuthApiController implements AuthFeignClient { ...@@ -29,6 +32,34 @@ public class AuthApiController implements AuthFeignClient {
private JwtUtils<ComJwtUser> jwtUtils; private JwtUtils<ComJwtUser> jwtUtils;
@Override @Override
public R<SimpleUser> login(String account, String password) {
User user = userService.findByAccount(account);
userService.verify(user, password);
SimpleUser simpleUser = new SimpleUser();
simpleUser.setId(user.getId());
simpleUser.setAccount(user.getAccount());
simpleUser.setUsername(user.getUsername());
return R.ok().data(simpleUser);
}
@Override
public R<SimpleUser> getSimpleUserById(Long userId) {
User user = userService.getById(userId);
if (user == null) {
throw new UserCenterException("用户不存在");
}
SimpleUser simpleUser = new SimpleUser();
simpleUser.setId(user.getId());
simpleUser.setAccount(user.getAccount());
simpleUser.setUsername(user.getUsername());
return R.ok().data(simpleUser);
}
@Override
public R<Boolean> sniff() { public R<Boolean> sniff() {
String token = SessionUtils.request().getHeader(HttpHeaders.AUTHORIZATION); String token = SessionUtils.request().getHeader(HttpHeaders.AUTHORIZATION);
boolean verifyFlag = jwtUtils.verifyToken(token); boolean verifyFlag = jwtUtils.verifyToken(token);
...@@ -37,28 +68,34 @@ public class AuthApiController implements AuthFeignClient { ...@@ -37,28 +68,34 @@ public class AuthApiController implements AuthFeignClient {
@Override @Override
public R<SyntheticUser> getAuthUser() { public R<SyntheticUser> getAuthUser() {
SyntheticUser authUser = userService.getSyntheticUser(); SyntheticUser authUser = userService.getSyntheticUserByToken();
return R.ok().data(authUser);
}
@Override
public R<SyntheticUser> getAuthUserById(Long userId) {
SyntheticUser authUser = userService.getSyntheticUserById(userId);
return R.ok().data(authUser); return R.ok().data(authUser);
} }
@Override @Override
public R<Set<Long>> getAuthDeptIds() { public R<Set<Long>> getAuthDeptIds() {
// TODO: 2021/6/10 单独查询 // TODO: 2021/6/10 单独查询
SyntheticUser authUser = userService.getSyntheticUser(); SyntheticUser authUser = userService.getSyntheticUserByToken();
return R.ok().data(authUser.getVisibleDeptIds()); return R.ok().data(authUser.getVisibleDeptIds());
} }
@Override @Override
public R<Set<Long>> getAuthUserIds() { public R<Set<Long>> getAuthUserIds() {
// TODO: 2021/6/10 单独查询 // TODO: 2021/6/10 单独查询
SyntheticUser authUser = userService.getSyntheticUser(); SyntheticUser authUser = userService.getSyntheticUserByToken();
return R.ok().data(authUser.getVisibleCreatorIds()); return R.ok().data(authUser.getVisibleCreatorIds());
} }
@Override @Override
public R<List<MenuPermission>> getPermMenus() { public R<List<MenuPermission>> getPermMenus() {
// TODO: 2021/6/10 单独查询 // TODO: 2021/6/10 单独查询
SyntheticUser authUser = userService.getSyntheticUser(); SyntheticUser authUser = userService.getSyntheticUserByToken();
List<MenuPermission> list = userService.getPermissionMenus(authUser); List<MenuPermission> list = userService.getPermissionMenus(authUser);
return R.ok().data(list); return R.ok().data(list);
} }
......
...@@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Set;
/** /**
* feign组织机构服务接口 * feign组织机构服务接口
...@@ -149,6 +150,12 @@ public class FeignOrganizationController implements cn.com.glsx.usercenter.api.f ...@@ -149,6 +150,12 @@ public class FeignOrganizationController implements cn.com.glsx.usercenter.api.f
} }
@Override @Override
public R<Set<Long>> getAllSubOrgIds() {
Set<Long> levelDeptList = organizationService.getAllSubOrgIds();
return R.ok().data(levelDeptList);
}
@Override
public R orgTree(@RequestBody FindOrgRequest request) { public R orgTree(@RequestBody FindOrgRequest request) {
OrgTreeSearch search = new OrgTreeSearch(); OrgTreeSearch search = new OrgTreeSearch();
search.setOrgName(request.getOrgName()); search.setOrgName(request.getOrgName());
......
...@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Set;
/** /**
* feign用户服务接口 * feign用户服务接口
...@@ -53,25 +54,32 @@ public class FeignUserController implements cn.com.glsx.usercenter.api.feign.Use ...@@ -53,25 +54,32 @@ public class FeignUserController implements cn.com.glsx.usercenter.api.feign.Use
} }
@Override @Override
@GetMapping(value = "/getSuperiorUserById") @GetMapping(value = "/getSuperiorById")
public R<User> getSuperiorUserById(@RequestParam("id") Long id) { public R<User> getSuperiorById(@RequestParam("id") Long userId) {
cn.com.glsx.shield.modules.entity.User u = userService.getSuperiorUserById(id); cn.com.glsx.shield.modules.entity.User u = userService.getSuperiorUserById(userId);
User user = null; User user = null;
if (u != null) { if (u != null) {
user = UserConverter.INSTANCE.do2foo(u); user = UserConverter.INSTANCE.do2foo(u);
user.setMid(id); user.setMid(userId);
} }
return R.ok().data(user); return R.ok().data(user);
} }
@Override @Override
@PostMapping(value = "/getSuperiorUserByIds") @PostMapping(value = "/getSuperiorByIds")
public R<List<User>> getSuperiorUserByIds(@RequestBody Collection<Long> userIds) { public R<List<User>> getSuperiorByIds(@RequestBody Collection<Long> userIds) {
List<User> userList = userService.getSuperiorUserByIds(userIds); List<User> userList = userService.getSuperiorUserByIds(userIds);
return R.ok().data(userList); return R.ok().data(userList);
} }
@Override @Override
@GetMapping(value = "/getSubordinateById")
public R<Set<Long>> getSubordinateById(@RequestParam("id") Long userId) {
Set<Long> userIdSet = userService.getSubordinateById(userId);
return R.ok().data(userIdSet);
}
@Override
@ApiOperation(value = "系统用户列表查询") @ApiOperation(value = "系统用户列表查询")
@GetMapping("/findByUser") @GetMapping("/findByUser")
public R<List<User>> findByUser(@RequestBody FindUserRequest request) { public R<List<User>> findByUser(@RequestBody FindUserRequest request) {
......
...@@ -24,6 +24,8 @@ public interface UserMapper extends CommonBaseMapper<User> { ...@@ -24,6 +24,8 @@ public interface UserMapper extends CommonBaseMapper<User> {
List<User> selectByTenantId(@Param("tenantId") Long tenantId); List<User> selectByTenantId(@Param("tenantId") Long tenantId);
List<User> selectByTenantIds(@Param("tenantIds") Collection<Long> tenantIds);
List<User> selectByDepartmentId(@Param("departmentId") Long departmentId); List<User> selectByDepartmentId(@Param("departmentId") Long departmentId);
List<OrgModel> selectUserOrgModelById(@Param("id") Long id); List<OrgModel> selectUserOrgModelById(@Param("id") Long id);
......
...@@ -20,7 +20,7 @@ public class UserBO { ...@@ -20,7 +20,7 @@ public class UserBO {
private Long id; private Long id;
@Size(min = 5, max = 50) @Size(min = 3, max = 30)
@NotBlank @NotBlank
private String account; private String account;
......
...@@ -207,6 +207,12 @@ public class DepartmentService { ...@@ -207,6 +207,12 @@ public class DepartmentService {
List<Long> subUserIdList = userPathList.stream().map(UserPath::getSubId).collect(Collectors.toList()); List<Long> subUserIdList = userPathList.stream().map(UserPath::getSubId).collect(Collectors.toList());
return userMapper.selectByIds(subUserIdList); return userMapper.selectByIds(subUserIdList);
} else if (assignTenants.getCode().equals(role.getRolePermissionType())) {
List<RoleDataPermission> assignTenants = roleDataPermissionMapper.selectByRoleId(roleId);
List<Long> assignTenantIdList = assignTenants.stream().map(RoleDataPermission::getRefId).collect(Collectors.toList());
return userMapper.selectByTenantIds(assignTenantIdList);
} }
return userList; return userList;
} }
......
...@@ -20,6 +20,7 @@ import cn.com.glsx.shield.modules.model.view.DepartmentDTO; ...@@ -20,6 +20,7 @@ import cn.com.glsx.shield.modules.model.view.DepartmentDTO;
import cn.com.glsx.shield.modules.service.permissionStrategy.PermissionStrategy; import cn.com.glsx.shield.modules.service.permissionStrategy.PermissionStrategy;
import cn.com.glsx.usercenter.api.dto.tree.OrgModel; import cn.com.glsx.usercenter.api.dto.tree.OrgModel;
import cn.com.glsx.usercenter.api.dto.tree.OrgTreeModel; import cn.com.glsx.usercenter.api.dto.tree.OrgTreeModel;
import cn.hutool.json.JSONUtil;
import com.glsx.plat.common.model.TreeModel; import com.glsx.plat.common.model.TreeModel;
import com.glsx.plat.common.utils.StringUtils; import com.glsx.plat.common.utils.StringUtils;
import com.glsx.plat.common.utils.TreeModelUtil; import com.glsx.plat.common.utils.TreeModelUtil;
...@@ -250,6 +251,8 @@ public class OrganizationService { ...@@ -250,6 +251,8 @@ public class OrganizationService {
} }
public List orgTree(OrgTreeSearch search) { public List orgTree(OrgTreeSearch search) {
log.info("OrgTree OrgTreeSearch:{}", JSONUtil.toJsonStr(search));
List<? extends TreeModel> treeModels = this.getPermissionStrategy().orgTree(search); List<? extends TreeModel> treeModels = this.getPermissionStrategy().orgTree(search);
treeModels.sort(Comparator.comparing(TreeModel::getOrder)); treeModels.sort(Comparator.comparing(TreeModel::getOrder));
...@@ -305,4 +308,12 @@ public class OrganizationService { ...@@ -305,4 +308,12 @@ public class OrganizationService {
return levelOrgList; return levelOrgList;
} }
public Set<Long> getAllSubOrgIds() {
List<Organization> subOrgList = organizationMapper.selectAllSubBySuperiorId(ShieldContextHolder.getDepartmentId());
Set<Long> subOrgIdList = subOrgList.stream().map(Organization::getSubId).collect(Collectors.toSet());
return subOrgIdList;
}
} }
...@@ -31,6 +31,7 @@ import com.glsx.plat.jwt.base.ComJwtUser; ...@@ -31,6 +31,7 @@ import com.glsx.plat.jwt.base.ComJwtUser;
import com.glsx.plat.jwt.util.JwtUtils; import com.glsx.plat.jwt.util.JwtUtils;
import com.glsx.plat.web.utils.SessionUtils; import com.glsx.plat.web.utils.SessionUtils;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.shiro.authc.credential.HashedCredentialsMatcher; import org.apache.shiro.authc.credential.HashedCredentialsMatcher;
...@@ -701,13 +702,31 @@ public class UserService { ...@@ -701,13 +702,31 @@ public class UserService {
} }
/** /**
* 获取综合用户信息 * 获取综合用户信息by token
* *
* @return * @return
*/ */
public SyntheticUser getSyntheticUser() { public SyntheticUser getSyntheticUserByToken() {
User user = this.getByToken(); User user = this.getByToken();
return getSyntheticUser(user);
}
/**
* 获取综合用户信息by userId
*
* @return
*/
public SyntheticUser getSyntheticUserById(Long userId) {
User user = userMapper.selectById(userId);
return getSyntheticUser(user);
}
/**
* 获取综合用户信息
*
* @return
*/
public SyntheticUser getSyntheticUser(User user) {
boolean isSupperAdmin = UserGlobalType.SUPER_ADMIN.getType().equals(user.getGlobalType()); boolean isSupperAdmin = UserGlobalType.SUPER_ADMIN.getType().equals(user.getGlobalType());
SyntheticUser authUser = new SyntheticUser(); SyntheticUser authUser = new SyntheticUser();
...@@ -718,7 +737,6 @@ public class UserService { ...@@ -718,7 +737,6 @@ public class UserService {
// TODO: 2020/9/24 缓存数据 // TODO: 2020/9/24 缓存数据
//租户 //租户
Tenant tenant = tenantMapper.selectById(user.getTenantId()); Tenant tenant = tenantMapper.selectById(user.getTenantId());
authUser.setTenant(AuthTenantConverter.INSTANCE.toAuthTenant(tenant)); authUser.setTenant(AuthTenantConverter.INSTANCE.toAuthTenant(tenant));
...@@ -737,58 +755,63 @@ public class UserService { ...@@ -737,58 +755,63 @@ public class UserService {
authUser.setRoles(list); authUser.setRoles(list);
} }
//可见租户 //可见租户
Set<Long> tenantIds = this.getRelationAuthTenantIds(authUser); Set<Long> tenantIds = this.getRelationAuthTenantIds(user.getId(), roleList.get(0).getId());
//可见根部门(租户)
authUser.setVisibleTenantIds(tenantIds);
//可见部门
Set<Long> deptIds = this.getRelationAuthDeptIds(user.getId(), roleList.get(0).getId());
//可见组织(部门)
authUser.setVisibleDeptIds(deptIds);
//超级管理员无需查询更详细的部门、用户等信息 //超级管理员无需查询更详细的部门、用户等信息
if (!isSupperAdmin) { if (!isSupperAdmin) {
//可见部门
Set<Long> deptIds = this.getRelationAuthDeptIds(authUser);
//可见用户 //可见用户
Set<Long> userIds = this.getRelationAuthUserIds(authUser); Set<Long> userIds = this.getRelationAuthUserIds(user.getId(), roleList.get(0).getId());
//可见用户
authUser.setVisibleCreatorIds(userIds);
} }
return authUser; return authUser;
} }
public Set<Long> getRelationAuthTenantIds(SyntheticUser authUser) { /**
* 获取用户根据数据权限范围内的可见租户id
List<Tenant> deptList = departmentService.getUserRoleTenants(authUser.getUserId(), *
authUser.getRoles().get(0).getRoleId()); * @param userId
* @param roleId
Set<Long> tenantIds = deptList.stream().map(Tenant::getId).collect(Collectors.toSet()); * @return
*/
public Set<Long> getRelationAuthTenantIds(Long userId, Long roleId) {
//可见根部门(租户) List<Tenant> deptList = departmentService.getUserRoleTenants(userId, roleId);
authUser.setVisibleTenantIds(tenantIds);
return tenantIds; return deptList.stream().map(Tenant::getId).collect(Collectors.toSet());
} }
public Set<Long> getRelationAuthDeptIds(SyntheticUser authUser) { /**
* 获取用户根据数据权限范围内的可见部门id
List<Department> deptList = departmentService.getUserRoleDepartments(authUser.getUserId(), *
authUser.getRoles().get(0).getRoleId()); * @param userId
* @param roleId
Set<Long> deptIds = deptList.stream().map(Department::getId).collect(Collectors.toSet()); * @return
*/
public Set<Long> getRelationAuthDeptIds(Long userId, Long roleId) {
//可见组织(部门) List<Department> deptList = departmentService.getUserRoleDepartments(userId, roleId);
authUser.setVisibleDeptIds(deptIds);
return deptIds; return deptList.stream().map(Department::getId).collect(Collectors.toSet());
} }
/** /**
* 获取用户根据数据权限范围内的可见用户id * 获取用户根据数据权限范围内的可见用户id
* *
* @param authUser * @param userId
* @param roleId
* @return * @return
*/ */
public Set<Long> getRelationAuthUserIds(SyntheticUser authUser) { public Set<Long> getRelationAuthUserIds(Long userId, Long roleId) {
List<User> userList = departmentService.getUserRoleUsers(authUser.getUserId(), authUser.getRoles().get(0).getRoleId()); List<User> userList = departmentService.getUserRoleUsers(userId, roleId);
Set<Long> userIds = userList.stream().map(User::getId).collect(Collectors.toSet());
//可见用户 return userList.stream().map(User::getId).collect(Collectors.toSet());
authUser.setVisibleCreatorIds(userIds);
return userIds;
} }
/** /**
...@@ -983,6 +1006,16 @@ public class UserService { ...@@ -983,6 +1006,16 @@ public class UserService {
return userMapper.selectSuperiorUserById(id); return userMapper.selectSuperiorUserById(id);
} }
public Set<Long> getSubordinateById(Long userId) {
List<Role> roleList = roleService.getUserRoleList(userId);
if (CollectionUtils.isEmpty(roleList)) {
return Sets.newHashSet();
}
return this.getRelationAuthUserIds(userId, roleList.get(0).getId());
}
public List<cn.com.glsx.usercenter.api.dto.response.User> getSuperiorUserByIds(Collection<Long> userIds) { public List<cn.com.glsx.usercenter.api.dto.response.User> getSuperiorUserByIds(Collection<Long> userIds) {
return userMapper.selectSuperiorUserByIds(userIds); return userMapper.selectSuperiorUserByIds(userIds);
} }
......
...@@ -15,10 +15,12 @@ import com.glsx.plat.common.model.TreeModel; ...@@ -15,10 +15,12 @@ import com.glsx.plat.common.model.TreeModel;
import com.glsx.plat.common.utils.StringUtils; import com.glsx.plat.common.utils.StringUtils;
import com.glsx.plat.common.utils.TreeModelUtil; import com.glsx.plat.common.utils.TreeModelUtil;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.StopWatch;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Collection; import java.util.Collection;
...@@ -124,17 +126,11 @@ public class AllStrategy extends PermissionStrategy { ...@@ -124,17 +126,11 @@ public class AllStrategy extends PermissionStrategy {
if (CollectionUtils.isNotEmpty(search.getSubOrgIds())) { if (CollectionUtils.isNotEmpty(search.getSubOrgIds())) {
Map<Long, Set<Long>> subOrgIdListMap = getSubIdsMap(search.getSubOrgIds()); Map<Long, Set<Long>> subOrgIdListMap = getSubIdsMap(search.getSubOrgIds());
Collection<Long> finalOrgIds = orgIds;
//选中的节点及下级节点 //选中的节点及下级节点
Set<Long> selectSubOrgIds = Sets.newHashSet(); Set<Long> selectSubOrgIds = Sets.newHashSet();
for (Map.Entry<Long, Set<Long>> entry : subOrgIdListMap.entrySet()) { for (Map.Entry<Long, Set<Long>> entry : subOrgIdListMap.entrySet()) {
Set<Long> subOrgIds = entry.getValue().stream().filter(finalOrgIds::contains).collect(Collectors.toSet()); selectSubOrgIds.addAll(entry.getValue());
if (orgIds.contains(entry.getKey())) {
subOrgIds.add(entry.getKey());
}
selectSubOrgIds.addAll(subOrgIds);
} }
orgIds = selectSubOrgIds; orgIds = selectSubOrgIds;
...@@ -145,19 +141,43 @@ public class AllStrategy extends PermissionStrategy { ...@@ -145,19 +141,43 @@ public class AllStrategy extends PermissionStrategy {
orgIds = this.getUserOrgSuperiorIds(search.getUserIds()); orgIds = this.getUserOrgSuperiorIds(search.getUserIds());
} }
//如果有查询条件,如果没有过滤到需要查询的组织链,返回空数据
if ((StringUtils.isNotEmpty(search.getOrgName())
|| CollectionUtils.isNotEmpty(search.getOrgIds())
|| CollectionUtils.isNotEmpty(search.getSupOrgIds())
|| CollectionUtils.isNotEmpty(search.getSubOrgIds())
|| CollectionUtils.isNotEmpty(search.getUserIds())) && CollectionUtils.isEmpty(orgIds)) {
return Lists.newArrayList();
}
search.setOrgIds(orgIds); search.setOrgIds(orgIds);
StopWatch sw = new StopWatch();
sw.start("task1");
List<OrgModel> modelList = organizationMapper.selectOrgList(search); List<OrgModel> modelList = organizationMapper.selectOrgList(search);
List<Long> departmentIdList = modelList.stream().map(OrgModel::getOrgId).collect(Collectors.toList()); List<Long> departmentIdList = modelList.stream().map(OrgModel::getOrgId).collect(Collectors.toList());
sw.stop();
sw.start("task2");
//计算用户数 //计算用户数
Map<Long, Integer> recursiveDepartmentUserMap = departmentService.countRecursiveDepartmentUser(departmentIdList); Map<Long, Integer> recursiveDepartmentUserMap = departmentService.countRecursiveDepartmentUser(departmentIdList);
List<OrgTreeModel> orgTreeModelList = modelList.stream().map(OrgTreeModel::new).collect(Collectors.toList()); List<OrgTreeModel> orgTreeModelList = modelList.stream().map(OrgTreeModel::new).collect(Collectors.toList());
List<OrgTreeModel> allTreeModelList = Lists.newArrayList(orgTreeModelList); List<OrgTreeModel> allTreeModelList = Lists.newArrayList(orgTreeModelList);
sw.stop();
//查询需要的用户,然后放到对应的组织节点的child,如果需要返回用户子节点的话
Map<Long, List<OrgModel>> groupByOrgIdUserMap = Maps.newHashMap();
if (search.getHasUserLeaf() && CollectionUtils.isNotEmpty(departmentIdList)) {
List<OrgModel> allUserList = userMapper.selectUserOrgModels(new UserSearch().setDepartmentIds(departmentIdList).setUserIds(search.getUserIds()));
groupByOrgIdUserMap = allUserList.stream().collect(Collectors.groupingBy(OrgModel::getParentId));
}
sw.start("task3");
// final Set<Long> subRootOrgIds = subOrgIdListMap.keySet(); // final Set<Long> subRootOrgIds = subOrgIdListMap.keySet();
Map<Long, List<OrgModel>> finalGroupByOrgIdUserMap = groupByOrgIdUserMap;
orgTreeModelList.forEach(otm -> { orgTreeModelList.forEach(otm -> {
Long orgId = Long.valueOf(otm.getId()); Long orgId = Long.valueOf(otm.getId());
Integer userNumber = recursiveDepartmentUserMap.get(orgId); Integer userNumber = recursiveDepartmentUserMap.get(orgId);
...@@ -169,16 +189,21 @@ public class AllStrategy extends PermissionStrategy { ...@@ -169,16 +189,21 @@ public class AllStrategy extends PermissionStrategy {
// } // }
//用户子树 //用户子树
if (search.getHasUserLeaf() && otm.getUserNumber() > 0) { if (search.getHasUserLeaf() && otm.getUserNumber() > 0) {
List<OrgModel> userList = userMapper.selectUserOrgModels(new UserSearch().setDepartmentId(orgId).setUserIds(search.getUserIds())); List<OrgModel> userList = finalGroupByOrgIdUserMap.getOrDefault(orgId, Lists.newArrayList());
List<OrgTreeModel> userTreeList = userList.stream().map(OrgTreeModel::new).collect(Collectors.toList()); List<OrgTreeModel> userTreeList = userList.stream().map(OrgTreeModel::new).collect(Collectors.toList());
allTreeModelList.addAll(userTreeList); allTreeModelList.addAll(userTreeList);
} }
}); });
sw.stop();
sw.start("task4");
if (search.getReturnTrees()) { if (search.getReturnTrees()) {
List<? extends TreeModel> orgTree = TreeModelUtil.fastConvertByRootMark(allTreeModelList, 1); List<? extends TreeModel> orgTree = TreeModelUtil.fastConvertByRootMark(allTreeModelList, 1);
return orgTree; return orgTree;
} }
sw.stop();
log.info("任务耗时概览:{},总耗时:{}秒", sw.prettyPrint(), sw.getTotalTimeSeconds());
return allTreeModelList; return allTreeModelList;
} }
......
...@@ -17,6 +17,7 @@ import com.glsx.plat.common.model.TreeModel; ...@@ -17,6 +17,7 @@ import com.glsx.plat.common.model.TreeModel;
import com.glsx.plat.common.utils.StringUtils; import com.glsx.plat.common.utils.StringUtils;
import com.glsx.plat.common.utils.TreeModelUtil; import com.glsx.plat.common.utils.TreeModelUtil;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
...@@ -127,17 +128,11 @@ public class AssignTenantStrategy extends PermissionStrategy { ...@@ -127,17 +128,11 @@ public class AssignTenantStrategy extends PermissionStrategy {
if (CollectionUtils.isNotEmpty(search.getSubOrgIds())) { if (CollectionUtils.isNotEmpty(search.getSubOrgIds())) {
Map<Long, Set<Long>> subOrgIdListMap = getSubIdsMap(search.getSubOrgIds()); Map<Long, Set<Long>> subOrgIdListMap = getSubIdsMap(search.getSubOrgIds());
Collection<Long> finalOrgIds = orgIds;
//选中的节点及下级节点 //选中的节点及下级节点
Set<Long> selectSubOrgIds = Sets.newHashSet(); Set<Long> selectSubOrgIds = Sets.newHashSet();
for (Map.Entry<Long, Set<Long>> entry : subOrgIdListMap.entrySet()) { for (Map.Entry<Long, Set<Long>> entry : subOrgIdListMap.entrySet()) {
Set<Long> subOrgIds = entry.getValue().stream().filter(finalOrgIds::contains).collect(Collectors.toSet()); selectSubOrgIds.addAll(entry.getValue());
if (orgIds.contains(entry.getKey())) {
subOrgIds.add(entry.getKey());
}
selectSubOrgIds.addAll(subOrgIds);
} }
orgIds = selectSubOrgIds; orgIds = selectSubOrgIds;
...@@ -152,16 +147,26 @@ public class AssignTenantStrategy extends PermissionStrategy { ...@@ -152,16 +147,26 @@ public class AssignTenantStrategy extends PermissionStrategy {
List<Tenant> tenantList = departmentService.getRolePermissionTenants(); List<Tenant> tenantList = departmentService.getRolePermissionTenants();
Set<Long> tenantIds = tenantList.stream().map(Tenant::getId).collect(Collectors.toSet()); Set<Long> tenantIds = tenantList.stream().map(Tenant::getId).collect(Collectors.toSet());
//如果指定租户没有,返回空数据
if (CollectionUtils.isEmpty(tenantIds)) {
return Lists.newArrayList();
}
//如果有查询条件,如果没有过滤到需要查询的组织链,返回空数据
if ((StringUtils.isNotEmpty(search.getOrgName())
|| CollectionUtils.isNotEmpty(search.getOrgIds())
|| CollectionUtils.isNotEmpty(search.getSupOrgIds())
|| CollectionUtils.isNotEmpty(search.getSubOrgIds())
|| CollectionUtils.isNotEmpty(search.getUserIds())) && CollectionUtils.isEmpty(orgIds)) {
return Lists.newArrayList();
}
//指定数据权限租户 //指定数据权限租户
search.setTenantIds(tenantIds); search.setTenantIds(tenantIds);
//过滤出的组织 //过滤出的组织
search.setOrgIds(orgIds); search.setOrgIds(orgIds);
//如果没有过滤到需要查询的组织链,返回空数据
if (CollectionUtils.isEmpty(orgIds) && CollectionUtils.isEmpty(tenantIds)) {
return Lists.newArrayList();
}
List<OrgModel> modelList = organizationMapper.selectOrgList(search); List<OrgModel> modelList = organizationMapper.selectOrgList(search);
List<Long> departmentIdList = modelList.stream().map(OrgModel::getOrgId).collect(Collectors.toList()); List<Long> departmentIdList = modelList.stream().map(OrgModel::getOrgId).collect(Collectors.toList());
...@@ -172,13 +177,21 @@ public class AssignTenantStrategy extends PermissionStrategy { ...@@ -172,13 +177,21 @@ public class AssignTenantStrategy extends PermissionStrategy {
List<OrgTreeModel> allTreeModelList = Lists.newArrayList(orgTreeModelList); List<OrgTreeModel> allTreeModelList = Lists.newArrayList(orgTreeModelList);
//查询需要的用户,然后放到对应的组织节点的child,如果需要返回用户子节点的话
Map<Long, List<OrgModel>> groupByOrgIdUserMap = Maps.newHashMap();
if (search.getHasUserLeaf() && CollectionUtils.isNotEmpty(departmentIdList)) {
List<OrgModel> allUserList = userMapper.selectUserOrgModels(new UserSearch().setDepartmentIds(departmentIdList).setUserIds(search.getUserIds()));
groupByOrgIdUserMap = allUserList.stream().collect(Collectors.groupingBy(OrgModel::getParentId));
}
Map<Long, List<OrgModel>> finalGroupByOrgIdUserMap = groupByOrgIdUserMap;
orgTreeModelList.forEach(otm -> { orgTreeModelList.forEach(otm -> {
Long orgId = Long.valueOf(otm.getId()); Long orgId = Long.valueOf(otm.getId());
Integer userNumber = recursiveDepartmentUserMap.get(orgId); Integer userNumber = recursiveDepartmentUserMap.get(orgId);
otm.setUserNumber(userNumber == null ? 0 : userNumber); otm.setUserNumber(userNumber == null ? 0 : userNumber);
//用户子树 //用户子树
if (search.getHasUserLeaf() && otm.getUserNumber() > 0) { if (search.getHasUserLeaf() && otm.getUserNumber() > 0) {
List<OrgModel> userList = userMapper.selectUserOrgModels(new UserSearch().setDepartmentId(orgId).setUserIds(search.getUserIds())); List<OrgModel> userList = finalGroupByOrgIdUserMap.getOrDefault(orgId, Lists.newArrayList());
List<OrgTreeModel> userTreeList = userList.stream().map(OrgTreeModel::new).collect(Collectors.toList()); List<OrgTreeModel> userTreeList = userList.stream().map(OrgTreeModel::new).collect(Collectors.toList());
allTreeModelList.addAll(userTreeList); allTreeModelList.addAll(userTreeList);
} }
......
...@@ -171,6 +171,10 @@ public abstract class PermissionStrategy { ...@@ -171,6 +171,10 @@ public abstract class PermissionStrategy {
Set<Long> departmentIdSet = userList.stream().map(User::getDepartmentId).collect(Collectors.toSet()); Set<Long> departmentIdSet = userList.stream().map(User::getDepartmentId).collect(Collectors.toSet());
if (CollectionUtils.isEmpty(departmentIdSet)) {
return Lists.newArrayList();
}
List<OrgSuperiorModel> superiorModelList = organizationMapper.selectSuperiorIdsByOrg(new OrgTreeSearch().setOrgIds(departmentIdSet)); List<OrgSuperiorModel> superiorModelList = organizationMapper.selectSuperiorIdsByOrg(new OrgTreeSearch().setOrgIds(departmentIdSet));
Collection<Long> superiorIdSet = this.getSuperiorIds(superiorModelList); Collection<Long> superiorIdSet = this.getSuperiorIds(superiorModelList);
......
...@@ -15,6 +15,7 @@ import com.glsx.plat.common.model.TreeModel; ...@@ -15,6 +15,7 @@ import com.glsx.plat.common.model.TreeModel;
import com.glsx.plat.common.utils.StringUtils; import com.glsx.plat.common.utils.StringUtils;
import com.glsx.plat.common.utils.TreeModelUtil; import com.glsx.plat.common.utils.TreeModelUtil;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
...@@ -136,17 +137,11 @@ public class SelfDepartmentStrategy extends PermissionStrategy { ...@@ -136,17 +137,11 @@ public class SelfDepartmentStrategy extends PermissionStrategy {
if (CollectionUtils.isNotEmpty(search.getSubOrgIds())) { if (CollectionUtils.isNotEmpty(search.getSubOrgIds())) {
Map<Long, Set<Long>> subOrgIdListMap = getSubIdsMap(search.getSubOrgIds()); Map<Long, Set<Long>> subOrgIdListMap = getSubIdsMap(search.getSubOrgIds());
Collection<Long> finalOrgIds = orgIds;
//选中的节点及下级节点 //选中的节点及下级节点
Set<Long> selectSubOrgIds = Sets.newHashSet(); Set<Long> selectSubOrgIds = Sets.newHashSet();
for (Map.Entry<Long, Set<Long>> entry : subOrgIdListMap.entrySet()) { for (Map.Entry<Long, Set<Long>> entry : subOrgIdListMap.entrySet()) {
Set<Long> subOrgIds = entry.getValue().stream().filter(finalOrgIds::contains).collect(Collectors.toSet()); selectSubOrgIds.addAll(entry.getValue());
if (orgIds.contains(entry.getKey())) {
subOrgIds.add(entry.getKey());
}
selectSubOrgIds.addAll(subOrgIds);
} }
orgIds = selectSubOrgIds; orgIds = selectSubOrgIds;
...@@ -157,8 +152,12 @@ public class SelfDepartmentStrategy extends PermissionStrategy { ...@@ -157,8 +152,12 @@ public class SelfDepartmentStrategy extends PermissionStrategy {
orgIds = this.getUserOrgSuperiorIds(search.getUserIds()); orgIds = this.getUserOrgSuperiorIds(search.getUserIds());
} }
//如果没有过滤到需要查询的组织链,返回空数据 //如果有查询条件,如果没有过滤到需要查询的组织链,返回空数据
if (CollectionUtils.isEmpty(orgIds)) { if ((StringUtils.isNotEmpty(search.getOrgName())
|| CollectionUtils.isNotEmpty(search.getOrgIds())
|| CollectionUtils.isNotEmpty(search.getSupOrgIds())
|| CollectionUtils.isNotEmpty(search.getSubOrgIds())
|| CollectionUtils.isNotEmpty(search.getUserIds())) && CollectionUtils.isEmpty(orgIds)) {
return Lists.newArrayList(); return Lists.newArrayList();
} }
...@@ -174,13 +173,21 @@ public class SelfDepartmentStrategy extends PermissionStrategy { ...@@ -174,13 +173,21 @@ public class SelfDepartmentStrategy extends PermissionStrategy {
List<OrgTreeModel> allTreeModelList = Lists.newArrayList(orgTreeModelList); List<OrgTreeModel> allTreeModelList = Lists.newArrayList(orgTreeModelList);
//查询需要的用户,然后放到对应的组织节点的child,如果需要返回用户子节点的话
Map<Long, List<OrgModel>> groupByOrgIdUserMap = Maps.newHashMap();
if (search.getHasUserLeaf() && CollectionUtils.isNotEmpty(departmentIdList)) {
List<OrgModel> allUserList = userMapper.selectUserOrgModels(new UserSearch().setDepartmentIds(departmentIdList).setUserIds(search.getUserIds()));
groupByOrgIdUserMap = allUserList.stream().collect(Collectors.groupingBy(OrgModel::getParentId));
}
Map<Long, List<OrgModel>> finalGroupByOrgIdUserMap = groupByOrgIdUserMap;
orgTreeModelList.stream().filter(otm -> Long.valueOf(otm.getId()).equals(deptId)).forEach(otm -> { orgTreeModelList.stream().filter(otm -> Long.valueOf(otm.getId()).equals(deptId)).forEach(otm -> {
Long orgId = Long.valueOf(otm.getId()); Long orgId = Long.valueOf(otm.getId());
Integer userNumber = recursiveDepartmentUserMap.get(orgId); Integer userNumber = recursiveDepartmentUserMap.get(orgId);
otm.setUserNumber(userNumber == null ? 0 : userNumber); otm.setUserNumber(userNumber == null ? 0 : userNumber);
//用户子树 //用户子树
if (search.getHasUserLeaf() && otm.getUserNumber() > 0) { if (search.getHasUserLeaf() && otm.getUserNumber() > 0) {
List<OrgModel> userList = userMapper.selectUserOrgModels(new UserSearch().setDepartmentId(orgId).setUserIds(search.getUserIds())); List<OrgModel> userList = finalGroupByOrgIdUserMap.getOrDefault(orgId, Lists.newArrayList());
List<OrgTreeModel> userTreeList = userList.stream().map(OrgTreeModel::new).collect(Collectors.toList()); List<OrgTreeModel> userTreeList = userList.stream().map(OrgTreeModel::new).collect(Collectors.toList());
allTreeModelList.addAll(userTreeList); allTreeModelList.addAll(userTreeList);
} }
......
...@@ -14,6 +14,7 @@ import com.glsx.plat.common.model.TreeModel; ...@@ -14,6 +14,7 @@ import com.glsx.plat.common.model.TreeModel;
import com.glsx.plat.common.utils.StringUtils; import com.glsx.plat.common.utils.StringUtils;
import com.glsx.plat.common.utils.TreeModelUtil; import com.glsx.plat.common.utils.TreeModelUtil;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
...@@ -192,17 +193,11 @@ public class SubDepartmentStrategy extends PermissionStrategy { ...@@ -192,17 +193,11 @@ public class SubDepartmentStrategy extends PermissionStrategy {
if (CollectionUtils.isNotEmpty(search.getSubOrgIds())) { if (CollectionUtils.isNotEmpty(search.getSubOrgIds())) {
Map<Long, Set<Long>> subOrgIdListMap = getSubIdsMap(search.getSubOrgIds()); Map<Long, Set<Long>> subOrgIdListMap = getSubIdsMap(search.getSubOrgIds());
Collection<Long> finalOrgIds = orgIds;
//选中的节点及下级节点 //选中的节点及下级节点
Set<Long> selectSubOrgIds = Sets.newHashSet(); Set<Long> selectSubOrgIds = Sets.newHashSet();
for (Map.Entry<Long, Set<Long>> entry : subOrgIdListMap.entrySet()) { for (Map.Entry<Long, Set<Long>> entry : subOrgIdListMap.entrySet()) {
Set<Long> subOrgIds = entry.getValue().stream().filter(finalOrgIds::contains).collect(Collectors.toSet()); selectSubOrgIds.addAll(entry.getValue());
if (orgIds.contains(entry.getKey())) {
subOrgIds.add(entry.getKey());
}
selectSubOrgIds.addAll(subOrgIds);
} }
orgIds = selectSubOrgIds; orgIds = selectSubOrgIds;
...@@ -213,8 +208,12 @@ public class SubDepartmentStrategy extends PermissionStrategy { ...@@ -213,8 +208,12 @@ public class SubDepartmentStrategy extends PermissionStrategy {
orgIds = this.getUserOrgSuperiorIds(search.getUserIds()); orgIds = this.getUserOrgSuperiorIds(search.getUserIds());
} }
//如果没有过滤到需要查询的组织链,返回空数据 //如果有查询条件,如果没有过滤到需要查询的组织链,返回空数据
if (CollectionUtils.isEmpty(orgIds)) { if ((StringUtils.isNotEmpty(search.getOrgName())
|| CollectionUtils.isNotEmpty(search.getOrgIds())
|| CollectionUtils.isNotEmpty(search.getSupOrgIds())
|| CollectionUtils.isNotEmpty(search.getSubOrgIds())
|| CollectionUtils.isNotEmpty(search.getUserIds())) && CollectionUtils.isEmpty(orgIds)) {
return Lists.newArrayList(); return Lists.newArrayList();
} }
...@@ -230,6 +229,14 @@ public class SubDepartmentStrategy extends PermissionStrategy { ...@@ -230,6 +229,14 @@ public class SubDepartmentStrategy extends PermissionStrategy {
List<OrgTreeModel> allTreeModelList = Lists.newArrayList(orgTreeModelList); List<OrgTreeModel> allTreeModelList = Lists.newArrayList(orgTreeModelList);
//查询需要的用户,然后放到对应的组织节点的child,如果需要返回用户子节点的话
Map<Long, List<OrgModel>> groupByOrgIdUserMap = Maps.newHashMap();
if (search.getHasUserLeaf() && CollectionUtils.isNotEmpty(departmentIdList)) {
List<OrgModel> allUserList = userMapper.selectUserOrgModels(new UserSearch().setDepartmentIds(departmentIdList).setUserIds(search.getUserIds()));
groupByOrgIdUserMap = allUserList.stream().collect(Collectors.groupingBy(OrgModel::getParentId));
}
Map<Long, List<OrgModel>> finalGroupByOrgIdUserMap = groupByOrgIdUserMap;
orgTreeModelList.forEach(otm -> { orgTreeModelList.forEach(otm -> {
Long orgId = Long.valueOf(otm.getId()); Long orgId = Long.valueOf(otm.getId());
//这里控制从用户自己部门开始才有用户 //这里控制从用户自己部门开始才有用户
...@@ -239,7 +246,7 @@ public class SubDepartmentStrategy extends PermissionStrategy { ...@@ -239,7 +246,7 @@ public class SubDepartmentStrategy extends PermissionStrategy {
//用户子树 //用户子树
if (search.getHasUserLeaf() && otm.getUserNumber() > 0) { if (search.getHasUserLeaf() && otm.getUserNumber() > 0) {
List<OrgModel> userList = userMapper.selectUserOrgModels(new UserSearch().setDepartmentId(orgId).setUserIds(search.getUserIds())); List<OrgModel> userList = finalGroupByOrgIdUserMap.getOrDefault(orgId, Lists.newArrayList());
List<OrgTreeModel> userTreeList = userList.stream().map(OrgTreeModel::new).collect(Collectors.toList()); List<OrgTreeModel> userTreeList = userList.stream().map(OrgTreeModel::new).collect(Collectors.toList());
allTreeModelList.addAll(userTreeList); allTreeModelList.addAll(userTreeList);
} }
......
...@@ -20,7 +20,6 @@ import com.google.common.collect.Lists; ...@@ -20,7 +20,6 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.context.annotation.DependsOn;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -181,6 +180,11 @@ public class SubOrdinateStrategy extends PermissionStrategy { ...@@ -181,6 +180,11 @@ public class SubOrdinateStrategy extends PermissionStrategy {
} else { } else {
matchedDepartmentIdList = subDepartmentIdList; matchedDepartmentIdList = subDepartmentIdList;
} }
//如果没找到匹配部门,返回为空(指定授权跨部门情况容易发生)
if (CollectionUtils.isEmpty(matchedDepartmentIdList)) {
return Lists.newArrayList();
}
//全部上级 //全部上级
List<Organization> superiorOrgList = organizationMapper.selectList(new OrganizationBO().setSubIdList(matchedDepartmentIdList)); List<Organization> superiorOrgList = organizationMapper.selectList(new OrganizationBO().setSubIdList(matchedDepartmentIdList));
//所有部门id //所有部门id
......
...@@ -58,10 +58,22 @@ ...@@ -58,10 +58,22 @@
</select> </select>
<select id="selectByTenantId" resultMap="BaseResultMap"> <select id="selectByTenantId" resultMap="BaseResultMap">
select * select
<include refid="Base_Column_List"/>
from t_user from t_user
where tenant_id = #{tenantId} where del_flag = 0
and del_flag = 0 and tenant_id = #{tenantId}
</select>
<select id="selectByTenantIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from t_user
where del_flag = 0
and tenant_id in
<foreach collection="tenantIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</select> </select>
<select id="selectByDepartmentId" resultMap="BaseResultMap"> <select id="selectByDepartmentId" resultMap="BaseResultMap">
...@@ -96,7 +108,10 @@ ...@@ -96,7 +108,10 @@
tu.id orderNum tu.id orderNum
from t_user tu from t_user tu
where del_flag = 0 where del_flag = 0
and department_id = #{departmentId} and department_id in
<foreach collection="departmentIds" item="departmentId" open="(" close=")" separator=",">
#{departmentId}
</foreach>
<if test="userIds != null and userIds.size() > 0"> <if test="userIds != null and userIds.size() > 0">
and tu.id in and tu.id in
<foreach collection="userIds" item="item" open="(" close=")" separator=","> <foreach collection="userIds" item="item" open="(" close=")" separator=",">
......
...@@ -188,7 +188,7 @@ public class UserApplicationTests { ...@@ -188,7 +188,7 @@ public class UserApplicationTests {
@Test @Test
public void testUser() { public void testUser() {
SyntheticUser user = userService.getSyntheticUser(); SyntheticUser user = userService.getSyntheticUserById(1L);
System.out.println(JSON.toJSONString(user)); System.out.println(JSON.toJSONString(user));
userService.addUser(new UserBO().setAccount("rrew").setUsername("桃桃桃").setDepartmentId(1L).setRoleId(1L).setPassword("123456")); userService.addUser(new UserBO().setAccount("rrew").setUsername("桃桃桃").setDepartmentId(1L).setRoleId(1L).setPassword("123456"));
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!