From 1e38f44af86775a341e4d0e4411d24ad35e417d3 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期五, 28 六月 2024 07:49:36 +0800
Subject: [PATCH] 调整平面图调用接口时间

---
 代码管理/PCS/WCS_Server/WIDESEA_WCS/Common/equipment/Wheel_info_trace.cs |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Common/equipment/Wheel_info_trace.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Common/equipment/Wheel_info_trace.cs"
index b9cc677..a1ab343 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Common/equipment/Wheel_info_trace.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Common/equipment/Wheel_info_trace.cs"
@@ -63,7 +63,7 @@
                         }
                     }
                     #region 鏇挎崲鑰丳CS鏃朵娇鐢�
-                    if (/*StackerDBItem.oi_on == 1*/true)
+                    if (StackerDBItem.oi_on == 1)
                     {
                         if (string.IsNullOrEmpty(StackerDBItem.o_wp_id)) throw new Exception($"{StackerDBItem.Name}锛歋N鍙蜂负绌�");
                         if (string.IsNullOrEmpty(StackerDBItem.o_online_time)) throw new Exception($"{StackerDBItem.Name}锛氫笂绾挎椂闂翠负绌�");
@@ -76,7 +76,7 @@
                         info.trace_status = "寰呭姞宸�";
                         info.trace_online_time = time;
                         info.trace_line_number = StackerDBItem.Name;
-                        var Work = workinfoRepository.Find(x => x.SN == info.trace_SN && x.processCode == "17").FirstOrDefault();
+                        var Work = workinfoRepository.Find(x => x.SN == info.trace_SN && x.processCode == "17").OrderByDescending(x => x.CreateTime).FirstOrDefault();
                         if (Work != null)
                         {
                             info.trace_workOrder = Work.workOrder;
@@ -87,7 +87,7 @@
                             info.trace_billetID = Work.billetID.ToString();
                         }
                         traceRepository.Add(info, true);
-                        //client.Write(key.FirstOrDefault(x => x.name == "oi_on").dbAddress, (byte)0);//淇″彿澶嶄綅
+                        client.Write(key.FirstOrDefault(x => x.name == "oi_on").dbAddress, (byte)0);//淇″彿澶嶄綅
                     }
                     #endregion
                 }
@@ -155,7 +155,7 @@
                         }
                     }
                     #region 鏇挎崲鑰丳CS鏃朵娇鐢�
-                    if (/*StackerDBItem.oi_on == 1*/true)
+                    if (StackerDBItem.oi_on == 1)
                     {
                         if (string.IsNullOrEmpty(StackerDBItem.o_wp_id)) throw new Exception($"{StackerDBItem.Name}锛歋N鍙蜂负绌�");
                         var info = traceRepository.Find(x => x.trace_SN == StackerDBItem.o_wp_id).FirstOrDefault();
@@ -172,7 +172,7 @@
                             info.trace_mach_number = StackerDBItem.Name;
                             traceRepository.Update(info, x => new { x.trace_mach_start_time, x.trace_mach_finish_time, x.trace_operator, x.trace_shift, x.trace_mach_statu, x.trace_process, x.trace_mach_number }, true);
                         }
-                        //client.Write(key.FirstOrDefault(x => x.name == "oi_on").dbAddress, (byte)0);//淇″彿澶嶄綅
+                        client.Write(key.FirstOrDefault(x => x.name == "oi_on").dbAddress, (byte)0);//淇″彿澶嶄綅
                     }
                     #endregion
                 }
@@ -228,7 +228,7 @@
                         }
                     }
                     #region 鏇挎崲鑰丳CS鏃朵娇鐢�
-                    if (/*StackerDBItem.oi_on == 1*/true)
+                    if (StackerDBItem.oi_on == 1)
                     {
                         if (string.IsNullOrEmpty(StackerDBItem.o_wp_id)) throw new Exception($"{StackerDBItem.Name}锛歋N鍙蜂负绌�");
                         var info = traceRepository.Find(x => x.trace_SN == StackerDBItem.o_wp_id).FirstOrDefault();
@@ -240,7 +240,7 @@
                             //info.trace_line_number = info.trace_line_number + StackerDBItem.Name;
                             traceRepository.Update(info, x => new { x.trace_offline_time, x.trace_direction }, true);
                         }
-                        //client.Write(key.FirstOrDefault(x => x.name == "oi_on").dbAddress, (byte)0);//淇″彿澶嶄綅
+                        client.Write(key.FirstOrDefault(x => x.name == "oi_on").dbAddress, (byte)0);//淇″彿澶嶄綅
                     }
                     #endregion
                 }

--
Gitblit v1.9.3