update 优化修改部门信息增加事务
This commit is contained in:
parent
08e40b611b
commit
4de9fa33b7
@ -31,6 +31,7 @@ import org.springframework.cache.annotation.CacheEvict;
|
|||||||
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
import org.springframework.cache.annotation.Caching;
|
import org.springframework.cache.annotation.Caching;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@ -301,6 +302,7 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService {
|
|||||||
@CacheEvict(cacheNames = CacheNames.SYS_DEPT_AND_CHILD, allEntries = true)
|
@CacheEvict(cacheNames = CacheNames.SYS_DEPT_AND_CHILD, allEntries = true)
|
||||||
})
|
})
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public int updateDept(SysDeptBo bo) {
|
public int updateDept(SysDeptBo bo) {
|
||||||
SysDept dept = MapstructUtils.convert(bo, SysDept.class);
|
SysDept dept = MapstructUtils.convert(bo, SysDept.class);
|
||||||
SysDept oldDept = baseMapper.selectById(dept.getDeptId());
|
SysDept oldDept = baseMapper.selectById(dept.getDeptId());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user