From e0d89637030791ce1e7dd46ca5fdec9979977960 Mon Sep 17 00:00:00 2001 From: 杨前锦 <1010338399@qq.com> Date: 星期三, 11 六月 2025 17:28:41 +0800 Subject: [PATCH] 印尼佳通-硫化流程出入库流程开发 --- HH.WCS.Mobox3/HH.WCS.Mobox3.FJJT/util/Settings.cs | 68 +++++++++++++++++++++++++++------ 1 files changed, 55 insertions(+), 13 deletions(-) diff --git a/HH.WCS.Mobox3/HH.WCS.Mobox3.FJJT/util/Settings.cs b/HH.WCS.Mobox3/HH.WCS.Mobox3.FJJT/util/Settings.cs index 9195aec..0933920 100644 --- a/HH.WCS.Mobox3/HH.WCS.Mobox3.FJJT/util/Settings.cs +++ b/HH.WCS.Mobox3/HH.WCS.Mobox3.FJJT/util/Settings.cs @@ -12,10 +12,13 @@ public static string SqlServer { get; set; } public static string SqlServer1 { get; set; } public static string OracleServer { get; set; } - public static List<deviceInfo> deviceInfos { get; set; } + public static List<CarDeviceInfo> carDeviceInfos { get; set; } public static List<LinePlcInfo> linePlcInfo { get; set; } public static List<PlcValue> plcValue { get; set; } public static List<AreaProperty> areaPropertyList { get; set; } + public static List<AreaRelevance> areaRelevanceList { get; set; } + + public static List<BufferLocConfig> bufferLocConfigList { get; set; } public static int port { get; set; } public static string WHCode { get; set; } public static string FacCode { get; set; } @@ -60,8 +63,8 @@ if (keyValue.Name == "ApiPort") { port = int.Parse(keyValue.Value.ToString()); } - if (keyValue.Name == "DeviceInfo") { - deviceInfos = JsonConvert.DeserializeObject<List<deviceInfo>>(keyValue.Value.ToString()); + if (keyValue.Name == "CarDeviceInfo") { + carDeviceInfos = JsonConvert.DeserializeObject<List<CarDeviceInfo>>(keyValue.Value.ToString()); } if (keyValue.Name == "linePlcInfo") { linePlcInfo = JsonConvert.DeserializeObject<List<LinePlcInfo>>(keyValue.Value.ToString()); @@ -72,6 +75,14 @@ if (keyValue.Name == "AreaProperty") { areaPropertyList = JsonConvert.DeserializeObject<List<AreaProperty>>(keyValue.Value.ToString()); + } + if (keyValue.Name == "AreaRelevance") + { + areaRelevanceList = JsonConvert.DeserializeObject<List<AreaRelevance>>(keyValue.Value.ToString()); + } + if (keyValue.Name == "BufferLocConfig") + { + bufferLocConfigList = JsonConvert.DeserializeObject<List<BufferLocConfig>>(keyValue.Value.ToString()); } } } @@ -92,6 +103,44 @@ return areaPropertyList.Where(a => a.cntrType.Contains(cntrType)).Select(a => a.areaCode).ToList(); } + /// <summary> + /// 鏌ヨ瀛樺偍搴撳尯 + /// </summary> + /// <param name="areaCode"></param> + /// <returns></returns> + public static List<string> getRelAreaCodes(string areaCode) + { + List<string> areaCodes = new List<string>(); + var areaRelevance = areaRelevanceList.Where(a => a.areaCode == areaCode).FirstOrDefault(); + if (areaRelevance != null) + { + areaCodes = areaRelevance.relAreaCode; + } + return areaCodes; + } + + /// <summary> + /// 鑾峰彇鐩磋繛缂撳瓨浣嶉厤缃�+ /// </summary> + /// <param name="locCode"></param> + /// <returns></returns> + public static BufferLocConfig GetBufferLocConfig(string locCode) + { + return bufferLocConfigList.Where(a => a.locCode == locCode).FirstOrDefault(); + } + + public class BufferLocConfig + { + public string locCode { get; set; } + public string deviceNo { get; set; } + } + + public class AreaRelevance + { + public string areaCode { get; set; } + public List<string> relAreaCode { get; set; } + } + public class AreaProperty { public string areaName { get; set; } @@ -99,18 +148,11 @@ public List<int> cntrType { get; set; } // 瀹瑰櫒绫诲瀷 1.鑳庨潰锛�.鑳庝晶锛�.鍐呰‖锛�.甯樺竷锛�.鐜甫锛�.鍐犲甫锛�.閽㈠寘 } - - - - - - public class deviceInfo { + public class CarDeviceInfo + { public string address { get; set; } public string deviceName { get; set; } - public string[] deviceNo { get; set; } - public string[] TN_Location { get; set; } - - public int deviceType { get; set; } + public string deviceNo { get; set; } public int enable { get; set; } } public class TableName { -- Gitblit v1.9.1