基类添加记录用户名称

usertest
cjy 4 months ago
parent 105f46ec97
commit 237927bbf2

@ -36,13 +36,24 @@ public abstract class BaseModel<TKey> : IDeleted
[SugarColumn(IsOnlyIgnoreUpdate = true, IsNullable = true, ColumnDescription = "创建人")] [SugarColumn(IsOnlyIgnoreUpdate = true, IsNullable = true, ColumnDescription = "创建人")]
public long CreateBy { get; set; } public long CreateBy { get; set; }
/// <summary>
/// 创建人名称
/// </summary>
[Description("创建人名称")]
[SugarColumn(IsOnlyIgnoreUpdate = true, IsNullable = true, ColumnDescription = "创建人名称", Length =50)]
public string CreateUserName { get; set; }
/// <summary> /// <summary>
/// 修改人 /// 修改人
/// </summary> /// </summary>
[Description("修改人")] [Description("修改人")]
[SugarColumn(IsNullable = true, ColumnDescription = "修改人")] [SugarColumn(IsNullable = true, ColumnDescription = "修改人")]
public long UpdateBy { get; set; } public long UpdateBy { get; set; }
/// <summary>
/// 修改人名称
/// </summary>
[Description("修改人名称")]
[SugarColumn(IsNullable = true, ColumnDescription = "修改人名称", Length = 50)]
public string UpdateUserName { get; set; }
/// <summary> /// <summary>
/// 更新时间 /// 更新时间
/// </summary> /// </summary>
@ -56,7 +67,12 @@ public abstract class BaseModel<TKey> : IDeleted
[Description("删除")] [Description("删除")]
[SugarColumn(ColumnDescription = "是否删除")] [SugarColumn(ColumnDescription = "是否删除")]
public bool Deleted { get; set; } = false; public bool Deleted { get; set; } = false;
/// <summary>
/// 删除人名称
/// </summary>
[Description("删除人名称")]
[SugarColumn(IsNullable = true, ColumnDescription = "删除人名称", Length = 50)]
public string DeleteUserName { get; set; }
/// <summary> /// <summary>
/// 删除时间 /// 删除时间
/// </summary> /// </summary>

@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
</Project>

@ -194,7 +194,17 @@ public static class SqlsugarInstall
entityInfo.SetValue(1288018625843826688); entityInfo.SetValue(1288018625843826688);
} }
} }
if (entityInfo.PropertyName == "CreateUserName")
{
if (!user.UserId.IsNullOrEmpty())
{
entityInfo.SetValue(user.UserName);
}
else
{
entityInfo.SetValue("超级管理员");
}
}
if (entityInfo.PropertyName == "Deleted") if (entityInfo.PropertyName == "Deleted")
entityInfo.SetValue(false); entityInfo.SetValue(false);
} }
@ -206,6 +216,8 @@ public static class SqlsugarInstall
entityInfo.SetValue(DateTime.Now); entityInfo.SetValue(DateTime.Now);
if (entityInfo.PropertyName == "UpdateBy" && user != null) if (entityInfo.PropertyName == "UpdateBy" && user != null)
entityInfo.SetValue(user.UserId); entityInfo.SetValue(user.UserId);
if (entityInfo.PropertyName == "UpdateUserName" && user != null)
entityInfo.SetValue(user.UserName);
} }
}; };

@ -33,6 +33,10 @@ public class ClientSelectRes
/// Desc:提单信息 /// Desc:提单信息
/// </summary> /// </summary>
public string BLContent { get; set; } public string BLContent { get; set; }
/// <summary>
/// 租户参数
/// </summary>
public List<ClientParamRes> ClientParams { get; set; }
} }

