Browse Source

新增飞手平台对接用户管理中心

tags/v2.4.1
xiaoying 1 year ago
parent
commit
8949d845aa
6 changed files with 69 additions and 24 deletions
  1. +30
    -0
      tuoheng_oidc_admin/src/main/java/com/tuoheng/constant/PilotConstant.java
  2. +37
    -22
      tuoheng_oidc_admin/src/main/java/com/tuoheng/service/impl/ClientUserServiceImpl.java
  3. BIN
      tuoheng_oidc_admin/target/classes/com/tuoheng/model/query/TenantQuery.class
  4. BIN
      tuoheng_oidc_admin/target/classes/com/tuoheng/model/vo/TenantVo.class
  5. BIN
      tuoheng_oidc_admin/target/classes/com/tuoheng/service/impl/ClientUserServiceImpl.class
  6. +2
    -2
      tuoheng_oidc_admin/target/classes/mapper/TenantMapper.xml

+ 30
- 0
tuoheng_oidc_admin/src/main/java/com/tuoheng/constant/PilotConstant.java View File

@@ -0,0 +1,30 @@
package com.tuoheng.constant;

/**
* @Author xiaoying
* @Date 2023/3/1 11:10
*/
public class PilotConstant {
public static final String PILOT_CLIENT="tuoheng-pilot";
/**
* 河湖长-pc端
*/
public static final String PILOT_CLIENT_ADMIN = "tuoheng-pilot-admin";

public static final String PILOT_CLIENT_MP = "tuoheng-pilot-mp";



public static final String PILOT_NAME="飞手业务平台";

/**
* 创建租户
*/
public static final String CREATE_TENANT = "/oidcTenant/add";
/**
* 编辑租户
*/
public static final String UPDATE_TENANT = "/oidcTenant/edit";

public static final String DELETE_TENANT = "/oidcTenant/delete";
}

+ 37
- 22
tuoheng_oidc_admin/src/main/java/com/tuoheng/service/impl/ClientUserServiceImpl.java View File

