| | |
| | | lqw.eq(bo.getExpireTime() != null, SysTenant::getExpireTime, bo.getExpireTime()); |
| | | lqw.eq(bo.getAccountCount() != null, SysTenant::getAccountCount, bo.getAccountCount()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysTenant::getStatus, bo.getStatus()); |
| | | lqw.orderByAsc(SysTenant::getId); |
| | | return lqw; |
| | | } |
| | | |
| | |
| | | SysDept dept = new SysDept(); |
| | | dept.setTenantId(tenantId); |
| | | dept.setDeptName(bo.getCompanyName()); |
| | | dept.setLeader(bo.getUsername()); |
| | | dept.setParentId(Constants.TOP_PARENT_ID); |
| | | dept.setAncestors(Constants.TOP_PARENT_ID.toString()); |
| | | deptMapper.insert(dept); |
| | |
| | | user.setPassword(BCrypt.hashpw(bo.getPassword())); |
| | | user.setDeptId(deptId); |
| | | userMapper.insert(user); |
| | | //新增系统用户后,默认当前用户为部门的负责人 |
| | | SysDept sd = new SysDept(); |
| | | sd.setLeader(user.getUserId()); |
| | | sd.setDeptId(deptId); |
| | | deptMapper.updateById(sd); |
| | | |
| | | // 用户和角色关联表 |
| | | SysUserRole userRole = new SysUserRole(); |