安徽租赁平台仓库初始化
This commit is contained in:
parent
ae50d4fede
commit
60bdaa584f
|
|
@ -141,7 +141,7 @@ public class TokenController {
|
|||
form.setPassword(form.getVerificationCode());
|
||||
}
|
||||
|
||||
/**对系统并发数进行判断*/
|
||||
/*对系统并发数进行判断*/
|
||||
long concurrency = 100;
|
||||
AjaxResult result = configService.getConfigKey("sys.backend.concurrency");
|
||||
if (result.isSuccess())
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public class AesCbcUtils {
|
|||
/**
|
||||
* AES要求密钥长度为128位或192位或256位,java默认限制AES密钥长度最多128位
|
||||
*/
|
||||
public static String sKey = "zhgd@bonus@zhgd@bonus@1234567890";
|
||||
public static String sKey = "Zhgd@Bonu$123456";
|
||||
|
||||
/**
|
||||
* 编码格式导出
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#Wed Nov 06 11:32:35 CST 2024
|
||||
#Tue Aug 26 18:30:22 CST 2025
|
||||
anotherKey=anotherValue
|
||||
key=value
|
||||
anotherKey1=anotherValue1
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ public class TokenService {
|
|||
private Long getTokenTime(){
|
||||
long tokenTime = 20L;
|
||||
String redisResult = redisService.getCacheObject("sys_config:"+ "sys.visit.tokentime");
|
||||
if(!redisResult.isEmpty()) {
|
||||
if(null != redisResult && !redisResult.isEmpty()) {
|
||||
tokenTime = Long.parseLong(redisResult);
|
||||
}else {
|
||||
Long result = systemConfig.getTokenTime();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,52 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 18080
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 14.103.246.124:8848
|
||||
namespace: material_mall
|
||||
# namespace: material_mall_shanxi
|
||||
username: nacos
|
||||
password: nacos123
|
||||
ip: 192.168.0.69
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 14.103.246.124:8848
|
||||
namespace: material_mall
|
||||
# namespace: material_mall_shanxi
|
||||
username: nacos
|
||||
password: nacos123
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
sentinel:
|
||||
# 取消控制台懒加载
|
||||
eager: true
|
||||
transport:
|
||||
# 控制台地址
|
||||
dashboard: 127.0.0.1:18858
|
||||
# nacos配置持久化
|
||||
datasource:
|
||||
ds1:
|
||||
nacos:
|
||||
server-addr: 192.168.1.2:8848
|
||||
namespace: material_mall
|
||||
username: nacos
|
||||
password: nacos123
|
||||
dataId: sentinel-bonus-gateway
|
||||
groupId: DEFAULT_GROUP
|
||||
data-type: json
|
||||
rule-type: gw-flow
|
||||
|
||||
#加密组件
|
||||
jasypt:
|
||||
encryptor:
|
||||
password: Encrypt
|
||||
|
||||
|
|
@ -21,22 +21,22 @@ public class MinioConfig
|
|||
/**
|
||||
* 服务地址
|
||||
*/
|
||||
private String endpoint;
|
||||
private String endpoint = "http://127.0.0.1:9000";
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String accessKey;
|
||||
private String accessKey = "minioadmin";
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String secretKey;
|
||||
private String secretKey = "minioadmin";
|
||||
|
||||
/**
|
||||
* 存储桶名称
|
||||
*/
|
||||
private String bucketName;
|
||||
private String bucketName = "bonus-file";
|
||||
|
||||
@Bean
|
||||
public MinioClient getMinioClient()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 29300
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 14.103.246.124:8848
|
||||
namespace: material_mall
|
||||
# namespace: material_mall_shanxi
|
||||
ip: 192.168.0.69
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 14.103.246.124:8848
|
||||
namespace: material_mall
|
||||
# namespace: material_mall_shanxi
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
|
||||
file:
|
||||
path: /home/bonus/file
|
||||
prefix: /
|
||||
domain: /
|
||||
|
|
@ -164,8 +164,8 @@ public class SysDeptController extends BaseController
|
|||
@GetMapping(value = "/company_info")
|
||||
public AjaxResult getCompanyInfo() {
|
||||
try{
|
||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
||||
return success(deptService.selectDeptById(companyId));
|
||||
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||
return success(deptService.selectDeptById(deptId));
|
||||
} catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ public class SysMenuController extends BaseController
|
|||
try{
|
||||
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
SysDept sysDept = deptService.selectDeptById(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||
SysDept sysDept = deptService.selectDeptById(SecurityUtils.getLoginUser().getSysUser().getDeptId());
|
||||
UserMenuParams userMenuParams = new UserMenuParams(userId, systemType, sysDept.getMenuTemplateId());
|
||||
List<SysMenu> menus = menuService.selectMenuTreeByUserIdAndSystemType(userMenuParams);
|
||||
return success(menuService.buildMenus(menus));
|
||||
|
|
|
|||
|
|
@ -165,8 +165,9 @@ public class SysUserController extends BaseController {
|
|||
if (StringUtils.isNull(sysUser)) {
|
||||
return R.fail("用户名或密码错误");
|
||||
}
|
||||
SysDept sysDept = deptService.selectActiveDeptById(sysUser.getCompanyId());
|
||||
SysDept sysDept = deptService.selectActiveDeptById(sysUser.getDeptId());
|
||||
if (StringUtils.isNull(sysDept)) {
|
||||
logger.error("用户信息:"+ sysUser + ",部门信息:" + sysDept);
|
||||
return R.fail("用户所在公司停用或注销");
|
||||
}
|
||||
// 角色集合
|
||||
|
|
@ -191,7 +192,7 @@ public class SysUserController extends BaseController {
|
|||
if (StringUtils.isNull(sysUser)) {
|
||||
return R.fail("用户名或密码错误");
|
||||
}
|
||||
SysDept sysDept = deptService.selectActiveDeptById(sysUser.getCompanyId());
|
||||
SysDept sysDept = deptService.selectActiveDeptById(sysUser.getDeptId());
|
||||
if (StringUtils.isNull(sysDept)) {
|
||||
return R.fail("用户所在公司停用或注销");
|
||||
}
|
||||
|
|
@ -216,7 +217,7 @@ public class SysUserController extends BaseController {
|
|||
if (StringUtils.isNull(sysUser)) {
|
||||
return R.fail("用户名或密码错误");
|
||||
}
|
||||
SysDept sysDept = deptService.selectActiveDeptById(sysUser.getCompanyId());
|
||||
SysDept sysDept = deptService.selectActiveDeptById(sysUser.getDeptId());
|
||||
if (StringUtils.isNull(sysDept)) {
|
||||
return R.fail("用户所在公司停用或注销");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -170,14 +170,11 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
@Override
|
||||
public List<SysMenu> selectMenuTreeByUserId(Long userId)
|
||||
{
|
||||
List<SysMenu> menus = null;
|
||||
if (SecurityUtils.isAdmin(userId))
|
||||
{
|
||||
List<SysMenu> menus;
|
||||
if (SecurityUtils.isAdmin(userId)) {
|
||||
menus = menuMapper.selectMenuTreeAll();
|
||||
}
|
||||
else
|
||||
{
|
||||
SysDept sysDept = deptMapper.selectDeptById(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||
} else {
|
||||
SysDept sysDept = deptMapper.selectDeptById(SecurityUtils.getLoginUser().getSysUser().getDeptId());
|
||||
menus = menuMapper.selectMenuTreeByUserId(userId, sysDept.getMenuTemplateId());
|
||||
}
|
||||
return getChildPerms(menus, 0);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 18082
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
# server-addr: 43.134.4.238:8848
|
||||
# namespace: sgzb_bns
|
||||
server-addr: 14.103.246.124:8848
|
||||
namespace: sgzb_bns
|
||||
config:
|
||||
# 配置中心地址
|
||||
# server-addr: 43.134.4.238:8848
|
||||
# namespace: sgzb_bns
|
||||
server-addr: 14.103.246.124:8848
|
||||
namespace: sgzb_bns
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
|
||||
#加密组件
|
||||
jasypt:
|
||||
encryptor:
|
||||
password: Encrypt
|
||||
|
|
@ -7,12 +7,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<resultMap type="com.bonus.system.api.domain.SysDept" id="SysDeptResult">
|
||||
<id property="deptId" column="dept_id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="ancestors" column="ancestors" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="orderNum" column="order_num" />
|
||||
<result property="leader" column="leader" />
|
||||
<result property="phone" column="phone" />
|
||||
<result property="email" column="email" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="parentName" column="parent_name" />
|
||||
|
|
@ -35,12 +33,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<sql id="selectDeptVo">
|
||||
select d.dept_id,
|
||||
d.parent_id,
|
||||
d.ancestors,
|
||||
d.dept_name,
|
||||
d.order_num,
|
||||
d.leader,
|
||||
d.phone,
|
||||
d.email,
|
||||
d.status,
|
||||
d.del_flag,
|
||||
d.create_by,
|
||||
|
|
@ -51,12 +47,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<sql id="selectDeptVoWithMoreInfo">
|
||||
select d.dept_id,
|
||||
d.parent_id,
|
||||
d.ancestors,
|
||||
d.dept_name,
|
||||
d.order_num,
|
||||
d.leader,
|
||||
d.phone,
|
||||
d.email,
|
||||
d.status,
|
||||
d.del_flag,
|
||||
d.create_by,
|
||||
|
|
@ -112,9 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
SELECT
|
||||
d.dept_id AS deptId,
|
||||
d.parent_id AS parentId,
|
||||
d.dept_name AS deptName,
|
||||
LENGTH( d.ancestors ) - LENGTH(
|
||||
REPLACE ( d.ancestors, ',', '' )) AS LEVEL
|
||||
d.dept_name AS deptName
|
||||
FROM
|
||||
sys_dept d
|
||||
WHERE
|
||||
|
|
@ -290,12 +282,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="getCompanyUserCount" resultType="com.bonus.system.api.domain.SysDept">
|
||||
SELECT
|
||||
CASE sd.ancestors
|
||||
WHEN ('0') THEN
|
||||
sd.dept_id
|
||||
ELSE
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(sd.ancestors, ',', 2), ',', -1)
|
||||
END as company_id,
|
||||
sd.dept_id,
|
||||
count(su.user_id) as user_count
|
||||
FROM `sys_user` su
|
||||
left join sys_dept sd on su.dept_id=sd.dept_id
|
||||
|
|
|
|||
|
|
@ -55,12 +55,7 @@
|
|||
<sql id="selectUserVo">
|
||||
select u.user_id,
|
||||
u.dept_id,
|
||||
CASE d.ancestors
|
||||
WHEN ('0') THEN
|
||||
d.dept_id
|
||||
ELSE
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(d.ancestors, ',', 2), ',', -1)
|
||||
END as company_id,
|
||||
u.dept_id as companyId,
|
||||
u.user_name,
|
||||
u.nick_name,
|
||||
u.email,
|
||||
|
|
@ -79,7 +74,6 @@
|
|||
u.is_permanent,
|
||||
d.dept_id,
|
||||
d.parent_id,
|
||||
d.ancestors,
|
||||
d.dept_name,
|
||||
d.order_num,
|
||||
d.leader,
|
||||
|
|
|
|||
Loading…
Reference in New Issue