审计日志基础

master
ZR20090193-陈敬勇 9 months ago
parent 205bcba183
commit c2411d948a

@ -75,7 +75,7 @@ public class JwtHelper
new Claim(JwtRegisteredClaimNames.Aud, aud), // 接收者
// new Claim("OrgId", data.OrgId), // 公司ID
new Claim("UserName", data.Name), // UserName
new Claim("TenantId", data.TenantId), // 租户ID
};
@ -150,7 +150,10 @@ public class JwtHelper
/// Id
/// </summary>
public string Uid { get; set; }
/// <summary>
/// Name
/// </summary>
public string Name { get; set; }
/// <summary>
/// GID
/// </summary>

@ -9,6 +9,7 @@
<ItemGroup>
<ProjectReference Include="..\Ds.Module.AppStartup\Ds.Module.AppStartup.csproj" />
<ProjectReference Include="..\DS.Module.Core\DS.Module.Core.csproj" />
<ProjectReference Include="..\DS.Module.Log\DS.Module.Log.csproj" />
<ProjectReference Include="..\DS.Module.Nuget\DS.Module.Nuget.csproj" />
<ProjectReference Include="..\DS.Module.UserModule\DS.Module.UserModule.csproj" />
<ProjectReference Include="..\Ds.Modules.DsEntity\Ds.Modules.DsEntity.csproj" />
@ -19,4 +20,8 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Folder Include="Log\" />
</ItemGroup>
</Project>

@ -29,4 +29,10 @@ public interface ISaasDbService
/// </summary>
/// <returns></returns>
public SqlSugarScopeProvider GetMasterDbScope();
/// <summary>
/// 获取日志库信息
/// </summary>
/// <returns></returns>
public SqlSugarScopeProvider GetLogDb();
}

@ -62,6 +62,15 @@ public class SaasDbService : ISaasDbService
return db.GetConnection("1288018625843826688");
}
/// <summary>
/// 获取日志库信息
/// </summary>
/// <returns></returns>
public SqlSugarScopeProvider GetLogDb()
{
return db.GetConnectionScope("1288018625843826680");
}
/// <summary>
/// 主库根据Id获取业务库Scope

@ -48,7 +48,7 @@ namespace DS.Module.SqlSugar
builder.Services.AddScoped(typeof(DsDataAppService<>));
//sqlsugar注册
builder.Services.AddSqlsugarInstall();
builder.Services.AddSqlSugarInstall();
}
}
}

@ -0,0 +1,78 @@
using System.Text;
using SqlSugar;
namespace DS.Module.SqlSugar;
/// <summary>
/// sqlsuagr差异帮助类
/// </summary>
public static class SqlSugarDiffUtil
{
/// <summary>
/// 比较两个数据对象的修改内容
/// </summary>
/// <param name="beforeData"></param>
/// <param name="afterData"></param>
/// <returns></returns>
public static DiffLog GetDiff(List<DiffLogTableInfo> beforeData, List<DiffLogTableInfo> afterData)
{
string mianID = null;
if (beforeData != null)
{
var keyCoulumn = beforeData[0].Columns.FirstOrDefault(p => p.IsPrimaryKey == true);
if (keyCoulumn != null)
{
mianID = keyCoulumn.Value.ToString();
}
}
else if (afterData != null)
{
var keyCoulumn = afterData[0].Columns.FirstOrDefault(p => p.IsPrimaryKey == true);
if (keyCoulumn != null)
{
mianID = keyCoulumn.Value.ToString();
}
}
StringBuilder sb = new StringBuilder();
if (beforeData != null && afterData != null)
{
var befroeColumns = beforeData[0].Columns;
var afterCloums = afterData[0].Columns;
foreach (var item in befroeColumns)
{
if (IgnoreColumns.Contains(item.ColumnName))
continue;
var afterItem = afterCloums.FirstOrDefault(p => p.ColumnName == item.ColumnName && !p.Value.Equals(item.Value));
if (afterItem != null)
{
sb.Append($"[字段:{item.ColumnDescription},修改前:{item.Value},修改后:{afterItem.Value}]");
}
}
}
return new DiffLog { Id = mianID, DiffData = sb.ToString() };
}
public class DiffLog
{
/// <summary>
/// 主键Id
/// </summary>
public string Id { get; set; }
/// <summary>
/// 差异数据
/// </summary>
public string DiffData { get; set; }
}
/// <summary>
/// 忽略的字段
/// </summary>
private static readonly List<string> IgnoreColumns = new List<string>()
{
"CreateTime",
"CreateBy",
"UpdateTime",
"UpdateBy",
};
}

@ -1,5 +1,7 @@
using Ds.Modules.DsEntity.log;
using DS.Module.Core;
using Ds.Modules.DsEntity.log;
using DS.Module.Core.Data;
using DS.Module.Core.Extensions;
using DS.Module.UserModule;
using Newtonsoft.Json;
using SqlSugar;
@ -46,23 +48,71 @@ namespace DS.Module.SqlSugar
dbProvider.Aop.DataExecuting = (oldValue, entityInfo) =>
{
// 新增操作
SqlsugarHelper.InsertByObjectForSqlsugar(entityInfo, user);
if (entityInfo.OperationType == DataFilterType.InsertByObject)
{
if (entityInfo.PropertyName == "Id")
{
if (entityInfo.EntityColumnInfo.PropertyInfo.PropertyType == typeof(string))
{
entityInfo.SetValue(GuidHelper.GetSnowflakeId());
}
if (entityInfo.EntityColumnInfo.IsPrimarykey && entityInfo.EntityColumnInfo.PropertyInfo.PropertyType == typeof(long))
{
var id = entityInfo.EntityColumnInfo.PropertyInfo.GetValue(entityInfo.EntityValue);
if (id == null || (long)id == 0)
entityInfo.SetValue(SnowFlakeSingle.Instance.NextId());
}
}
if (entityInfo.PropertyName == "CreateTime")
entityInfo.SetValue(DateTime.Now);
if (entityInfo.PropertyName == "TenantId")
{
var tenantId = ((dynamic)entityInfo.EntityValue).TenantId;
if (tenantId == null || tenantId == 0)
entityInfo.SetValue(user.GetTenantId());
}
if (entityInfo.PropertyName == "CreateBy")
{
if (!user.UserId.IsNullOrEmpty())
{
entityInfo.SetValue(user.UserId);
}
else
{
entityInfo.SetValue(1288018625843826688);
}
}
if (entityInfo.PropertyName == "Deleted")
entityInfo.SetValue(false);
}
// 更新操作
SqlsugarHelper.UpdateByObjectForSqlsugar(entityInfo, user);
if (entityInfo.OperationType == DataFilterType.UpdateByObject)
{
if (entityInfo.PropertyName == "UpdateTime")
entityInfo.SetValue(DateTime.Now);
if (entityInfo.PropertyName == "UpdateBy" && user != null)
entityInfo.SetValue(user.UserId);
}
};
dbProvider.Aop.OnDiffLogEvent = (it) =>
dbProvider.Aop.OnDiffLogEvent = it =>
{
Console.WriteLine("执行更新前更新后:");
//操作前记录 包含: 字段描述 列名 值 表名 表描述
//var editBeforeData = it.BeforeData;//插入Before为null之前还没进库
// //操作后记录 包含: 字段描述 列名 值 表名 表描述
//var editAfterData = it.AfterData;
//var sql = it.Sql;
//var parameter = it.Parameters;
//var data = it.BusinessData;//这边会显示你传进来的对象
//var time = it.Time;
//var diffType = it.DiffType;//enum insert 、update and delete
var editBeforeData = it.BeforeData;//插入Before为null之前还没进库
//操作后记录 包含: 字段描述 列名 值 表名 表描述
var editAfterData = it.AfterData;
var sql = it.Sql;
var parameter = it.Parameters;
var data = it.BusinessData;//这边会显示你传进来的对象
var time = it.Time;
var diffType = it.DiffType;//enum insert 、update and delete
// Sys_Log_DataAop
var log = new Sys_Log_DataAop()
{
@ -76,7 +126,7 @@ namespace DS.Module.SqlSugar
};
Console.WriteLine("执行的sql:" + log);
//Write logic
DbScoped.Sugar.GetConnection(200).Insertable(log).ExecuteCommand();
// DbScoped.Sugar.GetConnection(1288018625843826680).Insertable(log).ExecuteCommand();
};
//全局过滤租户
dbProvider.QueryFilter.AddTableFilter<ITenantId>(m => m.TenantId == user.GetTenantId());

@ -80,6 +80,7 @@ namespace DS.Module.SqlSugar
entityInfo.SetValue(DateTime.Now);
if (entityInfo.PropertyName == "UpdateBy" && user != null)
entityInfo.SetValue(user.UserId);
}
}

@ -1,8 +1,11 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.Module.Core.Extensions;
using DS.Module.Log.Entity;
using DS.Module.UserModule;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
using SqlSugar;
namespace DS.Module.SqlSugar;
@ -31,7 +34,7 @@ public static class SqlsugarInstall
/// </summary>
/// <param name="services">依赖注入服务容器</param>
/// <returns></returns>
public static IServiceCollection AddSqlsugarInstall(this IServiceCollection services)
public static IServiceCollection AddSqlSugarInstall(this IServiceCollection services)
{
if (services == null) throw new ArgumentNullException(nameof(services));
Console.WriteLine("开始加载sqlsugar模块");
@ -80,10 +83,10 @@ public static class SqlsugarInstall
// }
// });
//}
var httpContextAccessor = services.GetService<IHttpContextAccessor>();
var user = services.GetService<IUser>();
if (user.IsNullOrEmpty())
{
var httpContextAccessor = services.GetService<IHttpContextAccessor>();
user = new AspNetUser(httpContextAccessor)
{
UserId = "1288018625843826688",
@ -92,89 +95,130 @@ public static class SqlsugarInstall
OrgId = "1288018625843826688"
};
}
//全局上下文生效
SqlSugarScope sqlSugar = new SqlSugarScope(connectConfigList,
db =>
{
// 封装AOP
SqlsugarAopHelper.AopForSqlsugar(db, user, dbList, connectConfigList);
///*
// * 默认只会配置到第一个数据库,这里按照官方文档进行多数据库/多租户文档的说明进行循环配置
// */
//foreach (var c in connectConfigList)
//{
// var dbProvider = db.GetConnectionScope((string)c.ConfigId);
// var user = services.GetService<IUser>();
// //单例参数配置,所有上下文生效
// dbProvider.Ado.CommandTimeOut = 30;
// dbProvider.Aop.OnLogExecuting = (sql, pars) =>
// {
// Logger.Log(LogLevel.Info,
// DateTime.Now.ToString() + "\r\n" +
// UtilMethods.GetSqlString(c.DbType, sql, pars));
// };
// dbProvider.Aop.DataExecuting = (oldValue, entityInfo) =>
// {
// // 新增操作
// SqlsugarHelper.InsertByObjectForSqlsugar(entityInfo, user);
// // 更新操作
// SqlsugarHelper.UpdateByObjectForSqlsugar(entityInfo, user);
// //if (entityInfo.OperationType == DataFilterType.InsertByObject)
// //{
// // if (entityInfo.PropertyName == "Id")
// // {
// // if (entityInfo.EntityColumnInfo.PropertyInfo.PropertyType == typeof(string))
// // {
// // entityInfo.SetValue(GuidHelper.GetSnowflakeId());
// // }
// // if (entityInfo.EntityColumnInfo.PropertyInfo.PropertyType == typeof(long))
// // {
// // entityInfo.SetValue(SnowFlakeSingle.Instance.NextId());
// // }
// // }
// // if (entityInfo.PropertyName == "CreateTime")
// // entityInfo.SetValue(DateTime.Now);
// // if (!user.UserId.IsNullOrEmpty())
// // {
// // if (entityInfo.PropertyName == "TenantId")
// // entityInfo.SetValue(user.GetTenantId());
// // }
// // if (entityInfo.PropertyName == "CreateBy")
// // {
// // if (!user.UserId.IsNullOrEmpty())
// // {
// // entityInfo.SetValue(user.UserId);
// // }
// // else
// // {
// // entityInfo.SetValue(1288018625843826688);
// // }
// // }
// // if (entityInfo.PropertyName == "Deleted")
// // entityInfo.SetValue(false);
// //}
// //if (entityInfo.OperationType == DataFilterType.UpdateByObject)
// //{
// // if (entityInfo.PropertyName == "UpdateTime")
// // entityInfo.SetValue(DateTime.Now);
// // if (entityInfo.PropertyName == "UpdateBy" && user != null)
// // entityInfo.SetValue(user.UserId);
// //}
// };
// dbProvider.Aop.OnError = (exp) => //执行SQL 错误事件
// {
// Logger.Error(DateTime.Now.ToString() + "\r\n" + exp.Sql + "\r\n" + exp.Parametres);
// };
// dbProvider.QueryFilter.AddTableFilter<ITenantId>(m => m.TenantId == user.GetTenantId());
// //全局软删除过滤
// dbProvider.QueryFilter.AddTableFilter<IDeleted>(m => m.Deleted == false);
//}
// SqlsugarAopHelper.AopForSqlsugar(db, user, dbList, connectConfigList);
Console.WriteLine("开始加载sqlsugar模块 要走过滤 起了");
foreach (var c in connectConfigList)
{
var dbProvider = db.GetConnectionScope((string)c.ConfigId);
// var user = services.GetService<IUser>();
//单例参数配置,所有上下文生效
dbProvider.Ado.CommandTimeOut = 30;
dbProvider.Aop.OnLogExecuting = (sql, pars) =>
{
//执行前事件
//Logger.Log(LogLevel.Info,
// DateTime.Now.ToString() + "\r\n" +
// UtilMethods.GetSqlString(c.DbType, sql, pars));
Console.WriteLine("执行的sql:" + sql);
};
//数据处理事件
dbProvider.Aop.DataExecuting = (oldValue, entityInfo) =>
{
// 新增操作
if (entityInfo.OperationType == DataFilterType.InsertByObject)
{
if (entityInfo.PropertyName == "Id")
{
if (entityInfo.EntityColumnInfo.PropertyInfo.PropertyType == typeof(string))
{
entityInfo.SetValue(GuidHelper.GetSnowflakeId());
}
if (entityInfo.EntityColumnInfo.IsPrimarykey &&
entityInfo.EntityColumnInfo.PropertyInfo.PropertyType == typeof(long))
{
var id = entityInfo.EntityColumnInfo.PropertyInfo.GetValue(entityInfo
.EntityValue);
if (id == null || (long)id == 0)
entityInfo.SetValue(SnowFlakeSingle.Instance.NextId());
}
}
if (entityInfo.PropertyName == "CreateTime")
entityInfo.SetValue(DateTime.Now);
if (entityInfo.PropertyName == "TenantId")
{
var tenantId = ((dynamic)entityInfo.EntityValue).TenantId;
if (tenantId == null || tenantId == 0)
entityInfo.SetValue(user.GetTenantId());
}
if (entityInfo.PropertyName == "CreateBy")
{
if (!user.UserId.IsNullOrEmpty())
{
entityInfo.SetValue(user.UserId);
}
else
{
entityInfo.SetValue(1288018625843826688);
}
}
if (entityInfo.PropertyName == "Deleted")
entityInfo.SetValue(false);
}
// 更新操作
if (entityInfo.OperationType == DataFilterType.UpdateByObject)
{
if (entityInfo.PropertyName == "UpdateTime")
entityInfo.SetValue(DateTime.Now);
if (entityInfo.PropertyName == "UpdateBy" && user != null)
entityInfo.SetValue(user.UserId);
}
};
dbProvider.Aop.OnDiffLogEvent = it =>
{
//排除日志库操作
if (Convert.ToInt64(c.ConfigId) != 1288018625843826680)
{
#region 插入日志审计表
//操作前记录 包含: 字段描述 列名 值 表名 表描述
var editBeforeData = it.BeforeData; //插入Before为null之前还没进库
//操作后记录 包含: 字段描述 列名 值 表名 表描述
var editAfterData = it.AfterData;
var sql = it.Sql;
var parameter = it.Parameters;
var data = it.BusinessData; //这边会显示你传进来的对象
var time = it.Time;
var diffType = it.DiffType; //enum insert 、update and delete
var diffData = SqlSugarDiffUtil.GetDiff(editBeforeData,editAfterData);
var auditData = new SysLogAudit()
{
KeyId =Convert.ToInt64(diffData.Id),
Sql = it.Sql,
Param = JsonConvert.SerializeObject(it.Parameters),
OperateType = diffType.ToString(),
OldValue = JsonConvert.SerializeObject(editAfterData),
NewValue = JsonConvert.SerializeObject(editAfterData),
DiffData = diffData.DiffData,
AopData = JsonConvert.SerializeObject(it.BusinessData),
// CreateUser = user.UserName
};
db.GetConnection(1288018625843826680).Insertable(auditData).ExecuteCommand();
#endregion
}
};
//全局过滤租户
dbProvider.QueryFilter.AddTableFilter<ITenantId>(m => m.TenantId == user.GetTenantId());
//全局过滤机构Id
dbProvider.QueryFilter.AddTableFilter<IOrgId>(m => m.OrgId == user.GetOrgId());
//全局软删除过滤
dbProvider.QueryFilter.AddTableFilter<IDeleted>(m => m.Deleted == false);
}
});
services.AddSingleton<ISqlSugarClient>(sqlSugar); //这边是SqlSugarScope用AddSingleton

@ -42,7 +42,24 @@ public class AspNetUser : IUser
_userId = value;
}
}
private string _userName;
public string UserName
{
get
{
if (_userId == null)
{
var claimValue = GetClaimValueByType("Name").FirstOrDefault();
_userName = claimValue != null ? claimValue.ObjToString() : "管理员";
}
return _userName;
}
set
{
_userName = value;
}
}
public long GetTenantId()
{
var token = GetToken();

@ -16,7 +16,11 @@ public interface IUser
/// 获取用户ID
/// </summary>
string UserId { get; }
/// <summary>
/// 获取用户名称
/// </summary>
string UserName { get; }
/// <summary>
/// 获取公司ID
/// </summary>

@ -85,4 +85,15 @@ public class VersionController : ApiController
var res = _invokeService.GetTenantVersionUpdateList(request);
return res;
}
/// <summary>
/// 更新租户表差异
/// </summary>
/// <returns></returns>
[HttpPost]
[Route("UpdateSaasTableInfo")]
public DataResult UpdateSaasTableInfo()
{
return _invokeService.UpdateSaasTableInfo();
}
}

