/// <summary> /// 获取数据权限信息 /// </summary> /// <param name="model"></param> /// <returns></returns> public async Task <DataPrivilegesViewModel> GetPrivilegesAsync(DataPrivilegesViewModel model) { model.ZTrees = new List <ZTree>(); var dbdepts = await _databaseFixture.Db.SysDept.FindAllAsync(m => m.IsDel == 0); var dataplist = await _databaseFixture.Db.SysDataPrivileges.FindAllAsync(m => m.SystemId == model.SystemId && m.UserId == model.UserId); var dbdatap = dbdepts.ToList(); foreach (var item in dbdepts) { ZTree tree = new ZTree() { id = item.DeptId.ToString(), name = item.DeptName, pId = item.ParentId.ToString() }; var first = dbdatap.FirstOrDefault(m => m.DeptId == item.DeptId); tree.@checked = first != null; model.ZTrees.Add(tree); } return(model); }
public async Task <DataPrivilegesViewModel> GetPrivilegesAsync(DataPrivilegesViewModel model) { throw new System.Exception(); }
public async Task <IActionResult> GetDataPrivileges([FromQuery] DataPrivilegesViewModel model) { var res = await _userService.GetPrivilegesAsync(model); return(Ok(res)); }
public async Task <DataPrivilegesViewModel> GetPrivilegesAsync([FromQuery] DataPrivilegesViewModel model) { return(await _userService.GetPrivilegesAsync(model)); }