| | |
| | | using NLog.Targets; |
| | | using NLog; |
| | | using ServiceStack.Messaging.Rcon; |
| | | using System.Runtime.ExceptionServices; |
| | | using System.Runtime.InteropServices; |
| | | using System.Security.RightsManagement; |
| | | using static GZ.Projects.HnSx.Clloc.sendTask; |
| | | using static GZ.Projects.HnSx.Clloc.modifyTaskPriority; |
| | | using static GZ.Projects.HnSx.Clloc.stockInException; |
| | | using static GZ.Projects.HnSx.Clloc.taskFeedback; |
| | | using static GZ.Projects.HnSx.Clloc.stockInInteraction; |
| | | using static GZ.Projects.HnSx.Clloc.cancelTask; |
| | | using static GZ.Projects.HnSx.Clloc.palletStackerInteraction; |
| | | using static GZ.Projects.HnSx.Clloc.putConveyorTask; |
| | | using static GZ.Projects.HnSx.Clloc.reportWeightinfo; |
| | | using System.Threading.Channels; |
| | | using static GZ.Projects.HnSx.Clloc; |
| | | |
| | | namespace GZ.Projects.HnSx |
| | | { |
| | |
| | | /// </summary> |
| | | /// <param name="tag"></param> |
| | | /// <param name="action"></param> |
| | | public void ThreadSettingInit(Tag tag, Action action) |
| | | public void ThreadSettingInit(Tag tag) |
| | | { |
| | | |
| | | } |
| | | public void TaskEverythingRun() |
| | | |
| | | public async void ThreadwebSoc() |
| | | { |
| | | //read Alldata from database |
| | | //å°æ°æ®ç¼åå°å
åã |
| | | try |
| | | { |
| | | Thread.Sleep(1000); |
| | | while (true) |
| | | { |
| | | if (/*list.Count > 0 && */WebSocketClientWithReconnect.GetWebSocketState() == WebSocketState.Open) |
| | | for (int i = 0; i < 70000; i++) |
| | | { |
| | | Thread.Sleep(1000); |
| | | Console.WriteLine($"{DateTime.Now.ToString("HH:mm:ss.fff")}>>>åé 第 {i} æ¡"); |
| | | //LogHelper.Info($"Hello Server {i}"); |
| | | var req = new ReportWeightInfoRequest |
| | | { |
| | | data = new ReportWeightInfoData |
| | | { |
| | | header = new ReportWeightInfoHeader |
| | | { |
| | | deliveryNo = "F0000" + i, |
| | | grossWeight = i, |
| | | cube = i, |
| | | addTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), |
| | | addWho = "WCS" |
| | | } |
| | | } |
| | | }; |
| | | var b = WebSocketClientWithReconnect.Instance?.SendAsync(JsonConvert.SerializeObject(req)).Result; |
| | | Console.WriteLine($"{DateTime.Now.ToString("HH:mm:ss.fff")}>>åé宿ï¼ï¼" + b); |
| | | if (b == true) |
| | | { |
| | | // çå¾
ç¹å®ååº |
| | | |
| | | var rr = reportWeightinfo.GetChinnnl().Result; |
| | | |
| | | //LogHelper.Info($" {DateTime.Now.ToString("HH:mm:ss.fff")}>> æ¥æ¶" + JsonConvert.SerializeObject(rr)); |
| | | //} |
| | | Console.WriteLine($"{DateTime.Now.ToString("HH:mm:ss.fff")}>>" + JsonConvert.SerializeObject(rr)); |
| | | } |
| | | else Console.WriteLine("åé失败ã"); |
| | | } |
| | | Thread.Sleep(1000); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogHelper.Error(ex.Message, ex); |
| | | } |
| | | } |
| | | public async Task TaskEverythingRun() |
| | | { |
| | | var host = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()); |
| | | foreach (var ip in host.AddressList) |
| | |
| | | if (ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) |
| | | { |
| | | Console.WriteLine($"ip= {ip.ToString()}"); |
| | | //new HttpServer(ip.ToString()).HttpServerRun(); |
| | | new HttpServer(ip.ToString()).HttpServerRun(); |
| | | //new TcpServer(ip.ToString()); |
| | | //var server = new EnhancedWebSocketServer($"http://{ip.ToString()}:8809/").StartAsync(); |
| | | var client = new WebSocketClientWithReconnect($"ws://{ip.ToString()}:8809/socket")/*.StartAsync()*/; |
| | | //Task.Run(async () => |
| | | //{ |
| | | client.StartAsync(); |
| | | Task.Run(async () => |
| | | //var server = new EnhancedWebSocketServer($"http://{ip.ToString()}:8809/").StartAsync(); http://10.20.66.121:18080 |
| | | new WebSocketClientWithReconnect($"ws://10.20.66.121:20001/socket").StartAsync(); |
| | | //new WebSocketClientWithReconnect($"ws://{ip.ToString()}:8809/socket").StartAsync(); |
| | | WebSocketClientWithReconnect.Instance.OnMessageReceived += (msg) => |
| | | { |
| | | while (true) |
| | | //reportWeightinfo.channel.Writer.TryWrite(JsonConvert.DeserializeObject<ReportWeightInfoResponse>(msg)); |
| | | reportWeightinfo.channel.Writer.TryWrite(new ReportWeightInfoResponse |
| | | { |
| | | for (int i = 0; i < 10000; i++) |
| | | Response = new ReportWeightInfoResponseData |
| | | { |
| | | Thread.Sleep(1000); |
| | | Console.WriteLine($"{DateTime.Now.ToString("HH:mm:ss.fff")}>>>Server{i}"); |
| | | await client.SendAsync($"Hello Server{i}!"); |
| | | Return = new ReportWeightInfoReturnInfo |
| | | { |
| | | returnCode = "0000", |
| | | sortingChute = msg |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | //Task.Run(async () => |
| | | //{ |
| | | // while (true) |
| | | // { |
| | | // for (int i = 60000; i < 70000; i++) |
| | | // { |
| | | // Thread.Sleep(1000); |
| | | // Console.WriteLine($"{DateTime.Now.ToString("HH:mm:ss.fff")}>>>GGG{i}"); |
| | | // await client.SendAsync($"Hello GGG{i}!"); |
| | | // } |
| | | // } |
| | | //}); |
| | | //}); |
| | | }); |
| | | }; |
| | | break; |
| | | } |
| | | } |
| | |
| | | } |
| | | public class HttpServer |
| | | { |
| | | public static readonly HttpHelper apiHelper = new HttpHelper(); |
| | | System.Net.HttpListener HttpSvcHost = null; |
| | | |
| | | public static string _listenerPrefix = ""; |
| | | public HttpServer(string ip) |
| | | { |
| | | _listenerPrefix = $"http://{ip}:8807/"; |
| | | _listenerPrefix = $"http://{ip}:8808/"; |
| | | } |
| | | public void HttpServerRun() |
| | | { |
| | |
| | | Console.WriteLine(apth + "<<>>" + DateTime.Now.Subtract(data).TotalMilliseconds); |
| | | } |
| | | } |
| | | public static List<SendTaskHeader> lstr = new List<SendTaskHeader>(); |
| | | public static List<PutConveyorTaskHeader> putConveyorTasks = new List<PutConveyorTaskHeader>(); |
| | | |
| | | private System.String HttpSvcListenerCallback_he(System.String method, System.String path, System.String requestJson, out System.Net.HttpStatusCode statusCode) |
| | | { |
| | | try |
| | |
| | | { |
| | | switch (path) |
| | | { |
| | | case "/api/Wcs/GetTask": |
| | | { |
| | | statusCode = System.Net.HttpStatusCode.OK; |
| | | return JsonConvert.SerializeObject(new |
| | | { |
| | | åºå
¥ç§»åºä»»å¡ = lstr, |
| | | ç®±ä½ååä»»å¡ = putConveyorTasks |
| | | }); |
| | | break; |
| | | } |
| | | case "/api/Wcs/RemoveTask": |
| | | { |
| | | statusCode = System.Net.HttpStatusCode.OK; |
| | | lstr.RemoveAll(x => x.palletId == requestJson); |
| | | putConveyorTasks.RemoveAll(x => x.palletId == requestJson); |
| | | break; |
| | | } |
| | | ///ä»»å¡ä¸å--WMS-->WC |
| | | case "/api/Wcs/sendTask": |
| | | { |
| | | statusCode = System.Net.HttpStatusCode.OK; |
| | | var req = JsonConvert.DeserializeObject<SendTaskRequest>(requestJson); |
| | | if (req == null || req.data == null || lstr.Find(x => x.groupTaskSequence == req.data.header.groupTaskSequence && x.groupTaskId == req.data.header.groupTaskId) != null) |
| | | { |
| | | if (req == null || req.data == null) |
| | | |
| | | return JsonConvert.SerializeObject(""); |
| | | return JsonConvert.SerializeObject(new SendTaskResponse |
| | | { |
| | | Response = new ResponseData |
| | | { |
| | | Return = new ReturnInfo |
| | | { |
| | | returnCode = "0001", |
| | | returnDesc = req?.data == null ? "æ ä»»å¡ä¸åï¼" : "ä»»å¡éå¤ä¸åï¼", |
| | | returnFlag = "0" |
| | | } |
| | | } |
| | | }); |
| | | else |
| | | return JsonConvert.SerializeObject(new SendTaskResponse |
| | | { |
| | | Response = new ResponseData |
| | | { |
| | | Return = new ReturnInfo |
| | | { |
| | | returnCode = "0000", |
| | | returnDesc = "ä»»å¡éå¤ä¸åï¼", |
| | | returnFlag = "1" |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | lstr.Add(req.data.header); |
| | | return JsonConvert.SerializeObject(new SendTaskResponse |
| | | { |
| | | Response = new ResponseData |
| | | { |
| | | Return = new ReturnInfo |
| | | { |
| | | returnCode = "0000", |
| | | returnDesc = "ok", |
| | | returnFlag = "1" |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | ///å
¥åºå¼å¸¸ä¸æ¥ã WCS-->WMS |
| | | case "/api/Wcs/stockInException": |
| | | { |
| | | statusCode = System.Net.HttpStatusCode.OK; |
| | | var f = string.IsNullOrEmpty(requestJson) ? lstr.FirstOrDefault() : lstr.Find(x => x.palletId == requestJson); |
| | | var str = apiHelper.Post("http://10.20.66.121:18080/datahubjson/wcs/?method=STOCKINEXCEP", JsonConvert.SerializeObject(new StockInExceptionRequest |
| | | { |
| | | data = new StockInExceptionData |
| | | { |
| | | header = new StockInExceptionHeader |
| | | { |
| | | organizationId = f.organizationId, |
| | | warehouseId = f.warehouseId, |
| | | groupTaskId = f.groupTaskId, |
| | | groupTaskSequence = f.groupTaskSequence, |
| | | palletId = f.palletId, |
| | | addTime = f.addTime.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | addWho = f.addWho, |
| | | reason = "åºä½æè´§ä¸å¯ç¨", |
| | | reasonCode = "01" |
| | | } |
| | | } |
| | | })); |
| | | |
| | | return JsonConvert.SerializeObject(""); |
| | | var strres = JsonConvert.DeserializeObject<StockInExceptionResponse>(str); |
| | | if (strres.Response.Return.returnCode == "0000") |
| | | { |
| | | f.toPosition = strres.Response.Return.toPosition; |
| | | f.toLocation = strres.Response.Return.toLocation; |
| | | } |
| | | return str; |
| | | } |
| | | ///ä»»å¡ç¶æåé¦ WCS-->WM |
| | | case "/api/Wcs/taskFeedback": |
| | | { |
| | | statusCode = System.Net.HttpStatusCode.OK; |
| | | |
| | | //foreach (var statu in new List<string> { "", "" }) |
| | | { |
| | | var f = string.IsNullOrEmpty(requestJson) ? lstr.FirstOrDefault() : lstr.Find(x => x.palletId == requestJson); |
| | | var str = apiHelper.Post("http://10.20.66.121:18080/datahubjson/wcs/?method=TASKFEEDBACK", JsonConvert.SerializeObject(new TaskFeedbackRequest |
| | | { |
| | | data = new TaskFeedbackData |
| | | { |
| | | header = new TaskFeedbackHeader |
| | | { |
| | | organizationId = f.organizationId, |
| | | warehouseId = f.warehouseId, |
| | | groupTaskId = f.groupTaskId, |
| | | groupTaskSequence = f.groupTaskSequence, |
| | | palletId = f.palletId, |
| | | fmLocation = f.fmLocation, |
| | | fmPosition = f.fmPosition, |
| | | toLocation = f.toLocation, |
| | | toPosition = f.toPosition, |
| | | taskStatus = "80", |
| | | taskType = f.taskType, |
| | | closeTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | closeWho = f.addWho |
| | | } |
| | | } |
| | | })); |
| | | } |
| | | return JsonConvert.SerializeObject(""); |
| | | } |
| | | ///å
¥åºäº¤äº ãWCS-->WMS |
| | | case "/api/Wcs/stockInInteraction": |
| | | { |
| | | statusCode = System.Net.HttpStatusCode.OK; |
| | | var req = JsonConvert.DeserializeObject<StockInInteractionRequest>(requestJson); |
| | | |
| | | return JsonConvert.SerializeObject(""); |
| | | var str = apiHelper.Post("http://10.20.66.121:18080/datahubjson/wcs/?method=STOCKININTERACTION", requestJson); |
| | | //var str = @"{""Response"":{""return"":{""returnCode"":""0000"",""returnDesc"":""Success"",""returnFlag"":""1"",""groupTaskId"":""GT250708000001"",""groupTaskSequence"":""1"",""taskStatus"":""00"",""taskType"":""PA"",""priority"":""3"",""toLocation"":""5A070101"",""toPosition"":""01""}}}"; |
| | | var res = JsonConvert.DeserializeObject<StockInInteractionResponse>(str); |
| | | if (res.Response.Return.returnCode == "0000") |
| | | { |
| | | var from = req.data.header; |
| | | var resss = res.Response.Return; |
| | | lstr.Add(new SendTaskHeader |
| | | { |
| | | groupTaskId = resss.groupTaskId, |
| | | groupTaskSequence = resss.groupTaskSequence, |
| | | fmLocation = from.fmLocation, |
| | | fmPosition = from.fmPosition, |
| | | palletId = from.palletId, |
| | | taskStatus = resss.taskStatus, |
| | | taskType = resss.taskType, |
| | | priority = resss.priority, |
| | | toLocation = resss.toLocation, |
| | | toPosition = resss.toPosition, |
| | | addTime = DateTime.Now, |
| | | addWho = from.addWho, |
| | | }); |
| | | } |
| | | return str;// + JsonConvert.SerializeObject(lstr); |
| | | var str1 = apiHelper.Post("http://10.20.66.121:18080/datahubjson/wcs/?method=STOCKININTERACTION", JsonConvert.SerializeObject(new StockInInteractionRequest |
| | | { |
| | | data = new StockInInteractionData |
| | | { |
| | | header = new StockInInteractionHeader |
| | | { |
| | | palletId = "TP9901", |
| | | grossWeight = 99, |
| | | palletWidth = 99, |
| | | fmLocation = "", |
| | | fmPosition = "", |
| | | addTime = DateTime.Now, |
| | | addWho = "" |
| | | } |
| | | } |
| | | })); |
| | | return str1; |
| | | } |
| | | ///å
¥åºäº¤äº ãWCS-->WMS |
| | | case "/api/Wcs/stockInInteraction2": |
| | | { |
| | | statusCode = System.Net.HttpStatusCode.OK; |
| | | var req = JsonConvert.DeserializeObject<StockInInteractionRequest>(requestJson); |
| | | |
| | | var str = apiHelper.Post("http://10.20.66.121:18080/datahubjson/wcs/?method=STOCKININTERACTION", requestJson); |
| | | //var str = @"{""Response"":{""return"":{""returnCode"":""0000"",""returnDesc"":""Success"",""returnFlag"":""1"",""groupTaskId"":""GT250708000001"",""groupTaskSequence"":""1"",""taskStatus"":""00"",""taskType"":""PA"",""priority"":""3"",""toLocation"":""5A070101"",""toPosition"":""01""}}}"; |
| | | var res = JsonConvert.DeserializeObject<StockInInteractionResponse>(str); |
| | | if (res.Response.Return.returnCode == "0000") |
| | | { |
| | | var from = req.data.header; |
| | | var resss = res.Response.Return; |
| | | lstr.Add(new SendTaskHeader |
| | | { |
| | | groupTaskId = resss.groupTaskId, |
| | | groupTaskSequence = resss.groupTaskSequence, |
| | | fmLocation = from.fmLocation, |
| | | fmPosition = from.fmPosition, |
| | | palletId = from.palletId, |
| | | taskStatus = resss.taskStatus, |
| | | taskType = resss.taskType, |
| | | priority = resss.priority, |
| | | toLocation = resss.toLocation, |
| | | toPosition = resss.toPosition, |
| | | addTime = DateTime.Now, |
| | | addWho = from.addWho, |
| | | }); |
| | | } |
| | | return str;// + JsonConvert.SerializeObject(lstr); |
| | | var str1 = apiHelper.Post("http://10.20.66.121:18080/datahubjson/wcs/?method=STOCKININTERACTION", JsonConvert.SerializeObject(new StockInInteractionRequest |
| | | { |
| | | data = new StockInInteractionData |
| | | { |
| | | header = new StockInInteractionHeader |
| | | { |
| | | palletId = "TP9901", |
| | | grossWeight = 99, |
| | | palletWidth = 99, |
| | | fmLocation = "", |
| | | fmPosition = "", |
| | | addTime = DateTime.Now, |
| | | addWho = "" |
| | | } |
| | | } |
| | | })); |
| | | return str1; |
| | | } |
| | | |
| | | ///ä»»å¡åæ¶ã WMS-->WCS |
| | | case "/api/Wcs/cancelTask": |
| | | { |
| | | statusCode = System.Net.HttpStatusCode.OK; |
| | | |
| | | return JsonConvert.SerializeObject(""); |
| | | var req = JsonConvert.DeserializeObject<CancelTaskRequest>(requestJson); |
| | | var task = lstr.Find(x => x.groupTaskId == req.data.header.groupTaskId && x.groupTaskSequence == req.data.header.groupTaskSequence); |
| | | if (task == null) |
| | | return JsonConvert.SerializeObject(new CancelTaskResponse |
| | | { |
| | | Response = new ResponseData |
| | | { |
| | | Return = new ReturnInfo |
| | | { |
| | | returnCode = "0001", |
| | | returnDesc = "ä»»å¡ä¸åå¨ï¼ï¼ï¼", |
| | | returnFlag = "0" |
| | | } |
| | | } |
| | | }); |
| | | lstr.Remove(task); |
| | | return JsonConvert.SerializeObject(new CancelTaskResponse |
| | | { |
| | | Response = new ResponseData |
| | | { |
| | | Return = new ReturnInfo |
| | | { |
| | | returnCode = "0000", |
| | | returnDesc = "", |
| | | returnFlag = "1" |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | /// ç¢çæºç³è¯·ä»»å¡ã WCS-->WMS |
| | | case "/api/Wcs/palletStackerInteraction": |
| | | { |
| | | statusCode = System.Net.HttpStatusCode.OK; |
| | | |
| | | return JsonConvert.SerializeObject(""); |
| | | var str = apiHelper.Post("http://10.20.66.121:18080/datahubjson/wcs/?method=PALLETSTACKERINTERACTION", !string.IsNullOrEmpty(requestJson) ? requestJson : JsonConvert.SerializeObject(new PalletStackerInteractionRequest |
| | | { |
| | | data = new PalletStackerInteractionData |
| | | { |
| | | header = new PalletStackerInteractionHeader |
| | | { |
| | | palletId = "TP9901", |
| | | taskId = $"X{DateTime.Now.ToString("yyyyMMdd")}001", |
| | | taskType = "PI", |
| | | fmLocation = "2FC1076", |
| | | addTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | addWho = "wcs" |
| | | } |
| | | } |
| | | })); |
| | | return str; |
| | | //return JsonConvert.SerializeObject(""); |
| | | } |
| | | ///ä¿®æ¹ä»»å¡ä¼å
级 ã WMS - WCS |
| | | case "/api/Wcs/modifyTaskPriority": |
| | | { |
| | | statusCode = System.Net.HttpStatusCode.OK; |
| | | var req = JsonConvert.DeserializeObject<ModifyTaskPriorityRequest>(requestJson); |
| | | List<TaskErrorInfo> taskErrorInfos = new List<TaskErrorInfo>(); |
| | | if (req != null) |
| | | { |
| | | foreach (var item in req.data.header) |
| | | { |
| | | var task = lstr.Find(x => x.groupTaskSequence == item.groupTaskSequence && x.groupTaskId == item.groupTaskId); |
| | | if (task != null) |
| | | { |
| | | task.priority = item.priority; |
| | | } |
| | | else |
| | | { |
| | | taskErrorInfos.Add(new TaskErrorInfo |
| | | { |
| | | groupTaskId = item.groupTaskId, |
| | | groupTaskSequence = item.groupTaskSequence, |
| | | errorCode = "0001", |
| | | errorDesc = "没è¿ä¸ªä»»å¡" |
| | | }); |
| | | } |
| | | } |
| | | |
| | | return JsonConvert.SerializeObject(""); |
| | | } |
| | | |
| | | if (req == null || req.data.header.Count == taskErrorInfos.Count) |
| | | return JsonConvert.SerializeObject(new ModifyTaskPriorityResponse |
| | | { |
| | | Response = new ModifyTaskPriorityResponseData |
| | | { |
| | | Return = new ModifyTaskPriorityReturnInfo |
| | | { |
| | | returnCode = "0001", |
| | | returnDesc = "没æä»»å¡å¯æ´æ¹", |
| | | returnFlag = "0" |
| | | } |
| | | } |
| | | }); |
| | | else |
| | | { |
| | | if (taskErrorInfos.Count == 0) |
| | | return JsonConvert.SerializeObject(new ModifyTaskPriorityResponse |
| | | { |
| | | Response = new ModifyTaskPriorityResponseData |
| | | { |
| | | Return = new ModifyTaskPriorityReturnInfo |
| | | { |
| | | returnCode = "0000", |
| | | returnFlag = "1", |
| | | returnDesc="ok" |
| | | } |
| | | } |
| | | }); |
| | | else |
| | | { |
| | | return JsonConvert.SerializeObject(new ModifyTaskPriorityResponse |
| | | { |
| | | Response = new ModifyTaskPriorityResponseData |
| | | { |
| | | Return = new ModifyTaskPriorityReturnInfo |
| | | { |
| | | returnCode = "0001", |
| | | returnDesc = "é¨åä»»å¡å¯æ´æ¹", |
| | | returnFlag = "2", |
| | | resultInfo = taskErrorInfos |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | } |
| | | /// è¾éçº¿ä»»å¡æ¨éã WMS-->WCS -- è®°å½ç®±å·æ°æ®ï¼åæ£ä¸çº¿åæ ¹æ®æ³å¥½è¿å
¥å¯¹åºçåºåã |
| | | case "/api/Wcs/putConveyorTask": |
| | | { |
| | | statusCode = System.Net.HttpStatusCode.OK; |
| | | var req = JsonConvert.DeserializeObject<PutConveyorTaskRequest>(requestJson); |
| | | List<TaskErrorInfo> taskErrorInfos = new List<TaskErrorInfo>(); |
| | | if (req != null) |
| | | { |
| | | foreach (var item in req.data.header) |
| | | { |
| | | var task = putConveyorTasks.Find(x => x.groupTaskSequence == item.groupTaskSequence && x.groupTaskId == item.groupTaskId); |
| | | if (task == null) |
| | | { |
| | | putConveyorTasks.Add(item); |
| | | } |
| | | else |
| | | { |
| | | taskErrorInfos.Add(new TaskErrorInfo |
| | | { |
| | | groupTaskId = item.groupTaskId, |
| | | groupTaskSequence = item.groupTaskSequence, |
| | | errorCode = "0001", |
| | | errorDesc = "éå¤" |
| | | }); |
| | | } |
| | | } |
| | | |
| | | return JsonConvert.SerializeObject(""); |
| | | } |
| | | |
| | | if (req == null || req.data.header.Count == taskErrorInfos.Count) |
| | | return JsonConvert.SerializeObject(new PutConveyorTaskResponse |
| | | { |
| | | Response = new PutConveyorTaskResponseData |
| | | { |
| | | Return = new PutConveyorTaskReturnInfo |
| | | { |
| | | returnCode = "0001", |
| | | returnDesc = "å
¨é¨éå¤", |
| | | returnFlag = "0" |
| | | } |
| | | } |
| | | }); |
| | | else |
| | | { |
| | | if (taskErrorInfos.Count == 0) |
| | | return JsonConvert.SerializeObject(new PutConveyorTaskResponse |
| | | { |
| | | Response = new PutConveyorTaskResponseData |
| | | { |
| | | Return = new PutConveyorTaskReturnInfo |
| | | { |
| | | returnCode = "0000", |
| | | returnFlag = "1" |
| | | } |
| | | } |
| | | }); |
| | | else |
| | | { |
| | | return JsonConvert.SerializeObject(new PutConveyorTaskResponse |
| | | { |
| | | Response = new PutConveyorTaskResponseData |
| | | { |
| | | Return = new PutConveyorTaskReturnInfo |
| | | { |
| | | returnCode = "0001", |
| | | returnDesc = "é¨åéå¤", |
| | | returnFlag = "2", |
| | | resultInfo = taskErrorInfos |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | |
| | | ///䏿¥ç§°é尺寸 - websocket .è¿éåçä½ä¸ºè®°å½ |
| | | case "/api/Wcs/reportWeightinfo": |
| | | { |
| | | statusCode = System.Net.HttpStatusCode.OK; |
| | | if (/*list.Count > 0 && */WebSocketClientWithReconnect.GetWebSocketState() == WebSocketState.Open) |
| | | //for (int i = 60000; i < 70000; i++) |
| | | { |
| | | //Thread.Sleep(1000); |
| | | var req = new ReportWeightInfoRequest |
| | | { |
| | | data = new ReportWeightInfoData |
| | | { |
| | | header = new ReportWeightInfoHeader |
| | | { |
| | | deliveryNo = "F00001", |
| | | grossWeight = 99, |
| | | cube = 66, |
| | | addTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), |
| | | addWho = "WCS" |
| | | } |
| | | } |
| | | }; |
| | | //Console.WriteLine($"{DateTime.Now.ToString("HH:mm:ss.fff")}>>>GGG{i}"); |
| | | LogHelper.Info(JsonConvert.SerializeObject(req)); |
| | | var b = WebSocketClientWithReconnect.Instance?.SendAsync(JsonConvert.SerializeObject(req)).Result; |
| | | Console.WriteLine(req.data.header.deliveryNo + "åé宿ï¼ï¼" + b); |
| | | if (b == true) |
| | | { |
| | | // çå¾
ç¹å®ååº |
| | | |
| | | return JsonConvert.SerializeObject(""); |
| | | var rr = reportWeightinfo.GetChinnnl().Result; |
| | | |
| | | LogHelper.Info("æ¥æ¶" + JsonConvert.SerializeObject(rr)); |
| | | //} |
| | | return JsonConvert.SerializeObject(rr); |
| | | } |
| | | else return "åé失败ã"; |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | break; |
| | | } |
| | |
| | | |
| | | public class WebSocketClientWithReconnect |
| | | { |
| | | private ClientWebSocket _webSocket; |
| | | //public static List<object> SendList = new List<object>(); |
| | | |
| | | public static ClientWebSocket _webSocket; |
| | | private static WebSocketClientWithReconnect _instance; |
| | | private readonly Uri _serverUri; |
| | | private readonly CancellationTokenSource _cts = new CancellationTokenSource(); |
| | | private readonly int _reconnectDelayMs; |
| | | |
| | | public event Action<string> OnMessageReceived = msg => Console.WriteLine($"{DateTime.Now.ToString("HH:mm:ss.fff")}>>>Received: {msg}"); |
| | | public event Action OnConnected = () => Console.WriteLine("Connected to server"); |
| | | public event Action OnDisconnected = () => Console.WriteLine("Disconnected from server"); |
| | | public event Action OnDisconnected = () => Console.WriteLine("Disconnected from webSocket server"); |
| | | public event Action<Exception> OnError = ex => Console.WriteLine($"Error: {ex.Message}"); |
| | | |
| | | public WebSocketClientWithReconnect(string serverUrl, int reconnectDelayMs = 5000) |
| | |
| | | _serverUri = new Uri(serverUrl); |
| | | _reconnectDelayMs = reconnectDelayMs; |
| | | } |
| | | public static WebSocketClientWithReconnect Instance |
| | | { |
| | | get |
| | | { |
| | | return _instance; |
| | | } |
| | | } |
| | | |
| | | public static WebSocketState GetWebSocketState() => _webSocket != null ? _webSocket.State : WebSocketState.Closed; |
| | | public async Task StartAsync() |
| | | { |
| | | _instance = this; |
| | | while (!_cts.IsCancellationRequested) |
| | | { |
| | | try |
| | |
| | | } |
| | | } |
| | | |
| | | public async Task SendAsync(string message) |
| | | public async Task<bool> SendAsync(string message) |
| | | { |
| | | if (_webSocket?.State != WebSocketState.Open) |
| | | { |
| | |
| | | |
| | | var bytes = System.Text.Encoding.UTF8.GetBytes(message); |
| | | await _webSocket.SendAsync(new ArraySegment<byte>(bytes), WebSocketMessageType.Text, true, _cts.Token); |
| | | |
| | | return true; |
| | | } |
| | | } |
| | | |
| | |
| | | else |
| | | { |
| | | logger = LogFactory.CreateLogger(name); |
| | | if (logger != null) |
| | | if (logger != null && !loggers.Keys.Contains(name)) |
| | | { |
| | | loggers.Add(name, logger); |
| | | } |
| | |
| | | |
| | | #endregion [èªå®ä¹ç±»][20250323145505759][LogFactory] |
| | | } |
| | | |
| | | public class HttpHelper |
| | | { |
| | | #region [èªå®ä¹ç±»][20250325095622918][HttpHelper] |
| | | public string Post(string url, string postData, string contentType = "application/json", string sessionId = "") |
| | | { |
| | | LogHelper.Info(url + "+" + postData); |
| | | WebRequest request = WebRequest.Create(url); |
| | | request.Method = "POST"; |
| | | byte[] byteArray = Encoding.UTF8.GetBytes(postData); |
| | | request.ContentType = contentType; |
| | | request.ContentLength = byteArray.Length; |
| | | request.Timeout = 15000; |
| | | if (sessionId != "") |
| | | { |
| | | request.Headers.Set("ASP.NET_SessionId", sessionId); |
| | | } |
| | | |
| | | //Authorization: UApGP6WW9FsBUqAlzxRGOw == |
| | | request.Headers.Set("Authorization", "UApGP6WW9FsBUqAlzxRGOw=="); |
| | | StreamReader reader = null; |
| | | Stream stream = null; |
| | | WebResponse rsp = null; |
| | | try |
| | | { |
| | | stream = request.GetRequestStream(); |
| | | stream.Write(byteArray, 0, byteArray.Length); |
| | | stream.Close(); |
| | | rsp = request.GetResponse(); |
| | | stream = rsp.GetResponseStream(); |
| | | reader = new StreamReader(stream); |
| | | string rrend = reader.ReadToEnd(); |
| | | LogHelper.Info($"{url} response={rrend}"); |
| | | return rrend; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogHelper.Info($"{url} err={ex.Message}"); |
| | | return ""; |
| | | } |
| | | finally |
| | | { |
| | | // éæ¾èµæº |
| | | if (reader != null) reader.Close(); |
| | | if (stream != null) stream.Close(); |
| | | if (rsp != null) rsp.Close(); |
| | | } |
| | | |
| | | } |
| | | #endregion [èªå®ä¹ç±»][20250325095622918][HttpHelper] |
| | | } |
| | | public class Clloc |
| | | { |
| | | public class sendTask |
| | | { |
| | | /// <summary> |
| | | /// ä»»å¡ä¸åè¯·æ± |
| | | /// </summary> |
| | | public class SendTaskRequest |
| | | { |
| | | /// <summary> |
| | | /// è¯·æ±æ°æ® |
| | | /// </summary> |
| | | public SendTaskData data { get; set; } |
| | | } |
| | | |
| | | public class SendTaskData |
| | | { |
| | | /// <summary> |
| | | /// 请æ±å¤´ä¿¡æ¯ |
| | | /// </summary> |
| | | public SendTaskHeader header { get; set; } |
| | | } |
| | | |
| | | public class SendTaskHeader |
| | | { |
| | | /// <summary> |
| | | /// ç»ç»ç¼å· - 主é®ï¼é»è®¤MERCURY |
| | | /// </summary> |
| | | public string organizationId { get; set; } = "MERCURY"; |
| | | |
| | | /// <summary> |
| | | /// ä»åºç¼å· - 主é®ï¼é»è®¤HN02 |
| | | /// </summary> |
| | | public string warehouseId { get; set; } = "HN02"; |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç»ç¼å· - ä¸»é® |
| | | /// </summary> |
| | | public string groupTaskId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç»åºå· - ä¸»é® |
| | | /// </summary> |
| | | public int groupTaskSequence { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçå· |
| | | /// </summary> |
| | | public string palletId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥æºåºä½ |
| | | /// </summary> |
| | | public string fmLocation { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥æºç¹ä½ |
| | | /// </summary> |
| | | public string fmPosition { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ åºä½å· |
| | | /// </summary> |
| | | public string toLocation { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ ç¹ä½ |
| | | /// </summary> |
| | | public string toPosition { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¶æ - 00:å建 |
| | | /// </summary> |
| | | public string taskStatus { get; set; } = "00"; |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç±»å - PA:å
¥åº(䏿¶/ååº/ç§»åº), PK:åºåº(æ£è´§/ç§»åº/补货/çç¹), MV:ååº |
| | | /// </summary> |
| | | public string taskType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建æ¶é´ |
| | | /// </summary> |
| | | public DateTime addTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建人 |
| | | /// </summary> |
| | | public string addWho { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¼å
级 - 1-5(1æé«,5æä½),é»è®¤3 |
| | | /// </summary> |
| | | public string priority { get; set; } = "3"; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ä¸åååº |
| | | /// </summary> |
| | | public class SendTaskResponse |
| | | { |
| | | public ResponseData Response { get; set; } |
| | | } |
| | | |
| | | public class ResponseData |
| | | { |
| | | [JsonProperty("return")] |
| | | public ReturnInfo Return { get; set; } |
| | | } |
| | | |
| | | public class ReturnInfo |
| | | { |
| | | /// <summary> |
| | | /// è¿å代ç - 0000:æå, å
¶ä»:失败 |
| | | /// </summary> |
| | | public string returnCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è¿åæè¿° |
| | | /// </summary> |
| | | public string returnDesc { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è¿åæ è®° - 1:æå, 0:失败 |
| | | /// </summary> |
| | | public string returnFlag { get; set; } |
| | | } |
| | | } |
| | | |
| | | public class stockInException |
| | | { |
| | | /// <summary> |
| | | /// å
¥åºå¼å¸¸è¯·æ± |
| | | /// </summary> |
| | | public class StockInExceptionRequest |
| | | { |
| | | public StockInExceptionData data { get; set; } |
| | | } |
| | | |
| | | public class StockInExceptionData |
| | | { |
| | | public StockInExceptionHeader header { get; set; } |
| | | } |
| | | |
| | | public class StockInExceptionHeader |
| | | { |
| | | /// <summary> |
| | | /// ç»ç»ç¼å· - 主é®ï¼é»è®¤MERCURY |
| | | /// </summary> |
| | | public string organizationId { get; set; } = "MERCURY"; |
| | | |
| | | /// <summary> |
| | | /// ä»åºç¼å· - 主é®ï¼é»è®¤HN02 |
| | | /// </summary> |
| | | public string warehouseId { get; set; } = "HN02"; |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç»ç¼å· - ä¸»é® |
| | | /// </summary> |
| | | public string groupTaskId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç»åºå· - ä¸»é® |
| | | /// </summary> |
| | | public int groupTaskSequence { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçå· |
| | | /// </summary> |
| | | public string palletId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建æ¶é´ |
| | | /// </summary> |
| | | public string addTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå»ºè®¾å¤ |
| | | /// </summary> |
| | | public string addWho { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¼å¸¸åå æè¿° |
| | | /// </summary> |
| | | public string reason { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¼å¸¸åå 代ç - 01:åºä½æè´§ä¸å¯ç¨, 03:å
¥å
伸ä½å¤ä¼¸ä½æè´§ |
| | | /// </summary> |
| | | public string reasonCode { get; set; } |
| | | |
| | | // ... UDFåæ®µ |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å
¥åºå¼å¸¸ååº |
| | | /// </summary> |
| | | public class StockInExceptionResponse |
| | | { |
| | | public StockInExceptionResponseData Response { get; set; } |
| | | } |
| | | |
| | | public class StockInExceptionResponseData |
| | | { |
| | | [JsonProperty("return")] |
| | | public StockInExceptionReturnInfo Return { get; set; } |
| | | } |
| | | |
| | | public class StockInExceptionReturnInfo : ReturnInfo |
| | | { |
| | | /// <summary> |
| | | /// æ°åé
çç®æ åºä½ |
| | | /// </summary> |
| | | public string toLocation { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ°åé
çç®æ ç¹ä½ |
| | | /// </summary> |
| | | public string toPosition { get; set; } |
| | | } |
| | | } |
| | | |
| | | public class taskFeedback |
| | | { |
| | | /// <summary> |
| | | /// ä»»å¡åé¦è¯·æ± |
| | | /// </summary> |
| | | public class TaskFeedbackRequest |
| | | { |
| | | public TaskFeedbackData data { get; set; } |
| | | } |
| | | |
| | | public class TaskFeedbackData |
| | | { |
| | | public TaskFeedbackHeader header { get; set; } |
| | | } |
| | | |
| | | public class TaskFeedbackHeader |
| | | { |
| | | /// <summary> |
| | | /// ç»ç»ç¼å· - 主é®ï¼é»è®¤MERCURY |
| | | /// </summary> |
| | | public string organizationId { get; set; } = "MERCURY"; |
| | | |
| | | /// <summary> |
| | | /// ä»åºç¼å· - 主é®ï¼é»è®¤HN02 |
| | | /// </summary> |
| | | public string warehouseId { get; set; } = "HN02"; |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç»ç¼å· - ä¸»é® |
| | | /// </summary> |
| | | public string groupTaskId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç»åºå· - ä¸»é® |
| | | /// </summary> |
| | | public int groupTaskSequence { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçå· |
| | | /// </summary> |
| | | public string palletId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥æºåºä½ |
| | | /// </summary> |
| | | public string fmLocation { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥æºç¹ä½ |
| | | /// </summary> |
| | | public string fmPosition { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ åºä½å· |
| | | /// </summary> |
| | | public string toLocation { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ ç¹ä½ |
| | | /// </summary> |
| | | public string toPosition { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¶æ - 80:宿, 98:å¼å¸¸(åè´§æ è´§) |
| | | /// </summary> |
| | | public string taskStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç±»å - PA:å
¥åº, PK:åºåº, MV:ååº |
| | | /// </summary> |
| | | public string taskType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 宿æ¶é´ |
| | | /// </summary> |
| | | public string closeTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å®æäººå |
| | | /// </summary> |
| | | public string closeWho { get; set; } |
| | | |
| | | // ... UDFåæ®µ |
| | | } |
| | | } |
| | | public class stockInInteraction |
| | | { |
| | | /// <summary> |
| | | /// å
¥åºäº¤äºè¯·æ± |
| | | /// </summary> |
| | | public class StockInInteractionRequest |
| | | { |
| | | public StockInInteractionData data { get; set; } |
| | | } |
| | | |
| | | public class StockInInteractionData |
| | | { |
| | | public StockInInteractionHeader header { get; set; } |
| | | } |
| | | |
| | | public class StockInInteractionHeader |
| | | { |
| | | /// <summary> |
| | | /// ç»ç»ç¼å· - 主é®ï¼é»è®¤MERCURY |
| | | /// </summary> |
| | | public string organizationId { get; set; } = "MERCURY"; |
| | | |
| | | /// <summary> |
| | | /// ä»åºç¼å· - 主é®ï¼é»è®¤HN02 |
| | | /// </summary> |
| | | public string warehouseId { get; set; } = "HN02"; |
| | | |
| | | /// <summary> |
| | | /// æçå· - ä¸»é® |
| | | /// </summary> |
| | | public string palletId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ»éé(kg) |
| | | /// </summary> |
| | | public decimal grossWeight { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç ç宽度(cm) |
| | | /// </summary> |
| | | public decimal palletWidth { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥æºåºä½ |
| | | /// </summary> |
| | | public string fmLocation { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥æºç¹ä½ |
| | | /// </summary> |
| | | public string fmPosition { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建æ¶é´ |
| | | /// </summary> |
| | | public DateTime addTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建人 |
| | | /// </summary> |
| | | public string addWho { get; set; } |
| | | |
| | | // ... UDF01-UDF10 |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å
¥åºäº¤äºååº |
| | | /// </summary> |
| | | public class StockInInteractionResponse |
| | | { |
| | | public StockInInteractionResponseData Response { get; set; } |
| | | } |
| | | |
| | | public class StockInInteractionResponseData |
| | | { |
| | | [JsonProperty("return")] |
| | | public StockInInteractionReturnInfo Return { get; set; } |
| | | } |
| | | |
| | | public class StockInInteractionReturnInfo : ReturnInfo |
| | | { |
| | | /// <summary> |
| | | /// ä»»å¡ç»ç¼å· |
| | | /// </summary> |
| | | public string groupTaskId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç»åºå· |
| | | /// </summary> |
| | | public int groupTaskSequence { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¶æ - 00:å建 |
| | | /// </summary> |
| | | public string taskStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç±»å - PA:å
¥åº |
| | | /// </summary> |
| | | public string taskType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¼å
级 - 1-5(1æé«) |
| | | /// </summary> |
| | | public string priority { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ åºä½å· |
| | | /// </summary> |
| | | public string toLocation { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ ç¹ä½ |
| | | /// </summary> |
| | | public string toPosition { get; set; } |
| | | } |
| | | } |
| | | public class cancelTask |
| | | { |
| | | /// <summary> |
| | | /// ä»»å¡åæ¶è¯·æ± |
| | | /// </summary> |
| | | public class CancelTaskRequest |
| | | { |
| | | public CancelTaskData data { get; set; } |
| | | } |
| | | |
| | | public class CancelTaskData |
| | | { |
| | | public CancelTaskHeader header { get; set; } |
| | | } |
| | | |
| | | public class CancelTaskHeader |
| | | { |
| | | /// <summary> |
| | | /// ç»ç»ç¼å· - 主é®ï¼é»è®¤MERCURY |
| | | /// </summary> |
| | | public string organizationId { get; set; } = "MERCURY"; |
| | | |
| | | /// <summary> |
| | | /// ä»åºç¼å· - 主é®ï¼é»è®¤HN02 |
| | | /// </summary> |
| | | public string warehouseId { get; set; } = "HN02"; |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç»ç¼å· - ä¸»é® |
| | | /// </summary> |
| | | public string groupTaskId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç»åºå· - ä¸»é® |
| | | /// </summary> |
| | | public int groupTaskSequence { get; set; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡åæ¶ååº |
| | | /// </summary> |
| | | public class CancelTaskResponse |
| | | { |
| | | public ResponseData Response { get; set; } |
| | | } |
| | | } |
| | | public class palletStackerInteraction |
| | | { |
| | | /// <summary> |
| | | /// å çæºäº¤äºè¯·æ± |
| | | /// </summary> |
| | | public class PalletStackerInteractionRequest |
| | | { |
| | | public PalletStackerInteractionData data { get; set; } |
| | | } |
| | | |
| | | public class PalletStackerInteractionData |
| | | { |
| | | public PalletStackerInteractionHeader header { get; set; } |
| | | } |
| | | |
| | | public class PalletStackerInteractionHeader |
| | | { |
| | | /// <summary> |
| | | /// ç»ç»ç¼å· - 主é®ï¼é»è®¤MERCURY |
| | | /// </summary> |
| | | public string organizationId { get; set; } = "MERCURY"; |
| | | |
| | | /// <summary> |
| | | /// ä»åºç¼å· - 主é®ï¼é»è®¤HN02 |
| | | /// </summary> |
| | | public string warehouseId { get; set; } = "HN02"; |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç¼å· - 主é®ï¼è®¾å¤ååºç请æ±ID |
| | | /// </summary> |
| | | public string taskId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçå· |
| | | /// </summary> |
| | | public string palletId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç±»å - PI:å
¥åº, PT:åºåº(å½åæ åºåºåºæ¯) |
| | | /// </summary> |
| | | public string taskType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èµ·å§åºä½ - å çæºç©çèµ·å§ä½ç½® |
| | | /// </summary> |
| | | public string fmLocation { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¼å
级 - 1-5(1æé«) |
| | | /// </summary> |
| | | public string priority { get; set; } = "3"; |
| | | |
| | | /// <summary> |
| | | /// å建æ¶é´ |
| | | /// </summary> |
| | | public string addTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå»ºè®¾å¤ |
| | | /// </summary> |
| | | public string addWho { get; set; } |
| | | |
| | | // ... UDF01-UDF10 |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å çæºäº¤äºååº |
| | | /// </summary> |
| | | public class PalletStackerInteractionResponse |
| | | { |
| | | public ResponseData Response { get; set; } |
| | | } |
| | | |
| | | } |
| | | public class modifyTaskPriority |
| | | { |
| | | /// <summary> |
| | | /// ä¿®æ¹ä»»å¡ä¼å
çº§è¯·æ± |
| | | /// </summary> |
| | | public class ModifyTaskPriorityRequest |
| | | { |
| | | public ModifyTaskPriorityData data { get; set; } |
| | | } |
| | | |
| | | public class ModifyTaskPriorityData |
| | | { |
| | | public List<ModifyTaskPriorityHeader> header { get; set; } |
| | | } |
| | | |
| | | public class ModifyTaskPriorityHeader |
| | | { |
| | | /// <summary> |
| | | /// ç»ç»ç¼å· - 主é®ï¼é»è®¤MERCURY |
| | | /// </summary> |
| | | public string organizationId { get; set; } = "MERCURY"; |
| | | |
| | | /// <summary> |
| | | /// ä»åºç¼å· - 主é®ï¼é»è®¤HN02 |
| | | /// </summary> |
| | | public string warehouseId { get; set; } = "HN02"; |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç»ç¼å· - ä¸»é® |
| | | /// </summary> |
| | | public string groupTaskId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç»åºå· - ä¸»é® |
| | | /// </summary> |
| | | public int groupTaskSequence { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¼å
级 - 1-5(1æé«) |
| | | /// </summary> |
| | | public string priority { get; set; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹ä»»å¡ä¼å
级ååº(æ¯æé¨åæå) |
| | | /// </summary> |
| | | public class ModifyTaskPriorityResponse |
| | | { |
| | | public ModifyTaskPriorityResponseData Response { get; set; } |
| | | } |
| | | |
| | | public class ModifyTaskPriorityResponseData |
| | | { |
| | | [JsonProperty("return")] |
| | | public ModifyTaskPriorityReturnInfo Return { get; set; } |
| | | } |
| | | |
| | | public class ModifyTaskPriorityReturnInfo : ReturnInfo |
| | | { |
| | | /// <summary> |
| | | /// é¨åæåæ¶çé误详æ
|
| | | /// </summary> |
| | | public List<TaskErrorInfo> resultInfo { get; set; } |
| | | } |
| | | |
| | | public class TaskErrorInfo |
| | | { |
| | | /// <summary> |
| | | /// ä»»å¡ç»ç¼å· |
| | | /// </summary> |
| | | public string groupTaskId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç»åºå· |
| | | /// </summary> |
| | | public int groupTaskSequence { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é误代ç |
| | | /// </summary> |
| | | public string errorCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é误åå |
| | | /// </summary> |
| | | public string errorDesc { get; set; } |
| | | } |
| | | } |
| | | public class putConveyorTask |
| | | { |
| | | /// <summary> |
| | | /// è¾éçº¿ä»»å¡æ¨éè¯·æ± |
| | | /// </summary> |
| | | public class PutConveyorTaskRequest |
| | | { |
| | | public PutConveyorTaskData data { get; set; } |
| | | } |
| | | |
| | | public class PutConveyorTaskData |
| | | { |
| | | public List<PutConveyorTaskHeader> header { get; set; } |
| | | } |
| | | |
| | | public class PutConveyorTaskHeader |
| | | { |
| | | /// <summary> |
| | | /// ç»ç»ç¼å· - 主é®ï¼é»è®¤MERCURY |
| | | /// </summary> |
| | | public string organizationId { get; set; } = "MERCURY"; |
| | | |
| | | /// <summary> |
| | | /// ä»åºç¼å· - 主é®ï¼é»è®¤HN02 |
| | | /// </summary> |
| | | public string warehouseId { get; set; } = "HN02"; |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç»ç¼å· - ä¸»é® |
| | | /// </summary> |
| | | public string groupTaskId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç»åºå· - ä¸»é® |
| | | /// </summary> |
| | | public int groupTaskSequence { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®±å· |
| | | /// </summary> |
| | | public string palletId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®±å - 大箱/å°ç®±/å¨è½¬ç®±ç¼ç |
| | | /// </summary> |
| | | public string palletIdType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è´´æ æ è®° - Y:éè¦è´´æ , N:ä¸éè¦ |
| | | /// </summary> |
| | | public string syncFlag { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ åºå/éå£ - ç©çä½ç½®éå£ç¼ç æB2C夿 ¸å°åºåç¼ç |
| | | /// </summary> |
| | | public string dLocation { get; set; } |
| | | |
| | | // ... UDF01-UDF10 |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è¾éçº¿ä»»å¡æ¨éååº(æ¯æé¨åæå) |
| | | /// </summary> |
| | | public class PutConveyorTaskResponse |
| | | { |
| | | public PutConveyorTaskResponseData Response { get; set; } |
| | | } |
| | | |
| | | public class PutConveyorTaskResponseData |
| | | { |
| | | [JsonProperty("return")] |
| | | public PutConveyorTaskReturnInfo Return { get; set; } |
| | | } |
| | | |
| | | public class PutConveyorTaskReturnInfo : ReturnInfo |
| | | { |
| | | /// <summary> |
| | | /// é¨åæåæ¶çé误详æ
|
| | | /// </summary> |
| | | public List<TaskErrorInfo> resultInfo { get; set; } |
| | | } |
| | | } |
| | | public class reportWeightinfo |
| | | { |
| | | public static Channel<ReportWeightInfoResponse> channel = Channel.CreateUnbounded<ReportWeightInfoResponse>(); |
| | | |
| | | internal static async Task<ReportWeightInfoReturnInfo> GetChinnnl() |
| | | { |
| | | //var response = await reportWeightinfo.channel.Reader.ReadAllAsync();// foreach (var response in reportWeightinfo.channel.Reader.ReadAllAsync()) |
| | | //{ |
| | | // return response?.Response?.Return ?? new ReportWeightInfoReturnInfo { ReturnCode = "0001", SortingChute = "0", ReturnDesc = "è¿å为空ã" }; |
| | | //} |
| | | while (await reportWeightinfo.channel.Reader.WaitToReadAsync(CancellationToken.None)) |
| | | { |
| | | while (reportWeightinfo.channel.Reader.TryRead(out var response)) |
| | | { |
| | | return response?.Response?.Return ?? new ReportWeightInfoReturnInfo { returnCode = "0001", sortingChute = "0", returnDesc = "è¿å为空ã" }; |
| | | } |
| | | } |
| | | return new ReportWeightInfoReturnInfo { returnCode = "0001", sortingChute = "0", returnDesc = "è¿å为空ã" }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 䏿¥ç§°éä¿¡æ¯è¯·æ± |
| | | /// </summary> |
| | | public class ReportWeightInfoRequest |
| | | { |
| | | public ReportWeightInfoData data { get; set; } |
| | | } |
| | | |
| | | public class ReportWeightInfoData |
| | | { |
| | | public ReportWeightInfoHeader header { get; set; } |
| | | } |
| | | |
| | | public class ReportWeightInfoHeader |
| | | { |
| | | /// <summary> |
| | | /// ç»ç»ç¼å· - 主é®ï¼é»è®¤MERCURY |
| | | /// </summary> |
| | | public string organizationId { get; set; } = "MERCURY"; |
| | | |
| | | /// <summary> |
| | | /// ä»åºç¼å· - 主é®ï¼é»è®¤HN02 |
| | | /// </summary> |
| | | public string warehouseId { get; set; } = "HN02"; |
| | | |
| | | /// <summary> |
| | | /// é¢åå· - ä¸»é® |
| | | /// </summary> |
| | | public string deliveryNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éé(kg) |
| | | /// </summary> |
| | | public decimal grossWeight { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä½ç§¯(ç«æ¹åç±³) |
| | | /// </summary> |
| | | public decimal cube { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建æ¶é´ |
| | | /// </summary> |
| | | public string addTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå»ºè®¾å¤ |
| | | /// </summary> |
| | | public string addWho { get; set; } |
| | | |
| | | // ... UDFåæ®µ |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 䏿¥ç§°éä¿¡æ¯ååº |
| | | /// </summary> |
| | | public class ReportWeightInfoResponse |
| | | { |
| | | public ReportWeightInfoResponseData Response { get; set; } |
| | | } |
| | | |
| | | public class ReportWeightInfoResponseData |
| | | { |
| | | [JsonProperty("return")] |
| | | public ReportWeightInfoReturnInfo Return { get; set; } |
| | | } |
| | | |
| | | public class ReportWeightInfoReturnInfo : ReturnInfo |
| | | { |
| | | /// <summary> |
| | | /// 忣éå£ - è¾é线快é忣éå£ç¼ç |
| | | /// </summary> |
| | | public string sortingChute { get; set; } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | #endregion [èªå®ä¹ç±»-VS][20250701112200484][AutoThread] |