@ -495,3 +495,136 @@
2024-03-05 16:16:28.3845 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.AdminApi\bin\Debug\net8.0\nlog.config
2024-03-05 16:16:28.4056 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-03-05 16:16:28.4584 Info Configuration initialized.
2024-03-06 17:32:32.6384 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-03-06 17:32:32.7478 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-03-06 17:32:32.7775 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-03-06 17:32:32.8505 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-03-06 17:32:32.9050 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.AdminApi\bin\Debug\net8.0\nlog.config
2024-03-06 17:32:32.9277 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-03-06 17:32:32.9741 Info Configuration initialized.
2024-03-06 17:48:48.0058 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-03-06 17:48:48.1276 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-03-06 17:48:48.1640 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-03-06 17:48:48.2346 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-03-06 17:48:48.2942 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.AdminApi\bin\Debug\net8.0\nlog.config
2024-03-06 17:48:48.3183 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-03-06 17:48:48.3738 Info Configuration initialized.
2024-03-07 11:52:21.9801 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-03-07 11:52:22.1448 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-03-07 11:52:22.1799 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-03-07 11:52:22.3513 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-03-07 11:52:22.4135 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.AdminApi\bin\Debug\net8.0\nlog.config
2024-03-07 11:52:22.4465 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-03-07 11:52:22.5127 Info Configuration initialized.
2024-03-07 13:54:47.3578 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-03-07 13:54:47.4420 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-03-07 13:54:47.4615 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-03-07 13:54:47.4969 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-03-07 13:54:47.5247 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.AdminApi\bin\Debug\net8.0\nlog.config
2024-03-07 13:54:47.5371 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-03-07 13:54:47.5652 Info Configuration initialized.
2024-03-07 14:02:19.4154 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-03-07 14:02:19.5301 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-03-07 14:02:19.5571 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-03-07 14:02:19.5955 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-03-07 14:02:19.6261 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.AdminApi\bin\Debug\net8.0\nlog.config
2024-03-07 14:02:19.6372 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-03-07 14:02:19.6716 Info Configuration initialized.
2024-03-07 14:10:05.4579 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-03-07 14:10:05.5399 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-03-07 14:10:05.5610 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-03-07 14:10:05.5998 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-03-07 14:10:05.6270 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.AdminApi\bin\Debug\net8.0\nlog.config
2024-03-07 14:10:05.6270 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-03-07 14:10:05.6743 Info Configuration initialized.
2024-03-07 14:57:44.2164 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-03-07 14:57:44.3419 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-03-07 14:57:44.3770 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-03-07 14:57:44.4455 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-03-07 14:57:44.5012 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.AdminApi\bin\Debug\net8.0\nlog.config
2024-03-07 14:57:44.5258 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-03-07 14:57:44.5794 Info Configuration initialized.
2024-03-07 15:10:03.0440 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-03-07 15:10:03.1644 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-03-07 15:10:03.2678 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-03-07 15:10:03.3579 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-03-07 15:10:03.4251 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.AdminApi\bin\Debug\net8.0\nlog.config
2024-03-07 15:10:03.4595 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-03-07 15:10:03.5358 Info Configuration initialized.
2024-03-07 15:23:08.4713 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-03-07 15:23:08.5323 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-03-07 15:23:08.5489 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-03-07 15:23:08.5766 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-03-07 15:23:08.5996 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.AdminApi\bin\Debug\net8.0\nlog.config
2024-03-07 15:23:08.5996 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-03-07 15:23:08.6363 Info Configuration initialized.
2024-03-07 15:26:22.7802 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-03-07 15:26:22.9054 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-03-07 15:26:22.9285 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-03-07 15:26:22.9793 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-03-07 15:26:23.0153 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.AdminApi\bin\Debug\net8.0\nlog.config
2024-03-07 15:26:23.0362 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-03-07 15:26:23.0766 Info Configuration initialized.
2024-03-07 16:00:35.9383 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-03-07 16:00:36.0453 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-03-07 16:00:36.0734 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-03-07 16:00:36.1376 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-03-07 16:00:36.1745 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.AdminApi\bin\Debug\net8.0\nlog.config
2024-03-07 16:00:36.1913 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-03-07 16:00:36.2225 Info Configuration initialized.
2024-03-07 16:03:04.6474 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-03-07 16:03:04.7398 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-03-07 16:03:04.7621 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-03-07 16:03:04.8224 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-03-07 16:03:04.8723 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.AdminApi\bin\Debug\net8.0\nlog.config
2024-03-07 16:03:04.8972 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-03-07 16:03:04.9368 Info Configuration initialized.
2024-03-07 16:06:00.6253 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-03-07 16:06:00.6634 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-03-07 16:06:00.6799 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-03-07 16:06:00.6961 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-03-07 16:06:00.7775 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.AdminApi\bin\Debug\net8.0\nlog.config
2024-03-07 16:06:00.8048 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-03-07 16:06:00.8768 Info Configuration initialized.
2024-03-07 16:18:00.3701 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-03-07 16:18:00.4034 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-03-07 16:18:00.4377 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-03-07 16:18:00.4698 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-03-07 16:18:00.5190 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.AdminApi\bin\Debug\net8.0\nlog.config
2024-03-07 16:18:00.5405 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-03-07 16:18:00.6048 Info Configuration initialized.
2024-03-07 16:36:29.2160 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-03-07 16:36:29.2424 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-03-07 16:36:29.2825 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-03-07 16:36:29.3307 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-03-07 16:36:29.3854 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.AdminApi\bin\Debug\net8.0\nlog.config
2024-03-07 16:36:29.4059 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-03-07 16:36:29.4556 Info Configuration initialized.
2024-03-07 16:43:12.1187 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-03-07 16:43:12.2237 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-03-07 16:43:12.2542 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-03-07 16:43:12.3038 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-03-07 16:43:12.3434 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.AdminApi\bin\Debug\net8.0\nlog.config
2024-03-07 16:43:12.3643 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-03-07 16:43:12.4007 Info Configuration initialized.
2024-03-07 16:57:48.6793 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-03-07 16:57:48.7936 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-03-07 16:57:48.8282 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-03-07 16:57:48.8958 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-03-07 16:57:48.9439 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.AdminApi\bin\Debug\net8.0\nlog.config
2024-03-07 16:57:48.9624 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-03-07 16:57:48.9986 Info Configuration initialized.
2024-03-07 16:59:27.7180 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-03-07 16:59:27.7454 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-03-07 16:59:27.7734 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-03-07 16:59:27.8319 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-03-07 16:59:27.8969 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.AdminApi\bin\Debug\net8.0\nlog.config
2024-03-07 16:59:27.9191 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-03-07 16:59:27.9782 Info Configuration initialized.
2024-03-07 17:06:59.5184 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-03-07 17:06:59.5466 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-03-07 17:06:59.5776 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-03-07 17:06:59.6175 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-03-07 17:06:59.6509 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.AdminApi\bin\Debug\net8.0\nlog.config
2024-03-07 17:06:59.6681 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-03-07 17:06:59.7206 Info Configuration initialized.

