From 5cb28a17ca74fc0fbb07e25af0c3554951e4c2d9 Mon Sep 17 00:00:00 2001
From: czw <selecti@yeah.net>
Date: 星期三, 25 六月 2025 10:46:16 +0800
Subject: [PATCH] 1

---
 2025年6月12日/AuxAllWCS/Build/Project/代码/自定义类.cs |   32 ++++++++++++++++++++++++--------
 1 files changed, 24 insertions(+), 8 deletions(-)

diff --git "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/\350\207\252\345\256\232\344\271\211\347\261\273.cs" "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/\350\207\252\345\256\232\344\271\211\347\261\273.cs"
index 12fbd70..806003e 100644
--- "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/\350\207\252\345\256\232\344\271\211\347\261\273.cs"
+++ "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/\350\207\252\345\256\232\344\271\211\347\261\273.cs"
@@ -563,7 +563,7 @@
         internal static bool CreateTask(string no, string from, string to, string taskType, int pri, List<string> cntrs, string workMode = "AGV", int cntrCount = 1, int startLayer = 1, int endLayer = 1)
         {
 
-            LogHelper.Info($"杈撻�绾縍GV绌烘墭浠诲姟 from:{from}>to {to}寮�鍒涘缓>");
+            LogHelper.Info($"鍒涘缓浠诲姟 from:{from}>to {to}寮�鍒涘缓>");
             var cntrInfo = string.Join(",", cntrs);
             ILocRepository locc = new LocRepository();
             var fromLoc = locc.FindEntity(x => x.S_LOC_CODE == from);
@@ -571,10 +571,14 @@
 
             var s = Settings.deviceInfos.Find(x => x.location.Contains(from)) != null;
             var e = Settings.deviceInfos.Find(x => x.location.Contains(to)) != null;
-            string t = "F01";
-            if (s && !e) t = "A002";
-            if (!s && e) t = "A003";
-            if (s && e) t = "A004";
+            string t = "";
+            if (workMode == "AGV")
+            {
+                t = "F01";
+                if (s && !e) t = "A002";
+                if (!s && e) t = "A003";
+                if (s && e) t = "A004";
+            }
             try
             {
 
@@ -613,7 +617,7 @@
                     locc.Update(endLoc);
                 }
 
-                LogHelper.Info($"杈撻�绾縍GV绌烘墭浠诲姟 from:{from}>to {to} 鍒涘缓{wmsTask.S_TASK_NO}鎴愬姛");
+                LogHelper.Info($"鍒涘缓浠诲姟 from:{from}>to {to} 鍒涘缓{wmsTask.S_TASK_NO}鎴愬姛");
                 return true;
             }
             catch (Exception ex)
@@ -693,7 +697,7 @@
                         S_DEPART_NAME = "",
                         S_START_LOC = model.startBit,
                         S_END_LOC = model.endBit,
-                        S_TYPE = model.reqCode,
+                        S_TYPE = model.taskType,
                         S_SRC_NO = "",//
                         N_PRIORITY = -88,
                         S_WORK_MODE = "agv",
@@ -768,13 +772,19 @@
             //if (VERXs.Any())
             foreach (var task in tasks)
             {
+                LogHelper.Info($"瑙i噴MES浠诲姟 ->{task.S_TASK_NO} ");
                 var sx = VERXs?.Find(x => x.location.Contains(task.S_END_LOC));
+                LogHelper.Info($"瑙i噴MES浠诲姟 ->{task.S_TASK_NO} {(sx == null ? "闈� : "鏄�)}鎬昏鏈哄櫒浜轰换鍔�);
                 if (sx == null)
                 {
+                    LogHelper.Info($"瑙i噴MES浠诲姟 ->{task.S_TASK_NO} 鐩存帴鐢熸垚瀵瑰簲浠诲姟");
                     //鐩存帴鐢熸垚瀵瑰簲浠诲姟銆�-                    var res = TaskProcess.CreateTask(task.S_TASK_NO, task.S_START_LOC, task.S_END_LOC, task.S_TYPE, 6, task.S_CNTRS.Split(',').ToList());
+                    var res = TaskProcess.CreateTask(task.S_TASK_NO, task.S_START_LOC, task.S_END_LOC, task.S_TYPE, 6, task.S_CNTRS?.Split(',').ToList() ?? new List<string>());
+
+                    LogHelper.Info($"瑙i噴MES浠诲姟 ->{task.S_TASK_NO} 鐩存帴鐢熸垚瀵瑰簲浠诲姟 缁撴灉锛歿res}");
                     if (res)
                     {
+                        LogHelper.Info($"瑙i噴MES浠诲姟 ->{task.S_TASK_NO} 淇敼鏍囪瘑");
                         //task.N_PRIORITY = 0;
                         taskservice.dbcontext.Set<TaskEntity>().Attach(task);
                         taskservice.dbcontext.Entry(task).Property(x => x.N_PRIORITY).CurrentValue = 0;
@@ -788,6 +798,8 @@
                     LocRepository locRepository = new LocRepository();
                     //鐢熸垚璺宠穬浠诲姟銆� -- 鎵樼洏璐т綅琛ㄣ� 
                     var t1s = taskservice.FindList(x => x.S_SRC_NO == task.S_TASK_NO);
+
+                    LogHelper.Info($"瑙i噴MES浠诲姟 ->{task.S_TASK_NO} 鏌ユ壘鏄惁鏈夊凡鐢熸垚浠诲姟锛歿t1s != null}");
                     if (t1s.Any())
                     {
                         var t1 = t1s.OrderBy(x => x.T_CREATE).LastOrDefault();
@@ -857,6 +869,7 @@
                     }
                     else
                     {
+                        LogHelper.Info($"瑙i噴MES浠诲姟 ->{task.S_TASK_NO} 绛涢�鐢熸垚绗竴娈�浠诲姟銆�);
                         //鐢熸垚绗竴娈点�
                         LocEntity endLoc = null;
                         var di = sx;
@@ -873,7 +886,10 @@
                             }
                             if (endLoc != null)
                             {
+                                LogHelper.Info($"瑙i噴MES浠诲姟 ->{task.S_TASK_NO} 鍒涘缓绗竴娈�浠诲姟銆�);
                                 var res = TaskProcess.CreateTask("", task.S_START_LOC, endLoc.S_LOC_CODE, task.S_TYPE + "婊¤浆", 8, task.S_CNTRS.Split(',').ToList());
+
+                                LogHelper.Info($"瑙i噴MES浠诲姟 ->{task.S_TASK_NO} 鍒涘缓绗竴娈�浠诲姟銆傜粨鏋滐細{res}");
                                 if (res)
                                 {
                                     task.N_PRIORITY = 0; taskservice.Update(task);

--
Gitblit v1.9.1