From 8b0d749cfbec8bf0afe71a8956bfeeed6f27cdfc Mon Sep 17 00:00:00 2001
From: chengsc <11752@DESKTOP-DS49RCP>
Date: 星期四, 16 一月 2025 15:32:30 +0800
Subject: [PATCH] Merge branch 'csc'

---
 Admin.NET/WCS.Application/Hub/PlcDeviceHub.cs |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/Admin.NET/WCS.Application/Hub/PlcDeviceHub.cs b/Admin.NET/WCS.Application/Hub/PlcDeviceHub.cs
index 7a2c8ff..d1ed413 100644
--- a/Admin.NET/WCS.Application/Hub/PlcDeviceHub.cs
+++ b/Admin.NET/WCS.Application/Hub/PlcDeviceHub.cs
@@ -72,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)
@@ -187,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

--
Gitblit v1.8.0