update 优化修改部门信息增加事务

This commit is contained in:
AprilWind
2025-01-07 05:32:14 +08:00
parent 6ecb8447b6
commit a4b19e4879

View File

@@ -28,6 +28,7 @@ import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.cache.annotation.Caching;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
@@ -279,6 +280,7 @@ public class SysDeptServiceImpl implements ISysDeptService {
@CacheEvict(cacheNames = CacheNames.SYS_DEPT_AND_CHILD, allEntries = true)
})
@Override
@Transactional(rollbackFor = Exception.class)
public int updateDept(SysDeptBo bo) {
SysDept dept = MapstructUtils.convert(bo, SysDept.class);
SysDept oldDept = baseMapper.selectById(dept.getDeptId());