Search in sources :

Example 1 with DictCacheKeyBuilder

use of com.albedo.java.modules.sys.cache.DictCacheKeyBuilder in project albedo by somowhere.

the class DictServiceImpl method removeByIds.

@Override
public boolean removeByIds(Collection<?> ids) {
    ids.forEach(id -> {
        // 查询父节点为当前节点的节点
        List<DictDo> menuList = this.list(Wrappers.<DictDo>query().lambda().eq(DictDo::getParentId, id));
        ArgumentAssert.notEmpty(menuList, () -> new BizException("字典含有下级不能删除"));
    });
    boolean b = super.removeByIds(ids);
    cacheOps.del(new DictCacheKeyBuilder().key(CACHE_FIND_CODES));
    return b;
}
Also used : BizException(com.albedo.java.common.core.exception.BizException) DictDo(com.albedo.java.modules.sys.domain.DictDo) DictCacheKeyBuilder(com.albedo.java.modules.sys.cache.DictCacheKeyBuilder)

Aggregations

BizException (com.albedo.java.common.core.exception.BizException)1 DictCacheKeyBuilder (com.albedo.java.modules.sys.cache.DictCacheKeyBuilder)1 DictDo (com.albedo.java.modules.sys.domain.DictDo)1