|
@@ -2,6 +2,7 @@ package com.hfln.portal.infrastructure.gateway.impl;
|
|
|
|
|
|
import cn.hfln.framework.extension.BizException;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.hfln.portal.common.dto.data.role.RoleListDTO;
|
|
|
import com.hfln.portal.common.dto.data.tenant.TenantDto;
|
|
|
import com.hfln.portal.common.dto.data.tenant.TenantInfoDto;
|
|
|
import com.hfln.portal.common.dto.data.user.AdminUserDto;
|
|
@@ -14,10 +15,7 @@ import com.hfln.portal.domain.customer.util.CopyUtils;
|
|
|
import com.hfln.portal.domain.customer.util.PasswordUtil;
|
|
|
import com.hfln.portal.domain.exception.ErrorEnum;
|
|
|
import com.hfln.portal.domain.gateway.WebTenantGateway;
|
|
|
-import com.hfln.portal.infrastructure.po.AdminUserInfo;
|
|
|
-import com.hfln.portal.infrastructure.po.TblTenant;
|
|
|
-import com.hfln.portal.infrastructure.po.TblTenantInfo;
|
|
|
-import com.hfln.portal.infrastructure.po.TblUserRole;
|
|
|
+import com.hfln.portal.infrastructure.po.*;
|
|
|
import com.hfln.portal.infrastructure.service.*;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
@@ -48,6 +46,9 @@ public class WebTenantGatewayImpl implements WebTenantGateway {
|
|
|
@Autowired
|
|
|
private TblUserRoleService tblUserRoleService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TblRoleService tblRoleService;
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public void addTenant(TenantAddReq req) {
|
|
@@ -202,7 +203,15 @@ public class WebTenantGatewayImpl implements WebTenantGateway {
|
|
|
@Override
|
|
|
public AdminUserDto queryTenantAdmin(TenantAdminQueryParam req) {
|
|
|
|
|
|
- return CopyUtils.copy(adminUserService.queryByTenantIdAndUserType(req.getTenantId(), AdminUserType.USER_ADMIN.getCode()), AdminUserDto.class);
|
|
|
+ AdminUserDto copy = CopyUtils.copy(adminUserService.queryByTenantIdAndUserType(req.getTenantId(), AdminUserType.USER_ADMIN.getCode()), AdminUserDto.class);
|
|
|
+ if (copy != null) {
|
|
|
+ TblUserRole byUserId = tblUserRoleService.getByUserId(copy.getUserId());
|
|
|
+ if (byUserId != null) {
|
|
|
+ TblRole byId = tblRoleService.getById(byUserId.getRoleId());
|
|
|
+ copy.setUserRole(CopyUtils.copy(byId, RoleListDTO.class));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return copy;
|
|
|
}
|
|
|
|
|
|
@Override
|