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); - //} }