From 008e1327f186c793508cb6f61b11ef6b5323ad89 Mon Sep 17 00:00:00 2001
From: chengsc <Demo@DESKTOP-CPA90BF>
Date: 星期五, 13 九月 2024 14:28:22 +0800
Subject: [PATCH] 修改输送线交互问题
---
Admin.NET/WCS.Application/PLC/PLCCommon.cs | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/Admin.NET/WCS.Application/PLC/PLCCommon.cs b/Admin.NET/WCS.Application/PLC/PLCCommon.cs
index 8b64865..7407266 100644
--- a/Admin.NET/WCS.Application/PLC/PLCCommon.cs
+++ b/Admin.NET/WCS.Application/PLC/PLCCommon.cs
@@ -552,19 +552,28 @@
public static string GetRoadwayByStationNew(string StationNum)
{
string value = "";
- var conveyList1 = new List<string>() { "147", "145", "139", "137", "129", "127", "121", "119", "111", "109", "103", "101", "093", "091", "085", "083", "075", "073", "067", "065" };
- var conveyList2 = new List<string>() { "252", "254", "260", "262", "272", "270", "278", "280", "288", "290", "294", "301", "307", "309", "315", "317", "325", "327", "331", "337" };
- var conveyList3 = new List<string>() { "401", "402", "405", "406", "409", "410", "413", "414", "417", "418", "421", "422", "425", "426", "429", "430", "433", "434", "437", "438" };
+ //var conveyList1 = new List<string>() { "147", "145", "139", "137", "129", "127", "121", "119", "111", "109", "103", "101", "093", "091", "085", "083", "075", "073", "067", "065" };
+ //var conveyList2 = new List<string>() { "252", "254", "260", "262", "272", "270", "278", "280", "288", "290", "294", "301", "307", "309", "315", "317", "325", "327", "331", "337" };
+ //var conveyList3 = new List<string>() { "401", "402", "405", "406", "409", "410", "413", "414", "417", "418", "421", "422", "425", "426", "429", "430", "433", "434", "437", "438" };
- if (conveyList1.Contains(StationNum))
+ var ipInfo = _db.Queryable<WcsPlc>().Where(s => s.Type == PLCTypeEnum.StackingMachine || s.Type == PLCTypeEnum.ConveyorLine || s.Type == PLCTypeEnum.BoxConveyorLine);
+ var ip1 = ipInfo.First(m=>m.Text == "1灞傛墭鐩樿緭閫佺嚎");
+ var ip2 = ipInfo.First(m=>m.Text == "2灞傛墭鐩樿緭閫佺嚎");
+ var ip3 = ipInfo.First(m=>m.Text == "3灞傛墭鐩樿緭閫佺嚎");
+
+ var dev1 = PLCTaskAction.plcDevices.Where(m => m.IsDelete == false && m.PlcId == ip1.Id).Select(m=>m.StationNum).ToList();
+ var dev2 = PLCTaskAction.plcDevices.Where(m => m.IsDelete == false && m.PlcId == ip2.Id).Select(m => m.StationNum).ToList();
+ var dev3 = PLCTaskAction.plcDevices.Where(m => m.IsDelete == false && m.PlcId == ip3.Id).Select(m => m.StationNum).ToList();
+
+ if (dev1.Contains(StationNum))
{
value = "1";
}
- else if (conveyList2.Contains(StationNum))
+ else if (dev2.Contains(StationNum))
{
value = "2";
}
- else if (conveyList3.Contains(StationNum))
+ else if (dev3.Contains(StationNum))
{
value = "3";
}
--
Gitblit v1.8.0