@@ -353,28 +353,15 @@ public class ClientUserServiceImpl implements ClientUserSevice {
for (AuthoritiesPo authoritiesPo : poList) {
//TODO 后期维护各个业务平台
if (authoritiesPo.getAuthority().contains("hhz")) {
BusinessSystemVo businessSystemVo = new BusinessSystemVo();
businessSystemVo.setClientId(HhzUrlConstant.HHZ_CLIENT);
businessSystemVo.setName(HhzUrlConstant.HHZ_NAME);
businessSystemVoList.add(businessSystemVo);
}
if (authoritiesPo.getAuthority().contains("airport")) {
BusinessSystemVo businessSystemVo = new BusinessSystemVo();
businessSystemVo.setClientId(AirportConstant.AIRPORT_CLIENT);
businessSystemVo.setName(AirportConstant.AIRPORT_NAME);
businessSystemVoList.add(businessSystemVo);
}
if (authoritiesPo.getAuthority().contains("waterway")) {
BusinessSystemVo businessSystemVo = new BusinessSystemVo();
businessSystemVo.setClientId(WaterWayConstant.WATERWAY_CLIENT);
businessSystemVo.setName(WaterWayConstant.WATERWAY_NAME);
businessSystemVoList.add(businessSystemVo);
}
if (authoritiesPo.getAuthority().contains("freeway")) {
BusinessSystemVo businessSystemVo = new BusinessSystemVo();
businessSystemVo.setClientId(FreeWayConstant.FREEWAY_CLIENT);
businessSystemVo.setName(FreeWayConstant.FREEWAY_NAME);
businessSystemVoList.add(businessSystemVo);
businessSystemVoList.add(getbusinessSystemVo(HhzUrlConstant.HHZ_CLIENT, HhzUrlConstant.HHZ_NAME));
}else if (authoritiesPo.getAuthority().contains("airport")) {
businessSystemVoList.add(getbusinessSystemVo(AirportConstant.AIRPORT_CLIENT, AirportConstant.AIRPORT_NAME));
}else if (authoritiesPo.getAuthority().contains("waterway")) {
businessSystemVoList.add(getbusinessSystemVo(WaterWayConstant.WATERWAY_CLIENT, WaterWayConstant.WATERWAY_NAME));
}else if (authoritiesPo.getAuthority().contains("freeway")) {
businessSystemVoList.add(getbusinessSystemVo(FreeWayConstant.FREEWAY_CLIENT, FreeWayConstant.FREEWAY_NAME));
}else if(authoritiesPo.getAuthority().contains("pilot")) {
businessSystemVoList.add(getbusinessSystemVo(PilotConstant.PILOT_CLIENT, PilotConstant.PILOT_NAME));
}
}
businessSystemVoList = businessSystemVoList.stream().distinct().collect(Collectors.toList());
@@ -384,6 +371,20 @@ public class ClientUserServiceImpl implements ClientUserSevice {
return JsonResult.success(pageData);
}

/**
* 封装返回展示类
*
* @param client
* @param name
* @return
*/
private BusinessSystemVo getbusinessSystemVo(String client, String name) {
BusinessSystemVo businessSystemVo = new BusinessSystemVo();
businessSystemVo.setClientId(client);
businessSystemVo.setName(name);
return businessSystemVo;
}

/**
* 删除租户(逻辑删除)
*
@@ -513,6 +514,11 @@ public class ClientUserServiceImpl implements ClientUserSevice {
url = url + WaterWayConstant.CREATE_TENANT;
dto.setClientId(WaterWayConstant.WATERWAY_CLIENT_ADMIN + CommonConstant.COMMA + WaterWayConstant.WATERWAY_CLIENT_MP);
break;
//飞手
case PilotConstant.PILOT_CLIENT:
url = url + PilotConstant.CREATE_TENANT;
dto.setClientId(PilotConstant.PILOT_CLIENT + CommonConstant.COMMA + PilotConstant.PILOT_CLIENT_MP);
break;
default:
break;
}
@@ -575,6 +581,11 @@ public class ClientUserServiceImpl implements ClientUserSevice {
url = url + WaterWayConstant.UPDATE_TENANT;
dto.setClientId(WaterWayConstant.WATERWAY_CLIENT_ADMIN + CommonConstant.COMMA + WaterWayConstant.WATERWAY_CLIENT_MP);
break;
//飞手
case PilotConstant.PILOT_CLIENT:
url = url + PilotConstant.UPDATE_TENANT;
dto.setClientId(PilotConstant.PILOT_CLIENT + CommonConstant.COMMA + PilotConstant.PILOT_CLIENT_MP);
break;
default:
break;
}
@@ -633,6 +644,10 @@ public class ClientUserServiceImpl implements ClientUserSevice {
case WaterWayConstant.WATERWAY_CLIENT:
url = url + WaterWayConstant.DELETE_TENANT;
break;
//飞手
case PilotConstant.PILOT_CLIENT:
url = url + PilotConstant.DELETE_TENANT;
break;
default:
break;
}

BIN
tuoheng_oidc_admin/target/classes/com/tuoheng/model/query/TenantQuery.class View File


BIN
tuoheng_oidc_admin/target/classes/com/tuoheng/model/vo/TenantVo.class View File


BIN
tuoheng_oidc_admin/target/classes/com/tuoheng/service/impl/ClientUserServiceImpl.class View File


+ 2
- 2
tuoheng_oidc_admin/target/classes/mapper/TenantMapper.xml View File

@@ -50,8 +50,8 @@
t.name,t.province_code,t.province_name,t.city_code,t.city_name,t.district_code,t.district_name,u.username username
FROM t_tenant t,users u
WHERE t.enabled = 1 and u.enabled =1 and t.user_id =u.id
<if test="query.name != null and query.name != ''">
and t.name LIKE concat('%',#{query.name},'%')
<if test="query.tenantName != null and query.tenantName != ''">
and t.name LIKE concat('%',#{query.tenantName},'%')
</if>
<if test="query.username != null and query.username != ''">
and u.username LIKE concat('%',#{query.username},'%')

Loading…
Cancel
Save