1
This commit is contained in:
@@ -13,7 +13,7 @@ using Tnb.WarehouseMgr.Entities;
|
|||||||
|
|
||||||
namespace Tnb.WarehouseMgr
|
namespace Tnb.WarehouseMgr
|
||||||
{
|
{
|
||||||
public class WmsInternalTempTestService
|
public class WmsInternalTempTestService : BaseWareHouseService
|
||||||
{
|
{
|
||||||
private readonly ISqlSugarClient _db;
|
private readonly ISqlSugarClient _db;
|
||||||
public WmsInternalTempTestService(ISqlSugarRepository<BasLocation> repo)
|
public WmsInternalTempTestService(ISqlSugarRepository<BasLocation> repo)
|
||||||
@@ -24,18 +24,18 @@ namespace Tnb.WarehouseMgr
|
|||||||
/// 修改列
|
/// 修改列
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task UpdateColAsync()
|
public async Task UpdateColAsync()
|
||||||
{
|
{
|
||||||
List<BasLocation> list = await _db.Queryable<BasLocation>().Where(it => it.location_code.StartsWith("CP-A", StringComparison.OrdinalIgnoreCase)).OrderBy(i => i.location_code).ToListAsync();
|
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)
|
foreach (var loc in list)
|
||||||
{
|
{
|
||||||
ReadOnlySpan<char> inputSpan= loc.location_code.AsSpan();
|
ReadOnlySpan<char> inputSpan = loc.location_code.AsSpan();
|
||||||
ReadOnlySpan<char> lastTwoCharacters = inputSpan.Slice(inputSpan.Length - 2);
|
ReadOnlySpan<char> lastTwoCharacters = inputSpan.Slice(inputSpan.Length - 2);
|
||||||
int num = lastTwoCharacters.ToString().Match(@"\d+").ParseToInt();
|
int num = lastTwoCharacters.ToString().Match(@"\d+").ParseToInt();
|
||||||
await _db.Updateable<BasLocation>().SetColumns(it => it.loc_column == num).Where(it => it.id==loc.id).ExecuteCommandAsync();
|
await _db.Updateable<BasLocation>().SetColumns(it => it.loc_column == num).Where(it => it.id == loc.id).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user