| | |
| | | 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) |
| | | { |
| | | |
| | | LogHelper.Info("<<<<<<<<<<<<<<<<<<<....Running....>>>>>>>>>>>>>>>"); |
| | | } |
| | | |
| | | public async void ThreadwebSoc() |
| | | { |
| | | List<object> list = new List<object>(); |
| | | //read Alldata from database |
| | | //å°æ°æ®ç¼åå°å
åã |
| | | try |
| | |
| | | { |
| | | Thread.Sleep(1000); |
| | | Console.WriteLine($"{DateTime.Now.ToString("HH:mm:ss.fff")}>>>GGG{i}"); |
| | | LogHelper.Info($"{DateTime.Now.ToString("HH:mm:ss.fff")}>>>GGG{i}"); |
| | | var b = WebSocketClientWithReconnect.Instance?.SendAsync($"He >>GGG{i}").Result; |
| | | Console.WriteLine("åé宿ï¼ï¼" + b); |
| | | } |
| | |
| | | //new TcpServer(ip.ToString()); |
| | | //var server = new EnhancedWebSocketServer($"http://{ip.ToString()}:8809/").StartAsync(); |
| | | new WebSocketClientWithReconnect($"ws://{ip.ToString()}:8809/socket").StartAsync(); |
| | | |
| | | WebSocketClientWithReconnect.Instance.OnMessageReceived += (msg) => |
| | | { |
| | | reportWeightinfo.channel.Writer.TryWrite(JsonConvert.DeserializeObject<ReportWeightInfoResponse>(msg)); |
| | | }; |
| | | break; |
| | | } |
| | | } |
| | |
| | | } |
| | | public class HttpServer |
| | | { |
| | | public static readonly HttpHelper apiHelper = new HttpHelper(); |
| | | System.Net.HttpListener HttpSvcHost = null; |
| | | |
| | | public static string _listenerPrefix = ""; |
| | |
| | | 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 |
| | |
| | | case "/api/Wcs/sendTask": |
| | | { |
| | | statusCode = System.Net.HttpStatusCode.OK; |
| | | |
| | | return JsonConvert.SerializeObject(""); |
| | | var req = JsonConvert.DeserializeObject<SendTaskRequest>(requestJson); |
| | | if (lstr.Find(x => x.PalletId == req.Data.Header.PalletId) != null) |
| | | return JsonConvert.SerializeObject(new SendTaskResponse |
| | | { |
| | | Response = new ResponseData |
| | | { |
| | | Return = new ReturnInfo |
| | | { |
| | | ReturnCode = "0001", |
| | | ReturnDesc = "æçéå¤ä¸åï¼ï¼ï¼", |
| | | ReturnFlag = "0" |
| | | } |
| | | } |
| | | }); |
| | | 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; |
| | | |
| | | return JsonConvert.SerializeObject(""); |
| | | var f = lstr.FirstOrDefault(); |
| | | var str = apiHelper.Post("mom-basic/dataTransmission/json/service/202", 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, |
| | | AddWho = f.AddWho, |
| | | Reason = "åºä½æè´§ä¸å¯ç¨", |
| | | ReasonCode = "01" |
| | | } |
| | | } |
| | | })); |
| | | return str; |
| | | } |
| | | ///ä»»å¡ç¶æåé¦ WCS-->WM |
| | | case "/api/Wcs/taskFeedback": |
| | | { |
| | | statusCode = System.Net.HttpStatusCode.OK; |
| | | foreach (var statu in new List<string> { "", "" }) |
| | | { |
| | | |
| | | var f = lstr.FirstOrDefault(); |
| | | var str = apiHelper.Post("mom-basic/dataTransmission/json/service/202", 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, |
| | | CloseWho = f.AddWho |
| | | } |
| | | } |
| | | })); |
| | | } |
| | | return JsonConvert.SerializeObject(""); |
| | | } |
| | | ///å
¥åºäº¤äº ãWCS-->WMS |
| | | case "/api/Wcs/stockInInteraction": |
| | | { |
| | | statusCode = System.Net.HttpStatusCode.OK; |
| | | |
| | | return JsonConvert.SerializeObject(""); |
| | | var str = apiHelper.Post("mom-basic/dataTransmission/json/service/202", JsonConvert.SerializeObject(new StockInInteractionRequest |
| | | { |
| | | Data = new StockInInteractionData |
| | | { |
| | | Header = new StockInInteractionHeader |
| | | { |
| | | PalletId = "TP9901", |
| | | GrossWeight = 99, |
| | | PalletWidth = 99, |
| | | FmLocation = "", |
| | | FmPosition = "", |
| | | AddTime = DateTime.Now, |
| | | AddWho = "" |
| | | } |
| | | } |
| | | })); |
| | | return str; |
| | | } |
| | | |
| | | ///ä»»å¡åæ¶ã 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("mom-basic/dataTransmission/json/service/202", JsonConvert.SerializeObject(new PalletStackerInteractionRequest |
| | | { |
| | | Data = new PalletStackerInteractionData |
| | | { |
| | | Header = new PalletStackerInteractionHeader |
| | | { |
| | | PalletId = "TP9901", |
| | | TaskId = $"X{DateTime.Now.ToString("yyyy-MM-dd")}001", |
| | | TaskType = "PI", |
| | | FmLocation = "2FC1076", |
| | | AddTime = DateTime.Now, |
| | | 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" |
| | | } |
| | | } |
| | | }); |
| | | 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, |
| | | 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 |
| | | { |
| | | //public static List<object> SendList = new List<object>(); |
| | | |
| | | public static ClientWebSocket _webSocket; |
| | | private static WebSocketClientWithReconnect _instance; |
| | | private readonly Uri _serverUri; |
| | |
| | | |
| | | var bytes = System.Text.Encoding.UTF8.GetBytes(message); |
| | | await _webSocket.SendAsync(new ArraySegment<byte>(bytes), WebSocketMessageType.Text, true, _cts.Token); |
| | | return true; |
| | | 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 |
| | | { |
| | | 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 DateTime 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 |
| | | { |
| | | 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 DateTime 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 |
| | | { |
| | | 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 DateTime 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 |
| | | { |
| | | 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 |
| | | { |
| | | 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 DateTime AddTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå»ºè®¾å¤ |
| | | /// </summary> |
| | | public string AddWho { get; set; } |
| | | |
| | | // ... UDFåæ®µ |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 䏿¥ç§°éä¿¡æ¯ååº |
| | | /// </summary> |
| | | public class ReportWeightInfoResponse |
| | | { |
| | | public ReportWeightInfoResponseData Response { get; set; } |
| | | } |
| | | |
| | | public class ReportWeightInfoResponseData |
| | | { |
| | | public ReportWeightInfoReturnInfo Return { get; set; } |
| | | } |
| | | |
| | | public class ReportWeightInfoReturnInfo : ReturnInfo |
| | | { |
| | | /// <summary> |
| | | /// 忣éå£ - è¾é线快é忣éå£ç¼ç |
| | | /// </summary> |
| | | public string SortingChute { get; set; } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | #endregion [èªå®ä¹ç±»-VS][20250701112200484][AutoThread] |