From 18675524096643ce5cb3f53f134f2982dd0fd6d7 Mon Sep 17 00:00:00 2001
From: zhaowc <526854230@qq.com>
Date: 星期五, 31 十月 2025 16:42:15 +0800
Subject: [PATCH] 修改任务页面
---
Admin.NET/WCS.Application/Hub/PlcDeviceHub.cs | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/Admin.NET/WCS.Application/Hub/PlcDeviceHub.cs b/Admin.NET/WCS.Application/Hub/PlcDeviceHub.cs
index 3fc4f27..d1ed413 100644
--- a/Admin.NET/WCS.Application/Hub/PlcDeviceHub.cs
+++ b/Admin.NET/WCS.Application/Hub/PlcDeviceHub.cs
@@ -16,7 +16,6 @@
[MapHub("/hubs/PlcDevice")]
public class PlcDeviceHub : Hub<IPlcDeviceHub>
{
- private static readonly IHubContext<PlcDeviceHub, IPlcDeviceHub> _plcDeviceHubContext = App.GetService<IHubContext<PlcDeviceHub, IPlcDeviceHub>>();
private static readonly SysCacheService _sysCacheService = App.GetRequiredService<SysCacheService>();
private static bool boRunningState = false;
private static CancellationTokenSource cts;//鍙栨秷绾跨▼鏍囪瘑
@@ -73,7 +72,7 @@
var listPlc = _db.Queryable<WcsPlc>().Where(s => s.Type == PLCTypeEnum.StackingMachine || s.Type == PLCTypeEnum.ConveyorLine).Where(s => s.Enable == YesNoEnum.Y).ToList();
var listPlcId = listPlc.Select(s => s.Id).ToList();
- var listPlcDevice = _db.Queryable<WcsDevice>().Where(s => s.DeviceType == DeviceTypeEnum.Business && listPlcId.Contains(s.PlcId)).Select<WcsDeviceOutput>().ToList();
+ var listPlcDevice = _db.Queryable<WcsDevice>().Where(s => s.DeviceType == DeviceTypeEnum.Business && listPlcId.Contains(s.PlcId) && s.IsDelete).Select<WcsDeviceOutput>().ToList();
var listPlcDeviceId = listPlcDevice.Select(s => s.Id).ToList();
var listPlcStation = _db.Queryable<WcsPosition>().Where(s => listPlcDeviceId.Contains(s.DeviceId)).ToList();
while (true)
@@ -188,6 +187,13 @@
modDevice.PickStorey = Convert.ToInt32(pickStorey);
}
+ if (modPlc.Type == PLCTypeEnum.StackingMachine)
+ {
+ //璺烘満鐨勮捣濮嬪伐浣嶇敤鍙栬揣鎺掑垪灞�
+ modDevice.StartLocatNo = $"{modDevice.PickRow.ToString()}{modDevice.PickCol.ToString()}{modDevice.PickStorey.ToString()}";
+ //璺烘満鐨勭洰鐨勫伐浣嶇敤鏀捐揣鎺掑垪灞�
+ modDevice.EndLocatNo = $"{modDevice.ReleaseRow.ToString()}{modDevice.ReleaseCol.ToString()}{modDevice.ReleaseStorey.ToString()}";
+ }
}
}
//else
@@ -203,7 +209,7 @@
if (initialStates.TryGetValue(modDevice.Id, out var initialState))
{
if (modDevice.Status != initialState.Status ||
- (!modDevice.Plc.IsNullOrEmpty() && modDevice.Plc != initialState.Plc) ||
+ (modDevice.Plc.IsNullOrEmpty() && modDevice.Plc != initialState.Plc) ||
modDevice.Wcs != initialState.Wcs ||
modDevice.TaskNo != initialState.TaskNo ||
modDevice.TaskType != initialState.TaskType ||
@@ -219,7 +225,7 @@
modDevice.PickStorey != initialState.PickStorey)))
{
// 閫氱煡鐢ㄦ埛鍙樻洿
- _plcDeviceHubContext.Clients.All.PublicPlcDevice(modDevice);
+ HubUtil.PublicPlcDevice(modDevice);
}
}
initialStates[modDevice.Id] = modDevice.Adapt<WcsDeviceOutput>();
--
Gitblit v1.8.0