消除部分warning
This commit is contained in:
@@ -64,10 +64,14 @@ namespace Tnb.WarehouseMgr
|
|||||||
{
|
{
|
||||||
await _db.Ado.BeginTranAsync();
|
await _db.Ado.BeginTranAsync();
|
||||||
|
|
||||||
var singleSorting = setSortings[^setSortings.Count];
|
var singleSorting = new WmsSetsortingH();
|
||||||
var curCarry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.id == singleSorting.carry_id);
|
if (setSortings?.Count > 0)
|
||||||
var isMatch = await IsCarryAndLocationMatchByCarryStd(curCarry, endLocation);
|
{
|
||||||
if (!isMatch) throw new AppFriendlyException("库位与载具规格不匹配", 500);
|
singleSorting = setSortings[0];
|
||||||
|
var curCarry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.id == singleSorting.carry_id);
|
||||||
|
var isMatch = await IsCarryAndLocationMatchByCarryStd(curCarry, endLocation);
|
||||||
|
if (!isMatch) throw new AppFriendlyException("库位与载具规格不匹配", 500);
|
||||||
|
}
|
||||||
|
|
||||||
if (setSortings?.Count > 0 && !onFlag)
|
if (setSortings?.Count > 0 && !onFlag)
|
||||||
{
|
{
|
||||||
@@ -132,7 +136,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
carryMats = carryMats.OrderBy(o => o.create_time).GroupBy(g => new { g.carry_id, g.material_id, g.code_batch })
|
carryMats = carryMats.OrderBy(o => o.create_time).GroupBy(g => new { g.carry_id, g.material_id, g.code_batch })
|
||||||
.Select(x =>
|
.Select(x =>
|
||||||
{
|
{
|
||||||
WmsCarryMat? carryMat = x.FirstOrDefault();
|
WmsCarryMat carryMat = new();
|
||||||
carryMat.need_qty = x.Sum(d => d.need_qty);
|
carryMat.need_qty = x.Sum(d => d.need_qty);
|
||||||
return carryMat;
|
return carryMat;
|
||||||
})
|
})
|
||||||
@@ -205,7 +209,10 @@ namespace Tnb.WarehouseMgr
|
|||||||
if (sPoint != null && ePoint != null)
|
if (sPoint != null && ePoint != null)
|
||||||
{
|
{
|
||||||
var points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id);
|
var points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id);
|
||||||
locIds.AddRange(points.Select(x => x.location_id).ToList()!);
|
if (points?.Count> 0)
|
||||||
|
{
|
||||||
|
locIds.AddRange(points.Select(x => x.location_id).ToList()!);
|
||||||
|
}
|
||||||
//根据获取的路径点生成预任务,生成顺序必须预路径算法返回的起终点的顺序一致(预任务顺序)
|
//根据获取的路径点生成预任务,生成顺序必须预路径算法返回的起终点的顺序一致(预任务顺序)
|
||||||
if (points?.Count > 0)
|
if (points?.Count > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
}
|
}
|
||||||
if (carry != null)
|
if (carry != null)
|
||||||
{
|
{
|
||||||
if (carry!.location_id!.IsNotEmptyOrNull())
|
if (carry?.location_id?.IsNotEmptyOrNull() ?? false)
|
||||||
{
|
{
|
||||||
var loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == carry.location_id);
|
var loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == carry.location_id);
|
||||||
loc.is_use = ((int)EnumCarryStatus.空闲).ToString();
|
loc.is_use = ((int)EnumCarryStatus.空闲).ToString();
|
||||||
@@ -139,7 +139,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
isSuccessFul= false;
|
isSuccessFul = false;
|
||||||
}
|
}
|
||||||
return isSuccessFul;
|
return isSuccessFul;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user