diff --git a/Dolphin.ExamPictureCut.Application/Exams/ExamManager.cs b/Dolphin.ExamPictureCut.Application/Exams/ExamManager.cs index bf18c09..aee40b1 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) @@ -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 @@ -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(); // 割原题 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() 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..7ff107f 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": "47.109.67.254:16379,password=poiuyt)(*&^%,defaultDatabase=0,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" } },