|
@@ -3,6 +3,7 @@ package org.dromara.system.service.impl;
|
|
|
import cn.dev33.satoken.secure.BCrypt;
|
|
|
import cn.hutool.core.convert.Convert;
|
|
|
import cn.hutool.core.util.RandomUtil;
|
|
|
+import org.dromara.common.core.constant.TenantConstants;
|
|
|
import org.dromara.common.core.domain.model.LoginUser;
|
|
|
import org.dromara.common.core.exception.ServiceException;
|
|
|
import org.dromara.common.core.utils.DateUtils;
|
|
@@ -66,6 +67,9 @@ public class ZhxyShyjServiceImpl implements IZhxyShyjService {
|
|
|
|
|
|
private final SysUserMapper userMapper;
|
|
|
private final SysUserServiceImpl sysUserServiceImpl;
|
|
|
+ private final SysDictTypeMapper dictTypeMapper;
|
|
|
+ private final SysDictDataMapper dictDataMapper;
|
|
|
+ private final SysConfigMapper configMapper;
|
|
|
|
|
|
/**
|
|
|
* 查询智慧校园_审核意见
|
|
@@ -139,7 +143,7 @@ public class ZhxyShyjServiceImpl implements IZhxyShyjService {
|
|
|
registerSchoolMapper.updateById(schoolu);
|
|
|
//生成租户信息
|
|
|
SysTenantBo tenantBo = new SysTenantBo();
|
|
|
- tenantBo.setCompanyName(loginUser.getNickname());
|
|
|
+ tenantBo.setCompanyName(registerSchool.getUserName());
|
|
|
tenantBo.setContactUserName(registerSchool.getUserName());
|
|
|
tenantBo.setContactPhone(registerSchool.getUserPhone());
|
|
|
tenantBo.setUsername(registerSchool.getUserPhone());
|
|
@@ -157,6 +161,7 @@ public class ZhxyShyjServiceImpl implements IZhxyShyjService {
|
|
|
}
|
|
|
tenantBo.setId(sysTenant.getId());
|
|
|
|
|
|
+ copyDict(tenantId);
|
|
|
//部门表生成学校
|
|
|
SysDept dept = new SysDept();
|
|
|
dept.setParentId(0L);
|
|
@@ -378,6 +383,37 @@ public class ZhxyShyjServiceImpl implements IZhxyShyjService {
|
|
|
return flag;
|
|
|
}
|
|
|
|
|
|
+ /***
|
|
|
+ *复制公用字典值
|
|
|
+ * @param tenantId
|
|
|
+ */
|
|
|
+ private void copyDict(String tenantId){
|
|
|
+
|
|
|
+ String defaultTenantId = TenantConstants.DEFAULT_TENANT_ID;
|
|
|
+ List<SysDictType> dictTypeList = dictTypeMapper.selectList(
|
|
|
+ new LambdaQueryWrapper<SysDictType>().eq(SysDictType::getTenantId, defaultTenantId));
|
|
|
+ List<SysDictData> dictDataList = dictDataMapper.selectList(
|
|
|
+ new LambdaQueryWrapper<SysDictData>().eq(SysDictData::getTenantId, defaultTenantId));
|
|
|
+ for (SysDictType dictType : dictTypeList) {
|
|
|
+ dictType.setDictId(null);
|
|
|
+ dictType.setTenantId(tenantId);
|
|
|
+ }
|
|
|
+ for (SysDictData dictData : dictDataList) {
|
|
|
+ dictData.setDictCode(null);
|
|
|
+ dictData.setTenantId(tenantId);
|
|
|
+ }
|
|
|
+ dictTypeMapper.insertBatch(dictTypeList);
|
|
|
+ dictDataMapper.insertBatch(dictDataList);
|
|
|
+
|
|
|
+ List<SysConfig> sysConfigList = configMapper.selectList(
|
|
|
+ new LambdaQueryWrapper<SysConfig>().eq(SysConfig::getTenantId, defaultTenantId));
|
|
|
+ for (SysConfig config : sysConfigList) {
|
|
|
+ config.setConfigId(null);
|
|
|
+ config.setTenantId(tenantId);
|
|
|
+ }
|
|
|
+ configMapper.insertBatch(sysConfigList);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 修改智慧校园_审核意见
|
|
|
*/
|