Merge branch 'development' of https://git.dlhis.com/liguoyang/jinko.yikatong into development

This commit is contained in:
cheche
2024-03-08 17:59:31 +08:00
4 changed files with 15 additions and 9 deletions

View File

@@ -44,6 +44,7 @@ public class DeviceTaskEntity : SugarBaseEntity, ITenantId, IVersion
/// <summary>
/// 处理结果
/// </summary>
[SugarColumn(ColumnDataType = "longtext")]
public string ResultMessage { get; set; }
public string TenantId { get; set; }

View File

@@ -10,17 +10,20 @@ namespace Dlhis.ScheduledTask.TaskAssignment.Job;
public class CreateGetUploadRecordJob
{
private readonly IDbContext _dbContext;
private readonly ILogger<CreateSyncServerDateTimeJob> _logger;
private readonly ILogger<CreateGetUploadRecordJob> _logger;
private readonly ISqlSugarOptionsService _sqlSugarOptionsService;
public CreateGetUploadRecordJob(IDbContext dbContext, ILogger<CreateSyncServerDateTimeJob> logger)
public CreateGetUploadRecordJob(IDbContext dbContext, ILogger<CreateGetUploadRecordJob> logger, ISqlSugarOptionsService sqlSugarOptionsService)
{
_logger = logger;
_sqlSugarOptionsService = sqlSugarOptionsService;
_dbContext = dbContext;
}
public async Task RunAsync()
{
_dbContext.Client.QueryFilter.ClearAndBackup<ITenantId>();
_sqlSugarOptionsService.IgnoreTenant = true;
try
{
var devices = await _dbContext.Queryable<DeviceEntity>()
@@ -60,6 +63,7 @@ public class CreateGetUploadRecordJob
}
finally
{
_sqlSugarOptionsService.IgnoreTenant = false;
_dbContext.Client.QueryFilter.Restore();
}
}

View File

@@ -10,17 +10,20 @@ namespace Dlhis.ScheduledTask.TaskAssignment.Job
{
private readonly IDbContext _dbContext;
private readonly ILogger<CreateSyncServerDateTimeJob> _logger;
private readonly ISqlSugarOptionsService _sqlSugarOptionsService;
public CreateSyncServerDateTimeJob(IDbContext dbContext, ILogger<CreateSyncServerDateTimeJob> logger)
public CreateSyncServerDateTimeJob(IDbContext dbContext, ILogger<CreateSyncServerDateTimeJob> logger, ISqlSugarOptionsService sqlSugarOptionsService)
{
_dbContext = dbContext;
_logger = logger;
_sqlSugarOptionsService = sqlSugarOptionsService;
}
public async Task RunAsync()
{
_dbContext.Client.QueryFilter.ClearAndBackup<ITenantId>();
_sqlSugarOptionsService.IgnoreTenant = true;
try
{
var deviceUniqueNos = await _dbContext.Queryable<DeviceTaskEntity>()
@@ -60,6 +63,7 @@ namespace Dlhis.ScheduledTask.TaskAssignment.Job
}
finally
{
_sqlSugarOptionsService.IgnoreTenant = false;
_dbContext.Client.QueryFilter.Restore();
}
}

View File

@@ -13,16 +13,13 @@
"AppName": "yiliantong"
},
"SqlSugarOptions": {
"DefaultConnectionString": "server=10.27.21.22;port=3306;userid=root;password=dlhis123;database=yikatong;charset=utf8mb4;",
"DefaultConnectionString": "server=192.168.199.124;port=3306;userid=root;password=dlhis123;database=yikatong;charset=utf8mb4;",
"SlaveConnectionString": [],
"FaceConnectionString": "server=10.27.21.20;port=3306;userid=root;password=dlhis123;database=face;charset=utf8mb4;",
"FaceConnectionString": "server=192.168.199.124;port=3306;userid=root;password=dlhis123;database=face;charset=utf8mb4;",
"Timeout": 30,
"SlowSqlTime": 1,
"EnableSqlLog": false
},
"ConnectionStrings": {
"HangfireConnection": "server=10.27.21.22;port=3306;userid=root;password=dlhis123;database=hangfire;default command timeout=100;Connection Timeout=30;Charset=utf8mb4;Allow User Variables=true;IgnoreCommandTransaction=true"
},
"FaceUrlOptions": {
"Url": "https://yikatong.isawesome.cn/api/basic/gainfos/face?token=",
"Limit": 7200
@@ -86,7 +83,7 @@
{
"Name": "MySQL",
"Args": {
"connectionString": "server=10.27.21.22;port=3306;userid=root;password=dlhis123;database=log;charset=utf8mb4;",
"connectionString": "server=192.168.199.124;port=3306;userid=root;password=dlhis123;database=log;charset=utf8mb4;",
"tableName": "Logs",
"autoCreateSqlTable": true
}