Explorar o código

update 补全事务注解异常

疯狂的狮子Li %!s(int64=4) %!d(string=hai) anos
pai
achega
14c412113f

+ 4 - 4
ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/service/GenTableServiceImpl.java

@@ -121,7 +121,7 @@ public class GenTableServiceImpl implements IGenTableService
121
      * @return 结果
121
      * @return 结果
122
      */
122
      */
123
     @Override
123
     @Override
124
-    @Transactional
124
+    @Transactional(rollbackFor = Exception.class)
125
     public void updateGenTable(GenTable genTable)
125
     public void updateGenTable(GenTable genTable)
126
     {
126
     {
127
         String options = JSON.toJSONString(genTable.getParams());
127
         String options = JSON.toJSONString(genTable.getParams());
@@ -143,7 +143,7 @@ public class GenTableServiceImpl implements IGenTableService
143
      * @return 结果
143
      * @return 结果
144
      */
144
      */
145
     @Override
145
     @Override
146
-    @Transactional
146
+    @Transactional(rollbackFor = Exception.class)
147
     public void deleteGenTableByIds(Long[] tableIds)
147
     public void deleteGenTableByIds(Long[] tableIds)
148
     {
148
     {
149
         genTableMapper.deleteGenTableByIds(tableIds);
149
         genTableMapper.deleteGenTableByIds(tableIds);
@@ -156,7 +156,7 @@ public class GenTableServiceImpl implements IGenTableService
156
      * @param tableList 导入表列表
156
      * @param tableList 导入表列表
157
      */
157
      */
158
     @Override
158
     @Override
159
-    @Transactional
159
+    @Transactional(rollbackFor = Exception.class)
160
     public void importGenTable(List<GenTable> tableList)
160
     public void importGenTable(List<GenTable> tableList)
161
     {
161
     {
162
         String operName = SecurityUtils.getUsername();
162
         String operName = SecurityUtils.getUsername();
@@ -282,7 +282,7 @@ public class GenTableServiceImpl implements IGenTableService
282
      * @param tableName 表名称
282
      * @param tableName 表名称
283
      */
283
      */
284
     @Override
284
     @Override
285
-    @Transactional
285
+    @Transactional(rollbackFor = Exception.class)
286
     public void synchDb(String tableName)
286
     public void synchDb(String tableName)
287
     {
287
     {
288
         GenTable table = genTableMapper.selectGenTableByName(tableName);
288
         GenTable table = genTableMapper.selectGenTableByName(tableName);

+ 1 - 1
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java

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

+ 5 - 5
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java

@@ -228,7 +228,7 @@ public class SysRoleServiceImpl implements ISysRoleService
228
      * @return 结果
228
      * @return 结果
229
      */
229
      */
230
     @Override
230
     @Override
231
-    @Transactional
231
+    @Transactional(rollbackFor = Exception.class)
232
     public int insertRole(SysRole role)
232
     public int insertRole(SysRole role)
233
     {
233
     {
234
         // 新增角色信息
234
         // 新增角色信息
@@ -243,7 +243,7 @@ public class SysRoleServiceImpl implements ISysRoleService
243
      * @return 结果
243
      * @return 结果
244
      */
244
      */
245
     @Override
245
     @Override
246
-    @Transactional
246
+    @Transactional(rollbackFor = Exception.class)
247
     public int updateRole(SysRole role)
247
     public int updateRole(SysRole role)
248
     {
248
     {
249
         // 修改角色信息
249
         // 修改角色信息
@@ -272,7 +272,7 @@ public class SysRoleServiceImpl implements ISysRoleService
272
      * @return 结果
272
      * @return 结果
273
      */
273
      */
274
     @Override
274
     @Override
275
-    @Transactional
275
+    @Transactional(rollbackFor = Exception.class)
276
     public int authDataScope(SysRole role)
276
     public int authDataScope(SysRole role)
277
     {
277
     {
278
         // 修改角色信息
278
         // 修改角色信息
@@ -338,7 +338,7 @@ public class SysRoleServiceImpl implements ISysRoleService
338
      * @return 结果
338
      * @return 结果
339
      */
339
      */
340
     @Override
340
     @Override
341
-    @Transactional
341
+    @Transactional(rollbackFor = Exception.class)
342
     public int deleteRoleById(Long roleId)
342
     public int deleteRoleById(Long roleId)
343
     {
343
     {
344
         // 删除角色与菜单关联
344
         // 删除角色与菜单关联
@@ -355,7 +355,7 @@ public class SysRoleServiceImpl implements ISysRoleService
355
      * @return 结果
355
      * @return 结果
356
      */
356
      */
357
     @Override
357
     @Override
358
-    @Transactional
358
+    @Transactional(rollbackFor = Exception.class)
359
     public int deleteRoleByIds(Long[] roleIds)
359
     public int deleteRoleByIds(Long[] roleIds)
360
     {
360
     {
361
         for (Long roleId : roleIds)
361
         for (Long roleId : roleIds)

+ 5 - 5
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java

@@ -252,7 +252,7 @@ public class SysUserServiceImpl implements ISysUserService
252
      * @return 结果
252
      * @return 结果
253
      */
253
      */
254
     @Override
254
     @Override
255
-    @Transactional
255
+    @Transactional(rollbackFor = Exception.class)
256
     public int insertUser(SysUser user)
256
     public int insertUser(SysUser user)
257
     {
257
     {
258
         // 新增用户信息
258
         // 新增用户信息
@@ -283,7 +283,7 @@ public class SysUserServiceImpl implements ISysUserService
283
      * @return 结果
283
      * @return 结果
284
      */
284
      */
285
     @Override
285
     @Override
286
-    @Transactional
286
+    @Transactional(rollbackFor = Exception.class)
287
     public int updateUser(SysUser user)
287
     public int updateUser(SysUser user)
288
     {
288
     {
289
         Long userId = user.getUserId();
289
         Long userId = user.getUserId();
@@ -305,7 +305,7 @@ public class SysUserServiceImpl implements ISysUserService
305
      * @param roleIds 角色组
305
      * @param roleIds 角色组
306
      */
306
      */
307
     @Override
307
     @Override
308
-    @Transactional
308
+    @Transactional(rollbackFor = Exception.class)
309
     public void insertUserAuth(Long userId, Long[] roleIds)
309
     public void insertUserAuth(Long userId, Long[] roleIds)
310
     {
310
     {
311
         userRoleMapper.deleteUserRoleByUserId(userId);
311
         userRoleMapper.deleteUserRoleByUserId(userId);
@@ -459,7 +459,7 @@ public class SysUserServiceImpl implements ISysUserService
459
      * @return 结果
459
      * @return 结果
460
      */
460
      */
461
     @Override
461
     @Override
462
-    @Transactional
462
+    @Transactional(rollbackFor = Exception.class)
463
     public int deleteUserById(Long userId)
463
     public int deleteUserById(Long userId)
464
     {
464
     {
465
         // 删除用户与角色关联
465
         // 删除用户与角色关联
@@ -476,7 +476,7 @@ public class SysUserServiceImpl implements ISysUserService
476
      * @return 结果
476
      * @return 结果
477
      */
477
      */
478
     @Override
478
     @Override
479
-    @Transactional
479
+    @Transactional(rollbackFor = Exception.class)
480
     public int deleteUserByIds(Long[] userIds)
480
     public int deleteUserByIds(Long[] userIds)
481
     {
481
     {
482
         for (Long userId : userIds)
482
         for (Long userId : userIds)