From 12412d402129ec3b8d126e32f6df4ce6a5b1edd7 Mon Sep 17 00:00:00 2001 From: cjy Date: Mon, 2 Sep 2024 10:11:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A7=94=E6=89=98=E5=8D=95=E4=BD=8D=E5=92=8C?= =?UTF-8?q?=E8=AE=A2=E8=88=B1=E5=8F=A3=E4=B9=8B=E5=90=8E=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=B8=A6=E5=87=BA=E9=BB=98=E8=AE=A4=E8=81=94=E7=B3=BB=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DS.WMS.Core/Info/Dtos/ClientSelectRes.cs | 5 ++++- .../Info/Dtos/ControllerClientRes.cs | 5 +++++ .../Sys/Method/ClientCommonService.cs | 17 ++++++++++++++--- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientSelectRes.cs b/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientSelectRes.cs index 77913220..0b4fbcfe 100644 --- a/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientSelectRes.cs +++ b/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientSelectRes.cs @@ -42,7 +42,10 @@ public class ClientSelectRes /// 助记码 /// public string PinYinCode { get; set; } - + /// + /// 往来单位默认联系人 + /// + public ClientContactRes ClientContact { get; set; } } /// diff --git a/ds-wms-service/DS.WMS.Core/Info/Dtos/ControllerClientRes.cs b/ds-wms-service/DS.WMS.Core/Info/Dtos/ControllerClientRes.cs index 29d03a6a..69c9d735 100644 --- a/ds-wms-service/DS.WMS.Core/Info/Dtos/ControllerClientRes.cs +++ b/ds-wms-service/DS.WMS.Core/Info/Dtos/ControllerClientRes.cs @@ -121,5 +121,10 @@ namespace DS.WMS.Core.Info.Dtos /// Desc: 所属集团 /// public string PcorpName { get; set; } + + /// + /// 往来单位默认联系人 + /// + public ClientContactRes ClientContact { get; set; } } } diff --git a/ds-wms-service/DS.WMS.Core/Sys/Method/ClientCommonService.cs b/ds-wms-service/DS.WMS.Core/Sys/Method/ClientCommonService.cs index 8234a76c..342c0089 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Method/ClientCommonService.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Method/ClientCommonService.cs @@ -126,7 +126,13 @@ public class ClientCommonService : IClientCommonService PinYinCode = a.ShortName + "(" + a.CodeName + ")", //SaleOrgName = string.IsNullOrEmpty(a.SaleOrgId) ? "": orglist.Where(x=>x.Id == long.Parse(a.SaleOrgId)).FirstOrDefault().OrgName }, true - ).Take(20).WithCache($"{SqlSugarCacheConst.InfoClient}{user.TenantId}").ToListAsync(); + ) + .Mapper(it => + { + it.ClientContact = tenantDb.Queryable().Where(x => x.ClientId == it.Id && x.Status == StatusEnum.Enable && x.IsDefault == true) + .Select().First(); + }) + .Take(20).WithCache($"{SqlSugarCacheConst.InfoClient}{user.TenantId}").ToListAsync(); return await Task.FromResult(DataResult>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess)); } /// @@ -360,7 +366,7 @@ public class ClientCommonService : IClientCommonService var list = tenantDb.Queryable() .InnerJoin((a, b) => a.Id == b.ClientId) .Where((a, b) => a.Status == StatusEnum.Enable.ToEnumInt()) - .WhereIF(code == "carrier", (a, b) => b.IsCarrier == true) + //.WhereIF(code == "carrier", (a, b) => b.IsCarrier == true) .WhereIF(code == "yard", (a, b) => b.IsYard == true) .WhereIF(code == "booking", (a, b) => b.IsBooking == true) .WhereIF(code == "truck", (a, b) => b.IsTruck == true) @@ -389,7 +395,12 @@ public class ClientCommonService : IClientCommonService EnShortName = a.EnShortName, BLContent = a.BLContent, } - ).ToList(); + ) + .Mapper(it => + { + it.ClientContact = tenantDb.Queryable().Where(x => x.ClientId == it.Id && x.Status == StatusEnum.Enable && x.IsDefault == true) + .Select().First(); + }).ToList(); if (req.BusinessType == BusinessType.OceanShippingExport) {