diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockCode.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockCode.cs index 27c24a73..8a365606 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockCode.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockCode.cs @@ -1,3 +1,5 @@ +using JNPF.Common.Const; +using JNPF; using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; @@ -164,4 +166,13 @@ public partial class WmsInstockCode : BaseEntity /// public string? mo_bom_detail_id { get; set; } + public void Create() + { + var orgId = App.User?.FindFirst(ClaimConst.CLAINMORGID)?.Value; + if (!string.IsNullOrEmpty(orgId)) + { + this.org_id = orgId; + } + } + } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAFeedingService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAFeedingService.cs index 0fc6a4df..c6de40db 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAFeedingService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAFeedingService.cs @@ -46,10 +46,10 @@ namespace Tnb.WarehouseMgr private async Task WmsPDAFeeding(VisualDevModelDataCrInput input) { - + var isOk = false; try { - var isOk = false; + await _db.Ado.BeginTranAsync(); var carryId = input.data.ContainsKey("carry_id") ? input.data["carry_id"]?.ToString() : ""; var feedBoxCode = input.data.ContainsKey("feedbox_code") ? input.data["feedbox_code"]?.ToString() : ""; @@ -117,7 +117,7 @@ namespace Tnb.WarehouseMgr await _db.Ado.RollbackTranAsync(); throw; } - + return isOk; } public async Task UpdateNullCarry(WmsCarryH carryObj) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs index 2245df79..06f7cf80 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs @@ -214,7 +214,7 @@ namespace Tnb.WarehouseMgr var items = instockDetails.Adapt>(); - items.ForEach(it => it.org_id = _userManager.User.OrganizeId); + //items.ForEach(it => it.org_id = _userManager.User.OrganizeId); List instockCOdes = new(); jArr = JArray.Parse(input.data["tablefield115"].ToString()!); if (jArr?.Children().Count() > 0) @@ -234,7 +234,7 @@ namespace Tnb.WarehouseMgr } } await _db.Insertable(carryCodes).ExecuteCommandAsync(); - await _db.Insertable(instockCOdes).ExecuteCommandAsync(); + await _db.Insertable(instockCOdes).CallEntityMethod(it => it.Create()).ExecuteCommandAsync(); await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput, it => new WmsCarryH { carry_code = input.data[nameof(WmsCarryH.carry_code)].ToString()!, is_lock = 1, status = (int)EnumCarryStatus.占用, location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode }, it => new BasLocation { is_lock = 1, is_use = "1" }); diff --git a/common/Tnb.Common/Const/ClaimConst.cs b/common/Tnb.Common/Const/ClaimConst.cs index e4d72ef9..3cba3107 100644 --- a/common/Tnb.Common/Const/ClaimConst.cs +++ b/common/Tnb.Common/Const/ClaimConst.cs @@ -51,4 +51,8 @@ public class ClaimConst /// 登录类型用于区分Pc或Pda端 /// public const string LOGINTYPE = "LoginType"; + /// + /// 组织ID + /// + public const string CLAINMORGID = "OrgId"; } \ No newline at end of file diff --git a/common/Tnb.Common/Contracts/BaseEntity`1.cs b/common/Tnb.Common/Contracts/BaseEntity`1.cs index a252f539..b74bb002 100644 --- a/common/Tnb.Common/Contracts/BaseEntity`1.cs +++ b/common/Tnb.Common/Contracts/BaseEntity`1.cs @@ -16,4 +16,6 @@ public class BaseEntity : IEntity where TKey : IEquatable [SugarColumn(ColumnName = "id", ColumnDescription = "主键", IsPrimaryKey = true)] public TKey id { get; set; } + + } diff --git a/system/Tnb.OAuth/OAuthService.cs b/system/Tnb.OAuth/OAuthService.cs index 29b31528..afebf9dd 100644 --- a/system/Tnb.OAuth/OAuthService.cs +++ b/system/Tnb.OAuth/OAuthService.cs @@ -591,6 +591,7 @@ public class OAuthService : IDynamicApiController, ITransient { ClaimConst.CLAINMUSERID, userAnyPwd.Id }, { ClaimConst.CLAINMACCOUNT, userAnyPwd.Account }, { ClaimConst.CLAINMREALNAME, userAnyPwd.RealName }, + { ClaimConst.CLAINMORGID, userAnyPwd.OrganizeId }, { ClaimConst.CLAINMADMINISTRATOR, userAnyPwd.IsAdministrator }, { ClaimConst.TENANTID, options.ConfigId }, { ClaimConst.CONNECTIONCONFIG, options},