PDA扫码入库逻辑修改
This commit is contained in:
@@ -24,6 +24,7 @@ using JNPF.VisualDev;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NPOI.HSSF.UserModel;
|
||||
using NPOI.SS.UserModel;
|
||||
@@ -96,9 +97,18 @@ namespace Tnb.WarehouseMgr
|
||||
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();
|
||||
isMatch = locCarryStdArr.Contains(carry.carrystd_id);
|
||||
JArray? jsonArr = null;
|
||||
try
|
||||
{
|
||||
jsonArr = JArray.Parse(locDest.carrystd_id);
|
||||
var locCarryStdArr = jsonArr.Select(x => x.ToObject<string>()).ToArray();
|
||||
isMatch = locCarryStdArr.Contains(carry.carrystd_id);
|
||||
}
|
||||
catch (Exception ex) when (ex is JsonException jex)
|
||||
{
|
||||
isMatch = carry.carrystd_id.Equals(locDest.carrystd_id, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
}
|
||||
return Task.FromResult(isMatch);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user