@ -326,9 +326,17 @@ public class ClientCommonService : IClientCommonService
Id = a.Id, Id = a.Id,
CodeName = a.CodeName, CodeName = a.CodeName,
ShortName = a.ShortName, ShortName = a.ShortName,
EnShortName = a.EnShortName EnShortName = a.EnShortName,
} BLContent = a.BLContent
).ToListAsync(); })
.Mapper(it =>
{
it.ClientParams = tenantDb.Queryable<InfoClientParam>()
.Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable)
.Select<ClientParamRes>()
.ToList();
})
.ToListAsync();
data.Add(new ClientSelectMultiRes("carrier", carrier)); data.Add(new ClientSelectMultiRes("carrier", carrier));
var yard = await tenantDb.Queryable<InfoClient>() var yard = await tenantDb.Queryable<InfoClient>()
@ -339,9 +347,17 @@ public class ClientCommonService : IClientCommonService
Id = a.Id, Id = a.Id,
CodeName = a.CodeName, CodeName = a.CodeName,
ShortName = a.ShortName, ShortName = a.ShortName,
EnShortName = a.EnShortName EnShortName = a.EnShortName,
BLContent = a.BLContent
} }
).ToListAsync(); )
.Mapper(it =>
{
it.ClientParams = tenantDb.Queryable<InfoClientParam>()
.Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable)
.Select<ClientParamRes>()
.ToList();
}).ToListAsync();
data.Add(new ClientSelectMultiRes("yard", yard)); data.Add(new ClientSelectMultiRes("yard", yard));
var booking = await tenantDb.Queryable<InfoClient>() var booking = await tenantDb.Queryable<InfoClient>()
@ -352,9 +368,16 @@ public class ClientCommonService : IClientCommonService
Id = a.Id, Id = a.Id,
CodeName = a.CodeName, CodeName = a.CodeName,
ShortName = a.ShortName, ShortName = a.ShortName,
EnShortName = a.EnShortName EnShortName = a.EnShortName,
BLContent = a.BLContent
} }
).ToListAsync(); ).Mapper(it =>
{
it.ClientParams = tenantDb.Queryable<InfoClientParam>()
.Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable)
.Select<ClientParamRes>()
.ToList();
}).ToListAsync();
data.Add(new ClientSelectMultiRes("booking", booking)); data.Add(new ClientSelectMultiRes("booking", booking));
var truck = await tenantDb.Queryable<InfoClient>() var truck = await tenantDb.Queryable<InfoClient>()
@ -365,9 +388,16 @@ public class ClientCommonService : IClientCommonService
Id = a.Id, Id = a.Id,
CodeName = a.CodeName, CodeName = a.CodeName,
ShortName = a.ShortName, ShortName = a.ShortName,
EnShortName = a.EnShortName EnShortName = a.EnShortName,
BLContent = a.BLContent
} }
).ToListAsync(); ).Mapper(it =>
{
it.ClientParams = tenantDb.Queryable<InfoClientParam>()
.Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable)
.Select<ClientParamRes>()
.ToList();
}).ToListAsync();
data.Add(new ClientSelectMultiRes("truck", truck)); data.Add(new ClientSelectMultiRes("truck", truck));
var controller = await tenantDb.Queryable<InfoClient>() var controller = await tenantDb.Queryable<InfoClient>()
@ -378,9 +408,16 @@ public class ClientCommonService : IClientCommonService
Id = a.Id, Id = a.Id,
CodeName = a.CodeName, CodeName = a.CodeName,
ShortName = a.ShortName, ShortName = a.ShortName,
EnShortName = a.EnShortName EnShortName = a.EnShortName,
BLContent = a.BLContent
} }
).ToListAsync(); ).Mapper(it =>
{
it.ClientParams = tenantDb.Queryable<InfoClientParam>()
.Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable)
.Select<ClientParamRes>()
.ToList();
}).ToListAsync();
data.Add(new ClientSelectMultiRes("controller", controller)); data.Add(new ClientSelectMultiRes("controller", controller));
var custom = await tenantDb.Queryable<InfoClient>() var custom = await tenantDb.Queryable<InfoClient>()
@ -391,9 +428,16 @@ public class ClientCommonService : IClientCommonService
Id = a.Id, Id = a.Id,
CodeName = a.CodeName, CodeName = a.CodeName,
ShortName = a.ShortName, ShortName = a.ShortName,
EnShortName = a.EnShortName EnShortName = a.EnShortName,
BLContent = a.BLContent
} }
).ToListAsync(); ).Mapper(it =>
{
it.ClientParams = tenantDb.Queryable<InfoClientParam>()
.Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable)
.Select<ClientParamRes>()
.ToList();
}).ToListAsync();
data.Add(new ClientSelectMultiRes("custom", custom)); data.Add(new ClientSelectMultiRes("custom", custom));
var agent = await tenantDb.Queryable<InfoClient>() var agent = await tenantDb.Queryable<InfoClient>()
@ -404,9 +448,16 @@ public class ClientCommonService : IClientCommonService
Id = a.Id, Id = a.Id,
CodeName = a.CodeName, CodeName = a.CodeName,
ShortName = a.ShortName, ShortName = a.ShortName,
EnShortName = a.EnShortName EnShortName = a.EnShortName,
BLContent = a.BLContent
} }
).ToListAsync(); ).Mapper(it =>
{
it.ClientParams = tenantDb.Queryable<InfoClientParam>()
.Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable)
.Select<ClientParamRes>()
.ToList();
}).ToListAsync();
data.Add(new ClientSelectMultiRes("agent", agent)); data.Add(new ClientSelectMultiRes("agent", agent));
var agentcn = await tenantDb.Queryable<InfoClient>() var agentcn = await tenantDb.Queryable<InfoClient>()
@ -417,9 +468,16 @@ public class ClientCommonService : IClientCommonService
Id = a.Id, Id = a.Id,
CodeName = a.CodeName, CodeName = a.CodeName,
ShortName = a.ShortName, ShortName = a.ShortName,
EnShortName = a.EnShortName EnShortName = a.EnShortName,
BLContent = a.BLContent
} }
).ToListAsync(); ).Mapper(it =>
{
it.ClientParams = tenantDb.Queryable<InfoClientParam>()
.Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable)
.Select<ClientParamRes>()
.ToList();
}).ToListAsync();
data.Add(new ClientSelectMultiRes("agentcn", agentcn)); data.Add(new ClientSelectMultiRes("agentcn", agentcn));
var express = await tenantDb.Queryable<InfoClient>() var express = await tenantDb.Queryable<InfoClient>()
@ -430,9 +488,16 @@ public class ClientCommonService : IClientCommonService
Id = a.Id, Id = a.Id,
CodeName = a.CodeName, CodeName = a.CodeName,
ShortName = a.ShortName, ShortName = a.ShortName,
EnShortName = a.EnShortName EnShortName = a.EnShortName,
BLContent = a.BLContent
} }
).ToListAsync(); ).Mapper(it =>
{
it.ClientParams = tenantDb.Queryable<InfoClientParam>()
.Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable)
.Select<ClientParamRes>()
.ToList();
}).ToListAsync();
data.Add(new ClientSelectMultiRes("express", express)); data.Add(new ClientSelectMultiRes("express", express));
var airlines = await tenantDb.Queryable<InfoClient>() var airlines = await tenantDb.Queryable<InfoClient>()
@ -443,9 +508,16 @@ public class ClientCommonService : IClientCommonService
Id = a.Id, Id = a.Id,
CodeName = a.CodeName, CodeName = a.CodeName,
ShortName = a.ShortName, ShortName = a.ShortName,
EnShortName = a.EnShortName EnShortName = a.EnShortName,
BLContent = a.BLContent
} }
).ToListAsync(); ).Mapper(it =>
{
it.ClientParams = tenantDb.Queryable<InfoClientParam>()
.Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable)
.Select<ClientParamRes>()
.ToList();
}).ToListAsync();
data.Add(new ClientSelectMultiRes("airlines", airlines)); data.Add(new ClientSelectMultiRes("airlines", airlines));
var shipper = await tenantDb.Queryable<InfoClient>() var shipper = await tenantDb.Queryable<InfoClient>()
@ -456,9 +528,16 @@ public class ClientCommonService : IClientCommonService
Id = a.Id, Id = a.Id,
CodeName = a.CodeName, CodeName = a.CodeName,
ShortName = a.ShortName, ShortName = a.ShortName,
EnShortName = a.EnShortName EnShortName = a.EnShortName,
BLContent = a.BLContent
} }
).ToListAsync(); ).Mapper(it =>
{
it.ClientParams = tenantDb.Queryable<InfoClientParam>()
.Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable)
.Select<ClientParamRes>()
.ToList();
}).ToListAsync();
data.Add(new ClientSelectMultiRes("shipper", shipper)); data.Add(new ClientSelectMultiRes("shipper", shipper));
var notifyparty = await tenantDb.Queryable<InfoClient>() var notifyparty = await tenantDb.Queryable<InfoClient>()
@ -469,9 +548,16 @@ public class ClientCommonService : IClientCommonService
Id = a.Id, Id = a.Id,
CodeName = a.CodeName, CodeName = a.CodeName,
ShortName = a.ShortName, ShortName = a.ShortName,
EnShortName = a.EnShortName EnShortName = a.EnShortName,
BLContent = a.BLContent
} }
).ToListAsync(); ).Mapper(it =>
{
it.ClientParams = tenantDb.Queryable<InfoClientParam>()
.Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable)
.Select<ClientParamRes>()
.ToList();
}).ToListAsync();
data.Add(new ClientSelectMultiRes("notifyparty", notifyparty)); data.Add(new ClientSelectMultiRes("notifyparty", notifyparty));
@ -483,9 +569,16 @@ public class ClientCommonService : IClientCommonService
Id = a.Id, Id = a.Id,
CodeName = a.CodeName, CodeName = a.CodeName,
ShortName = a.ShortName, ShortName = a.ShortName,
EnShortName = a.EnShortName EnShortName = a.EnShortName,
BLContent = a.BLContent
} }
).ToListAsync(); ).Mapper(it =>
{
it.ClientParams = tenantDb.Queryable<InfoClientParam>()
.Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable)
.Select<ClientParamRes>()
.ToList();
}).ToListAsync();
data.Add(new ClientSelectMultiRes("warehouse", warehouse)); data.Add(new ClientSelectMultiRes("warehouse", warehouse));
@ -497,9 +590,16 @@ public class ClientCommonService : IClientCommonService
Id = a.Id, Id = a.Id,
CodeName = a.CodeName, CodeName = a.CodeName,
ShortName = a.ShortName, ShortName = a.ShortName,
EnShortName = a.EnShortName EnShortName = a.EnShortName,
BLContent = a.BLContent
} }
).ToListAsync(); ).Mapper(it =>
{
it.ClientParams = tenantDb.Queryable<InfoClientParam>()
.Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable)
.Select<ClientParamRes>()
.ToList();
}).ToListAsync();
data.Add(new ClientSelectMultiRes("wharf", wharf)); data.Add(new ClientSelectMultiRes("wharf", wharf));
var insurer = await tenantDb.Queryable<InfoClient>() var insurer = await tenantDb.Queryable<InfoClient>()
@ -510,9 +610,16 @@ public class ClientCommonService : IClientCommonService
Id = a.Id, Id = a.Id,
CodeName = a.CodeName, CodeName = a.CodeName,
ShortName = a.ShortName, ShortName = a.ShortName,
EnShortName = a.EnShortName EnShortName = a.EnShortName,
BLContent = a.BLContent
} }
).ToListAsync(); ).Mapper(it =>
{
it.ClientParams = tenantDb.Queryable<InfoClientParam>()
.Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable)
.Select<ClientParamRes>()
.ToList();
}).ToListAsync();
data.Add(new ClientSelectMultiRes("insurer", insurer)); data.Add(new ClientSelectMultiRes("insurer", insurer));
var leasing = await tenantDb.Queryable<InfoClient>() var leasing = await tenantDb.Queryable<InfoClient>()
@ -523,9 +630,16 @@ public class ClientCommonService : IClientCommonService
Id = a.Id, Id = a.Id,
CodeName = a.CodeName, CodeName = a.CodeName,
ShortName = a.ShortName, ShortName = a.ShortName,
EnShortName = a.EnShortName EnShortName = a.EnShortName,
BLContent = a.BLContent
} }
).ToListAsync(); ).Mapper(it =>
{
it.ClientParams = tenantDb.Queryable<InfoClientParam>()
.Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable)
.Select<ClientParamRes>()
.ToList();
}).ToListAsync();
data.Add(new ClientSelectMultiRes("leasing", leasing)); data.Add(new ClientSelectMultiRes("leasing", leasing));
var tradingagency = await tenantDb.Queryable<InfoClient>() var tradingagency = await tenantDb.Queryable<InfoClient>()
@ -536,9 +650,16 @@ public class ClientCommonService : IClientCommonService
Id = a.Id, Id = a.Id,
CodeName = a.CodeName, CodeName = a.CodeName,
ShortName = a.ShortName, ShortName = a.ShortName,
EnShortName = a.EnShortName EnShortName = a.EnShortName,
BLContent = a.BLContent
} }
).ToListAsync(); ).Mapper(it =>
{
it.ClientParams = tenantDb.Queryable<InfoClientParam>()
.Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable)
.Select<ClientParamRes>()
.ToList();
}).ToListAsync();
data.Add(new ClientSelectMultiRes("tradingagency", tradingagency)); data.Add(new ClientSelectMultiRes("tradingagency", tradingagency));
var shipagency = await tenantDb.Queryable<InfoClient>() var shipagency = await tenantDb.Queryable<InfoClient>()
@ -549,9 +670,16 @@ public class ClientCommonService : IClientCommonService
Id = a.Id, Id = a.Id,
CodeName = a.CodeName, CodeName = a.CodeName,
ShortName = a.ShortName, ShortName = a.ShortName,
EnShortName = a.EnShortName EnShortName = a.EnShortName,
BLContent = a.BLContent
} }
).ToListAsync(); ).Mapper(it =>
{
it.ClientParams = tenantDb.Queryable<InfoClientParam>()
.Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable)
.Select<ClientParamRes>()
.ToList();
}).ToListAsync();
data.Add(new ClientSelectMultiRes("shipagency", shipagency)); data.Add(new ClientSelectMultiRes("shipagency", shipagency));
var enterprise = await tenantDb.Queryable<InfoClient>() var enterprise = await tenantDb.Queryable<InfoClient>()
@ -562,9 +690,16 @@ public class ClientCommonService : IClientCommonService
Id = a.Id, Id = a.Id,
CodeName = a.CodeName, CodeName = a.CodeName,
ShortName = a.ShortName, ShortName = a.ShortName,
EnShortName = a.EnShortName EnShortName = a.EnShortName,
BLContent = a.BLContent
} }
).ToListAsync(); ).Mapper(it =>
{
it.ClientParams = tenantDb.Queryable<InfoClientParam>()
.Where(x => x.CustomerId == it.Id && x.Status == StatusEnum.Enable)
.Select<ClientParamRes>()
.ToList();
}).ToListAsync();
data.Add(new ClientSelectMultiRes("enterprise", enterprise)); data.Add(new ClientSelectMultiRes("enterprise", enterprise));
return await Task.FromResult(DataResult<List<ClientSelectMultiRes>>.Success(data)); return await Task.FromResult(DataResult<List<ClientSelectMultiRes>>.Success(data));

