Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
2024-08-08 17:17:08 +08:00
7 changed files with 158 additions and 59 deletions

View File

@@ -6,6 +6,7 @@ using System.Dynamic;
using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.X509Certificates;
using System.Security.Policy; using System.Security.Policy;
using System.Text; using System.Text;
using System.Text.Json.Nodes;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading; using System.Threading;
using Aop.Api.Domain; using Aop.Api.Domain;
@@ -945,16 +946,47 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
{ {
var strs = dic.Where(p => p.Key == key).First().Value; var strs = dic.Where(p => p.Key == key).First().Value;
bool re = await GetBoolTag(key, strs[0]); JObject reObj = await GetObjectTag(key, strs[0]);
if (reObj == null)
continue;
bool re = false;
DateTime timestamp_judgeCode = DateTime.MinValue;
if (reObj.TryGetValue("Value", out JToken valueToken1))
{
re = bool.Parse(valueToken1.ToString());
if (reObj.TryGetValue("TimeStamp", out JToken valueToken2))
timestamp_judgeCode = DateTime.Parse(valueToken2.ToString());
}
if (!re) if (!re)
continue; continue;
string? result = await GetStringTag(key, strs[1]);
JObject reObj_code = await GetObjectTag(key, strs[1]);
if (reObj_code == null)
continue;
string? result = "";
DateTime timestamp_code = DateTime.MinValue;
if (reObj_code.TryGetValue("Value", out JToken valueToken3))
{
result = valueToken3.ToString();
if (reObj_code.TryGetValue("TimeStamp", out JToken valueToken4))
timestamp_code = DateTime.Parse(valueToken4.ToString());
}
if (!string.IsNullOrEmpty(result)) if (!string.IsNullOrEmpty(result))
{ {
if (result.Length < 5) if (result.Length < 5)
{ {
result = "LX" + result.Replace("\r", ""); result = "LX" + result.Replace("\r", "");
} }
if (timestamp_judgeCode > timestamp_code)
{
LoggerSSX.LogInformation($"【定时任务SSXcode】下升降机入中储仓 判定料箱{result}的条码判断请求信号时间{timestamp_judgeCode.ToString("yyyy-MM-dd HH:mm:ss")} 大于条码更新的时间{timestamp_code.ToString("yyyy-MM-dd HH:mm:ss")},将跳过此次执行");
continue;
}
var DistaskH = db_SSXcodetimer.Queryable<WmsDistaskH>().Where(p => p.carry_code == result && p.status != WmsWareHouseConst.TASK_BILL_STATUS_COMPLE_ID).OrderByDescending(p => p.create_time).First(); var DistaskH = db_SSXcodetimer.Queryable<WmsDistaskH>().Where(p => p.carry_code == result && p.status != WmsWareHouseConst.TASK_BILL_STATUS_COMPLE_ID).OrderByDescending(p => p.create_time).First();
if (DistaskH != null) if (DistaskH != null)
{ {
@@ -1229,9 +1261,9 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
/// <returns></returns> /// <returns></returns>
public async void (object? args) public async void (object? args)
{ {
if (s_task送空托到上升降区.CurrentCount == 0) if (_wareHouseService.s_taskExecuteSemaphore_F2ZCCOutstock.CurrentCount == 0)
return; return;
await s_task送空托到上升降区.WaitAsync(); await _wareHouseService.s_taskExecuteSemaphore_F2ZCCOutstock.WaitAsync();
Stopwatch stopwatch = new Stopwatch(); Stopwatch stopwatch = new Stopwatch();
stopwatch.Start(); stopwatch.Start();
try try
@@ -1355,7 +1387,7 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
} }
finally finally
{ {
s_task送空托到上升降区.Release(); _wareHouseService.s_taskExecuteSemaphore_F2ZCCOutstock.Release();
if (!db_Floor2timer送空托到上升降区.Ado.Transaction.IsNull()) if (!db_Floor2timer送空托到上升降区.Ado.Transaction.IsNull())
try { await db_Floor2timer送空托到上升降区.Ado.CommitTranAsync(); } catch { }; try { await db_Floor2timer送空托到上升降区.Ado.CommitTranAsync(); } catch { };
_wareHouseService.GenTaskExecute(); _wareHouseService.GenTaskExecute();
@@ -1371,9 +1403,9 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
/// <returns></returns> /// <returns></returns>
public async void (object? args) public async void (object? args)
{ {
if (s_task送满托到下升降区.CurrentCount == 0) if (_wareHouseService.s_taskExecuteSemaphore_F2ZCCOutstock.CurrentCount == 0)
return; return;
await s_task送满托到下升降区.WaitAsync(); await _wareHouseService.s_taskExecuteSemaphore_F2ZCCOutstock.WaitAsync();
Stopwatch stopwatch = new Stopwatch(); Stopwatch stopwatch = new Stopwatch();
stopwatch.Start(); stopwatch.Start();
try try
@@ -1533,7 +1565,7 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
} }
finally finally
{ {
s_task送满托到下升降区.Release(); _wareHouseService.s_taskExecuteSemaphore_F2ZCCOutstock.Release();
if (!db_Floor2timer送满托到下升降区.Ado.Transaction.IsNull()) if (!db_Floor2timer送满托到下升降区.Ado.Transaction.IsNull())
try { await db_Floor2timer送满托到下升降区.Ado.CommitTranAsync(); } catch { }; try { await db_Floor2timer送满托到下升降区.Ado.CommitTranAsync(); } catch { };
_wareHouseService.GenTaskExecute(); _wareHouseService.GenTaskExecute();
@@ -1550,9 +1582,9 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
/// <returns></returns> /// <returns></returns>
public async void (object? args) public async void (object? args)
{ {
if (s_task移走上升降区未生成预任务且满托的料架.CurrentCount == 0) if (_wareHouseService.s_taskExecuteSemaphore_F2ZCCInstock.CurrentCount == 0)
return; return;
await s_task移走上升降区未生成预任务且满托的料架.WaitAsync(); await _wareHouseService.s_taskExecuteSemaphore_F2ZCCInstock.WaitAsync();
Stopwatch stopwatch = new Stopwatch(); Stopwatch stopwatch = new Stopwatch();
stopwatch.Start(); stopwatch.Start();
try try
@@ -1658,7 +1690,7 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
} }
finally finally
{ {
s_task移走上升降区未生成预任务且满托的料架.Release(); _wareHouseService.s_taskExecuteSemaphore_F2ZCCInstock.Release();
if (!db_Floor2timer移走上升降区未生成预任务且满托的料架.Ado.Transaction.IsNull()) if (!db_Floor2timer移走上升降区未生成预任务且满托的料架.Ado.Transaction.IsNull())
// 数据库连接断开时会报错 // 数据库连接断开时会报错
try { await db_Floor2timer移走上升降区未生成预任务且满托的料架.Ado.CommitTranAsync(); } catch { }; try { await db_Floor2timer移走上升降区未生成预任务且满托的料架.Ado.CommitTranAsync(); } catch { };
@@ -1676,9 +1708,9 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
/// <returns></returns> /// <returns></returns>
public async void (object? args) public async void (object? args)
{ {
if (s_task移走下升降区未生成预任务且空托的料架.CurrentCount == 0) if (_wareHouseService.s_taskExecuteSemaphore_F2ZCCInstock.CurrentCount == 0)
return; return;
await s_task移走下升降区未生成预任务且空托的料架.WaitAsync(); await _wareHouseService.s_taskExecuteSemaphore_F2ZCCInstock.WaitAsync();
Stopwatch stopwatch = new Stopwatch(); Stopwatch stopwatch = new Stopwatch();
stopwatch.Start(); stopwatch.Start();
try try
@@ -1789,7 +1821,7 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
} }
finally finally
{ {
s_task移走下升降区未生成预任务且空托的料架.Release(); _wareHouseService.s_taskExecuteSemaphore_F2ZCCInstock.Release();
if (!db_Floor2timer移走下升降区未生成预任务且空托的料架.Ado.Transaction.IsNull()) if (!db_Floor2timer移走下升降区未生成预任务且空托的料架.Ado.Transaction.IsNull())
try { await db_Floor2timer移走下升降区未生成预任务且空托的料架.Ado.CommitTranAsync(); } catch { }; try { await db_Floor2timer移走下升降区未生成预任务且空托的料架.Ado.CommitTranAsync(); } catch { };
_wareHouseService.GenTaskExecute(); _wareHouseService.GenTaskExecute();
@@ -2066,6 +2098,31 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
//return true; //return true;
} }
public async Task<JObject> GetObjectTag(string DevName, string field)
{
#region
try
{
string jsonString = await _redisData.GetHash(DevName, field);
Log.Information($"查询X2Server数据 {DevName} {field}:" + jsonString);
JObject jsonObject = JObject.Parse(jsonString);
if (jsonObject.TryGetValue("StatusCode", out JToken valueToken1))
{
if (valueToken1.ToString() == "-1")
return null;
}
return jsonObject;
}
catch (Exception ex)
{
// 捕获并处理异常
Console.WriteLine($"发生异常: {ex.Message}");
}
return null;
#endregion
}
#endregion #endregion
@@ -2522,41 +2579,41 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
public Task StartAsync(CancellationToken cancellationToken) public Task StartAsync(CancellationToken cancellationToken)
{ {
CheckGettimer = new Timer(CheckGet, null, TimeSpan.Zero, TimeSpan.FromSeconds(10)); //CheckGettimer = new Timer(CheckGet, null, TimeSpan.Zero, TimeSpan.FromSeconds(10));
Scantimer = new Timer(ScanInStock, null, TimeSpan.Zero, TimeSpan.FromSeconds(60)); //Scantimer = new Timer(ScanInStock, null, TimeSpan.Zero, TimeSpan.FromSeconds(60));
SSXcodetimer = new Timer(SSXcode, null, TimeSpan.Zero, TimeSpan.FromSeconds(10)); SSXcodetimer = new Timer(SSXcode, null, TimeSpan.Zero, TimeSpan.FromSeconds(10));
// 八工位缓存区补充空托盘 //// 八工位缓存区补充空托盘
BGWCarrySupplementtimer = new Timer(BGWCarrySupplement, null, TimeSpan.Zero, TimeSpan.FromSeconds(30)); //BGWCarrySupplementtimer = new Timer(BGWCarrySupplement, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
// 供料叠盘机空托盘自动入库 //// 供料叠盘机空托盘自动入库
YCLGLDPJInstocktimer = new Timer(YCLGLDPJInstock, null, TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(30)); //YCLGLDPJInstocktimer = new Timer(YCLGLDPJInstock, null, TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(30));
// 外协叠盘机空托盘自动入库 //// 外协叠盘机空托盘自动入库
YCLWXDPJInstocktimer = new Timer(YCLWXDPJInstock, null, TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(30)); //YCLWXDPJInstocktimer = new Timer(YCLWXDPJInstock, null, TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(30));
// 二楼上升降机 //// 二楼上升降机
Floor2UpMachinecodetimer = new Timer(Floor2UpMachinecode, null, TimeSpan.Zero, TimeSpan.FromSeconds(20)); //Floor2UpMachinecodetimer = new Timer(Floor2UpMachinecode, null, TimeSpan.Zero, TimeSpan.FromSeconds(20));
// 二楼料架配送 //// 二楼料架配送
Floor2timer送空托到上升降区 = new Timer(, null, TimeSpan.Zero, TimeSpan.FromSeconds(30)); //Floor2timer送空托到上升降区 = new Timer(送空托到上升降区, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
Floor2timer送满托到下升降区 = new Timer(, null, TimeSpan.Zero, TimeSpan.FromSeconds(30)); //Floor2timer送满托到下升降区 = new Timer(送满托到下升降区, null, TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(30));
Floor2timer移走上升降区未生成预任务且满托的料架 = new Timer(, null, TimeSpan.Zero, TimeSpan.FromSeconds(30)); //Floor2timer移走上升降区未生成预任务且满托的料架 = new Timer(移走上升降区未生成预任务且满托的料架, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
Floor2timer移走下升降区未生成预任务且空托的料架 = new Timer(, null, TimeSpan.Zero, TimeSpan.FromSeconds(30)); //Floor2timer移走下升降区未生成预任务且空托的料架 = new Timer(移走下升降区未生成预任务且空托的料架, null, TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(30));
GenTaskExecutetimer = new Timer(GenTaskExecute, null, TimeSpan.Zero, TimeSpan.FromSeconds(30)); //GenTaskExecutetimer = new Timer(GenTaskExecute, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
// 停用 //// 停用
//PackOutstockServicetimer = new Timer(PackOutstockService, null, TimeSpan.Zero, TimeSpan.FromSeconds(60)); ////PackOutstockServicetimer = new Timer(PackOutstockService, null, TimeSpan.Zero, TimeSpan.FromSeconds(60));
ElevatorTaskExceptionHandleThread = new Thread(ElevatorTaskExceptionHandle); //ElevatorTaskExceptionHandleThread = new Thread(ElevatorTaskExceptionHandle);
ElevatorTaskExceptionHandleThread.Start(); //ElevatorTaskExceptionHandleThread.Start();
Floor4DMJ2MJXtimer = new Timer(Floor4DMJ2MJX, null, TimeSpan.Zero, TimeSpan.FromSeconds(30)); //Floor4DMJ2MJXtimer = new Timer(Floor4DMJ2MJX, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
Floor4MJX2MJCtimer = new Timer(Floor4MJX2MJC, null, TimeSpan.Zero, TimeSpan.FromSeconds(30)); //Floor4MJX2MJCtimer = new Timer(Floor4MJX2MJC, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
Floor4DMC2CPKtimer = new Timer(Floor4DMC2CPK, null, TimeSpan.Zero, TimeSpan.FromSeconds(30)); //Floor4DMC2CPKtimer = new Timer(Floor4DMC2CPK, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
F2KTPsupplementtimer = new Timer(F2KTPsupplement, null, TimeSpan.Zero, TimeSpan.FromSeconds(30)); //F2KTPsupplementtimer = new Timer(F2KTPsupplement, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
YCLInternalTransfertimer = new Timer(YCLInternalTransfer, null, TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(185)); //YCLInternalTransfertimer = new Timer(YCLInternalTransfer, null, TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(185));
return Task.CompletedTask; return Task.CompletedTask;
} }

View File

@@ -23,6 +23,14 @@ namespace Tnb.WarehouseMgr.Interfaces
/// 原材料出库 /// 原材料出库
/// </summary> /// </summary>
SemaphoreSlim s_taskExecuteSemaphore_YCLOutstock { get; } SemaphoreSlim s_taskExecuteSemaphore_YCLOutstock { get; }
/// <summary>
/// 暂存仓入库
/// </summary>
SemaphoreSlim s_taskExecuteSemaphore_F2ZCCInstock { get; }
/// <summary>
/// 暂存仓出库
/// </summary>
SemaphoreSlim s_taskExecuteSemaphore_F2ZCCOutstock { get; }
/// <summary> /// <summary>
/// 入库策略 /// 入库策略

View File

@@ -47,14 +47,21 @@ namespace Tnb.WarehouseMgr
public static SemaphoreSlim s_taskExecuteSemaphore = new(1); public static SemaphoreSlim s_taskExecuteSemaphore = new(1);
public static SemaphoreSlim s_elevatorStatusSemaphore = new(1); public static SemaphoreSlim s_elevatorStatusSemaphore = new(1);
public static SemaphoreSlim _s_taskExecuteSemaphore_YCLInstock = new(1); public static SemaphoreSlim _s_taskExecuteSemaphore_YCLInstock = new(1);
public static SemaphoreSlim _s_taskExecuteSemaphore_YCLOutstock = new(1); public static SemaphoreSlim _s_taskExecuteSemaphore_YCLOutstock = new(1);
public static SemaphoreSlim _s_taskExecuteSemaphore_F1ZCCInstock = new(1); public static SemaphoreSlim _s_taskExecuteSemaphore_F1ZCCInstock = new(1);
public static SemaphoreSlim _s_taskExecuteSemaphore_F1ZCCOutstock = new(1); public static SemaphoreSlim _s_taskExecuteSemaphore_F1ZCCOutstock = new(1);
public static SemaphoreSlim _s_taskExecuteSemaphore_F2ZCCInstock = new(1);
public static SemaphoreSlim _s_taskExecuteSemaphore_F2ZCCOutstock = new(1);
public static SemaphoreSlim _s_taskExecuteSemaphore_F2HCCInstock = new(1);
public static SemaphoreSlim _s_taskExecuteSemaphore_F2HCCOutstock = new(1);
public static SemaphoreSlim _s_taskExecuteSemaphore_F4DMJCInstock = new(1);
public static SemaphoreSlim _s_taskExecuteSemaphore_F4DMJCOutstock = new(1);
protected static Dictionary<string, int> _s_eleUseStatusDic; protected static Dictionary<string, int> _s_eleUseStatusDic;
protected IEventPublisher? EventPublisher { set; get; } protected IEventPublisher? EventPublisher { set; get; }

View File

@@ -109,6 +109,17 @@ namespace Tnb.WarehouseMgr
get { return _s_taskExecuteSemaphore_F1ZCCOutstock; } get { return _s_taskExecuteSemaphore_F1ZCCOutstock; }
} }
public SemaphoreSlim s_taskExecuteSemaphore_F2ZCCInstock
{
get { return _s_taskExecuteSemaphore_F2ZCCInstock; }
}
public SemaphoreSlim s_taskExecuteSemaphore_F2ZCCOutstock
{
get { return _s_taskExecuteSemaphore_F2ZCCOutstock; }
}
public WareHouseService(ISqlSugarRepository<WmsInstockH> repository, IDictionaryDataService dictionaryDataService, StackExRedisHelper redisData, public WareHouseService(ISqlSugarRepository<WmsInstockH> repository, IDictionaryDataService dictionaryDataService, StackExRedisHelper redisData,
IBillRullService billRullService, IUserManager userManager, ICacheManager cacheManager, IElevatorControlService elevatorControlService, IBillRullService billRullService, IUserManager userManager, ICacheManager cacheManager, IElevatorControlService elevatorControlService,

View File

@@ -580,6 +580,8 @@ namespace Tnb.WarehouseMgr
{ {
try try
{ {
await _s_taskExecuteSemaphore_F2HCCOutstock.WaitAsync();
if (string.IsNullOrEmpty(input.source_id)) if (string.IsNullOrEmpty(input.source_id))
{ {
throw new AppFriendlyException("来源单据id不可为空", 500); throw new AppFriendlyException("来源单据id不可为空", 500);
@@ -642,8 +644,6 @@ namespace Tnb.WarehouseMgr
PrdMoTask prdMoTask = organizeEntityCXs.First(); PrdMoTask prdMoTask = organizeEntityCXs.First();
await s_taskExecuteSemaphore.WaitAsync();
await _db.Ado.BeginTranAsync(); await _db.Ado.BeginTranAsync();
//入库取终点 //出库起点 //入库取终点 //出库起点
@@ -711,7 +711,7 @@ namespace Tnb.WarehouseMgr
} }
finally finally
{ {
_ = s_taskExecuteSemaphore.Release(); _s_taskExecuteSemaphore_F2HCCOutstock.Release();
InvokeGenPretaskExcute(); InvokeGenPretaskExcute();
} }
@@ -1532,6 +1532,7 @@ namespace Tnb.WarehouseMgr
{ {
try try
{ {
await _s_taskExecuteSemaphore_F2ZCCOutstock.WaitAsync();
OrganizeEntity organizeEntity = _db.Queryable<OrganizeEntity>().Where(r => r.Id == input.workstation_id).First(); OrganizeEntity organizeEntity = _db.Queryable<OrganizeEntity>().Where(r => r.Id == input.workstation_id).First();
if (organizeEntity == null) if (organizeEntity == null)
{ {
@@ -1632,6 +1633,10 @@ namespace Tnb.WarehouseMgr
Logger.LogError("【CallRackToProductionLine】" + ex.StackTrace); Logger.LogError("【CallRackToProductionLine】" + ex.StackTrace);
return await ToApiResult(HttpStatusCode.InternalServerError, ex.Message); return await ToApiResult(HttpStatusCode.InternalServerError, ex.Message);
} }
finally
{
_s_taskExecuteSemaphore_F2ZCCOutstock.Release();
}
return await ToApiResult(HttpStatusCode.OK, "成功"); return await ToApiResult(HttpStatusCode.OK, "成功");
} }
@@ -1738,6 +1743,7 @@ namespace Tnb.WarehouseMgr
{ {
try try
{ {
await _s_taskExecuteSemaphore_F2ZCCInstock.WaitAsync();
List<WmsCarryD> wmsCarryDs = _db.Queryable<WmsCarryD>().Where(r => r.carry_id == wmsCarryH.id).ToList(); List<WmsCarryD> wmsCarryDs = _db.Queryable<WmsCarryD>().Where(r => r.carry_id == wmsCarryH.id).ToList();
if (wmsCarryDs.Count > 0) if (wmsCarryDs.Count > 0)
{ {
@@ -1839,6 +1845,10 @@ namespace Tnb.WarehouseMgr
await _db.Ado.RollbackTranAsync(); await _db.Ado.RollbackTranAsync();
return await ToApiResult(HttpStatusCode.InternalServerError, ex.Message); return await ToApiResult(HttpStatusCode.InternalServerError, ex.Message);
} }
finally
{
_s_taskExecuteSemaphore_F2ZCCInstock.Release();
}
return await ToApiResult(HttpStatusCode.OK, "成功"); return await ToApiResult(HttpStatusCode.OK, "成功");
} }
@@ -1846,6 +1856,7 @@ namespace Tnb.WarehouseMgr
{ {
try try
{ {
await _s_taskExecuteSemaphore_F2HCCInstock.WaitAsync();
BasLocation startlocation = _db.Queryable<BasLocation>().Where(r => r.id == input.startlocation_id).First(); BasLocation startlocation = _db.Queryable<BasLocation>().Where(r => r.id == input.startlocation_id).First();
if (startlocation == null) if (startlocation == null)
{ {
@@ -1898,6 +1909,10 @@ namespace Tnb.WarehouseMgr
await _db.Ado.RollbackTranAsync(); await _db.Ado.RollbackTranAsync();
return await ToApiResult(HttpStatusCode.InternalServerError, ex.Message); return await ToApiResult(HttpStatusCode.InternalServerError, ex.Message);
} }
finally
{
_s_taskExecuteSemaphore_F2HCCInstock.Release();
}
return await ToApiResult(HttpStatusCode.OK, "成功"); return await ToApiResult(HttpStatusCode.OK, "成功");
} }

View File

@@ -60,9 +60,9 @@ namespace Tnb.WarehouseMgr
{ {
if (input.data[nameof(OutStockStrategyQuery.warehouse_id)].ToString() == WmsWareHouseConst.WAREHOUSE_ZC_ID) if (input.data[nameof(OutStockStrategyQuery.warehouse_id)].ToString() == WmsWareHouseConst.WAREHOUSE_ZC_ID)
{
await _s_taskExecuteSemaphore_F1ZCCOutstock.WaitAsync(); await _s_taskExecuteSemaphore_F1ZCCOutstock.WaitAsync();
} else if (input.data[nameof(OutStockStrategyQuery.warehouse_id)].ToString() == WmsWareHouseConst.WAREHOUSE_HCC_ID)
await _s_taskExecuteSemaphore_F2HCCOutstock.WaitAsync();
try try
{ {
Logger.Information("开始PDA空载具出库"); Logger.Information("开始PDA空载具出库");
@@ -236,9 +236,10 @@ namespace Tnb.WarehouseMgr
finally finally
{ {
if (input.data[nameof(OutStockStrategyQuery.warehouse_id)].ToString() == WmsWareHouseConst.WAREHOUSE_ZC_ID) if (input.data[nameof(OutStockStrategyQuery.warehouse_id)].ToString() == WmsWareHouseConst.WAREHOUSE_ZC_ID)
{
_s_taskExecuteSemaphore_F1ZCCOutstock.Release(); _s_taskExecuteSemaphore_F1ZCCOutstock.Release();
} else if (input.data[nameof(OutStockStrategyQuery.warehouse_id)].ToString() == WmsWareHouseConst.WAREHOUSE_HCC_ID)
_s_taskExecuteSemaphore_F2HCCOutstock.Release();
await InvokeGenPretaskExcute(); await InvokeGenPretaskExcute();
} }
return Task.FromResult(true); return Task.FromResult(true);

View File

@@ -143,15 +143,15 @@ namespace Tnb.WarehouseMgr
await db.Insertable(WmsPrdInstockCodes).ExecuteCommandAsync(); await db.Insertable(WmsPrdInstockCodes).ExecuteCommandAsync();
if (type == "25019163616533") if (type == DictConst.PrdMoTypeZS)
{ {
await _s_taskExecuteSemaphore_F1ZCCInstock.WaitAsync(); await _s_taskExecuteSemaphore_F1ZCCInstock.WaitAsync();
} }
else if (type == "25019172714005") else if (type == DictConst.PrdMoTypeJC)
{ {
await _s_taskExecuteSemaphore_F1ZCCInstock.WaitAsync(); await _s_taskExecuteSemaphore_F2HCCInstock.WaitAsync();
} }
else if (type == "25019191681045") else if (type == DictConst.PrdMoTypeBZ)
{ {
} }
@@ -177,7 +177,7 @@ namespace Tnb.WarehouseMgr
string startlocation_id_ssx = null; string startlocation_id_ssx = null;
if (type == "25019163616533") if (type == DictConst.PrdMoTypeZS)
{ {
Logger.LogInformation($"【PrdInstock】注塑车间生产提报"); Logger.LogInformation($"【PrdInstock】注塑车间生产提报");
// 注塑线边库到24输送线 // 注塑线边库到24输送线
@@ -231,7 +231,7 @@ namespace Tnb.WarehouseMgr
throw new Exception($"注塑车间生成到中储仓的任务失败 {res2.msg}"); throw new Exception($"注塑车间生成到中储仓的任务失败 {res2.msg}");
} }
} }
else if (type == "25019172714005") else if (type == DictConst.PrdMoTypeJC)
{ {
Logger.LogInformation($"【PrdInstock】挤出车间生产提报"); Logger.LogInformation($"【PrdInstock】挤出车间生产提报");
WmsCarryH wmsCarryH = await db.Queryable<WmsCarryH>().Where(r => r.id == wmsPrdInstockD.carry_id).FirstAsync(); WmsCarryH wmsCarryH = await db.Queryable<WmsCarryH>().Where(r => r.id == wmsPrdInstockD.carry_id).FirstAsync();
@@ -253,7 +253,7 @@ namespace Tnb.WarehouseMgr
throw new Exception($"挤出车间生成到中储仓的任务失败 {res2.msg}"); throw new Exception($"挤出车间生成到中储仓的任务失败 {res2.msg}");
} }
} }
else if (type == "25019191681045") else if (type == DictConst.PrdMoTypeBZ)
{ {
Logger.LogInformation($"【PrdInstock】包装车间生产提报"); Logger.LogInformation($"【PrdInstock】包装车间生产提报");
WmsCarryH wmsCarryH = await db.Queryable<WmsCarryH>().Where(r => r.id == wmsPrdInstockD.carry_id).FirstAsync(); WmsCarryH wmsCarryH = await db.Queryable<WmsCarryH>().Where(r => r.id == wmsPrdInstockD.carry_id).FirstAsync();
@@ -289,15 +289,15 @@ namespace Tnb.WarehouseMgr
} }
finally finally
{ {
if (type == "25019163616533") if (type == DictConst.PrdMoTypeZS)
{ {
_s_taskExecuteSemaphore_F1ZCCInstock.Release(); _s_taskExecuteSemaphore_F1ZCCInstock.Release();
} }
else if (type == "25019172714005") else if (type == DictConst.PrdMoTypeJC)
{ {
_s_taskExecuteSemaphore_F1ZCCInstock.Release(); _s_taskExecuteSemaphore_F2HCCInstock.Release();
} }
else if (type == "25019191681045") else if (type == DictConst.PrdMoTypeBZ)
{ {
} }