Browse Source

fix: 修改或者新增仓库了以后清除仓库列表缓存

pull/8/head
pref_mail@163.com 10 months ago
parent
commit
bb9e715070
  1. 8
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java

8
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java

@ -31,6 +31,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.cache.CacheObjNames;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.cache.utils.CacheUtil;
@ -211,7 +212,12 @@ public class BasicdataWarehouseController extends BladeController {
public R submit(@Valid @RequestBody BasicdataWarehouseEntity warehouseWarehouse) {
BladeUser user = AuthUtil.getUser();
CacheUtil.evict(CacheObjNames.basic_data_warehourse_list.getCacheName(), CacheObjNames.basic_data_warehourse_list.getKeyPrefix(),user.getUserId());
return R.status(warehouseService.saveOrUpdate(warehouseWarehouse));
boolean b = warehouseService.saveOrUpdate(warehouseWarehouse);
if(b){
// 清除缓存
bladeRedis.del(CacheNames.tenantKeyObj(user.getTenantId(), CacheNames.USER_WAREHOUSE_OWN, user.getUserId()));
}
return R.status(b);
}
/**

Loading…
Cancel
Save