Quellcode durchsuchen

更新回显待会租户角色名称

tags/v2.4.1
xiaoying vor 1 Jahr
Ursprung
Commit
e0142666fe
9 geänderte Dateien mit 34 neuen und 25 gelöschten Zeilen
  1. +1
    -1
      tuoheng_oidc_admin/src/main/java/com/tuoheng/model/entity/TenantEmploy.java
  2. +4
    -0
      tuoheng_oidc_admin/src/main/java/com/tuoheng/model/param/ClientRoleDto.java
  3. +0
    -1
      tuoheng_oidc_admin/src/main/java/com/tuoheng/model/param/CreateClientTenantDto.java
  4. +2
    -0
      tuoheng_oidc_admin/src/main/java/com/tuoheng/model/po/ClientUserRolePo.java
  5. +19
    -15
      tuoheng_oidc_admin/src/main/java/com/tuoheng/service/impl/TenantServiceImpl.java
  6. +4
    -4
      tuoheng_oidc_admin/src/main/resources/mapper/ClientUserRoleMapper.xml
  7. BIN
      tuoheng_oidc_admin/target/classes/com/tuoheng/model/param/ClientRoleDto.class
  8. BIN
      tuoheng_oidc_admin/target/classes/com/tuoheng/model/param/CreateClientTenantDto.class
  9. +4
    -4
      tuoheng_oidc_admin/target/classes/mapper/ClientUserRoleMapper.xml

+ 1
- 1
tuoheng_oidc_admin/src/main/java/com/tuoheng/model/entity/TenantEmploy.java Datei anzeigen

@@ -18,7 +18,7 @@ public class TenantEmploy implements Serializable {
/**
*
*/
@TableId(type = IdType.AUTO)
@TableId(type = IdType.ASSIGN_ID)
private Long id;

/**

+ 4
- 0
tuoheng_oidc_admin/src/main/java/com/tuoheng/model/param/ClientRoleDto.java Datei anzeigen

@@ -25,4 +25,8 @@ public class ClientRoleDto {
* 识别详情
*/
private String description;
/**
* 角色名
*/
private String roleName;
}

+ 0
- 1
tuoheng_oidc_admin/src/main/java/com/tuoheng/model/param/CreateClientTenantDto.java Datei anzeigen

@@ -22,7 +22,6 @@ public class CreateClientTenantDto {
@NotEmpty(message = "username can not be empty!")
private String username;

@NotEmpty(message = "password can not be empty!")
private String password;

private String remark;

+ 2
- 0
tuoheng_oidc_admin/src/main/java/com/tuoheng/model/po/ClientUserRolePo.java Datei anzeigen

@@ -22,4 +22,6 @@ public class ClientUserRolePo extends BasePo {

private Integer status;

private String roleName;

}

+ 19
- 15
tuoheng_oidc_admin/src/main/java/com/tuoheng/service/impl/TenantServiceImpl.java Datei anzeigen

@@ -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)

+ 4
- 4
tuoheng_oidc_admin/src/main/resources/mapper/ClientUserRoleMapper.xml Datei anzeigen

@@ -3,16 +3,16 @@
<mapper namespace="com.tuoheng.mapper.ClientUserRoleMapper">

<insert id="batchInsert" parameterType="java.util.List">
insert into t_client_user_role (user_id, client_id, role_id, create_user)
insert into t_client_user_role (user_id, client_id, role_id, create_user,role_name)
VALUES
<foreach collection="list" item="it" separator=",">
(#{it.userId}, #{it.clientId}, #{it.roleId}, #{it.createUser})
(#{it.userId}, #{it.clientId}, #{it.roleId}, #{it.createUser},#{it.roleName})
</foreach>
</insert>

<insert id="insert" parameterType="com.tuoheng.model.po.ClientUserRolePo">
insert into t_client_user_role (user_id, client_id, role_id, create_user)
VALUES (#{userId}, #{clientId}, #{roleId}, #{createUser})
insert into t_client_user_role (user_id, client_id, role_id, create_user, role_name)
VALUES (#{userId}, #{clientId}, #{roleId}, #{createUser}, #{it.roleName})
</insert>

<update id="updateUserClientRole" parameterType="com.tuoheng.model.po.ClientUserRolePo">

BIN
tuoheng_oidc_admin/target/classes/com/tuoheng/model/param/ClientRoleDto.class Datei anzeigen


BIN
tuoheng_oidc_admin/target/classes/com/tuoheng/model/param/CreateClientTenantDto.class Datei anzeigen


+ 4
- 4
tuoheng_oidc_admin/target/classes/mapper/ClientUserRoleMapper.xml Datei anzeigen

@@ -3,16 +3,16 @@
<mapper namespace="com.tuoheng.mapper.ClientUserRoleMapper">

<insert id="batchInsert" parameterType="java.util.List">
insert into t_client_user_role (user_id, client_id, role_id, create_user)
insert into t_client_user_role (user_id, client_id, role_id, create_user,role_name)
VALUES
<foreach collection="list" item="it" separator=",">
(#{it.userId}, #{it.clientId}, #{it.roleId}, #{it.createUser})
(#{it.userId}, #{it.clientId}, #{it.roleId}, #{it.createUser},#{it.roleName})
</foreach>
</insert>

<insert id="insert" parameterType="com.tuoheng.model.po.ClientUserRolePo">
insert into t_client_user_role (user_id, client_id, role_id, create_user)
VALUES (#{userId}, #{clientId}, #{roleId}, #{createUser})
insert into t_client_user_role (user_id, client_id, role_id, create_user, role_name)
VALUES (#{userId}, #{clientId}, #{roleId}, #{createUser}, #{it.roleName})
</insert>

<update id="updateUserClientRole" parameterType="com.tuoheng.model.po.ClientUserRolePo">

Laden…
Abbrechen
Speichern