mirror of https://gitee.com/y_project/RuoYi.git
根据开发规范,使用事务的地方必须手动设置回滚的异常类型
parent
9d02f8f7e7
commit
666c6af944
|
@ -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);
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
// 修改角色信息
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue