From f0d68a8f0ab2d5f7123233e6596b028c6bb18e68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B5=87=E6=96=87=E9=BE=99?= Date: Fri, 2 Aug 2024 16:11:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=BB=E5=8A=A1=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E6=97=B6=E7=9A=84=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DS.Module.Core/Constants/MultiLanguageConst.cs | 2 +- .../DS.WMS.Core/Op/Dtos/TaskInteraction/TaskRequest.cs | 6 +++--- .../DS.WMS.Core/Op/Method/TaskInteraction/TaskService.cs | 3 --- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs index ce7e23de..51aa8eee 100644 --- a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs +++ b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs @@ -1479,7 +1479,7 @@ public static class MultiLanguageConst #endregion #region 关联任务 - [Description("此类型的任务已存在")] + [Description("此任务已存在,请勿重复提交")] public const string TaskExists = "Task_Exists"; [Description("此任务已完成")] public const string TaskCompleted = "Task_Completed"; diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/TaskInteraction/TaskRequest.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/TaskInteraction/TaskRequest.cs index 83aba1bf..227c4891 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Dtos/TaskInteraction/TaskRequest.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/TaskInteraction/TaskRequest.cs @@ -20,12 +20,12 @@ namespace DS.WMS.Core.Op.Dtos.TaskInteraction /// public BusinessType BusinessType { get; set; } - TaskBaseTypeEnum _defaultTaskType = TaskBaseTypeEnum.NOT_SPECIFIED; + static readonly TaskBaseTypeEnum _defaultTaskType = TaskBaseTypeEnum.NOT_SPECIFIED; /// /// 任务类型 /// [IgnoreDataMember] - public TaskBaseTypeEnum TaskType => string.IsNullOrEmpty(TaskTypeName) ? _defaultTaskType : Enum.Parse(TaskTypeName); + public TaskBaseTypeEnum TaskType => string.IsNullOrEmpty(TaskTypeName) ? _defaultTaskType : Enum.Parse(TaskTypeName); /// /// 任务类型名称 @@ -39,7 +39,7 @@ namespace DS.WMS.Core.Op.Dtos.TaskInteraction /// public virtual IEnumerable Validate(ValidationContext validationContext) { - if (BusinessId == 0) + if (BusinessId == 0) { yield return new ValidationResult($"参数 {nameof(BusinessId)} 不能为空"); } diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/TaskService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/TaskService.cs index ddc534e0..bcc1a3e9 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/TaskService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/TaskService.cs @@ -85,9 +85,6 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction /// protected virtual async Task EnsureModuleAuthorized() { - //if (!await Db.Queryable().AnyAsync(x => x.PermissionId == PERMISSION_ID)) - // return false; - long tid = long.Parse(User.TenantId); var authStr = await Db.Queryable().Where(x => x.PermissionId == PERMISSION_ID && x.TenantId == tid && SqlFunc.Subqueryable().Where(spt => spt.PermissionId == x.PermissionId).Any())