@ -31,7 +31,7 @@ builder.Host
builder.Services.AddAppWebInstal();
builder.Services.AddCorsInstall();
builder.Services.AddUserModuleInstall(); //用户服务
builder.Services.AddSqlsugarInstall();
builder.Services.AddSqlSugarInstall();
builder.Services.AddSwaggerInstall();
builder.Services.AddJwtInstall();
builder.Services.AddSaasDbInstall();//分库服务

@ -22,12 +22,11 @@
"DefaultDbString": "server=60.209.125.238;port=32006;uid=root;pwd=Djy@Mysql.test;database=shippingweb8_dev",
"DBS": [
{
"ConnId": "1595354960864874496",
"DBType": 1,
"ConnId": "1288018625843826680",
"DBType": 0,
"Enabled": false,
"HitRate": 40,
"Connection": "Data Source=47.105.193.36,11435;Initial Catalog=SHIPPINGWEB_JNHJ;Integrated Security=False;Connect Timeout=500;User ID=sa;Password=Ds20040201",
"ProviderName": "System.Data.SqlClient"
"Connection": "server=60.209.125.238;port=32006;uid=root;pwd=Djy@Mysql.test;database=shippingweb8_log"
}
]
},

@ -62,7 +62,7 @@ public class CodeCountryService:ICodeCountryService
info = req.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}
@ -110,7 +110,7 @@ public class CodeCountryService:ICodeCountryService
info = req.Adapt(info);
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}

