From 77625189bea07d19bdd48c361c5e50b16faa475c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=BA=20=E6=9D=A8?= Date: Wed, 27 Mar 2024 16:41:57 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=92=8C=E7=94=9F=E4=BA=A7=E7=8E=AF=E5=A2=83=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../appsettings.Staging.json | 38 +++++++++++++++++++ .../appsettings.json | 10 ++--- 2 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 Dolphin.ExamPictureCut.HttpApi.Host/appsettings.Staging.json diff --git a/Dolphin.ExamPictureCut.HttpApi.Host/appsettings.Staging.json b/Dolphin.ExamPictureCut.HttpApi.Host/appsettings.Staging.json new file mode 100644 index 0000000..22f9800 --- /dev/null +++ b/Dolphin.ExamPictureCut.HttpApi.Host/appsettings.Staging.json @@ -0,0 +1,38 @@ +{ + "App": { + "CorsOrigins": "https://*.23544.com" + }, + "ConnectionStrings": { + "marking_basic": "Server=102553.23544.com;Port=3306;Database=marking_basic;Uid=marking;Pwd=qwe123!@#;AllowLoadLocalInfile=true;", + "penoffline": "host=47.108.209.28;port=8812;username=zhjs;password=zhjsniubi;database=qdb;ServerCompatibilityMode=NoTypeLoading;" + }, + "Redis": { + "Configuration": "102553.23544.com,password=qwe123!@#,defaultDatabase=1,idleTimeout=3000,poolsize=5,prefix=marking" + }, + "StringEncryption": { + "DefaultPassPhrase": "LB6Ts3T0sdE5VSNq" + }, + "RabbitMQ": { + "Connections": { + "Default": { + "HostName": "102553.23544.com", + "Port": "5672", + "UserName": "mkadmin", + "Password": "poiuyt)(*&^%", + "VirtualHost": "marking" + } + }, + "EventBus": { + "ClientName": "collect_queue", + "ExchangeName": "exam_gather_ex" + } + }, + "Aliyun": { + "AccessKeyId": "LTAI5tJ6stiMWGhVU3TtRyAf", + "AccessKeySecret": "A3pwnGx2SW1orvraCkXta6Lx4sV06e", + "Endpoint": "https://oss-cn-chengdu.aliyuncs.com", + "RegionId": "oss-cn-chengdu", + "ContainerName": "mk-xk-test", + "Host": "//mk-xk-test.23544.com" + } +} diff --git a/Dolphin.ExamPictureCut.HttpApi.Host/appsettings.json b/Dolphin.ExamPictureCut.HttpApi.Host/appsettings.json index 7bf9529..5fcc9b0 100644 --- a/Dolphin.ExamPictureCut.HttpApi.Host/appsettings.json +++ b/Dolphin.ExamPictureCut.HttpApi.Host/appsettings.json @@ -3,11 +3,11 @@ "CorsOrigins": "https://*.23544.com" }, "ConnectionStrings": { - "marking_basic": "Server=192.168.2.9;Port=3306;Database=marking_basic;Uid=root;Pwd=qwe123!@#;AllowLoadLocalInfile=true;", + "marking_basic": "Server=mk-rds.23544.com;Port=33306;Database=marking_basic;Uid=marking;Pwd=poiuytPOIUYT098765)(*&^%;AllowLoadLocalInfile=true;", "penoffline": "host=47.108.209.28;port=8812;username=zhjs;password=zhjsniubi;database=qdb;ServerCompatibilityMode=NoTypeLoading;" }, "Redis": { - "Configuration": "192.168.2.7:6379,password=qwe123!@#,defaultDatabase=14,idleTimeout=3000,poolsize=5,prefix=marking" + "Configuration": "102553.23544.com:6379,password=qwe123!@#,defaultDatabase=4,idleTimeout=3000,poolsize=5,prefix=marking" }, "StringEncryption": { "DefaultPassPhrase": "LB6Ts3T0sdE5VSNq" @@ -15,10 +15,10 @@ "RabbitMQ": { "Connections": { "Default": { - "HostName": "192.168.2.7", + "HostName": "47.109.67.254", "Port": "5672", - "UserName": "rabbit", - "Password": "qwe123!@#", + "UserName": "mkadmin", + "Password": "poiuyt)(*&^%", "VirtualHost": "marking" } }, From d269c6d1b4f895b082b55f9a53c08eb83ad786ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=BA=20=E6=9D=A8?= Date: Fri, 29 Mar 2024 09:16:05 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=9F=E4=BA=A7?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dolphin.ExamPictureCut.HttpApi.Host/appsettings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dolphin.ExamPictureCut.HttpApi.Host/appsettings.json b/Dolphin.ExamPictureCut.HttpApi.Host/appsettings.json index 5fcc9b0..7ff107f 100644 --- a/Dolphin.ExamPictureCut.HttpApi.Host/appsettings.json +++ b/Dolphin.ExamPictureCut.HttpApi.Host/appsettings.json @@ -7,7 +7,7 @@ "penoffline": "host=47.108.209.28;port=8812;username=zhjs;password=zhjsniubi;database=qdb;ServerCompatibilityMode=NoTypeLoading;" }, "Redis": { - "Configuration": "102553.23544.com:6379,password=qwe123!@#,defaultDatabase=4,idleTimeout=3000,poolsize=5,prefix=marking" + "Configuration": "47.109.67.254:16379,password=poiuyt)(*&^%,defaultDatabase=0,idleTimeout=3000,poolsize=5,prefix=marking" }, "StringEncryption": { "DefaultPassPhrase": "LB6Ts3T0sdE5VSNq" From 5a82cea4b4c032eca13108f49286c935ddf42546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=BA=20=E6=9D=A8?= Date: Fri, 29 Mar 2024 14:15:59 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=8F=91=E7=89=88=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dolphin.ExamPictureCut.Application/Exams/ExamManager.cs | 2 +- Dolphin.ExamPictureCut.Application/Services/ExamAppService.cs | 2 +- Dolphin.ExamPictureCut.HttpApi.Host/Program.cs | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Dolphin.ExamPictureCut.Application/Exams/ExamManager.cs b/Dolphin.ExamPictureCut.Application/Exams/ExamManager.cs index bf18c09..66bc4ce 100644 --- a/Dolphin.ExamPictureCut.Application/Exams/ExamManager.cs +++ b/Dolphin.ExamPictureCut.Application/Exams/ExamManager.cs @@ -47,7 +47,7 @@ public class ExamManager : DomainService, IExamManager public async Task ExamStudentGather(ExamStudentGatherEto eto) { var penSerial = eto.StudentExamNum; - Logger.LogInformation("{ExamSubjectId} {penSerial} 开始收集...", eto.ExamSubjectId, penSerial); + Logger.LogInformation($"开始收集... 参数:{JsonConvert.SerializeObject(eto)}"); var guid = GuidGenerator.Create().ToString("N"); var templates = await Db.Queryable().Where(w => w.BookId == eto.BookId) diff --git a/Dolphin.ExamPictureCut.Application/Services/ExamAppService.cs b/Dolphin.ExamPictureCut.Application/Services/ExamAppService.cs index cf7c9e6..8756216 100644 --- a/Dolphin.ExamPictureCut.Application/Services/ExamAppService.cs +++ b/Dolphin.ExamPictureCut.Application/Services/ExamAppService.cs @@ -12,6 +12,6 @@ public class ExamAppService : DolphinAppService public async Task Test() { - await _examManager.ExamStudentGather(new() { SchoolId = 1, StudentExamNum = "BP2-3G3-07K-BZ", BookId = 528102717276229, ExamSubjectSchoolId = 528066671910982, ExamSubjectId = 528066655817797, LastCollectTime = DateTime.Now }); + await _examManager.ExamStudentGather(new() { SchoolId = 3, StudentExamNum = "BP2-3G3-07K-C1", BookId = 529493484986437, ExamSubjectSchoolId = 530151338438726, ExamSubjectId = 530151329325125, LastCollectTime = DateTime.Now }); } } diff --git a/Dolphin.ExamPictureCut.HttpApi.Host/Program.cs b/Dolphin.ExamPictureCut.HttpApi.Host/Program.cs index 726d07c..0c91325 100644 --- a/Dolphin.ExamPictureCut.HttpApi.Host/Program.cs +++ b/Dolphin.ExamPictureCut.HttpApi.Host/Program.cs @@ -1,4 +1,4 @@ -using Serilog; +using Serilog; using Serilog.Events; namespace Dolphin.ExamPictureCut; @@ -28,6 +28,7 @@ public class Program try { Log.Information("Starting Dolphin.ExamPictureCut.HttpApi.Host."); + Log.Information("Current Env:" + Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")); var builder = WebApplication.CreateBuilder(args); builder.Host.AddAppSettingsSecretsJson() .UseAutofac() From 0cfc2a7b12bf115b61910d50b6e897b4d0e6548c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=BA=20=E6=9D=A8?= Date: Fri, 29 Mar 2024 14:40:42 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dolphin.ExamPictureCut.Application/Exams/ExamManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dolphin.ExamPictureCut.Application/Exams/ExamManager.cs b/Dolphin.ExamPictureCut.Application/Exams/ExamManager.cs index 66bc4ce..a746980 100644 --- a/Dolphin.ExamPictureCut.Application/Exams/ExamManager.cs +++ b/Dolphin.ExamPictureCut.Application/Exams/ExamManager.cs @@ -70,7 +70,7 @@ public class ExamManager : DomainService, IExamManager var paperIds = templates.Select(s => s.PaperId).ToList(); // 获取点阵数据 - var timespan = (long)(eto.LastCollectTime - new DateTime(1970, 1, 1, 0, 0, 0)).TotalMilliseconds; + var timespan = (long)(eto.LastCollectTime - TimeZoneInfo.ConvertTimeFromUtc(new DateTime(1970, 1, 1), TimeZoneInfo.Local)).TotalMilliseconds; var lattices = await DbPenOffline.Queryable() .Where(w => w.PenSerial == penSerial && paperIds.Contains(w.PageSerial) && w.logType == LogType.作业 && w.Time <= timespan) .Select(s => new PenOfflineData From 298136ac3021a3ead5a531c24501bd9c3585cf84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=BA=20=E6=9D=A8?= Date: Fri, 29 Mar 2024 14:49:03 +0800 Subject: [PATCH 5/5] 11 --- Dolphin.ExamPictureCut.Application/Exams/ExamManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dolphin.ExamPictureCut.Application/Exams/ExamManager.cs b/Dolphin.ExamPictureCut.Application/Exams/ExamManager.cs index a746980..aee40b1 100644 --- a/Dolphin.ExamPictureCut.Application/Exams/ExamManager.cs +++ b/Dolphin.ExamPictureCut.Application/Exams/ExamManager.cs @@ -87,7 +87,7 @@ public class ExamManager : DomainService, IExamManager if (lattices.Count == 0) { await DbBiz.Updateable().SetColumns(s => s.CollectStatus == 2).Where(w => w.ExamSubjectSchoolId == eto.ExamSubjectSchoolId && w.StudentExamNum == penSerial).ExecuteCommandAsync(); - Logger.LogInformation("{ExamSubjectId} {penSerial} 无点阵数据", eto.ExamSubjectId, penSerial); + Logger.LogInformation($"{eto.ExamSubjectId} {penSerial} {string.Join(',', paperIds)} {timespan} 无点阵数据"); return; } @@ -105,7 +105,7 @@ public class ExamManager : DomainService, IExamManager }).ToListAsync(); var gotoCount = 0; - dotPenOriginalImg: +dotPenOriginalImg: var zgtSettingDtls = await DbBiz.Queryable().Where(w => w.ExamSubjectId == eto.ExamSubjectId).ToListAsync(); // 割原题