Explorar el Código

完成初步租户创建(及相关表及字段更新)

tags/v2.4.1
xiaoying hace 1 año
padre
commit
9a58d3dc88
Se han modificado 28 ficheros con 562 adiciones y 17 borrados
  1. +15
    -0
      tuoheng_oidc_admin/src/main/java/com/tuoheng/common/CommonConfig.java
  2. +20
    -0
      tuoheng_oidc_admin/src/main/java/com/tuoheng/mapper/TenantEmployMapper.java
  3. +20
    -0
      tuoheng_oidc_admin/src/main/java/com/tuoheng/mapper/TenantItemMapper.java
  4. +61
    -0
      tuoheng_oidc_admin/src/main/java/com/tuoheng/model/entity/TenantEmploy.java
  5. +76
    -0
      tuoheng_oidc_admin/src/main/java/com/tuoheng/model/entity/TenantItem.java
  6. +14
    -3
      tuoheng_oidc_admin/src/main/java/com/tuoheng/model/param/ClientRoleDto.java
  7. +16
    -0
      tuoheng_oidc_admin/src/main/java/com/tuoheng/model/param/CreateClientTenantDto.java
  8. +9
    -1
      tuoheng_oidc_admin/src/main/java/com/tuoheng/model/po/TenantPo.java
  9. +13
    -0
      tuoheng_oidc_admin/src/main/java/com/tuoheng/service/TenantEmployService.java
  10. +13
    -0
      tuoheng_oidc_admin/src/main/java/com/tuoheng/service/TenantItemService.java
  11. +22
    -0
      tuoheng_oidc_admin/src/main/java/com/tuoheng/service/impl/TenantEmployServiceImpl.java
  12. +22
    -0
      tuoheng_oidc_admin/src/main/java/com/tuoheng/service/impl/TenantItemServiceImpl.java
  13. +43
    -2
      tuoheng_oidc_admin/src/main/java/com/tuoheng/service/impl/TenantServiceImpl.java
  14. +140
    -0
      tuoheng_oidc_admin/src/main/java/com/tuoheng/until/MapUtils.java
  15. +3
    -1
      tuoheng_oidc_admin/src/main/resources/application-dev.yml
  16. +3
    -1
      tuoheng_oidc_admin/src/main/resources/application-prod.yml
  17. +3
    -1
      tuoheng_oidc_admin/src/main/resources/application-test.yml
  18. +26
    -0
      tuoheng_oidc_admin/src/main/resources/mapper/TenantEmployMapper.xml
  19. +27
    -0
      tuoheng_oidc_admin/src/main/resources/mapper/TenantItemMapper.xml
  20. +2
    -2
      tuoheng_oidc_admin/src/main/resources/mapper/TenantMapper.xml
  21. +3
    -1
      tuoheng_oidc_admin/target/classes/WEB-INF/classes/application-dev.yml
  22. +3
    -1
      tuoheng_oidc_admin/target/classes/application-dev.yml
  23. +3
    -1
      tuoheng_oidc_admin/target/classes/application-prod.yml
  24. +3
    -1
      tuoheng_oidc_admin/target/classes/application-test.yml
  25. BIN
      tuoheng_oidc_admin/target/classes/com/tuoheng/model/param/ClientRoleDto.class
  26. BIN
      tuoheng_oidc_admin/target/classes/com/tuoheng/model/param/CreateClientTenantDto.class
  27. BIN
      tuoheng_oidc_admin/target/classes/com/tuoheng/model/po/TenantPo.class
  28. +2
    -2
      tuoheng_oidc_admin/target/classes/mapper/TenantMapper.xml

+ 15
- 0
tuoheng_oidc_admin/src/main/java/com/tuoheng/common/CommonConfig.java Ver fichero

@@ -20,6 +20,11 @@ public class CommonConfig {
*/
public static String dspURL;

/**
* 高德KEY
*/
public static String gaodeKey;

/**
* 机场url
* @param url
@@ -37,4 +42,14 @@ public class CommonConfig {
public void dspURL(String url) {
dspURL = url;
}

/**
* 高德KEY赋值
*
* @param key 高德KEY
*/
@Value("${tuoheng.gaodeKey}")
public void setGaodeKey(String key) {
gaodeKey = key;
}
}

