소스 검색

完善租户模块

master
zongjl 2 년 전
부모
커밋
fe9ee54e2c
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  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 파일 보기

@@ -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…
취소
저장