From 885bd60ed54a0642c48c57a3d685cba24e4c763b Mon Sep 17 00:00:00 2001 From: huanghongfeng <huanghongfeng@hnkhzn.com> Date: 星期日, 08 十二月 2024 11:33:07 +0800 Subject: [PATCH] 1 --- 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 68 +++++++++++++++++++++++++++++++--- 1 files changed, 62 insertions(+), 6 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" index f4f4044..43decfc 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" @@ -46,9 +46,9 @@ using WIDESEAWCS_ITaskInfoRepository; using WIDESEAWCS_ITaskInfoService; using WIDESEAWCS_Model.Models; -using WIDESEAWCS_QuartzJob; using WIDESEAWCS_QuartzJob.Models; using WIDESEAWCS_QuartzJob.Service; +using static Microsoft.IO.RecyclableMemoryStreamManager; namespace WIDESEAWCS_TaskInfoService { @@ -88,6 +88,7 @@ public string urlQueryinventory = WIDESEAWCS_Core.Helper.AppSettings.Configuration["urlQueryinventory"]; public string urlEmptyOutbound = WIDESEAWCS_Core.Helper.AppSettings.Configuration["urlEmptyOutbound"]; public string urlRawmaterialout = WIDESEAWCS_Core.Helper.AppSettings.Configuration["urlRawmaterialout"]; + public string urlPalletQueryinventory = WIDESEAWCS_Core.Helper.AppSettings.Configuration["urlPalletQueryinventory"]; /// <summary> /// 鎺ユ敹WMS浠诲姟淇℃伅 /// </summary> @@ -108,6 +109,7 @@ Dt_Task task = _mapper.Map<Dt_Task>(item); task.TaskState = (int)TaskOutStatusEnum.OutNew; task.Roadway = task.Roadway == "1" ? task.Roadway = "SC01" : task.Roadway = "SC02"; + task.CreateDate = DateTime.Now; tasks.Add(task); } BaseDal.AddData(tasks); @@ -181,14 +183,38 @@ /// <returns></returns> public WebResponseContent ToPlatform(string palletCode) { - WebResponseContent content = new WebResponseContent(); + try + { + WebResponseContent content = new WebResponseContent(); + GenerateInv generate = new GenerateInv() + { + SourceAddress = "", + PalletCode = palletCode + }; + + return content = HttpHelper.Post<WebResponseContent>($"{urlQueryinventory}", generate); + } + catch (Exception ex) + { + + throw; + } + + /*WebResponseContent content = new WebResponseContent(); GenerateInv generate = new GenerateInv() { - SourceAddress ="", + SourceAddress = "", PalletCode = palletCode }; - - return content = HttpHelper.Post<WebResponseContent>($"{urlQueryinventory}", generate); + content = HttpHelper.Post<WebResponseContent>($"{urlQueryinventory}", generate); + if (content != null) + { + if (content.Status) + { + return content; + } + } + return content = WebResponseContent.Instance.Error();*/ } /// <summary> @@ -219,6 +245,10 @@ task.Roadway = task.Roadway == "1" ? task.Roadway = "SC01" : task.Roadway = "SC02"; BaseDal.AddData(task); return content = WebResponseContent.Instance.OK(); + } + else + { + WriteLog.GetLog("PLC鏃ュ織鍑哄簱鏃ュ織").Write($"绌烘墭鍑哄簱澶辫触锛岃鎯咃細{content.Message}", "闇�瑕佺┖鎵�"); } } return content = WebResponseContent.Instance.Error(); @@ -272,6 +302,20 @@ } } + + public WebResponseContent RequestWMSTask4() + { + WebResponseContent content = new WebResponseContent(); + try + { + + return content = HttpHelper.Get<WebResponseContent>($"{urlPalletQueryinventory}"); + } + catch (Exception ex) + { + return content = WebResponseContent.Instance.Error(ex.Message); + } + } /// <summary> /// 鏍规嵁娣卞簱浣嶅悜wms鐢宠鍒ゆ柇娴呭簱浣嶆槸鍚︽湁璐э紝鏄惁闇�瑕佽繘琛岀Щ搴撴搷浣� /// </summary> @@ -302,6 +346,10 @@ return task; } } + } + else + { + WriteLog.GetLog("PLC鏃ュ織").Write($"澶辫触淇℃伅锛歿content.Message}", "绉诲簱淇℃伅"); } } @@ -380,7 +428,15 @@ public Dt_Task IngStackerCraneTask2(string deviceNo) { //string deviceNot = deviceNo == "SC01" ? "1" : "2"; - return BaseDal.QueryFirst(x => x.Roadway == deviceNo && x.TaskState == (int)TaskOutStatusEnum.SC_OutExecuting); + try + { + return BaseDal.QueryFirst(x => x.Roadway == deviceNo && x.TaskState == (int)TaskOutStatusEnum.SC_OutExecuting); + } + catch (Exception ex) + { + + throw; + } } /// <summary> -- Gitblit v1.9.3