From 27663b4e535111c8e0455163d5a703373d43929c Mon Sep 17 00:00:00 2001 From: liguoyang Date: Fri, 8 Mar 2024 16:42:22 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix=20=E6=95=B0=E6=8D=AE=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Device/Entities/{DeviceTask.cs => DeviceTaskEntity.cs} | 1 + .../TaskAssignment/Job/CreateGetUploadRecordJob.cs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) rename Src/Dlhis.Entity/Device/Entities/{DeviceTask.cs => DeviceTaskEntity.cs} (96%) diff --git a/Src/Dlhis.Entity/Device/Entities/DeviceTask.cs b/Src/Dlhis.Entity/Device/Entities/DeviceTaskEntity.cs similarity index 96% rename from Src/Dlhis.Entity/Device/Entities/DeviceTask.cs rename to Src/Dlhis.Entity/Device/Entities/DeviceTaskEntity.cs index f1348681..22d404b6 100644 --- a/Src/Dlhis.Entity/Device/Entities/DeviceTask.cs +++ b/Src/Dlhis.Entity/Device/Entities/DeviceTaskEntity.cs @@ -44,6 +44,7 @@ public class DeviceTaskEntity : SugarBaseEntity, ITenantId, IVersion /// /// 处理结果 /// + [SugarColumn(ColumnDataType = "longtext")] public string ResultMessage { get; set; } public string TenantId { get; set; } diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Job/CreateGetUploadRecordJob.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Job/CreateGetUploadRecordJob.cs index c66584a7..f8835e35 100644 --- a/Src/Dlhis.ScheduledTask/TaskAssignment/Job/CreateGetUploadRecordJob.cs +++ b/Src/Dlhis.ScheduledTask/TaskAssignment/Job/CreateGetUploadRecordJob.cs @@ -10,9 +10,9 @@ namespace Dlhis.ScheduledTask.TaskAssignment.Job; public class CreateGetUploadRecordJob { private readonly IDbContext _dbContext; - private readonly ILogger _logger; + private readonly ILogger _logger; - public CreateGetUploadRecordJob(IDbContext dbContext, ILogger logger) + public CreateGetUploadRecordJob(IDbContext dbContext, ILogger logger) { _logger = logger; _dbContext = dbContext; From 23cc2588a3ad5efaa7deb74127d39d5ca29ee7bd Mon Sep 17 00:00:00 2001 From: liguoyang Date: Fri, 8 Mar 2024 16:48:32 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix=20rebase=E9=85=8D=E7=BD=AE=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/Dlhis.ScheduledTask/appsettings.json | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Src/Dlhis.ScheduledTask/appsettings.json b/Src/Dlhis.ScheduledTask/appsettings.json index 6ab2844d..2fe0bba9 100644 --- a/Src/Dlhis.ScheduledTask/appsettings.json +++ b/Src/Dlhis.ScheduledTask/appsettings.json @@ -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 } From 96ed9e04ef6dd6bd472100cedf976fb2136de32a Mon Sep 17 00:00:00 2001 From: liguoyang Date: Fri, 8 Mar 2024 17:07:07 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix=20tenantId=20null=20=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TaskAssignment/Job/CreateGetUploadRecordJob.cs | 6 +++++- .../TaskAssignment/Job/CreateSyncServerDateTimeJob.cs | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Job/CreateGetUploadRecordJob.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Job/CreateGetUploadRecordJob.cs index f8835e35..d11caa4c 100644 --- a/Src/Dlhis.ScheduledTask/TaskAssignment/Job/CreateGetUploadRecordJob.cs +++ b/Src/Dlhis.ScheduledTask/TaskAssignment/Job/CreateGetUploadRecordJob.cs @@ -11,16 +11,19 @@ public class CreateGetUploadRecordJob { private readonly IDbContext _dbContext; private readonly ILogger _logger; + private readonly ISqlSugarOptionsService _sqlSugarOptionsService; - public CreateGetUploadRecordJob(IDbContext dbContext, ILogger logger) + public CreateGetUploadRecordJob(IDbContext dbContext, ILogger logger, ISqlSugarOptionsService sqlSugarOptionsService) { _logger = logger; + _sqlSugarOptionsService = sqlSugarOptionsService; _dbContext = dbContext; } public async Task RunAsync() { _dbContext.Client.QueryFilter.ClearAndBackup(); + _sqlSugarOptionsService.IgnoreTenant = true; try { var devices = await _dbContext.Queryable() @@ -60,6 +63,7 @@ public class CreateGetUploadRecordJob } finally { + _sqlSugarOptionsService.IgnoreTenant = false; _dbContext.Client.QueryFilter.Restore(); } } diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Job/CreateSyncServerDateTimeJob.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Job/CreateSyncServerDateTimeJob.cs index 789d6722..a8efb1c1 100644 --- a/Src/Dlhis.ScheduledTask/TaskAssignment/Job/CreateSyncServerDateTimeJob.cs +++ b/Src/Dlhis.ScheduledTask/TaskAssignment/Job/CreateSyncServerDateTimeJob.cs @@ -10,17 +10,20 @@ namespace Dlhis.ScheduledTask.TaskAssignment.Job { private readonly IDbContext _dbContext; private readonly ILogger _logger; + private readonly ISqlSugarOptionsService _sqlSugarOptionsService; - public CreateSyncServerDateTimeJob(IDbContext dbContext, ILogger logger) + public CreateSyncServerDateTimeJob(IDbContext dbContext, ILogger logger, ISqlSugarOptionsService sqlSugarOptionsService) { _dbContext = dbContext; _logger = logger; + _sqlSugarOptionsService = sqlSugarOptionsService; } public async Task RunAsync() { _dbContext.Client.QueryFilter.ClearAndBackup(); + _sqlSugarOptionsService.IgnoreTenant = true; try { var deviceUniqueNos = await _dbContext.Queryable() @@ -60,6 +63,7 @@ namespace Dlhis.ScheduledTask.TaskAssignment.Job } finally { + _sqlSugarOptionsService.IgnoreTenant = false; _dbContext.Client.QueryFilter.Restore(); } }