Browse Source

重构初始化系统租户和用户代码

tags/v1.0.0^2
wanjing 1 year ago
parent
commit
7458c09af0
1 changed files with 7 additions and 6 deletions
  1. +7
    -6
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/user/init/SystemUserInitService.java

+ 7
- 6
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/user/init/SystemUserInitService.java View File

@@ -178,12 +178,13 @@ public class SystemUserInitService {
}

// 如果顶级部门存在,将该超级管理员与顶级部门关联
Dept dept = deptMapper.selectOne(Wrappers.<Dept>lambdaQuery()
.eq(Dept::getMark, 1)
.eq(Dept::getPid, SystemConstant.ROOT_DEPT_PID));
if (ObjectUtil.isNotNull(dept)) {
user.setDeptId(dept.getId());
}
// Dept dept = deptMapper.selectOne(Wrappers.<Dept>lambdaQuery()
// .eq(Dept::getMark, 1)
// .eq(Dept::getTenantId, user.getTenantId())
// .eq(Dept::getPid, SystemConstant.ROOT_DEPT_PID));
// if (ObjectUtil.isNotNull(dept)) {
// user.setDeptId(dept.getId());
// }
Integer rowCount = userMapper.insert(user);
if (rowCount <= 0) {
log.info("初始化系统租户用户失败,username:{}", user.getUsername());

Loading…
Cancel
Save