bug
This commit is contained in:
@@ -60,11 +60,12 @@ namespace Tnb.WarehouseMgr
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
await _db.Ado.BeginTranAsync();
|
await _db.Ado.BeginTranAsync();
|
||||||
|
|
||||||
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSOUTBALEPDA_ID, true);
|
|
||||||
await _runService.Create(templateEntity, input);
|
|
||||||
//出库取起点
|
//出库取起点
|
||||||
WmsCarryH carry = await _db.Queryable<WmsCarryH>().FirstAsync(it => it.id == input.data[nameof(WmsOutbale.carry_id)].ToString());
|
WmsCarryH carry = await _db.Queryable<WmsCarryH>().FirstAsync(it => it.id == input.data[nameof(WmsOutbale.carry_id)].ToString());
|
||||||
|
if (carry == null)
|
||||||
|
{
|
||||||
|
throw new AppFriendlyException("请选择载具", 500);
|
||||||
|
}
|
||||||
WmsPointH? sPoint = null;
|
WmsPointH? sPoint = null;
|
||||||
WmsPointH? ePoint = null;
|
WmsPointH? ePoint = null;
|
||||||
if (input.data.ContainsKey(nameof(WmsPointH.location_id)))
|
if (input.data.ContainsKey(nameof(WmsPointH.location_id)))
|
||||||
@@ -75,19 +76,26 @@ namespace Tnb.WarehouseMgr
|
|||||||
{
|
{
|
||||||
sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == carry.location_id);
|
sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == carry.location_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sPoint != null && ePoint != null)
|
if (sPoint != null && ePoint != null)
|
||||||
{
|
{
|
||||||
List<WmsPointH> points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id);
|
var points=new List<WmsPointH>();
|
||||||
//根据获取的路径点生成预任务,生成顺序必须预路径算法返回的起终点的顺序一致(预任务顺序)
|
if (sPoint.area_code != ePoint.area_code)
|
||||||
if (points?.Count > 0)
|
|
||||||
{
|
{
|
||||||
|
points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id);
|
||||||
if (points.Count <= 2)
|
if (points.Count <= 2)
|
||||||
{
|
{
|
||||||
throw new AppFriendlyException("该路径不存在", 500);
|
throw new AppFriendlyException("该路径不存在", 500);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
points.Add(sPoint);
|
||||||
|
points.Add(ePoint);
|
||||||
|
}
|
||||||
|
//根据获取的路径点生成预任务,生成顺序必须预路径算法返回的起终点的顺序一致(预任务顺序)
|
||||||
|
if (points?.Count > 0)
|
||||||
|
{
|
||||||
List<WmsPretaskH> preTasks = points.Where(it => !it.location_id.IsNullOrEmpty()).GroupBy(g => g.area_code).Select(it =>
|
List<WmsPretaskH> preTasks = points.Where(it => !it.location_id.IsNullOrEmpty()).GroupBy(g => g.area_code).Select(it =>
|
||||||
{
|
{
|
||||||
WmsPointH? sPoint = it.FirstOrDefault();
|
WmsPointH? sPoint = it.FirstOrDefault();
|
||||||
@@ -150,7 +158,8 @@ namespace Tnb.WarehouseMgr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSOUTBALEPDA_ID, true);
|
||||||
|
await _runService.Create(templateEntity, input);
|
||||||
await _db.Ado.CommitTranAsync();
|
await _db.Ado.CommitTranAsync();
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
|
|||||||
Reference in New Issue
Block a user