From 21a0d27aa941744f982648ad82ded5585f5b7ea5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Tue, 22 Mar 2022 17:26:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=96=87=E4=BB=B6=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E3=80=81=E6=96=B0=E5=A2=9E=E5=8A=A0=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Infrastructure/Helper/FileUtil.cs | 11 ++----- .../Controllers/CommonController.cs | 1 + ZR.Model/JsonDateConverter.cs | 15 --------- ZR.Tasks/TaskSchedulerServer.cs | 2 +- ZR.Vue/src/components/FileUpload/index.vue | 31 ++++++++++++------- 5 files changed, 24 insertions(+), 36 deletions(-) delete mode 100644 ZR.Model/JsonDateConverter.cs diff --git a/Infrastructure/Helper/FileUtil.cs b/Infrastructure/Helper/FileUtil.cs index d9bbb0a..de8c701 100644 --- a/Infrastructure/Helper/FileUtil.cs +++ b/Infrastructure/Helper/FileUtil.cs @@ -16,16 +16,11 @@ namespace Infrastructure public static string GetdirPath(string path = "") { DateTime date = DateTime.Now; - int year = date.Year; - int month = date.Month; - int day = date.Day; - int hour = date.Hour; - - string timeDir = $"{year}{month}{day}/";// date.ToString("yyyyMM/dd/HH/"); + string timeDir = Path.Combine(date.ToString("yyyyMMdd"));// date.ToString("yyyyMM/dd/HH/"); if (!string.IsNullOrEmpty(path)) { - timeDir = $"{path}/{timeDir}/"; + timeDir = Path.Combine(path, timeDir); } return timeDir; } @@ -41,7 +36,7 @@ namespace Infrastructure { str = Guid.NewGuid().ToString(); } - MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider(); + MD5CryptoServiceProvider md5 = new(); return BitConverter.ToString(md5.ComputeHash(Encoding.Default.GetBytes(str)), 4, 8).Replace("-", ""); } } diff --git a/ZR.Admin.WebApi/Controllers/CommonController.cs b/ZR.Admin.WebApi/Controllers/CommonController.cs index e4120fd..ce579ef 100644 --- a/ZR.Admin.WebApi/Controllers/CommonController.cs +++ b/ZR.Admin.WebApi/Controllers/CommonController.cs @@ -9,6 +9,7 @@ using Microsoft.Extensions.Options; using Newtonsoft.Json; using Snowflake.Core; using System; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; diff --git a/ZR.Model/JsonDateConverter.cs b/ZR.Model/JsonDateConverter.cs deleted file mode 100644 index 70ca6c8..0000000 --- a/ZR.Model/JsonDateConverter.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Newtonsoft.Json.Converters; -using System; -using System.Collections.Generic; -using System.Text; - -namespace ZR.Model -{ - public class JsonDateConverter: IsoDateTimeConverter - { - public JsonDateConverter() - { - DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; - } - } -} diff --git a/ZR.Tasks/TaskSchedulerServer.cs b/ZR.Tasks/TaskSchedulerServer.cs index 8570680..681c405 100644 --- a/ZR.Tasks/TaskSchedulerServer.cs +++ b/ZR.Tasks/TaskSchedulerServer.cs @@ -262,7 +262,7 @@ namespace ZR.Tasks List jobKeys = _scheduler.Result.GetJobKeys(GroupMatcher.GroupEquals(tasksQz.JobGroup)).Result.ToList(); if (jobKeys == null || jobKeys.Count == 0) { - return new ApiResult(110, $"未找到分组[{ tasksQz.JobGroup }]"); + await AddTaskScheduleAsync(tasksQz); } var triggers = await _scheduler.Result.GetTriggersOfJob(jobKey); diff --git a/ZR.Vue/src/components/FileUpload/index.vue b/ZR.Vue/src/components/FileUpload/index.vue index 6523b74..14d85de 100644 --- a/ZR.Vue/src/components/FileUpload/index.vue +++ b/ZR.Vue/src/components/FileUpload/index.vue @@ -1,11 +1,12 @@