@ -62,7 +62,7 @@ public class CodeCtnService:ICodeCtnService
info = req.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}
@ -110,7 +110,7 @@ public class CodeCtnService:ICodeCtnService
info = req.Adapt(info);
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}

@ -63,7 +63,7 @@ public class CodeGoodsService:ICodeGoodsService
info = req.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}
@ -112,7 +112,7 @@ public class CodeGoodsService:ICodeGoodsService
info = req.Adapt(info);
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}

@ -62,7 +62,7 @@ public class CodeGoodsTypeService:ICodeGoodsTypeService
info = req.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}
@ -110,7 +110,7 @@ public class CodeGoodsTypeService:ICodeGoodsTypeService
info = req.Adapt(info);
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}

@ -62,7 +62,7 @@ public class CodeIssueTypeService:ICodeIssueTypeService
info = req.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}
@ -110,7 +110,7 @@ public class CodeIssueTypeService:ICodeIssueTypeService
info = req.Adapt(info);
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}

@ -62,7 +62,7 @@ public class CodeLanesService:ICodeLanesService
info = req.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}
@ -110,7 +110,7 @@ public class CodeLanesService:ICodeLanesService
info = req.Adapt(info);
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}

@ -62,7 +62,7 @@ public class CodePackageService:ICodePackageService
info = req.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}
@ -110,7 +110,7 @@ public class CodePackageService:ICodePackageService
info = req.Adapt(info);
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}

@ -62,7 +62,7 @@ public class CodePortService:ICodePortService
info = req.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}
@ -100,7 +100,7 @@ public class CodePortService:ICodePortService
var data = req.Adapt<CodePort>();
var entity = tenantDb.Insertable(data).ExecuteReturnEntity();
var entity = tenantDb.Insertable(data).EnableDiffLogEvent().ExecuteReturnEntity();
return DataResult.Successed("添加成功!", entity.Id,MultiLanguageConst.DataCreateSuccess);
}

@ -62,7 +62,7 @@ public class CodeSourceDetailService:ICodeSourceDetailService
info = req.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}
@ -110,7 +110,7 @@ public class CodeSourceDetailService:ICodeSourceDetailService
info = req.Adapt(info);
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}

@ -62,7 +62,7 @@ public class CodeSourceService:ICodeSourceService
info = req.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}
@ -110,7 +110,7 @@ public class CodeSourceService:ICodeSourceService
info = req.Adapt(info);
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}

@ -62,7 +62,7 @@ public class CodeVesselService:ICodeVesselService
info = req.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}
@ -100,7 +100,7 @@ public class CodeVesselService:ICodeVesselService
var data = req.Adapt<CodeVessel>();
var entity = tenantDb.Insertable(data).ExecuteReturnEntity();
var entity = tenantDb.Insertable(data).EnableDiffLogEvent().ExecuteReturnEntity();
return DataResult.Successed("添加成功!", entity.Id,MultiLanguageConst.DataCreateSuccess);
}

@ -63,7 +63,7 @@ public class CodeVoynoService:ICodeVoynoService
info = req.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}
@ -112,7 +112,7 @@ public class CodeVoynoService:ICodeVoynoService
info = req.Adapt(info);
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}

@ -57,7 +57,7 @@ public class ClientFlowTemplateService : IClientFlowTemplateService
info = req.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}
@ -98,7 +98,7 @@ public class ClientFlowTemplateService : IClientFlowTemplateService
return DataResult.Failed("工作流实例存在引用的流程模板不能删除!",MultiLanguageConst.FlowTemplateDelExistImport);
}
db.Deleteable(info).ExecuteCommand();
db.Deleteable(info).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("删除成功!",MultiLanguageConst.DataDelSuccess);
}

@ -62,7 +62,7 @@ public class FlowInstanceService : IFlowInstanceService
}
info = req.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}

@ -64,7 +64,7 @@ public class FlowTemplateService:IFlowTemplateService
info = req.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!");
}
}

@ -70,6 +70,7 @@ public class CommonService : ICommonService
var tokenModel = new JwtHelper.JwtTokenModel
{
Uid = userInfo.Id.ToString(),
Name = userInfo.UserName,
// OrgId = userInfo.OrgId,
// GID = userInfo.GID,
TenantId = userInfo.TenantId.ToString(),
@ -87,10 +88,10 @@ public class CommonService : ICommonService
{
var userId = long.Parse(user.UserId);
var tenantId = user.GetTenantId();
var tokenModel = new JwtHelper.JwtTokenModel
{
Uid = user.UserId,
Name = db.Queryable<SysUser>().Filter(null, true).First(x => x.Id == userId).UserName,
// OrgId = userInfo.OrgId,
// GID = userInfo.GID,
TenantId = tenantId.ToString(),
@ -268,6 +269,7 @@ public class CommonService : ICommonService
var tokenModel = new JwtHelper.JwtTokenModel
{
Uid = user.UserId,
Name = db.Queryable<SysUser>().Filter(null, true).First(x => x.Id == userId).UserName,
TenantId = tenantId.ToString(),
};
var data = new RefreshTokenRes
@ -310,6 +312,7 @@ public class CommonService : ICommonService
var tokenModel = new JwtHelper.JwtTokenModel
{
Uid = user.UserId,
Name = db.Queryable<SysUser>().Filter(null, true).First(x => x.Id == userId).UserName,
TenantId = tenantId.ToString(),
};
var data = new RefreshTokenRes
@ -358,6 +361,7 @@ public class CommonService : ICommonService
var tokenModel = new JwtHelper.JwtTokenModel
{
Uid = userInfo.Id.ToString(),
Name = userInfo.UserName,
// OrgId = orgRelation.OrgId.ToString(),
TenantId = userInfo.TenantId.ToString(),
};
@ -383,6 +387,7 @@ public class CommonService : ICommonService
var tokenModel = new JwtHelper.JwtTokenModel
{
Uid = user.UserId,
Name = db.Queryable<SysUser>().Filter(null, true).First(x => x.Id == userId).UserName,
// OrgId = user.GetOrgId().ToString(),
TenantId = tenantId.ToString(),
};
@ -440,6 +445,7 @@ public class CommonService : ICommonService
{
Uid = userId,
OrgId = id,
Name = sysUser.UserName,
TenantId = tenantId.ToString(),
};
var token = new RefreshTokenRes

@ -68,7 +68,7 @@ public class ConfigService : IConfigService
info = req.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}

@ -69,7 +69,7 @@ public class DataRuleService : IDataRuleService
info = req.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}

@ -62,7 +62,7 @@ public class LanguageSetService:ILanguageSetService
info = req.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!");
}
}

@ -124,7 +124,7 @@ public class PermissionService : IPermissionService
var info = db.Queryable<SysPermission>().Where(x => x.Id == model.Id).First();
var data = model.Adapt(info);
db.Updateable(data).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(data).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
// db.Updateable(info).IgnoreColumns(ignoreAllNullColumns:true).IgnoreColumns(u => new { u.AddBy,u.CreateTime }).ExecuteCommand();
return DataResult.Successed("更新权限成功!");

@ -68,7 +68,7 @@ public class SequenceRuleService : ISequenceRuleService
info = req.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}

@ -69,7 +69,7 @@ public class SequenceService : ISequenceService
info = req.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}

@ -59,7 +59,7 @@ public class SysDictDataService:ISysDictDataService
info = req.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}

@ -62,7 +62,7 @@ public class SysDictTypeService:ISysDictTypeService
info = req.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}

@ -67,7 +67,7 @@ public class SysOrgService:ISysOrgService
info = req.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}

@ -74,7 +74,7 @@ public class SysRoleService : ISysRoleService
info = model.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}

@ -291,7 +291,7 @@ public class TenantApplyService : ITenantApplyService
apply.AuditStatus = (AuditStatusEnum)(int)req.AuditInfo.Status;
apply.AuditTime = DateTime.Now;
apply.AuditNote = req.AuditInfo.AuditNote;
await masterDb.Updateable(apply).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
await masterDb.Updateable(apply).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommandAsync();
await dbScope.Ado.CommitTranAsync();
return await Task.FromResult(DataResult.Successed("审批成功!"));

@ -149,7 +149,7 @@ public class UserService : IUserService
info = model.MapTo<UserReq, SysUser>();
info.PinYinCode = PinYinUtil.GetFristLetter(info.UserName);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
#region 处理用户角色

@ -74,7 +74,7 @@ public class VersionService : IVersionService
info = req.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess);
}
}
@ -175,7 +175,7 @@ public class VersionService : IVersionService
}
version.Executed = true;
await db.Updateable(version).ExecuteCommandAsync();
await db.Updateable(version).EnableDiffLogEvent().ExecuteCommandAsync();
await dbScope.Ado.CommitTranAsync();
return await Task.FromResult(DataResult.Successed("执行版本更新成功!", MultiLanguageConst.DataUpdateSuccess));

