Browse Source

完善租户模块

master
zongjl 2 years ago
parent
commit
fe9ee54e2c
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/TenantServiceImpl.java

+ 7
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/TenantServiceImpl.java View File

@@ -15,6 +15,7 @@ import com.tuoheng.common.config.CommonConfig;
import com.tuoheng.common.utils.*;
import com.tuoheng.system.entity.User;
import com.tuoheng.system.mapper.UserMapper;
import com.tuoheng.system.utils.ShiroUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -87,6 +88,10 @@ public class TenantServiceImpl extends BaseServiceImpl<TenantMapper, Tenant> imp
// 参数转换
Tenant tenant = new Tenant();
BeanUtils.copyProperties(tenantDto, tenant);
tenant.setCreateUser(ShiroUtils.getUserId());
tenant.setCreateTime(DateUtils.now());
tenant.setUpdateUser(ShiroUtils.getUserId());
tenant.setUpdateTime(DateUtils.now());
// 租户头像
if (StringUtils.isNotNull(tenantDto.getLogo()) && tenantDto.getLogo().contains(CommonConfig.imageURL)) {
tenant.setLogo(tenantDto.getLogo().replaceAll(CommonConfig.imageURL, ""));
@@ -136,6 +141,8 @@ public class TenantServiceImpl extends BaseServiceImpl<TenantMapper, Tenant> imp
return JsonResult.error("系统中已经存在相同的租户编码");
}
BeanUtils.copyProperties(tenantDto, tenant);
tenant.setUpdateUser(ShiroUtils.getUserId());
tenant.setUpdateTime(DateUtils.now());
// 租户头像
if (StringUtils.isNotNull(tenantDto.getLogo()) && tenantDto.getLogo().contains(CommonConfig.imageURL)) {
tenant.setLogo(tenantDto.getLogo().replaceAll(CommonConfig.imageURL, ""));

Loading…
Cancel
Save