@ -63,6 +63,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DS.WMS.TaskApi", "DS.WMS.Ta
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DS.Module.EmailModule", "DS.Module.EmailModule\DS.Module.EmailModule.csproj", "{4B51DCC1-62A5-49C5-978B-798E6B48F3C0}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DS.Module.EmailModule", "DS.Module.EmailModule\DS.Module.EmailModule.csproj", "{4B51DCC1-62A5-49C5-978B-798E6B48F3C0}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DS.Module.FastReportModule", "DS.Module.FastReportModule\DS.Module.FastReportModule.csproj", "{F7FD58CB-28DF-456E-A411-38444C4D8E3D}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU 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}.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.ActiveCfg = Release|Any CPU
{4B51DCC1-62A5-49C5-978B-798E6B48F3C0}.Release|Any CPU.Build.0 = 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 EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -209,6 +215,7 @@ Global
{32B97A3A-C361-44F3-B417-5D08E9FD9624} = {65D75DB2-12D5-4D1F-893D-9750905CE5E4} {32B97A3A-C361-44F3-B417-5D08E9FD9624} = {65D75DB2-12D5-4D1F-893D-9750905CE5E4}
{8DAE16A3-E249-4C86-BEEC-DA8429FD837C} = {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} {4B51DCC1-62A5-49C5-978B-798E6B48F3C0} = {518DB9B5-80A8-4B2C-8570-52BD406458DE}
{F7FD58CB-28DF-456E-A411-38444C4D8E3D} = {518DB9B5-80A8-4B2C-8570-52BD406458DE}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {66115F23-94B4-43C0-838E-33B5CF77F788} SolutionGuid = {66115F23-94B4-43C0-838E-33B5CF77F788}

Loading…
Cancel
Save