@ -215,3 +215,31 @@
2024-03-05 15:54:03.1623 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
2024-03-05 15:54:03.1820 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-03-05 15:54:03.2199 Info Configuration initialized.
2024-03-06 17:45:02.1922 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-03-06 17:45:02.2980 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-03-06 17:45:02.3199 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-03-06 17:45:02.3660 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-03-06 17:45:02.4013 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
2024-03-06 17:45:02.4224 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-03-06 17:45:02.4650 Info Configuration initialized.
2024-03-07 12:01:04.4405 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-03-07 12:01:04.5046 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-03-07 12:01:04.5189 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-03-07 12:01:04.5612 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-03-07 12:01:04.5866 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
2024-03-07 12:01:04.5964 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-03-07 12:01:04.6228 Info Configuration initialized.
2024-03-07 14:04:43.2705 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-03-07 14:04:43.3995 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-03-07 14:04:43.4318 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-03-07 14:04:43.5060 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-03-07 14:04:43.5694 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
2024-03-07 14:04:43.6068 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-03-07 14:04:43.6704 Info Configuration initialized.
2024-03-07 15:59:11.3516 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-03-07 15:59:11.4503 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-03-07 15:59:11.4688 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-03-07 15:59:11.5281 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-03-07 15:59:11.5733 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
2024-03-07 15:59:11.5941 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-03-07 15:59:11.6429 Info Configuration initialized.

@ -33,7 +33,7 @@ builder.Host
builder.Services.AddAppWebInstal();
builder.Services.AddCorsInstall();
builder.Services.AddUserModuleInstall(); //用户服务
builder.Services.AddSqlsugarInstall();
builder.Services.AddSqlSugarInstall();
builder.Services.AddSwaggerInstall();
builder.Services.AddJwtInstall();
builder.Services.AddSaasDbInstall();//分库服务

@ -22,12 +22,11 @@
"DefaultDbString": "server=60.209.125.238;port=32006;uid=root;pwd=Djy@Mysql.test;database=shippingweb8_dev",
"DBS": [
{
"ConnId": "1595354960864874496",
"DBType": 1,
"ConnId": "1288018625843826680",
"DBType": 0,
"Enabled": false,
"HitRate": 40,
"Connection": "Data Source=47.105.193.36,11435;Initial Catalog=SHIPPINGWEB_JNHJ;Integrated Security=False;Connect Timeout=500;User ID=sa;Password=Ds20040201",
"ProviderName": "System.Data.SqlClient"
"Connection": "server=60.209.125.238;port=32006;uid=root;pwd=Djy@Mysql.test;database=shippingweb8_log"
}
]
},

@ -50,7 +50,7 @@ public class Startup
{
// services.AddTransient<ITestService, TestService>();
services.AddUserModuleInstall(); //用户服务
services.AddSqlsugarInstall();
services.AddSqlSugarInstall();
services.AddSaasDbInstall();
}

@ -15,7 +15,7 @@ namespace Ds.WMS.Finance.MediatR
public void ConfigureServices(WebApplicationBuilder builder)
{
//builder.Services.AddSqlsugarInstall();
//builder.Services.AddSqlSugarInstall();
var assembly = AppDomain.CurrentDomain.Load("Ds.WMS.Finance.MediatR");
builder.Services.AddMediatR(c =>

@ -65,6 +65,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DS.WMS.Test", "DS.WMS.Test\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DS.Module.MultiLanguage", "DS.Module.MultiLanguage\DS.Module.MultiLanguage.csproj", "{FE82ABD4-CE11-49F6-823C-6E0B64135FFC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DS.Module.Log", "DS.Module.Log\DS.Module.Log.csproj", "{739899DE-D41F-4083-94E1-EDA349344ECC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -179,6 +181,10 @@ Global
{FE82ABD4-CE11-49F6-823C-6E0B64135FFC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FE82ABD4-CE11-49F6-823C-6E0B64135FFC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FE82ABD4-CE11-49F6-823C-6E0B64135FFC}.Release|Any CPU.Build.0 = Release|Any CPU
{739899DE-D41F-4083-94E1-EDA349344ECC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{739899DE-D41F-4083-94E1-EDA349344ECC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{739899DE-D41F-4083-94E1-EDA349344ECC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{739899DE-D41F-4083-94E1-EDA349344ECC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -211,6 +217,7 @@ Global
{47702656-3E62-4477-B72C-ADA39034B5A7} = {518DB9B5-80A8-4B2C-8570-52BD406458DE}
{A8749917-1B4C-4976-98F7-C0A1B043DE38} = {EB351D25-8071-4AE1-B981-EA52B5C2C06E}
{FE82ABD4-CE11-49F6-823C-6E0B64135FFC} = {518DB9B5-80A8-4B2C-8570-52BD406458DE}
{739899DE-D41F-4083-94E1-EDA349344ECC} = {518DB9B5-80A8-4B2C-8570-52BD406458DE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {66115F23-94B4-43C0-838E-33B5CF77F788}

Loading…
Cancel
Save