From 7d8f716f4bead12d27b54949846fc38ba993335b Mon Sep 17 00:00:00 2001 From: wanshenmean <cathay_xy@163.com> Date: 星期六, 12 四月 2025 19:43:36 +0800 Subject: [PATCH] 123 --- 代码管理/NEWCode/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGVJob/UpdateTaskAGV.cs | 42 +++++++++++++++++++++++++++++++++++++++++- 1 files changed, 41 insertions(+), 1 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGVJob/UpdateTaskAGV.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGVJob/UpdateTaskAGV.cs" index caf0630..157560b 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGVJob/UpdateTaskAGV.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGVJob/UpdateTaskAGV.cs" @@ -1,4 +1,5 @@ -锘縰sing WIDESEAWCS_Common.AGVEnum; +锘縰sing Newtonsoft.Json; +using WIDESEAWCS_Common.AGVEnum; using WIDESEAWCS_Common.TaskEnum; using WIDESEAWCS_ITaskInfoRepository; using WIDESEAWCS_Model.Models; @@ -176,6 +177,32 @@ plcClient.Communicator.Write(taskFbInteractive2, 1); //throw new Exception("浠诲姟鐘舵�佹洿鏀逛负4缁堢偣宸插畬鎴愬け璐�,浠诲姟ID:" + agvTask.agv_tasknum + DateTime.Now + ",浠诲姟鐘舵�佷笉鏄粓鐐规墽琛屼腑!"); } + if (agvTask.TargetAddress.Contains("HXWLX")) + { + if (agvTask.SourceAddress.Contains("KPHLX")) + { + // 绌虹洏绾胯繘鐑樼 + // TODO: 璋冪敤鍒涙櫤鎺ュ彛鑾峰彇瀹屾暣鏉$爜 + var materials = new List<BakingClass> + { + new BakingClass { BarCode = "1", MaterialType = "1" }, + }; + MESback WMSbackresult = MESAPIInvoke.BakingFeedingBinding(agvTask.TargetAddress, materials); + if (WMSbackresult.Code > 0) { new Exception(WMSbackresult.Message); return; } + } + else + { + // 鎻愬崌鏈鸿繘鐑樼 + // TODO: 璋冪敤鍒涙櫤鎺ュ彛鑾峰彇瀹屾暣鏉$爜 + var materials = new List<BakingClass> + { + new BakingClass { BarCode = "1", MaterialType = "1" }, + }; + MESback WMSbackresult = MESAPIInvoke.BakingFeedingBinding(agvTask.TargetAddress, materials); + if (WMSbackresult.Code > 0) { new Exception(WMSbackresult.Message); return; } + } + } + //agvtask_HtyRepository.AddTaskHistory(agvTask, OperateType.Finished.ToString()); _taskRepository.DeleteData(agvTask); @@ -385,4 +412,17 @@ } } } + + public class BakingFeedingClass + { + public string Devid { get; set; } + + public List<BakingClass> Materials { get; set; } + } + + public class BakingClass + { + public string MaterialType { get; set; } + public string BarCode { get; set; } + } } \ No newline at end of file -- Gitblit v1.9.3