diff --git a/ZR.Admin.WebApi/Controllers/System/SysRoleController.cs b/ZR.Admin.WebApi/Controllers/System/SysRoleController.cs
index 5c1859a4..800ad0fe 100644
--- a/ZR.Admin.WebApi/Controllers/System/SysRoleController.cs
+++ b/ZR.Admin.WebApi/Controllers/System/SysRoleController.cs
@@ -129,15 +129,18 @@ namespace ZR.Admin.WebApi.Controllers.System
if (sysRoleDto == null || sysRoleDto.RoleId <= 0) return ToResponse(ApiResult.Error(101, "请求参数错误"));
sysRoleDto.Create_by = HttpContext.GetName();
- //删除角色菜单
- sysRoleService.DeleteRoleMenuByRoleId(sysRoleDto.RoleId);
- sysRoleService.InsertRoleMenu(sysRoleDto);
+ bool result = sysRoleService.UseTran2(() =>
+ {
+ //删除角色菜单
+ sysRoleService.DeleteRoleMenuByRoleId(sysRoleDto.RoleId);
+ sysRoleService.InsertRoleMenu(sysRoleDto);
+ });
- return SUCCESS(true);
+ return SUCCESS(result);
}
///
- /// 角色删除 √
+ /// 角色删除
///
///
///
@@ -153,7 +156,7 @@ namespace ZR.Admin.WebApi.Controllers.System
}
///
- /// 修改角色状态 √
+ /// 修改角色状态
///
/// 角色对象
///
diff --git a/ZR.Service/System/IService/ISysRoleService.cs b/ZR.Service/System/IService/ISysRoleService.cs
index 9c9f4a48..2df2b549 100644
--- a/ZR.Service/System/IService/ISysRoleService.cs
+++ b/ZR.Service/System/IService/ISysRoleService.cs
@@ -4,7 +4,7 @@ using ZR.Model.System;
namespace ZR.Service.System.IService
{
- public interface ISysRoleService
+ public interface ISysRoleService : IBaseService
{
///
/// 根据条件分页查询角色数据
@@ -12,7 +12,7 @@ namespace ZR.Service.System.IService
/// 角色信息
///
/// 角色数据集合信息
- public PagedInfo SelectRoleList(SysRole role, Model.PagerInfo pager);
+ public PagedInfo SelectRoleList(SysRole role, PagerInfo pager);
///
/// 查询所有角色
@@ -113,7 +113,7 @@ namespace ZR.Service.System.IService
///
///
public List SelectUserRoles(long userId);
-
+
///
/// 获取用户权限字符串集合
///
diff --git a/ZR.Service/System/SysRoleService.cs b/ZR.Service/System/SysRoleService.cs
index f0df6314..d04a8207 100644
--- a/ZR.Service/System/SysRoleService.cs
+++ b/ZR.Service/System/SysRoleService.cs
@@ -17,14 +17,14 @@ namespace ZR.Service
/// 角色
///
[AppService(ServiceType = typeof(ISysRoleService), ServiceLifetime = LifeTime.Transient)]
- public class SysRoleService: ISysRoleService
+ public class SysRoleService : BaseService, ISysRoleService
{
private SysRoleRepository SysRoleRepository;
private ISysUserRoleService SysUserRoleService;
public SysRoleService(
- SysRoleRepository sysRoleRepository,
- ISysUserRoleService sysUserRoleService)
+ SysRoleRepository sysRoleRepository,
+ ISysUserRoleService sysUserRoleService) : base(sysRoleRepository)
{
SysRoleRepository = sysRoleRepository;
SysUserRoleService = sysUserRoleService;