for nw
This commit is contained in:
parent
e667e58ebf
commit
3e4955f0b9
|
|
@ -39,8 +39,8 @@ import java.util.Map;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class TokenController {
|
public class TokenController {
|
||||||
|
|
||||||
@Value("${sgzb.customer}")
|
@Value("${sgzb.site}")
|
||||||
private String customer;
|
private String site;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private TokenService tokenService;
|
private TokenService tokenService;
|
||||||
|
|
@ -63,7 +63,7 @@ public class TokenController {
|
||||||
//web端登录
|
//web端登录
|
||||||
@PostMapping("login")
|
@PostMapping("login")
|
||||||
public R<?> login(@RequestBody LoginBody form) throws Exception {
|
public R<?> login(@RequestBody LoginBody form) throws Exception {
|
||||||
if (Constants.CUSTOMER_GZ.equals(customer)) {
|
if (Constants.SITE_NW.equals(site)) {
|
||||||
//优先校验图形验证码
|
//优先校验图形验证码
|
||||||
String uuid = form.getUuid();
|
String uuid = form.getUuid();
|
||||||
Object cacheObject = redisService.getCacheObject(CacheConstants.CAPTCHA_CODE_KEY + uuid);
|
Object cacheObject = redisService.getCacheObject(CacheConstants.CAPTCHA_CODE_KEY + uuid);
|
||||||
|
|
@ -156,7 +156,7 @@ public class TokenController {
|
||||||
|
|
||||||
@PostMapping("sendCode")
|
@PostMapping("sendCode")
|
||||||
public R<?> sendCode(@RequestBody LoginBody form) {
|
public R<?> sendCode(@RequestBody LoginBody form) {
|
||||||
if (Constants.CUSTOMER_GZ.equals(customer)) {
|
if (Constants.SITE_NW.equals(site)) {
|
||||||
if ("adminBns".equals(form.getUsername())) {
|
if ("adminBns".equals(form.getUsername())) {
|
||||||
// 根据用户名查询用户信息
|
// 根据用户名查询用户信息
|
||||||
LoginUser userInfo = sysLoginService.selectByName(form.getUsername());
|
LoginUser userInfo = sysLoginService.selectByName(form.getUsername());
|
||||||
|
|
|
||||||
|
|
@ -33,3 +33,6 @@ registerPhone: /lbcloud-user/api/user/registrationByPhone
|
||||||
userBindUrl: /lbcloud-authority/api/RoleClient/bindDefaultSystemRole
|
userBindUrl: /lbcloud-authority/api/RoleClient/bindDefaultSystemRole
|
||||||
verifyPhoneCode: /lbcloud-mbroker/api/broker/simpleVerificationCode
|
verifyPhoneCode: /lbcloud-mbroker/api/broker/simpleVerificationCode
|
||||||
|
|
||||||
|
# 适应多公司的个性化配置
|
||||||
|
sgzb:
|
||||||
|
site: cq
|
||||||
|
|
@ -39,3 +39,6 @@ management:
|
||||||
env:
|
env:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
|
# 适应多公司的个性化配置
|
||||||
|
sgzb:
|
||||||
|
site: nw
|
||||||
|
|
@ -33,4 +33,6 @@ registerPhone: /lbcloud-user/api/user/registrationByPhone
|
||||||
userBindUrl: /lbcloud-authority/api/RoleClient/bindDefaultSystemRole
|
userBindUrl: /lbcloud-authority/api/RoleClient/bindDefaultSystemRole
|
||||||
verifyPhoneCode: /lbcloud-mbroker/api/broker/simpleVerificationCode
|
verifyPhoneCode: /lbcloud-mbroker/api/broker/simpleVerificationCode
|
||||||
|
|
||||||
|
# 适应多公司的个性化配置
|
||||||
|
sgzb:
|
||||||
|
site: cq
|
||||||
|
|
|
||||||
|
|
@ -39,3 +39,6 @@ management:
|
||||||
env:
|
env:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
|
# 适应多公司的个性化配置
|
||||||
|
sgzb:
|
||||||
|
site: nw
|
||||||
|
|
@ -8,14 +8,14 @@ package com.bonus.sgzb.common.core.constant;
|
||||||
public class Constants
|
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 字符集
|
* UTF-8 字符集
|
||||||
|
|
|
||||||
|
|
@ -48,3 +48,7 @@ spring:
|
||||||
jasypt:
|
jasypt:
|
||||||
encryptor:
|
encryptor:
|
||||||
password: Encrypt
|
password: Encrypt
|
||||||
|
|
||||||
|
# 适应多公司的个性化配置
|
||||||
|
sgzb:
|
||||||
|
site: cq
|
||||||
|
|
@ -44,4 +44,8 @@ spring:
|
||||||
management:
|
management:
|
||||||
endpoint:
|
endpoint:
|
||||||
env:
|
env:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
|
# 适应多公司的个性化配置
|
||||||
|
sgzb:
|
||||||
|
site: nw
|
||||||
|
|
@ -48,3 +48,7 @@ spring:
|
||||||
jasypt:
|
jasypt:
|
||||||
encryptor:
|
encryptor:
|
||||||
password: Encrypt
|
password: Encrypt
|
||||||
|
|
||||||
|
# 适应多公司的个性化配置
|
||||||
|
sgzb:
|
||||||
|
site: cq
|
||||||
|
|
@ -43,4 +43,8 @@ spring:
|
||||||
management:
|
management:
|
||||||
endpoint:
|
endpoint:
|
||||||
env:
|
env:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
|
# 适应多公司的个性化配置
|
||||||
|
sgzb:
|
||||||
|
site: nw
|
||||||
|
|
@ -22,3 +22,7 @@ spring:
|
||||||
# 共享配置
|
# 共享配置
|
||||||
shared-configs:
|
shared-configs:
|
||||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
|
||||||
|
# 适应多公司的个性化配置
|
||||||
|
sgzb:
|
||||||
|
site: cq
|
||||||
|
|
@ -27,4 +27,8 @@ spring:
|
||||||
management:
|
management:
|
||||||
endpoint:
|
endpoint:
|
||||||
env:
|
env:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
|
# 适应多公司的个性化配置
|
||||||
|
sgzb:
|
||||||
|
site: nw
|
||||||
|
|
@ -22,3 +22,7 @@ spring:
|
||||||
# 共享配置
|
# 共享配置
|
||||||
shared-configs:
|
shared-configs:
|
||||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
|
||||||
|
# 适应多公司的个性化配置
|
||||||
|
sgzb:
|
||||||
|
site: cq
|
||||||
|
|
@ -27,4 +27,8 @@ spring:
|
||||||
management:
|
management:
|
||||||
endpoint:
|
endpoint:
|
||||||
env:
|
env:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
|
# 适应多公司的个性化配置
|
||||||
|
sgzb:
|
||||||
|
site: nw
|
||||||
|
|
@ -17,7 +17,6 @@ import com.bonus.sgzb.system.mapper.SysDeptMapper;
|
||||||
import com.bonus.sgzb.system.mapper.SysRoleMapper;
|
import com.bonus.sgzb.system.mapper.SysRoleMapper;
|
||||||
import com.bonus.sgzb.system.mapper.SysUserMapper;
|
import com.bonus.sgzb.system.mapper.SysUserMapper;
|
||||||
import com.bonus.sgzb.system.service.ISysDeptService;
|
import com.bonus.sgzb.system.service.ISysDeptService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
@ -36,8 +35,8 @@ import java.util.stream.Collectors;
|
||||||
@Service
|
@Service
|
||||||
public class SysDeptServiceImpl implements ISysDeptService {
|
public class SysDeptServiceImpl implements ISysDeptService {
|
||||||
|
|
||||||
@Value("${sgzb.customer}")
|
@Value("${sgzb.site}")
|
||||||
private String customer;
|
private String site;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private SysDeptMapper deptMapper;
|
private SysDeptMapper deptMapper;
|
||||||
|
|
@ -57,7 +56,7 @@ public class SysDeptServiceImpl implements ISysDeptService {
|
||||||
@Override
|
@Override
|
||||||
@DataScope(deptAlias = "d")
|
@DataScope(deptAlias = "d")
|
||||||
public List<SysDept> selectDeptList(SysDept dept) {
|
public List<SysDept> selectDeptList(SysDept dept) {
|
||||||
if (Constants.CUSTOMER_GZ.equals(customer)) {
|
if (Constants.SITE_NW.equals(site)) {
|
||||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
SysUser sysUser = loginUser.getSysUser();
|
SysUser sysUser = loginUser.getSysUser();
|
||||||
dept.setCompanyId(Objects.nonNull(sysUser) ? sysUser.getCompanyId() : null);
|
dept.setCompanyId(Objects.nonNull(sysUser) ? sysUser.getCompanyId() : null);
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,8 @@ import static com.bonus.sgzb.common.core.web.domain.AjaxResult.success;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class SysSmsServiceImpl implements ISysSmsService {
|
public class SysSmsServiceImpl implements ISysSmsService {
|
||||||
|
|
||||||
@Value("${sgzb.customer}")
|
@Value("${sgzb.site}")
|
||||||
private String customer;
|
private String site;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private RedisService redisService;
|
private RedisService redisService;
|
||||||
|
|
@ -75,7 +75,7 @@ public class SysSmsServiceImpl implements ISysSmsService {
|
||||||
if (phone.length() != UserConstants.PHONE_DEFAULT_LENGTH_LOGIN) {
|
if (phone.length() != UserConstants.PHONE_DEFAULT_LENGTH_LOGIN) {
|
||||||
return AjaxResult.error("手机号格式不正确");
|
return AjaxResult.error("手机号格式不正确");
|
||||||
}
|
}
|
||||||
if (Constants.CUSTOMER_GZ.equals(customer)) {
|
if (Constants.SITE_NW.equals(site)) {
|
||||||
try {
|
try {
|
||||||
String[] args = msg.split(",");
|
String[] args = msg.split(",");
|
||||||
String body = sendMessageNew(phone,tencentSmsConfig.getTemplateId().get(0),args);
|
String body = sendMessageNew(phone,tencentSmsConfig.getTemplateId().get(0),args);
|
||||||
|
|
|
||||||
|
|
@ -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.core.web.domain.AjaxResult;
|
||||||
import com.bonus.sgzb.common.datascope.annotation.DataScope;
|
import com.bonus.sgzb.common.datascope.annotation.DataScope;
|
||||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
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.SysRole;
|
||||||
import com.bonus.sgzb.system.api.domain.SysUser;
|
import com.bonus.sgzb.system.api.domain.SysUser;
|
||||||
import com.bonus.sgzb.system.api.model.LoginUser;
|
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 com.bonus.sgzb.system.service.ISysUserService;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
@ -34,7 +32,6 @@ import org.springframework.util.CollectionUtils;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.validation.Validator;
|
import javax.validation.Validator;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
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 {
|
public class SysUserServiceImpl implements ISysUserService {
|
||||||
private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class);
|
private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class);
|
||||||
|
|
||||||
@Value("${sgzb.customer}")
|
@Value("${sgzb.site}")
|
||||||
private String customer;
|
private String site;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private SysUserMapper userMapper;
|
private SysUserMapper userMapper;
|
||||||
|
|
@ -86,7 +83,7 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||||
@Override
|
@Override
|
||||||
@DataScope(deptAlias = "d", userAlias = "u")
|
@DataScope(deptAlias = "d", userAlias = "u")
|
||||||
public List<SysUser> selectUserList(SysUser user) {
|
public List<SysUser> selectUserList(SysUser user) {
|
||||||
if (Constants.CUSTOMER_GZ.equals(customer)) {
|
if (Constants.SITE_NW.equals(site)) {
|
||||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
SysUser sysUser = loginUser.getSysUser();
|
SysUser sysUser = loginUser.getSysUser();
|
||||||
user.setCompanyId(Objects.nonNull(sysUser) ? sysUser.getCompanyId() : null);
|
user.setCompanyId(Objects.nonNull(sysUser) ? sysUser.getCompanyId() : null);
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,9 @@ tencent:
|
||||||
#云平台模板id 2116937-验收通知 2115503-登录验证
|
#云平台模板id 2116937-验收通知 2115503-登录验证
|
||||||
templateId: 2116937,2115503
|
templateId: 2116937,2115503
|
||||||
|
|
||||||
|
# 适应多公司的个性化配置
|
||||||
|
sgzb:
|
||||||
|
site: cq
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,9 @@ management:
|
||||||
env:
|
env:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
|
# 适应多公司的个性化配置
|
||||||
|
sgzb:
|
||||||
|
site: nw
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -44,7 +44,9 @@ tencent:
|
||||||
#云平台模板id 2116937-验收通知 2115503-登录验证
|
#云平台模板id 2116937-验收通知 2115503-登录验证
|
||||||
templateId: 2116937,2115503
|
templateId: 2116937,2115503
|
||||||
|
|
||||||
|
# 适应多公司的个性化配置
|
||||||
|
sgzb:
|
||||||
|
site: cq
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,9 @@ management:
|
||||||
env:
|
env:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
|
# 适应多公司的个性化配置
|
||||||
|
sgzb:
|
||||||
|
site: nw
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue