|
@@ -2,12 +2,14 @@ package com.usky.system.service.impl;
|
|
|
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.usky.common.core.bean.CommonPage;
|
|
|
import com.usky.common.core.exception.BusinessException;
|
|
|
import com.usky.common.mybatis.core.AbstractCrudService;
|
|
|
import com.usky.common.security.utils.SecurityUtils;
|
|
|
-import com.usky.system.domain.*;
|
|
|
+import com.usky.system.domain.SysDept;
|
|
|
+import com.usky.system.domain.SysRole;
|
|
|
+import com.usky.system.domain.SysTenant;
|
|
|
+import com.usky.system.domain.SysUserTenant;
|
|
|
import com.usky.system.mapper.SysTenantMapper;
|
|
|
import com.usky.system.mapper.SysUserTenantMapper;
|
|
|
import com.usky.system.service.ISysDeptService;
|
|
@@ -124,20 +126,11 @@ public class SysTenantServiceImpl extends AbstractCrudService<SysTenantMapper, S
|
|
|
sysDept.setCreateBy(SecurityUtils.getUsername());
|
|
|
iSysDeptService.insertDept(sysDept);
|
|
|
|
|
|
- Integer[] arr = new Integer[]{Integer.parseInt(sysTenant.getSystemName())};
|
|
|
- LambdaQueryWrapper<SysTenantPlatform> queryWrapper = Wrappers.lambdaQuery();
|
|
|
- queryWrapper.eq(SysTenantPlatform::getTenantId,tenantId)
|
|
|
- .eq(SysTenantPlatform::getIsDefault,1);
|
|
|
- sysTenantPlatformService.remove(queryWrapper);
|
|
|
- LambdaQueryWrapper<SysTenantPlatform> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
- queryWrapper1.eq(SysTenantPlatform::getTenantId,tenantId)
|
|
|
- .eq(SysTenantPlatform::getPlatformId,arr[0]);
|
|
|
- sysTenantPlatformService.remove(queryWrapper1);
|
|
|
- SysTenantPlatform sysTenantPlatform = new SysTenantPlatform();
|
|
|
- sysTenantPlatform.setTenantId(tenantId);
|
|
|
- sysTenantPlatform.setPlatformId(arr[0]);
|
|
|
- sysTenantPlatform.setIsDefault(1);
|
|
|
- sysTenantPlatformService.save(sysTenantPlatform);
|
|
|
+ TenantPlatformVo tenantPlatformVo = new TenantPlatformVo();
|
|
|
+ tenantPlatformVo.setPlatformIds(new Integer[]{Integer.parseInt(sysTenant.getSystemName())});
|
|
|
+ tenantPlatformVo.setRequestId(0);
|
|
|
+ tenantPlatformVo.setTenantId(tenantId);
|
|
|
+ sysTenantPlatformService.updateTenantPlatform(tenantPlatformVo);
|
|
|
}
|
|
|
|
|
|
@Override
|