|
|
@@ -88,13 +88,14 @@ public class TenantServiceImpl implements TenantService { |
|
|
|
if (clientUserMapper.judgeCreateByUserName(createClientTenantDto.getUsername()) > 0) { |
|
|
|
return JsonResult.error("该用户名称已存在!"); |
|
|
|
} |
|
|
|
createClientTenantDto.setPassword(passward); |
|
|
|
//创建租户创建成功后的返回实体类 |
|
|
|
CreateTenantVo vo = new CreateTenantVo(); |
|
|
|
vo.setPassword(passward); |
|
|
|
vo.setPassword(createClientTenantDto.getPassword()); |
|
|
|
vo.setTenantName(createClientTenantDto.getTenantName()); |
|
|
|
vo.setUsername(createClientTenantDto.getUsername()); |
|
|
|
//code复用username |
|
|
|
createClientTenantDto.setTenantCode(createClientTenantDto.getTenantName()); |
|
|
|
createClientTenantDto.setTenantCode(createClientTenantDto.getUsername()); |
|
|
|
//用户表 |
|
|
|
UserPo userPo = new UserPo() |
|
|
|
.setIsTenant(1) |
|
|
@@ -165,7 +166,8 @@ public class TenantServiceImpl implements TenantService { |
|
|
|
ClientUserRolePo clientUserRolePo = new ClientUserRolePo() |
|
|
|
.setUserId(userPo.getId()) |
|
|
|
.setClientId(clientRoleDto.getClientId()) |
|
|
|
.setRoleId(clientRoleDto.getRoleId()); |
|
|
|
.setRoleId(clientRoleDto.getRoleId()) |
|
|
|
.setRoleName(clientRoleDto.getRoleName()); |
|
|
|
clientUserRolePo.setCreateUser(loginUser.getUserId()); |
|
|
|
clientUserRolePoArrayList.add(clientUserRolePo); |
|
|
|
} |
|
|
@@ -205,12 +207,12 @@ public class TenantServiceImpl implements TenantService { |
|
|
|
switch (dto.getClientId()) { |
|
|
|
//暂时河湖长,动态匹配其他平台 |
|
|
|
case HhzUrlConstant.HHZ_CLIENT: |
|
|
|
addClientRoleDtoList(HhzUrlConstant.HHZ_CLIENT_MP, dto.getRoleId(), clientRoleDtoList); |
|
|
|
addClientRoleDtoList(HhzUrlConstant.HHZ_CLIENT_ADMIN, dto.getRoleId(), clientRoleDtoList); |
|
|
|
addClientRoleDtoList(HhzUrlConstant.HHZ_CLIENT_MP, dto, clientRoleDtoList); |
|
|
|
addClientRoleDtoList(HhzUrlConstant.HHZ_CLIENT_ADMIN,dto, clientRoleDtoList); |
|
|
|
break; |
|
|
|
case PilotConstant.PILOT_CLIENT: |
|
|
|
addClientRoleDtoList(PilotConstant.PILOT_CLIENT_ADMIN, dto.getRoleId(), clientRoleDtoList); |
|
|
|
addClientRoleDtoList(PilotConstant.PILOT_CLIENT_MP, dto.getRoleId(), clientRoleDtoList); |
|
|
|
addClientRoleDtoList(PilotConstant.PILOT_CLIENT_ADMIN, dto, clientRoleDtoList); |
|
|
|
addClientRoleDtoList(PilotConstant.PILOT_CLIENT_MP, dto, clientRoleDtoList); |
|
|
|
break; |
|
|
|
////暂时河湖长,动态匹配其他平台 |
|
|
|
//case HhzUrlConstant.HHZ_CLIENT: |
|
|
@@ -232,13 +234,14 @@ public class TenantServiceImpl implements TenantService { |
|
|
|
* 封装数据到 clientRoleDtoList |
|
|
|
* |
|
|
|
* @param clientId |
|
|
|
* @param roleId |
|
|
|
* @param dto |
|
|
|
* @param clientRoleDtoList |
|
|
|
*/ |
|
|
|
private void addClientRoleDtoList(String clientId, Integer roleId, List<ClientRoleDto> clientRoleDtoList) { |
|
|
|
private void addClientRoleDtoList(String clientId, ClientRoleDto dto, List<ClientRoleDto> clientRoleDtoList) { |
|
|
|
ClientRoleDto clientRoleDto = new ClientRoleDto(); |
|
|
|
clientRoleDto.setClientId(clientId); |
|
|
|
clientRoleDto.setRoleId(roleId); |
|
|
|
clientRoleDto.setRoleId(dto.getRoleId()); |
|
|
|
clientRoleDto.setRoleName(dto.getRoleName()); |
|
|
|
clientRoleDtoList.add(clientRoleDto); |
|
|
|
} |
|
|
|
|
|
|
@@ -347,15 +350,15 @@ public class TenantServiceImpl implements TenantService { |
|
|
|
List<BusinessSystemVo> businessSystemVoList = new ArrayList<>(); |
|
|
|
for (AuthoritiesPo authoritiesPo : list) { |
|
|
|
//TODO 后期维护各个业务平台 |
|
|
|
if (authoritiesPo.getAuthority().contains("hhz")) { |
|
|
|
if (authoritiesPo.getAuthority().contains(HhzUrlConstant.HHZ_CLIENT)) { |
|
|
|
businessSystemVoList.add(getbusinessSystemVo(HhzUrlConstant.HHZ_CLIENT, HhzUrlConstant.HHZ_NAME)); |
|
|
|
} else if (authoritiesPo.getAuthority().contains("airport")) { |
|
|
|
} else if (authoritiesPo.getAuthority().contains(AirportConstant.AIRPORT_CLIENT)) { |
|
|
|
businessSystemVoList.add(getbusinessSystemVo(AirportConstant.AIRPORT_CLIENT, AirportConstant.AIRPORT_NAME)); |
|
|
|
} else if (authoritiesPo.getAuthority().contains("waterway")) { |
|
|
|
} else if (authoritiesPo.getAuthority().contains(WaterWayConstant.WATERWAY_CLIENT)) { |
|
|
|
businessSystemVoList.add(getbusinessSystemVo(WaterWayConstant.WATERWAY_CLIENT, WaterWayConstant.WATERWAY_NAME)); |
|
|
|
} else if (authoritiesPo.getAuthority().contains("freeway")) { |
|
|
|
} else if (authoritiesPo.getAuthority().contains(FreeWayConstant.FREEWAY_CLIENT)) { |
|
|
|
businessSystemVoList.add(getbusinessSystemVo(FreeWayConstant.FREEWAY_CLIENT, FreeWayConstant.FREEWAY_NAME)); |
|
|
|
} else if (authoritiesPo.getAuthority().contains("pilot")) { |
|
|
|
} else if (authoritiesPo.getAuthority().contains(PilotConstant.PILOT_CLIENT)) { |
|
|
|
businessSystemVoList.add(getbusinessSystemVo(PilotConstant.PILOT_CLIENT, PilotConstant.PILOT_NAME)); |
|
|
|
} |
|
|
|
} |
|
|
@@ -402,6 +405,7 @@ public class TenantServiceImpl implements TenantService { |
|
|
|
clientRoleDto = new ClientRoleDto(); |
|
|
|
//此处 暂时格式都为 tuoheng-hhz-web 等格式 如后续维护需要变更形式则此处代码需要更改 |
|
|
|
clientRoleDto.setRoleId(clientUserRolePo.getRoleId()); |
|
|
|
clientRoleDto.setRoleName(clientUserRolePo.getRoleName()); |
|
|
|
clientRoleDto.setClientId(clientUserRolePo.getClientId().substring(CommonConstant.ZERO, clientUserRolePo.getClientId().lastIndexOf(CommonConstant.BARS))); |
|
|
|
TenantEmploy tenantEmploy = tenantEmployMapper.selectOne(Wrappers.<TenantEmploy>lambdaQuery() |
|
|
|
.eq(TenantEmploy::getTenantId, tenantId) |