From 7ff54321f3d163bd15416dbf79bd29874d97825f Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Wed, 12 Jun 2024 15:34:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AA=E6=9C=89=E4=BB=BB=E5=8A=A1=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E4=B8=BA=E9=83=A8=E5=88=86=E5=AE=8C=E6=88=90=E6=89=8D?= =?UTF-8?q?=E8=83=BD=E7=BB=88=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ThirdLocationJobs/ThirdLocationJobAppService.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ThirdLocationJobs/ThirdLocationJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ThirdLocationJobs/ThirdLocationJobAppService.cs index 1c505db17..83121b505 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ThirdLocationJobs/ThirdLocationJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ThirdLocationJobs/ThirdLocationJobAppService.cs @@ -103,8 +103,19 @@ public class ThirdLocationJobAppService { throw new UserFriendlyException($"未找到ID为 {id} 的任务"); } + else + { + if (thirdLocationJob.JobStatus == EnumJobStatus.Partial) + { + await _thirdLocationJobManager.CloseAsync(thirdLocationJob).ConfigureAwait(false); + } + else + { + throw new UserFriendlyException($"【{thirdLocationJob.JobStatus.GetDisplayName()}】状态不允许终止"); + } + } - await _thirdLocationJobManager.CloseAsync(thirdLocationJob).ConfigureAwait(false); + } ///