+ 20
- 0
tuoheng_oidc_admin/src/main/java/com/tuoheng/mapper/TenantEmployMapper.java Ver fichero

@@ -0,0 +1,20 @@
package com.tuoheng.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tuoheng.model.entity.TenantEmploy;
import org.apache.ibatis.annotations.Mapper;

/**
* @author 小影
* @description 针对表【t_tenant_ employ】的数据库操作Mapper
* @createDate 2023-03-08 14:33:40
* @Entity com.tuoheng.model.entity.Tenant employ
*/
@Mapper
public interface TenantEmployMapper extends BaseMapper<TenantEmploy> {

}





+ 20
- 0
tuoheng_oidc_admin/src/main/java/com/tuoheng/mapper/TenantItemMapper.java Ver fichero

@@ -0,0 +1,20 @@
package com.tuoheng.mapper;

import com.tuoheng.model.entity.TenantItem;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

/**
* @author 小影
* @description 针对表【t_tenant_item】的数据库操作Mapper
* @createDate 2023-03-08 14:11:43
* @Entity com.tuoheng.model.entity.TenantItem
*/
@Mapper
public interface TenantItemMapper extends BaseMapper<TenantItem> {

}





+ 61
- 0
tuoheng_oidc_admin/src/main/java/com/tuoheng/model/entity/TenantEmploy.java Ver fichero

@@ -0,0 +1,61 @@
package com.tuoheng.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
*
* @TableName t_tenant_employ
*/
@TableName(value ="t_tenant_employ")
@Data
public class TenantEmploy implements Serializable {
/**
*
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;

/**
*
*/
private Date createTime;

/**
*
*/
private Date updateTime;

/**
*
*/
private Long createUser;

/**
*
*/
private Long updateUser;

/**
* 租户id
*/
private Long tenantId;

/**
* 服务实例id
*/
private String serviceId;

/**
* 识别详情
*/
private String description;

@TableField(exist = false)
private static final long serialVersionUID = 1L;
}

+ 76
- 0
tuoheng_oidc_admin/src/main/java/com/tuoheng/model/entity/TenantItem.java Ver fichero

@@ -0,0 +1,76 @@
package com.tuoheng.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
*
* @TableName t_tenant_item
*/
@TableName(value ="t_tenant_item")
@Data
public class TenantItem implements Serializable {
/**
*
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;

/**
*
*/
private Date createTime;

/**
*
*/
private Date updateTime;

/**
*
*/
private Long createUser;

/**
*
*/
private Long updateUser;

/**
* 销售人员id
*/
private Long mrakerId;

/**
* 租户id
*/
private Long tenantId;

/**
* 立项编号
*/
private String projectCode;

/**
* 合同编号
*/
private String contractCode;

/**
* 项目起始时间
*/
private Date beginTime;

/**
* 项目失效时间
*/
private Date endTime;

@TableField(exist = false)
private static final long serialVersionUID = 1L;
}

+ 14
- 3
tuoheng_oidc_admin/src/main/java/com/tuoheng/model/param/ClientRoleDto.java Ver fichero

@@ -9,9 +9,20 @@ import lombok.Data;
*/
@Data
public class ClientRoleDto {

/**
* 平台标识
*/
private String clientId;

/**
* 该平台对应角色id
*/
private Integer roleId;

/**
* 该平台对应服务实例id
*/
private String serviceId;
/**
* 识别详情
*/
private String description;
}

+ 16
- 0
tuoheng_oidc_admin/src/main/java/com/tuoheng/model/param/CreateClientTenantDto.java Ver fichero

@@ -1,5 +1,6 @@
package com.tuoheng.model.param;

