| | |
| | | public static string SqlServer { get; set; } |
| | | public static string TCPServerIP { get; set; } |
| | | public static int TCPServerPort { get; set; } |
| | | public static List<Config.Area> Areas { get; set; } |
| | | public static List<Config.Snap> Snaps { get; set; } |
| | | //public static List<Config.Area> Areas { get; set; } |
| | | public static List<List<string>> Areas { get; set; } = new List<List<string>>(); |
| | | public static List<Config.Snap> Snaps { get; set; } = new List<Config.Snap>(); |
| | | public static string CaptureUrl { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 库区字典(加载后就不变) |
| | | /// </summary> |
| | | public static Dictionary<string, List<string>> AreaMap { get; set; } = new Dictionary<string, List<string>>(); |
| | | //public static Dictionary<string, List<string>> AreaMap { get; set; } = new Dictionary<string, List<string>>(); |
| | | |
| | | public static void Init() { |
| | | // 加载配置文件 |
| | | LoadJson(); |
| | | |
| | | // 针对 Areas 进行转换:将 Config 的 List 加载到 Dict 中 |
| | | LoadAreas(); |
| | | //LoadAreas(); |
| | | } |
| | | |
| | | private static void LoadJson() { |
| | |
| | | |
| | | WebApiUrl = root.WebApiUrl; |
| | | RCSApiUrl = root.RCSApiUrl; |
| | | NDCApiUrl = root.NDCApiUrl; |
| | | //NDCApiUrl = root.NDCApiUrl; |
| | | SqlServer = root.SqlServer; |
| | | TCPServerIP = root.TCPServerIP; |
| | | TCPServerPort = root.TCPServerPort; |
| | | Areas = root.Areas; |
| | | //TCPServerIP = root.TCPServerIP; |
| | | //TCPServerPort = root.TCPServerPort; |
| | | //Areas = root.Areas; |
| | | foreach (var item in root.Areas) { |
| | | Areas.Add(item.Codes); |
| | | } |
| | | Snaps = root.Snaps; |
| | | CaptureUrl = root.CaptureUrl; |
| | | |
| | |
| | | } |
| | | |
| | | private static void LoadAreas() { |
| | | foreach (var area in Areas) { |
| | | AreaMap.Add(area.Name, area.Codes); |
| | | } |
| | | //foreach (var area in Areas) { |
| | | // AreaMap.Add(area.Name, area.Codes); |
| | | //} |
| | | } |
| | | } |
| | | |
| | |
| | | public class Root { |
| | | public string WebApiUrl { get; set; } |
| | | public string RCSApiUrl { get; set; } |
| | | public string NDCApiUrl { get; set; } |
| | | public string SqlServer { get; set; } |
| | | public string TCPServerIP { get; set; } |
| | | public int TCPServerPort { get; set; } |
| | | public List<Area> Areas { get; set; } |
| | | public List<Snap> Snaps { get; set; } |
| | | public string CaptureUrl { get; set; } |
| | |
| | | public string Name { get; set; } |
| | | public string Pwd { get; set; } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | public class TaskName { |
| | | public const string 产品入库 = "产品入库"; |
| | | public const string 产品部分出库 = "产品部分出库"; |
| | | public const string 产品部分回库 = "产品部分回库"; |
| | | public const string 盘点理货出库 = "盘点理货出库"; |
| | | public const string 盘点理货回库 = "盘点理货回库"; |
| | | } |
| | | |
| | | public class AreaIndex { |
| | | public const int Q取货区 = 0; |
| | | public const int X卸货区 = 1; |
| | | public const int H货架区 = 2; |
| | | } |
| | | } |