| | |
| | | import org.dromara.system.service.ISysDeptService; |
| | | import org.springframework.cache.annotation.CacheEvict; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.cache.annotation.Caching; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | * @param bo 部门信息 |
| | | * @return 结果 |
| | | */ |
| | | @CacheEvict(cacheNames = CacheNames.SYS_DEPT_AND_CHILD, allEntries = true) |
| | | @Override |
| | | public int insertDept(SysDeptBo bo) { |
| | | SysDept info = baseMapper.selectById(bo.getParentId()); |
| | |
| | | * @param bo 部门信息 |
| | | * @return 结果 |
| | | */ |
| | | @CacheEvict(cacheNames = CacheNames.SYS_DEPT, key = "#bo.deptId") |
| | | @Caching(evict = { |
| | | @CacheEvict(cacheNames = CacheNames.SYS_DEPT, key = "#bo.deptId"), |
| | | @CacheEvict(cacheNames = CacheNames.SYS_DEPT_AND_CHILD, allEntries = true) |
| | | }) |
| | | @Override |
| | | public int updateDept(SysDeptBo bo) { |
| | | SysDept dept = MapstructUtils.convert(bo, SysDept.class); |
| | |
| | | * @param deptId 部门ID |
| | | * @return 结果 |
| | | */ |
| | | @CacheEvict(cacheNames = CacheNames.SYS_DEPT, key = "#deptId") |
| | | @Caching(evict = { |
| | | @CacheEvict(cacheNames = CacheNames.SYS_DEPT, key = "#deptId"), |
| | | @CacheEvict(cacheNames = CacheNames.SYS_DEPT_AND_CHILD, key = "#deptId") |
| | | }) |
| | | @Override |
| | | public int deleteDeptById(Long deptId) { |
| | | return baseMapper.deleteById(deptId); |