[bug]修复业务字典修改时缓存不清空的问题, 使用缓存时不使用租户

master
liuqingkun 3 years ago
parent aa258ffd03
commit fceb043321
  1. 3
      src/main/java/org/springblade/common/cache/DeptCache.java
  2. 10
      src/main/java/org/springblade/common/cache/DictBizCache.java
  3. 5
      src/main/java/org/springblade/common/cache/ParamCache.java
  4. 3
      src/main/java/org/springblade/common/cache/RegionCache.java
  5. 41
      src/main/java/org/springblade/common/cache/SysCache.java
  6. 5
      src/main/java/org/springblade/common/cache/UserCache.java
  7. 1
      src/main/java/org/springblade/common/constant/BusinessConstant.java
  8. 17
      src/main/java/org/springblade/modules/auth/endpoint/BladeTokenEndPoint.java
  9. 6
      src/main/java/org/springblade/modules/business/controller/CommonApiController.java
  10. 1
      src/main/java/org/springblade/modules/business/service/impl/ApmRecordServiceImpl.java
  11. 4
      src/main/java/org/springblade/modules/system/controller/DeptController.java
  12. 4
      src/main/java/org/springblade/modules/system/controller/DictBizController.java
  13. 9
      src/main/java/org/springblade/modules/system/controller/UserController.java
  14. 3
      src/main/java/org/springblade/modules/system/service/impl/DictBizServiceImpl.java
  15. 2
      src/main/resources/application.yml

@ -16,6 +16,7 @@
*/
package org.springblade.common.cache;
import org.springblade.common.constant.BusinessConstant;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.tool.utils.SpringUtil;
import org.springblade.modules.system.entity.Dept;
@ -47,7 +48,7 @@ public class DeptCache {
* @return
*/
public static Dept getDept(Long id) {
return CacheUtil.get(DEPT_CACHE, DEPT_CACHE_ID, id, () -> deptService.getById(id), Boolean.FALSE);
return CacheUtil.get(DEPT_CACHE, DEPT_CACHE_ID, id, () -> deptService.getById(id), BusinessConstant.TENANT_MODE);
}
}

@ -55,7 +55,7 @@ public class DictBizCache {
*/
public static DictBiz getById(Long id) {
String keyPrefix = DICT_ID.concat(StringPool.DASH).concat(AuthUtil.getTenantId()).concat(StringPool.COLON);
return CacheUtil.get(DICT_CACHE, keyPrefix, id, () -> dictService.getById(id));
return CacheUtil.get(DICT_CACHE, keyPrefix, id, () -> dictService.getById(id), BusinessConstant.TENANT_MODE);
}
/**
@ -78,7 +78,7 @@ public class DictBizCache {
*/
public static String getValue(String code, Integer dictKey) {
String keyPrefix = DICT_VALUE.concat(StringPool.DASH).concat(AuthUtil.getTenantId()).concat(StringPool.COLON);
return CacheUtil.get(DICT_CACHE, keyPrefix + code + StringPool.COLON, String.valueOf(dictKey), () -> dictService.getValue(code, String.valueOf(dictKey)));
return CacheUtil.get(DICT_CACHE, keyPrefix + code + StringPool.COLON, String.valueOf(dictKey), () -> dictService.getValue(code, String.valueOf(dictKey)), BusinessConstant.TENANT_MODE);
}
/**
@ -101,7 +101,7 @@ public class DictBizCache {
*/
public static String getValue(String code, String dictKey) {
String keyPrefix = DICT_VALUE.concat(StringPool.DASH).concat(AuthUtil.getTenantId()).concat(StringPool.COLON);
return CacheUtil.get(DICT_CACHE, keyPrefix + code + StringPool.COLON, dictKey, () -> dictService.getValue(code, dictKey));
return CacheUtil.get(DICT_CACHE, keyPrefix + code + StringPool.COLON, dictKey, () -> dictService.getValue(code, dictKey), BusinessConstant.TENANT_MODE);
}
/**
@ -112,7 +112,7 @@ public class DictBizCache {
*/
public static List<DictBiz> getList(String code) {
String keyPrefix = DICT_LIST.concat(StringPool.DASH).concat(AuthUtil.getTenantId()).concat(StringPool.COLON);
return CacheUtil.get(DICT_CACHE, keyPrefix, code, () -> dictService.getList(code));
return CacheUtil.get(DICT_CACHE, keyPrefix, code, () -> dictService.getList(code), BusinessConstant.TENANT_MODE);
}
private static final String COMMON_BUSINESS_DICT_KEY = "1";
@ -147,7 +147,7 @@ public class DictBizCache {
value = Integer.parseInt(valueStr);
}
CacheUtil.put(DICT_VALUE, dictCode, COMMON_BUSINESS_DICT_KEY, value);
CacheUtil.put(DICT_VALUE, dictCode, COMMON_BUSINESS_DICT_KEY, value, BusinessConstant.TENANT_MODE);
}
return value;

