定时服务启动方式调整,并调整相关业务代码
This commit is contained in:
@@ -80,8 +80,8 @@ namespace Tnb.WarehouseMgr
|
||||
[HttpPost, Timed(Name = nameof(KittingOutByAdd))]
|
||||
public async Task KittingOutByAdd(CancellationTokenSource? cts = default)
|
||||
{
|
||||
if (UserManager.AsscessToken.IsNullOrWhiteSpace()) return;
|
||||
var curUser = await GetUserIdentity();
|
||||
//if (UserManager.AsscessToken.IsNullOrWhiteSpace()) return;
|
||||
//var curUser = await GetUserIdentity();
|
||||
var curDb = _db.CopyNew();
|
||||
try
|
||||
{
|
||||
@@ -136,8 +136,8 @@ namespace Tnb.WarehouseMgr
|
||||
setSortingH.id = SnowflakeIdHelper.NextId();
|
||||
setSortingH.kittingout_id = ko.id;
|
||||
setSortingH.seq = ko.seq;
|
||||
setSortingH.org_id = curUser.FindFirst(ClaimConst.CLAINMORGID)?.Value;
|
||||
setSortingH.create_id = curUser.FindFirst(ClaimConst.CLAINMUSERID)!.Value;
|
||||
setSortingH.org_id = _userManager.User.OrganizeId;
|
||||
setSortingH.create_id = _userManager.UserId;
|
||||
setSortingH.create_time = DateTime.Now;
|
||||
await curDb.Insertable(setSortingH).ExecuteCommandAsync();
|
||||
|
||||
@@ -148,8 +148,8 @@ namespace Tnb.WarehouseMgr
|
||||
x.id = SnowflakeIdHelper.NextId();
|
||||
x.bill_id = setSortingH.id;
|
||||
x.warehouse_id = setSortingH.warehouse_id;
|
||||
x.org_id = curUser.FindFirst(ClaimConst.CLAINMORGID)?.Value;
|
||||
x.create_id = curUser.FindFirst(ClaimConst.CLAINMUSERID)!.Value;
|
||||
x.org_id = _userManager.User.OrganizeId;
|
||||
x.create_id = _userManager.UserId;
|
||||
x.create_time = DateTime.Now;
|
||||
});
|
||||
await curDb.Insertable(setSortDetails).ExecuteCommandAsync();
|
||||
@@ -171,7 +171,7 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
RequestURL = App.HttpContext?.Request?.Path,
|
||||
RequestMethod = App.HttpContext?.Request?.Method,
|
||||
userIdentity = curUser,
|
||||
userIdentity = await GetUserIdentity(_userManager.ToKen),
|
||||
};
|
||||
var timedTaskEx = ex.ToTimedTaskException(ei);
|
||||
cts?.Cancel();
|
||||
@@ -185,8 +185,8 @@ namespace Tnb.WarehouseMgr
|
||||
[HttpPost, Timed(Name = nameof(KittingOutByIsToBeShipped))]
|
||||
public async Task KittingOutByIsToBeShipped(CancellationTokenSource? cts = default)
|
||||
{
|
||||
if (UserManager.AsscessToken.IsNullOrWhiteSpace()) return;
|
||||
var curUser = await GetUserIdentity();
|
||||
//if (UserManager.AsscessToken.IsNullOrWhiteSpace()) return;
|
||||
//var curUser = await GetUserIdentity();
|
||||
var curDb = _db.CopyNew();
|
||||
try
|
||||
{
|
||||
@@ -225,7 +225,7 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
WmsPretaskH preTask = new()
|
||||
{
|
||||
org_id = curUser.FindFirst(ClaimConst.CLAINMORGID)?.Value,
|
||||
org_id = _userManager.User.OrganizeId,
|
||||
startlocation_id = sPoint?.location_id!,
|
||||
startlocation_code = sPoint?.location_code!,
|
||||
endlocation_id = ePoint?.location_id!,
|
||||
@@ -246,7 +246,7 @@ namespace Tnb.WarehouseMgr
|
||||
area_code = it.Key,
|
||||
require_id = ko.id,
|
||||
require_code = ko.bill_code,
|
||||
create_id = curUser.FindFirst(ClaimConst.CLAINMUSERID)!.Value,
|
||||
create_id = _userManager.UserId,
|
||||
create_time = DateTime.Now,
|
||||
source_id = ko.source_id,
|
||||
source_code = ko.source_code
|
||||
@@ -278,7 +278,7 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
RequestURL = App.HttpContext?.Request?.Path,
|
||||
RequestMethod = App.HttpContext?.Request?.Method,
|
||||
userIdentity = curUser,
|
||||
userIdentity = await GetUserIdentity(_userManager.ToKen),
|
||||
};
|
||||
var timedTaskEx = ex.ToTimedTaskException(ei);
|
||||
cts?.Cancel();
|
||||
|
||||
Reference in New Issue
Block a user