任务流水号取消使用公共序号生成方法

dev
zhangxiaofeng 3 weeks ago
parent 1e1837b9ed
commit 1d6eb49beb

@ -616,23 +616,13 @@ namespace DS.WMS.Core.TaskPlat.Method
}
// 获取任务流水号
DataResult<string> sequence = await commonService.GetSequenceNextAsync<TaskBaseInfo>(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<string> sequence = await commonService.GetSequenceNextAsync<TaskBaseInfo>(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<TaskBaseInfo>().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);
//}
}

Loading…
Cancel
Save