| | |
| | | * @param collection 多个对象
|
| | | * @return
|
| | | */
|
| | | public long deleteObject(final Collection collection)
|
| | | public boolean deleteObject(final Collection collection)
|
| | | {
|
| | | return redisTemplate.delete(collection);
|
| | | return redisTemplate.delete(collection) > 0;
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 删除Hash中的数据
|
| | | * |
| | | * @param key
|
| | | * @param hKey
|
| | | */
|
| | | public void delCacheMapValue(final String key, final String hKey)
|
| | | {
|
| | | HashOperations hashOperations = redisTemplate.opsForHash();
|
| | | hashOperations.delete(key, hKey);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取多个Hash中的数据
|
| | | *
|
| | | * @param key Redis键
|
| | |
| | | */
|
| | | public boolean deleteCacheMapValue(final String key, final String hKey)
|
| | | {
|
| | | return Boolean.TRUE.equals(redisTemplate.opsForHash().delete(key, hKey));
|
| | | return redisTemplate.opsForHash().delete(key, hKey) > 0;
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | package com.ruoyi.project.system.controller;
|
| | |
|
| | | import java.util.Iterator;
|
| | | import java.util.List;
|
| | | import org.apache.commons.lang3.ArrayUtils;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | |
| | | public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId)
|
| | | {
|
| | | List<SysDept> depts = deptService.selectDeptList(new SysDept());
|
| | | Iterator<SysDept> it = depts.iterator();
|
| | | while (it.hasNext())
|
| | | {
|
| | | SysDept d = (SysDept) it.next();
|
| | | if (d.getDeptId().intValue() == deptId
|
| | | || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""))
|
| | | {
|
| | | it.remove();
|
| | | }
|
| | | }
|
| | | depts.removeIf(d -> d.getDeptId().intValue() == deptId || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""));
|
| | | return AjaxResult.success(depts);
|
| | | }
|
| | |
|
| | |
| | |
|
| | | public boolean getDefault()
|
| | | {
|
| | | return UserConstants.YES.equals(this.isDefault) ? true : false;
|
| | | return UserConstants.YES.equals(this.isDefault);
|
| | | }
|
| | |
|
| | | public String getIsDefault()
|