This commit is contained in:
alex
2023-06-21 09:11:33 +08:00
parent 3485b72044
commit 4b8f14d215
6 changed files with 23 additions and 5 deletions

View File

@@ -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<string>
/// </summary>
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;
}
}
}

View File

@@ -46,10 +46,10 @@ namespace Tnb.WarehouseMgr
private async Task<dynamic> 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<int> UpdateNullCarry(WmsCarryH carryObj)

View File

@@ -214,7 +214,7 @@ namespace Tnb.WarehouseMgr
var items = instockDetails.Adapt<List<WmsInstockCode>>();
items.ForEach(it => it.org_id = _userManager.User.OrganizeId);
//items.ForEach(it => it.org_id = _userManager.User.OrganizeId);
List<WmsInstockCode> 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" });

View File

@@ -51,4 +51,8 @@ public class ClaimConst
/// 登录类型用于区分Pc或Pda端
/// </summary>
public const string LOGINTYPE = "LoginType";
/// <summary>
/// 组织ID
/// </summary>
public const string CLAINMORGID = "OrgId";
}

View File

@@ -16,4 +16,6 @@ public class BaseEntity<TKey> : IEntity where TKey : IEquatable<TKey>
[SugarColumn(ColumnName = "id", ColumnDescription = "主键", IsPrimaryKey = true)]
public TKey id { get; set; }
}

View File

@@ -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},