|
|
@ -38,12 +38,14 @@ public class SysCache { |
|
|
|
private static final String MENU_ID = "menu:id:"; |
|
|
|
private static final String MENU_ID = "menu:id:"; |
|
|
|
private static final String DEPT_ID = "dept:id:"; |
|
|
|
private static final String DEPT_ID = "dept:id:"; |
|
|
|
private static final String DEPT_NAME = "dept:name:"; |
|
|
|
private static final String DEPT_NAME = "dept:name:"; |
|
|
|
|
|
|
|
private static final String DEPT_NAME_FUZZY = "dept:nameFuzzy:"; |
|
|
|
private static final String DEPT_NAME_ID = "deptName:id:"; |
|
|
|
private static final String DEPT_NAME_ID = "deptName:id:"; |
|
|
|
private static final String DEPT_NAMES_ID = "deptNames:id:"; |
|
|
|
private static final String DEPT_NAMES_ID = "deptNames:id:"; |
|
|
|
private static final String DEPT_CHILD_ID = "deptChild:id:"; |
|
|
|
private static final String DEPT_CHILD_ID = "deptChild:id:"; |
|
|
|
private static final String DEPT_CHILDIDS_ID = "deptChildIds:id:"; |
|
|
|
private static final String DEPT_CHILDIDS_ID = "deptChildIds:id:"; |
|
|
|
private static final String POST_ID = "post:id:"; |
|
|
|
private static final String POST_ID = "post:id:"; |
|
|
|
private static final String POST_NAME = "post:name:"; |
|
|
|
private static final String POST_NAME = "post:name:"; |
|
|
|
|
|
|
|
private static final String POST_NAME_FUZZY = "post:nameFuzzy:"; |
|
|
|
private static final String POST_NAME_ID = "postName:id:"; |
|
|
|
private static final String POST_NAME_ID = "postName:id:"; |
|
|
|
private static final String POST_NAMES_ID = "postNames:id:"; |
|
|
|
private static final String POST_NAMES_ID = "postNames:id:"; |
|
|
|
private static final String ROLE_ID = "role:id:"; |
|
|
|
private static final String ROLE_ID = "role:id:"; |
|
|
@ -68,7 +70,7 @@ public class SysCache { |
|
|
|
* 获取菜单 |
|
|
|
* 获取菜单 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param id 主键 |
|
|
|
* @param id 主键 |
|
|
|
* @return |
|
|
|
* @return 菜单 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static Menu getMenu(Long id) { |
|
|
|
public static Menu getMenu(Long id) { |
|
|
|
return CacheUtil.get(SYS_CACHE, MENU_ID, id, () -> { |
|
|
|
return CacheUtil.get(SYS_CACHE, MENU_ID, id, () -> { |
|
|
@ -81,7 +83,7 @@ public class SysCache { |
|
|
|
* 获取部门 |
|
|
|
* 获取部门 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param id 主键 |
|
|
|
* @param id 主键 |
|
|
|
* @return |
|
|
|
* @return 部门 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static Dept getDept(Long id) { |
|
|
|
public static Dept getDept(Long id) { |
|
|
|
return CacheUtil.get(SYS_CACHE, DEPT_ID, id, () -> { |
|
|
|
return CacheUtil.get(SYS_CACHE, DEPT_ID, id, () -> { |
|
|
@ -95,7 +97,7 @@ public class SysCache { |
|
|
|
* |
|
|
|
* |
|
|
|
* @param tenantId 租户id |
|
|
|
* @param tenantId 租户id |
|
|
|
* @param deptNames 部门名 |
|
|
|
* @param deptNames 部门名 |
|
|
|
* @return |
|
|
|
* @return 部门id |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static String getDeptIds(String tenantId, String deptNames) { |
|
|
|
public static String getDeptIds(String tenantId, String deptNames) { |
|
|
|
return CacheUtil.get(SYS_CACHE, DEPT_NAME, tenantId + StringPool.DASH + deptNames, () -> { |
|
|
|
return CacheUtil.get(SYS_CACHE, DEPT_NAME, tenantId + StringPool.DASH + deptNames, () -> { |
|
|
@ -104,6 +106,20 @@ public class SysCache { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 获取部门id |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param tenantId 租户id |
|
|
|
|
|
|
|
* @param deptNames 部门名模糊查询 |
|
|
|
|
|
|
|
* @return 部门id |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static String getDeptIdsByFuzzy(String tenantId, String deptNames) { |
|
|
|
|
|
|
|
return CacheUtil.get(SYS_CACHE, DEPT_NAME_FUZZY, tenantId + StringPool.DASH + deptNames, () -> { |
|
|
|
|
|
|
|
R<String> result = getSysClient().getDeptIdsByFuzzy(tenantId, deptNames); |
|
|
|
|
|
|
|
return result.getData(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 获取部门名 |
|
|
|
* 获取部门名 |
|
|
|
* |
|
|
|
* |
|
|
@ -195,6 +211,20 @@ public class SysCache { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 获取岗位id |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param tenantId 租户id |
|
|
|
|
|
|
|
* @param postNames 岗位名模糊查询 |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static String getPostIdsByFuzzy(String tenantId, String postNames) { |
|
|
|
|
|
|
|
return CacheUtil.get(SYS_CACHE, POST_NAME_FUZZY, tenantId + StringPool.DASH + postNames, () -> { |
|
|
|
|
|
|
|
R<String> result = getSysClient().getPostIdsByFuzzy(tenantId, postNames); |
|
|
|
|
|
|
|
return result.getData(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 获取岗位名 |
|
|
|
* 获取岗位名 |
|
|
|
* |
|
|
|
* |
|
|
|