@ -16,6 +16,7 @@
*/
package org.springblade.common.cache;
import org.springblade.common.constant.BusinessConstant;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.tool.utils.SpringUtil;
import org.springblade.modules.system.entity.Param;
@ -46,7 +47,7 @@ public class ParamCache {
* @return Param
*/
public static Param getById(Long id) {
return CacheUtil.get(PARAM_CACHE, PARAM_ID, id, () -> paramService.getById(id));
return CacheUtil.get(PARAM_CACHE, PARAM_ID, id, () -> paramService.getById(id), BusinessConstant.TENANT_MODE);
}
/**
@ -56,7 +57,7 @@ public class ParamCache {
* @return String
*/
public static String getValue(String paramKey) {
return CacheUtil.get(PARAM_CACHE, PARAM_VALUE, paramKey, () -> paramService.getValue(paramKey));
return CacheUtil.get(PARAM_CACHE, PARAM_VALUE, paramKey, () -> paramService.getValue(paramKey), BusinessConstant.TENANT_MODE);
}
}

@ -16,6 +16,7 @@
*/
package org.springblade.common.cache;
import org.springblade.common.constant.BusinessConstant;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.tool.utils.SpringUtil;
import org.springblade.modules.system.entity.Region;
@ -50,7 +51,7 @@ public class RegionCache {
* @return Param
*/
public static Region getByCode(String code) {
return CacheUtil.get(SYS_CACHE, REGION_CODE, code, () -> regionService.getById(code));
return CacheUtil.get(SYS_CACHE, REGION_CODE, code, () -> regionService.getById(code), BusinessConstant.TENANT_MODE);
}
}

