@@ -2,6 +2,7 @@ package com.tuoheng.mapper; | |||
import com.tuoheng.model.dto.City; | |||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
import org.apache.ibatis.annotations.Mapper; | |||
/** | |||
* @author 小影 | |||
@@ -9,6 +10,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
* @createDate 2023-02-03 09:57:16 | |||
* @Entity com.tuoheng.model.dto.City | |||
*/ | |||
@Mapper | |||
public interface CityMapper extends BaseMapper<City> { | |||
} |
@@ -29,4 +29,7 @@ public interface TenantMapper { | |||
void updateById(TenantPo tenantPo); | |||
TenantPo selectById(Long id); | |||
@Select("select * from tuoheng_oidc.t_tenant where enabled =1") | |||
List<TTenant> selectList(); | |||
} |
@@ -62,6 +62,31 @@ public class TTenant implements Serializable { | |||
*/ | |||
private Integer enabled; | |||
/** | |||
* 省级编码 | |||
*/ | |||
private String provinceCode; | |||
/** | |||
* 省份名称 | |||
*/ | |||
private String provinceName; | |||
/** | |||
*市区编号 | |||
*/ | |||
private String cityCode; | |||
/** | |||
* 市区名称 | |||
*/ | |||
private String cityName; | |||
/** | |||
* 区县编号 | |||
*/ | |||
private String districtCode; | |||
/** | |||
* 区县名称 | |||
*/ | |||
private String districtName; | |||
@TableField(exist = false) | |||
private static final long serialVersionUID = 1L; | |||
} |
@@ -34,7 +34,7 @@ public class CreateClientUserDto { | |||
@NotNull(message = "clientRoleDtoList can not be null!") | |||
private List<ClientRoleDto> clientRoleDtoList; | |||
/** | |||
* 租户cod | |||
* 租户code | |||
*/ | |||
private String code; | |||
/** | |||
@@ -42,4 +42,30 @@ public class CreateClientUserDto { | |||
*/ | |||
private String name; | |||
/** | |||
* 省级编码 | |||
*/ | |||
private String provinceCode; | |||
/** | |||
* 省份名称 | |||
*/ | |||
private String provinceName; | |||
/** | |||
*市区编号 | |||
*/ | |||
private String cityCode; | |||
/** | |||
* 市区名称 | |||
*/ | |||
private String cityName; | |||
/** | |||
* 区县编号 | |||
*/ | |||
private String districtCode; | |||
/** | |||
* 区县名称 | |||
*/ | |||
private String districtName; | |||
} |
@@ -24,4 +24,28 @@ public class TenantPo extends BasePo { | |||
private String name; | |||
/** | |||
* 省级编码 | |||
*/ | |||
private String provinceCode; | |||
/** | |||
* 省份名称 | |||
*/ | |||
private String provinceName; | |||
/** | |||
*市区编号 | |||
*/ | |||
private String cityCode; | |||
/** | |||
* 市区名称 | |||
*/ | |||
private String cityName; | |||
/** | |||
* 区县编号 | |||
*/ | |||
private String districtCode; | |||
/** | |||
* 区县名称 | |||
*/ | |||
private String districtName; | |||
} |
@@ -109,6 +109,13 @@ public class ClientUserServiceImpl implements ClientUserSevice { | |||
//添加租户code | |||
tenantPo.setCode(createClientUserDto.getCode()); | |||
tenantPo.setName(createClientUserDto.getName()); | |||
tenantPo.setProvinceCode(createClientUserDto.getProvinceCode()); | |||
tenantPo.setProvinceName(createClientUserDto.getProvinceName()); | |||
tenantPo.setDistrictCode(createClientUserDto.getDistrictCode()); | |||
tenantPo.setDistrictName(createClientUserDto.getDistrictName()); | |||
tenantPo.setCityCode(createClientUserDto.getCityCode()); | |||
tenantPo.setCityName(createClientUserDto.getCityName()); | |||
log.debug("信息:" + tenantPo.toString()); | |||
tenantMapper.insertTenant(tenantPo); | |||
} | |||
} | |||
@@ -358,14 +365,14 @@ public class ClientUserServiceImpl implements ClientUserSevice { | |||
return jsonResult; | |||
} | |||
//TODO ->会导致循环终止(后期改进) | |||
requestAirport(dto, loginUser, CommonConstant.TWO); | |||
requestAirport(dto, loginUser, CommonConstant.TWO); | |||
} | |||
} else { | |||
JsonResult jsonResult = editResult(dto, dto.getClientId(), loginUser); | |||
if (!"操作成功".equals(jsonResult.getMsg())) { | |||
return jsonResult; | |||
} | |||
requestAirport(dto, loginUser, CommonConstant.TWO); | |||
requestAirport(dto, loginUser, CommonConstant.TWO); | |||
} | |||
TTenant tTenant = tenantMapper.getByCode(dto.getCode()); | |||
dto.setId(tTenant.getId()); | |||
@@ -545,7 +552,7 @@ public class ClientUserServiceImpl implements ClientUserSevice { | |||
resultRequestHeader.add("Authorization", "Bearer " + loginUser.getThToken()); | |||
HttpEntity httpEntity = new HttpEntity(request, resultRequestHeader); | |||
//设置地址(机场平台->配置文件) | |||
String url=""; | |||
String url = ""; | |||
switch (type) { | |||
case 1: | |||
url = CommonConfig.airportURL + AirportConstant.CREATE_TENANT; |
@@ -5,19 +5,19 @@ | |||
<mapper namespace="com.tuoheng.mapper.CityMapper"> | |||
<resultMap id="BaseResultMap" type="com.tuoheng.model.dto.City"> | |||
<id property="id" column="id" jdbcType="OTHER"/> | |||
<result property="pid" column="pid" jdbcType="OTHER"/> | |||
<id property="id" column="id" jdbcType="INTEGER"/> | |||
<result property="pid" column="pid" jdbcType="INTEGER"/> | |||
<result property="level" column="level" jdbcType="TINYINT"/> | |||
<result property="name" column="name" jdbcType="VARCHAR"/> | |||
<result property="citycode" column="citycode" jdbcType="VARCHAR"/> | |||
<result property="pAdcode" column="p_adcode" jdbcType="VARCHAR"/> | |||
<result property="adcode" column="adcode" jdbcType="VARCHAR"/> | |||
<result property="lng" column="lng" jdbcType="OTHER"/> | |||
<result property="lat" column="lat" jdbcType="OTHER"/> | |||
<result property="lng" column="lng" jdbcType="INTEGER"/> | |||
<result property="lat" column="lat" jdbcType="INTEGER"/> | |||
<result property="sort" column="sort" jdbcType="TINYINT"/> | |||
<result property="createUser" column="create_user" jdbcType="OTHER"/> | |||
<result property="createUser" column="create_user" jdbcType="INTEGER"/> | |||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> | |||
<result property="updateUser" column="update_user" jdbcType="OTHER"/> | |||
<result property="updateUser" column="update_user" jdbcType="INTEGER"/> | |||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> | |||
<result property="mark" column="mark" jdbcType="TINYINT"/> | |||
</resultMap> |
@@ -3,8 +3,8 @@ | |||
<mapper namespace="com.tuoheng.mapper.TenantMapper"> | |||
<insert id="insertTenant" parameterType="com.tuoheng.model.po.TenantPo" keyProperty="id" useGeneratedKeys="true"> | |||
INSERT INTO t_tenant (user_id, remark, `code`, `name`) | |||
VALUES (#{userId}, #{remark}, #{code}, #{name}) | |||
INSERT INTO t_tenant (user_id, remark, `code`, `name`,province_code,province_name,city_code,city_name,district_code,district_name) | |||
VALUES (#{userId}, #{remark}, #{code}, #{name},#{provinceCode},#{provinceName},#{cityCode},#{cityName},#{districtCode},#{districtName}) | |||
</insert> | |||
<update id="updateById" parameterType="com.tuoheng.model.po.TenantPo"> | |||
update t_tenant | |||
@@ -15,6 +15,24 @@ | |||
<if test="enabled != null"> | |||
enabled = #{enabled}, | |||
</if> | |||
<if test="provinceCode != null and provinceCode !=''"> | |||
province_code = #{provinceCode}, | |||
</if> | |||
<if test="provinceName != null and provinceName !=''"> | |||
province_name = #{provinceName}, | |||
</if> | |||
<if test="cityCode != null and cityCode !=''"> | |||
city_code = #{cityCode}, | |||
</if> | |||
<if test="cityName != null and cityName !=''"> | |||
city_name = #{cityName}, | |||
</if> | |||
<if test="districtCode != null and districtCode !=''"> | |||
district_code = #{districtCode}, | |||
</if> | |||
<if test="districtName != null and districtName !=''"> | |||
district_name = #{districtName}, | |||
</if> | |||
</set> | |||
where id = #{id} | |||
</update> |
@@ -65,4 +65,8 @@ spring: | |||
max-active: 1000 # 连接池最大连接数(使用负值表示没有限制) | |||
max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) | |||
max-idle: 10 # 连接池中的最大空闲连接 | |||
min-idle: 1 # 连接池中的最小空闲连接 | |||
min-idle: 1 # 连接池中的最小空闲连接 | |||
# 自定义配置 | |||
tuoheng: | |||
#airport配置地址 | |||
airport-url: https://airport-test.t-aaron.com |
@@ -65,4 +65,8 @@ spring: | |||
max-active: 1000 # 连接池最大连接数(使用负值表示没有限制) | |||
max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) | |||
max-idle: 10 # 连接池中的最大空闲连接 | |||
min-idle: 1 # 连接池中的最小空闲连接 | |||
min-idle: 1 # 连接池中的最小空闲连接 | |||
# 自定义配置 | |||
tuoheng: | |||
#airport配置地址 | |||
airport-url: https://airport-test.t-aaron.com |
@@ -65,3 +65,7 @@ spring: | |||
max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) | |||
max-idle: 10 # 连接池中的最大空闲连接 | |||
min-idle: 1 # 连接池中的最小空闲连接 | |||
# 自定义配置 | |||
tuoheng: | |||
#airport配置地址 | |||
airport-url: https://airport-test.t-aaron.com |
@@ -29,6 +29,13 @@ | |||
WHERE id = #{userId} | |||
and enabled = 1 | |||
</select> | |||
<select id="selectByTenantId" resultType="com.tuoheng.model.po.UserPo"> | |||
SELECT * | |||
FROM users | |||
WHERE tenant_id = #{tenantId} | |||
# 用户没有被删除 | |||
and enabled = 1 | |||
</select> | |||
<update id="updatePass" parameterType="com.tuoheng.model.po.UserPo"> | |||
update users |
@@ -3,18 +3,36 @@ | |||
<mapper namespace="com.tuoheng.mapper.TenantMapper"> | |||
<insert id="insertTenant" parameterType="com.tuoheng.model.po.TenantPo" keyProperty="id" useGeneratedKeys="true"> | |||
INSERT INTO t_tenant (user_id, remark, `code`, `name`) | |||
VALUES (#{userId}, #{remark}, #{code}, #{name}) | |||
INSERT INTO t_tenant (user_id, remark, `code`, `name`,province_code,province_name,city_code,city_name,district_code,district_name) | |||
VALUES (#{userId}, #{remark}, #{code}, #{name},#{provinceCode},#{provinceName},#{cityCode},#{cityName},#{districtCode},#{districtName}) | |||
</insert> | |||
<update id="updateById" parameterType="com.tuoheng.model.po.TenantPo"> | |||
update t_tenant | |||
<set> | |||
<if test="name !=null and name !=''"> | |||
<if test="name != null and name !=''"> | |||
name = #{name}, | |||
</if> | |||
<if test="enabled !=null"> | |||
<if test="enabled != null"> | |||
enabled = #{enabled}, | |||
</if> | |||
<if test="provinceCode != null and provinceCode !=''"> | |||
province_code = #{provinceCode}, | |||
</if> | |||
<if test="provinceName != null and provinceName !=''"> | |||
province_name = #{provinceName}, | |||
</if> | |||
<if test="cityCode != null and cityCode !=''"> | |||
city_code = #{cityCode}, | |||
</if> | |||
<if test="cityName != null and cityName !=''"> | |||
city_name = #{cityName}, | |||
</if> | |||
<if test="districtCode != null and districtCode !=''"> | |||
district_code = #{districtCode}, | |||
</if> | |||
<if test="districtName != null and districtName !=''"> | |||
district_name = #{districtName}, | |||
</if> | |||
</set> | |||
where id = #{id} | |||
</update> |