From 1d6eb49bebec0935dffee1423ecdbff031944770 Mon Sep 17 00:00:00 2001 From: zhangxiaofeng <1939543722@qq.com> Date: Sat, 2 Nov 2024 14:53:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=B5=81=E6=B0=B4=E5=8F=B7?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E4=BD=BF=E7=94=A8=E5=85=AC=E5=85=B1=E5=BA=8F?= =?UTF-8?q?=E5=8F=B7=E7=94=9F=E6=88=90=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TaskPlat/Method/TaskManageService.cs | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageService.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageService.cs index 7ca66e7f..d1fa2eb8 100644 --- a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageService.cs +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageService.cs @@ -616,23 +616,13 @@ namespace DS.WMS.Core.TaskPlat.Method } // 获取任务流水号 - DataResult sequence = await commonService.GetSequenceNextAsync(tenantDb, user); - string taskNo = sequence.Data ?? ""; - - if (string.IsNullOrEmpty(taskNo)) - { - taskNo = Guid.NewGuid().ToString(); - } - - //if (!sequence.Succeeded || sequence.Data is null) - //{ - // return await Task.FromResult(DataResult.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist)); - //} + //DataResult sequence = await commonService.GetSequenceNextAsync(tenantDb, user); + //string taskNo = sequence.Data ?? ""; taskInfo = new TaskBaseInfo { Id = SnowFlakeSingle.Instance.NextId(), - TASK_NO = taskNo, + TASK_NO = Guid.NewGuid().ToString(), STATUS = TaskStatusEnum.Create.ToString(), STATUS_NAME = TaskStatusEnum.Create.EnumDescription(), IS_EXCEPT = 0, @@ -2077,7 +2067,8 @@ namespace DS.WMS.Core.TaskPlat.Method //回写任务号 - var result = new DataResult(ResultCode.Success, "新增任务成功", data: taskInfo.TASK_NO); + var taskNo = await tenantDb.Queryable().Where(x => x.Id == taskInfo.Id).Select(x => x.TASK_NO).FirstAsync(); + var result = new DataResult(ResultCode.Success, "新增任务成功", data: taskNo); return await Task.FromResult(result); } @@ -2086,10 +2077,6 @@ namespace DS.WMS.Core.TaskPlat.Method logger.LogError(ex, "任务台:初始化任务的过程中发生未知异常,批次号={no}", batchNo); return DataResult.Failed(ex.Message); } - //finally - //{ - // Monitor.Exit(ImportLockObj); - //} }