|
|
|
@ -96,14 +96,16 @@ public partial class SeaExportService : ISeaExportService
|
|
|
|
|
public async Task<DataResult<SeaExportListRes>> GetListByPage(PageRequest request)
|
|
|
|
|
{
|
|
|
|
|
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 whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
|
|
|
|
|
var result = tenantDb.Queryable<SeaExport>()
|
|
|
|
|
.InnerJoin<BusinessFeeStatus>((a, b) => a.Id == b.BusinessId)
|
|
|
|
|
//var result = tenantDb.Queryable<SeaExport>()
|
|
|
|
|
var statusList = tenantDb.Queryable<BookingStatus>().Select<BookingStatusRes>().ToList();
|
|
|
|
|
var result = query
|
|
|
|
|
.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.SaleDeptId == c.Id, "shippingweb8_dev.sys_org")
|
|
|
|
|
.Select((a, b) => new SeaExportRes()
|
|
|
|
@ -115,9 +117,9 @@ public partial class SeaExportService : ISeaExportService
|
|
|
|
|
.MergeTable()
|
|
|
|
|
.Mapper(it =>
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
it.BookingStatus = tenantDb.Queryable<BookingStatus>().Where(x => x.BusinessId == it.Id).Select<BookingStatusRes>().ToList();
|
|
|
|
|
|
|
|
|
|
it.BookingStatus = statusList.Where(x => x.BusinessId == it.Id).ToList();
|
|
|
|
|
//it.BookingStatus = tenantDb.Queryable<BookingStatus>().Where(x => x.BusinessId == it.Id).Select<BookingStatusRes>().ToList();
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
.Where(whereList);
|
|
|
|
|
//.ToQueryPageAsync(request.PageCondition);
|
|
|
|
|