From 23c3e242d9cb182f6855d7af11334216f879e8a6 Mon Sep 17 00:00:00 2001
From: pengmn <pmn@HanInfo>
Date: 星期一, 07 七月 2025 10:56:57 +0800
Subject: [PATCH] 1

---
 HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/dispatch/GZRobot.cs |   71 +++++++++++++++++++++++++++++++++++
 1 files changed, 71 insertions(+), 0 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 04da739..5ea9fbd 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
 {
@@ -204,6 +207,74 @@
         }
 
 
+        /// <summary>
+        /// agv鐢宠缁曡矾
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        public static GzResult applyReroute(orderReroute model)
+        {
+            GzResult result = new GzResult();
+            try
+            {
+                var wcsTask = WCSHelper.GetTaskName(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.success = true;
+                        result.msg = "鐩爣璐т綅宸茬┖";
+                        return result;
+                    }
+                    else
+                    {
+                        result.resultCode = 1;
+                        result.success = false;
+                        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;
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                result.resultCode = 1;
+                result.success = false;
+                result.msg = $"agv鐢宠缁曡矾鍑虹幇閿欒{JsonConvert.SerializeObject(ex.Message)}";
+                return result;
+            }
+            
+        }
+
+
         ///// <summary>
         ///// 璋冪敤灏忕背鐘舵�鍥炴姤鎺ュ彛
         ///// </summary>

--
Gitblit v1.9.1