import com.tuoheng.model.entity.TenantItem;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
@@ -56,4 +57,19 @@ public class CreateClientTenantDto {
* 区县名称
*/
private String districtName;
/**
* 租户对应项目基本信息
*/
private TenantItem tenantItem;

private String customer;

private String customerPhone;

private String adress;

private String lng;

private String lat;

}

+ 9
- 1
tuoheng_oidc_admin/src/main/java/com/tuoheng/model/po/TenantPo.java Ver fichero

@@ -49,5 +49,13 @@ public class TenantPo extends BasePo {
*/
private String districtName;

private String username;
private String customer;

private String customerPhone;

private String adress;

private String lng;

private String lat;
}

+ 13
- 0
tuoheng_oidc_admin/src/main/java/com/tuoheng/service/TenantEmployService.java Ver fichero

@@ -0,0 +1,13 @@
package com.tuoheng.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tuoheng.model.entity.TenantEmploy;

/**
* @author 小影
* @description 针对表【t_tenant_ employ】的数据库操作Service
* @createDate 2023-03-08 14:33:40
*/
public interface TenantEmployService extends IService<TenantEmploy> {

}

+ 13
- 0
tuoheng_oidc_admin/src/main/java/com/tuoheng/service/TenantItemService.java Ver fichero

@@ -0,0 +1,13 @@
package com.tuoheng.service;

import com.tuoheng.model.entity.TenantItem;
import com.baomidou.mybatisplus.extension.service.IService;

/**
* @author 小影
* @description 针对表【t_tenant_item】的数据库操作Service
* @createDate 2023-03-08 14:11:43
*/
public interface TenantItemService extends IService<TenantItem> {

}

+ 22
- 0
tuoheng_oidc_admin/src/main/java/com/tuoheng/service/impl/TenantEmployServiceImpl.java Ver fichero

@@ -0,0 +1,22 @@
package com.tuoheng.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tuoheng.mapper.TenantEmployMapper;
import com.tuoheng.model.entity.TenantEmploy;
import com.tuoheng.service.TenantEmployService;
import org.springframework.stereotype.Service;

/**
* @author 小影
* @description 针对表【t_tenant_ employ】的数据库操作Service实现
* @createDate 2023-03-08 14:33:40
*/
@Service
public class TenantEmployServiceImpl extends ServiceImpl<TenantEmployMapper, TenantEmploy>
implements TenantEmployService {

}





+ 22
- 0
tuoheng_oidc_admin/src/main/java/com/tuoheng/service/impl/TenantItemServiceImpl.java Ver fichero

@@ -0,0 +1,22 @@
package com.tuoheng.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tuoheng.model.entity.TenantItem;
import com.tuoheng.service.TenantItemService;
import com.tuoheng.mapper.TenantItemMapper;
import org.springframework.stereotype.Service;

/**
* @author 小影
* @description 针对表【t_tenant_item】的数据库操作Service实现
* @createDate 2023-03-08 14:11:43
*/
@Service
public class TenantItemServiceImpl extends ServiceImpl<TenantItemMapper, TenantItem>
implements TenantItemService{

}





+ 43
- 2
tuoheng_oidc_admin/src/main/java/com/tuoheng/service/impl/TenantServiceImpl.java Ver fichero

@@ -1,15 +1,19 @@
package com.tuoheng.service.impl;

