From 22cbcd83cdb5c321929c5c2096868e2436df807f Mon Sep 17 00:00:00 2001 From: FanLian Date: Fri, 14 Jul 2023 18:14:03 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BD=90=E5=A5=97=E5=88=86=E6=8B=A3=E5=92=8C?= =?UTF-8?q?=E9=BD=90=E5=A5=97=E5=85=A5=E5=BA=93=E7=9A=84bug=EF=BC=8C?= =?UTF-8?q?=E6=B3=A8=E9=87=8A=E4=BA=86=E8=B4=A8=E6=A3=80=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WarehouseMgr/Tnb.WarehouseMgr/WmsKittingInStkService.cs | 2 +- common/Tnb.Common/Extension/StringExtensions.cs | 5 +++++ taskschedule/Tnb.TaskScheduler/Listener/QcTaskTimeWorker.cs | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsKittingInStkService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsKittingInStkService.cs index 3330140a..7ad379ee 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsKittingInStkService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsKittingInStkService.cs @@ -216,7 +216,7 @@ namespace Tnb.WarehouseMgr if (kittingOut != null) { var locaion = await _db.Queryable().SingleAsync(it => it.id == kittingOut.location_id); - if (locaion?.is_type.ToEnum() != EnumLocationType.存储库位) + if (locaion !=null && locaion.is_type.ToEnum() != EnumLocationType.存储库位) { kittingOut.status = WmsWareHouseConst.BILLSTATUS_TOBESHIPPED_ID; diff --git a/common/Tnb.Common/Extension/StringExtensions.cs b/common/Tnb.Common/Extension/StringExtensions.cs index 99ac6dfc..2d6e9011 100644 --- a/common/Tnb.Common/Extension/StringExtensions.cs +++ b/common/Tnb.Common/Extension/StringExtensions.cs @@ -949,6 +949,11 @@ public static class StringExtensions return (T)System.Enum.Parse(typeof(T), value, true); } + public static T ToEnumWithNull(this string? value) + { + return (T)System.Enum.Parse(typeof(T), value, true); + } + #endregion #region 转换,来自Abp diff --git a/taskschedule/Tnb.TaskScheduler/Listener/QcTaskTimeWorker.cs b/taskschedule/Tnb.TaskScheduler/Listener/QcTaskTimeWorker.cs index 2e9cd054..060bc1a5 100644 --- a/taskschedule/Tnb.TaskScheduler/Listener/QcTaskTimeWorker.cs +++ b/taskschedule/Tnb.TaskScheduler/Listener/QcTaskTimeWorker.cs @@ -22,11 +22,11 @@ namespace Tnb.TaskScheduler.Listener /// /// 生成质检任务 /// - public class QcTaskTimeWorker : ISpareTimeWorker + public class QcTaskTimeWorker //: ISpareTimeWorker { private ISqlSugarClient repository => App.GetService(); - [SpareTime("0 0 0 * * ?", "生成质检任务", ExecuteType = SpareTimeExecuteTypes.Serial, StartNow = false)] + //[SpareTime("0 0 0 * * ?", "生成质检任务", ExecuteType = SpareTimeExecuteTypes.Serial, StartNow = false)] public async void CreateTask(SpareTimer timer, long count) { var timeTaskEntity = await repository.Queryable().Where(p => p.Id == timer.WorkerName && p.EnabledMark == 1).FirstAsync();