| | |
| | | public static string WebApiUrl { get; set; } |
| | | public static string NdcApiUrl { get; set; } |
| | | public static string ErpApiUrl { get; set; } // ERP 反馈接口URL |
| | | public static string SqlServer { get; set; } |
| | | public static string TcpServerIp { get; set; } |
| | | |
| | | public static int TcpServerPort { get; set; } |
| | | public static Config.ErpRoute ErpRoute { get; set; } |
| | | |
| | | public static string SqlServer { get; set; } |
| | | //public static string TcpServerIp { get; set; } |
| | | //public static int TcpServerPort { get; set; } |
| | | public static List<Config.ProductionLine> ProductionLines { get; set; } = new List<Config.ProductionLine>(); |
| | | |
| | | public static List<Config.TaskInfo> TaskInfos { get; set; } = new List<Config.TaskInfo> { }; |
| | |
| | | WebApiUrl = root.WebApiUrl; |
| | | NdcApiUrl = root.NdcApiUrl; |
| | | ErpApiUrl = root.ErpApiUrl; |
| | | ErpRoute = root.ErpRoute; |
| | | TcpServerPort= root.TcpServerPort; |
| | | SqlServer = root.SqlServer; |
| | | TcpServerIp = root.TcpServerIp; |
| | | TcpServerPort = root.TcpServerPort; |
| | | //TcpServerIp = root.TcpServerIp; |
| | | //TcpServerPort = root.TcpServerPort; |
| | | ProductionLines = root.ProductionLines; |
| | | TaskInfos = root.TaskInfos; |
| | | |
| | | for (var i = 0; i < ProductionLines.Count; i++) { |
| | | if (ProductionLines[i].OnLoc == null) continue; |
| | | foreach (var onLoc in ProductionLines[i].OnLoc) { |
| | | LocProdIdMap.Add(onLoc, int.Parse(ProductionLines[i].Id)); |
| | | } |
| | |
| | | // [Convert JSON to C# Classes Online - Json2CSharp Toolkit](https://json2csharp.com/) |
| | | |
| | | public class Config { |
| | | |
| | | // Root myDeserializedClass = JsonConvert.DeserializeObject<Root>(myJsonResponse); |
| | | public class ErpRoute { |
| | | public string CreateTaskReturn { get; set; } |
| | | public string PickUpReturn { get; set; } |
| | | } |
| | | |
| | | public class ProductionLine { |
| | | public string Id { get; set; } |
| | | public string Name { get; set; } |
| | |
| | | public string WebApiUrl { get; set; } |
| | | public string NdcApiUrl { get; set; } |
| | | public string ErpApiUrl { get; set; } |
| | | public string SqlServer { get; set; } |
| | | public string TcpServerIp { get; set; } |
| | | public int TcpServerPort { get; set; } |
| | | public ErpRoute ErpRoute { get; set; } |
| | | public string SqlServer { get; set; } |
| | | public List<TaskInfo> TaskInfos { get; set; } |
| | | public List<ProductionLine> ProductionLines { get; set; } |
| | | } |
| | |
| | | public static string Name(this ETask eTask) { |
| | | return Settings.TaskInfos[(int)eTask].TaskName; |
| | | } |
| | | |
| | | public static Config.TaskInfo Info(this ETask eTask) { |
| | | return Settings.TaskInfos[(int)eTask]; |
| | | } |
| | | |
| | | public static List<string> StartAreas(this ETask eTask) { |
| | | return Settings.TaskInfos[(int)(eTask)].StartAreas; |
| | | } |
| | | |
| | | public static List<string> EndAreas(this ETask eTask) { |
| | | return Settings.TaskInfos[((int)eTask)].EndAreas; |
| | | } |
| | | } |
| | | } |