From 5a9a4c4198ae354c0e6af4c13685d016b860e675 Mon Sep 17 00:00:00 2001 From: pengmn <pmn@HanInfo> Date: 星期五, 04 七月 2025 10:57:05 +0800 Subject: [PATCH] 1 --- HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/dispatch/GZRobot.cs | 55 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 49 insertions(+), 6 deletions(-) diff --git a/HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/dispatch/GZRobot.cs b/HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/dispatch/GZRobot.cs index c00c28a..658a6c6 100644 --- a/HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/dispatch/GZRobot.cs +++ b/HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/dispatch/GZRobot.cs @@ -1,10 +1,13 @@ 锘縰sing HH.WCS.XiaoMi.api; using HH.WCS.XiaoMi.core; +using HH.WCS.XiaoMi.LISTA.dispatch; using HH.WCS.XiaoMi.util; +using HH.WCS.XiaoMi.wms; using Newtonsoft.Json; using System; using System.Collections.Generic; using static HH.WCS.XiaoMi.api.ApiModel; +using static HH.WCS.XiaoMi.LISTA.dispatch.XMWcsHelper; namespace HH.WCS.XiaoMi.dispatch { @@ -209,14 +212,54 @@ /// </summary> /// <param name="model"></param> /// <returns></returns> - public static GzResult applyReroute(orderStatusReportParme model) + public static GzResult applyReroute(orderReroute model) { GzResult result = new GzResult(); - - result.resultCode = 0; - result.msg = "杩斿洖璁㈠崟鐘舵�鎴愬姛"; - result.orderID = model.orderID; - LogHelper.Info("orderStatusReport 杩斿洖" + JsonConvert.SerializeObject(result), "API"); + var wcsTask = WCSHelper.GetTask(model.orderName); + if (wcsTask == null) + { + result.resultCode = 1; + result.msg = "璁㈠崟涓嶅瓨鍦�"; + return result; + } + if (model.orderType == 1) + { + //1琛ㄧず鏄惁鐢宠缁曡矾 + var endLoc = LocationHelper.GetLoc(wcsTask.S_END_LOC); + if (endLoc.N_CURRENT_NUM == 0 && endLoc.S_LOCK_STATE == "鏃�) + { + result.resultCode = 0; + result.msg = "鐩爣璐т綅宸茬┖"; + return result; + } + else + { + result.resultCode = 1; + result.msg = "鐩爣璐т綅涓烘弧"; + return result; + } + } + else + { + //2琛ㄧず鐢宠鐩爣搴撲綅 + var apply = new ApplyModel() { wcsTaskCode = wcsTask.S_WORKSHOP_NO }; + var end = XMWcsHelper.GetPositionApply(apply); + if (!string.IsNullOrEmpty(end.body.pointCode)) + { + result.resultCode = 0; + result.msg = "鐩爣搴撲綅宸茬敵璇�; + result.orderData = end.body.pointCode; + return result; + } + else + { + result.resultCode = 1; + result.msg = "鐩爣搴撲綅宸茬敵璇�; + result.orderData = ""; + return result; + } + } + return result; } -- Gitblit v1.9.1