新增,判断目标库位是否可以放置当前载具

This commit is contained in:
alex
2023-07-18 10:38:44 +08:00
parent c92dbc3397
commit 81f7672980
3 changed files with 46 additions and 9 deletions

View File

@@ -15,7 +15,9 @@ using JNPF.DynamicApiController;
using JNPF.Systems.Interfaces.System;
using JNPF.VisualDev;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
using SqlSugar;
using Tnb.BasicData.Entities;
using Tnb.WarehouseMgr.Entities;
using Tnb.WarehouseMgr.Entities.Attributes;
using Tnb.WarehouseMgr.Entities.Consts;
@@ -47,8 +49,32 @@ namespace Tnb.WarehouseMgr
}
}
}
/// <summary>
/// 判断最终目标库位是否可以放置当前载具
/// </summary>
/// <param name="carry">当前载具</param>
/// <param name="locDest">目标库位</param>
/// <returns></returns>
/// <exception cref="ArgumentNullException"></exception>
[NonAction]
protected Task<bool> IsCarryAndLocationMatchByCarryStd(WmsCarryH carry, BasLocation locDest)
{
bool isMatch = false;
string errMessage = string.Empty;
if (carry == null) throw new ArgumentNullException(nameof(carry));
if (locDest == null) throw new ArgumentNullException(nameof(locDest));
if (!carry.carrystd_id.IsNullOrEmpty() && !locDest.carrystd_id.IsNullOrEmpty())
{
var jsonArr = JArray.Parse(locDest.carrystd_id);
var locCarryStdArr = jsonArr.Select(x => x.ToObject<string>()).ToArray();
if (locCarryStdArr.Contains(carry.carrystd_id))
{
isMatch = true;
}
}
return Task.FromResult(isMatch);
}
[NonAction]
protected async Task DoUpdate(WareHouseUpInput input)
{