From a8baebe7ac7d7e03ae833815e8d94b996dfd3b5e Mon Sep 17 00:00:00 2001
From: lss <Lss@HanInfo>
Date: 星期五, 16 五月 2025 17:23:15 +0800
Subject: [PATCH] 叠盘机流程开发与问题优化

---
 HH.WCS.Mobox3/HH.WCS.Mobox3.JiaTong/process/DeviceProcess.cs |   40 +++++++++++++++++++++++++++++++++++-----
 1 files changed, 35 insertions(+), 5 deletions(-)

diff --git a/HH.WCS.Mobox3/HH.WCS.Mobox3.JiaTong/process/DeviceProcess.cs b/HH.WCS.Mobox3/HH.WCS.Mobox3.JiaTong/process/DeviceProcess.cs
index 9d644c9..a153929 100644
--- a/HH.WCS.Mobox3/HH.WCS.Mobox3.JiaTong/process/DeviceProcess.cs
+++ b/HH.WCS.Mobox3/HH.WCS.Mobox3.JiaTong/process/DeviceProcess.cs
@@ -4,6 +4,7 @@
 using HH.WCS.JiaTong.util;
 using HH.WCS.JiaTong.wms;
 using Newtonsoft.Json;
+using S7.Net;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -31,7 +32,7 @@
                     {
                         if (data == "")
                         {
-                            Traystacker(plc);
+                            // Traystacker(plc);
                         }
                     }
                 }
@@ -45,13 +46,13 @@
         /// <summary>
         /// 鍙犵洏鏈虹┖鎵樿繑鍥�         /// </summary>    
-        internal static void Traystacker(Settings.deviceInfo device)
+        internal static void Traystacker(string loc, int qty)
         {
             try
             {
                 //涓婁紶鏁版嵁
                 Result<Traystacker> result1 = new Result<Traystacker>();
-                Traystacker traystacker = new Traystacker() { station = device.TN_Location[0], taskSource = 1, Qty = 7 };
+                Traystacker traystacker = new Traystacker() { station = loc, taskSource = 1, Qty = qty };
                 result1.data.Add(traystacker);
                 HttpHelper httpHelper = new HttpHelper();
                 Result result = new Result();
@@ -106,10 +107,39 @@
                     }
                 }
             }
-
-
         }
+        internal static void KjTraffic()
+        {
+           
 
+            var db = new SqlHelper<object>().GetInstance();
+            List<string> locs = new List<string>() { "PMDDW-001" };
+            var location = db.Queryable<Location>().Where(a => locs.Contains(a.S_CODE)).ToList();
+            if (location.Count > 0)
+            {
+                // string cntrcode = "";
+                foreach (var item in location)
+                {
+
+                    if (item.N_CURRENT_NUM >= 6)
+                    {
+                        //var cntr = db.Queryable<LocCntrRel>().Where(a => a.S_LOC_CODE.Trim() == item.S_CODE).ToList();
+                        //if (cntr.Count > 0)
+                        //{
+                        //    var cntrcodes = cntr.Select(a => a.S_CNTR_CODE).ToArray();
+                        //    cntrcode = string.Join(",", cntrcodes);
+                        //}
+
+                        //鍒涘缓杩囨湭瀹屾垚鐨勪换鍔′笉鍙戣捣璇锋眰
+                        var mst = WCSHelper.GetTaskByStartloc(item.S_CODE);
+                        if (mst == null)
+                        {
+                            Traystacker(item.S_CODE, item.N_CURRENT_NUM);
+                        }
+                    }
+                }
+            }
+        }
         /// <summary>
         /// 鍘熸潗鏂欏簱鎺ュ彛璁块棶
         /// </summary>    

--
Gitblit v1.9.1