From a8d798c38a6e7fb186b6d8a20953af200caefc8c Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期五, 22 七月 2022 17:34:14 +0800 Subject: [PATCH] fix 修复 RedisUtils 并发 set ttl 错误问题 --- ruoyi-common/src/main/java/com/ruoyi/common/enums/DataScopeType.java | 26 ++++++++++++++++---------- 1 files changed, 16 insertions(+), 10 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataScopeType.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataScopeType.java index f99413b..6432465 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataScopeType.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataScopeType.java @@ -6,15 +6,16 @@ /** * 鏁版嵁鏉冮檺绫诲瀷 - * + * <p> * 璇硶鏀寔 spel 妯℃澘琛ㄨ揪寮� - * - * 鍐呯疆鏁版嵁 user 褰撳墠鐢ㄦ埛 鍐呭鍙傝�� SysUser - * 濡傞渶鎵╁睍鏁版嵁 闇�寰� SysUser 鍐呮敞鍏� + * <p> + * 鍐呯疆鏁版嵁 user 褰撳墠鐢ㄦ埛 鍐呭鍙傝�� LoginUser + * 濡傞渶鎵╁睍鏁版嵁 鍙娇鐢� {@link com.ruoyi.common.helper.DataPermissionHelper} 鎿嶄綔 * 鍐呯疆鏈嶅姟 sdss 绯荤粺鏁版嵁鏉冮檺鏈嶅姟 鍐呭鍙傝�� SysDataScopeService * 濡傞渶鎵╁睍鏇村鑷畾涔夋湇鍔� 鍙互鍙傝�� sdss 鑷缂栧啓 * * @author Lion Li + * @version 3.5.0 */ @Getter @AllArgsConstructor @@ -23,34 +24,39 @@ /** * 鍏ㄩ儴鏁版嵁鏉冮檺 */ - ALL("1", ""), + ALL("1", "", ""), /** * 鑷畾鏁版嵁鏉冮檺 */ - CUSTOM("2", " #{#deptName} IN ( #{@sdss.getRoleCustom( #user.roleId )} ) "), + CUSTOM("2", " #{#deptName} IN ( #{@sdss.getRoleCustom( #user.roleId )} ) ", ""), /** * 閮ㄩ棬鏁版嵁鏉冮檺 */ - DEPT("3", " #{#deptName} = #{#user.deptId} "), + DEPT("3", " #{#deptName} = #{#user.deptId} ", ""), /** * 閮ㄩ棬鍙婁互涓嬫暟鎹潈闄� */ - DEPT_AND_CHILD("4", " #{#deptName} IN ( #{@sdss.getDeptAndChild( #user.deptId )} )"), + DEPT_AND_CHILD("4", " #{#deptName} IN ( #{@sdss.getDeptAndChild( #user.deptId )} )", ""), /** * 浠呮湰浜烘暟鎹潈闄� */ - SELF("5", " #{#userName?:1} = #{#user.userId} "); + SELF("5", " #{#userName} = #{#user.userId} ", " 1 = 0 "); private final String code; /** * 璇硶 閲囩敤 spel 妯℃澘琛ㄨ揪寮� */ - private final String sql; + private final String sqlTemplate; + + /** + * 涓嶆弧瓒� sqlTemplate 鍒欏~鍏� + */ + private final String elseSql; public static DataScopeType findCode(String code) { if (StringUtils.isBlank(code)) { -- Gitblit v1.9.3