1、解决SnowflakeIdHeler.NextId()空引用问题

2、将Agv心跳检测服务移至自定义定时服务,统一维护管理
This commit is contained in:
yang.lee
2023-10-16 13:53:33 +08:00
parent 9597c9b3e5
commit 66242f929d
10 changed files with 163 additions and 204 deletions

View File

@@ -103,20 +103,22 @@ namespace Tnb.WarehouseMgr
//Console.WriteLine($"ThreadID:{Thread.CurrentThread.ManagedThreadId}\t Thread pool: {Thread.CurrentThread.IsThreadPoolThread}");
var curDb = _db.CopyNew();
string firstLocationId = "27010980724501", secondLocationId = "27010987857941";
var endLocation = await curDb.Queryable<BasLocation>().SingleAsync(it => it.id == secondLocationId);
var setSortings = await curDb.Queryable<WmsSetsortingH>()
.Where(a => a.status == WmsWareHouseConst.BILLSTATUS_ADD_ID)
.Select<WmsSetsortingH>()
.OrderBy(a => a.seq)
.ToListAsync();
var items = await curDb.Queryable<WmsSetsortingH>().Where(it => it.status == WmsWareHouseConst.BILLSTATUS_ON_ID).ToListAsync();
var onFlag = items?.Count > 0;
try
{
await curDb.Ado.BeginTranAsync();
string firstLocationId = "27010980724501", secondLocationId = "27010987857941";
var endLocation = await curDb.Queryable<BasLocation>().FirstAsync(it => it.id == secondLocationId);
var setSortings = await curDb.Queryable<WmsSetsortingH>()
.Where(a => a.status == WmsWareHouseConst.BILLSTATUS_ADD_ID)
.Select<WmsSetsortingH>()
.OrderBy(a => a.seq)
.ToListAsync();
var items = await curDb.Queryable<WmsSetsortingH>().Where(it => it.status == WmsWareHouseConst.BILLSTATUS_ON_ID).ToListAsync();
var onFlag = items?.Count > 0;
if (setSortings?.Count > 0 && !onFlag)
{
var singleSorting = setSortings[0];
@@ -263,19 +265,24 @@ namespace Tnb.WarehouseMgr
{
JNPF.Logging.Log.Error("齐套分拣执行时出现错误", ex);
await curDb.Ado.RollbackTranAsync();
TimedTaskErrorInfo ei = new()
if (_userManager?.ToKen.IsNullOrEmpty() ?? false)
{
RequestURL = App.HttpContext?.Request?.Path,
RequestMethod = App.HttpContext?.Request?.Method,
userIdentity = await GetUserIdentity(_userManager.ToKen),
};
var timedTaskEx = ex.ToTimedTaskException(ei);
//cts?.Cancel();
throw timedTaskEx;
TimedTaskErrorInfo ei = new()
{
RequestURL = App.HttpContext?.Request?.Path,
RequestMethod = App.HttpContext?.Request?.Method,
userIdentity = await GetUserIdentity(_userManager.ToKen),
};
var timedTaskEx = ex.ToTimedTaskException(ei);
//cts?.Cancel();
throw timedTaskEx;
}
}
finally
{
await Publish(nameof(IWareHouseService.GenTaskExecute));
//await Publish(nameof(IWareHouseService.GenTaskExecute));
}
}