This commit is contained in:
qianjiawei
2023-12-25 17:31:50 +08:00
parent 7ede7e4f08
commit 7244fab4ac
7 changed files with 49 additions and 19 deletions

View File

@@ -394,7 +394,7 @@ namespace Tnb.ProductionMgr
input.outstockDs = new List<MESWmsOutstockDInput>();
BasLocation location = await db.Queryable<BasLocation>().Where(x => x.location_code == materialOutstockInput.location_code).FirstAsync();
if (location == null) throw Oops.Bah("未找到库位");
if (location == null) throw new AppFriendlyException("未找到库位", 500);
string locationId = location.id;
PrdOutstockH prdOutstockH = new()
@@ -448,7 +448,8 @@ namespace Tnb.ProductionMgr
AuthResponse authResponse = JsonConvert.DeserializeObject<AuthResponse>(sendResult);
if (authResponse.code != 200)
{
throw Oops.Bah(authResponse.msg);
throw new AppFriendlyException(authResponse.msg, 500);
}
else
{
@@ -491,7 +492,8 @@ namespace Tnb.ProductionMgr
if (!result.IsSuccess)
{
throw Oops.Bah(result.ErrorMessage);
throw new AppFriendlyException(result.ErrorMessage, 500);
}
}
@@ -499,9 +501,8 @@ namespace Tnb.ProductionMgr
}
catch (Exception e)
{
Console.WriteLine(e);
Log.Error(e.Message);
throw Oops.Bah(e.Message);
throw new AppFriendlyException(e.Message, 500);
}
}
}

View File

@@ -191,7 +191,7 @@ namespace Tnb.ProductionMgr
{
// Readtimer = new Timer(GetRedisData, null, TimeSpan.Zero, TimeSpan.FromSeconds(300));
// CheckGettimer = new Timer(CheckGet, null, TimeSpan.Zero, TimeSpan.FromSeconds(300));
Scantimer = new Timer(ScanInStock, null, TimeSpan.Zero, TimeSpan.FromSeconds(300));
// Scantimer = new Timer(ScanInStock, null, TimeSpan.Zero, TimeSpan.FromSeconds(300));
return Task.CompletedTask;
}
public Task StopAsync(CancellationToken cancellationToken)