using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml.Linq; using WIDESEAWCS_Core.Helper; namespace WIDESEAWCS_DTO.WMSInfo { public class WMSInterfaceAddress { public static readonly string Ip = AppSettings.Configuration["WMSIP"]; /// /// 产线申请 /// public static string ProductionlineRequest => GetInterfaceAddress(nameof(ProductionlineRequest)); /// /// 获取放车位置 /// public static string GetPosition => GetInterfaceAddress(nameof(GetPosition)); /// /// 输送线申请入库 /// public static string ConveyorLineRequestInbound => GetInterfaceAddress(nameof(ConveyorLineRequestInbound)); /// /// 堆垛机申请入库 /// public static string StackerCraneRequestInbound => GetInterfaceAddress(nameof(StackerCraneRequestInbound)); /// /// 任务状态同步到WMS /// public static string UpdateTaskStatus => GetInterfaceAddress(nameof(UpdateTaskStatus)); /// /// 任务取消 /// public static string CancelTask => GetInterfaceAddress(nameof(CancelTask)); static string GetInterfaceAddress(string MethodName) { string wmsInterfaceAddress = AppSettings.Configuration[nameof(wmsInterfaceAddress)]; if (!string.IsNullOrEmpty(wmsInterfaceAddress)) { List InterfaceAddresses = wmsInterfaceAddress.Split(',').ToList(); return Ip + InterfaceAddresses.Where(x => x.Contains(MethodName)).FirstOrDefault(); } return ""; } } }