@ -16,6 +16,7 @@
*/
package org.springblade.common.cache;
import org.springblade.common.constant.BusinessConstant;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.tool.utils.SpringUtil;
import org.springblade.core.tool.utils.StringPool;
@ -80,7 +81,7 @@ public class SysCache {
* @return 菜单
*/
public static Menu getMenu(Long id) {
return CacheUtil.get(SYS_CACHE, MENU_ID, id, () -> menuService.getById(id));
return CacheUtil.get(SYS_CACHE, MENU_ID, id, () -> menuService.getById(id), BusinessConstant.TENANT_MODE);
}
/**
@ -90,7 +91,7 @@ public class SysCache {
* @return 部门
*/
public static Dept getDept(Long id) {
return CacheUtil.get(SYS_CACHE, DEPT_ID, id, () -> deptService.getById(id));
return CacheUtil.get(SYS_CACHE, DEPT_ID, id, () -> deptService.getById(id), BusinessConstant.TENANT_MODE);
}
/**
@ -101,7 +102,7 @@ public class SysCache {
* @return 部门id
*/
public static String getDeptIds(String tenantId, String deptNames) {
return CacheUtil.get(SYS_CACHE, DEPT_NAME, tenantId + StringPool.DASH + deptNames, () -> deptService.getDeptIds(tenantId, deptNames));
return CacheUtil.get(SYS_CACHE, DEPT_NAME, tenantId + StringPool.DASH + deptNames, () -> deptService.getDeptIds(tenantId, deptNames), BusinessConstant.TENANT_MODE);
}
/**
@ -112,7 +113,7 @@ public class SysCache {
* @return 部门id
*/
public static String getDeptIdsByFuzzy(String tenantId, String deptNames) {
return CacheUtil.get(SYS_CACHE, DEPT_NAME_FUZZY, tenantId + StringPool.DASH + deptNames, () -> deptService.getDeptIdsByFuzzy(tenantId, deptNames));
return CacheUtil.get(SYS_CACHE, DEPT_NAME_FUZZY, tenantId + StringPool.DASH + deptNames, () -> deptService.getDeptIdsByFuzzy(tenantId, deptNames), BusinessConstant.TENANT_MODE);
}
/**
@ -122,7 +123,7 @@ public class SysCache {
* @return 部门名
*/
public static String getDeptName(Long id) {
return CacheUtil.get(SYS_CACHE, DEPT_NAME_ID, id, () -> deptService.getById(id).getDeptName());
return CacheUtil.get(SYS_CACHE, DEPT_NAME_ID, id, () -> deptService.getById(id).getDeptName(), BusinessConstant.TENANT_MODE);
}
@ -133,7 +134,7 @@ public class SysCache {
* @return 部门名
*/
public static List<String> getDeptNames(String deptIds) {
return CacheUtil.get(SYS_CACHE, DEPT_NAMES_ID, deptIds, () -> deptService.getDeptNames(deptIds));
return CacheUtil.get(SYS_CACHE, DEPT_NAMES_ID, deptIds, () -> deptService.getDeptNames(deptIds), BusinessConstant.TENANT_MODE);
}
/**
@ -143,7 +144,7 @@ public class SysCache {
* @return 子部门
*/
public static List<Dept> getDeptChild(Long deptId) {
return CacheUtil.get(SYS_CACHE, DEPT_CHILD_ID, deptId, () -> deptService.getDeptChild(deptId));
return CacheUtil.get(SYS_CACHE, DEPT_CHILD_ID, deptId, () -> deptService.getDeptChild(deptId), BusinessConstant.TENANT_MODE);
}
/**
@ -156,7 +157,7 @@ public class SysCache {
if (deptId == null) {
return null;
}
List<Long> deptIdList = CacheUtil.get(SYS_CACHE, DEPT_CHILDIDS_ID, deptId, List.class);
List<Long> deptIdList = CacheUtil.get(SYS_CACHE, DEPT_CHILDIDS_ID, deptId, List.class, BusinessConstant.TENANT_MODE);
if (deptIdList == null) {
deptIdList = new ArrayList<>();
List<Dept> deptChild = getDeptChild(deptId);
@ -165,7 +166,7 @@ public class SysCache {
deptIdList.addAll(collect);
}
deptIdList.add(deptId);
CacheUtil.put(SYS_CACHE, DEPT_CHILDIDS_ID, deptId, deptIdList);
CacheUtil.put(SYS_CACHE, DEPT_CHILDIDS_ID, deptId, deptIdList, BusinessConstant.TENANT_MODE);
}
return deptIdList;
}
@ -177,7 +178,7 @@ public class SysCache {
* @return
*/
public static Post getPost(Long id) {
return CacheUtil.get(SYS_CACHE, POST_ID, id, () -> postService.getById(id));
return CacheUtil.get(SYS_CACHE, POST_ID, id, () -> postService.getById(id), BusinessConstant.TENANT_MODE);
}
/**
@ -188,7 +189,7 @@ public class SysCache {
* @return
*/
public static String getPostIds(String tenantId, String postNames) {
return CacheUtil.get(SYS_CACHE, POST_NAME, tenantId + StringPool.DASH + postNames, () -> postService.getPostIds(tenantId, postNames));
return CacheUtil.get(SYS_CACHE, POST_NAME, tenantId + StringPool.DASH + postNames, () -> postService.getPostIds(tenantId, postNames), BusinessConstant.TENANT_MODE);
}
/**
@ -199,7 +200,7 @@ public class SysCache {
* @return
*/
public static String getPostIdsByFuzzy(String tenantId, String postNames) {
return CacheUtil.get(SYS_CACHE, POST_NAME_FUZZY, tenantId + StringPool.DASH + postNames, () -> postService.getPostIdsByFuzzy(tenantId, postNames));
return CacheUtil.get(SYS_CACHE, POST_NAME_FUZZY, tenantId + StringPool.DASH + postNames, () -> postService.getPostIdsByFuzzy(tenantId, postNames), BusinessConstant.TENANT_MODE);
}
/**
@ -209,7 +210,7 @@ public class SysCache {
* @return 岗位名
*/
public static String getPostName(Long id) {
return CacheUtil.get(SYS_CACHE, POST_NAME_ID, id, () -> postService.getById(id).getPostName());
return CacheUtil.get(SYS_CACHE, POST_NAME_ID, id, () -> postService.getById(id).getPostName(), BusinessConstant.TENANT_MODE);
}
/**
@ -219,7 +220,7 @@ public class SysCache {
* @return 岗位名
*/
public static List<String> getPostNames(String postIds) {
return CacheUtil.get(SYS_CACHE, POST_NAMES_ID, postIds, () -> postService.getPostNames(postIds));
return CacheUtil.get(SYS_CACHE, POST_NAMES_ID, postIds, () -> postService.getPostNames(postIds), BusinessConstant.TENANT_MODE);
}
/**
@ -229,7 +230,7 @@ public class SysCache {
* @return Role
*/
public static Role getRole(Long id) {
return CacheUtil.get(SYS_CACHE, ROLE_ID, id, () -> roleService.getById(id));
return CacheUtil.get(SYS_CACHE, ROLE_ID, id, () -> roleService.getById(id), BusinessConstant.TENANT_MODE);
}
/**
@ -240,7 +241,7 @@ public class SysCache {
* @return
*/
public static String getRoleIds(String tenantId, String roleNames) {
return CacheUtil.get(SYS_CACHE, ROLE_NAME, tenantId + StringPool.DASH + roleNames, () -> roleService.getRoleIds(tenantId, roleNames));
return CacheUtil.get(SYS_CACHE, ROLE_NAME, tenantId + StringPool.DASH + roleNames, () -> roleService.getRoleIds(tenantId, roleNames), BusinessConstant.TENANT_MODE);
}
/**
@ -250,7 +251,7 @@ public class SysCache {
* @return 角色名
*/
public static String getRoleName(Long id) {
return CacheUtil.get(SYS_CACHE, ROLE_NAME_ID, id, () -> roleService.getById(id).getRoleName());
return CacheUtil.get(SYS_CACHE, ROLE_NAME_ID, id, () -> roleService.getById(id).getRoleName(), BusinessConstant.TENANT_MODE);
}
/**
@ -260,7 +261,7 @@ public class SysCache {
* @return 角色名
*/
public static List<String> getRoleNames(String roleIds) {
return CacheUtil.get(SYS_CACHE, ROLE_NAMES_ID, roleIds, () -> roleService.getRoleNames(roleIds));
return CacheUtil.get(SYS_CACHE, ROLE_NAMES_ID, roleIds, () -> roleService.getRoleNames(roleIds), BusinessConstant.TENANT_MODE);
}
/**
@ -270,7 +271,7 @@ public class SysCache {
* @return 角色别名
*/
public static String getRoleAlias(Long id) {
return CacheUtil.get(SYS_CACHE, ROLE_ALIAS_ID, id, () -> roleService.getById(id).getRoleAlias());
return CacheUtil.get(SYS_CACHE, ROLE_ALIAS_ID, id, () -> roleService.getById(id).getRoleAlias(), BusinessConstant.TENANT_MODE);
}
/**
@ -280,7 +281,7 @@ public class SysCache {
* @return 角色别名
*/
public static List<String> getRoleAliases(String roleIds) {
return CacheUtil.get(SYS_CACHE, ROLE_ALIASES_ID, roleIds, () -> roleService.getRoleAliases(roleIds));
return CacheUtil.get(SYS_CACHE, ROLE_ALIASES_ID, roleIds, () -> roleService.getRoleAliases(roleIds), BusinessConstant.TENANT_MODE);
}
/**

@ -16,6 +16,7 @@
*/
package org.springblade.common.cache;
import org.springblade.common.constant.BusinessConstant;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.SpringUtil;
@ -60,7 +61,7 @@ public class UserCache {
* @return
*/
public static User getUser(Long userId) {
return CacheUtil.get(USER_CACHE, USER_CACHE_ID, userId, () -> userService.getById(userId));
return CacheUtil.get(USER_CACHE, USER_CACHE_ID, userId, () -> userService.getById(userId), BusinessConstant.TENANT_MODE);
}
/**
@ -71,7 +72,7 @@ public class UserCache {
* @return
*/
public static User getUser(String tenantId, String account) {
return CacheUtil.get(USER_CACHE, USER_CACHE_ACCOUNT, tenantId + StringPool.DASH + account, () -> userService.userByAccount(tenantId, account));
return CacheUtil.get(USER_CACHE, USER_CACHE_ACCOUNT, tenantId + StringPool.DASH + account, () -> userService.userByAccount(tenantId, account), BusinessConstant.TENANT_MODE);
}
}

@ -7,6 +7,7 @@ package org.springblade.common.constant;
*/
public interface BusinessConstant {
Boolean TENANT_MODE = Boolean.FALSE;
String PW_PATTERN = "^(?![A-Za-z0-9]+$)(?![a-z0-9\\W]+$)(?![A-Za-z\\W]+$)(?![A-Z0-9\\W]+$)[a-zA-Z0-9\\W]{8,18}$";
String STRING_EMPTY = "";
String DATE_STR_DAY_START_HMS = " 00:00:00";

@ -23,6 +23,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.constant.BusinessConstant;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.jwt.JwtUtil;
import org.springblade.core.jwt.props.JwtProperties;
@ -132,14 +133,14 @@ public class BladeTokenEndPoint {
@GetMapping("/oauth/clear-cache")
@ApiOperation(value = "清除缓存")
public Kv clearCache() {
CacheUtil.clear(BIZ_CACHE);
CacheUtil.clear(USER_CACHE);
CacheUtil.clear(DICT_CACHE);
CacheUtil.clear(FLOW_CACHE);
CacheUtil.clear(SYS_CACHE);
CacheUtil.clear(PARAM_CACHE);
CacheUtil.clear(RESOURCE_CACHE);
CacheUtil.clear(MENU_CACHE);
CacheUtil.clear(BIZ_CACHE, BusinessConstant.TENANT_MODE);
CacheUtil.clear(USER_CACHE, BusinessConstant.TENANT_MODE);
CacheUtil.clear(DICT_CACHE, BusinessConstant.TENANT_MODE);
CacheUtil.clear(FLOW_CACHE, BusinessConstant.TENANT_MODE);
CacheUtil.clear(SYS_CACHE, BusinessConstant.TENANT_MODE);
CacheUtil.clear(PARAM_CACHE, BusinessConstant.TENANT_MODE);
CacheUtil.clear(RESOURCE_CACHE, BusinessConstant.TENANT_MODE);
CacheUtil.clear(MENU_CACHE, BusinessConstant.TENANT_MODE);
CacheUtil.clear(DICT_CACHE, Boolean.FALSE);
CacheUtil.clear(MENU_CACHE, Boolean.FALSE);
CacheUtil.clear(SYS_CACHE, Boolean.FALSE);

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.*;
import lombok.AllArgsConstructor;
import org.springblade.common.cache.DictBizCache;
import org.springblade.common.constant.BusinessConstant;
import org.springblade.common.constant.CommonConstant;
import org.springblade.common.utils.CommonDateUtil;
@ -40,4 +41,9 @@ public class CommonApiController extends BladeController {
public R getSystemDatetime() {
return R.data(CommonDateUtil.getNowString());
}
@GetMapping("/test")
public R test() {
return R.data(DictBizCache.getDictValueWithOffset(BusinessConstant.DICT_KEY_BLACKLIST_OUTDATE));
}
}

@ -121,6 +121,7 @@ public class ApmRecordServiceImpl extends BaseServiceImpl<ApmRecordMapper, ApmRe
String cupCardNo = apmRecordList.get(0).getCupCardNo();
Date apmDay = apmRecordList.get(0).getApmDay();
System.out.println(DictBizCache.getDictValueWithOffset("save check : "+BusinessConstant.DICT_KEY_BLACKLIST_OUTDATE));
// 判断用户是否正在被拉黑
Blacklist blacklist = blacklistService.getLatelyRecord(cupCardNo);
if (Func.isNotEmpty(blacklist) && CommonDateUtil.daysBetweenWithoutStartDay(blacklist.getCreateTime(), DateUtil.now()) < DictBizCache.getDictValueWithOffset(BusinessConstant.DICT_KEY_BLACKLIST_OUTDATE)) {

@ -139,7 +139,7 @@ public class DeptController extends BladeController {
@ApiOperation(value = "新增或修改", notes = "传入dept")
public R submit(@Valid @RequestBody Dept dept) {
if (deptService.submit(dept)) {
CacheUtil.clear(SYS_CACHE);
CacheUtil.clear(SYS_CACHE, BusinessConstant.TENANT_MODE);
// 返回懒加载树更新节点所需字段
Kv kv = Kv.create().set("id", String.valueOf(dept.getId())).set("tenantId", dept.getTenantId())
.set("deptCategoryName", DictCache.getValue(DictEnum.ORG_CATEGORY, dept.getDeptCategory()));
@ -155,7 +155,7 @@ public class DeptController extends BladeController {
@ApiOperationSupport(order = 7)
@ApiOperation(value = "删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
CacheUtil.clear(SYS_CACHE);
CacheUtil.clear(SYS_CACHE, BusinessConstant.TENANT_MODE);
return R.status(deptService.removeDept(ids));
}

@ -140,7 +140,7 @@ public class DictBizController extends BladeController {
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入dict")
public R submit(@Valid @RequestBody DictBiz dict) {
CacheUtil.clear(DICT_CACHE);
CacheUtil.clear(DICT_CACHE, BusinessConstant.TENANT_MODE);
return R.status(dictService.submit(dict));
}
@ -151,7 +151,7 @@ public class DictBizController extends BladeController {
@ApiOperationSupport(order = 7)
@ApiOperation(value = "删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
CacheUtil.clear(DICT_CACHE);
CacheUtil.clear(DICT_CACHE, BusinessConstant.TENANT_MODE);
return R.status(dictService.removeDict(ids));
}

@ -27,6 +27,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.constant.BusinessConstant;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.launch.constant.AppConstant;
@ -141,7 +142,7 @@ public class UserController {
@ApiOperation(value = "新增或修改", notes = "传入User")
@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
public R submit(@Valid @RequestBody User user) {
CacheUtil.clear(USER_CACHE);
CacheUtil.clear(USER_CACHE, BusinessConstant.TENANT_MODE);
return R.status(userService.submit(user));
}
@ -152,7 +153,7 @@ public class UserController {
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改", notes = "传入User")
public R update(@Valid @RequestBody User user) {
CacheUtil.clear(USER_CACHE);
CacheUtil.clear(USER_CACHE, BusinessConstant.TENANT_MODE);
return R.status(userService.updateUser(user));
}
@ -164,7 +165,7 @@ public class UserController {
@ApiOperation(value = "删除", notes = "传入id集合")
@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
public R remove(@RequestParam String ids) {
CacheUtil.clear(USER_CACHE);
CacheUtil.clear(USER_CACHE, BusinessConstant.TENANT_MODE);
return R.status(userService.removeUser(ids));
}
@ -213,7 +214,7 @@ public class UserController {
@ApiOperationSupport(order = 10)
@ApiOperation(value = "修改基本信息", notes = "传入User")
public R updateInfo(@Valid @RequestBody User user) {
CacheUtil.clear(USER_CACHE);
CacheUtil.clear(USER_CACHE, BusinessConstant.TENANT_MODE);
return R.status(userService.updateUserInfo(user));
}

@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.common.cache.DictBizCache;
import org.springblade.common.constant.BusinessConstant;
import org.springblade.common.constant.CommonConstant;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.log.exception.ServiceException;
@ -87,7 +88,7 @@ public class DictBizServiceImpl extends ServiceImpl<DictBizMapper, DictBiz> impl
dict.setParentId(BladeConstant.TOP_PARENT_ID);
}
dict.setIsDeleted(BladeConstant.DB_NOT_DELETED);
CacheUtil.clear(DICT_CACHE);
CacheUtil.clear(DICT_CACHE, BusinessConstant.TENANT_MODE);
return saveOrUpdate(dict);
}

@ -155,7 +155,7 @@ blade:
- /blade-business/apm-record/save
- /blade-business/apm-record/page
- /blade-business/apm-record/cancel
- /blade-business/common-api/get-system-datetime
- /blade-business/common-api/*
#多租户配置
tenant:
#多租户增强

Loading…
Cancel
Save