海运出口跨库查询

usertest
cjy 4 months ago
parent b9d5c56fae
commit 7a0692223c

@ -136,6 +136,8 @@ public class SaasDbService : ISaasDbService
}; };
dbProvider.Aop.OnDiffLogEvent = (it) => { }; dbProvider.Aop.OnDiffLogEvent = (it) => { };
//全局过滤租户Id
dbProvider.QueryFilter.AddTableFilter<ITenantId>(m => m.TenantId ==long.Parse(user.TenantId));
//全局过滤机构Id //全局过滤机构Id
dbProvider.QueryFilter.AddTableFilter<IOrgId>(m => m.OrgId == user.GetOrgId()); dbProvider.QueryFilter.AddTableFilter<IOrgId>(m => m.OrgId == user.GetOrgId());
//全局软删除过滤 //全局软删除过滤

@ -1227,4 +1227,13 @@ public class SeaExportRes
/// 国内发货人 t_info_client CUSTNAME /// 国内发货人 t_info_client CUSTNAME
/// </summary> /// </summary>
public string ShipperCn { get; set; } public string ShipperCn { get; set; }
/// <summary>
/// 所属分部名称
/// </summary>
public string SaleOrgName { get; set; }
/// <summary>
/// 所属部门名称
/// </summary>
public string SaleDeptName { get; set; }
} }

@ -328,11 +328,21 @@ 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 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>()
.InnerJoin<BusinessFeeStatus>((a, b) => a.Id == b.BusinessId) .InnerJoin<BusinessFeeStatus>((a, b) => a.Id == b.BusinessId)
.Select<SeaExportRes>() .LeftJoin<SysOrg>((a, b, c) => a.SaleOrgId == c.Id, "shippingweb8_dev.sys_org")
.LeftJoin<SysOrg>((a, b, c, d) => a.SaleOrgId == d.Id, "shippingweb8_dev.sys_org")
.Select((a, b, c, d) => new SeaExportRes()
{
SaleOrgName = c.OrgName,
SaleDeptName = d.OrgName,
},
true)//true表示 其余字段自动映射,根据字段名字
//.Select<SeaExportRes>()
.MergeTable() .MergeTable()
.Mapper(it => .Mapper(it =>
{ {

Loading…
Cancel
Save