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

@@ -676,5 +676,25 @@
/// </summary> /// </summary>
public const string EQUIPMANAGERORG_ID = "26586914497557"; public const string EQUIPMANAGERORG_ID = "26586914497557";
/// <summary>
/// 注塑提报
/// </summary>
public const string bipwarehouseid_zs = "1001A1100000001SO7YO";
/// <summary>
/// 挤出提报
/// </summary>
public const string bipwarehouseid_jc = "1001A1100000001SO4AM";
/// <summary>
/// 包装提报
/// </summary>
public const string bipwarehouseid_bz = "1001A1100000001KZIU5";
/// <summary>
/// 灭菌提报
/// </summary>
public const string bipwarehouseid_mj = "1001A1100000001MA8KP";
/// <summary>
/// 成品提报
/// </summary>
public const string bipwarehouseid_cp = "1001A1100000001MA8ME";
} }
} }

View File

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