This commit is contained in:
2024-08-31 10:49:47 +08:00
parent 551bba105c
commit 033ec98671
2 changed files with 31 additions and 19 deletions

View File

@@ -30,6 +30,7 @@ using Tnb.WarehouseMgr.Entities.Dto.Inputs;
using Tnb.WarehouseMgr.Entities.Entity;
using Tnb.WarehouseMgr.Interfaces;
using Tnb.ProductionMgr.Entities.Entity;
using System.Threading;
namespace Tnb.WarehouseMgr
{
@@ -67,6 +68,7 @@ namespace Tnb.WarehouseMgr
db = dbConn;
string type = "";
SemaphoreSlim semaphoreSlim = null;
try
{
await db.Ado.BeginTranAsync();
@@ -118,19 +120,19 @@ namespace Tnb.WarehouseMgr
string scwarehouse_id = "";
if (type == DictConst.PrdMoTypeZS)
{
scwarehouse_id = "0201010402";
scwarehouse_id = WmsWareHouseConst.bipwarehouseid_zs;
}
else if (type == DictConst.PrdMoTypeJC)
{
scwarehouse_id = "0202010202";
scwarehouse_id = WmsWareHouseConst.bipwarehouseid_jc;
}
else if (type == DictConst.PrdMoTypeZZ)
{
scwarehouse_id = "0204010402";
scwarehouse_id = WmsWareHouseConst.bipwarehouseid_bz;
}
else if (type == DictConst.PrdMoTypeBZ)
{
scwarehouse_id = "0204010402";
scwarehouse_id = WmsWareHouseConst.bipwarehouseid_bz;
}
#endregion
foreach (WmsPrdInstockDInput prdInstockDInput in input.prdInstockDs)
@@ -171,16 +173,17 @@ namespace Tnb.WarehouseMgr
if (type == DictConst.PrdMoTypeZS)
{
await _s_taskExecuteSemaphore_F1ZCCInstock.WaitAsync();
semaphoreSlim = _wareHouseService.GetSemaphore("instock", WmsWareHouseConst.WAREHOUSE_ZC_ID);
}
else if (type == DictConst.PrdMoTypeJC)
{
await _s_taskExecuteSemaphore_F2HCCInstock.WaitAsync();
semaphoreSlim = _wareHouseService.GetSemaphore("instock", WmsWareHouseConst.WAREHOUSE_HCC_ID);
}
else if (type == DictConst.PrdMoTypeBZ)
{
semaphoreSlim = _wareHouseService.GetSemaphore("instock", WmsWareHouseConst.WAREHOUSE_DMJC_ID);
}
await semaphoreSlim.WaitAsync();
foreach (WmsPrdInstockD wmsPrdInstockD in WmsPrdInstockDs)
{
@@ -315,18 +318,7 @@ namespace Tnb.WarehouseMgr
}
finally
{
if (type == DictConst.PrdMoTypeZS)
{
_s_taskExecuteSemaphore_F1ZCCInstock.Release();
}
else if (type == DictConst.PrdMoTypeJC)
{
_s_taskExecuteSemaphore_F2HCCInstock.Release();
}
else if (type == DictConst.PrdMoTypeBZ)
{
}
semaphoreSlim.Release();
_wareHouseService.GenTaskExecute();
}