三级菜单修改1

usertest
cjy 5 months ago
parent 3fd5e0c741
commit 8b7f3bbb9a

@ -20,6 +20,7 @@ using MathNet.Numerics.LinearAlgebra.Factorization;
using NPOI.SS.Formula.Functions;
using NPOI.Util;
using Quartz.Logging;
using DS.Module.Core.Data;
namespace DS.WMS.Core.Check.Method
{
@ -258,5 +259,32 @@ namespace DS.WMS.Core.Check.Method
return await Task.FromResult(DataResult.Successed("导入成功!"));
}
/// <summary>
/// 对账明细批量删除
/// </summary>
/// <param name="req">主表Id及明细业务Ids</param>
/// <returns></returns>
public DataResult BatchDelCheckBillAutoDetail(IdModel req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var checkId = long.Parse(req.Id);
if (req.Id.IsNull())
return DataResult.Failed("主表Id不能为空");
var info = tenantDb.Queryable<CheckBillAuto>().First(x => x.Id == checkId);
if (info.IsNull())
return DataResult.Failed("客户对账信息不存在");
if (req.Ids.Length == 0)
return DataResult.Failed("明细业务Ids不能为空");
var businessList = tenantDb.Queryable<CheckBillAutoDetail>().Where(x => x.CheckId == checkId && req.Ids.Contains(x.Id)).ToList();
if (businessList.Count > 0)
tenantDb.Deleteable(businessList).ExecuteCommand();
return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess);
}
}
}

@ -9,7 +9,7 @@ public class PermissionTreeViewModel
public long? Value { get; set; }
public List<PermissionTree> Children { get; set; }
public List<PermissionTreeViewModel> Children { get; set; }
}
public class PermissionTree

@ -522,7 +522,7 @@ public class CommonService : ICommonService
foreach (var item in list)
{
var childs = db.Queryable<SysPermission>().Filter(null, true)
.Where(x => x.MenuType == 2 && x.ParentId == item.Id && x.IsHidden == false &&
.Where(x => (x.MenuType == 1 || x.MenuType == 2) && x.ParentId == item.Id && x.IsHidden == false &&
(x.PermissionType == 1 || x.PermissionType == 0))
.OrderBy(x => x.SortCode)
.Select(a => new RouteItem
@ -643,7 +643,7 @@ public class CommonService : ICommonService
foreach (var item in list)
{
var childs = db.Queryable<SysPermissionTenant>().Where(x =>
x.MenuType == 2 && x.ParentId == item.ParentId && x.IsHidden == false &&
(x.MenuType == 1 || x.MenuType == 2) && x.ParentId == item.ParentId && x.IsHidden == false &&
permissions.Contains(x.PermissionId) &&
(x.PermissionType == 1 || x.PermissionType == 0) &&
x.PermissionId != 1744968217220222976) //排除企业用户维护
@ -760,7 +760,7 @@ public class CommonService : ICommonService
foreach (var item in list)
{
var childs = db.Queryable<SysPermission>().Where(x =>
x.MenuType == 2 && x.IsHidden == false && x.ParentId == item.Key &&
(x.MenuType == 1 || x.MenuType == 2) && x.IsHidden == false && x.ParentId == item.Key &&
(x.PermissionType == 1 || x.PermissionType == 0))
.OrderBy(x => x.SortCode)
.Select(a => new PermissionTreeList
@ -770,6 +770,19 @@ public class CommonService : ICommonService
Key = a.Id,
Icon = a.Icon
}).ToList();
foreach (var child in childs)
{
var grandsons = db.Queryable<SysPermission>().Where(x => x.MenuType == 2 && x.ParentId == child.Key)
.OrderBy(x => x.SortCode)
.Select(a => new PermissionTreeList
{
Title = a.PermissionName,
EnTitle = a.PermissionEnName,
Key = a.Id,
Icon = a.Icon
}).ToList();
child.Children = grandsons;
}
item.Children = childs;
}

@ -176,12 +176,23 @@ public class PermissionService : IPermissionService
foreach (var item in list)
{
var childs = db.Queryable<SysPermission>().Where(x => x.MenuType == 2 && x.ParentId == item.Value)
.Select(a => new PermissionTree
var childs = db.Queryable<SysPermission>().Where(x => (x.MenuType == 1 || x.MenuType == 2) && x.ParentId == item.Value)
.Select(a => new PermissionTreeViewModel
{
Title = a.PermissionName,
Value = a.Id,
}).ToList();
foreach (var child in childs)
{
var buttons = db.Queryable<SysPermission>().Where(x => x.MenuType == 2 && x.ParentId == child.Value)
.OrderBy(x => x.SortCode)
.Select(a => new PermissionTreeViewModel
{
Title = a.PermissionName,
Value = a.Id,
}).ToList();
child.Children = buttons;
}
item.Children = childs;
}
@ -206,7 +217,7 @@ public class PermissionService : IPermissionService
foreach (var item in list)
{
var childs = db.Queryable<SysPermission>().Where(x => x.MenuType == 2 && x.ParentId == item.Key)
var childs = db.Queryable<SysPermission>().Where(x =>(x.MenuType == 1 || x.MenuType == 2) && x.ParentId == item.Key)
.OrderBy(x => x.SortCode)
.Select(a => new PermissionTreeList
{
@ -214,11 +225,9 @@ public class PermissionService : IPermissionService
Key = a.Id,
Icon = a.Icon
}).ToList();
item.Children = childs;
foreach (var child in childs)
{
var buttons = db.Queryable<SysPermission>().Where(x =>(x.MenuType == 3 || x.MenuType == 2) && x.ParentId == child.Key)
var buttons = db.Queryable<SysPermission>().Where(x => x.MenuType == 2 && x.ParentId == child.Key)
.OrderBy(x => x.SortCode)
.Select(a => new PermissionTreeList
{
@ -228,6 +237,7 @@ public class PermissionService : IPermissionService
}).ToList();
child.Children = buttons;
}
item.Children = childs;
}
return DataResult<List<PermissionTreeList>>.Success("获取数据成功!", list);
}

Loading…
Cancel
Save