From 04eed9fb0fdb0a4c09c482f78d4449f941cfaadb Mon Sep 17 00:00:00 2001
From: 海波 张 <2956280567@qq.com>
Date: 星期三, 14 五月 2025 17:24:06 +0800
Subject: [PATCH] 金坛bug修改

---
 dispatch/WcsTask.cs |   91 ++++++++++++++++-----------------------------
 1 files changed, 32 insertions(+), 59 deletions(-)

diff --git a/dispatch/WcsTask.cs b/dispatch/WcsTask.cs
index 89a5593..8ddd933 100644
--- a/dispatch/WcsTask.cs
+++ b/dispatch/WcsTask.cs
@@ -397,8 +397,8 @@
                         ContainerHelper.CreateCntrItem(rel);
 
 
-                    //娣诲姞鎵樼洏
-                    if (model.code == "1" || model.contNo == "99") {
+                    //娣诲姞鎵樼洏 寮傚父鎵樼洏涓嶆坊鍔�+                    if (!(model.code == "1" || model.contNo == "99")) {
                         Container cntr1 = new Container();
                         cntr1.S_CODE = model.contNo;
                         cntr1.C_ENABLE = "Y";
@@ -635,11 +635,12 @@
                                     TaskHelper.Fail(transportTask);
                                     TaskProcess.OperateStatus(transportTask, 7);
 
-                                    var agvTask = newDb.Queryable<WMSTask>().Where(e => e.S_CODE == transportTask.S_OP_CODE+"_1")?.First();
+                                    var agvTask = TaskHelper.GetTaskByWorkNo(transportTask.S_OP_CODE, "agv");
+
                                     if (agvTask == null)
                                     {
-                                        LogHelper.Info($"RFID鏍¢獙澶辫触锛屾病鎵惧埌瀵瑰簲{transportTask.S_OP_CODE+"_1"}浠诲姟", "Wcs浠诲姟鎵ц閫氱煡");
-                                        throw new Exception($"RFID鏍¢獙澶辫触,娌℃壘鍒板搴攞transportTask.S_OP_CODE + "_1"}浠诲姟");
+                                        LogHelper.Info($"RFID鏍¢獙澶辫触锛屾病鎵惧埌瀵瑰簲{transportTask.S_OP_CODE}鐨刟gv浠诲姟", "Wcs浠诲姟鎵ц閫氱煡");
+                                        throw new Exception($"RFID鏍¢獙澶辫触,娌℃壘鍒板搴攞transportTask.S_OP_CODE }鐨刟gv浠诲姟");
                                     }
                                     var workFlow = TaskHelper.selectWorkFlowByType(agvTask.N_TYPE.ToString(), agvTask.TOOLSTYPE);
                                   
@@ -695,7 +696,7 @@
                             TaskHelper.Fail(transportTask);
                             TaskProcess.OperateStatus(transportTask, 7);
                             LocationHelper.updateLocLock(transportTask.S_START_LOC, 4, "寮傚父閿�);
-                            var agvTask = TaskHelper.GetTask(transportTask.S_OP_CODE + "_1");
+                            var agvTask = TaskHelper.GetTaskByWorkNo(transportTask.S_OP_CODE, "agv");
                             if (agvTask!=null)
                             {
                                 TaskHelper.Fail(agvTask);
@@ -927,63 +928,35 @@
                 LogHelper.Info("鏌ヨ鍒板畨鍏ㄨ姹備俊鍙疯褰曡〃宸茬粡瀛樺湪鏁版嵁,姝ゆ淇″彿涓嶄笅杈剧粰绔嬪簱", "agv鎵ц閫氱煡");
                 return true;
             }
-
-            if (mst.S_TYPE.Contains("鍏ュ簱"))
+            switch (state)
             {
-                 Type = "2";
-                 bit = mst.S_END_LOC;
-                if (state == 1103)
-                {
-                    Meshod = "AgvRequest";
-                    bit = mst.S_END_LOC;
-                }
-                else if (state == 7)
-                {
-                    Type = "3";
-                    Meshod = "AgvRequestCancel";
-                }
-                else if (state == 4)
-                {
-                    //鐢宠鍑洪棬
-                    Type = "4";
-                    Meshod = "AgvRequest";
-                    bit = mst.S_END_LOC;
-                }
-                else
-                {
-                    Meshod = "Complete";
-                }
-            }
-            else if (mst.S_TYPE.Contains("鍑哄簱"))
-            {
-                Type = "1";
-                bit = mst.S_START_LOC;
-                if (state == 1101)
-                {
-                    Meshod = "AgvRequest";
-                }
-                else if (state == 7)
-                {
-                    Type = "3";
-                    Meshod = "AgvRequestCancel";
-                }
-                else if (state == 3)
-                {
-                    //鐢宠杩涢棬
-                    Type = "3";
-                    Meshod = "AgvRequest";
+                case 1101:
+                    Type = "1";
                     bit = mst.S_START_LOC;
-                }
-                else
-                {
+                    Meshod = "AgvRequest";
+                    break;
+                case 1102:
+                    Type = "1";
+                    bit = mst.S_START_LOC;
                     Meshod = "Complete";
-                }
+                    break;
+                case 1103:
+                    Type = "2";
+                    bit = mst.S_END_LOC;
+                    Meshod = "AgvRequest";
+                    break;
+                case 1104:
+                    Type = "5";
+                    bit = mst.S_END_LOC;
+                    Meshod = "Complete";
+                    break;
+                case 7:
+                    Type = "2";
+                    bit = "";
+                    Meshod = "AgvRequestCancel";
+                    break;
             }
-            else
-            {
-                LogHelper.Info("闄や簡鍑哄叆搴撳叾浣欎笉闇�瀹夊叏璇锋眰", "agv鎵ц閫氱煡");
-                return true;
-            }
+
 
 
 

--
Gitblit v1.9.1