This commit is contained in:
sxu 2024-08-14 08:59:13 +08:00
parent e667e58ebf
commit 3e4955f0b9
21 changed files with 76 additions and 29 deletions

View File

@ -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());

View File

@ -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

View File

@ -39,3 +39,6 @@ management:
env:
enabled: false
# 适应多公司的个性化配置
sgzb:
site: nw

View File

@ -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

View File

@ -39,3 +39,6 @@ management:
env:
enabled: false
# 适应多公司的个性化配置
sgzb:
site: nw

View File

@ -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 字符集

View File

@ -48,3 +48,7 @@ spring:
jasypt:
encryptor:
password: Encrypt
# 适应多公司的个性化配置
sgzb:
site: cq

View File

@ -44,4 +44,8 @@ spring:
management:
endpoint:
env:
enabled: false
enabled: false
# 适应多公司的个性化配置
sgzb:
site: nw

View File

@ -48,3 +48,7 @@ spring:
jasypt:
encryptor:
password: Encrypt
# 适应多公司的个性化配置
sgzb:
site: cq

View File

@ -43,4 +43,8 @@ spring:
management:
endpoint:
env:
enabled: false
enabled: false
# 适应多公司的个性化配置
sgzb:
site: nw

View File

@ -22,3 +22,7 @@ spring:
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
# 适应多公司的个性化配置
sgzb:
site: cq

View File

@ -27,4 +27,8 @@ spring:
management:
endpoint:
env:
enabled: false
enabled: false
# 适应多公司的个性化配置
sgzb:
site: nw

View File

@ -22,3 +22,7 @@ spring:
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
# 适应多公司的个性化配置
sgzb:
site: cq

View File

@ -27,4 +27,8 @@ spring:
management:
endpoint:
env:
enabled: false
enabled: false
# 适应多公司的个性化配置
sgzb:
site: nw

View File

@ -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<SysDept> 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);

View File

@ -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);

View File

@ -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<SysUser> 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);

View File

@ -44,7 +44,9 @@ tencent:
#云平台模板id 2116937-验收通知 2115503-登录验证
templateId: 2116937,2115503
# 适应多公司的个性化配置
sgzb:
site: cq

View File

@ -64,7 +64,9 @@ management:
env:
enabled: false
# 适应多公司的个性化配置
sgzb:
site: nw

View File

@ -44,7 +44,9 @@ tencent:
#云平台模板id 2116937-验收通知 2115503-登录验证
templateId: 2116937,2115503
# 适应多公司的个性化配置
sgzb:
site: cq

View File

@ -64,7 +64,9 @@ management:
env:
enabled: false
# 适应多公司的个性化配置
sgzb:
site: nw