diff --git a/sgzb-auth/src/main/java/com/bonus/sgzb/auth/controller/TokenController.java b/sgzb-auth/src/main/java/com/bonus/sgzb/auth/controller/TokenController.java index c78fc08..e7d4fc7 100644 --- a/sgzb-auth/src/main/java/com/bonus/sgzb/auth/controller/TokenController.java +++ b/sgzb-auth/src/main/java/com/bonus/sgzb/auth/controller/TokenController.java @@ -39,8 +39,8 @@ import java.util.Map; @Slf4j public class TokenController { - @Value("${sgzb.customer}") - private String customer; + @Value("${sgzb.site}") + private String site; @Autowired private TokenService tokenService; @@ -63,7 +63,7 @@ public class TokenController { //web端登录 @PostMapping("login") public R login(@RequestBody LoginBody form) throws Exception { - if (Constants.CUSTOMER_GZ.equals(customer)) { + if (Constants.SITE_NW.equals(site)) { //优先校验图形验证码 String uuid = form.getUuid(); Object cacheObject = redisService.getCacheObject(CacheConstants.CAPTCHA_CODE_KEY + uuid); @@ -156,7 +156,7 @@ public class TokenController { @PostMapping("sendCode") public R sendCode(@RequestBody LoginBody form) { - if (Constants.CUSTOMER_GZ.equals(customer)) { + if (Constants.SITE_NW.equals(site)) { if ("adminBns".equals(form.getUsername())) { // 根据用户名查询用户信息 LoginUser userInfo = sysLoginService.selectByName(form.getUsername()); diff --git a/sgzb-auth/src/main/resources/bootstrap-sgzb_dev_cq.yml b/sgzb-auth/src/main/resources/bootstrap-sgzb_dev_cq.yml index 0db1302..22a4999 100644 --- a/sgzb-auth/src/main/resources/bootstrap-sgzb_dev_cq.yml +++ b/sgzb-auth/src/main/resources/bootstrap-sgzb_dev_cq.yml @@ -33,3 +33,6 @@ registerPhone: /lbcloud-user/api/user/registrationByPhone userBindUrl: /lbcloud-authority/api/RoleClient/bindDefaultSystemRole verifyPhoneCode: /lbcloud-mbroker/api/broker/simpleVerificationCode +# 适应多公司的个性化配置 +sgzb: + site: cq \ No newline at end of file diff --git a/sgzb-auth/src/main/resources/bootstrap-sgzb_dev_gz.yml b/sgzb-auth/src/main/resources/bootstrap-sgzb_dev_nw.yml similarity index 96% rename from sgzb-auth/src/main/resources/bootstrap-sgzb_dev_gz.yml rename to sgzb-auth/src/main/resources/bootstrap-sgzb_dev_nw.yml index d719eee..0a0ef8f 100644 --- a/sgzb-auth/src/main/resources/bootstrap-sgzb_dev_gz.yml +++ b/sgzb-auth/src/main/resources/bootstrap-sgzb_dev_nw.yml @@ -39,3 +39,6 @@ management: env: enabled: false +# 适应多公司的个性化配置 +sgzb: + site: nw \ No newline at end of file diff --git a/sgzb-auth/src/main/resources/bootstrap-sgzb_local_cq.yml b/sgzb-auth/src/main/resources/bootstrap-sgzb_local_cq.yml index 82f64e9..d3dec2a 100644 --- a/sgzb-auth/src/main/resources/bootstrap-sgzb_local_cq.yml +++ b/sgzb-auth/src/main/resources/bootstrap-sgzb_local_cq.yml @@ -33,4 +33,6 @@ registerPhone: /lbcloud-user/api/user/registrationByPhone userBindUrl: /lbcloud-authority/api/RoleClient/bindDefaultSystemRole verifyPhoneCode: /lbcloud-mbroker/api/broker/simpleVerificationCode - +# 适应多公司的个性化配置 +sgzb: + site: cq diff --git a/sgzb-auth/src/main/resources/bootstrap-sgzb_local_gz.yml b/sgzb-auth/src/main/resources/bootstrap-sgzb_local_nw.yml similarity index 96% rename from sgzb-auth/src/main/resources/bootstrap-sgzb_local_gz.yml rename to sgzb-auth/src/main/resources/bootstrap-sgzb_local_nw.yml index e7f1f96..a5a0d1a 100644 --- a/sgzb-auth/src/main/resources/bootstrap-sgzb_local_gz.yml +++ b/sgzb-auth/src/main/resources/bootstrap-sgzb_local_nw.yml @@ -39,3 +39,6 @@ management: env: enabled: false +# 适应多公司的个性化配置 +sgzb: + site: nw \ No newline at end of file diff --git a/sgzb-common/sgzb-common-core/src/main/java/com/bonus/sgzb/common/core/constant/Constants.java b/sgzb-common/sgzb-common-core/src/main/java/com/bonus/sgzb/common/core/constant/Constants.java index ca6d283..df9ef41 100644 --- a/sgzb-common/sgzb-common-core/src/main/java/com/bonus/sgzb/common/core/constant/Constants.java +++ b/sgzb-common/sgzb-common-core/src/main/java/com/bonus/sgzb/common/core/constant/Constants.java @@ -8,14 +8,14 @@ package com.bonus.sgzb.common.core.constant; public class Constants { /** - * 广州仓储 + * 南网仓储 */ - public static final String CUSTOMER_GZ = "gz"; + public static final String SITE_NW = "nw"; /** * 重庆机具 */ - public static final String CUSTOMER_CQ = "cq"; + public static final String SITE_CQ = "cq"; /** * UTF-8 字符集 diff --git a/sgzb-gateway/src/main/resources/bootstrap-sgzb_dev_cq.yml b/sgzb-gateway/src/main/resources/bootstrap-sgzb_dev_cq.yml index d4efd45..1b9fd9f 100644 --- a/sgzb-gateway/src/main/resources/bootstrap-sgzb_dev_cq.yml +++ b/sgzb-gateway/src/main/resources/bootstrap-sgzb_dev_cq.yml @@ -48,3 +48,7 @@ spring: jasypt: encryptor: password: Encrypt + +# 适应多公司的个性化配置 +sgzb: + site: cq \ No newline at end of file diff --git a/sgzb-gateway/src/main/resources/bootstrap-sgzb_dev_gz.yml b/sgzb-gateway/src/main/resources/bootstrap-sgzb_dev_nw.yml similarity index 93% rename from sgzb-gateway/src/main/resources/bootstrap-sgzb_dev_gz.yml rename to sgzb-gateway/src/main/resources/bootstrap-sgzb_dev_nw.yml index 5270a08..1e66cfe 100644 --- a/sgzb-gateway/src/main/resources/bootstrap-sgzb_dev_gz.yml +++ b/sgzb-gateway/src/main/resources/bootstrap-sgzb_dev_nw.yml @@ -44,4 +44,8 @@ spring: management: endpoint: env: - enabled: false \ No newline at end of file + enabled: false + +# 适应多公司的个性化配置 +sgzb: + site: nw \ No newline at end of file diff --git a/sgzb-gateway/src/main/resources/bootstrap-sgzb_local_cq.yml b/sgzb-gateway/src/main/resources/bootstrap-sgzb_local_cq.yml index aaecddf..c642b47 100644 --- a/sgzb-gateway/src/main/resources/bootstrap-sgzb_local_cq.yml +++ b/sgzb-gateway/src/main/resources/bootstrap-sgzb_local_cq.yml @@ -48,3 +48,7 @@ spring: jasypt: encryptor: password: Encrypt + +# 适应多公司的个性化配置 +sgzb: + site: cq \ No newline at end of file diff --git a/sgzb-gateway/src/main/resources/bootstrap-sgzb_local_gz.yml b/sgzb-gateway/src/main/resources/bootstrap-sgzb_local_nw.yml similarity index 93% rename from sgzb-gateway/src/main/resources/bootstrap-sgzb_local_gz.yml rename to sgzb-gateway/src/main/resources/bootstrap-sgzb_local_nw.yml index 547a22e..4bbca1f 100644 --- a/sgzb-gateway/src/main/resources/bootstrap-sgzb_local_gz.yml +++ b/sgzb-gateway/src/main/resources/bootstrap-sgzb_local_nw.yml @@ -43,4 +43,8 @@ spring: management: endpoint: env: - enabled: false \ No newline at end of file + enabled: false + +# 适应多公司的个性化配置 +sgzb: + site: nw \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_dev_cq.yml b/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_dev_cq.yml index 02e5aa4..6573353 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_dev_cq.yml +++ b/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_dev_cq.yml @@ -22,3 +22,7 @@ spring: # 共享配置 shared-configs: - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + +# 适应多公司的个性化配置 +sgzb: + site: cq \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_dev_gz.yml b/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_dev_nw.yml similarity index 90% rename from sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_dev_gz.yml rename to sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_dev_nw.yml index 31bade0..ad464f1 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_dev_gz.yml +++ b/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_dev_nw.yml @@ -27,4 +27,8 @@ spring: management: endpoint: env: - enabled: false \ No newline at end of file + enabled: false + +# 适应多公司的个性化配置 +sgzb: + site: nw \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_local_cq.yml b/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_local_cq.yml index bc922c8..2bbe8c1 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_local_cq.yml +++ b/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_local_cq.yml @@ -22,3 +22,7 @@ spring: # 共享配置 shared-configs: - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + +# 适应多公司的个性化配置 +sgzb: + site: cq \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_local_gz.yml b/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_local_nw.yml similarity index 90% rename from sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_local_gz.yml rename to sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_local_nw.yml index edfe166..cf84598 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_local_gz.yml +++ b/sgzb-modules/sgzb-material/src/main/resources/bootstrap-sgzb_local_nw.yml @@ -27,4 +27,8 @@ spring: management: endpoint: env: - enabled: false \ No newline at end of file + enabled: false + +# 适应多公司的个性化配置 +sgzb: + site: nw \ No newline at end of file diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysDeptServiceImpl.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysDeptServiceImpl.java index fa1de63..6c40b6a 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysDeptServiceImpl.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysDeptServiceImpl.java @@ -17,7 +17,6 @@ import com.bonus.sgzb.system.mapper.SysDeptMapper; import com.bonus.sgzb.system.mapper.SysRoleMapper; import com.bonus.sgzb.system.mapper.SysUserMapper; import com.bonus.sgzb.system.service.ISysDeptService; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -36,8 +35,8 @@ import java.util.stream.Collectors; @Service public class SysDeptServiceImpl implements ISysDeptService { - @Value("${sgzb.customer}") - private String customer; + @Value("${sgzb.site}") + private String site; @Resource private SysDeptMapper deptMapper; @@ -57,7 +56,7 @@ public class SysDeptServiceImpl implements ISysDeptService { @Override @DataScope(deptAlias = "d") public List selectDeptList(SysDept dept) { - if (Constants.CUSTOMER_GZ.equals(customer)) { + if (Constants.SITE_NW.equals(site)) { LoginUser loginUser = SecurityUtils.getLoginUser(); SysUser sysUser = loginUser.getSysUser(); dept.setCompanyId(Objects.nonNull(sysUser) ? sysUser.getCompanyId() : null); diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java index c30843e..3c19654 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java @@ -46,8 +46,8 @@ import static com.bonus.sgzb.common.core.web.domain.AjaxResult.success; @Slf4j public class SysSmsServiceImpl implements ISysSmsService { - @Value("${sgzb.customer}") - private String customer; + @Value("${sgzb.site}") + private String site; @Resource private RedisService redisService; @@ -75,7 +75,7 @@ public class SysSmsServiceImpl implements ISysSmsService { if (phone.length() != UserConstants.PHONE_DEFAULT_LENGTH_LOGIN) { return AjaxResult.error("手机号格式不正确"); } - if (Constants.CUSTOMER_GZ.equals(customer)) { + if (Constants.SITE_NW.equals(site)) { try { String[] args = msg.split(","); String body = sendMessageNew(phone,tencentSmsConfig.getTemplateId().get(0),args); diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysUserServiceImpl.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysUserServiceImpl.java index 9722e97..056c65f 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysUserServiceImpl.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysUserServiceImpl.java @@ -11,7 +11,6 @@ import com.bonus.sgzb.common.core.utils.bean.BeanValidators; import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.common.datascope.annotation.DataScope; import com.bonus.sgzb.common.security.utils.SecurityUtils; -import com.bonus.sgzb.system.api.domain.SysDept; import com.bonus.sgzb.system.api.domain.SysRole; import com.bonus.sgzb.system.api.domain.SysUser; import com.bonus.sgzb.system.api.model.LoginUser; @@ -25,7 +24,6 @@ import com.bonus.sgzb.system.service.ISysConfigService; import com.bonus.sgzb.system.service.ISysUserService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -34,7 +32,6 @@ import org.springframework.util.CollectionUtils; import javax.annotation.Resource; import javax.validation.Validator; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; @@ -50,8 +47,8 @@ import static com.bonus.sgzb.common.core.web.domain.AjaxResult.success; public class SysUserServiceImpl implements ISysUserService { private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class); - @Value("${sgzb.customer}") - private String customer; + @Value("${sgzb.site}") + private String site; @Resource private SysUserMapper userMapper; @@ -86,7 +83,7 @@ public class SysUserServiceImpl implements ISysUserService { @Override @DataScope(deptAlias = "d", userAlias = "u") public List selectUserList(SysUser user) { - if (Constants.CUSTOMER_GZ.equals(customer)) { + if (Constants.SITE_NW.equals(site)) { LoginUser loginUser = SecurityUtils.getLoginUser(); SysUser sysUser = loginUser.getSysUser(); user.setCompanyId(Objects.nonNull(sysUser) ? sysUser.getCompanyId() : null); diff --git a/sgzb-modules/sgzb-system/src/main/resources/bootstrap-sgzb_dev_cq.yml b/sgzb-modules/sgzb-system/src/main/resources/bootstrap-sgzb_dev_cq.yml index 4d903e6..8e985e2 100644 --- a/sgzb-modules/sgzb-system/src/main/resources/bootstrap-sgzb_dev_cq.yml +++ b/sgzb-modules/sgzb-system/src/main/resources/bootstrap-sgzb_dev_cq.yml @@ -44,7 +44,9 @@ tencent: #云平台模板id 2116937-验收通知 2115503-登录验证 templateId: 2116937,2115503 - +# 适应多公司的个性化配置 +sgzb: + site: cq diff --git a/sgzb-modules/sgzb-system/src/main/resources/bootstrap-sgzb_dev_gz.yml b/sgzb-modules/sgzb-system/src/main/resources/bootstrap-sgzb_dev_nw.yml similarity index 96% rename from sgzb-modules/sgzb-system/src/main/resources/bootstrap-sgzb_dev_gz.yml rename to sgzb-modules/sgzb-system/src/main/resources/bootstrap-sgzb_dev_nw.yml index 8899f1f..00a2195 100644 --- a/sgzb-modules/sgzb-system/src/main/resources/bootstrap-sgzb_dev_gz.yml +++ b/sgzb-modules/sgzb-system/src/main/resources/bootstrap-sgzb_dev_nw.yml @@ -64,7 +64,9 @@ management: env: enabled: false - +# 适应多公司的个性化配置 +sgzb: + site: nw diff --git a/sgzb-modules/sgzb-system/src/main/resources/bootstrap-sgzb_local_cq.yml b/sgzb-modules/sgzb-system/src/main/resources/bootstrap-sgzb_local_cq.yml index 634335f..f26fd73 100644 --- a/sgzb-modules/sgzb-system/src/main/resources/bootstrap-sgzb_local_cq.yml +++ b/sgzb-modules/sgzb-system/src/main/resources/bootstrap-sgzb_local_cq.yml @@ -44,7 +44,9 @@ tencent: #云平台模板id 2116937-验收通知 2115503-登录验证 templateId: 2116937,2115503 - +# 适应多公司的个性化配置 +sgzb: + site: cq diff --git a/sgzb-modules/sgzb-system/src/main/resources/bootstrap-sgzb_local_gz.yml b/sgzb-modules/sgzb-system/src/main/resources/bootstrap-sgzb_local_nw.yml similarity index 96% rename from sgzb-modules/sgzb-system/src/main/resources/bootstrap-sgzb_local_gz.yml rename to sgzb-modules/sgzb-system/src/main/resources/bootstrap-sgzb_local_nw.yml index 7d13626..e516dac 100644 --- a/sgzb-modules/sgzb-system/src/main/resources/bootstrap-sgzb_local_gz.yml +++ b/sgzb-modules/sgzb-system/src/main/resources/bootstrap-sgzb_local_nw.yml @@ -64,7 +64,9 @@ management: env: enabled: false - +# 适应多公司的个性化配置 +sgzb: + site: nw