From cb59082bad17508f7e9355d8b9605022dde8e399 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Mon, 31 Jul 2023 09:54:48 +0800 Subject: [PATCH 01/29] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=20clientid=20=E9=80=9A=E8=BF=87=20param=20=E4=BC=A0?= =?UTF-8?q?=E8=BE=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/dromara/common/security/config/SecurityConfig.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ruoyi-common/ruoyi-common-security/src/main/java/org/dromara/common/security/config/SecurityConfig.java b/ruoyi-common/ruoyi-common-security/src/main/java/org/dromara/common/security/config/SecurityConfig.java index 7ac920f2f..063d9131e 100644 --- a/ruoyi-common/ruoyi-common-security/src/main/java/org/dromara/common/security/config/SecurityConfig.java +++ b/ruoyi-common/ruoyi-common-security/src/main/java/org/dromara/common/security/config/SecurityConfig.java @@ -48,10 +48,11 @@ public class SecurityConfig implements WebMvcConfigurer { // 检查是否登录 是否有token StpUtil.checkLogin(); - // 检查 header 里的 clientId 与 token 里的是否一致 + // 检查 header 与 param 里的 clientid 与 token 里的是否一致 String headerCid = ServletUtils.getRequest().getHeader(LoginHelper.CLIENT_KEY); + String paramCid = ServletUtils.getParameter(LoginHelper.CLIENT_KEY); String clientId = StpUtil.getExtra(LoginHelper.CLIENT_KEY).toString(); - if (!StringUtils.equals(headerCid, clientId)) { + if (!StringUtils.equalsAny(clientId, headerCid, paramCid)) { // token 无效 throw NotLoginException.newInstance( StpUtil.getLoginType(), From 348938eb96dc60ed40c8fc7ae64500f1c5cfdee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Mon, 31 Jul 2023 17:41:35 +0800 Subject: [PATCH 02/29] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E7=BB=91=E5=AE=9A=20=E5=AE=9E=E4=BD=93=E7=B1=BBcopy?= =?UTF-8?q?=E8=A6=86=E7=9B=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/dromara/web/service/SysLoginService.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ruoyi-admin/src/main/java/org/dromara/web/service/SysLoginService.java b/ruoyi-admin/src/main/java/org/dromara/web/service/SysLoginService.java index b91452cd7..c2392d383 100644 --- a/ruoyi-admin/src/main/java/org/dromara/web/service/SysLoginService.java +++ b/ruoyi-admin/src/main/java/org/dromara/web/service/SysLoginService.java @@ -4,7 +4,6 @@ import cn.dev33.satoken.exception.NotLoginException; import cn.dev33.satoken.stp.StpUtil; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import me.zhyd.oauth.model.AuthUser; @@ -15,7 +14,6 @@ import org.dromara.common.core.domain.dto.RoleDTO; import org.dromara.common.core.domain.model.LoginUser; import org.dromara.common.core.enums.LoginType; import org.dromara.common.core.enums.TenantStatus; -import org.dromara.common.core.enums.UserStatus; import org.dromara.common.core.exception.user.UserException; import org.dromara.common.core.utils.DateUtils; import org.dromara.common.core.utils.MessageUtils; @@ -34,7 +32,6 @@ import org.dromara.system.mapper.SysUserMapper; import org.dromara.system.service.ISysPermissionService; import org.dromara.system.service.ISysSocialService; import org.dromara.system.service.ISysTenantService; -import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -72,13 +69,13 @@ public class SysLoginService { * @return 统一响应实体 */ public void socialRegister(AuthUser authUserData) { - SysSocialBo bo = new SysSocialBo(); + SysSocialBo bo = BeanUtil.toBean(authUserData, SysSocialBo.class); + BeanUtil.copyProperties(authUserData.getToken(), bo); bo.setUserId(LoginHelper.getUserId()); bo.setAuthId(authUserData.getSource() + authUserData.getUuid()); bo.setOpenId(authUserData.getUuid()); bo.setUserName(authUserData.getUsername()); - BeanUtils.copyProperties(authUserData, bo); - BeanUtils.copyProperties(authUserData.getToken(), bo); + bo.setNickName(authUserData.getNickname()); sysSocialService.insertByBo(bo); } From 352caa3e9386cf95c58fafa75a5c4d4bfa0d9a9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Tue, 1 Aug 2023 13:14:26 +0800 Subject: [PATCH 03/29] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20excel?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=AD=97=E5=85=B8=E8=BD=AC=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=A1=86=20=E6=97=A0=E9=9C=80=E6=A0=87=E8=AE=B0index=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=A4=84=E7=90=86(=E6=84=9F=E8=B0=A2=E4=B8=80?= =?UTF-8?q?=E5=A4=8Fcoco)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/excel/core/ExcelDownHandler.java | 26 +++++++++---------- .../dromara/system/domain/vo/SysClientVo.java | 2 +- .../dromara/system/domain/vo/SysConfigVo.java | 2 +- .../dromara/system/domain/vo/SysDeptVo.java | 2 +- .../system/domain/vo/SysDictDataVo.java | 4 +-- .../system/domain/vo/SysDictTypeVo.java | 2 +- .../system/domain/vo/SysLogininforVo.java | 2 +- .../system/domain/vo/SysOperLogVo.java | 6 ++--- .../dromara/system/domain/vo/SysPostVo.java | 2 +- .../dromara/system/domain/vo/SysRoleVo.java | 4 +-- .../system/domain/vo/SysTenantPackageVo.java | 2 +- .../dromara/system/domain/vo/SysTenantVo.java | 2 +- .../system/domain/vo/SysUserExportVo.java | 4 +-- 13 files changed, 29 insertions(+), 31 deletions(-) diff --git a/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/core/ExcelDownHandler.java b/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/core/ExcelDownHandler.java index db4fecca1..3b791ea54 100644 --- a/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/core/ExcelDownHandler.java +++ b/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/core/ExcelDownHandler.java @@ -5,7 +5,9 @@ import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.EnumUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; -import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.metadata.FieldCache; +import com.alibaba.excel.metadata.FieldWrapper; +import com.alibaba.excel.util.ClassUtils; import com.alibaba.excel.write.handler.SheetWriteHandler; import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder; @@ -83,16 +85,18 @@ public class ExcelDownHandler implements SheetWriteHandler { Sheet sheet = writeSheetHolder.getSheet(); // 开始设置下拉框 HSSFWorkbook DataValidationHelper helper = sheet.getDataValidationHelper(); - Field[] fields = writeWorkbookHolder.getClazz().getDeclaredFields(); Workbook workbook = writeWorkbookHolder.getWorkbook(); - int length = fields.length; - for (int i = 0; i < length; i++) { + FieldCache fieldCache = ClassUtils.declaredFields(writeWorkbookHolder.getClazz(), writeWorkbookHolder); + for (Map.Entry entry : fieldCache.getSortedFieldMap().entrySet()) { + Integer index = entry.getKey(); + FieldWrapper wrapper = entry.getValue(); + Field field = wrapper.getField(); // 循环实体中的每个属性 // 可选的下拉值 List options = new ArrayList<>(); - if (fields[i].isAnnotationPresent(ExcelDictFormat.class)) { + if (field.isAnnotationPresent(ExcelDictFormat.class)) { // 如果指定了@ExcelDictFormat,则使用字典的逻辑 - ExcelDictFormat format = fields[i].getDeclaredAnnotation(ExcelDictFormat.class); + ExcelDictFormat format = field.getDeclaredAnnotation(ExcelDictFormat.class); String dictType = format.dictType(); String converterExp = format.readConverterExp(); if (StrUtil.isNotBlank(dictType)) { @@ -105,20 +109,14 @@ public class ExcelDownHandler implements SheetWriteHandler { // 如果指定了确切的值,则直接解析确切的值 options = StrUtil.split(converterExp, format.separator(), true, true); } - } else if (fields[i].isAnnotationPresent(ExcelEnumFormat.class)) { + } else if (field.isAnnotationPresent(ExcelEnumFormat.class)) { // 否则如果指定了@ExcelEnumFormat,则使用枚举的逻辑 - ExcelEnumFormat format = fields[i].getDeclaredAnnotation(ExcelEnumFormat.class); + ExcelEnumFormat format = field.getDeclaredAnnotation(ExcelEnumFormat.class); List values = EnumUtil.getFieldValues(format.enumClass(), format.textField()); options = StreamUtils.toList(values, String::valueOf); } if (ObjectUtil.isNotEmpty(options)) { // 仅当下拉可选项不为空时执行 - // 获取列下标,默认为当前循环次数 - int index = i; - if (fields[i].isAnnotationPresent(ExcelProperty.class)) { - // 如果指定了列下标,以指定的为主 - index = fields[i].getDeclaredAnnotation(ExcelProperty.class).index(); - } if (options.size() > 20) { // 这里限制如果可选项大于20,则使用额外表形式 dropDownWithSheet(helper, workbook, sheet, index, options); diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysClientVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysClientVo.java index fa23cd1b5..34f24eb36 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysClientVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysClientVo.java @@ -82,7 +82,7 @@ public class SysClientVo implements Serializable { /** * 状态(0正常 1停用) */ - @ExcelProperty(value = "状态", index = 7, converter = ExcelDictConvert.class) + @ExcelProperty(value = "状态", converter = ExcelDictConvert.class) @ExcelDictFormat(readConverterExp = "0=正常,1=停用") private String status; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysConfigVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysConfigVo.java index db7d53a3a..f896000a3 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysConfigVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysConfigVo.java @@ -53,7 +53,7 @@ public class SysConfigVo implements Serializable { /** * 系统内置(Y是 N否) */ - @ExcelProperty(value = "系统内置", index = 4, converter = ExcelDictConvert.class) + @ExcelProperty(value = "系统内置", converter = ExcelDictConvert.class) @ExcelDictFormat(dictType = "sys_yes_no") private String configType; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDeptVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDeptVo.java index 4611ae0fe..e09d67e12 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDeptVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDeptVo.java @@ -78,7 +78,7 @@ public class SysDeptVo implements Serializable { /** * 部门状态(0正常 1停用) */ - @ExcelProperty(value = "部门状态", index = 5, converter = ExcelDictConvert.class) + @ExcelProperty(value = "部门状态", converter = ExcelDictConvert.class) @ExcelDictFormat(dictType = "sys_normal_disable") private String status; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDictDataVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDictDataVo.java index 1372f3161..d058d5e91 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDictDataVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDictDataVo.java @@ -69,14 +69,14 @@ public class SysDictDataVo implements Serializable { /** * 是否默认(Y是 N否) */ - @ExcelProperty(value = "是否默认", index = 5, converter = ExcelDictConvert.class) + @ExcelProperty(value = "是否默认", converter = ExcelDictConvert.class) @ExcelDictFormat(dictType = "sys_yes_no") private String isDefault; /** * 状态(0正常 1停用) */ - @ExcelProperty(value = "状态", index = 6, converter = ExcelDictConvert.class) + @ExcelProperty(value = "状态", converter = ExcelDictConvert.class) @ExcelDictFormat(dictType = "sys_normal_disable") private String status; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDictTypeVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDictTypeVo.java index 771f9563c..2cac4a25f 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDictTypeVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDictTypeVo.java @@ -47,7 +47,7 @@ public class SysDictTypeVo implements Serializable { /** * 状态(0正常 1停用) */ - @ExcelProperty(value = "状态", index = 3, converter = ExcelDictConvert.class) + @ExcelProperty(value = "状态", converter = ExcelDictConvert.class) @ExcelDictFormat(dictType = "sys_normal_disable") private String status; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysLogininforVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysLogininforVo.java index 97bc79b37..cf9720e95 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysLogininforVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysLogininforVo.java @@ -48,7 +48,7 @@ public class SysLogininforVo implements Serializable { /** * 登录状态(0成功 1失败) */ - @ExcelProperty(value = "登录状态", index = 2, converter = ExcelDictConvert.class) + @ExcelProperty(value = "登录状态", converter = ExcelDictConvert.class) @ExcelDictFormat(dictType = "sys_common_status") private String status; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysOperLogVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysOperLogVo.java index 306237e35..d9eb71d40 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysOperLogVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysOperLogVo.java @@ -47,7 +47,7 @@ public class SysOperLogVo implements Serializable { /** * 业务类型(0其它 1新增 2修改 3删除) */ - @ExcelProperty(value = "业务类型", index = 2, converter = ExcelDictConvert.class) + @ExcelProperty(value = "业务类型", converter = ExcelDictConvert.class) @ExcelDictFormat(dictType = "sys_oper_type") private Integer businessType; @@ -71,7 +71,7 @@ public class SysOperLogVo implements Serializable { /** * 操作类别(0其它 1后台用户 2手机端用户) */ - @ExcelProperty(value = "操作类别", index = 5, converter = ExcelDictConvert.class) + @ExcelProperty(value = "操作类别", converter = ExcelDictConvert.class) @ExcelDictFormat(readConverterExp = "0=其它,1=后台用户,2=手机端用户") private Integer operatorType; @@ -120,7 +120,7 @@ public class SysOperLogVo implements Serializable { /** * 操作状态(0正常 1异常) */ - @ExcelProperty(value = "状态", index = 13, converter = ExcelDictConvert.class) + @ExcelProperty(value = "状态", converter = ExcelDictConvert.class) @ExcelDictFormat(dictType = "sys_common_status") private Integer status; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysPostVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysPostVo.java index 3185423af..3e6c6a843 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysPostVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysPostVo.java @@ -54,7 +54,7 @@ public class SysPostVo implements Serializable { /** * 状态(0正常 1停用) */ - @ExcelProperty(value = "状态", index = 4, converter = ExcelDictConvert.class) + @ExcelProperty(value = "状态", converter = ExcelDictConvert.class) @ExcelDictFormat(dictType = "sys_normal_disable") private String status; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysRoleVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysRoleVo.java index 015a0436d..1e5cd9ee6 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysRoleVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysRoleVo.java @@ -53,7 +53,7 @@ public class SysRoleVo implements Serializable { /** * 数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限) */ - @ExcelProperty(value = "数据范围", index = 4, converter = ExcelDictConvert.class) + @ExcelProperty(value = "数据范围", converter = ExcelDictConvert.class) @ExcelDictFormat(readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限") private String dataScope; @@ -72,7 +72,7 @@ public class SysRoleVo implements Serializable { /** * 角色状态(0正常 1停用) */ - @ExcelProperty(value = "角色状态", index = 7, converter = ExcelDictConvert.class) + @ExcelProperty(value = "角色状态", converter = ExcelDictConvert.class) @ExcelDictFormat(dictType = "sys_normal_disable") private String status; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysTenantPackageVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysTenantPackageVo.java index ae11a8202..070334b41 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysTenantPackageVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysTenantPackageVo.java @@ -58,7 +58,7 @@ public class SysTenantPackageVo implements Serializable { /** * 状态(0正常 1停用) */ - @ExcelProperty(value = "状态", index = 5, converter = ExcelDictConvert.class) + @ExcelProperty(value = "状态", converter = ExcelDictConvert.class) @ExcelDictFormat(readConverterExp = "0=正常,1=停用") private String status; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysTenantVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysTenantVo.java index 49e03ea34..6a453150e 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysTenantVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysTenantVo.java @@ -107,7 +107,7 @@ public class SysTenantVo implements Serializable { /** * 租户状态(0正常 1停用) */ - @ExcelProperty(value = "租户状态", index = 13, converter = ExcelDictConvert.class) + @ExcelProperty(value = "租户状态", converter = ExcelDictConvert.class) @ExcelDictFormat(readConverterExp = "0=正常,1=停用") private String status; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserExportVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserExportVo.java index b7fc48002..21b1efbec 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserExportVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserExportVo.java @@ -59,14 +59,14 @@ public class SysUserExportVo implements Serializable { /** * 用户性别 */ - @ExcelProperty(value = "用户性别", index = 6, converter = ExcelDictConvert.class) + @ExcelProperty(value = "用户性别", converter = ExcelDictConvert.class) @ExcelDictFormat(dictType = "sys_user_sex") private String sex; /** * 帐号状态(0正常 1停用) */ - @ExcelProperty(value = "帐号状态", index = 7, converter = ExcelDictConvert.class) + @ExcelProperty(value = "帐号状态", converter = ExcelDictConvert.class) @ExcelDictFormat(dictType = "sys_normal_disable") private String status; From 359ec45b055c86907368228bbf5891dc80b68c71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Wed, 2 Aug 2023 10:17:22 +0800 Subject: [PATCH 04/29] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E7=AB=AFid=E4=B8=8Etoken=E6=A0=A1=E9=AA=8C=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/dromara/common/security/config/SecurityConfig.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ruoyi-common/ruoyi-common-security/src/main/java/org/dromara/common/security/config/SecurityConfig.java b/ruoyi-common/ruoyi-common-security/src/main/java/org/dromara/common/security/config/SecurityConfig.java index 063d9131e..69a2e104a 100644 --- a/ruoyi-common/ruoyi-common-security/src/main/java/org/dromara/common/security/config/SecurityConfig.java +++ b/ruoyi-common/ruoyi-common-security/src/main/java/org/dromara/common/security/config/SecurityConfig.java @@ -54,10 +54,8 @@ public class SecurityConfig implements WebMvcConfigurer { String clientId = StpUtil.getExtra(LoginHelper.CLIENT_KEY).toString(); if (!StringUtils.equalsAny(clientId, headerCid, paramCid)) { // token 无效 - throw NotLoginException.newInstance( - StpUtil.getLoginType(), - NotLoginException.INVALID_TOKEN, - NotLoginException.NOT_TOKEN_MESSAGE, + throw NotLoginException.newInstance(StpUtil.getLoginType(), + "-100", "客户端ID与Token不匹配", StpUtil.getTokenValue()); } From c92c99c8da92fd9d7dc4af9534419d0679fcc207 Mon Sep 17 00:00:00 2001 From: zlyx <1242874891@qq.com> Date: Wed, 2 Aug 2023 14:21:12 +0800 Subject: [PATCH 05/29] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20SysLoginSer?= =?UTF-8?q?vice#socialRegister=20=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=B7=B2=E7=BB=8F=E7=BB=91=E5=AE=9A=E7=94=A8=E6=88=B7=20;=20fi?= =?UTF-8?q?x=20=E4=BF=AE=E6=AD=A3=20SysSocialServiceImpl#selectByAuthId=20?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E6=95=B0=E6=8D=AE=E6=8A=A5=E9=94=99=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dromara/web/service/SysLoginService.java | 23 ++++++++++++------- .../service/impl/SysSocialServiceImpl.java | 7 +++++- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/ruoyi-admin/src/main/java/org/dromara/web/service/SysLoginService.java b/ruoyi-admin/src/main/java/org/dromara/web/service/SysLoginService.java index c2392d383..ba5840abd 100644 --- a/ruoyi-admin/src/main/java/org/dromara/web/service/SysLoginService.java +++ b/ruoyi-admin/src/main/java/org/dromara/web/service/SysLoginService.java @@ -26,6 +26,7 @@ import org.dromara.common.tenant.exception.TenantException; import org.dromara.common.tenant.helper.TenantHelper; import org.dromara.system.domain.SysUser; import org.dromara.system.domain.bo.SysSocialBo; +import org.dromara.system.domain.vo.SysSocialVo; import org.dromara.system.domain.vo.SysTenantVo; import org.dromara.system.domain.vo.SysUserVo; import org.dromara.system.mapper.SysUserMapper; @@ -69,14 +70,20 @@ public class SysLoginService { * @return 统一响应实体 */ public void socialRegister(AuthUser authUserData) { - SysSocialBo bo = BeanUtil.toBean(authUserData, SysSocialBo.class); - BeanUtil.copyProperties(authUserData.getToken(), bo); - bo.setUserId(LoginHelper.getUserId()); - bo.setAuthId(authUserData.getSource() + authUserData.getUuid()); - bo.setOpenId(authUserData.getUuid()); - bo.setUserName(authUserData.getUsername()); - bo.setNickName(authUserData.getNickname()); - sysSocialService.insertByBo(bo); + String authId = authUserData.getSource() + authUserData.getUuid(); + // 查询是否已经绑定用户 + SysSocialVo vo = sysSocialService.selectByAuthId(authId); + if (ObjectUtil.isEmpty(vo)) { + // 没有绑定用户, 新增用户信息 + SysSocialBo bo = BeanUtil.toBean(authUserData, SysSocialBo.class); + BeanUtil.copyProperties(authUserData.getToken(), bo); + bo.setUserId(LoginHelper.getUserId()); + bo.setAuthId(authId); + bo.setOpenId(authUserData.getUuid()); + bo.setUserName(authUserData.getUsername()); + bo.setNickName(authUserData.getNickname()); + sysSocialService.insertByBo(bo); + } } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysSocialServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysSocialServiceImpl.java index 065dea0da..14ad9340d 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysSocialServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysSocialServiceImpl.java @@ -3,6 +3,7 @@ package org.dromara.system.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import lombok.RequiredArgsConstructor; import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.system.domain.SysSocial; import org.dromara.system.domain.bo.SysSocialBo; import org.dromara.system.domain.vo.SysSocialVo; @@ -91,7 +92,11 @@ public class SysSocialServiceImpl implements ISysSocialService { */ @Override public SysSocialVo selectByAuthId(String authId) { - return baseMapper.selectVoOne(new LambdaQueryWrapper().eq(SysSocial::getAuthId, authId)); + return baseMapper.selectVoOne( + new LambdaQueryWrapper() + .eq(SysSocial::getAuthId, authId) + .orderByDesc(BaseEntity::getCreateTime) + .last("limit 1")); } } From bbe672208fa862b3a01473336e5711b679279293 Mon Sep 17 00:00:00 2001 From: zlyx <1242874891@qq.com> Date: Wed, 2 Aug 2023 14:51:23 +0800 Subject: [PATCH 06/29] =?UTF-8?q?add=20=E6=96=B0=E5=A2=9E=20SysSocialServi?= =?UTF-8?q?ceImpl#updateByBo=20=E6=9B=B4=E6=96=B0=E7=A4=BE=E4=BC=9A?= =?UTF-8?q?=E5=8C=96=E5=85=B3=E7=B3=BB=20;=20update=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=20SysLoginService#socialRegister=20=E5=AF=B9=E5=B7=B2=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E7=94=A8=E6=88=B7=E8=BF=9B=E8=A1=8C=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=20;=20reset=20=E5=9B=9E=E6=BB=9A=E4=B8=8A=E4=B8=80=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E4=B8=AD=20SysSocialServiceImpl#selectByAuthId=20?= =?UTF-8?q?=E4=BC=9A=E5=AF=BC=E8=87=B4=E5=A4=9A=E7=A7=8D=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E4=B8=8D=E5=85=BC=E5=AE=B9=20;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dromara/web/service/SysLoginService.java | 19 ++++++++++++------- .../system/service/ISysSocialService.java | 4 ++++ .../service/impl/SysSocialServiceImpl.java | 16 ++++++++++------ 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/ruoyi-admin/src/main/java/org/dromara/web/service/SysLoginService.java b/ruoyi-admin/src/main/java/org/dromara/web/service/SysLoginService.java index ba5840abd..ad8a41e36 100644 --- a/ruoyi-admin/src/main/java/org/dromara/web/service/SysLoginService.java +++ b/ruoyi-admin/src/main/java/org/dromara/web/service/SysLoginService.java @@ -71,18 +71,23 @@ public class SysLoginService { */ public void socialRegister(AuthUser authUserData) { String authId = authUserData.getSource() + authUserData.getUuid(); + // 第三方用户信息 + SysSocialBo bo = BeanUtil.toBean(authUserData, SysSocialBo.class); + BeanUtil.copyProperties(authUserData.getToken(), bo); + bo.setUserId(LoginHelper.getUserId()); + bo.setAuthId(authId); + bo.setOpenId(authUserData.getUuid()); + bo.setUserName(authUserData.getUsername()); + bo.setNickName(authUserData.getNickname()); // 查询是否已经绑定用户 SysSocialVo vo = sysSocialService.selectByAuthId(authId); if (ObjectUtil.isEmpty(vo)) { // 没有绑定用户, 新增用户信息 - SysSocialBo bo = BeanUtil.toBean(authUserData, SysSocialBo.class); - BeanUtil.copyProperties(authUserData.getToken(), bo); - bo.setUserId(LoginHelper.getUserId()); - bo.setAuthId(authId); - bo.setOpenId(authUserData.getUuid()); - bo.setUserName(authUserData.getUsername()); - bo.setNickName(authUserData.getNickname()); sysSocialService.insertByBo(bo); + } else { + // 更新用户信息 + bo.setId(vo.getId()); + sysSocialService.updateByBo(bo); } } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysSocialService.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysSocialService.java index 9c8275efd..5f2014d9e 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysSocialService.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysSocialService.java @@ -33,6 +33,10 @@ public interface ISysSocialService { */ Boolean insertByBo(SysSocialBo bo); + /** + * 更新社会化关系 + */ + Boolean updateByBo(SysSocialBo bo); /** * 删除社会化关系信息 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysSocialServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysSocialServiceImpl.java index 14ad9340d..bd7248f3c 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysSocialServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysSocialServiceImpl.java @@ -3,7 +3,6 @@ package org.dromara.system.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import lombok.RequiredArgsConstructor; import org.dromara.common.core.utils.MapstructUtils; -import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.system.domain.SysSocial; import org.dromara.system.domain.bo.SysSocialBo; import org.dromara.system.domain.vo.SysSocialVo; @@ -66,6 +65,15 @@ public class SysSocialServiceImpl implements ISysSocialService { return flag; } + /** + * 更新社会化关系 + */ + @Override + public Boolean updateByBo(SysSocialBo bo) { + SysSocial update = MapstructUtils.convert(bo, SysSocial.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } /** * 保存前的数据校验 @@ -92,11 +100,7 @@ public class SysSocialServiceImpl implements ISysSocialService { */ @Override public SysSocialVo selectByAuthId(String authId) { - return baseMapper.selectVoOne( - new LambdaQueryWrapper() - .eq(SysSocial::getAuthId, authId) - .orderByDesc(BaseEntity::getCreateTime) - .last("limit 1")); + return baseMapper.selectVoOne(new LambdaQueryWrapper().eq(SysSocial::getAuthId, authId)); } } From 6c9f1f1994d8d98f9f60e040d53cf3d63e752129 Mon Sep 17 00:00:00 2001 From: "Michelle.Chung" <1242874891@qq.com> Date: Wed, 2 Aug 2023 16:34:42 +0800 Subject: [PATCH 07/29] =?UTF-8?q?update=20=E6=9B=B4=E6=96=B0=20sql,=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AE=A2=E6=88=B7=E7=AB=AF=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=B1=BB=E5=9E=8B=E5=AD=97=E5=85=B8=E5=8F=82?= =?UTF-8?q?=E6=95=B0=20;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/sql/oracle/oracle_ry_vue_5.X.sql | 8 +++++--- script/sql/postgres/postgres_ry_vue_5.X.sql | 8 +++++--- script/sql/ry_vue_5.X.sql | 8 +++++--- script/sql/sqlserver/sqlserver_ry_vue_5.X.sql | 10 +++++++--- script/sql/update/oracle/update_5.0-5.1.sql | 8 +++++--- script/sql/update/postgres/update_5.0-5.1.sql | 8 +++++--- script/sql/update/sqlserver/update_5.0-5.1.sql | 10 +++++++--- script/sql/update/update_5.0-5.1.sql | 8 +++++--- 8 files changed, 44 insertions(+), 24 deletions(-) diff --git a/script/sql/oracle/oracle_ry_vue_5.X.sql b/script/sql/oracle/oracle_ry_vue_5.X.sql index fd2c58439..a79b06358 100644 --- a/script/sql/oracle/oracle_ry_vue_5.X.sql +++ b/script/sql/oracle/oracle_ry_vue_5.X.sql @@ -876,8 +876,10 @@ insert into sys_dict_data values(31, '000000', 0, '短信认证', 'sms', insert into sys_dict_data values(32, '000000', 0, '邮件认证', 'email', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, '邮件认证'); insert into sys_dict_data values(33, '000000', 0, '小程序认证', 'xcx', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, '小程序认证'); insert into sys_dict_data values(34, '000000', 0, '三方登录认证', 'social', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, '三方登录认证'); -insert into sys_dict_data values(35, '000000', 0, 'PC端', 'pc', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, 'PC端'); -insert into sys_dict_data values(36, '000000', 0, 'APP端', 'app', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, 'APP端'); +insert into sys_dict_data values(35, '000000', 0, 'PC', 'pc', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, 'PC'); +insert into sys_dict_data values(36, '000000', 0, '安卓', 'android', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, '安卓'); +insert into sys_dict_data values(37, '000000', 0, 'iOS', 'ios', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, 'iOS'); +insert into sys_dict_data values(38, '000000', 0, '小程序', 'xcx', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, '小程序'); -- ---------------------------- @@ -1238,7 +1240,7 @@ comment on column sys_client.update_by is '更新者'; comment on column sys_client.update_time is '更新时间'; insert into sys_client values (1, 'e5cd7e4891bf95d1d19206ce24a7b32e', 'pc', 'pc123', 'password,social', 'pc', 1800, 604800, 0, 0, 103, 1, sysdate, 1, sysdate); -insert into sys_client values (2, '428a8310cd442757ae699df5d894f051', 'app', 'app123', 'password,sms,social', 'app', 1800, 604800, 0, 0, 103, 1, sysdate, 1, sysdate); +insert into sys_client values (2, '428a8310cd442757ae699df5d894f051', 'app', 'app123', 'password,sms,social', 'android', 1800, 604800, 0, 0, 103, 1, sysdate, 1, sysdate); -- ---------------------------- diff --git a/script/sql/postgres/postgres_ry_vue_5.X.sql b/script/sql/postgres/postgres_ry_vue_5.X.sql index d2f39f06e..4326f6ae1 100644 --- a/script/sql/postgres/postgres_ry_vue_5.X.sql +++ b/script/sql/postgres/postgres_ry_vue_5.X.sql @@ -893,8 +893,10 @@ insert into sys_dict_data values(31, '000000', 0, '短信认证', 'sms', insert into sys_dict_data values(32, '000000', 0, '邮件认证', 'email', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, now(), null, null, '邮件认证'); insert into sys_dict_data values(33, '000000', 0, '小程序认证', 'xcx', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, now(), null, null, '小程序认证'); insert into sys_dict_data values(34, '000000', 0, '三方登录认证', 'social', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, now(), null, null, '三方登录认证'); -insert into sys_dict_data values(35, '000000', 0, 'PC端', 'pc', 'sys_device_type', '', 'default', 'N', '0', 103, 1, now(), null, null, 'PC端'); -insert into sys_dict_data values(36, '000000', 0, 'APP端', 'app', 'sys_device_type', '', 'default', 'N', '0', 103, 1, now(), null, null, 'APP端'); +insert into sys_dict_data values(35, '000000', 0, 'PC', 'pc', 'sys_device_type', '', 'default', 'N', '0', 103, 1, now(), null, null, 'PC'); +insert into sys_dict_data values(36, '000000', 0, '安卓', 'android', 'sys_device_type', '', 'default', 'N', '0', 103, 1, now(), null, null, '安卓'); +insert into sys_dict_data values(37, '000000', 0, 'iOS', 'ios', 'sys_device_type', '', 'default', 'N', '0', 103, 1, now(), null, null, 'iOS'); +insert into sys_dict_data values(38, '000000', 0, '小程序', 'xcx', 'sys_device_type', '', 'default', 'N', '0', 103, 1, now(), null, null, '小程序'); -- ---------------------------- @@ -1260,7 +1262,7 @@ comment on column sys_client.update_by is '更新者'; comment on column sys_client.update_time is '更新时间'; insert into sys_client values (1, 'e5cd7e4891bf95d1d19206ce24a7b32e', 'pc', 'pc123', 'password,social', 'pc', 1800, 604800, 0, 0, 103, 1, now(), 1, now()); -insert into sys_client values (2, '428a8310cd442757ae699df5d894f051', 'app', 'app123', 'password,sms,social', 'app', 1800, 604800, 0, 0, 103, 1, now(), 1, now()); +insert into sys_client values (2, '428a8310cd442757ae699df5d894f051', 'app', 'app123', 'password,sms,social', 'android', 1800, 604800, 0, 0, 103, 1, now(), 1, now()); -- 字符串自动转时间 避免框架时间查询报错问题 create or replace function cast_varchar_to_timestamp(varchar) returns timestamptz as $$ diff --git a/script/sql/ry_vue_5.X.sql b/script/sql/ry_vue_5.X.sql index a9ca1c3a7..745f9a078 100644 --- a/script/sql/ry_vue_5.X.sql +++ b/script/sql/ry_vue_5.X.sql @@ -660,8 +660,10 @@ insert into sys_dict_data values(31, '000000', 0, '短信认证', 'sms', insert into sys_dict_data values(32, '000000', 0, '邮件认证', 'email', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, sysdate(), null, null, '邮件认证'); insert into sys_dict_data values(33, '000000', 0, '小程序认证', 'xcx', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, sysdate(), null, null, '小程序认证'); insert into sys_dict_data values(34, '000000', 0, '三方登录认证', 'social', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, sysdate(), null, null, '三方登录认证'); -insert into sys_dict_data values(35, '000000', 0, 'PC端', 'pc', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate(), null, null, 'PC端'); -insert into sys_dict_data values(36, '000000', 0, 'APP端', 'app', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate(), null, null, 'APP端'); +insert into sys_dict_data values(35, '000000', 0, 'PC', 'pc', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate(), null, null, 'PC'); +insert into sys_dict_data values(36, '000000', 0, '安卓', 'android', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate(), null, null, '安卓'); +insert into sys_dict_data values(37, '000000', 0, 'iOS', 'ios', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate(), null, null, 'iOS'); +insert into sys_dict_data values(38, '000000', 0, '小程序', 'xcx', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate(), null, null, '小程序'); -- ---------------------------- @@ -879,4 +881,4 @@ create table sys_client ( ) engine=innodb comment='系统授权表'; insert into sys_client values (1, 'e5cd7e4891bf95d1d19206ce24a7b32e', 'pc', 'pc123', 'password,social', 'pc', 1800, 604800, 0, 0, 103, 1, sysdate(), 1, sysdate()); -insert into sys_client values (2, '428a8310cd442757ae699df5d894f051', 'app', 'app123', 'password,sms,social', 'app', 1800, 604800, 0, 0, 103, 1, sysdate(), 1, sysdate()); +insert into sys_client values (2, '428a8310cd442757ae699df5d894f051', 'app', 'app123', 'password,sms,social', 'android', 1800, 604800, 0, 0, 103, 1, sysdate(), 1, sysdate()); diff --git a/script/sql/sqlserver/sqlserver_ry_vue_5.X.sql b/script/sql/sqlserver/sqlserver_ry_vue_5.X.sql index 193a14a2f..d90f02d31 100644 --- a/script/sql/sqlserver/sqlserver_ry_vue_5.X.sql +++ b/script/sql/sqlserver/sqlserver_ry_vue_5.X.sql @@ -1263,9 +1263,13 @@ INSERT sys_dict_data VALUES (33, N'000000', 0, N'小程序认证', N'xcx', N'sys GO INSERT sys_dict_data VALUES (34, N'000000', 0, N'三方登录认证', N'`social`', N'sys_grant_type', N'', N'default', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'三方登录认证') GO -INSERT sys_dict_data VALUES (35, N'000000', 0, N'PC端', N'`pc`', N'sys_device_type', N'', N'default', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'PC端') +INSERT sys_dict_data VALUES (35, N'000000', 0, N'PC', N'`pc`', N'sys_device_type', N'', N'default', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'PC') GO -INSERT sys_dict_data VALUES (36, N'000000', 0, N'APP端', N'`app`', N'sys_device_type', N'', N'default', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'APP端') +INSERT sys_dict_data VALUES (36, N'000000', 0, N'安卓', N'`android`', N'sys_device_type', N'', N'default', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'安卓') +GO +INSERT sys_dict_data VALUES (37, N'000000', 0, N'iOS', N'`ios`', N'sys_device_type', N'', N'default', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'iOS') +GO +INSERT sys_dict_data VALUES (38, N'000000', 0, N'小程序', N'`xcx`', N'sys_device_type', N'', N'default', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'小程序') GO CREATE TABLE sys_dict_type @@ -3198,5 +3202,5 @@ GO INSERT INTO sys_client VALUES (N'1', N'e5cd7e4891bf95d1d19206ce24a7b32e', N'pc', N'pc123', N'password,social', N'pc', 1800, 604800, N'0', N'0', 103, 1, getdate(), 1, getdate()) GO -INSERT INTO sys_client VALUES (N'2', N'428a8310cd442757ae699df5d894f051', N'app', N'app123', N'password,sms,social', N'app', 1800, 604800, N'0', N'0', 103, 1, getdate(), 1, getdate()) +INSERT INTO sys_client VALUES (N'2', N'428a8310cd442757ae699df5d894f051', N'app', N'app123', N'password,sms,social', N'android', 1800, 604800, N'0', N'0', 103, 1, getdate(), 1, getdate()) GO diff --git a/script/sql/update/oracle/update_5.0-5.1.sql b/script/sql/update/oracle/update_5.0-5.1.sql index 6cb3c4805..54cff5db5 100644 --- a/script/sql/update/oracle/update_5.0-5.1.sql +++ b/script/sql/update/oracle/update_5.0-5.1.sql @@ -115,7 +115,7 @@ comment on column sys_client.update_by is '更新者'; comment on column sys_client.update_time is '更新时间'; insert into sys_client values (1, 'e5cd7e4891bf95d1d19206ce24a7b32e', 'pc', 'pc123', 'password,social', 'pc', 1800, 604800, 0, 0, 103, 1, sysdate, 1, sysdate); -insert into sys_client values (2, '428a8310cd442757ae699df5d894f051', 'app', 'app123', 'password,sms,social', 'app', 1800, 604800, 0, 0, 103, 1, sysdate, 1, sysdate); +insert into sys_client values (2, '428a8310cd442757ae699df5d894f051', 'app', 'app123', 'password,sms,social', 'android', 1800, 604800, 0, 0, 103, 1, sysdate, 1, sysdate); insert into sys_dict_type values(11, '000000', '授权类型', 'sys_grant_type', '0', 103, 1, sysdate, null, null, '认证授权类型'); insert into sys_dict_type values(12, '000000', '设备类型', 'sys_device_type', '0', 103, 1, sysdate, null, null, '客户端设备类型'); @@ -125,8 +125,10 @@ insert into sys_dict_data values(31, '000000', 0, '短信认证', 'sms', insert into sys_dict_data values(32, '000000', 0, '邮件认证', 'email', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, '邮件认证'); insert into sys_dict_data values(33, '000000', 0, '小程序认证', 'xcx', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, '小程序认证'); insert into sys_dict_data values(34, '000000', 0, '三方登录认证', 'social', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, '三方登录认证'); -insert into sys_dict_data values(35, '000000', 0, 'PC端', 'pc', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, 'PC端'); -insert into sys_dict_data values(36, '000000', 0, 'APP端', 'app', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, 'APP端'); +insert into sys_dict_data values(35, '000000', 0, 'PC', 'pc', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, 'PC'); +insert into sys_dict_data values(36, '000000', 0, '安卓', 'android', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, '安卓'); +insert into sys_dict_data values(37, '000000', 0, 'iOS', 'ios', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, 'iOS'); +insert into sys_dict_data values(38, '000000', 0, '小程序', 'xcx', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, '小程序'); -- 二级菜单 insert into sys_menu values('123', '客户端管理', '1', '11', 'client', 'system/client/index', '', 1, 0, 'C', '0', '0', 'system:client:list', 'international', 103, 1, sysdate, null, null, '客户端管理菜单'); diff --git a/script/sql/update/postgres/update_5.0-5.1.sql b/script/sql/update/postgres/update_5.0-5.1.sql index 5c7d00ba7..a0107ae87 100644 --- a/script/sql/update/postgres/update_5.0-5.1.sql +++ b/script/sql/update/postgres/update_5.0-5.1.sql @@ -114,7 +114,7 @@ comment on column sys_client.update_by is '更新者'; comment on column sys_client.update_time is '更新时间'; insert into sys_client values (1, 'e5cd7e4891bf95d1d19206ce24a7b32e', 'pc', 'pc123', 'password,social', 'pc', 1800, 604800, 0, 0, 103, 1, now(), 1, now()); -insert into sys_client values (2, '428a8310cd442757ae699df5d894f051', 'app', 'app123', 'password,sms,social', 'app', 1800, 604800, 0, 0, 103, 1, now(), 1, now()); +insert into sys_client values (2, '428a8310cd442757ae699df5d894f051', 'app', 'app123', 'password,sms,social', 'android', 1800, 604800, 0, 0, 103, 1, now(), 1, now()); insert into sys_dict_type values(11, '000000', '授权类型', 'sys_grant_type', '0', 103, 1, now(), null, null, '认证授权类型'); insert into sys_dict_type values(12, '000000', '设备类型', 'sys_device_type', '0', 103, 1, now(), null, null, '客户端设备类型'); @@ -124,8 +124,10 @@ insert into sys_dict_data values(31, '000000', 0, '短信认证', 'sms', insert into sys_dict_data values(32, '000000', 0, '邮件认证', 'email', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, now(), null, null, '邮件认证'); insert into sys_dict_data values(33, '000000', 0, '小程序认证', 'xcx', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, now(), null, null, '小程序认证'); insert into sys_dict_data values(34, '000000', 0, '三方登录认证', 'social', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, now(), null, null, '三方登录认证'); -insert into sys_dict_data values(35, '000000', 0, 'PC端', 'pc', 'sys_device_type', '', 'default', 'N', '0', 103, 1, now(), null, null, 'PC端'); -insert into sys_dict_data values(36, '000000', 0, 'APP端', 'app', 'sys_device_type', '', 'default', 'N', '0', 103, 1, now(), null, null, 'APP端'); +insert into sys_dict_data values(35, '000000', 0, 'PC', 'pc', 'sys_device_type', '', 'default', 'N', '0', 103, 1, now(), null, null, 'PC'); +insert into sys_dict_data values(36, '000000', 0, '安卓', 'android', 'sys_device_type', '', 'default', 'N', '0', 103, 1, now(), null, null, '安卓'); +insert into sys_dict_data values(37, '000000', 0, 'iOS', 'ios', 'sys_device_type', '', 'default', 'N', '0', 103, 1, now(), null, null, 'iOS'); +insert into sys_dict_data values(38, '000000', 0, '小程序', 'xcx', 'sys_device_type', '', 'default', 'N', '0', 103, 1, now(), null, null, '小程序'); -- 二级菜单 insert into sys_menu values('123', '客户端管理', '1', '11', 'client', 'system/client/index', '', '1', '0', 'C', '0', '0', 'system:client:list', 'international', 103, 1, now(), null, null, '客户端管理菜单'); diff --git a/script/sql/update/sqlserver/update_5.0-5.1.sql b/script/sql/update/sqlserver/update_5.0-5.1.sql index 6bbedcf3d..63fa9379b 100644 --- a/script/sql/update/sqlserver/update_5.0-5.1.sql +++ b/script/sql/update/sqlserver/update_5.0-5.1.sql @@ -347,7 +347,7 @@ GO INSERT INTO sys_client VALUES (N'1', N'e5cd7e4891bf95d1d19206ce24a7b32e', N'pc', N'pc123', N'password,social', N'pc', 1800, 604800, N'0', N'0', 103, 1, getdate(), 1, getdate()) GO -INSERT INTO sys_client VALUES (N'2', N'428a8310cd442757ae699df5d894f051', N'app', N'app123', N'password,sms,social', N'app', 1800, 604800, N'0', N'0', 103, 1, getdate(), 1, getdate()) +INSERT INTO sys_client VALUES (N'2', N'428a8310cd442757ae699df5d894f051', N'app', N'app123', N'password,sms,social', N'android', 1800, 604800, N'0', N'0', 103, 1, getdate(), 1, getdate()) GO INSERT sys_dict_type VALUES (11, N'000000', N'授权类型', N'sys_grant_type', N'0', 103, 1, getdate(), NULL, NULL, N'认证授权类型') @@ -365,9 +365,13 @@ INSERT sys_dict_data VALUES (33, N'000000', 0, N'小程序认证', N'xcx', N'sys GO INSERT sys_dict_data VALUES (34, N'000000', 0, N'三方登录认证', N'`social`', N'sys_grant_type', N'', N'default', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'三方登录认证') GO -INSERT sys_dict_data VALUES (35, N'000000', 0, N'PC端', N'`pc`', N'sys_device_type', N'', N'default', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'PC端') +INSERT sys_dict_data VALUES (35, N'000000', 0, N'PC', N'`pc`', N'sys_device_type', N'', N'default', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'PC') GO -INSERT sys_dict_data VALUES (36, N'000000', 0, N'APP端', N'`app`', N'sys_device_type', N'', N'default', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'APP端') +INSERT sys_dict_data VALUES (36, N'000000', 0, N'安卓', N'`android`', N'sys_device_type', N'', N'default', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'安卓') +GO +INSERT sys_dict_data VALUES (37, N'000000', 0, N'iOS', N'`ios`', N'sys_device_type', N'', N'default', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'iOS') +GO +INSERT sys_dict_data VALUES (38, N'000000', 0, N'小程序', N'`xcx`', N'sys_device_type', N'', N'default', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'小程序') GO -- 二级菜单 diff --git a/script/sql/update/update_5.0-5.1.sql b/script/sql/update/update_5.0-5.1.sql index acafcbae8..22b227b79 100644 --- a/script/sql/update/update_5.0-5.1.sql +++ b/script/sql/update/update_5.0-5.1.sql @@ -65,7 +65,7 @@ create table sys_client ( ) engine=innodb comment='系统授权表'; insert into sys_client values (1, 'e5cd7e4891bf95d1d19206ce24a7b32e', 'pc', 'pc123', 'password,social', 'pc', 1800, 604800, 0, 0, 103, 1, sysdate(), 1, sysdate()); -insert into sys_client values (2, '428a8310cd442757ae699df5d894f051', 'app', 'app123', 'password,sms,social', 'app', 1800, 604800, 0, 0, 103, 1, sysdate(), 1, sysdate()); +insert into sys_client values (2, '428a8310cd442757ae699df5d894f051', 'app', 'app123', 'password,sms,social', 'android', 1800, 604800, 0, 0, 103, 1, sysdate(), 1, sysdate()); insert into sys_dict_type values(11, '000000', '授权类型', 'sys_grant_type', '0', 103, 1, sysdate(), null, null, '认证授权类型'); insert into sys_dict_type values(12, '000000', '设备类型', 'sys_device_type', '0', 103, 1, sysdate(), null, null, '客户端设备类型'); @@ -75,8 +75,10 @@ insert into sys_dict_data values(31, '000000', 0, '短信认证', 'sms', insert into sys_dict_data values(32, '000000', 0, '邮件认证', 'email', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, sysdate(), null, null, '邮件认证'); insert into sys_dict_data values(33, '000000', 0, '小程序认证', 'xcx', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, sysdate(), null, null, '小程序认证'); insert into sys_dict_data values(34, '000000', 0, '三方登录认证', 'social', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, sysdate(), null, null, '三方登录认证'); -insert into sys_dict_data values(35, '000000', 0, 'PC端', 'pc', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate(), null, null, 'PC端'); -insert into sys_dict_data values(36, '000000', 0, 'APP端', 'app', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate(), null, null, 'APP端'); +insert into sys_dict_data values(35, '000000', 0, 'PC', 'pc', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate(), null, null, 'PC'); +insert into sys_dict_data values(36, '000000', 0, '安卓', 'android', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate(), null, null, '安卓'); +insert into sys_dict_data values(37, '000000', 0, 'iOS', 'ios', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate(), null, null, 'iOS'); +insert into sys_dict_data values(38, '000000', 0, '小程序', 'xcx', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate(), null, null, '小程序'); -- 二级菜单 insert into sys_menu values('123', '客户端管理', '1', '11', 'client', 'system/client/index', '', 1, 0, 'C', '0', '0', 'system:client:list', 'international', 103, 1, sysdate(), null, null, '客户端管理菜单'); From b96f2c4f27414dd285dd6b536eb12faf6e29c01f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Fri, 4 Aug 2023 10:19:47 +0800 Subject: [PATCH 08/29] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E7=AE=80?= =?UTF-8?q?=E5=8C=96=E7=BA=BF=E7=A8=8B=E6=B1=A0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/core/config/ThreadPoolConfig.java | 18 ++++++++ .../common/core/manager/ShutdownManager.java | 41 ------------------- 2 files changed, 18 insertions(+), 41 deletions(-) delete mode 100644 ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/manager/ShutdownManager.java diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/config/ThreadPoolConfig.java b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/config/ThreadPoolConfig.java index cb3d8f7d7..da1c5ae6f 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/config/ThreadPoolConfig.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/config/ThreadPoolConfig.java @@ -1,8 +1,11 @@ package org.dromara.common.core.config; +import jakarta.annotation.PreDestroy; +import lombok.extern.slf4j.Slf4j; import org.dromara.common.core.config.properties.ThreadPoolProperties; import org.dromara.common.core.utils.Threads; import org.apache.commons.lang3.concurrent.BasicThreadFactory; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; @@ -18,6 +21,7 @@ import java.util.concurrent.ThreadPoolExecutor; * * @author Lion Li **/ +@Slf4j @AutoConfiguration @EnableConfigurationProperties(ThreadPoolProperties.class) public class ThreadPoolConfig { @@ -54,4 +58,18 @@ public class ThreadPoolConfig { } }; } + + /** + * 销毁事件 + */ + @PreDestroy + public void destroy(@Qualifier("scheduledExecutorService") ScheduledExecutorService scheduledExecutorService) { + try { + log.info("====关闭后台任务任务线程池===="); + Threads.shutdownAndAwaitTermination(scheduledExecutorService); + } catch (Exception e) { + log.error(e.getMessage(), e); + } + } + } diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/manager/ShutdownManager.java b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/manager/ShutdownManager.java deleted file mode 100644 index 45ba7d36e..000000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/manager/ShutdownManager.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.dromara.common.core.manager; - -import org.dromara.common.core.utils.Threads; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Component; - -import jakarta.annotation.PreDestroy; -import java.util.concurrent.ScheduledExecutorService; - -/** - * 确保应用退出时能关闭后台线程 - * - * @author Lion Li - */ -@Slf4j -@Component -public class ShutdownManager { - - @Autowired - @Qualifier("scheduledExecutorService") - private ScheduledExecutorService scheduledExecutorService; - - @PreDestroy - public void destroy() { - shutdownAsyncManager(); - } - - /** - * 停止异步执行任务 - */ - private void shutdownAsyncManager() { - try { - log.info("====关闭后台任务任务线程池===="); - Threads.shutdownAndAwaitTermination(scheduledExecutorService); - } catch (Exception e) { - log.error(e.getMessage(), e); - } - } -} From e042f7f6b3858210ec65f1105b6e7f803265570e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Fri, 4 Aug 2023 10:24:23 +0800 Subject: [PATCH 09/29] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E7=AE=80?= =?UTF-8?q?=E5=8C=96=E7=BA=BF=E7=A8=8B=E6=B1=A0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/dromara/common/core/config/ThreadPoolConfig.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/config/ThreadPoolConfig.java b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/config/ThreadPoolConfig.java index da1c5ae6f..3db62b279 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/config/ThreadPoolConfig.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/config/ThreadPoolConfig.java @@ -2,10 +2,10 @@ package org.dromara.common.core.config; import jakarta.annotation.PreDestroy; import lombok.extern.slf4j.Slf4j; -import org.dromara.common.core.config.properties.ThreadPoolProperties; -import org.dromara.common.core.utils.Threads; import org.apache.commons.lang3.concurrent.BasicThreadFactory; -import org.springframework.beans.factory.annotation.Qualifier; +import org.dromara.common.core.config.properties.ThreadPoolProperties; +import org.dromara.common.core.utils.SpringUtils; +import org.dromara.common.core.utils.Threads; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; @@ -63,9 +63,10 @@ public class ThreadPoolConfig { * 销毁事件 */ @PreDestroy - public void destroy(@Qualifier("scheduledExecutorService") ScheduledExecutorService scheduledExecutorService) { + public void destroy() { try { log.info("====关闭后台任务任务线程池===="); + ScheduledExecutorService scheduledExecutorService = SpringUtils.getBean("scheduledExecutorService"); Threads.shutdownAndAwaitTermination(scheduledExecutorService); } catch (Exception e) { log.error(e.getMessage(), e); From 946580373028db7386c0f472ddc126090e27129f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Fri, 4 Aug 2023 10:55:05 +0800 Subject: [PATCH 10/29] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=20powerjob=20=E6=97=A0=E7=94=A8=E7=9A=84=E5=BF=83?= =?UTF-8?q?=E8=B7=B3=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-admin/src/main/resources/application.yml | 1 + .../src/main/resources/application.properties | 3 +++ 2 files changed, 4 insertions(+) diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 616446d27..5f1a664e4 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -50,6 +50,7 @@ logging: level: org.dromara: @logging.level@ org.springframework: warn + tech.powerjob.worker.background: warn config: classpath:logback-plus.xml # 用户配置 diff --git a/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application.properties b/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application.properties index 5477c1fed..5b6516c2c 100644 --- a/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application.properties +++ b/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application.properties @@ -6,6 +6,9 @@ spring.main.banner-mode=log spring.jpa.open-in-view=false spring.data.mongodb.repositories.type=none logging.level.org.mongodb=warn +logging.level.tech.powerjob.server=warn +logging.level.MONITOR_LOGGER_DB_OPERATION=warn +logging.level.MONITOR_LOGGER_WORKER_HEART_BEAT=warn logging.config: classpath:logback-plus.xml # Configuration for uploading files. From 4a00998f1379028f17d46665084f0f0dde8cfdac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Fri, 4 Aug 2023 17:10:08 +0800 Subject: [PATCH 11/29] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E9=80=82?= =?UTF-8?q?=E9=85=8D=20mysql=208.0.34=20=E5=8D=87=E7=BA=A7=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-admin/src/main/resources/application-dev.yml | 4 ++-- ruoyi-admin/src/main/resources/application-prod.yml | 4 ++-- .../src/main/resources/application-dev.properties | 2 +- .../src/main/resources/application-prod.properties | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ruoyi-admin/src/main/resources/application-dev.yml b/ruoyi-admin/src/main/resources/application-dev.yml index 897725c41..5d23ddc1b 100644 --- a/ruoyi-admin/src/main/resources/application-dev.yml +++ b/ruoyi-admin/src/main/resources/application-dev.yml @@ -43,7 +43,7 @@ spring: driverClassName: com.mysql.cj.jdbc.Driver # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562 # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题) - url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true + url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true username: root password: root # 从库数据源 @@ -51,7 +51,7 @@ spring: lazy: true type: ${spring.datasource.type} driverClassName: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true + url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true username: password: # oracle: diff --git a/ruoyi-admin/src/main/resources/application-prod.yml b/ruoyi-admin/src/main/resources/application-prod.yml index f9cddb9b2..3623e6e28 100644 --- a/ruoyi-admin/src/main/resources/application-prod.yml +++ b/ruoyi-admin/src/main/resources/application-prod.yml @@ -46,7 +46,7 @@ spring: driverClassName: com.mysql.cj.jdbc.Driver # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562 # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题) - url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true + url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true username: root password: root # 从库数据源 @@ -54,7 +54,7 @@ spring: lazy: true type: ${spring.datasource.type} driverClassName: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true + url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true username: password: # oracle: diff --git a/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application-dev.properties b/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application-dev.properties index 36dbdfc65..ba024d3c2 100644 --- a/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application-dev.properties +++ b/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application-dev.properties @@ -2,7 +2,7 @@ oms.env=dev ####### Database properties(Configure according to the the environment) ####### spring.datasource.core.driver-class-name=com.mysql.cj.jdbc.Driver -spring.datasource.core.jdbc-url=jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai +spring.datasource.core.jdbc-url=jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true spring.datasource.core.username=root spring.datasource.core.password=root spring.datasource.core.maximum-pool-size=20 diff --git a/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application-prod.properties b/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application-prod.properties index e6a6052c1..b13c68867 100644 --- a/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application-prod.properties +++ b/ruoyi-extend/ruoyi-powerjob-server/src/main/resources/application-prod.properties @@ -2,7 +2,7 @@ oms.env=prod ####### Database properties(Configure according to the the environment) ####### spring.datasource.core.driver-class-name=com.mysql.cj.jdbc.Driver -spring.datasource.core.jdbc-url=jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai +spring.datasource.core.jdbc-url=jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true spring.datasource.core.username=root spring.datasource.core.password=root spring.datasource.core.maximum-pool-size=20 From 86a8f5a700a19d8e55da5f5f0d5edd6b1284934f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Mon, 7 Aug 2023 12:35:34 +0800 Subject: [PATCH 12/29] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E5=8A=A0?= =?UTF-8?q?=E5=AF=86=E5=AE=9E=E7=8E=B0=20=E4=BD=BF=E7=94=A8=20EncryptUtils?= =?UTF-8?q?=20=E7=BB=9F=E4=B8=80=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../encrypt/core/encryptor/AesEncryptor.java | 26 ++----- .../core/encryptor/Base64Encryptor.java | 6 +- .../encrypt/core/encryptor/RsaEncryptor.java | 15 ++-- .../encrypt/core/encryptor/Sm2Encryptor.java | 15 ++-- .../encrypt/core/encryptor/Sm4Encryptor.java | 24 ++----- .../common/encrypt/utils/EncryptUtils.java | 68 +++++++++++++++++++ 6 files changed, 95 insertions(+), 59 deletions(-) diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/org/dromara/common/encrypt/core/encryptor/AesEncryptor.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/org/dromara/common/encrypt/core/encryptor/AesEncryptor.java index 228a36278..e4dc59767 100644 --- a/ruoyi-common/ruoyi-common-encrypt/src/main/java/org/dromara/common/encrypt/core/encryptor/AesEncryptor.java +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/org/dromara/common/encrypt/core/encryptor/AesEncryptor.java @@ -1,14 +1,9 @@ package org.dromara.common.encrypt.core.encryptor; -import cn.hutool.core.util.ArrayUtil; -import cn.hutool.core.util.StrUtil; -import cn.hutool.crypto.SecureUtil; -import cn.hutool.crypto.symmetric.AES; import org.dromara.common.encrypt.core.EncryptContext; import org.dromara.common.encrypt.enumd.AlgorithmType; import org.dromara.common.encrypt.enumd.EncodeType; - -import java.nio.charset.StandardCharsets; +import org.dromara.common.encrypt.utils.EncryptUtils; /** * AES算法实现 @@ -18,20 +13,11 @@ import java.nio.charset.StandardCharsets; */ public class AesEncryptor extends AbstractEncryptor { - private final AES aes; + private final EncryptContext context; public AesEncryptor(EncryptContext context) { super(context); - String password = context.getPassword(); - if (StrUtil.isBlank(password)) { - throw new IllegalArgumentException("AES没有获得秘钥信息"); - } - // aes算法的秘钥要求是16位、24位、32位 - int[] array = {16, 24, 32}; - if (!ArrayUtil.contains(array, password.length())) { - throw new IllegalArgumentException("AES秘钥长度应该为16位、24位、32位,实际为" + password.length() + "位"); - } - aes = SecureUtil.aes(context.getPassword().getBytes(StandardCharsets.UTF_8)); + this.context = context; } /** @@ -51,9 +37,9 @@ public class AesEncryptor extends AbstractEncryptor { @Override public String encrypt(String value, EncodeType encodeType) { if (encodeType == EncodeType.HEX) { - return aes.encryptHex(value); + return EncryptUtils.encryptByAesHex(value, context.getPassword()); } else { - return aes.encryptBase64(value); + return EncryptUtils.encryptByAes(value, context.getPassword()); } } @@ -64,6 +50,6 @@ public class AesEncryptor extends AbstractEncryptor { */ @Override public String decrypt(String value) { - return this.aes.decryptStr(value); + return EncryptUtils.decryptByAes(value, context.getPassword()); } } diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/org/dromara/common/encrypt/core/encryptor/Base64Encryptor.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/org/dromara/common/encrypt/core/encryptor/Base64Encryptor.java index 40039543d..002854831 100644 --- a/ruoyi-common/ruoyi-common-encrypt/src/main/java/org/dromara/common/encrypt/core/encryptor/Base64Encryptor.java +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/org/dromara/common/encrypt/core/encryptor/Base64Encryptor.java @@ -1,9 +1,9 @@ package org.dromara.common.encrypt.core.encryptor; -import cn.hutool.core.codec.Base64; import org.dromara.common.encrypt.core.EncryptContext; import org.dromara.common.encrypt.enumd.AlgorithmType; import org.dromara.common.encrypt.enumd.EncodeType; +import org.dromara.common.encrypt.utils.EncryptUtils; /** * Base64算法实现 @@ -33,7 +33,7 @@ public class Base64Encryptor extends AbstractEncryptor { */ @Override public String encrypt(String value, EncodeType encodeType) { - return Base64.encode(value); + return EncryptUtils.encryptByBase64(value); } /** @@ -43,6 +43,6 @@ public class Base64Encryptor extends AbstractEncryptor { */ @Override public String decrypt(String value) { - return Base64.decodeStr(value); + return EncryptUtils.decryptByBase64(value); } } diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/org/dromara/common/encrypt/core/encryptor/RsaEncryptor.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/org/dromara/common/encrypt/core/encryptor/RsaEncryptor.java index 61b1dffe4..5f03a4b44 100644 --- a/ruoyi-common/ruoyi-common-encrypt/src/main/java/org/dromara/common/encrypt/core/encryptor/RsaEncryptor.java +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/org/dromara/common/encrypt/core/encryptor/RsaEncryptor.java @@ -1,13 +1,10 @@ package org.dromara.common.encrypt.core.encryptor; -import cn.hutool.core.codec.Base64; -import cn.hutool.crypto.SecureUtil; -import cn.hutool.crypto.asymmetric.KeyType; -import cn.hutool.crypto.asymmetric.RSA; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.encrypt.core.EncryptContext; import org.dromara.common.encrypt.enumd.AlgorithmType; import org.dromara.common.encrypt.enumd.EncodeType; +import org.dromara.common.encrypt.utils.EncryptUtils; /** @@ -18,7 +15,7 @@ import org.dromara.common.encrypt.enumd.EncodeType; */ public class RsaEncryptor extends AbstractEncryptor { - private final RSA rsa; + private final EncryptContext context; public RsaEncryptor(EncryptContext context) { super(context); @@ -27,7 +24,7 @@ public class RsaEncryptor extends AbstractEncryptor { if (StringUtils.isAnyEmpty(privateKey, publicKey)) { throw new IllegalArgumentException("RSA公私钥均需要提供,公钥加密,私钥解密。"); } - this.rsa = SecureUtil.rsa(Base64.decode(privateKey), Base64.decode(publicKey)); + this.context = context; } /** @@ -47,9 +44,9 @@ public class RsaEncryptor extends AbstractEncryptor { @Override public String encrypt(String value, EncodeType encodeType) { if (encodeType == EncodeType.HEX) { - return rsa.encryptHex(value, KeyType.PublicKey); + return EncryptUtils.encryptByRsaHex(value, context.getPublicKey()); } else { - return rsa.encryptBase64(value, KeyType.PublicKey); + return EncryptUtils.encryptByRsa(value, context.getPublicKey()); } } @@ -60,6 +57,6 @@ public class RsaEncryptor extends AbstractEncryptor { */ @Override public String decrypt(String value) { - return this.rsa.decryptStr(value, KeyType.PrivateKey); + return EncryptUtils.decryptByRsa(value, context.getPrivateKey()); } } diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/org/dromara/common/encrypt/core/encryptor/Sm2Encryptor.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/org/dromara/common/encrypt/core/encryptor/Sm2Encryptor.java index c728cf838..aec5d826e 100644 --- a/ruoyi-common/ruoyi-common-encrypt/src/main/java/org/dromara/common/encrypt/core/encryptor/Sm2Encryptor.java +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/org/dromara/common/encrypt/core/encryptor/Sm2Encryptor.java @@ -1,13 +1,10 @@ package org.dromara.common.encrypt.core.encryptor; -import cn.hutool.core.codec.Base64; -import cn.hutool.crypto.SmUtil; -import cn.hutool.crypto.asymmetric.KeyType; -import cn.hutool.crypto.asymmetric.SM2; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.encrypt.core.EncryptContext; import org.dromara.common.encrypt.enumd.AlgorithmType; import org.dromara.common.encrypt.enumd.EncodeType; +import org.dromara.common.encrypt.utils.EncryptUtils; /** * sm2算法实现 @@ -17,7 +14,7 @@ import org.dromara.common.encrypt.enumd.EncodeType; */ public class Sm2Encryptor extends AbstractEncryptor { - private final SM2 sm2; + private final EncryptContext context; public Sm2Encryptor(EncryptContext context) { super(context); @@ -26,7 +23,7 @@ public class Sm2Encryptor extends AbstractEncryptor { if (StringUtils.isAnyEmpty(privateKey, publicKey)) { throw new IllegalArgumentException("SM2公私钥均需要提供,公钥加密,私钥解密。"); } - this.sm2 = SmUtil.sm2(Base64.decode(privateKey), Base64.decode(publicKey)); + this.context = context; } /** @@ -46,9 +43,9 @@ public class Sm2Encryptor extends AbstractEncryptor { @Override public String encrypt(String value, EncodeType encodeType) { if (encodeType == EncodeType.HEX) { - return sm2.encryptHex(value, KeyType.PublicKey); + return EncryptUtils.encryptBySm2Hex(value, context.getPublicKey()); } else { - return sm2.encryptBase64(value, KeyType.PublicKey); + return EncryptUtils.encryptBySm2(value, context.getPublicKey()); } } @@ -59,6 +56,6 @@ public class Sm2Encryptor extends AbstractEncryptor { */ @Override public String decrypt(String value) { - return this.sm2.decryptStr(value, KeyType.PrivateKey); + return EncryptUtils.decryptBySm2(value, context.getPrivateKey()); } } diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/org/dromara/common/encrypt/core/encryptor/Sm4Encryptor.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/org/dromara/common/encrypt/core/encryptor/Sm4Encryptor.java index 2a32faf24..adaf67488 100644 --- a/ruoyi-common/ruoyi-common-encrypt/src/main/java/org/dromara/common/encrypt/core/encryptor/Sm4Encryptor.java +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/org/dromara/common/encrypt/core/encryptor/Sm4Encryptor.java @@ -1,13 +1,9 @@ package org.dromara.common.encrypt.core.encryptor; -import cn.hutool.core.util.StrUtil; -import cn.hutool.crypto.SmUtil; -import cn.hutool.crypto.symmetric.SM4; import org.dromara.common.encrypt.core.EncryptContext; import org.dromara.common.encrypt.enumd.AlgorithmType; import org.dromara.common.encrypt.enumd.EncodeType; - -import java.nio.charset.StandardCharsets; +import org.dromara.common.encrypt.utils.EncryptUtils; /** * sm4算法实现 @@ -17,19 +13,11 @@ import java.nio.charset.StandardCharsets; */ public class Sm4Encryptor extends AbstractEncryptor { - private final SM4 sm4; + private final EncryptContext context; public Sm4Encryptor(EncryptContext context) { super(context); - String password = context.getPassword(); - if (StrUtil.isBlank(password)) { - throw new IllegalArgumentException("SM4没有获得秘钥信息"); - } - // sm4算法的秘钥要求是16位长度 - if (16 != password.length()) { - throw new IllegalArgumentException("SM4秘钥长度应该为16位,实际为" + password.length() + "位"); - } - this.sm4 = SmUtil.sm4(password.getBytes(StandardCharsets.UTF_8)); + this.context = context; } /** @@ -49,9 +37,9 @@ public class Sm4Encryptor extends AbstractEncryptor { @Override public String encrypt(String value, EncodeType encodeType) { if (encodeType == EncodeType.HEX) { - return sm4.encryptHex(value); + return EncryptUtils.encryptBySm4Hex(value, context.getPassword()); } else { - return sm4.encryptBase64(value); + return EncryptUtils.encryptBySm4(value, context.getPassword()); } } @@ -62,6 +50,6 @@ public class Sm4Encryptor extends AbstractEncryptor { */ @Override public String decrypt(String value) { - return this.sm4.decryptStr(value); + return EncryptUtils.decryptBySm4(value, context.getPassword()); } } diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/org/dromara/common/encrypt/utils/EncryptUtils.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/org/dromara/common/encrypt/utils/EncryptUtils.java index 3504573ce..8e34843a7 100644 --- a/ruoyi-common/ruoyi-common-encrypt/src/main/java/org/dromara/common/encrypt/utils/EncryptUtils.java +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/org/dromara/common/encrypt/utils/EncryptUtils.java @@ -67,6 +67,25 @@ public class EncryptUtils { return SecureUtil.aes(password.getBytes(StandardCharsets.UTF_8)).encryptBase64(data, StandardCharsets.UTF_8); } + /** + * AES加密 + * + * @param data 待解密数据 + * @param password 秘钥字符串 + * @return 加密后字符串, 采用Hex编码 + */ + public static String encryptByAesHex(String data, String password) { + if (StrUtil.isBlank(password)) { + throw new IllegalArgumentException("AES需要传入秘钥信息"); + } + // aes算法的秘钥要求是16位、24位、32位 + int[] array = {16, 24, 32}; + if (!ArrayUtil.contains(array, password.length())) { + throw new IllegalArgumentException("AES秘钥长度要求为16位、24位、32位"); + } + return SecureUtil.aes(password.getBytes(StandardCharsets.UTF_8)).encryptHex(data, StandardCharsets.UTF_8); + } + /** * AES解密 * @@ -105,6 +124,25 @@ public class EncryptUtils { return SmUtil.sm4(password.getBytes(StandardCharsets.UTF_8)).encryptBase64(data, StandardCharsets.UTF_8); } + /** + * sm4加密 + * + * @param data 待加密数据 + * @param password 秘钥字符串 + * @return 加密后字符串, 采用Base64编码 + */ + public static String encryptBySm4Hex(String data, String password) { + if (StrUtil.isBlank(password)) { + throw new IllegalArgumentException("SM4需要传入秘钥信息"); + } + // sm4算法的秘钥要求是16位长度 + int sm4PasswordLength = 16; + if (sm4PasswordLength != password.length()) { + throw new IllegalArgumentException("SM4秘钥长度要求为16位"); + } + return SmUtil.sm4(password.getBytes(StandardCharsets.UTF_8)).encryptHex(data, StandardCharsets.UTF_8); + } + /** * sm4解密 * @@ -152,6 +190,21 @@ public class EncryptUtils { return sm2.encryptBase64(data, StandardCharsets.UTF_8, KeyType.PublicKey); } + /** + * sm2公钥加密 + * + * @param data 待加密数据 + * @param publicKey 公钥 + * @return 加密后字符串, 采用Hex编码 + */ + public static String encryptBySm2Hex(String data, String publicKey) { + if (StrUtil.isBlank(publicKey)) { + throw new IllegalArgumentException("SM2需要传入公钥进行加密"); + } + SM2 sm2 = SmUtil.sm2(null, publicKey); + return sm2.encryptHex(data, StandardCharsets.UTF_8, KeyType.PublicKey); + } + /** * sm2私钥解密 * @@ -195,6 +248,21 @@ public class EncryptUtils { return rsa.encryptBase64(data, StandardCharsets.UTF_8, KeyType.PublicKey); } + /** + * rsa公钥加密 + * + * @param data 待加密数据 + * @param publicKey 公钥 + * @return 加密后字符串, 采用Hex编码 + */ + public static String encryptByRsaHex(String data, String publicKey) { + if (StrUtil.isBlank(publicKey)) { + throw new IllegalArgumentException("RSA需要传入公钥进行加密"); + } + RSA rsa = SecureUtil.rsa(null, publicKey); + return rsa.encryptHex(data, StandardCharsets.UTF_8, KeyType.PublicKey); + } + /** * rsa私钥解密 * From ddc43b3057ba8f2d20f5b1e627c5e03f871371b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Mon, 7 Aug 2023 17:23:13 +0800 Subject: [PATCH 13/29] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=AD=97=E5=85=B8=E6=97=A0=E7=94=A8=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=AD=97=E6=AE=B5(=E5=9F=BA=E6=9C=AC=E7=94=A8=E4=B8=8D?= =?UTF-8?q?=E4=B8=8A=20=E7=A6=81=E7=94=A8=E5=90=8E=E8=BF=98=E4=BC=9A?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E5=9B=9E=E6=98=BE=E9=97=AE=E9=A2=98)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dromara/system/domain/SysDictData.java | 5 - .../dromara/system/domain/SysDictType.java | 5 - .../system/domain/bo/SysDictDataBo.java | 5 - .../system/domain/bo/SysDictTypeBo.java | 5 - .../system/domain/vo/SysDictDataVo.java | 7 -- .../system/domain/vo/SysDictTypeVo.java | 7 -- .../system/mapper/SysDictDataMapper.java | 4 +- .../service/impl/SysDictDataServiceImpl.java | 1 - .../service/impl/SysDictTypeServiceImpl.java | 1 - script/sql/oracle/oracle_ry_vue_5.X.sql | 92 +++++++------- script/sql/postgres/postgres_ry_vue_5.X.sql | 92 +++++++------- script/sql/ry_vue_5.X.sql | 90 +++++++------- script/sql/sqlserver/sqlserver_ry_vue_5.X.sql | 114 ++++++++---------- 13 files changed, 183 insertions(+), 245 deletions(-) diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysDictData.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysDictData.java index 9b60d9299..6884fc2db 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysDictData.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysDictData.java @@ -59,11 +59,6 @@ public class SysDictData extends TenantEntity { */ private String isDefault; - /** - * 状态(0正常 1停用) - */ - private String status; - /** * 备注 */ diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysDictType.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysDictType.java index 5345f8775..955af85fb 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysDictType.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysDictType.java @@ -33,11 +33,6 @@ public class SysDictType extends TenantEntity { */ private String dictType; - /** - * 状态(0正常 1停用) - */ - private String status; - /** * 备注 */ diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysDictDataBo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysDictDataBo.java index 3990de3ce..70f062834 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysDictDataBo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysDictDataBo.java @@ -70,11 +70,6 @@ public class SysDictDataBo extends BaseEntity { */ private String isDefault; - /** - * 状态(0正常 1停用) - */ - private String status; - /** * 创建部门 */ diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysDictTypeBo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysDictTypeBo.java index 2fac7ea75..c121d24a8 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysDictTypeBo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysDictTypeBo.java @@ -44,11 +44,6 @@ public class SysDictTypeBo extends BaseEntity { @Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "字典类型必须以字母开头,且只能为(小写字母,数字,下滑线)") private String dictType; - /** - * 状态(0正常 1停用) - */ - private String status; - /** * 备注 */ diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDictDataVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDictDataVo.java index d058d5e91..83ea619af 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDictDataVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDictDataVo.java @@ -73,13 +73,6 @@ public class SysDictDataVo implements Serializable { @ExcelDictFormat(dictType = "sys_yes_no") private String isDefault; - /** - * 状态(0正常 1停用) - */ - @ExcelProperty(value = "状态", converter = ExcelDictConvert.class) - @ExcelDictFormat(dictType = "sys_normal_disable") - private String status; - /** * 备注 */ diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDictTypeVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDictTypeVo.java index 2cac4a25f..e6a184fcf 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDictTypeVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDictTypeVo.java @@ -44,13 +44,6 @@ public class SysDictTypeVo implements Serializable { @ExcelProperty(value = "字典类型") private String dictType; - /** - * 状态(0正常 1停用) - */ - @ExcelProperty(value = "状态", converter = ExcelDictConvert.class) - @ExcelDictFormat(dictType = "sys_normal_disable") - private String status; - /** * 备注 */ diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/SysDictDataMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/SysDictDataMapper.java index 5c8565379..c2f1a7cbe 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/SysDictDataMapper.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/SysDictDataMapper.java @@ -1,9 +1,8 @@ package org.dromara.system.mapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import org.dromara.common.core.constant.UserConstants; -import org.dromara.system.domain.SysDictData; import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; +import org.dromara.system.domain.SysDictData; import org.dromara.system.domain.vo.SysDictDataVo; import java.util.List; @@ -18,7 +17,6 @@ public interface SysDictDataMapper extends BaseMapperPlus selectDictDataByType(String dictType) { return selectVoList( new LambdaQueryWrapper() - .eq(SysDictData::getStatus, UserConstants.DICT_NORMAL) .eq(SysDictData::getDictType, dictType) .orderByAsc(SysDictData::getDictSort)); } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDictDataServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDictDataServiceImpl.java index bb03d0d13..74d445453 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDictDataServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDictDataServiceImpl.java @@ -56,7 +56,6 @@ public class SysDictDataServiceImpl implements ISysDictDataService { lqw.eq(bo.getDictSort() != null, SysDictData::getDictSort, bo.getDictSort()); lqw.like(StringUtils.isNotBlank(bo.getDictLabel()), SysDictData::getDictLabel, bo.getDictLabel()); lqw.eq(StringUtils.isNotBlank(bo.getDictType()), SysDictData::getDictType, bo.getDictType()); - lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysDictData::getStatus, bo.getStatus()); lqw.orderByAsc(SysDictData::getDictSort); return lqw; } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDictTypeServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDictTypeServiceImpl.java index d0e956234..b0620d6f6 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDictTypeServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDictTypeServiceImpl.java @@ -74,7 +74,6 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); lqw.like(StringUtils.isNotBlank(bo.getDictName()), SysDictType::getDictName, bo.getDictName()); lqw.like(StringUtils.isNotBlank(bo.getDictType()), SysDictType::getDictType, bo.getDictType()); - lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysDictType::getStatus, bo.getStatus()); lqw.between(params.get("beginTime") != null && params.get("endTime") != null, SysDictType::getCreateTime, params.get("beginTime"), params.get("endTime")); return lqw; diff --git a/script/sql/oracle/oracle_ry_vue_5.X.sql b/script/sql/oracle/oracle_ry_vue_5.X.sql index a79b06358..29c5ac6ba 100644 --- a/script/sql/oracle/oracle_ry_vue_5.X.sql +++ b/script/sql/oracle/oracle_ry_vue_5.X.sql @@ -767,7 +767,6 @@ create table sys_dict_type ( tenant_id varchar2(20) default '000000', dict_name varchar2(100) default '', dict_type varchar2(100) default '', - status char(1) default '0', create_dept number(20) default null, create_by number(20) default null, create_time date, @@ -784,7 +783,6 @@ comment on column sys_dict_type.dict_id is '字典主键'; comment on column sys_dict_type.tenant_id is '租户编号'; comment on column sys_dict_type.dict_name is '字典名称'; comment on column sys_dict_type.dict_type is '字典类型'; -comment on column sys_dict_type.status is '状态(0正常 1停用)'; comment on column sys_dict_type.create_dept is '创建部门'; comment on column sys_dict_type.create_by is '创建者'; comment on column sys_dict_type.create_time is '创建时间'; @@ -792,16 +790,16 @@ comment on column sys_dict_type.update_by is '更新者'; comment on column sys_dict_type.update_time is '更新时间'; comment on column sys_dict_type.remark is '备注'; -insert into sys_dict_type values(1, '000000', '用户性别', 'sys_user_sex', '0', 103, 1, sysdate, null, null, '用户性别列表'); -insert into sys_dict_type values(2, '000000', '菜单状态', 'sys_show_hide', '0', 103, 1, sysdate, null, null, '菜单状态列表'); -insert into sys_dict_type values(3, '000000', '系统开关', 'sys_normal_disable', '0', 103, 1, sysdate, null, null, '系统开关列表'); -insert into sys_dict_type values(6, '000000', '系统是否', 'sys_yes_no', '0', 103, 1, sysdate, null, null, '系统是否列表'); -insert into sys_dict_type values(7, '000000', '通知类型', 'sys_notice_type', '0', 103, 1, sysdate, null, null, '通知类型列表'); -insert into sys_dict_type values(8, '000000', '通知状态', 'sys_notice_status', '0', 103, 1, sysdate, null, null, '通知状态列表'); -insert into sys_dict_type values(9, '000000', '操作类型', 'sys_oper_type', '0', 103, 1, sysdate, null, null, '操作类型列表'); -insert into sys_dict_type values(10, '000000', '系统状态', 'sys_common_status', '0', 103, 1, sysdate, null, null, '登录状态列表'); -insert into sys_dict_type values(11, '000000', '授权类型', 'sys_grant_type', '0', 103, 1, sysdate, null, null, '认证授权类型'); -insert into sys_dict_type values(12, '000000', '设备类型', 'sys_device_type', '0', 103, 1, sysdate, null, null, '客户端设备类型'); +insert into sys_dict_type values(1, '000000', '用户性别', 'sys_user_sex', 103, 1, sysdate, null, null, '用户性别列表'); +insert into sys_dict_type values(2, '000000', '菜单状态', 'sys_show_hide', 103, 1, sysdate, null, null, '菜单状态列表'); +insert into sys_dict_type values(3, '000000', '系统开关', 'sys_normal_disable', 103, 1, sysdate, null, null, '系统开关列表'); +insert into sys_dict_type values(6, '000000', '系统是否', 'sys_yes_no', 103, 1, sysdate, null, null, '系统是否列表'); +insert into sys_dict_type values(7, '000000', '通知类型', 'sys_notice_type', 103, 1, sysdate, null, null, '通知类型列表'); +insert into sys_dict_type values(8, '000000', '通知状态', 'sys_notice_status', 103, 1, sysdate, null, null, '通知状态列表'); +insert into sys_dict_type values(9, '000000', '操作类型', 'sys_oper_type', 103, 1, sysdate, null, null, '操作类型列表'); +insert into sys_dict_type values(10, '000000', '系统状态', 'sys_common_status', 103, 1, sysdate, null, null, '登录状态列表'); +insert into sys_dict_type values(11, '000000', '授权类型', 'sys_grant_type', 103, 1, sysdate, null, null, '认证授权类型'); +insert into sys_dict_type values(12, '000000', '设备类型', 'sys_device_type', 103, 1, sysdate, null, null, '客户端设备类型'); -- ---------------------------- @@ -817,7 +815,6 @@ create table sys_dict_data ( css_class varchar2(100) default null, list_class varchar2(100) default null, is_default char(1) default 'N', - status char(1) default '0', create_dept number(20) default null, create_by number(20) default null, create_time date, @@ -838,7 +835,6 @@ comment on column sys_dict_data.dict_type is '字典类型'; comment on column sys_dict_data.css_class is '样式属性(其他样式扩展)'; comment on column sys_dict_data.list_class is '表格回显样式'; comment on column sys_dict_data.is_default is '是否默认(Y是 N否)'; -comment on column sys_dict_data.status is '状态(0正常 1停用)'; comment on column sys_dict_data.create_dept is '创建部门'; comment on column sys_dict_data.create_by is '创建者'; comment on column sys_dict_data.create_time is '创建时间'; @@ -846,40 +842,40 @@ comment on column sys_dict_data.update_by is '更新者'; comment on column sys_dict_data.update_time is '更新时间'; comment on column sys_dict_data.remark is '备注'; -insert into sys_dict_data values(1, '000000', 1, '男', '0', 'sys_user_sex', '', '', 'Y', '0', 103, 1, sysdate, null, null, '性别男'); -insert into sys_dict_data values(2, '000000', 2, '女', '1', 'sys_user_sex', '', '', 'N', '0', 103, 1, sysdate, null, null, '性别女'); -insert into sys_dict_data values(3, '000000', 3, '未知', '2', 'sys_user_sex', '', '', 'N', '0', 103, 1, sysdate, null, null, '性别未知'); -insert into sys_dict_data values(4, '000000', 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', '0', 103, 1, sysdate, null, null, '显示菜单'); -insert into sys_dict_data values(5, '000000', 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', '0', 103, 1, sysdate, null, null, '隐藏菜单'); -insert into sys_dict_data values(6, '000000', 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', '0', 103, 1, sysdate, null, null, '正常状态'); -insert into sys_dict_data values(7, '000000', 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', '0', 103, 1, sysdate, null, null, '停用状态'); -insert into sys_dict_data values(12, '000000', 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', '0', 103, 1, sysdate, null, null, '系统默认是'); -insert into sys_dict_data values(13, '000000', 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', '0', 103, 1, sysdate, null, null, '系统默认否'); -insert into sys_dict_data values(14, '000000', 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', '0', 103, 1, sysdate, null, null, '通知'); -insert into sys_dict_data values(15, '000000', 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', '0', 103, 1, sysdate, null, null, '公告'); -insert into sys_dict_data values(16, '000000', 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', '0', 103, 1, sysdate, null, null, '正常状态'); -insert into sys_dict_data values(17, '000000', 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', '0', 103, 1, sysdate, null, null, '关闭状态'); -insert into sys_dict_data values(29, '000000', 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', '0', 103, 1, sysdate, null, null, '其他操作'); -insert into sys_dict_data values(18, '000000', 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', '0', 103, 1, sysdate, null, null, '新增操作'); -insert into sys_dict_data values(19, '000000', 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', '0', 103, 1, sysdate, null, null, '修改操作'); -insert into sys_dict_data values(20, '000000', 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', '0', 103, 1, sysdate, null, null, '删除操作'); -insert into sys_dict_data values(21, '000000', 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', '0', 103, 1, sysdate, null, null, '授权操作'); -insert into sys_dict_data values(22, '000000', 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', '0', 103, 1, sysdate, null, null, '导出操作'); -insert into sys_dict_data values(23, '000000', 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', '0', 103, 1, sysdate, null, null, '导入操作'); -insert into sys_dict_data values(24, '000000', 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', '0', 103, 1, sysdate, null, null, '强退操作'); -insert into sys_dict_data values(25, '000000', 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', '0', 103, 1, sysdate, null, null, '生成操作'); -insert into sys_dict_data values(26, '000000', 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', '0', 103, 1, sysdate, null, null, '清空操作'); -insert into sys_dict_data values(27, '000000', 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', '0', 103, 1, sysdate, null, null, '正常状态'); -insert into sys_dict_data values(28, '000000', 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 103, 1, sysdate, null, null, '停用状态'); -insert into sys_dict_data values(30, '000000', 0, '密码认证', 'password', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, '密码认证'); -insert into sys_dict_data values(31, '000000', 0, '短信认证', 'sms', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, '短信认证'); -insert into sys_dict_data values(32, '000000', 0, '邮件认证', 'email', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, '邮件认证'); -insert into sys_dict_data values(33, '000000', 0, '小程序认证', 'xcx', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, '小程序认证'); -insert into sys_dict_data values(34, '000000', 0, '三方登录认证', 'social', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, '三方登录认证'); -insert into sys_dict_data values(35, '000000', 0, 'PC', 'pc', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, 'PC'); -insert into sys_dict_data values(36, '000000', 0, '安卓', 'android', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, '安卓'); -insert into sys_dict_data values(37, '000000', 0, 'iOS', 'ios', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, 'iOS'); -insert into sys_dict_data values(38, '000000', 0, '小程序', 'xcx', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, '小程序'); +insert into sys_dict_data values(1, '000000', 1, '男', '0', 'sys_user_sex', '', '', 'Y', 103, 1, sysdate, null, null, '性别男'); +insert into sys_dict_data values(2, '000000', 2, '女', '1', 'sys_user_sex', '', '', 'N', 103, 1, sysdate, null, null, '性别女'); +insert into sys_dict_data values(3, '000000', 3, '未知', '2', 'sys_user_sex', '', '', 'N', 103, 1, sysdate, null, null, '性别未知'); +insert into sys_dict_data values(4, '000000', 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', 103, 1, sysdate, null, null, '显示菜单'); +insert into sys_dict_data values(5, '000000', 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', 103, 1, sysdate, null, null, '隐藏菜单'); +insert into sys_dict_data values(6, '000000', 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', 103, 1, sysdate, null, null, '正常状态'); +insert into sys_dict_data values(7, '000000', 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', 103, 1, sysdate, null, null, '停用状态'); +insert into sys_dict_data values(12, '000000', 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', 103, 1, sysdate, null, null, '系统默认是'); +insert into sys_dict_data values(13, '000000', 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', 103, 1, sysdate, null, null, '系统默认否'); +insert into sys_dict_data values(14, '000000', 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', 103, 1, sysdate, null, null, '通知'); +insert into sys_dict_data values(15, '000000', 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', 103, 1, sysdate, null, null, '公告'); +insert into sys_dict_data values(16, '000000', 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', 103, 1, sysdate, null, null, '正常状态'); +insert into sys_dict_data values(17, '000000', 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', 103, 1, sysdate, null, null, '关闭状态'); +insert into sys_dict_data values(29, '000000', 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', 103, 1, sysdate, null, null, '其他操作'); +insert into sys_dict_data values(18, '000000', 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', 103, 1, sysdate, null, null, '新增操作'); +insert into sys_dict_data values(19, '000000', 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', 103, 1, sysdate, null, null, '修改操作'); +insert into sys_dict_data values(20, '000000', 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', 103, 1, sysdate, null, null, '删除操作'); +insert into sys_dict_data values(21, '000000', 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', 103, 1, sysdate, null, null, '授权操作'); +insert into sys_dict_data values(22, '000000', 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', 103, 1, sysdate, null, null, '导出操作'); +insert into sys_dict_data values(23, '000000', 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', 103, 1, sysdate, null, null, '导入操作'); +insert into sys_dict_data values(24, '000000', 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', 103, 1, sysdate, null, null, '强退操作'); +insert into sys_dict_data values(25, '000000', 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', 103, 1, sysdate, null, null, '生成操作'); +insert into sys_dict_data values(26, '000000', 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', 103, 1, sysdate, null, null, '清空操作'); +insert into sys_dict_data values(27, '000000', 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', 103, 1, sysdate, null, null, '正常状态'); +insert into sys_dict_data values(28, '000000', 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', 103, 1, sysdate, null, null, '停用状态'); +insert into sys_dict_data values(30, '000000', 0, '密码认证', 'password', 'sys_grant_type', '', 'default', 'N', 103, 1, sysdate, null, null, '密码认证'); +insert into sys_dict_data values(31, '000000', 0, '短信认证', 'sms', 'sys_grant_type', '', 'default', 'N', 103, 1, sysdate, null, null, '短信认证'); +insert into sys_dict_data values(32, '000000', 0, '邮件认证', 'email', 'sys_grant_type', '', 'default', 'N', 103, 1, sysdate, null, null, '邮件认证'); +insert into sys_dict_data values(33, '000000', 0, '小程序认证', 'xcx', 'sys_grant_type', '', 'default', 'N', 103, 1, sysdate, null, null, '小程序认证'); +insert into sys_dict_data values(34, '000000', 0, '三方登录认证', 'social', 'sys_grant_type', '', 'default', 'N', 103, 1, sysdate, null, null, '三方登录认证'); +insert into sys_dict_data values(35, '000000', 0, 'PC', 'pc', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate, null, null, 'PC'); +insert into sys_dict_data values(36, '000000', 0, '安卓', 'android', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate, null, null, '安卓'); +insert into sys_dict_data values(37, '000000', 0, 'iOS', 'ios', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate, null, null, 'iOS'); +insert into sys_dict_data values(38, '000000', 0, '小程序', 'xcx', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate, null, null, '小程序'); -- ---------------------------- diff --git a/script/sql/postgres/postgres_ry_vue_5.X.sql b/script/sql/postgres/postgres_ry_vue_5.X.sql index 4326f6ae1..0f1d265e1 100644 --- a/script/sql/postgres/postgres_ry_vue_5.X.sql +++ b/script/sql/postgres/postgres_ry_vue_5.X.sql @@ -784,7 +784,6 @@ create table if not exists sys_dict_type tenant_id varchar(20) default '000000'::varchar, dict_name varchar(100) default ''::varchar, dict_type varchar(100) default ''::varchar, - status char default '0'::bpchar, create_dept int8, create_by int8, create_time timestamp, @@ -801,7 +800,6 @@ comment on column sys_dict_type.dict_id is '字典主键'; comment on column sys_dict_type.tenant_id is '租户编号'; comment on column sys_dict_type.dict_name is '字典名称'; comment on column sys_dict_type.dict_type is '字典类型'; -comment on column sys_dict_type.status is '状态(0正常 1停用)'; comment on column sys_dict_type.create_dept is '创建部门'; comment on column sys_dict_type.create_by is '创建者'; comment on column sys_dict_type.create_time is '创建时间'; @@ -809,16 +807,16 @@ comment on column sys_dict_type.update_by is '更新者'; comment on column sys_dict_type.update_time is '更新时间'; comment on column sys_dict_type.remark is '备注'; -insert into sys_dict_type values(1, '000000', '用户性别', 'sys_user_sex', '0', 103, 1, now(), null, null, '用户性别列表'); -insert into sys_dict_type values(2, '000000', '菜单状态', 'sys_show_hide', '0', 103, 1, now(), null, null, '菜单状态列表'); -insert into sys_dict_type values(3, '000000', '系统开关', 'sys_normal_disable', '0', 103, 1, now(), null, null, '系统开关列表'); -insert into sys_dict_type values(6, '000000', '系统是否', 'sys_yes_no', '0', 103, 1, now(), null, null, '系统是否列表'); -insert into sys_dict_type values(7, '000000', '通知类型', 'sys_notice_type', '0', 103, 1, now(), null, null, '通知类型列表'); -insert into sys_dict_type values(8, '000000', '通知状态', 'sys_notice_status', '0', 103, 1, now(), null, null, '通知状态列表'); -insert into sys_dict_type values(9, '000000', '操作类型', 'sys_oper_type', '0', 103, 1, now(), null, null, '操作类型列表'); -insert into sys_dict_type values(10, '000000', '系统状态', 'sys_common_status', '0', 103, 1, now(), null, null, '登录状态列表'); -insert into sys_dict_type values(11, '000000', '授权类型', 'sys_grant_type', '0', 103, 1, now(), null, null, '认证授权类型'); -insert into sys_dict_type values(12, '000000', '设备类型', 'sys_device_type', '0', 103, 1, now(), null, null, '客户端设备类型'); +insert into sys_dict_type values(1, '000000', '用户性别', 'sys_user_sex', 103, 1, now(), null, null, '用户性别列表'); +insert into sys_dict_type values(2, '000000', '菜单状态', 'sys_show_hide', 103, 1, now(), null, null, '菜单状态列表'); +insert into sys_dict_type values(3, '000000', '系统开关', 'sys_normal_disable', 103, 1, now(), null, null, '系统开关列表'); +insert into sys_dict_type values(6, '000000', '系统是否', 'sys_yes_no', 103, 1, now(), null, null, '系统是否列表'); +insert into sys_dict_type values(7, '000000', '通知类型', 'sys_notice_type', 103, 1, now(), null, null, '通知类型列表'); +insert into sys_dict_type values(8, '000000', '通知状态', 'sys_notice_status', 103, 1, now(), null, null, '通知状态列表'); +insert into sys_dict_type values(9, '000000', '操作类型', 'sys_oper_type', 103, 1, now(), null, null, '操作类型列表'); +insert into sys_dict_type values(10, '000000', '系统状态', 'sys_common_status', 103, 1, now(), null, null, '登录状态列表'); +insert into sys_dict_type values(11, '000000', '授权类型', 'sys_grant_type', 103, 1, now(), null, null, '认证授权类型'); +insert into sys_dict_type values(12, '000000', '设备类型', 'sys_device_type', 103, 1, now(), null, null, '客户端设备类型'); -- ---------------------------- -- 12、字典数据表 @@ -835,7 +833,6 @@ create table if not exists sys_dict_data css_class varchar(100) default null::varchar, list_class varchar(100) default null::varchar, is_default char default 'N'::bpchar, - status char default '0'::bpchar, create_dept int8, create_by int8, create_time timestamp, @@ -855,7 +852,6 @@ comment on column sys_dict_data.dict_type is '字典类型'; comment on column sys_dict_data.css_class is '样式属性(其他样式扩展)'; comment on column sys_dict_data.list_class is '表格回显样式'; comment on column sys_dict_data.is_default is '是否默认(Y是 N否)'; -comment on column sys_dict_data.status is '状态(0正常 1停用)'; comment on column sys_dict_data.create_dept is '创建部门'; comment on column sys_dict_data.create_by is '创建者'; comment on column sys_dict_data.create_time is '创建时间'; @@ -863,40 +859,40 @@ comment on column sys_dict_data.update_by is '更新者'; comment on column sys_dict_data.update_time is '更新时间'; comment on column sys_dict_data.remark is '备注'; -insert into sys_dict_data values(1, '000000', 1, '男', '0', 'sys_user_sex', '', '', 'Y', '0', 103, 1, now(), null, null, '性别男'); -insert into sys_dict_data values(2, '000000', 2, '女', '1', 'sys_user_sex', '', '', 'N', '0', 103, 1, now(), null, null, '性别女'); -insert into sys_dict_data values(3, '000000', 3, '未知', '2', 'sys_user_sex', '', '', 'N', '0', 103, 1, now(), null, null, '性别未知'); -insert into sys_dict_data values(4, '000000', 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', '0', 103, 1, now(), null, null, '显示菜单'); -insert into sys_dict_data values(5, '000000', 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', '0', 103, 1, now(), null, null, '隐藏菜单'); -insert into sys_dict_data values(6, '000000', 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', '0', 103, 1, now(), null, null, '正常状态'); -insert into sys_dict_data values(7, '000000', 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', '0', 103, 1, now(), null, null, '停用状态'); -insert into sys_dict_data values(12, '000000', 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', '0', 103, 1, now(), null, null, '系统默认是'); -insert into sys_dict_data values(13, '000000', 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', '0', 103, 1, now(), null, null, '系统默认否'); -insert into sys_dict_data values(14, '000000', 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', '0', 103, 1, now(), null, null, '通知'); -insert into sys_dict_data values(15, '000000', 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', '0', 103, 1, now(), null, null, '公告'); -insert into sys_dict_data values(16, '000000', 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', '0', 103, 1, now(), null, null, '正常状态'); -insert into sys_dict_data values(17, '000000', 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', '0', 103, 1, now(), null, null, '关闭状态'); -insert into sys_dict_data values(29, '000000', 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', '0', 103, 1, now(), null, null, '其他操作'); -insert into sys_dict_data values(18, '000000', 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', '0', 103, 1, now(), null, null, '新增操作'); -insert into sys_dict_data values(19, '000000', 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', '0', 103, 1, now(), null, null, '修改操作'); -insert into sys_dict_data values(20, '000000', 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', '0', 103, 1, now(), null, null, '删除操作'); -insert into sys_dict_data values(21, '000000', 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', '0', 103, 1, now(), null, null, '授权操作'); -insert into sys_dict_data values(22, '000000', 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', '0', 103, 1, now(), null, null, '导出操作'); -insert into sys_dict_data values(23, '000000', 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', '0', 103, 1, now(), null, null, '导入操作'); -insert into sys_dict_data values(24, '000000', 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', '0', 103, 1, now(), null, null, '强退操作'); -insert into sys_dict_data values(25, '000000', 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', '0', 103, 1, now(), null, null, '生成操作'); -insert into sys_dict_data values(26, '000000', 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', '0', 103, 1, now(), null, null, '清空操作'); -insert into sys_dict_data values(27, '000000', 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', '0', 103, 1, now(), null, null, '正常状态'); -insert into sys_dict_data values(28, '000000', 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 103, 1, now(), null, null, '停用状态'); -insert into sys_dict_data values(30, '000000', 0, '密码认证', 'password', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, now(), null, null, '密码认证'); -insert into sys_dict_data values(31, '000000', 0, '短信认证', 'sms', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, now(), null, null, '短信认证'); -insert into sys_dict_data values(32, '000000', 0, '邮件认证', 'email', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, now(), null, null, '邮件认证'); -insert into sys_dict_data values(33, '000000', 0, '小程序认证', 'xcx', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, now(), null, null, '小程序认证'); -insert into sys_dict_data values(34, '000000', 0, '三方登录认证', 'social', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, now(), null, null, '三方登录认证'); -insert into sys_dict_data values(35, '000000', 0, 'PC', 'pc', 'sys_device_type', '', 'default', 'N', '0', 103, 1, now(), null, null, 'PC'); -insert into sys_dict_data values(36, '000000', 0, '安卓', 'android', 'sys_device_type', '', 'default', 'N', '0', 103, 1, now(), null, null, '安卓'); -insert into sys_dict_data values(37, '000000', 0, 'iOS', 'ios', 'sys_device_type', '', 'default', 'N', '0', 103, 1, now(), null, null, 'iOS'); -insert into sys_dict_data values(38, '000000', 0, '小程序', 'xcx', 'sys_device_type', '', 'default', 'N', '0', 103, 1, now(), null, null, '小程序'); +insert into sys_dict_data values(1, '000000', 1, '男', '0', 'sys_user_sex', '', '', 'Y', 103, 1, now(), null, null, '性别男'); +insert into sys_dict_data values(2, '000000', 2, '女', '1', 'sys_user_sex', '', '', 'N', 103, 1, now(), null, null, '性别女'); +insert into sys_dict_data values(3, '000000', 3, '未知', '2', 'sys_user_sex', '', '', 'N', 103, 1, now(), null, null, '性别未知'); +insert into sys_dict_data values(4, '000000', 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', 103, 1, now(), null, null, '显示菜单'); +insert into sys_dict_data values(5, '000000', 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', 103, 1, now(), null, null, '隐藏菜单'); +insert into sys_dict_data values(6, '000000', 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', 103, 1, now(), null, null, '正常状态'); +insert into sys_dict_data values(7, '000000', 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', 103, 1, now(), null, null, '停用状态'); +insert into sys_dict_data values(12, '000000', 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', 103, 1, now(), null, null, '系统默认是'); +insert into sys_dict_data values(13, '000000', 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', 103, 1, now(), null, null, '系统默认否'); +insert into sys_dict_data values(14, '000000', 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', 103, 1, now(), null, null, '通知'); +insert into sys_dict_data values(15, '000000', 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', 103, 1, now(), null, null, '公告'); +insert into sys_dict_data values(16, '000000', 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', 103, 1, now(), null, null, '正常状态'); +insert into sys_dict_data values(17, '000000', 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', 103, 1, now(), null, null, '关闭状态'); +insert into sys_dict_data values(29, '000000', 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', 103, 1, now(), null, null, '其他操作'); +insert into sys_dict_data values(18, '000000', 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', 103, 1, now(), null, null, '新增操作'); +insert into sys_dict_data values(19, '000000', 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', 103, 1, now(), null, null, '修改操作'); +insert into sys_dict_data values(20, '000000', 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', 103, 1, now(), null, null, '删除操作'); +insert into sys_dict_data values(21, '000000', 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', 103, 1, now(), null, null, '授权操作'); +insert into sys_dict_data values(22, '000000', 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', 103, 1, now(), null, null, '导出操作'); +insert into sys_dict_data values(23, '000000', 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', 103, 1, now(), null, null, '导入操作'); +insert into sys_dict_data values(24, '000000', 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', 103, 1, now(), null, null, '强退操作'); +insert into sys_dict_data values(25, '000000', 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', 103, 1, now(), null, null, '生成操作'); +insert into sys_dict_data values(26, '000000', 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', 103, 1, now(), null, null, '清空操作'); +insert into sys_dict_data values(27, '000000', 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', 103, 1, now(), null, null, '正常状态'); +insert into sys_dict_data values(28, '000000', 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', 103, 1, now(), null, null, '停用状态'); +insert into sys_dict_data values(30, '000000', 0, '密码认证', 'password', 'sys_grant_type', '', 'default', 'N', 103, 1, now(), null, null, '密码认证'); +insert into sys_dict_data values(31, '000000', 0, '短信认证', 'sms', 'sys_grant_type', '', 'default', 'N', 103, 1, now(), null, null, '短信认证'); +insert into sys_dict_data values(32, '000000', 0, '邮件认证', 'email', 'sys_grant_type', '', 'default', 'N', 103, 1, now(), null, null, '邮件认证'); +insert into sys_dict_data values(33, '000000', 0, '小程序认证', 'xcx', 'sys_grant_type', '', 'default', 'N', 103, 1, now(), null, null, '小程序认证'); +insert into sys_dict_data values(34, '000000', 0, '三方登录认证', 'social', 'sys_grant_type', '', 'default', 'N', 103, 1, now(), null, null, '三方登录认证'); +insert into sys_dict_data values(35, '000000', 0, 'PC', 'pc', 'sys_device_type', '', 'default', 'N', 103, 1, now(), null, null, 'PC'); +insert into sys_dict_data values(36, '000000', 0, '安卓', 'android', 'sys_device_type', '', 'default', 'N', 103, 1, now(), null, null, '安卓'); +insert into sys_dict_data values(37, '000000', 0, 'iOS', 'ios', 'sys_device_type', '', 'default', 'N', 103, 1, now(), null, null, 'iOS'); +insert into sys_dict_data values(38, '000000', 0, '小程序', 'xcx', 'sys_device_type', '', 'default', 'N', 103, 1, now(), null, null, '小程序'); -- ---------------------------- diff --git a/script/sql/ry_vue_5.X.sql b/script/sql/ry_vue_5.X.sql index 745f9a078..2b8e18903 100644 --- a/script/sql/ry_vue_5.X.sql +++ b/script/sql/ry_vue_5.X.sql @@ -582,7 +582,6 @@ create table sys_dict_type tenant_id varchar(20) default '000000' comment '租户编号', dict_name varchar(100) default '' comment '字典名称', dict_type varchar(100) default '' comment '字典类型', - status char(1) default '0' comment '状态(0正常 1停用)', create_dept bigint(20) default null comment '创建部门', create_by bigint(20) default null comment '创建者', create_time datetime comment '创建时间', @@ -593,16 +592,16 @@ create table sys_dict_type unique (tenant_id, dict_type) ) engine=innodb comment = '字典类型表'; -insert into sys_dict_type values(1, '000000', '用户性别', 'sys_user_sex', '0', 103, 1, sysdate(), null, null, '用户性别列表'); -insert into sys_dict_type values(2, '000000', '菜单状态', 'sys_show_hide', '0', 103, 1, sysdate(), null, null, '菜单状态列表'); -insert into sys_dict_type values(3, '000000', '系统开关', 'sys_normal_disable', '0', 103, 1, sysdate(), null, null, '系统开关列表'); -insert into sys_dict_type values(6, '000000', '系统是否', 'sys_yes_no', '0', 103, 1, sysdate(), null, null, '系统是否列表'); -insert into sys_dict_type values(7, '000000', '通知类型', 'sys_notice_type', '0', 103, 1, sysdate(), null, null, '通知类型列表'); -insert into sys_dict_type values(8, '000000', '通知状态', 'sys_notice_status', '0', 103, 1, sysdate(), null, null, '通知状态列表'); -insert into sys_dict_type values(9, '000000', '操作类型', 'sys_oper_type', '0', 103, 1, sysdate(), null, null, '操作类型列表'); -insert into sys_dict_type values(10, '000000', '系统状态', 'sys_common_status', '0', 103, 1, sysdate(), null, null, '登录状态列表'); -insert into sys_dict_type values(11, '000000', '授权类型', 'sys_grant_type', '0', 103, 1, sysdate(), null, null, '认证授权类型'); -insert into sys_dict_type values(12, '000000', '设备类型', 'sys_device_type', '0', 103, 1, sysdate(), null, null, '客户端设备类型'); +insert into sys_dict_type values(1, '000000', '用户性别', 'sys_user_sex', 103, 1, sysdate(), null, null, '用户性别列表'); +insert into sys_dict_type values(2, '000000', '菜单状态', 'sys_show_hide', 103, 1, sysdate(), null, null, '菜单状态列表'); +insert into sys_dict_type values(3, '000000', '系统开关', 'sys_normal_disable', 103, 1, sysdate(), null, null, '系统开关列表'); +insert into sys_dict_type values(6, '000000', '系统是否', 'sys_yes_no', 103, 1, sysdate(), null, null, '系统是否列表'); +insert into sys_dict_type values(7, '000000', '通知类型', 'sys_notice_type', 103, 1, sysdate(), null, null, '通知类型列表'); +insert into sys_dict_type values(8, '000000', '通知状态', 'sys_notice_status', 103, 1, sysdate(), null, null, '通知状态列表'); +insert into sys_dict_type values(9, '000000', '操作类型', 'sys_oper_type', 103, 1, sysdate(), null, null, '操作类型列表'); +insert into sys_dict_type values(10, '000000', '系统状态', 'sys_common_status', 103, 1, sysdate(), null, null, '登录状态列表'); +insert into sys_dict_type values(11, '000000', '授权类型', 'sys_grant_type', 103, 1, sysdate(), null, null, '认证授权类型'); +insert into sys_dict_type values(12, '000000', '设备类型', 'sys_device_type', 103, 1, sysdate(), null, null, '客户端设备类型'); -- ---------------------------- @@ -620,7 +619,6 @@ create table sys_dict_data css_class varchar(100) default null comment '样式属性(其他样式扩展)', list_class varchar(100) default null comment '表格回显样式', is_default char(1) default 'N' comment '是否默认(Y是 N否)', - status char(1) default '0' comment '状态(0正常 1停用)', create_dept bigint(20) default null comment '创建部门', create_by bigint(20) default null comment '创建者', create_time datetime comment '创建时间', @@ -630,40 +628,40 @@ create table sys_dict_data primary key (dict_code) ) engine=innodb comment = '字典数据表'; -insert into sys_dict_data values(1, '000000', 1, '男', '0', 'sys_user_sex', '', '', 'Y', '0', 103, 1, sysdate(), null, null, '性别男'); -insert into sys_dict_data values(2, '000000', 2, '女', '1', 'sys_user_sex', '', '', 'N', '0', 103, 1, sysdate(), null, null, '性别女'); -insert into sys_dict_data values(3, '000000', 3, '未知', '2', 'sys_user_sex', '', '', 'N', '0', 103, 1, sysdate(), null, null, '性别未知'); -insert into sys_dict_data values(4, '000000', 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', '0', 103, 1, sysdate(), null, null, '显示菜单'); -insert into sys_dict_data values(5, '000000', 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', '0', 103, 1, sysdate(), null, null, '隐藏菜单'); -insert into sys_dict_data values(6, '000000', 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', '0', 103, 1, sysdate(), null, null, '正常状态'); -insert into sys_dict_data values(7, '000000', 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', '0', 103, 1, sysdate(), null, null, '停用状态'); -insert into sys_dict_data values(12, '000000', 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', '0', 103, 1, sysdate(), null, null, '系统默认是'); -insert into sys_dict_data values(13, '000000', 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', '0', 103, 1, sysdate(), null, null, '系统默认否'); -insert into sys_dict_data values(14, '000000', 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', '0', 103, 1, sysdate(), null, null, '通知'); -insert into sys_dict_data values(15, '000000', 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', '0', 103, 1, sysdate(), null, null, '公告'); -insert into sys_dict_data values(16, '000000', 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', '0', 103, 1, sysdate(), null, null, '正常状态'); -insert into sys_dict_data values(17, '000000', 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', '0', 103, 1, sysdate(), null, null, '关闭状态'); -insert into sys_dict_data values(29, '000000', 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', '0', 103, 1, sysdate(), null, null, '其他操作'); -insert into sys_dict_data values(18, '000000', 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', '0', 103, 1, sysdate(), null, null, '新增操作'); -insert into sys_dict_data values(19, '000000', 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', '0', 103, 1, sysdate(), null, null, '修改操作'); -insert into sys_dict_data values(20, '000000', 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', '0', 103, 1, sysdate(), null, null, '删除操作'); -insert into sys_dict_data values(21, '000000', 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', '0', 103, 1, sysdate(), null, null, '授权操作'); -insert into sys_dict_data values(22, '000000', 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', '0', 103, 1, sysdate(), null, null, '导出操作'); -insert into sys_dict_data values(23, '000000', 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', '0', 103, 1, sysdate(), null, null, '导入操作'); -insert into sys_dict_data values(24, '000000', 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', '0', 103, 1, sysdate(), null, null, '强退操作'); -insert into sys_dict_data values(25, '000000', 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', '0', 103, 1, sysdate(), null, null, '生成操作'); -insert into sys_dict_data values(26, '000000', 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', '0', 103, 1, sysdate(), null, null, '清空操作'); -insert into sys_dict_data values(27, '000000', 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', '0', 103, 1, sysdate(), null, null, '正常状态'); -insert into sys_dict_data values(28, '000000', 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 103, 1, sysdate(), null, null, '停用状态'); -insert into sys_dict_data values(30, '000000', 0, '密码认证', 'password', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, sysdate(), null, null, '密码认证'); -insert into sys_dict_data values(31, '000000', 0, '短信认证', 'sms', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, sysdate(), null, null, '短信认证'); -insert into sys_dict_data values(32, '000000', 0, '邮件认证', 'email', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, sysdate(), null, null, '邮件认证'); -insert into sys_dict_data values(33, '000000', 0, '小程序认证', 'xcx', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, sysdate(), null, null, '小程序认证'); -insert into sys_dict_data values(34, '000000', 0, '三方登录认证', 'social', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, sysdate(), null, null, '三方登录认证'); -insert into sys_dict_data values(35, '000000', 0, 'PC', 'pc', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate(), null, null, 'PC'); -insert into sys_dict_data values(36, '000000', 0, '安卓', 'android', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate(), null, null, '安卓'); -insert into sys_dict_data values(37, '000000', 0, 'iOS', 'ios', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate(), null, null, 'iOS'); -insert into sys_dict_data values(38, '000000', 0, '小程序', 'xcx', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate(), null, null, '小程序'); +insert into sys_dict_data values(1, '000000', 1, '男', '0', 'sys_user_sex', '', '', 'Y', 103, 1, sysdate(), null, null, '性别男'); +insert into sys_dict_data values(2, '000000', 2, '女', '1', 'sys_user_sex', '', '', 'N', 103, 1, sysdate(), null, null, '性别女'); +insert into sys_dict_data values(3, '000000', 3, '未知', '2', 'sys_user_sex', '', '', 'N', 103, 1, sysdate(), null, null, '性别未知'); +insert into sys_dict_data values(4, '000000', 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', 103, 1, sysdate(), null, null, '显示菜单'); +insert into sys_dict_data values(5, '000000', 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', 103, 1, sysdate(), null, null, '隐藏菜单'); +insert into sys_dict_data values(6, '000000', 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', 103, 1, sysdate(), null, null, '正常状态'); +insert into sys_dict_data values(7, '000000', 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', 103, 1, sysdate(), null, null, '停用状态'); +insert into sys_dict_data values(12, '000000', 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', 103, 1, sysdate(), null, null, '系统默认是'); +insert into sys_dict_data values(13, '000000', 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', 103, 1, sysdate(), null, null, '系统默认否'); +insert into sys_dict_data values(14, '000000', 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', 103, 1, sysdate(), null, null, '通知'); +insert into sys_dict_data values(15, '000000', 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', 103, 1, sysdate(), null, null, '公告'); +insert into sys_dict_data values(16, '000000', 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', 103, 1, sysdate(), null, null, '正常状态'); +insert into sys_dict_data values(17, '000000', 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', 103, 1, sysdate(), null, null, '关闭状态'); +insert into sys_dict_data values(29, '000000', 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', 103, 1, sysdate(), null, null, '其他操作'); +insert into sys_dict_data values(18, '000000', 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', 103, 1, sysdate(), null, null, '新增操作'); +insert into sys_dict_data values(19, '000000', 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', 103, 1, sysdate(), null, null, '修改操作'); +insert into sys_dict_data values(20, '000000', 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', 103, 1, sysdate(), null, null, '删除操作'); +insert into sys_dict_data values(21, '000000', 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', 103, 1, sysdate(), null, null, '授权操作'); +insert into sys_dict_data values(22, '000000', 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', 103, 1, sysdate(), null, null, '导出操作'); +insert into sys_dict_data values(23, '000000', 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', 103, 1, sysdate(), null, null, '导入操作'); +insert into sys_dict_data values(24, '000000', 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', 103, 1, sysdate(), null, null, '强退操作'); +insert into sys_dict_data values(25, '000000', 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', 103, 1, sysdate(), null, null, '生成操作'); +insert into sys_dict_data values(26, '000000', 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', 103, 1, sysdate(), null, null, '清空操作'); +insert into sys_dict_data values(27, '000000', 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', 103, 1, sysdate(), null, null, '正常状态'); +insert into sys_dict_data values(28, '000000', 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', 103, 1, sysdate(), null, null, '停用状态'); +insert into sys_dict_data values(30, '000000', 0, '密码认证', 'password', 'sys_grant_type', '', 'default', 'N', 103, 1, sysdate(), null, null, '密码认证'); +insert into sys_dict_data values(31, '000000', 0, '短信认证', 'sms', 'sys_grant_type', '', 'default', 'N', 103, 1, sysdate(), null, null, '短信认证'); +insert into sys_dict_data values(32, '000000', 0, '邮件认证', 'email', 'sys_grant_type', '', 'default', 'N', 103, 1, sysdate(), null, null, '邮件认证'); +insert into sys_dict_data values(33, '000000', 0, '小程序认证', 'xcx', 'sys_grant_type', '', 'default', 'N', 103, 1, sysdate(), null, null, '小程序认证'); +insert into sys_dict_data values(34, '000000', 0, '三方登录认证', 'social', 'sys_grant_type', '', 'default', 'N', 103, 1, sysdate(), null, null, '三方登录认证'); +insert into sys_dict_data values(35, '000000', 0, 'PC', 'pc', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate(), null, null, 'PC'); +insert into sys_dict_data values(36, '000000', 0, '安卓', 'android', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate(), null, null, '安卓'); +insert into sys_dict_data values(37, '000000', 0, 'iOS', 'ios', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate(), null, null, 'iOS'); +insert into sys_dict_data values(38, '000000', 0, '小程序', 'xcx', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate(), null, null, '小程序'); -- ---------------------------- diff --git a/script/sql/sqlserver/sqlserver_ry_vue_5.X.sql b/script/sql/sqlserver/sqlserver_ry_vue_5.X.sql index d90f02d31..3fb84049a 100644 --- a/script/sql/sqlserver/sqlserver_ry_vue_5.X.sql +++ b/script/sql/sqlserver/sqlserver_ry_vue_5.X.sql @@ -1079,7 +1079,6 @@ CREATE TABLE sys_dict_data css_class nvarchar(100) NULL, list_class nvarchar(100) NULL, is_default nchar(1) DEFAULT ('N') NULL, - status nchar(1) DEFAULT ('0') NULL, create_dept bigint NULL, create_by bigint NULL, create_time datetime2(7) NULL, @@ -1147,12 +1146,6 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_dict_data', 'COLUMN', N'is_default' GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'状态(0正常 1停用)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_data', - 'COLUMN', N'status' -GO EXEC sys.sp_addextendedproperty 'MS_Description', N'创建部门' , 'SCHEMA', N'dbo', @@ -1195,81 +1188,81 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_dict_data' GO -INSERT sys_dict_data VALUES (1, N'000000', 1, N'男', N'0', N'sys_user_sex', N'', N'', N'Y', N'0', 103, 1, getdate(), NULL, NULL, N'性别男') +INSERT sys_dict_data VALUES (1, N'000000', 1, N'男', N'0', N'sys_user_sex', N'', N'', N'Y', 103, 1, getdate(), NULL, NULL, N'性别男') GO -INSERT sys_dict_data VALUES (2, N'000000', 2, N'女', N'1', N'sys_user_sex', N'', N'', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'性别女') +INSERT sys_dict_data VALUES (2, N'000000', 2, N'女', N'1', N'sys_user_sex', N'', N'', N'N', 103, 1, getdate(), NULL, NULL, N'性别女') GO -INSERT sys_dict_data VALUES (3, N'000000', 3, N'未知', N'2', N'sys_user_sex', N'', N'', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'性别未知') +INSERT sys_dict_data VALUES (3, N'000000', 3, N'未知', N'2', N'sys_user_sex', N'', N'', N'N', 103, 1, getdate(), NULL, NULL, N'性别未知') GO -INSERT sys_dict_data VALUES (4, N'000000', 1, N'显示', N'0', N'sys_show_hide', N'', N'primary', N'Y', N'0', 103, 1, getdate(), NULL, NULL, N'显示菜单') +INSERT sys_dict_data VALUES (4, N'000000', 1, N'显示', N'0', N'sys_show_hide', N'', N'primary', N'Y', 103, 1, getdate(), NULL, NULL, N'显示菜单') GO -INSERT sys_dict_data VALUES (5, N'000000', 2, N'隐藏', N'1', N'sys_show_hide', N'', N'danger', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'隐藏菜单') +INSERT sys_dict_data VALUES (5, N'000000', 2, N'隐藏', N'1', N'sys_show_hide', N'', N'danger', N'N', 103, 1, getdate(), NULL, NULL, N'隐藏菜单') GO -INSERT sys_dict_data VALUES (6, N'000000', 1, N'正常', N'0', N'sys_normal_disable', N'', N'primary', N'Y', N'0', 103, 1, getdate(), NULL, NULL, N'正常状态') +INSERT sys_dict_data VALUES (6, N'000000', 1, N'正常', N'0', N'sys_normal_disable', N'', N'primary', N'Y', 103, 1, getdate(), NULL, NULL, N'正常状态') GO -INSERT sys_dict_data VALUES (7, N'000000', 2, N'停用', N'1', N'sys_normal_disable', N'', N'danger', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'停用状态') +INSERT sys_dict_data VALUES (7, N'000000', 2, N'停用', N'1', N'sys_normal_disable', N'', N'danger', N'N', 103, 1, getdate(), NULL, NULL, N'停用状态') GO -INSERT sys_dict_data VALUES (8, N'000000', 1, N'正常', N'0', N'sys_job_status', N'', N'primary', N'Y', N'0', 103, 1, getdate(), NULL, NULL, N'正常状态') +INSERT sys_dict_data VALUES (8, N'000000', 1, N'正常', N'0', N'sys_job_status', N'', N'primary', N'Y', 103, 1, getdate(), NULL, NULL, N'正常状态') GO -INSERT sys_dict_data VALUES (9, N'000000', 2, N'暂停', N'1', N'sys_job_status', N'', N'danger', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'停用状态') +INSERT sys_dict_data VALUES (9, N'000000', 2, N'暂停', N'1', N'sys_job_status', N'', N'danger', N'N', 103, 1, getdate(), NULL, NULL, N'停用状态') GO -INSERT sys_dict_data VALUES (10, N'000000', 1, N'默认', N'DEFAULT', N'sys_job_group', N'', N'', N'Y', N'0', 103, 1, getdate(), NULL, NULL, N'默认分组') +INSERT sys_dict_data VALUES (10, N'000000', 1, N'默认', N'DEFAULT', N'sys_job_group', N'', N'', N'Y', 103, 1, getdate(), NULL, NULL, N'默认分组') GO -INSERT sys_dict_data VALUES (11, N'000000', 2, N'系统', N'SYSTEM', N'sys_job_group', N'', N'', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'系统分组') +INSERT sys_dict_data VALUES (11, N'000000', 2, N'系统', N'SYSTEM', N'sys_job_group', N'', N'', N'N', 103, 1, getdate(), NULL, NULL, N'系统分组') GO -INSERT sys_dict_data VALUES (12, N'000000', 1, N'是', N'Y', N'sys_yes_no', N'', N'primary', N'Y', N'0', 103, 1, getdate(), NULL, NULL, N'系统默认是') +INSERT sys_dict_data VALUES (12, N'000000', 1, N'是', N'Y', N'sys_yes_no', N'', N'primary', N'Y', 103, 1, getdate(), NULL, NULL, N'系统默认是') GO -INSERT sys_dict_data VALUES (13, N'000000', 2, N'否', N'N', N'sys_yes_no', N'', N'danger', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'系统默认否') +INSERT sys_dict_data VALUES (13, N'000000', 2, N'否', N'N', N'sys_yes_no', N'', N'danger', N'N', 103, 1, getdate(), NULL, NULL, N'系统默认否') GO -INSERT sys_dict_data VALUES (14, N'000000', 1, N'通知', N'1', N'sys_notice_type', N'', N'warning', N'Y', N'0', 103, 1, getdate(), NULL, NULL, N'通知') +INSERT sys_dict_data VALUES (14, N'000000', 1, N'通知', N'1', N'sys_notice_type', N'', N'warning', N'Y', 103, 1, getdate(), NULL, NULL, N'通知') GO -INSERT sys_dict_data VALUES (15, N'000000', 2, N'公告', N'2', N'sys_notice_type', N'', N'success', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'公告') +INSERT sys_dict_data VALUES (15, N'000000', 2, N'公告', N'2', N'sys_notice_type', N'', N'success', N'N', 103, 1, getdate(), NULL, NULL, N'公告') GO -INSERT sys_dict_data VALUES (16, N'000000', 1, N'正常', N'0', N'sys_notice_status', N'', N'primary', N'Y', N'0', 103, 1, getdate(), NULL, NULL, N'正常状态') +INSERT sys_dict_data VALUES (16, N'000000', 1, N'正常', N'0', N'sys_notice_status', N'', N'primary', N'Y', 103, 1, getdate(), NULL, NULL, N'正常状态') GO -INSERT sys_dict_data VALUES (17, N'000000', 2, N'关闭', N'1', N'sys_notice_status', N'', N'danger', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'关闭状态') +INSERT sys_dict_data VALUES (17, N'000000', 2, N'关闭', N'1', N'sys_notice_status', N'', N'danger', N'N', 103, 1, getdate(), NULL, NULL, N'关闭状态') GO -INSERT sys_dict_data VALUES (29, N'000000', 99, N'其他', N'0', N'sys_oper_type', N'', N'info', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'其他操作'); +INSERT sys_dict_data VALUES (29, N'000000', 99, N'其他', N'0', N'sys_oper_type', N'', N'info', N'N', 103, 1, getdate(), NULL, NULL, N'其他操作'); GO -INSERT sys_dict_data VALUES (18, N'000000', 1, N'新增', N'1', N'sys_oper_type', N'', N'info', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'新增操作') +INSERT sys_dict_data VALUES (18, N'000000', 1, N'新增', N'1', N'sys_oper_type', N'', N'info', N'N', 103, 1, getdate(), NULL, NULL, N'新增操作') GO -INSERT sys_dict_data VALUES (19, N'000000', 2, N'修改', N'2', N'sys_oper_type', N'', N'info', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'修改操作') +INSERT sys_dict_data VALUES (19, N'000000', 2, N'修改', N'2', N'sys_oper_type', N'', N'info', N'N', 103, 1, getdate(), NULL, NULL, N'修改操作') GO -INSERT sys_dict_data VALUES (20, N'000000', 3, N'删除', N'3', N'sys_oper_type', N'', N'danger', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'删除操作') +INSERT sys_dict_data VALUES (20, N'000000', 3, N'删除', N'3', N'sys_oper_type', N'', N'danger', N'N', 103, 1, getdate(), NULL, NULL, N'删除操作') GO -INSERT sys_dict_data VALUES (21, N'000000', 4, N'授权', N'4', N'sys_oper_type', N'', N'primary', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'授权操作') +INSERT sys_dict_data VALUES (21, N'000000', 4, N'授权', N'4', N'sys_oper_type', N'', N'primary', N'N', 103, 1, getdate(), NULL, NULL, N'授权操作') GO -INSERT sys_dict_data VALUES (22, N'000000', 5, N'导出', N'5', N'sys_oper_type', N'', N'warning', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'导出操作') +INSERT sys_dict_data VALUES (22, N'000000', 5, N'导出', N'5', N'sys_oper_type', N'', N'warning', N'N', 103, 1, getdate(), NULL, NULL, N'导出操作') GO -INSERT sys_dict_data VALUES (23, N'000000', 6, N'导入', N'6', N'sys_oper_type', N'', N'warning', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'导入操作') +INSERT sys_dict_data VALUES (23, N'000000', 6, N'导入', N'6', N'sys_oper_type', N'', N'warning', N'N', 103, 1, getdate(), NULL, NULL, N'导入操作') GO -INSERT sys_dict_data VALUES (24, N'000000', 7, N'强退', N'7', N'sys_oper_type', N'', N'danger', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'强退操作') +INSERT sys_dict_data VALUES (24, N'000000', 7, N'强退', N'7', N'sys_oper_type', N'', N'danger', N'N', 103, 1, getdate(), NULL, NULL, N'强退操作') GO -INSERT sys_dict_data VALUES (25, N'000000', 8, N'生成代码', N'8', N'sys_oper_type', N'', N'warning', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'生成操作') +INSERT sys_dict_data VALUES (25, N'000000', 8, N'生成代码', N'8', N'sys_oper_type', N'', N'warning', N'N', 103, 1, getdate(), NULL, NULL, N'生成操作') GO -INSERT sys_dict_data VALUES (26, N'000000', 9, N'清空数据', N'9', N'sys_oper_type', N'', N'danger', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'清空操作') +INSERT sys_dict_data VALUES (26, N'000000', 9, N'清空数据', N'9', N'sys_oper_type', N'', N'danger', N'N', 103, 1, getdate(), NULL, NULL, N'清空操作') GO -INSERT sys_dict_data VALUES (27, N'000000', 1, N'成功', N'0', N'sys_common_status', N'', N'primary', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'正常状态') +INSERT sys_dict_data VALUES (27, N'000000', 1, N'成功', N'0', N'sys_common_status', N'', N'primary', N'N', 103, 1, getdate(), NULL, NULL, N'正常状态') GO -INSERT sys_dict_data VALUES (28, N'000000', 2, N'失败', N'1', N'sys_common_status', N'', N'danger', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'停用状态') +INSERT sys_dict_data VALUES (28, N'000000', 2, N'失败', N'1', N'sys_common_status', N'', N'danger', N'N', 103, 1, getdate(), NULL, NULL, N'停用状态') GO -INSERT sys_dict_data VALUES (30, N'000000', 0, N'密码认证', N'password', N'sys_grant_type', N'', N'default', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'密码认证') +INSERT sys_dict_data VALUES (30, N'000000', 0, N'密码认证', N'password', N'sys_grant_type', N'', N'default', N'N', 103, 1, getdate(), NULL, NULL, N'密码认证') GO -INSERT sys_dict_data VALUES (31, N'000000', 0, N'短信认证', N'sms', N'sys_grant_type', N'', N'default', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'短信认证') +INSERT sys_dict_data VALUES (31, N'000000', 0, N'短信认证', N'sms', N'sys_grant_type', N'', N'default', N'N', 103, 1, getdate(), NULL, NULL, N'短信认证') GO -INSERT sys_dict_data VALUES (32, N'000000', 0, N'邮件认证', N'email', N'sys_grant_type', N'', N'default', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'邮件认证') +INSERT sys_dict_data VALUES (32, N'000000', 0, N'邮件认证', N'email', N'sys_grant_type', N'', N'default', N'N', 103, 1, getdate(), NULL, NULL, N'邮件认证') GO -INSERT sys_dict_data VALUES (33, N'000000', 0, N'小程序认证', N'xcx', N'sys_grant_type', N'', N'default', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'小程序认证') +INSERT sys_dict_data VALUES (33, N'000000', 0, N'小程序认证', N'xcx', N'sys_grant_type', N'', N'default', N'N', 103, 1, getdate(), NULL, NULL, N'小程序认证') GO -INSERT sys_dict_data VALUES (34, N'000000', 0, N'三方登录认证', N'`social`', N'sys_grant_type', N'', N'default', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'三方登录认证') +INSERT sys_dict_data VALUES (34, N'000000', 0, N'三方登录认证', N'`social`', N'sys_grant_type', N'', N'default', N'N', 103, 1, getdate(), NULL, NULL, N'三方登录认证') GO -INSERT sys_dict_data VALUES (35, N'000000', 0, N'PC', N'`pc`', N'sys_device_type', N'', N'default', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'PC') +INSERT sys_dict_data VALUES (35, N'000000', 0, N'PC', N'`pc`', N'sys_device_type', N'', N'default', N'N', 103, 1, getdate(), NULL, NULL, N'PC') GO -INSERT sys_dict_data VALUES (36, N'000000', 0, N'安卓', N'`android`', N'sys_device_type', N'', N'default', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'安卓') +INSERT sys_dict_data VALUES (36, N'000000', 0, N'安卓', N'`android`', N'sys_device_type', N'', N'default', N'N', 103, 1, getdate(), NULL, NULL, N'安卓') GO -INSERT sys_dict_data VALUES (37, N'000000', 0, N'iOS', N'`ios`', N'sys_device_type', N'', N'default', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'iOS') +INSERT sys_dict_data VALUES (37, N'000000', 0, N'iOS', N'`ios`', N'sys_device_type', N'', N'default', N'N', 103, 1, getdate(), NULL, NULL, N'iOS') GO -INSERT sys_dict_data VALUES (38, N'000000', 0, N'小程序', N'`xcx`', N'sys_device_type', N'', N'default', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'小程序') +INSERT sys_dict_data VALUES (38, N'000000', 0, N'小程序', N'`xcx`', N'sys_device_type', N'', N'default', N'N', 103, 1, getdate(), NULL, NULL, N'小程序') GO CREATE TABLE sys_dict_type @@ -1278,7 +1271,6 @@ CREATE TABLE sys_dict_type tenant_id nvarchar(20) DEFAULT ('000000') NULL, dict_name nvarchar(100) DEFAULT '' NULL, dict_type nvarchar(100) DEFAULT '' NULL, - status nchar(1) DEFAULT ('0') NULL, create_dept bigint NULL, create_by bigint NULL, create_time datetime2(7) NULL, @@ -1319,12 +1311,6 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_dict_type', 'COLUMN', N'dict_type' GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'状态(0正常 1停用)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_type', - 'COLUMN', N'status' -GO EXEC sys.sp_addextendedproperty 'MS_Description', N'创建部门' , 'SCHEMA', N'dbo', @@ -1367,29 +1353,29 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_dict_type' GO -INSERT sys_dict_type VALUES (1, N'000000', N'用户性别', N'sys_user_sex', N'0', 103, 1, getdate(), NULL, NULL, N'用户性别列表') +INSERT sys_dict_type VALUES (1, N'000000', N'用户性别', N'sys_user_sex', 103, 1, getdate(), NULL, NULL, N'用户性别列表') GO -INSERT sys_dict_type VALUES (2, N'000000', N'菜单状态', N'sys_show_hide', N'0', 103, 1, getdate(), NULL, NULL, N'菜单状态列表') +INSERT sys_dict_type VALUES (2, N'000000', N'菜单状态', N'sys_show_hide', 103, 1, getdate(), NULL, NULL, N'菜单状态列表') GO -INSERT sys_dict_type VALUES (3, N'000000', N'系统开关', N'sys_normal_disable', N'0', 103, 1, getdate(), NULL, NULL, N'系统开关列表') +INSERT sys_dict_type VALUES (3, N'000000', N'系统开关', N'sys_normal_disable', 103, 1, getdate(), NULL, NULL, N'系统开关列表') GO -INSERT sys_dict_type VALUES (4, N'000000', N'任务状态', N'sys_job_status', N'0', 103, 1, getdate(), NULL, NULL, N'任务状态列表') +INSERT sys_dict_type VALUES (4, N'000000', N'任务状态', N'sys_job_status', 103, 1, getdate(), NULL, NULL, N'任务状态列表') GO -INSERT sys_dict_type VALUES (5, N'000000', N'任务分组', N'sys_job_group', N'0', 103, 1, getdate(), NULL, NULL, N'任务分组列表') +INSERT sys_dict_type VALUES (5, N'000000', N'任务分组', N'sys_job_group', 103, 1, getdate(), NULL, NULL, N'任务分组列表') GO -INSERT sys_dict_type VALUES (6, N'000000', N'系统是否', N'sys_yes_no', N'0', 103, 1, getdate(), NULL, NULL, N'系统是否列表') +INSERT sys_dict_type VALUES (6, N'000000', N'系统是否', N'sys_yes_no', 103, 1, getdate(), NULL, NULL, N'系统是否列表') GO -INSERT sys_dict_type VALUES (7, N'000000', N'通知类型', N'sys_notice_type', N'0', 103, 1, getdate(), NULL, NULL, N'通知类型列表') +INSERT sys_dict_type VALUES (7, N'000000', N'通知类型', N'sys_notice_type', 103, 1, getdate(), NULL, NULL, N'通知类型列表') GO -INSERT sys_dict_type VALUES (8, N'000000', N'通知状态', N'sys_notice_status', N'0', 103, 1, getdate(), NULL, NULL, N'通知状态列表') +INSERT sys_dict_type VALUES (8, N'000000', N'通知状态', N'sys_notice_status', 103, 1, getdate(), NULL, NULL, N'通知状态列表') GO -INSERT sys_dict_type VALUES (9, N'000000', N'操作类型', N'sys_oper_type', N'0', 103, 1, getdate(), NULL, NULL, N'操作类型列表') +INSERT sys_dict_type VALUES (9, N'000000', N'操作类型', N'sys_oper_type', 103, 1, getdate(), NULL, NULL, N'操作类型列表') GO -INSERT sys_dict_type VALUES (10, N'000000', N'系统状态', N'sys_common_status', N'0', 103, 1, getdate(), NULL, NULL, N'登录状态列表') +INSERT sys_dict_type VALUES (10, N'000000', N'系统状态', N'sys_common_status', 103, 1, getdate(), NULL, NULL, N'登录状态列表') GO -INSERT sys_dict_type VALUES (11, N'000000', N'授权类型', N'sys_grant_type', N'0', 103, 1, getdate(), NULL, NULL, N'认证授权类型') +INSERT sys_dict_type VALUES (11, N'000000', N'授权类型', N'sys_grant_type', 103, 1, getdate(), NULL, NULL, N'认证授权类型') GO -INSERT sys_dict_type VALUES (12, N'000000', N'设备类型', N'sys_device_type', N'0', 103, 1, getdate(), NULL, NULL, N'客户端设备类型') +INSERT sys_dict_type VALUES (12, N'000000', N'设备类型', N'sys_device_type', 103, 1, getdate(), NULL, NULL, N'客户端设备类型') GO CREATE TABLE sys_logininfor From afdc4b103d76b3335ced088e66ab42569003969e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Mon, 7 Aug 2023 17:41:11 +0800 Subject: [PATCH 14/29] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E4=B8=8E=E8=A7=92=E8=89=B2=E5=A6=82=E6=9E=9C=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E4=BA=86=E7=94=A8=E6=88=B7=E5=88=99=E4=B8=8D=E5=85=81?= =?UTF-8?q?=E8=AE=B8=E7=A6=81=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/controller/system/SysDeptController.java | 9 ++++++--- .../dromara/system/service/impl/SysRoleServiceImpl.java | 5 ++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysDeptController.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysDeptController.java index 478ac6e9a..130c0d1f3 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysDeptController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysDeptController.java @@ -92,9 +92,12 @@ public class SysDeptController extends BaseController { return R.fail("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在"); } else if (dept.getParentId().equals(deptId)) { return R.fail("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己"); - } else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) - && deptService.selectNormalChildrenDeptById(deptId) > 0) { - return R.fail("该部门包含未停用的子部门!"); + } else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus())) { + if (deptService.selectNormalChildrenDeptById(deptId) > 0) { + return R.fail("该部门包含未停用的子部门!"); + } else if (deptService.checkDeptExistUser(deptId)) { + return R.fail("该部门下存在已分配用户,不能禁用!"); + } } return toAjax(deptService.updateDept(dept)); } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysRoleServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysRoleServiceImpl.java index 7b8e8f9b7..79fada231 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysRoleServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysRoleServiceImpl.java @@ -283,6 +283,9 @@ public class SysRoleServiceImpl implements ISysRoleService { */ @Override public int updateRoleStatus(Long roleId, String status) { + if (UserConstants.ROLE_DISABLE.equals(status) && this.countUserRoleByRoleId(roleId) > 0) { + throw new ServiceException("角色已分配,不能禁用!"); + } return baseMapper.update(null, new LambdaUpdateWrapper() .set(SysRole::getStatus, status) @@ -379,7 +382,7 @@ public class SysRoleServiceImpl implements ISysRoleService { checkRoleAllowed(BeanUtil.toBean(role, SysRoleBo.class)); checkRoleDataScope(roleId); if (countUserRoleByRoleId(roleId) > 0) { - throw new ServiceException(String.format("%1$s已分配,不能删除", role.getRoleName())); + throw new ServiceException(String.format("%1$s已分配,不能删除!", role.getRoleName())); } } List ids = Arrays.asList(roleIds); From ae0d4dd6e574367b5b89a06be90b00f2eb1e40ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Mon, 7 Aug 2023 18:01:22 +0800 Subject: [PATCH 15/29] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E5=B2=97?= =?UTF-8?q?=E4=BD=8D=E5=A6=82=E6=9E=9C=E7=BB=91=E5=AE=9A=E4=BA=86=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=88=99=E4=B8=8D=E5=85=81=E8=AE=B8=E7=A6=81=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dromara/common/core/constant/UserConstants.java | 10 ++++++++++ .../system/controller/system/SysPostController.java | 8 +++++++- .../system/service/impl/SysPostServiceImpl.java | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/constant/UserConstants.java b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/constant/UserConstants.java index c78adc2a5..6f3b0b96b 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/constant/UserConstants.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/constant/UserConstants.java @@ -52,6 +52,16 @@ public interface UserConstants { */ String DEPT_DISABLE = "1"; + /** + * 岗位正常状态 + */ + String POST_NORMAL = "0"; + + /** + * 岗位停用状态 + */ + String POST_DISABLE = "1"; + /** * 字典正常状态 */ diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysPostController.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysPostController.java index 28e56a2f2..fe62fdbbc 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysPostController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysPostController.java @@ -1,6 +1,7 @@ package org.dromara.system.controller.system; import cn.dev33.satoken.annotation.SaCheckPermission; +import org.dromara.common.core.constant.UserConstants; import org.dromara.common.core.domain.R; import org.dromara.common.excel.utils.ExcelUtil; import org.dromara.common.log.annotation.Log; @@ -88,6 +89,9 @@ public class SysPostController extends BaseController { return R.fail("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在"); } else if (!postService.checkPostCodeUnique(post)) { return R.fail("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在"); + } else if (UserConstants.POST_DISABLE.equals(post.getStatus()) + && postService.countUserPostById(post.getPostId()) > 0) { + return R.fail("该岗位下存在已分配用户,不能禁用!"); } return toAjax(postService.updatePost(post)); } @@ -109,7 +113,9 @@ public class SysPostController extends BaseController { */ @GetMapping("/optionselect") public R> optionselect() { - List posts = postService.selectPostAll(); + SysPostBo postBo = new SysPostBo(); + postBo.setStatus(UserConstants.POST_NORMAL); + List posts = postService.selectPostList(postBo); return R.ok(posts); } } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysPostServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysPostServiceImpl.java index d9529e702..b69a06c5f 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysPostServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysPostServiceImpl.java @@ -156,7 +156,7 @@ public class SysPostServiceImpl implements ISysPostService { for (Long postId : postIds) { SysPost post = baseMapper.selectById(postId); if (countUserPostById(postId) > 0) { - throw new ServiceException(String.format("%1$s已分配,不能删除", post.getPostName())); + throw new ServiceException(String.format("%1$s已分配,不能删除!", post.getPostName())); } } return baseMapper.deleteBatchIds(Arrays.asList(postIds)); From 49f20f7d9ff22087706223acae957a45819d0f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Mon, 7 Aug 2023 18:02:11 +0800 Subject: [PATCH 16/29] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E7=AE=A1=E7=90=86=20=E5=8F=AA=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=9C=AA=E7=A6=81=E7=94=A8=E7=9A=84=E9=83=A8=E9=97=A8=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E5=B2=97=E4=BD=8D=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/controller/system/SysUserController.java | 11 +++++++++-- .../system/service/impl/SysDeptServiceImpl.java | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysUserController.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysUserController.java index eef0a1af8..d68c66f0f 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysUserController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysUserController.java @@ -7,6 +7,7 @@ import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ObjectUtil; import jakarta.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; +import org.dromara.common.core.constant.UserConstants; import org.dromara.common.core.domain.R; import org.dromara.common.core.domain.model.LoginUser; import org.dromara.common.core.utils.MapstructUtils; @@ -22,6 +23,8 @@ import org.dromara.common.satoken.utils.LoginHelper; import org.dromara.common.tenant.helper.TenantHelper; import org.dromara.common.web.core.BaseController; import org.dromara.system.domain.bo.SysDeptBo; +import org.dromara.system.domain.bo.SysPostBo; +import org.dromara.system.domain.bo.SysRoleBo; import org.dromara.system.domain.bo.SysUserBo; import org.dromara.system.domain.vo.*; import org.dromara.system.listener.SysUserImportListener; @@ -124,9 +127,13 @@ public class SysUserController extends BaseController { public R getInfo(@PathVariable(value = "userId", required = false) Long userId) { userService.checkUserDataScope(userId); SysUserInfoVo userInfoVo = new SysUserInfoVo(); - List roles = roleService.selectRoleAll(); + SysRoleBo roleBo = new SysRoleBo(); + roleBo.setStatus(UserConstants.ROLE_NORMAL); + SysPostBo postBo = new SysPostBo(); + postBo.setStatus(UserConstants.POST_NORMAL); + List roles = roleService.selectRoleList(roleBo); userInfoVo.setRoles(LoginHelper.isSuperAdmin(userId) ? roles : StreamUtils.filter(roles, r -> !r.isSuperAdmin())); - userInfoVo.setPosts(postService.selectPostAll()); + userInfoVo.setPosts(postService.selectPostList(postBo)); if (ObjectUtil.isNotNull(userId)) { SysUserVo sysUser = userService.selectUserById(userId); userInfoVo.setUser(sysUser); diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDeptServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDeptServiceImpl.java index 874f634b8..208fe4e00 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDeptServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDeptServiceImpl.java @@ -69,6 +69,8 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService { */ @Override public List> selectDeptTreeList(SysDeptBo bo) { + // 只查询未禁用部门 + bo.setStatus(UserConstants.DEPT_NORMAL); LambdaQueryWrapper lqw = buildQueryWrapper(bo); List depts = baseMapper.selectDeptList(lqw); return buildDeptTreeSelect(depts); From 58e7849fc479edd155f2c3d5e3f2c66b53b71126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Mon, 7 Aug 2023 18:24:46 +0800 Subject: [PATCH 17/29] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E7=94=A8=E6=88=B7=E5=A2=9E=E5=8A=A0=E6=98=B5=E7=A7=B0?= =?UTF-8?q?=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/org/dromara/web/service/SysLoginService.java | 1 + .../java/org/dromara/web/service/impl/XcxAuthStrategy.java | 1 + .../java/org/dromara/common/core/domain/model/LoginUser.java | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/ruoyi-admin/src/main/java/org/dromara/web/service/SysLoginService.java b/ruoyi-admin/src/main/java/org/dromara/web/service/SysLoginService.java index ad8a41e36..3a19f8c34 100644 --- a/ruoyi-admin/src/main/java/org/dromara/web/service/SysLoginService.java +++ b/ruoyi-admin/src/main/java/org/dromara/web/service/SysLoginService.java @@ -140,6 +140,7 @@ public class SysLoginService { loginUser.setUserId(user.getUserId()); loginUser.setDeptId(user.getDeptId()); loginUser.setUsername(user.getUserName()); + loginUser.setNickname(user.getNickName()); loginUser.setUserType(user.getUserType()); loginUser.setMenuPermission(permissionService.getMenuPermission(user.getUserId())); loginUser.setRolePermission(permissionService.getRolePermission(user.getUserId())); diff --git a/ruoyi-admin/src/main/java/org/dromara/web/service/impl/XcxAuthStrategy.java b/ruoyi-admin/src/main/java/org/dromara/web/service/impl/XcxAuthStrategy.java index 5a6f43ab4..36b305e99 100644 --- a/ruoyi-admin/src/main/java/org/dromara/web/service/impl/XcxAuthStrategy.java +++ b/ruoyi-admin/src/main/java/org/dromara/web/service/impl/XcxAuthStrategy.java @@ -52,6 +52,7 @@ public class XcxAuthStrategy implements IAuthStrategy { loginUser.setTenantId(user.getTenantId()); loginUser.setUserId(user.getUserId()); loginUser.setUsername(user.getUserName()); + loginUser.setUsername(user.getNickName()); loginUser.setUserType(user.getUserType()); loginUser.setOpenid(openid); diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/model/LoginUser.java b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/model/LoginUser.java index a770089c9..66262680c 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/model/LoginUser.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/model/LoginUser.java @@ -97,6 +97,11 @@ public class LoginUser implements Serializable { */ private String username; + /** + * 用户昵称 + */ + private String nickname; + /** * 角色对象 */ From 743ebc77d63fe195f0e1b5c0509bc1fa0af59743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Mon, 7 Aug 2023 18:25:53 +0800 Subject: [PATCH 18/29] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E7=94=A8=E6=88=B7=E5=A2=9E=E5=8A=A0=E6=98=B5=E7=A7=B0?= =?UTF-8?q?=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/org/dromara/web/service/impl/XcxAuthStrategy.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-admin/src/main/java/org/dromara/web/service/impl/XcxAuthStrategy.java b/ruoyi-admin/src/main/java/org/dromara/web/service/impl/XcxAuthStrategy.java index 36b305e99..7096f136f 100644 --- a/ruoyi-admin/src/main/java/org/dromara/web/service/impl/XcxAuthStrategy.java +++ b/ruoyi-admin/src/main/java/org/dromara/web/service/impl/XcxAuthStrategy.java @@ -52,7 +52,7 @@ public class XcxAuthStrategy implements IAuthStrategy { loginUser.setTenantId(user.getTenantId()); loginUser.setUserId(user.getUserId()); loginUser.setUsername(user.getUserName()); - loginUser.setUsername(user.getNickName()); + loginUser.setNickname(user.getNickName()); loginUser.setUserType(user.getUserType()); loginUser.setOpenid(openid); From eb16b9e6a0abca429a1e916e90a5df3afe0f960d Mon Sep 17 00:00:00 2001 From: Lionel <12719401+wisdom_woods@user.noreply.gitee.com> Date: Wed, 9 Aug 2023 02:47:25 +0000 Subject: [PATCH 19/29] =?UTF-8?q?!410=20=E5=B0=86=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E7=AE=A1=E7=90=86=20=E8=B4=9F=E8=B4=A3=E4=BA=BA=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E6=94=B9=E4=B8=BA=E4=B8=8B=E6=8B=89=E6=A1=86=E9=80=89?= =?UTF-8?q?=E6=8B=A9=20=E4=BB=8E=E5=BD=93=E5=89=8D=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E7=9A=84=E7=94=A8=E6=88=B7=E5=88=97=E8=A1=A8=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E4=BA=BA=E5=81=9A=E7=BB=91=E5=AE=9A=20?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E6=8E=A5=E6=94=B6=E7=94=A8=E6=88=B7ID=20#I7R?= =?UTF-8?q?8CI=20*=20=E5=B0=86=E9=83=A8=E9=97=A8=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E8=B4=9F=E8=B4=A3=E4=BA=BA=E9=80=89=E9=A1=B9=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=A1=86=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/system/SysUserController.java | 9 ++++++++ .../org/dromara/system/domain/SysDept.java | 2 +- .../dromara/system/domain/bo/SysDeptBo.java | 2 +- .../dromara/system/domain/vo/SysDeptVo.java | 2 +- .../system/domain/vo/SysUserExportVo.java | 2 +- .../system/service/ISysUserService.java | 7 ++++++ .../service/impl/SysTenantServiceImpl.java | 6 ++++- .../service/impl/SysUserServiceImpl.java | 13 +++++++++++ script/sql/oracle/oracle_ry_vue_5.X.sql | 22 +++++++++---------- script/sql/postgres/postgres_ry_vue_5.X.sql | 22 +++++++++---------- script/sql/ry_vue_5.X.sql | 22 +++++++++---------- script/sql/sqlserver/sqlserver_ry_vue_5.X.sql | 22 +++++++++---------- 12 files changed, 82 insertions(+), 49 deletions(-) diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysUserController.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysUserController.java index d68c66f0f..9dafb9cbf 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysUserController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysUserController.java @@ -6,6 +6,7 @@ import cn.hutool.core.lang.tree.Tree; import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ObjectUtil; import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.NotNull; import lombok.RequiredArgsConstructor; import org.dromara.common.core.constant.UserConstants; import org.dromara.common.core.domain.R; @@ -265,4 +266,12 @@ public class SysUserController extends BaseController { return R.ok(deptService.selectDeptTreeList(dept)); } + /** + * 获取部门下的所有用户信息 + */ + @SaCheckPermission("system:user:list") + @GetMapping("/list/dept/{deptId}") + public R> listByDept(@PathVariable @NotNull Long deptId) { + return R.ok(userService.selectUserListByDept(deptId)); + } } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysDept.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysDept.java index d7ad7c4a8..70f1a9ad0 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysDept.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysDept.java @@ -47,7 +47,7 @@ public class SysDept extends TenantEntity { /** * 负责人 */ - private String leader; + private Long leader; /** * 联系电话 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysDeptBo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysDeptBo.java index 44f405273..613977dc0 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysDeptBo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysDeptBo.java @@ -50,7 +50,7 @@ public class SysDeptBo extends BaseEntity { /** * 负责人 */ - private String leader; + private Long leader; /** * 联系电话 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDeptVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDeptVo.java index e09d67e12..671e5793d 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDeptVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDeptVo.java @@ -61,7 +61,7 @@ public class SysDeptVo implements Serializable { * 负责人 */ @ExcelProperty(value = "负责人") - private String leader; + private Long leader; /** * 联系电话 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserExportVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserExportVo.java index 21b1efbec..d01b3df50 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserExportVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserExportVo.java @@ -94,6 +94,6 @@ public class SysUserExportVo implements Serializable { */ @ReverseAutoMapping(target = "leader", source = "dept.leader") @ExcelProperty(value = "部门负责人") - private String leader; + private Long leader; } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysUserService.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysUserService.java index cee572268..bbe78be2b 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysUserService.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysUserService.java @@ -202,4 +202,11 @@ public interface ISysUserService { */ int deleteUserByIds(Long[] userIds); + /** + * 通过部门id查询当前部门所有用户 + * + * @param deptId + * @return + */ + List selectUserListByDept(Long deptId); } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysTenantServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysTenantServiceImpl.java index eb681519a..f3a45ec72 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysTenantServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysTenantServiceImpl.java @@ -132,7 +132,6 @@ public class SysTenantServiceImpl implements ISysTenantService { SysDept dept = new SysDept(); dept.setTenantId(tenantId); dept.setDeptName(bo.getCompanyName()); - dept.setLeader(bo.getUsername()); dept.setParentId(Constants.TOP_PARENT_ID); dept.setAncestors(Constants.TOP_PARENT_ID.toString()); deptMapper.insert(dept); @@ -152,6 +151,11 @@ public class SysTenantServiceImpl implements ISysTenantService { user.setPassword(BCrypt.hashpw(bo.getPassword())); user.setDeptId(deptId); userMapper.insert(user); + //新增系统用户后,默认当前用户为部门的负责人 + SysDept sd = new SysDept(); + sd.setLeader(user.getUserId()); + sd.setDeptId(deptId); + deptMapper.updateById(sd); // 用户和角色关联表 SysUserRole userRole = new SysUserRole(); diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java index c8f63274c..0a13a5002 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java @@ -513,6 +513,19 @@ public class SysUserServiceImpl implements ISysUserService, UserService { return flag; } + /** + * 通过部门id查询当前部门所有用户 + * + * @param deptId + * @return + */ + @Override + public List selectUserListByDept(Long deptId) { + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(SysUser::getDeptId, deptId); + return baseMapper.selectVoList(lqw); + } + @Cacheable(cacheNames = CacheNames.SYS_USER_NAME, key = "#userId") @Override public String selectUserNameById(Long userId) { diff --git a/script/sql/oracle/oracle_ry_vue_5.X.sql b/script/sql/oracle/oracle_ry_vue_5.X.sql index 29c5ac6ba..8938b4c04 100644 --- a/script/sql/oracle/oracle_ry_vue_5.X.sql +++ b/script/sql/oracle/oracle_ry_vue_5.X.sql @@ -166,7 +166,7 @@ create table sys_dept ( ancestors varchar2(500) default '', dept_name varchar2(30) default '', order_num number(4) default 0, - leader varchar2(20) default null, + leader number(20) default null, phone varchar2(11) default null, email varchar2(50) default null, status char(1) default '0', @@ -201,16 +201,16 @@ comment on column sys_dept.update_time is '更新时间'; -- ---------------------------- -- 初始化-部门表数据 -- ---------------------------- -insert into sys_dept values(100, '000000', 0, '0', 'XXX科技', 0, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -insert into sys_dept values(101, '000000', 100, '0,100', '深圳总公司', 1, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -insert into sys_dept values(102, '000000', 100, '0,100', '长沙分公司', 2, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -insert into sys_dept values(103, '000000', 101, '0,100,101', '研发部门', 1, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -insert into sys_dept values(104, '000000', 101, '0,100,101', '市场部门', 2, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -insert into sys_dept values(105, '000000', 101, '0,100,101', '测试部门', 3, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -insert into sys_dept values(106, '000000', 101, '0,100,101', '财务部门', 4, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -insert into sys_dept values(107, '000000', 101, '0,100,101', '运维部门', 5, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -insert into sys_dept values(108, '000000', 102, '0,100,102', '市场部门', 1, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -insert into sys_dept values(109, '000000', 102, '0,100,102', '财务部门', 2, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); +insert into sys_dept values(100, '000000', 0, '0', 'XXX科技', 0, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); +insert into sys_dept values(101, '000000', 100, '0,100', '深圳总公司', 1, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); +insert into sys_dept values(102, '000000', 100, '0,100', '长沙分公司', 2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); +insert into sys_dept values(103, '000000', 101, '0,100,101', '研发部门', 1, 1, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); +insert into sys_dept values(104, '000000', 101, '0,100,101', '市场部门', 2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); +insert into sys_dept values(105, '000000', 101, '0,100,101', '测试部门', 3, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); +insert into sys_dept values(106, '000000', 101, '0,100,101', '财务部门', 4, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); +insert into sys_dept values(107, '000000', 101, '0,100,101', '运维部门', 5, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); +insert into sys_dept values(108, '000000', 102, '0,100,102', '市场部门', 1, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); +insert into sys_dept values(109, '000000', 102, '0,100,102', '财务部门', 2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -- ---------------------------- diff --git a/script/sql/postgres/postgres_ry_vue_5.X.sql b/script/sql/postgres/postgres_ry_vue_5.X.sql index 0f1d265e1..5992e6aa6 100644 --- a/script/sql/postgres/postgres_ry_vue_5.X.sql +++ b/script/sql/postgres/postgres_ry_vue_5.X.sql @@ -173,7 +173,7 @@ create table if not exists sys_dept ancestors varchar(500)default ''::varchar, dept_name varchar(30) default ''::varchar, order_num int4 default 0, - leader varchar(20) default null::varchar, + leader int8 default null, phone varchar(11) default null::varchar, email varchar(50) default null::varchar, status char default '0'::bpchar, @@ -207,16 +207,16 @@ comment on column sys_dept.update_time is '更新时间'; -- ---------------------------- -- 初始化-部门表数据 -- ---------------------------- -insert into sys_dept values(100, '000000', 0, '0', 'XXX科技', 0, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -insert into sys_dept values(101, '000000', 100, '0,100', '深圳总公司', 1, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -insert into sys_dept values(102, '000000', 100, '0,100', '长沙分公司', 2, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -insert into sys_dept values(103, '000000', 101, '0,100,101', '研发部门', 1, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -insert into sys_dept values(104, '000000', 101, '0,100,101', '市场部门', 2, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -insert into sys_dept values(105, '000000', 101, '0,100,101', '测试部门', 3, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -insert into sys_dept values(106, '000000', 101, '0,100,101', '财务部门', 4, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -insert into sys_dept values(107, '000000', 101, '0,100,101', '运维部门', 5, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -insert into sys_dept values(108, '000000', 102, '0,100,102', '市场部门', 1, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -insert into sys_dept values(109, '000000', 102, '0,100,102', '财务部门', 2, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); +insert into sys_dept values(100, '000000', 0, '0', 'XXX科技', 0, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); +insert into sys_dept values(101, '000000', 100, '0,100', '深圳总公司', 1, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); +insert into sys_dept values(102, '000000', 100, '0,100', '长沙分公司', 2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); +insert into sys_dept values(103, '000000', 101, '0,100,101', '研发部门', 1, 1, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); +insert into sys_dept values(104, '000000', 101, '0,100,101', '市场部门', 2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); +insert into sys_dept values(105, '000000', 101, '0,100,101', '测试部门', 3, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); +insert into sys_dept values(106, '000000', 101, '0,100,101', '财务部门', 4, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); +insert into sys_dept values(107, '000000', 101, '0,100,101', '运维部门', 5, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); +insert into sys_dept values(108, '000000', 102, '0,100,102', '市场部门', 1, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); +insert into sys_dept values(109, '000000', 102, '0,100,102', '财务部门', 2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -- ---------------------------- -- 2、用户信息表 diff --git a/script/sql/ry_vue_5.X.sql b/script/sql/ry_vue_5.X.sql index 2b8e18903..de924759a 100644 --- a/script/sql/ry_vue_5.X.sql +++ b/script/sql/ry_vue_5.X.sql @@ -106,7 +106,7 @@ create table sys_dept ( ancestors varchar(500) default '' comment '祖级列表', dept_name varchar(30) default '' comment '部门名称', order_num int(4) default 0 comment '显示顺序', - leader varchar(20) default null comment '负责人', + leader bigint(20) default null comment '负责人', phone varchar(11) default null comment '联系电话', email varchar(50) default null comment '邮箱', status char(1) default '0' comment '部门状态(0正常 1停用)', @@ -124,16 +124,16 @@ create table sys_dept ( -- ---------------------------- -insert into sys_dept values(100, '000000', 0, '0', 'XXX科技', 0, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); -insert into sys_dept values(101, '000000', 100, '0,100', '深圳总公司', 1, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); -insert into sys_dept values(102, '000000', 100, '0,100', '长沙分公司', 2, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); -insert into sys_dept values(103, '000000', 101, '0,100,101', '研发部门', 1, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); -insert into sys_dept values(104, '000000', 101, '0,100,101', '市场部门', 2, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); -insert into sys_dept values(105, '000000', 101, '0,100,101', '测试部门', 3, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); -insert into sys_dept values(106, '000000', 101, '0,100,101', '财务部门', 4, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); -insert into sys_dept values(107, '000000', 101, '0,100,101', '运维部门', 5, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); -insert into sys_dept values(108, '000000', 102, '0,100,102', '市场部门', 1, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); -insert into sys_dept values(109, '000000', 102, '0,100,102', '财务部门', 2, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); +insert into sys_dept values(100, '000000', 0, '0', 'XXX科技', 0, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); +insert into sys_dept values(101, '000000', 100, '0,100', '深圳总公司', 1, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); +insert into sys_dept values(102, '000000', 100, '0,100', '长沙分公司', 2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); +insert into sys_dept values(103, '000000', 101, '0,100,101', '研发部门', 1, 1, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); +insert into sys_dept values(104, '000000', 101, '0,100,101', '市场部门', 2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); +insert into sys_dept values(105, '000000', 101, '0,100,101', '测试部门', 3, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); +insert into sys_dept values(106, '000000', 101, '0,100,101', '财务部门', 4, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); +insert into sys_dept values(107, '000000', 101, '0,100,101', '运维部门', 5, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); +insert into sys_dept values(108, '000000', 102, '0,100,102', '市场部门', 1, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); +insert into sys_dept values(109, '000000', 102, '0,100,102', '财务部门', 2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); -- ---------------------------- diff --git a/script/sql/sqlserver/sqlserver_ry_vue_5.X.sql b/script/sql/sqlserver/sqlserver_ry_vue_5.X.sql index 3fb84049a..f16edb1de 100644 --- a/script/sql/sqlserver/sqlserver_ry_vue_5.X.sql +++ b/script/sql/sqlserver/sqlserver_ry_vue_5.X.sql @@ -928,7 +928,7 @@ CREATE TABLE sys_dept ancestors nvarchar(500)DEFAULT '' NULL, dept_name nvarchar(30) DEFAULT '' NULL, order_num int DEFAULT ((0)) NULL, - leader nvarchar(20) NULL, + leader bigint NULL, phone nvarchar(11) NULL, email nvarchar(50) NULL, status nchar(1) DEFAULT ('0') NULL, @@ -1047,25 +1047,25 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_dept' GO -INSERT sys_dept VALUES (100, N'000000', 0, N'0', N'XXX科技', 0, N'疯狂的狮子Li', N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) +INSERT sys_dept VALUES (100, N'000000', 0, N'0', N'XXX科技', 0, NULL, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) GO -INSERT sys_dept VALUES (101, N'000000', 100, N'0,100', N'深圳总公司', 1, N'疯狂的狮子Li', N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) +INSERT sys_dept VALUES (101, N'000000', 100, N'0,100', N'深圳总公司', 1, NULL, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) GO -INSERT sys_dept VALUES (102, N'000000', 100, N'0,100', N'长沙分公司', 2, N'疯狂的狮子Li', N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) +INSERT sys_dept VALUES (102, N'000000', 100, N'0,100', N'长沙分公司', 2, NULL, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) GO -INSERT sys_dept VALUES (103, N'000000', 101, N'0,100,101', N'研发部门', 1, N'疯狂的狮子Li', N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) +INSERT sys_dept VALUES (103, N'000000', 101, N'0,100,101', N'研发部门', 1, 1, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) GO -INSERT sys_dept VALUES (104, N'000000', 101, N'0,100,101', N'市场部门', 2, N'疯狂的狮子Li', N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) +INSERT sys_dept VALUES (104, N'000000', 101, N'0,100,101', N'市场部门', 2, NULL, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) GO -INSERT sys_dept VALUES (105, N'000000', 101, N'0,100,101', N'测试部门', 3, N'疯狂的狮子Li', N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) +INSERT sys_dept VALUES (105, N'000000', 101, N'0,100,101', N'测试部门', 3, NULL, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) GO -INSERT sys_dept VALUES (106, N'000000', 101, N'0,100,101', N'财务部门', 4, N'疯狂的狮子Li', N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) +INSERT sys_dept VALUES (106, N'000000', 101, N'0,100,101', N'财务部门', 4, NULL, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) GO -INSERT sys_dept VALUES (107, N'000000', 101, N'0,100,101', N'运维部门', 5, N'疯狂的狮子Li', N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) +INSERT sys_dept VALUES (107, N'000000', 101, N'0,100,101', N'运维部门', 5, NULL, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) GO -INSERT sys_dept VALUES (108, N'000000', 102, N'0,100,102', N'市场部门', 1, N'疯狂的狮子Li', N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) +INSERT sys_dept VALUES (108, N'000000', 102, N'0,100,102', N'市场部门', 1, NULL, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) GO -INSERT sys_dept VALUES (109, N'000000', 102, N'0,100,102', N'财务部门', 2, N'疯狂的狮子Li', N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) +INSERT sys_dept VALUES (109, N'000000', 102, N'0,100,102', N'财务部门', 2, NULL, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) GO CREATE TABLE sys_dict_data From 29e7c5dc41a841c9e324b0e076d7980e28ebd266 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Wed, 9 Aug 2023 10:06:36 +0800 Subject: [PATCH 20/29] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86=E5=99=A8=20?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E5=BC=82=E5=B8=B8=E4=B8=8D=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E5=85=B7=E4=BD=93=E5=A0=86=E6=A0=88=E4=BF=A1=E6=81=AF=20?= =?UTF-8?q?=E5=87=8F=E5=B0=91=E6=97=A0=E7=94=A8=E6=97=A5=E5=BF=97=E5=AD=98?= =?UTF-8?q?=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../handler/GlobalExceptionHandler.java | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/ruoyi-common/ruoyi-common-security/src/main/java/org/dromara/common/security/handler/GlobalExceptionHandler.java b/ruoyi-common/ruoyi-common-security/src/main/java/org/dromara/common/security/handler/GlobalExceptionHandler.java index d9ee05f45..1809c613e 100644 --- a/ruoyi-common/ruoyi-common-security/src/main/java/org/dromara/common/security/handler/GlobalExceptionHandler.java +++ b/ruoyi-common/ruoyi-common-security/src/main/java/org/dromara/common/security/handler/GlobalExceptionHandler.java @@ -12,6 +12,7 @@ import lombok.extern.slf4j.Slf4j; import org.dromara.common.core.domain.R; import org.dromara.common.core.exception.DemoModeException; import org.dromara.common.core.exception.ServiceException; +import org.dromara.common.core.exception.base.BaseException; import org.dromara.common.core.utils.StreamUtils; import org.springframework.context.support.DefaultMessageSourceResolvable; import org.springframework.validation.BindException; @@ -77,18 +78,27 @@ public class GlobalExceptionHandler { */ @ExceptionHandler(ServiceException.class) public R handleServiceException(ServiceException e, HttpServletRequest request) { - log.error(e.getMessage(), e); + log.error(e.getMessage()); Integer code = e.getCode(); return ObjectUtil.isNotNull(code) ? R.fail(code, e.getMessage()) : R.fail(e.getMessage()); } + /** + * 业务异常 + */ + @ExceptionHandler(BaseException.class) + public R handleBaseException(BaseException e, HttpServletRequest request) { + log.error(e.getMessage()); + return R.fail(e.getMessage()); + } + /** * 请求路径中缺少必需的路径变量 */ @ExceptionHandler(MissingPathVariableException.class) public R handleMissingPathVariableException(MissingPathVariableException e, HttpServletRequest request) { String requestURI = request.getRequestURI(); - log.error("请求路径中缺少必需的路径变量'{}',发生系统异常.", requestURI, e); + log.error("请求路径中缺少必需的路径变量'{}',发生系统异常.", requestURI); return R.fail(String.format("请求路径中缺少必需的路径变量[%s]", e.getVariableName())); } @@ -98,7 +108,7 @@ public class GlobalExceptionHandler { @ExceptionHandler(MethodArgumentTypeMismatchException.class) public R handleMethodArgumentTypeMismatchException(MethodArgumentTypeMismatchException e, HttpServletRequest request) { String requestURI = request.getRequestURI(); - log.error("请求参数类型不匹配'{}',发生系统异常.", requestURI, e); + log.error("请求参数类型不匹配'{}',发生系统异常.", requestURI); return R.fail(String.format("请求参数类型不匹配,参数[%s]要求类型为:'%s',但输入值为:'%s'", e.getName(), e.getRequiredType().getName(), e.getValue())); } @@ -127,7 +137,7 @@ public class GlobalExceptionHandler { */ @ExceptionHandler(BindException.class) public R handleBindException(BindException e) { - log.error(e.getMessage(), e); + log.error(e.getMessage()); String message = StreamUtils.join(e.getAllErrors(), DefaultMessageSourceResolvable::getDefaultMessage, ", "); return R.fail(message); } @@ -137,7 +147,7 @@ public class GlobalExceptionHandler { */ @ExceptionHandler(ConstraintViolationException.class) public R constraintViolationException(ConstraintViolationException e) { - log.error(e.getMessage(), e); + log.error(e.getMessage()); String message = StreamUtils.join(e.getConstraintViolations(), ConstraintViolation::getMessage, ", "); return R.fail(message); } @@ -147,7 +157,7 @@ public class GlobalExceptionHandler { */ @ExceptionHandler(MethodArgumentNotValidException.class) public R handleMethodArgumentNotValidException(MethodArgumentNotValidException e) { - log.error(e.getMessage(), e); + log.error(e.getMessage()); String message = e.getBindingResult().getFieldError().getDefaultMessage(); return R.fail(message); } From 703815dae7638906e412a277de64d3ee727f3437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Wed, 9 Aug 2023 11:53:57 +0800 Subject: [PATCH 21/29] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20oracle=20sql?= =?UTF-8?q?=20=E8=84=9A=E6=9C=AC=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/sql/oracle/oracle_ry_vue_5.X.sql | 56 ++++++++++----------- script/sql/update/oracle/update_5.0-5.1.sql | 4 +- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/script/sql/oracle/oracle_ry_vue_5.X.sql b/script/sql/oracle/oracle_ry_vue_5.X.sql index 8938b4c04..ecab07c9f 100644 --- a/script/sql/oracle/oracle_ry_vue_5.X.sql +++ b/script/sql/oracle/oracle_ry_vue_5.X.sql @@ -3,8 +3,8 @@ -- ---------------------------- create table sys_social ( - id number(20) not null, - user_id number(20) not null, + id number(20) not null, + user_id number(20) not null, tenant_id varchar2(20) default null, auth_id varchar2(255) not null, source varchar2(255) not null, @@ -14,7 +14,7 @@ create table sys_social email varchar2(255) default '', avatar varchar2(500) default '', access_token varchar2(255) not null, - expire_in number(100) default null, + expire_in number(20) default null, refresh_token varchar2(255) default null, access_code varchar2(255) default null, union_id varchar2(255) default null, @@ -1000,8 +1000,8 @@ create table gen_table ( data_name varchar2(200) default '', table_name varchar2(200) default '', table_comment varchar2(500) default '', - sub_table_name varchar2(64) default null, - sub_table_fk_name varchar2(64) default null, + sub_table_name varchar2(64) default null, + sub_table_fk_name varchar2(64) default null, class_name varchar2(100) default '', tpl_category varchar2(200) default 'crud', package_name varchar2(100), @@ -1069,7 +1069,7 @@ create table gen_table_column ( html_type varchar2(200), dict_type varchar2(200) default '', sort number(4), - create_dept number(20) default null, + create_dept number(20) default null, create_by number(20) default null, create_time date , update_by number(20) default null, @@ -1108,17 +1108,17 @@ comment on column gen_table_column.update_time is '更新时间'; -- OSS对象存储表 -- ---------------------------- create table sys_oss ( - oss_id number(20) not null, - tenant_id varchar2(20) default '000000', + oss_id number(20) not null, + tenant_id varchar2(20) default '000000', file_name varchar2(255) not null, original_name varchar2(255) not null, file_suffix varchar2(10) not null, url varchar2(500) not null, service varchar2(20) default 'minio' not null, - create_dept number(20) default null, - create_by number(20) default null, + create_dept number(20) default null, + create_by number(20) default null, create_time date, - update_by number(20) default null, + update_by number(20) default null, update_time date ); @@ -1143,8 +1143,8 @@ comment on column sys_oss.update_by is '更新者'; -- OSS对象存储动态配置表 -- ---------------------------- create table sys_oss_config ( - oss_config_id number(20) not null, - tenant_id varchar2(20) default '000000', + oss_config_id number(20) not null, + tenant_id varchar2(20) default '000000', config_key varchar2(20) not null, access_key varchar2(255) default '', secret_key varchar2(255) default '', @@ -1152,16 +1152,16 @@ create table sys_oss_config ( prefix varchar2(255) default '', endpoint varchar2(255) default '', domain varchar2(255) default '', - is_https char(1) default 'N', + is_https char(1) default 'N', region varchar2(255) default '', - access_policy char(1) default '1' not null, - status char(1) default '1', + access_policy char(1) default '1' not null, + status char(1) default '1', ext1 varchar2(255) default '', remark varchar2(500) default null, - create_dept number(20) default null, - create_by number(20) default null, + create_dept number(20) default null, + create_by number(20) default null, create_time date, - update_by number(20) default null, + update_by number(20) default null, update_time date ); @@ -1199,22 +1199,22 @@ insert into sys_oss_config values (5, '000000', 'image', 'ruoyi', 'r -- 系统授权表 -- ---------------------------- create table sys_client ( - id number(20) not null, + id number(20) not null, client_id varchar2(64) default null, client_key varchar2(32) default null, client_secret varchar2(255) default null, grant_type varchar2(255) default null, device_type varchar2(32) default null, - active_timeout number(11) default 1800, - timeout number(11) default 604800, - status char(1) default '0', - del_flag char(1) default '0', - create_dept number(20) default null, - create_by number(20) default null, + active_timeout number(11) default 1800, + timeout number(11) default 604800, + status char(1) default '0', + del_flag char(1) default '0', + create_dept number(20) default null, + create_by number(20) default null, create_time date, - update_by number(20) default null, + update_by number(20) default null, update_time date -) +); alter table sys_client add constraint pk_sys_client primary key (id); diff --git a/script/sql/update/oracle/update_5.0-5.1.sql b/script/sql/update/oracle/update_5.0-5.1.sql index 54cff5db5..bf178ec4f 100644 --- a/script/sql/update/oracle/update_5.0-5.1.sql +++ b/script/sql/update/oracle/update_5.0-5.1.sql @@ -20,7 +20,7 @@ create table sys_social email varchar2(255) default '', avatar varchar2(500) default '', access_token varchar2(255) not null, - expire_in number(100) default null, + expire_in number(20) default null, refresh_token varchar2(255) default null, access_code varchar2(255) default null, union_id varchar2(255) default null, @@ -93,7 +93,7 @@ create table sys_client ( create_time date, update_by number(20) default null, update_time date -) +); alter table sys_client add constraint pk_sys_client primary key (id); From af4b0cb1079490e2b1e9b83161abf9aac7cd04d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Wed, 9 Aug 2023 12:06:05 +0800 Subject: [PATCH 22/29] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20!pr410=20?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84=E7=94=A8=E6=88=B7=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/org/dromara/system/domain/vo/SysDeptVo.java | 7 ++++++- .../org/dromara/system/domain/vo/SysUserExportVo.java | 4 ++-- .../src/main/resources/mapper/system/SysUserMapper.xml | 8 ++++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDeptVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDeptVo.java index 671e5793d..c4dd412b3 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDeptVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDeptVo.java @@ -57,11 +57,16 @@ public class SysDeptVo implements Serializable { */ private Integer orderNum; + /** + * 负责人ID + */ + private Long leader; + /** * 负责人 */ @ExcelProperty(value = "负责人") - private Long leader; + private String leaderName; /** * 联系电话 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserExportVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserExportVo.java index d01b3df50..3cc5186c8 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserExportVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserExportVo.java @@ -92,8 +92,8 @@ public class SysUserExportVo implements Serializable { /** * 负责人 */ - @ReverseAutoMapping(target = "leader", source = "dept.leader") + @ReverseAutoMapping(target = "leaderName", source = "dept.leaderName") @ExcelProperty(value = "部门负责人") - private Long leader; + private String leaderName; } diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml index 0b67a3397..f813ca066 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -67,17 +67,21 @@ From 1e423facaa8d2de58ec2dbed70f5562d620ece17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Wed, 9 Aug 2023 12:06:22 +0800 Subject: [PATCH 23/29] =?UTF-8?q?add=20=E5=A2=9E=E5=8A=A0=20!pr410=20sql?= =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/sql/update/oracle/update_5.0-5.1.sql | 4 ++++ script/sql/update/postgres/update_5.0-5.1.sql | 4 ++++ script/sql/update/sqlserver/update_5.0-5.1.sql | 6 ++++++ script/sql/update/update_5.0-5.1.sql | 4 ++++ 4 files changed, 18 insertions(+) diff --git a/script/sql/update/oracle/update_5.0-5.1.sql b/script/sql/update/oracle/update_5.0-5.1.sql index bf178ec4f..72f117082 100644 --- a/script/sql/update/oracle/update_5.0-5.1.sql +++ b/script/sql/update/oracle/update_5.0-5.1.sql @@ -145,3 +145,7 @@ insert into sys_role_menu values ('2', '1062'); insert into sys_role_menu values ('2', '1063'); insert into sys_role_menu values ('2', '1064'); insert into sys_role_menu values ('2', '1065'); + + +update sys_dept set leader = null; +ALTER TABLE sys_dept ALTER COLUMN leader TYPE int8; diff --git a/script/sql/update/postgres/update_5.0-5.1.sql b/script/sql/update/postgres/update_5.0-5.1.sql index a0107ae87..5db2cd14b 100644 --- a/script/sql/update/postgres/update_5.0-5.1.sql +++ b/script/sql/update/postgres/update_5.0-5.1.sql @@ -144,3 +144,7 @@ insert into sys_role_menu values ('2', '1062'); insert into sys_role_menu values ('2', '1063'); insert into sys_role_menu values ('2', '1064'); insert into sys_role_menu values ('2', '1065'); + + +update sys_dept set leader = null; +alter table sys_dept modify column leader bigint null default null comment '负责人' after order_num; diff --git a/script/sql/update/sqlserver/update_5.0-5.1.sql b/script/sql/update/sqlserver/update_5.0-5.1.sql index 63fa9379b..605f02ff8 100644 --- a/script/sql/update/sqlserver/update_5.0-5.1.sql +++ b/script/sql/update/sqlserver/update_5.0-5.1.sql @@ -401,3 +401,9 @@ INSERT sys_role_menu VALUES (2, 1064) GO INSERT sys_role_menu VALUES (2, 1065) GO + + +UPDATE sys_dept SET leader = null +GO +ALTER TABLE sys_dept ALTER COLUMN leader bigint NULL +GO diff --git a/script/sql/update/update_5.0-5.1.sql b/script/sql/update/update_5.0-5.1.sql index 22b227b79..2bc1cc17c 100644 --- a/script/sql/update/update_5.0-5.1.sql +++ b/script/sql/update/update_5.0-5.1.sql @@ -95,3 +95,7 @@ insert into sys_role_menu values ('2', '1062'); insert into sys_role_menu values ('2', '1063'); insert into sys_role_menu values ('2', '1064'); insert into sys_role_menu values ('2', '1065'); + + +update sys_dept set leader = null; +alter table sys_dept modify column leader bigint null default null comment '负责人' after order_num; From 60c48fd27ce8e383abfa692350273f9d8310efce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Wed, 9 Aug 2023 12:07:11 +0800 Subject: [PATCH 24/29] update mybatis-plus 3.5.3.1 => 3.5.3.2 update dynamic-ds 4.1.2 => 4.1.3 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 48c02178c..956e62c66 100644 --- a/pom.xml +++ b/pom.xml @@ -25,14 +25,14 @@ 3.3.2 2.3 1.35.0.RC - 3.5.3.1 + 3.5.3.2 3.9.1 5.8.20 4.10.0 3.1.3 3.23.1 2.2.4 - 4.1.2 + 4.1.3 2.14.2 4.3.3 1.3.5 From f12afaab5da68acb92332a6063c1fb5f9abd4385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Wed, 9 Aug 2023 12:32:56 +0800 Subject: [PATCH 25/29] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20update=20sql?= =?UTF-8?q?=20=E4=B9=A6=E5=86=99=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/sql/update/oracle/update_5.0-5.1.sql | 2 +- script/sql/update/postgres/update_5.0-5.1.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/script/sql/update/oracle/update_5.0-5.1.sql b/script/sql/update/oracle/update_5.0-5.1.sql index 72f117082..363d4abab 100644 --- a/script/sql/update/oracle/update_5.0-5.1.sql +++ b/script/sql/update/oracle/update_5.0-5.1.sql @@ -148,4 +148,4 @@ insert into sys_role_menu values ('2', '1065'); update sys_dept set leader = null; -ALTER TABLE sys_dept ALTER COLUMN leader TYPE int8; +ALTER TABLE sys_dept MODIFY (leader NUMBER(20)) diff --git a/script/sql/update/postgres/update_5.0-5.1.sql b/script/sql/update/postgres/update_5.0-5.1.sql index 5db2cd14b..fa2eb3e72 100644 --- a/script/sql/update/postgres/update_5.0-5.1.sql +++ b/script/sql/update/postgres/update_5.0-5.1.sql @@ -147,4 +147,4 @@ insert into sys_role_menu values ('2', '1065'); update sys_dept set leader = null; -alter table sys_dept modify column leader bigint null default null comment '负责人' after order_num; +ALTER TABLE sys_dept ALTER COLUMN leader TYPE int8; From 15a7a83966a833ead6ab75bcc042b3424b3a4a08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Thu, 10 Aug 2023 09:50:39 +0800 Subject: [PATCH 26/29] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E5=BA=94=E7=94=A8=E6=89=BE=E4=B8=8D=E5=88=B0=E7=BA=BF?= =?UTF-8?q?=E7=A8=8B=E6=B1=A0bean=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/dromara/common/core/config/ThreadPoolConfig.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/config/ThreadPoolConfig.java b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/config/ThreadPoolConfig.java index 3db62b279..b4d452817 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/config/ThreadPoolConfig.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/config/ThreadPoolConfig.java @@ -4,7 +4,6 @@ import jakarta.annotation.PreDestroy; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.concurrent.BasicThreadFactory; import org.dromara.common.core.config.properties.ThreadPoolProperties; -import org.dromara.common.core.utils.SpringUtils; import org.dromara.common.core.utils.Threads; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; @@ -31,6 +30,8 @@ public class ThreadPoolConfig { */ private final int core = Runtime.getRuntime().availableProcessors() + 1; + private ScheduledExecutorService scheduledExecutorService; + @Bean(name = "threadPoolTaskExecutor") @ConditionalOnProperty(prefix = "thread-pool", name = "enabled", havingValue = "true") public ThreadPoolTaskExecutor threadPoolTaskExecutor(ThreadPoolProperties threadPoolProperties) { @@ -48,7 +49,7 @@ public class ThreadPoolConfig { */ @Bean(name = "scheduledExecutorService") protected ScheduledExecutorService scheduledExecutorService() { - return new ScheduledThreadPoolExecutor(core, + ScheduledThreadPoolExecutor scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(core, new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build(), new ThreadPoolExecutor.CallerRunsPolicy()) { @Override @@ -57,6 +58,8 @@ public class ThreadPoolConfig { Threads.printException(r, t); } }; + this.scheduledExecutorService = scheduledThreadPoolExecutor; + return scheduledThreadPoolExecutor; } /** @@ -66,7 +69,6 @@ public class ThreadPoolConfig { public void destroy() { try { log.info("====关闭后台任务任务线程池===="); - ScheduledExecutorService scheduledExecutorService = SpringUtils.getBean("scheduledExecutorService"); Threads.shutdownAndAwaitTermination(scheduledExecutorService); } catch (Exception e) { log.error(e.getMessage(), e); From 84429206dc3ef4475ae31eb9e96d00b3c15c7a5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Thu, 10 Aug 2023 12:57:42 +0800 Subject: [PATCH 27/29] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20redis?= =?UTF-8?q?=E5=BA=8F=E5=88=97=E5=8C=96=E9=85=8D=E7=BD=AE=20=E6=9B=B4?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E9=80=9A=E7=94=A8=E6=A0=BC=E5=BC=8F(?= =?UTF-8?q?=E5=8D=87=E7=BA=A7=E9=9C=80=E6=B8=85=E9=99=A4redis=E6=89=80?= =?UTF-8?q?=E6=9C=89=E6=95=B0=E6=8D=AE)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/redis/config/RedisConfig.java | 18 +++++++++++++++--- .../service/impl/SysOssConfigServiceImpl.java | 7 +++---- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/ruoyi-common/ruoyi-common-redis/src/main/java/org/dromara/common/redis/config/RedisConfig.java b/ruoyi-common/ruoyi-common-redis/src/main/java/org/dromara/common/redis/config/RedisConfig.java index 644edbe0e..a271ba46d 100644 --- a/ruoyi-common/ruoyi-common-redis/src/main/java/org/dromara/common/redis/config/RedisConfig.java +++ b/ruoyi-common/ruoyi-common-redis/src/main/java/org/dromara/common/redis/config/RedisConfig.java @@ -1,12 +1,17 @@ package org.dromara.common.redis.config; import cn.hutool.core.util.ObjectUtil; +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.PropertyAccessor; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator; +import lombok.extern.slf4j.Slf4j; import org.dromara.common.redis.config.properties.RedissonProperties; import org.dromara.common.redis.handler.KeyPrefixHandler; import org.dromara.common.redis.manager.PlusSpringCacheManager; -import lombok.extern.slf4j.Slf4j; -import org.redisson.codec.JsonJacksonCodec; +import org.redisson.client.codec.StringCodec; +import org.redisson.codec.CompositeCodec; +import org.redisson.codec.TypedJsonJacksonCodec; import org.redisson.spring.starter.RedissonAutoConfigurationCustomizer; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.AutoConfiguration; @@ -35,9 +40,16 @@ public class RedisConfig { @Bean public RedissonAutoConfigurationCustomizer redissonCustomizer() { return config -> { + ObjectMapper om = objectMapper.copy(); + om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); + // 指定序列化输入的类型,类必须是非final修饰的。序列化时将对象全类名一起保存下来 + om.activateDefaultTyping(LaissezFaireSubTypeValidator.instance, ObjectMapper.DefaultTyping.NON_FINAL); + TypedJsonJacksonCodec jsonCodec = new TypedJsonJacksonCodec(Object.class, om); + // 组合序列化 key 使用 String 内容使用通用 json 格式 + CompositeCodec codec = new CompositeCodec(StringCodec.INSTANCE, jsonCodec, jsonCodec); config.setThreads(redissonProperties.getThreads()) .setNettyThreads(redissonProperties.getNettyThreads()) - .setCodec(new JsonJacksonCodec(objectMapper)); + .setCodec(codec); RedissonProperties.SingleServerConfig singleServerConfig = redissonProperties.getSingleServerConfig(); if (ObjectUtil.isNotNull(singleServerConfig)) { // 使用单机模式 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysOssConfigServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysOssConfigServiceImpl.java index 4d421ee04..aca239e0d 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysOssConfigServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysOssConfigServiceImpl.java @@ -13,7 +13,6 @@ import org.dromara.common.core.exception.ServiceException; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StreamUtils; import org.dromara.common.core.utils.StringUtils; -import org.dromara.common.json.utils.JsonUtils; import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.common.oss.constant.OssConstant; @@ -66,7 +65,7 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService { if ("0".equals(config.getStatus())) { RedisUtils.setCacheObject(OssConstant.DEFAULT_CONFIG_KEY, configKey); } - CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config)); + CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), config); } } } finally { @@ -101,7 +100,7 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService { validEntityBeforeSave(config); boolean flag = baseMapper.insert(config) > 0; if (flag) { - CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config)); + CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), config); } return flag; } @@ -118,7 +117,7 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService { luw.eq(SysOssConfig::getOssConfigId, config.getOssConfigId()); boolean flag = baseMapper.update(config, luw) > 0; if (flag) { - CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config)); + CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), config); } return flag; } From b4cbefd2b8abebd1c51b7a724e6a9b2a58b19e62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Thu, 10 Aug 2023 12:58:46 +0800 Subject: [PATCH 28/29] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E7=94=A8=E6=88=B7=E7=BC=93=E5=AD=98=20=E5=8E=BB?= =?UTF-8?q?=E9=99=A4=E5=86=97=E4=BD=99=E7=BB=9F=E4=B8=80=E5=AD=98=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/dromara/common/satoken/utils/LoginHelper.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ruoyi-common/ruoyi-common-satoken/src/main/java/org/dromara/common/satoken/utils/LoginHelper.java b/ruoyi-common/ruoyi-common-satoken/src/main/java/org/dromara/common/satoken/utils/LoginHelper.java index 22c160a70..2bbcd0d91 100644 --- a/ruoyi-common/ruoyi-common-satoken/src/main/java/org/dromara/common/satoken/utils/LoginHelper.java +++ b/ruoyi-common/ruoyi-common-satoken/src/main/java/org/dromara/common/satoken/utils/LoginHelper.java @@ -52,7 +52,7 @@ public class LoginHelper { StpUtil.login(loginUser.getLoginId(), model.setExtra(TENANT_KEY, loginUser.getTenantId()) .setExtra(USER_KEY, loginUser.getUserId())); - StpUtil.getTokenSession().set(LOGIN_USER_KEY, loginUser); + StpUtil.getSession().set(LOGIN_USER_KEY, loginUser); } /** @@ -63,7 +63,7 @@ public class LoginHelper { if (loginUser != null) { return loginUser; } - SaSession session = StpUtil.getTokenSession(); + SaSession session = StpUtil.getSession(); if (ObjectUtil.isNull(session)) { return null; } @@ -76,7 +76,8 @@ public class LoginHelper { * 获取用户基于token */ public static LoginUser getLoginUser(String token) { - SaSession session = StpUtil.getTokenSessionByToken(token); + Object loginId = StpUtil.getLoginIdByToken(token); + SaSession session = StpUtil.getSessionByLoginId(loginId); if (ObjectUtil.isNull(session)) { return null; } From 72e0d9aeb6b937345887421c22f750bb3ab78b8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Thu, 10 Aug 2023 13:01:35 +0800 Subject: [PATCH 29/29] =?UTF-8?q?reset=20=E5=9B=9E=E6=BB=9A=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/service/impl/SysOssConfigServiceImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysOssConfigServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysOssConfigServiceImpl.java index aca239e0d..4d421ee04 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysOssConfigServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysOssConfigServiceImpl.java @@ -13,6 +13,7 @@ import org.dromara.common.core.exception.ServiceException; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StreamUtils; import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.json.utils.JsonUtils; import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.common.oss.constant.OssConstant; @@ -65,7 +66,7 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService { if ("0".equals(config.getStatus())) { RedisUtils.setCacheObject(OssConstant.DEFAULT_CONFIG_KEY, configKey); } - CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), config); + CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config)); } } } finally { @@ -100,7 +101,7 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService { validEntityBeforeSave(config); boolean flag = baseMapper.insert(config) > 0; if (flag) { - CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), config); + CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config)); } return flag; } @@ -117,7 +118,7 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService { luw.eq(SysOssConfig::getOssConfigId, config.getOssConfigId()); boolean flag = baseMapper.update(config, luw) > 0; if (flag) { - CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), config); + CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config)); } return flag; }