import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tuoheng.common.CommonConfig;
import com.tuoheng.common.ServiceException;
import com.tuoheng.constant.*;
import com.tuoheng.mapper.*;
import com.tuoheng.model.dto.*;
import com.tuoheng.model.entity.TenantEmploy;
import com.tuoheng.model.entity.TenantItem;
import com.tuoheng.model.param.*;
import com.tuoheng.model.po.AuthoritiesPo;
import com.tuoheng.model.po.ClientUserRolePo;
@@ -20,8 +24,10 @@ import com.tuoheng.model.query.UserQuery;
import com.tuoheng.model.vo.BusinessSystemVo;
import com.tuoheng.model.vo.TenantVo;
import com.tuoheng.model.vo.UserVo;
import com.tuoheng.service.TenantEmployService;
import com.tuoheng.service.TenantService;
import com.tuoheng.until.JsonResult;
import com.tuoheng.until.MapUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -35,6 +41,7 @@ import org.springframework.web.client.RestTemplate;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
@@ -63,6 +70,12 @@ public class TenantServiceImpl implements TenantService {
@Autowired
private PlatformMapper platformMapper;

@Autowired
private TenantEmployMapper tenantEmployMapper;

@Autowired
private TenantItemMapper tenantItemMapper;


@Override
@Transactional(rollbackFor = Exception.class)
@@ -71,6 +84,8 @@ public class TenantServiceImpl implements TenantService {
if (clientUserMapper.judgeCreateByUserName(createClientTenantDto.getUsername()) > 0) {
return JsonResult.error("该用户名称已存在!");
}
//code复用username
createClientTenantDto.setTenantCode(createClientTenantDto.getTenantName());
//用户表
UserPo userPo = new UserPo()
.setIsTenant(1)
@@ -78,19 +93,44 @@ public class TenantServiceImpl implements TenantService {
.setPassword("{bcrypt}" + new BCryptPasswordEncoder().encode(createClientTenantDto.getPassword()));
userPo.setCreateUser(loginUser.getUserId());
clientUserMapper.insertClientUser(userPo);
log.info("用户表添加完毕");
//调用高德将地址转换经纬度
Map lonAndLat = MapUtils.getLonAndLat(createClientTenantDto.getAdress(), CommonConfig.gaodeKey);
//租户表
TenantPo tenantPo = new TenantPo();
BeanUtils.copyProperties(createClientTenantDto, tenantPo);
tenantPo.setName(createClientTenantDto.getTenantName())
.setCode(createClientTenantDto.getTenantCode())
.setUserId(userPo.getId());
.setUserId(userPo.getId())
//获取经纬度更新
.setLat(lonAndLat.get("lat").toString())
.setLng(lonAndLat.get("lng").toString());
tenantMapper.insertTenant(tenantPo);
log.info("租户表添加完毕");
//添加租户对应项目详细信息表
TenantItem tenantItem = createClientTenantDto.getTenantItem();
tenantItem.setTenantId(tenantPo.getId());
tenantItemMapper.insert(tenantItem);
log.info("租户项目表添加完毕");

for (ClientRoleDto clientRoleDto : createClientTenantDto.getClientRoleDtoList()) {
//添加租户对应服务的相关表数据
TenantEmploy tenantEmploy = new TenantEmploy();
tenantEmploy.setTenantId(tenantPo.getId());
tenantEmploy.setServiceId(clientRoleDto.getServiceId());
tenantEmploy.setDescription(clientRoleDto.getDescription());
tenantEmployMapper.insert(tenantEmploy);
}
log.info("租户客户表添加完毕");

//1.开始判断租户对应需要的平台并进行匹对
List<ClientRoleDto> clientRoleDtoList = getClientRoleDtos(createClientTenantDto);
List<AuthoritiesPo> authoritiesPos = new ArrayList<>();
List<ClientUserRolePo> clientUserRolePoArrayList = new ArrayList<>();
//添加租户对应相关信息
//2.添加租户对应相关信息
log.info("开始创建对应各个业务平台的表");
for (ClientRoleDto clientRoleDto : clientRoleDtoList) {
//添加角色权限相关
AuthoritiesPo authoritiesPo = new AuthoritiesPo()
.setUserId(userPo.getId())
.setUsername(createClientTenantDto.getUsername())
@@ -248,6 +288,7 @@ public class TenantServiceImpl implements TenantService {

return JsonResult.success();
}

/**
* 查询租户以及该租户对应绑定的系统等
*

+ 140
- 0
tuoheng_oidc_admin/src/main/java/com/tuoheng/until/MapUtils.java Ver fichero

@@ -0,0 +1,140 @@
package com.tuoheng.until;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.tuoheng.common.CommonConfig;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.HashMap;
import java.util.Map;

public class MapUtils {
public static void main(String[] args) {
try {
// 1、根据地址获取经纬度
Map<String, String> lonAndLat = getLonAndLat("浙江省杭州市滨江区江汉路1515号", CommonConfig.gaodeKey);
System.out.println("转换后经纬度为:" + lonAndLat);

// 2、根据经纬度获取地址
String formattedAddress = getAMapByLngAndLat("120.204798", "30.201000", CommonConfig.gaodeKey);
System.out.println("转换后地址为:" + formattedAddress);
} catch (Exception e) {
e.printStackTrace();
}
}

/**
* 地址转换为经纬度
*
* @param address 地址
* @param key 高德地图应用key
* @return 经纬度
*/
public static Map getLonAndLat(String address, String key) {
// 返回输入地址address的经纬度信息, 格式是 经度,纬度
String queryUrl = "http://restapi.amap.com/v3/geocode/geo?key=" + key + "&address=" + address;
// 高德接口返回的是JSON格式的字符串
String queryResult = getResponse(queryUrl);
Map<String, String> map = new HashMap<String, String>();
JSONObject obj = JSONObject.parseObject(queryResult);
if (obj.get("status").toString().equals("1")) {
JSONObject jobJSON = JSONObject.parseObject(obj.get("geocodes").toString().substring(1, obj.get("geocodes").toString().length() - 1));
String location = jobJSON.get("location").toString();
System.out.println("经纬度:" + location);
String[] lonAndLat = location.split(",");
if (lonAndLat != null && lonAndLat.length == 2) {
map.put("lng", lonAndLat[0]);
map.put("lat", lonAndLat[1]);
}
System.out.println(map);
return map;
} else {
throw new RuntimeException("地址转换经纬度失败,错误码:" + obj.get("infocode"));
}
}

/**
* 将经纬度getLng, getLat 通过getAMapByLngAndLat方法转换地址
*
* @param getLng 经度
* @param getLat 纬度
* @param key 高德地图应用key
* @return 地址名称
* @throws Exception
*/
public static String getAMapByLngAndLat(String getLng, String getLat, String key) throws Exception {
String url;
try {
url = "http://restapi.amap.com/v3/geocode/regeo?output=JSON&location=" + getLng + ","
+ getLat + "&key=" + key + "&radius=0&extensions=base";
String queryResult = getResponse(url); // 高德接品返回的是JSON格式的字符串
// 将获取结果转为json数据
JSONObject obj = JSONObject.parseObject(queryResult);
System.out.println("obj为:" + obj);
if (obj.get("status").toString().equals("1")) {
// 如果没有返回-1
JSONObject regeocode = obj.getJSONObject("regeocode");
if (regeocode.size() > 0) {
// 在regeocode中拿到 formatted_address 具体位置
return regeocode.get("formatted_address").toString();
} else {
throw new RuntimeException("未找到相匹配的地址!");
}
} else {
throw new RuntimeException("请求错误!");
}
} catch (Exception e) {
e.printStackTrace();
}
return "-1";
}

/**
* 根据两个定位点的经纬度算出两点间的距离
*
* @param startLonLat 起始经纬度
* @param endLonLat 结束经纬度(目标经纬度)
* @param key 高德地图应用key
* @return 两个定位点之间的距离
*/
private static long getDistance(String startLonLat, String endLonLat, String key) {
// 返回起始地startAddr与目的地endAddr之间的距离,单位:米
Long result = new Long(0);
String queryUrl = "http://restapi.amap.com/v3/distance?key=" + key + "&origins=" + startLonLat + "&destination=" + endLonLat;
String queryResult = getResponse(queryUrl);
JSONObject obj = JSONObject.parseObject(queryResult);
JSONArray ja = obj.getJSONArray("results");
JSONObject jobO = JSONObject.parseObject(ja.getString(0));
result = Long.parseLong(jobO.get("distance").toString());
System.out.println("距离:" + result);
return result;
}

/**
* 发送请求
*
* @param serverUrl 请求地址
*/
private static String getResponse(String serverUrl) {
// 用JAVA发起http请求,并返回json格式的结果
StringBuffer result = new StringBuffer();
try {
URL url = new URL(serverUrl);
URLConnection conn = url.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;
while ((line = in.readLine()) != null) {
result.append(line);
}
in.close();
} catch (Exception e) {
e.printStackTrace();
}
return result.toString();
}
}



+ 3
- 1
tuoheng_oidc_admin/src/main/resources/application-dev.yml Ver fichero

@@ -71,4 +71,6 @@ tuoheng:
#airport配置地址
airport-url: https://airport-test.t-aaron.com
#dsp配置地址
dsp-url: http://106.15.64.139:7011/api/web/dsp
dsp-url: http://106.15.64.139:7011/api/web/dsp
# 高德Key
gaodeKey: 5a1f63e7563cba471a9d0773e218144a

+ 3
- 1
tuoheng_oidc_admin/src/main/resources/application-prod.yml Ver fichero

@@ -68,4 +68,6 @@ spring:
# 自定义配置
tuoheng:
#airport配置地址
airport-url: https://airport.t-aaron.com
airport-url: https://airport.t-aaron.com
# 高德Key
gaodeKey: 5a1f63e7563cba471a9d0773e218144a

+ 3
- 1
tuoheng_oidc_admin/src/main/resources/application-test.yml Ver fichero

@@ -70,4 +70,6 @@ tuoheng:
#airport配置地址
airport-url: https://airport-test.t-aaron.com
#dsp配置地址
dsp-url: https://dsp-portal.t-aaron.com/api/web/dsp
dsp-url: https://dsp-portal.t-aaron.com/api/web/dsp
# 高德Key
gaodeKey: 5a1f63e7563cba471a9d0773e218144a

+ 26
- 0
tuoheng_oidc_admin/src/main/resources/mapper/TenantEmployMapper.xml Ver fichero

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.tuoheng.mapper.TenantEmployMapper">
<resultMap id="BaseResultMap" type="com.tuoheng.model.entity.TenantItem">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="createUser" column="create_user" jdbcType="BIGINT"/>
<result property="updateUser" column="update_user" jdbcType="BIGINT"/>
<result property="mrakerId" column="mraker_id" jdbcType="BIGINT"/>
<result property="tenantId" column="tenant_id" jdbcType="BIGINT"/>
<result property="projectCode" column="project_code" jdbcType="VARCHAR"/>
<result property="contractCode" column="contract_code" jdbcType="VARCHAR"/>
<result property="beginTime" column="begin_time" jdbcType="TIMESTAMP"/>
<result property="endTime" column="end_time" jdbcType="TIMESTAMP"/>
</resultMap>

<sql id="Base_Column_List">
id,create_time,update_time,
create_user,update_user,mraker_id,
tenant_id,project_code,contract_code,
begin_time,end_time
</sql>


</mapper>

+ 27
- 0
tuoheng_oidc_admin/src/main/resources/mapper/TenantItemMapper.xml Ver fichero

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.tuoheng.mapper.TenantItemMapper">

<resultMap id="BaseResultMap" type="com.tuoheng.model.entity.TenantItem">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="createUser" column="create_user" jdbcType="BIGINT"/>
<result property="updateUser" column="update_user" jdbcType="BIGINT"/>
<result property="mrakerId" column="mraker_id" jdbcType="BIGINT"/>
<result property="tenantId" column="tenant_id" jdbcType="BIGINT"/>
<result property="projectCode" column="project_code" jdbcType="VARCHAR"/>
<result property="contractCode" column="contract_code" jdbcType="VARCHAR"/>
<result property="beginTime" column="begin_time" jdbcType="TIMESTAMP"/>
<result property="endTime" column="end_time" jdbcType="TIMESTAMP"/>
</resultMap>

<sql id="Base_Column_List">
id,create_time,update_time,
create_user,update_user,mraker_id,
tenant_id,project_code,contract_code,
begin_time,end_time
</sql>
</mapper>

+ 2
- 2
tuoheng_oidc_admin/src/main/resources/mapper/TenantMapper.xml Ver fichero

@@ -4,9 +4,9 @@

<insert id="insertTenant" parameterType="com.tuoheng.model.po.TenantPo" keyProperty="id" useGeneratedKeys="true">
INSERT INTO t_tenant (user_id, remark, `code`, `name`, province_code, province_name, city_code, city_name,
district_code, district_name)
district_code, district_name, customer, customer_phone, adress, lng, lat)
VALUES (#{userId}, #{remark}, #{code}, #{name}, #{provinceCode}, #{provinceName}, #{cityCode}, #{cityName},
#{districtCode}, #{districtName})
#{districtCode}, #{districtName}, #{customer}, #{customerPhone}, #{adress}, #{lng}, #{lat})
</insert>
<update id="updateById" parameterType="com.tuoheng.model.po.TenantPo">
update t_tenant

+ 3
- 1
tuoheng_oidc_admin/target/classes/WEB-INF/classes/application-dev.yml Ver fichero

@@ -71,4 +71,6 @@ tuoheng:
#airport配置地址
airport-url: https://airport-test.t-aaron.com
#dsp配置地址
dsp-url: http://106.15.64.139:7011/api/web/dsp
dsp-url: http://106.15.64.139:7011/api/web/dsp
# 高德Key
gaodeKey: 5a1f63e7563cba471a9d0773e218144a

+ 3
- 1
tuoheng_oidc_admin/target/classes/application-dev.yml Ver fichero

@@ -71,4 +71,6 @@ tuoheng:
#airport配置地址
airport-url: https://airport-test.t-aaron.com
#dsp配置地址
dsp-url: http://106.15.64.139:7011/api/web/dsp
dsp-url: http://106.15.64.139:7011/api/web/dsp
# 高德Key
gaodeKey: 5a1f63e7563cba471a9d0773e218144a

+ 3
- 1
tuoheng_oidc_admin/target/classes/application-prod.yml Ver fichero

@@ -68,4 +68,6 @@ spring:
# 自定义配置
tuoheng:
#airport配置地址
airport-url: https://airport.t-aaron.com
airport-url: https://airport.t-aaron.com
# 高德Key
gaodeKey: 5a1f63e7563cba471a9d0773e218144a

+ 3
- 1
tuoheng_oidc_admin/target/classes/application-test.yml Ver fichero

@@ -70,4 +70,6 @@ tuoheng:
#airport配置地址
airport-url: https://airport-test.t-aaron.com
#dsp配置地址
dsp-url: https://dsp-portal.t-aaron.com/api/web/dsp
dsp-url: https://dsp-portal.t-aaron.com/api/web/dsp
# 高德Key
gaodeKey: 5a1f63e7563cba471a9d0773e218144a

BIN
tuoheng_oidc_admin/target/classes/com/tuoheng/model/param/ClientRoleDto.class Ver fichero


BIN
tuoheng_oidc_admin/target/classes/com/tuoheng/model/param/CreateClientTenantDto.class Ver fichero


BIN
tuoheng_oidc_admin/target/classes/com/tuoheng/model/po/TenantPo.class Ver fichero


+ 2
- 2
tuoheng_oidc_admin/target/classes/mapper/TenantMapper.xml Ver fichero

@@ -4,9 +4,9 @@

<insert id="insertTenant" parameterType="com.tuoheng.model.po.TenantPo" keyProperty="id" useGeneratedKeys="true">
INSERT INTO t_tenant (user_id, remark, `code`, `name`, province_code, province_name, city_code, city_name,
district_code, district_name)
district_code, district_name, customer, customer_phone, adress, lng, lat)
VALUES (#{userId}, #{remark}, #{code}, #{name}, #{provinceCode}, #{provinceName}, #{cityCode}, #{cityName},
#{districtCode}, #{districtName})
#{districtCode}, #{districtName}, #{customer}, #{customerPhone}, #{adress}, #{lng}, #{lat})
</insert>
<update id="updateById" parameterType="com.tuoheng.model.po.TenantPo">
update t_tenant

Cargando…
Cancelar
Guardar