From 29162790e29cbe55a1c07445c991a40568efc249 Mon Sep 17 00:00:00 2001 From: yangsb Date: Fri, 12 Apr 2024 15:11:27 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=96=B0=E5=A2=9E=E7=BB=84=E7=BB=87=E6=97=B6?= =?UTF-8?q?=E5=80=99=E9=80=9A=E8=BF=87=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=BB=84=E7=BB=87=E7=9A=84data-code=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=BA=90=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../imes/module/system/service/organ/OrganServiceImpl.java | 7 +++++++ .../src/main/resources/application.yaml | 1 + 2 files changed, 8 insertions(+) diff --git a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/service/organ/OrganServiceImpl.java b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/service/organ/OrganServiceImpl.java index e39a9ac71..326aa5e3b 100644 --- a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/service/organ/OrganServiceImpl.java +++ b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/service/organ/OrganServiceImpl.java @@ -37,6 +37,7 @@ import com.cf.imes.module.system.service.user.AdminUserService; import com.baomidou.dynamic.datasource.annotation.DSTransactional; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; @@ -83,6 +84,9 @@ public class OrganServiceImpl implements OrganService { //组织员工角色id private static final Long ORGAN_STAFF_ROLE_ID = 166L; + @Value("${chenfeng.organ.use-data-code:imes_prod}") + private String useDataCode; + @Override public List getOrganIdList() { List organizationDOS = organMapper.selectList(); @@ -131,6 +135,9 @@ public class OrganServiceImpl implements OrganService { tenant.setCode(StrUtil.isBlank(createReqVO.getCode())? pinyinFull : createReqVO.getCode()); tenant.setLarge(createReqVO.getLarge() == null ? Boolean.FALSE : createReqVO.getLarge()); tenant.setPinyinInitial(PinYinUtils.convertFirstChar(tenant.getName())); + //todo 未来还需要判断是否大客户,大客户有自己dataCode + tenant.setDataSourceCode(useDataCode); + organMapper.insert(tenant); Long organId = tenant.getId(); if (!tenant.getLarge()) { diff --git a/cf-module-system/cf-module-system-biz/src/main/resources/application.yaml b/cf-module-system/cf-module-system-biz/src/main/resources/application.yaml index 96d3bc550..471ccf244 100644 --- a/cf-module-system/cf-module-system-biz/src/main/resources/application.yaml +++ b/cf-module-system/cf-module-system-biz/src/main/resources/application.yaml @@ -182,6 +182,7 @@ chenfeng: - system_label_template - system_label_element_template - system_data_source + use-data-code: imes_prod #动态数据源标识,后期添加的数据源需要修改此值 sms-code: # 短信验证码相关的配置项 expire-times: 10m