mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-14 21:52:07 +08:00
1.新增组织时候通过配置文件创建组织的data-code数据源标识
This commit is contained in:
+7
@@ -37,6 +37,7 @@ import com.cf.imes.module.system.service.user.AdminUserService;
|
|||||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -83,6 +84,9 @@ public class OrganServiceImpl implements OrganService {
|
|||||||
//组织员工角色id
|
//组织员工角色id
|
||||||
private static final Long ORGAN_STAFF_ROLE_ID = 166L;
|
private static final Long ORGAN_STAFF_ROLE_ID = 166L;
|
||||||
|
|
||||||
|
@Value("${chenfeng.organ.use-data-code:imes_prod}")
|
||||||
|
private String useDataCode;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Long> getOrganIdList() {
|
public List<Long> getOrganIdList() {
|
||||||
List<OrganizationDO> organizationDOS = organMapper.selectList();
|
List<OrganizationDO> organizationDOS = organMapper.selectList();
|
||||||
@@ -131,6 +135,9 @@ public class OrganServiceImpl implements OrganService {
|
|||||||
tenant.setCode(StrUtil.isBlank(createReqVO.getCode())? pinyinFull : createReqVO.getCode());
|
tenant.setCode(StrUtil.isBlank(createReqVO.getCode())? pinyinFull : createReqVO.getCode());
|
||||||
tenant.setLarge(createReqVO.getLarge() == null ? Boolean.FALSE : createReqVO.getLarge());
|
tenant.setLarge(createReqVO.getLarge() == null ? Boolean.FALSE : createReqVO.getLarge());
|
||||||
tenant.setPinyinInitial(PinYinUtils.convertFirstChar(tenant.getName()));
|
tenant.setPinyinInitial(PinYinUtils.convertFirstChar(tenant.getName()));
|
||||||
|
//todo 未来还需要判断是否大客户,大客户有自己dataCode
|
||||||
|
tenant.setDataSourceCode(useDataCode);
|
||||||
|
|
||||||
organMapper.insert(tenant);
|
organMapper.insert(tenant);
|
||||||
Long organId = tenant.getId();
|
Long organId = tenant.getId();
|
||||||
if (!tenant.getLarge()) {
|
if (!tenant.getLarge()) {
|
||||||
|
|||||||
@@ -182,6 +182,7 @@ chenfeng:
|
|||||||
- system_label_template
|
- system_label_template
|
||||||
- system_label_element_template
|
- system_label_element_template
|
||||||
- system_data_source
|
- system_data_source
|
||||||
|
use-data-code: imes_prod #动态数据源标识,后期添加的数据源需要修改此值
|
||||||
|
|
||||||
sms-code: # 短信验证码相关的配置项
|
sms-code: # 短信验证码相关的配置项
|
||||||
expire-times: 10m
|
expire-times: 10m
|
||||||
|
|||||||
Reference in New Issue
Block a user