海运出口列表可视数据权限实现

dev
cjy 2 months ago
parent b91f861b21
commit 73a602490d

@ -96,13 +96,15 @@ public partial class SeaExportService : ISeaExportService
public async Task<DataResult<SeaExportListRes>> GetListByPage(PageRequest request) public async Task<DataResult<SeaExportListRes>> GetListByPage(PageRequest request)
{ {
var tenantDb = saasService.GetBizDbScopeById(user.TenantId); var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
//启用海运出口列表可视数据权限
//var query = commonService.GetVisibleDataRuleFilter<SeaExport>(tenantDb); var query = commonService.GetVisibleDataRuleFilter<SeaExport>(tenantDb);
var orgList = db.Queryable<SysOrg>().Where(x => x.Status == StatusEnum.Enable); var orgList = db.Queryable<SysOrg>().Where(x => x.Status == StatusEnum.Enable);
//序列化查询条件 //序列化查询条件
var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition); var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
var result = tenantDb.Queryable<SeaExport>() //var result = tenantDb.Queryable<SeaExport>()
var statusList = tenantDb.Queryable<BookingStatus>().Select<BookingStatusRes>().ToList();
var result = query
.InnerJoin<BusinessFeeStatus>((a, b) => a.Id == b.BusinessId) .InnerJoin<BusinessFeeStatus>((a, b) => a.Id == b.BusinessId)
//.LeftJoin<SysOrg>((a, b, c) => a.SaleOrgId == c.Id, "shippingweb8_dev.sys_org") //.LeftJoin<SysOrg>((a, b, c) => a.SaleOrgId == c.Id, "shippingweb8_dev.sys_org")
//.LeftJoin<SysOrg>((a, b, c) => a.SaleDeptId == c.Id, "shippingweb8_dev.sys_org") //.LeftJoin<SysOrg>((a, b, c) => a.SaleDeptId == c.Id, "shippingweb8_dev.sys_org")
@ -115,8 +117,8 @@ public partial class SeaExportService : ISeaExportService
.MergeTable() .MergeTable()
.Mapper(it => .Mapper(it =>
{ {
it.BookingStatus = statusList.Where(x => x.BusinessId == it.Id).ToList();
it.BookingStatus = tenantDb.Queryable<BookingStatus>().Where(x => x.BusinessId == it.Id).Select<BookingStatusRes>().ToList(); //it.BookingStatus = tenantDb.Queryable<BookingStatus>().Where(x => x.BusinessId == it.Id).Select<BookingStatusRes>().ToList();
}) })
.Where(whereList); .Where(whereList);

Loading…
Cancel
Save