From 7a0692223cb8c651c4a3a57cb7610259e8fc5622 Mon Sep 17 00:00:00 2001 From: cjy Date: Mon, 29 Jul 2024 15:23:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=B7=E8=BF=90=E5=87=BA=E5=8F=A3=E8=B7=A8?= =?UTF-8?q?=E5=BA=93=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ds-wms-service/DS.Module.SqlSugar/SaasDbService.cs | 2 ++ ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs | 9 +++++++++ .../DS.WMS.Core/Op/Method/SeaExportService.cs | 12 +++++++++++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/ds-wms-service/DS.Module.SqlSugar/SaasDbService.cs b/ds-wms-service/DS.Module.SqlSugar/SaasDbService.cs index 59036587..85f7ad83 100644 --- a/ds-wms-service/DS.Module.SqlSugar/SaasDbService.cs +++ b/ds-wms-service/DS.Module.SqlSugar/SaasDbService.cs @@ -136,6 +136,8 @@ public class SaasDbService : ISaasDbService }; dbProvider.Aop.OnDiffLogEvent = (it) => { }; + //全局过滤租户Id + dbProvider.QueryFilter.AddTableFilter(m => m.TenantId ==long.Parse(user.TenantId)); //全局过滤机构Id dbProvider.QueryFilter.AddTableFilter(m => m.OrgId == user.GetOrgId()); //全局软删除过滤 diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs index 28a8a3ab..6b4ef917 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs @@ -1227,4 +1227,13 @@ public class SeaExportRes /// 国内发货人 t_info_client CUSTNAME /// public string ShipperCn { get; set; } + + /// + /// 所属分部名称 + /// + public string SaleOrgName { get; set; } + /// + /// 所属部门名称 + /// + public string SaleDeptName { get; set; } } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs index cbaa55e6..29487c42 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs @@ -328,11 +328,21 @@ public partial class SeaExportService : ISeaExportService public async Task> GetListByPage(PageRequest request) { var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + + var orgList = db.Queryable().Where(x => x.Status == StatusEnum.Enable); //序列化查询条件 var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition); var result = tenantDb.Queryable() .InnerJoin((a, b) => a.Id == b.BusinessId) - .Select() + .LeftJoin((a, b, c) => a.SaleOrgId == c.Id, "shippingweb8_dev.sys_org") + .LeftJoin((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() .MergeTable() .Mapper(it => {