This commit is contained in:
alex
2023-06-20 13:33:18 +08:00
parent e46098835d
commit 2469d4d2c5

View File

@@ -67,6 +67,8 @@ namespace Tnb.WarehouseMgr
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSOUTSTOCK_ID, true);
await _runService.Create(templateEntity, input);
//判断目标库位是否自动签收
var loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == input.data[nameof(WmsPointH.location_id)].ToString());
var carryIds = new List<string>();
//tablefield120 出库物料明细
@@ -140,6 +142,7 @@ namespace Tnb.WarehouseMgr
if (carrys?.Count > 0)
{
List<WmsPretaskH> preTasks = new();
List<string> locIds = new();
foreach (var carry in carrys)
{
WmsPointH sPoint = null;
@@ -155,6 +158,7 @@ namespace Tnb.WarehouseMgr
if (sPoint != null && ePoint != null)
{
var points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id);
locIds.AddRange(points.Select(x => x.location_id).ToList()!);
//根据获取的路径点生成预任务,生成顺序必须预路径算法返回的起终点的顺序一致(预任务顺序)
if (points?.Count > 0)
{
@@ -186,13 +190,19 @@ namespace Tnb.WarehouseMgr
preTask.create_time = DateTime.Now;
return preTask;
}).ToList();
if (loc.is_sign == 0)
{
curPreTasks[^1].is_sign = 0; // 修改最后一个元素的是否签收值
}
preTasks.AddRange(curPreTasks);
}
}
}
var isOk = await _wareHouseService.GenPreTask(preTasks, null);
GenPreTaskUpInput genPreTaskAfterUpInput = new();
genPreTaskAfterUpInput.CarryIds = preTasks.Select(x => x.carry_id).ToList();
genPreTaskAfterUpInput.LocationIds = new HashSet<string>(locIds).ToList();
await _wareHouseService.GenInStockTaskHandleAfter(genPreTaskAfterUpInput, it => new WmsCarryH { is_lock = 1 }, it => new BasLocation { is_lock = 1 });
}