载具移入,当前用户获取不到bug处理

This commit is contained in:
alex
2023-09-07 10:11:38 +08:00
parent b52e48ce9a
commit c3749bb2ac
2 changed files with 17 additions and 1 deletions

View File

@@ -1,15 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Channels;
using System.Threading.Tasks;
using JNPF.Common.Const;
using JNPF.Common.Core.Manager;
using JNPF.Common.Dtos.VisualDev;
using JNPF.Common.Enums;
using JNPF.Common.Extension;
using JNPF.Common.Security;
using JNPF.FriendlyException;
using JNPF.Systems.Entitys.Permission;
using JNPF.Systems.Interfaces.System;
using JNPF.VisualDev;
using JNPF.VisualDev.Entitys;
@@ -90,6 +93,18 @@ namespace Tnb.WarehouseMgr
ePoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == endLocations[0].id);
}
if (_userManager.User == null)
{
var ui = await GetUserIdentity(_userManager.ToKen);
var curUserPI = _userManager.GetType().GetProperty(nameof(_userManager.User), BindingFlags.Instance | BindingFlags.NonPublic);
if (curUserPI != null)
{
var curUid = ui.FindFirst(ClaimConst.CLAINMUSERID)?.Value;
var curUser = await _db.Queryable<UserEntity>().SingleAsync(it => it.Id == curUid);
curUserPI.SetValue(_userManager,curUser, null);
}
}
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_CARRYMOVEINSTOCK_ID, true);
await _runService.Create(templateEntity, input);