This commit is contained in:
yang.lee
2023-12-01 22:42:28 +08:00
parent e5150d209e
commit 2d47e18d45

View File

@@ -30,9 +30,8 @@ namespace Tnb.WarehouseMgr
List<BasLocation> list = await _db.Queryable<BasLocation>().Where(it => it.location_code.StartsWith("CP-A", StringComparison.OrdinalIgnoreCase)).OrderBy(i => i.location_code).ToListAsync();
foreach (var loc in list)
{
ReadOnlySpan<char> inputSpan = loc.location_code.AsSpan();
ReadOnlySpan<char> lastTwoCharacters = inputSpan.Slice(inputSpan.Length - 2);
int num = lastTwoCharacters.ToString().Match(@"\d+").ParseToInt();
var input = loc.location_code.Substring(loc.location_code.Length - 2);
int num = input.Match(@"\d+").ParseToInt();
await _db.Updateable<BasLocation>().SetColumns(it => it.loc_column == num).Where(it => it.id == loc.id).ExecuteCommandAsync();
}