AppCommon.cs
4.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
using HHWCS.Bll;
using HHWCS.Model;
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace HHWCS.Bll
{
public class AppCommon
{
public static IBll Bll = new BllWMS();
public static String ConnectionString = ConfigurationManager.ConnectionStrings["MySql"].ConnectionString;
public static MySqlConnection MysqlConnection = new MySqlConnection(ConnectionString);
public static String Origin = ConfigurationManager.AppSettings["origin"];
public static String WarehouseCode = ConfigurationManager.AppSettings["warehouseCode"];
public static int WarehouseId = Convert.ToInt32(ConfigurationManager.AppSettings["warehouseId"]);
public static String PrinterName = ConfigurationManager.AppSettings["printerName"];
public static String Report = ConfigurationManager.AppSettings["printerReport"];
public static String LedIP = ConfigurationManager.AppSettings["ledIP"];
public static ushort LedPort = Convert.ToUInt16(ConfigurationManager.AppSettings["ledPort"]);
public static int LedTimer = Convert.ToInt32(ConfigurationManager.AppSettings["ledTimer"]);
public static User User = new User();
public static Dictionary<WMSUrls, string> Urls = new Dictionary<WMSUrls, string>()
{
{ WMSUrls.TaskComplete,"wms/task/task/complete"},
{WMSUrls.TaskExecute,"wms/task/task/execute" },
{WMSUrls.Login,"wms/login" },
{WMSUrls.Heartbeat,"wms/mobile/heartbeat" },
{WMSUrls.HandleEmptyOut,"wms/task/task/handleEmptyOut" },
{WMSUrls.GetLocation,"wms/task/task/setLocationCode" }
};
public static HttpClient Client = new HttpClient(new HttpClientHandler()
{
UseCookies = true
})
{
BaseAddress = new Uri(ConfigurationManager.AppSettings["ServerUrl"])
};
public static String GetTaskType(String v)
{
switch (v)
{
case "100": return "整盘入库";
case "200": return "补充入库";
case "300": return "整盘出库";
case "400": return "分拣出库";
case "500": return "空容器入库";
case "600": return "空容器出库";
case "700": return "盘点";
case "800": return "移库";
case "900": return "出库查看";
}
return "未识别的任务类型";
}
public static Dictionary<string, string> GetTaskType()
{
Dictionary<String, String> types = new Dictionary<string, string>();
types.Add("100", "整盘入库");
types.Add("200", "补充入库");
types.Add("300", "整盘出库");
types.Add("400", "分拣出库");
types.Add("500", "空容器入库");
types.Add("600", "空容器出库");
types.Add("700", "盘点");
types.Add("800", "移库");
types.Add("900", "出库查看");
return types;
}
public static Dictionary<string, string> GetTaskStatus()
{
Dictionary<String, String> status = new Dictionary<string, string>();
status.Add("0", "生成任务");
status.Add("10", "下达任务");
status.Add("20", "开始执行");
status.Add("30", "到达站台");
status.Add("40", "完成");
status.Add("", "全部");
return status;
}
public static Dictionary<String, string> GetPriority()
{
Dictionary<String, String> priorities = new Dictionary<string, string>();
priorities.Add("1", "1");
priorities.Add("2", "2");
priorities.Add("3", "3");
priorities.Add("4", "4");
priorities.Add("5", "5");
priorities.Add("6", "6");
return priorities;
}
public static Dictionary<String, string> GetStations()
{
Dictionary<String, String> stations = new Dictionary<string, string>();
stations.Add("1", "1");
stations.Add("2", "2");
return stations;
}
public static Dictionary<String, string> GetLocationStatus()
{
Dictionary<String, String> status = new Dictionary<string, string>();
status.Add("empty", "空");
status.Add("lock", "预定");
status.Add("occupy", "占用");
status.Add("disable", "禁用");
return status;
}
}
}