Преглед изворни кода

update 补全事务注解异常

疯狂的狮子Li пре 4 година
родитељ
комит
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 121
      * @return 结果
122 122
      */
123 123
     @Override
124
-    @Transactional
124
+    @Transactional(rollbackFor = Exception.class)
125 125
     public void updateGenTable(GenTable genTable)
126 126
     {
127 127
         String options = JSON.toJSONString(genTable.getParams());
@@ -143,7 +143,7 @@ public class GenTableServiceImpl implements IGenTableService
143 143
      * @return 结果
144 144
      */
145 145
     @Override
146
-    @Transactional
146
+    @Transactional(rollbackFor = Exception.class)
147 147
     public void deleteGenTableByIds(Long[] tableIds)
148 148
     {
149 149
         genTableMapper.deleteGenTableByIds(tableIds);
@@ -156,7 +156,7 @@ public class GenTableServiceImpl implements IGenTableService
156 156
      * @param tableList 导入表列表
157 157
      */
158 158
     @Override
159
-    @Transactional
159
+    @Transactional(rollbackFor = Exception.class)
160 160
     public void importGenTable(List<GenTable> tableList)
161 161
     {
162 162
         String operName = SecurityUtils.getUsername();
@@ -282,7 +282,7 @@ public class GenTableServiceImpl implements IGenTableService
282 282
      * @param tableName 表名称
283 283
      */
284 284
     @Override
285
-    @Transactional
285
+    @Transactional(rollbackFor = Exception.class)
286 286
     public void synchDb(String tableName)
287 287
     {
288 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 189
      * @return 结果
190 190
      */
191 191
     @Override
192
-    @Transactional
192
+    @Transactional(rollbackFor = Exception.class)
193 193
     public int updateDictType(SysDictType dict)
194 194
     {
195 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 228
      * @return 结果
229 229
      */
230 230
     @Override
231
-    @Transactional
231
+    @Transactional(rollbackFor = Exception.class)
232 232
     public int insertRole(SysRole role)
233 233
     {
234 234
         // 新增角色信息
@@ -243,7 +243,7 @@ public class SysRoleServiceImpl implements ISysRoleService
243 243
      * @return 结果
244 244
      */
245 245
     @Override
246
-    @Transactional
246
+    @Transactional(rollbackFor = Exception.class)
247 247
     public int updateRole(SysRole role)
248 248
     {
249 249
         // 修改角色信息
@@ -272,7 +272,7 @@ public class SysRoleServiceImpl implements ISysRoleService
272 272
      * @return 结果
273 273
      */
274 274
     @Override
275
-    @Transactional
275
+    @Transactional(rollbackFor = Exception.class)
276 276
     public int authDataScope(SysRole role)
277 277
     {
278 278
         // 修改角色信息
@@ -338,7 +338,7 @@ public class SysRoleServiceImpl implements ISysRoleService
338 338
      * @return 结果
339 339
      */
340 340
     @Override
341
-    @Transactional
341
+    @Transactional(rollbackFor = Exception.class)
342 342
     public int deleteRoleById(Long roleId)
343 343
     {
344 344
         // 删除角色与菜单关联
@@ -355,7 +355,7 @@ public class SysRoleServiceImpl implements ISysRoleService
355 355
      * @return 结果
356 356
      */
357 357
     @Override
358
-    @Transactional
358
+    @Transactional(rollbackFor = Exception.class)
359 359
     public int deleteRoleByIds(Long[] roleIds)
360 360
     {
361 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 252
      * @return 结果
253 253
      */
254 254
     @Override
255
-    @Transactional
255
+    @Transactional(rollbackFor = Exception.class)
256 256
     public int insertUser(SysUser user)
257 257
     {
258 258
         // 新增用户信息
@@ -283,7 +283,7 @@ public class SysUserServiceImpl implements ISysUserService
283 283
      * @return 结果
284 284
      */
285 285
     @Override
286
-    @Transactional
286
+    @Transactional(rollbackFor = Exception.class)
287 287
     public int updateUser(SysUser user)
288 288
     {
289 289
         Long userId = user.getUserId();
@@ -305,7 +305,7 @@ public class SysUserServiceImpl implements ISysUserService
305 305
      * @param roleIds 角色组
306 306
      */
307 307
     @Override
308
-    @Transactional
308
+    @Transactional(rollbackFor = Exception.class)
309 309
     public void insertUserAuth(Long userId, Long[] roleIds)
310 310
     {
311 311
         userRoleMapper.deleteUserRoleByUserId(userId);
@@ -459,7 +459,7 @@ public class SysUserServiceImpl implements ISysUserService
459 459
      * @return 结果
460 460
      */
461 461
     @Override
462
-    @Transactional
462
+    @Transactional(rollbackFor = Exception.class)
463 463
     public int deleteUserById(Long userId)
464 464
     {
465 465
         // 删除用户与角色关联
@@ -476,7 +476,7 @@ public class SysUserServiceImpl implements ISysUserService
476 476
      * @return 结果
477 477
      */
478 478
     @Override
479
-    @Transactional
479
+    @Transactional(rollbackFor = Exception.class)
480 480
     public int deleteUserByIds(Long[] userIds)
481 481
     {
482 482
         for (Long userId : userIds)