From 1aac16f7056bf98882443371ca3e62b7eb4048f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Thu, 12 Jun 2025 15:33:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- API/TaskManager.Entity/Entity.cs | 2 ++ API/Wood.Admin.WebApi/Startup.cs | 5 +---- .../CheryRecurringJobInputPageController.cs | 15 ++++----------- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/API/TaskManager.Entity/Entity.cs b/API/TaskManager.Entity/Entity.cs index f8253e8..ee5ff3b 100644 --- a/API/TaskManager.Entity/Entity.cs +++ b/API/TaskManager.Entity/Entity.cs @@ -541,10 +541,12 @@ namespace TaskManager.Entity [ExporterHeader(DisplayName = "版本号")] public int Version { get; set; } =0; + [MaxLength(50)] [JsonProperty("omterior")] [ExporterHeader(DisplayName = "内外饰")] // 推测拼写错误并自定义显示名 public string? Omterior { get; set; } = String.Empty; + [MaxLength(50)] [JsonProperty("salseDepartment")] [ExporterHeader(DisplayName = "销售部门")] // 推测拼写错误并自定义显示名 public string? SalseDepartment { get; set; } = String.Empty; diff --git a/API/Wood.Admin.WebApi/Startup.cs b/API/Wood.Admin.WebApi/Startup.cs index c27ef33..e3c84a1 100644 --- a/API/Wood.Admin.WebApi/Startup.cs +++ b/API/Wood.Admin.WebApi/Startup.cs @@ -74,10 +74,6 @@ namespace Wood.Admin.WebApi GlobalContext.JwtConfig = Configuration.GetSection("JwtConfig").Get()!; GlobalContext.Services = services; GlobalContext.Configuration = Configuration; - - - - //初始化 eventbus services.AddEventBus(); @@ -93,6 +89,7 @@ namespace Wood.Admin.WebApi // 配置 DbContext 使用 SQL Server 连接字符串 services.AddDbContext(options => options.UseSqlServer(GlobalContext.SystemConfig.CustomerDb)); + // 配置 Hangfire 使用 SQL Server 存储 services.AddHangfire( diff --git a/API/Wood.Service/Controllers/CheryRecurringJobInputPageController.cs b/API/Wood.Service/Controllers/CheryRecurringJobInputPageController.cs index f8c0f6f..731ea3b 100644 --- a/API/Wood.Service/Controllers/CheryRecurringJobInputPageController.cs +++ b/API/Wood.Service/Controllers/CheryRecurringJobInputPageController.cs @@ -87,17 +87,11 @@ namespace TaskManager.Controllers new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase, - - Converters= { new DecimalTrimConverter() }, - - WriteIndented = true // 可选,用于格式化输出 - - - - + Converters = { new DecimalTrimConverter() }, + WriteIndented = false // 可选,用于格式化输出 } ); - inputjson = RemoveWhitespace(inputjson); + //inputjson = RemoveWhitespace(inputjson); var content = await Post(Url, Path, inputjson,taskId,version); if (!string.IsNullOrEmpty(content)) { @@ -212,8 +206,7 @@ namespace TaskManager.Controllers { _jobDbContext.BulkUpdate(records); sub.SyncedPageCount = i; - - if (result.data.totalGet == total) + if (i == total) { sub.WriteState = true; _jobDbContext.Set().Update(sub);