根据开发规范,使用事务的地方必须手动设置回滚的异常类型

pull/434/head
zhuqinshu 2022-12-19 19:33:19 +08:00
parent 9d02f8f7e7
commit 666c6af944
5 changed files with 16 additions and 16 deletions

View File

@ -122,7 +122,7 @@ public class GenTableServiceImpl implements IGenTableService
* @return
*/
@Override
@Transactional
@Transactional(rollbackFor = Exception.class)
public void updateGenTable(GenTable genTable)
{
String options = JSON.toJSONString(genTable.getParams());
@ -144,7 +144,7 @@ public class GenTableServiceImpl implements IGenTableService
* @return
*/
@Override
@Transactional
@Transactional(rollbackFor = Exception.class)
public void deleteGenTableByIds(String ids)
{
genTableMapper.deleteGenTableByIds(Convert.toLongArray(ids));
@ -170,7 +170,7 @@ public class GenTableServiceImpl implements IGenTableService
* @param operName
*/
@Override
@Transactional
@Transactional(rollbackFor = Exception.class)
public void importGenTable(List<GenTable> tableList, String operName)
{
try
@ -295,7 +295,7 @@ public class GenTableServiceImpl implements IGenTableService
* @param tableName
*/
@Override
@Transactional
@Transactional(rollbackFor = Exception.class)
public void synchDb(String tableName)
{
GenTable table = genTableMapper.selectGenTableByName(tableName);

View File

@ -210,7 +210,7 @@ public class SysDeptServiceImpl implements ISysDeptService
* @return
*/
@Override
@Transactional
@Transactional(rollbackFor = Exception.class)
public int updateDept(SysDept dept)
{
SysDept newParentDept = deptMapper.selectDeptById(dept.getParentId());

View File

@ -193,7 +193,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
* @return
*/
@Override
@Transactional
@Transactional(rollbackFor = Exception.class)
public int updateDictType(SysDictType dict)
{
SysDictType oldDict = dictTypeMapper.selectDictTypeById(dict.getDictId());

View File

@ -135,7 +135,7 @@ public class SysRoleServiceImpl implements ISysRoleService
* @return
*/
@Override
@Transactional
@Transactional(rollbackFor = Exception.class)
public boolean deleteRoleById(Long roleId)
{
// 删除角色与菜单关联
@ -152,7 +152,7 @@ public class SysRoleServiceImpl implements ISysRoleService
* @throws Exception
*/
@Override
@Transactional
@Transactional(rollbackFor = Exception.class)
public int deleteRoleByIds(String ids)
{
Long[] roleIds = Convert.toLongArray(ids);
@ -180,7 +180,7 @@ public class SysRoleServiceImpl implements ISysRoleService
* @return
*/
@Override
@Transactional
@Transactional(rollbackFor = Exception.class)
public int insertRole(SysRole role)
{
// 新增角色信息
@ -195,7 +195,7 @@ public class SysRoleServiceImpl implements ISysRoleService
* @return
*/
@Override
@Transactional
@Transactional(rollbackFor = Exception.class)
public int updateRole(SysRole role)
{
// 修改角色信息
@ -212,7 +212,7 @@ public class SysRoleServiceImpl implements ISysRoleService
* @return
*/
@Override
@Transactional
@Transactional(rollbackFor = Exception.class)
public int authDataScope(SysRole role)
{
// 修改角色信息

View File

@ -169,7 +169,7 @@ public class SysUserServiceImpl implements ISysUserService
* @return
*/
@Override
@Transactional
@Transactional(rollbackFor = Exception.class)
public int deleteUserById(Long userId)
{
// 删除用户与角色关联
@ -186,7 +186,7 @@ public class SysUserServiceImpl implements ISysUserService
* @return
*/
@Override
@Transactional
@Transactional(rollbackFor = Exception.class)
public int deleteUserByIds(String ids)
{
Long[] userIds = Convert.toLongArray(ids);
@ -209,7 +209,7 @@ public class SysUserServiceImpl implements ISysUserService
* @return
*/
@Override
@Transactional
@Transactional(rollbackFor = Exception.class)
public int insertUser(SysUser user)
{
// 新增用户信息
@ -241,7 +241,7 @@ public class SysUserServiceImpl implements ISysUserService
* @return
*/
@Override
@Transactional
@Transactional(rollbackFor = Exception.class)
public int updateUser(SysUser user)
{
Long userId = user.getUserId();
@ -275,7 +275,7 @@ public class SysUserServiceImpl implements ISysUserService
* @param roleIds
*/
@Override
@Transactional
@Transactional(rollbackFor = Exception.class)
public void insertUserAuth(Long userId, Long[] roleIds)
{
userRoleMapper.deleteUserRoleByUserId(userId);