From 237927bbf2950ee5c82014fcfee08f19a605fd95 Mon Sep 17 00:00:00 2001 From: cjy Date: Thu, 18 Jul 2024 08:54:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=B1=BB=E6=B7=BB=E5=8A=A0=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E7=94=A8=E6=88=B7=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DS.Module.Core/Data/BaseModel.cs | 20 +- .../DS.Module.FastReportModule.csproj | 7 + .../DS.Module.SqlSugar/SqlsugarInstall.cs | 14 +- .../DS.WMS.Core/Info/Dtos/ClientSelectRes.cs | 4 + .../Sys/Method/ClientCommonService.cs | 213 ++++++++++++++---- ds-wms-service/ds-wms-service.sln | 7 + 6 files changed, 223 insertions(+), 42 deletions(-) create mode 100644 ds-wms-service/DS.Module.FastReportModule/DS.Module.FastReportModule.csproj diff --git a/ds-wms-service/DS.Module.Core/Data/BaseModel.cs b/ds-wms-service/DS.Module.Core/Data/BaseModel.cs index d6c5356a..645b16a6 100644 --- a/ds-wms-service/DS.Module.Core/Data/BaseModel.cs +++ b/ds-wms-service/DS.Module.Core/Data/BaseModel.cs @@ -36,13 +36,24 @@ public abstract class BaseModel : IDeleted [SugarColumn(IsOnlyIgnoreUpdate = true, IsNullable = true, ColumnDescription = "创建人")] public long CreateBy { get; set; } + /// + /// 创建人名称 + /// + [Description("创建人名称")] + [SugarColumn(IsOnlyIgnoreUpdate = true, IsNullable = true, ColumnDescription = "创建人名称", Length =50)] + public string CreateUserName { get; set; } /// /// 修改人 /// [Description("修改人")] [SugarColumn(IsNullable = true, ColumnDescription = "修改人")] public long UpdateBy { get; set; } - + /// + /// 修改人名称 + /// + [Description("修改人名称")] + [SugarColumn(IsNullable = true, ColumnDescription = "修改人名称", Length = 50)] + public string UpdateUserName { get; set; } /// /// 更新时间 /// @@ -56,7 +67,12 @@ public abstract class BaseModel : IDeleted [Description("删除")] [SugarColumn(ColumnDescription = "是否删除")] public bool Deleted { get; set; } = false; - + /// + /// 删除人名称 + /// + [Description("删除人名称")] + [SugarColumn(IsNullable = true, ColumnDescription = "删除人名称", Length = 50)] + public string DeleteUserName { get; set; } /// /// 删除时间 /// diff --git a/ds-wms-service/DS.Module.FastReportModule/DS.Module.FastReportModule.csproj b/ds-wms-service/DS.Module.FastReportModule/DS.Module.FastReportModule.csproj new file mode 100644 index 00000000..cb631906 --- /dev/null +++ b/ds-wms-service/DS.Module.FastReportModule/DS.Module.FastReportModule.csproj @@ -0,0 +1,7 @@ + + + + netcoreapp3.1 + + + diff --git a/ds-wms-service/DS.Module.SqlSugar/SqlsugarInstall.cs b/ds-wms-service/DS.Module.SqlSugar/SqlsugarInstall.cs index 81db135a..ea305fdc 100644 --- a/ds-wms-service/DS.Module.SqlSugar/SqlsugarInstall.cs +++ b/ds-wms-service/DS.Module.SqlSugar/SqlsugarInstall.cs @@ -194,7 +194,17 @@ public static class SqlsugarInstall entityInfo.SetValue(1288018625843826688); } } - + if (entityInfo.PropertyName == "CreateUserName") + { + if (!user.UserId.IsNullOrEmpty()) + { + entityInfo.SetValue(user.UserName); + } + else + { + entityInfo.SetValue("超级管理员"); + } + } if (entityInfo.PropertyName == "Deleted") entityInfo.SetValue(false); } @@ -206,6 +216,8 @@ public static class SqlsugarInstall entityInfo.SetValue(DateTime.Now); if (entityInfo.PropertyName == "UpdateBy" && user != null) entityInfo.SetValue(user.UserId); + if (entityInfo.PropertyName == "UpdateUserName" && user != null) + entityInfo.SetValue(user.UserName); } }; 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 2a027df9..b678897c 100644 --- a/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientSelectRes.cs +++ b/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientSelectRes.cs @@ -33,6 +33,10 @@ public class ClientSelectRes /// Desc:提单信息 /// public string BLContent { get; set; } + /// + /// 租户参数 + /// + public List ClientParams { 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 44ef302d..f3c951bb 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Method/ClientCommonService.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Method/ClientCommonService.cs @@ -326,9 +326,17 @@ public class ClientCommonService : IClientCommonService Id = a.Id, CodeName = a.CodeName, ShortName = a.ShortName, - EnShortName = a.EnShortName - } - ).ToListAsync(); + EnShortName = a.EnShortName, + BLContent = a.BLContent + }) + .Mapper(it => + { + it.ClientParams = tenantDb.Queryable() + .Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable) + .Select() + .ToList(); + }) + .ToListAsync(); data.Add(new ClientSelectMultiRes("carrier", carrier)); var yard = await tenantDb.Queryable() @@ -339,9 +347,17 @@ public class ClientCommonService : IClientCommonService Id = a.Id, CodeName = a.CodeName, ShortName = a.ShortName, - EnShortName = a.EnShortName + EnShortName = a.EnShortName, + BLContent = a.BLContent } - ).ToListAsync(); + ) + .Mapper(it => + { + it.ClientParams = tenantDb.Queryable() + .Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable) + .Select() + .ToList(); + }).ToListAsync(); data.Add(new ClientSelectMultiRes("yard", yard)); var booking = await tenantDb.Queryable() @@ -352,9 +368,16 @@ public class ClientCommonService : IClientCommonService Id = a.Id, CodeName = a.CodeName, ShortName = a.ShortName, - EnShortName = a.EnShortName + EnShortName = a.EnShortName, + BLContent = a.BLContent } - ).ToListAsync(); + ).Mapper(it => + { + it.ClientParams = tenantDb.Queryable() + .Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable) + .Select() + .ToList(); + }).ToListAsync(); data.Add(new ClientSelectMultiRes("booking", booking)); var truck = await tenantDb.Queryable() @@ -365,9 +388,16 @@ public class ClientCommonService : IClientCommonService Id = a.Id, CodeName = a.CodeName, ShortName = a.ShortName, - EnShortName = a.EnShortName + EnShortName = a.EnShortName, + BLContent = a.BLContent } - ).ToListAsync(); + ).Mapper(it => + { + it.ClientParams = tenantDb.Queryable() + .Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable) + .Select() + .ToList(); + }).ToListAsync(); data.Add(new ClientSelectMultiRes("truck", truck)); var controller = await tenantDb.Queryable() @@ -378,9 +408,16 @@ public class ClientCommonService : IClientCommonService Id = a.Id, CodeName = a.CodeName, ShortName = a.ShortName, - EnShortName = a.EnShortName + EnShortName = a.EnShortName, + BLContent = a.BLContent } - ).ToListAsync(); + ).Mapper(it => + { + it.ClientParams = tenantDb.Queryable() + .Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable) + .Select() + .ToList(); + }).ToListAsync(); data.Add(new ClientSelectMultiRes("controller", controller)); var custom = await tenantDb.Queryable() @@ -391,9 +428,16 @@ public class ClientCommonService : IClientCommonService Id = a.Id, CodeName = a.CodeName, ShortName = a.ShortName, - EnShortName = a.EnShortName + EnShortName = a.EnShortName, + BLContent = a.BLContent } - ).ToListAsync(); + ).Mapper(it => + { + it.ClientParams = tenantDb.Queryable() + .Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable) + .Select() + .ToList(); + }).ToListAsync(); data.Add(new ClientSelectMultiRes("custom", custom)); var agent = await tenantDb.Queryable() @@ -404,9 +448,16 @@ public class ClientCommonService : IClientCommonService Id = a.Id, CodeName = a.CodeName, ShortName = a.ShortName, - EnShortName = a.EnShortName + EnShortName = a.EnShortName, + BLContent = a.BLContent } - ).ToListAsync(); + ).Mapper(it => + { + it.ClientParams = tenantDb.Queryable() + .Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable) + .Select() + .ToList(); + }).ToListAsync(); data.Add(new ClientSelectMultiRes("agent", agent)); var agentcn = await tenantDb.Queryable() @@ -417,9 +468,16 @@ public class ClientCommonService : IClientCommonService Id = a.Id, CodeName = a.CodeName, ShortName = a.ShortName, - EnShortName = a.EnShortName + EnShortName = a.EnShortName, + BLContent = a.BLContent } - ).ToListAsync(); + ).Mapper(it => + { + it.ClientParams = tenantDb.Queryable() + .Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable) + .Select() + .ToList(); + }).ToListAsync(); data.Add(new ClientSelectMultiRes("agentcn", agentcn)); var express = await tenantDb.Queryable() @@ -430,9 +488,16 @@ public class ClientCommonService : IClientCommonService Id = a.Id, CodeName = a.CodeName, ShortName = a.ShortName, - EnShortName = a.EnShortName + EnShortName = a.EnShortName, + BLContent = a.BLContent } - ).ToListAsync(); + ).Mapper(it => + { + it.ClientParams = tenantDb.Queryable() + .Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable) + .Select() + .ToList(); + }).ToListAsync(); data.Add(new ClientSelectMultiRes("express", express)); var airlines = await tenantDb.Queryable() @@ -443,9 +508,16 @@ public class ClientCommonService : IClientCommonService Id = a.Id, CodeName = a.CodeName, ShortName = a.ShortName, - EnShortName = a.EnShortName + EnShortName = a.EnShortName, + BLContent = a.BLContent } - ).ToListAsync(); + ).Mapper(it => + { + it.ClientParams = tenantDb.Queryable() + .Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable) + .Select() + .ToList(); + }).ToListAsync(); data.Add(new ClientSelectMultiRes("airlines", airlines)); var shipper = await tenantDb.Queryable() @@ -456,9 +528,16 @@ public class ClientCommonService : IClientCommonService Id = a.Id, CodeName = a.CodeName, ShortName = a.ShortName, - EnShortName = a.EnShortName + EnShortName = a.EnShortName, + BLContent = a.BLContent } - ).ToListAsync(); + ).Mapper(it => + { + it.ClientParams = tenantDb.Queryable() + .Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable) + .Select() + .ToList(); + }).ToListAsync(); data.Add(new ClientSelectMultiRes("shipper", shipper)); var notifyparty = await tenantDb.Queryable() @@ -469,9 +548,16 @@ public class ClientCommonService : IClientCommonService Id = a.Id, CodeName = a.CodeName, ShortName = a.ShortName, - EnShortName = a.EnShortName + EnShortName = a.EnShortName, + BLContent = a.BLContent } - ).ToListAsync(); + ).Mapper(it => + { + it.ClientParams = tenantDb.Queryable() + .Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable) + .Select() + .ToList(); + }).ToListAsync(); data.Add(new ClientSelectMultiRes("notifyparty", notifyparty)); @@ -483,9 +569,16 @@ public class ClientCommonService : IClientCommonService Id = a.Id, CodeName = a.CodeName, ShortName = a.ShortName, - EnShortName = a.EnShortName + EnShortName = a.EnShortName, + BLContent = a.BLContent } - ).ToListAsync(); + ).Mapper(it => + { + it.ClientParams = tenantDb.Queryable() + .Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable) + .Select() + .ToList(); + }).ToListAsync(); data.Add(new ClientSelectMultiRes("warehouse", warehouse)); @@ -497,9 +590,16 @@ public class ClientCommonService : IClientCommonService Id = a.Id, CodeName = a.CodeName, ShortName = a.ShortName, - EnShortName = a.EnShortName + EnShortName = a.EnShortName, + BLContent = a.BLContent } - ).ToListAsync(); + ).Mapper(it => + { + it.ClientParams = tenantDb.Queryable() + .Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable) + .Select() + .ToList(); + }).ToListAsync(); data.Add(new ClientSelectMultiRes("wharf", wharf)); var insurer = await tenantDb.Queryable() @@ -510,9 +610,16 @@ public class ClientCommonService : IClientCommonService Id = a.Id, CodeName = a.CodeName, ShortName = a.ShortName, - EnShortName = a.EnShortName + EnShortName = a.EnShortName, + BLContent = a.BLContent } - ).ToListAsync(); + ).Mapper(it => + { + it.ClientParams = tenantDb.Queryable() + .Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable) + .Select() + .ToList(); + }).ToListAsync(); data.Add(new ClientSelectMultiRes("insurer", insurer)); var leasing = await tenantDb.Queryable() @@ -523,9 +630,16 @@ public class ClientCommonService : IClientCommonService Id = a.Id, CodeName = a.CodeName, ShortName = a.ShortName, - EnShortName = a.EnShortName + EnShortName = a.EnShortName, + BLContent = a.BLContent } - ).ToListAsync(); + ).Mapper(it => + { + it.ClientParams = tenantDb.Queryable() + .Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable) + .Select() + .ToList(); + }).ToListAsync(); data.Add(new ClientSelectMultiRes("leasing", leasing)); var tradingagency = await tenantDb.Queryable() @@ -536,9 +650,16 @@ public class ClientCommonService : IClientCommonService Id = a.Id, CodeName = a.CodeName, ShortName = a.ShortName, - EnShortName = a.EnShortName + EnShortName = a.EnShortName, + BLContent = a.BLContent } - ).ToListAsync(); + ).Mapper(it => + { + it.ClientParams = tenantDb.Queryable() + .Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable) + .Select() + .ToList(); + }).ToListAsync(); data.Add(new ClientSelectMultiRes("tradingagency", tradingagency)); var shipagency = await tenantDb.Queryable() @@ -549,9 +670,16 @@ public class ClientCommonService : IClientCommonService Id = a.Id, CodeName = a.CodeName, ShortName = a.ShortName, - EnShortName = a.EnShortName + EnShortName = a.EnShortName, + BLContent = a.BLContent } - ).ToListAsync(); + ).Mapper(it => + { + it.ClientParams = tenantDb.Queryable() + .Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable) + .Select() + .ToList(); + }).ToListAsync(); data.Add(new ClientSelectMultiRes("shipagency", shipagency)); var enterprise = await tenantDb.Queryable() @@ -562,9 +690,16 @@ public class ClientCommonService : IClientCommonService Id = a.Id, CodeName = a.CodeName, ShortName = a.ShortName, - EnShortName = a.EnShortName + EnShortName = a.EnShortName, + BLContent = a.BLContent } - ).ToListAsync(); + ).Mapper(it => + { + it.ClientParams = tenantDb.Queryable() + .Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable) + .Select() + .ToList(); + }).ToListAsync(); data.Add(new ClientSelectMultiRes("enterprise", enterprise)); return await Task.FromResult(DataResult>.Success(data)); diff --git a/ds-wms-service/ds-wms-service.sln b/ds-wms-service/ds-wms-service.sln index df50f1f3..86b38fbd 100644 --- a/ds-wms-service/ds-wms-service.sln +++ b/ds-wms-service/ds-wms-service.sln @@ -63,6 +63,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DS.WMS.TaskApi", "DS.WMS.Ta EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DS.Module.EmailModule", "DS.Module.EmailModule\DS.Module.EmailModule.csproj", "{4B51DCC1-62A5-49C5-978B-798E6B48F3C0}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DS.Module.FastReportModule", "DS.Module.FastReportModule\DS.Module.FastReportModule.csproj", "{F7FD58CB-28DF-456E-A411-38444C4D8E3D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -177,6 +179,10 @@ Global {4B51DCC1-62A5-49C5-978B-798E6B48F3C0}.Debug|Any CPU.Build.0 = Debug|Any CPU {4B51DCC1-62A5-49C5-978B-798E6B48F3C0}.Release|Any CPU.ActiveCfg = Release|Any CPU {4B51DCC1-62A5-49C5-978B-798E6B48F3C0}.Release|Any CPU.Build.0 = Release|Any CPU + {F7FD58CB-28DF-456E-A411-38444C4D8E3D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F7FD58CB-28DF-456E-A411-38444C4D8E3D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F7FD58CB-28DF-456E-A411-38444C4D8E3D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F7FD58CB-28DF-456E-A411-38444C4D8E3D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -209,6 +215,7 @@ Global {32B97A3A-C361-44F3-B417-5D08E9FD9624} = {65D75DB2-12D5-4D1F-893D-9750905CE5E4} {8DAE16A3-E249-4C86-BEEC-DA8429FD837C} = {65D75DB2-12D5-4D1F-893D-9750905CE5E4} {4B51DCC1-62A5-49C5-978B-798E6B48F3C0} = {518DB9B5-80A8-4B2C-8570-52BD406458DE} + {F7FD58CB-28DF-456E-A411-38444C4D8E3D} = {518DB9B5-80A8-4B2C-8570-52BD406458DE} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {66115F23-94B4-43C0-838E-33B5CF77F788}