From 46f7bf1ee45c97b688a370bbe45d149efb403cc1 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期二, 07 五月 2024 17:26:18 +0800
Subject: [PATCH] 检测上料逻辑修改,无有料货位时写入不允许桁架进入信号

---
 代码管理/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs |  109 ++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 76 insertions(+), 33 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs"
index c5d9223..e5df10a 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs"
@@ -34,6 +34,7 @@
         /// <param name="client"></param>
         public void QueryWheeldata(PLCClient client)
         {
+            string namea = "";
             try
             {
                 VOLContext Context = new VOLContext();
@@ -48,6 +49,7 @@
                 List<string> names = new List<string>() { "1鍗曞厓杈婇亾涓嬫枡鏌ヨ杞﹁疆", "2鍗曞厓杈婇亾涓嬫枡鏌ヨ杞﹁疆", "3鍗曞厓杈婇亾涓嬫枡鏌ヨ杞﹁疆", "杈婇亾涓婃枡鏌ヨ杞﹁疆" };
                 foreach (string name in names)
                 {
+                    namea = name;
                     var details = plcRepository.Find(x => x.plcdetail_iotype == plc.plcinfo_iotyep && x.plcdetail_number == name).ToList();
                     var on = DBExtension.Read(details.Where(x => x.plcdetail_name == "R_oi_on").First(), client);
                     if ((byte)on == 1)
@@ -66,7 +68,8 @@
                             client.WriteByOrder("W_i_status", (byte)2, name);
                             client.WriteByOrder("R_oi_on", (byte)0, name);
                             #region 鏃ュ織璁板綍
-                            WriteDBLog.Error(name, $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿wp_id}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�2\nR_oi_on锛�0\n\n鏈煡璇㈠埌宸ュ崟淇℃伅", "PCS");
+                            //WriteDBLog.Error(name, $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿wp_id}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�2\nR_oi_on锛�0\n\n鏈煡璇㈠埌宸ュ崟淇℃伅", "PCS");
+                            WriteLog.Write_Log(name, wp_id, "閿欒淇℃伅锛�", $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿wp_id}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�2\nR_oi_on锛�0\n\n鏈煡璇㈠埌宸ュ崟淇℃伅");
                             #endregion
                             continue;
                         }
@@ -107,7 +110,8 @@
                                 client.WriteByOrder("W_i_status", (byte)2, name);
                                 client.WriteByOrder("R_oi_on", (byte)0, name);
                                 #region 鏃ュ織璁板綍
-                                WriteDBLog.Error(name, $"璇诲彇妗佹灦淇℃伅锛歕n杞瀷ID锛歿wp_type}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�2\nR_oi_on锛�0\n\n鏈煡璇㈠埌鏈哄姞宸ヨ溅杞俊鎭�", "PCS");
+                                //WriteDBLog.Error(name, $"璇诲彇妗佹灦淇℃伅锛歕n杞瀷ID锛歿wp_type}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�2\nR_oi_on锛�0\n\n鏈煡璇㈠埌鏈哄姞宸ヨ溅杞俊鎭�", "PCS");
+                                WriteLog.Write_Log(name, wp_id, "閿欒淇℃伅锛�", $"璇诲彇妗佹灦淇℃伅锛歕n杞瀷ID锛歿wp_type}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�2\nR_oi_on锛�0\n\n鏈煡璇㈠埌鏈哄姞宸ヨ溅杞俊鎭�");
                                 #endregion
                             }
                             else
@@ -124,7 +128,17 @@
                                 client.WriteByOrder("W_i_parameter_h", geometry == null ? (float)geometry1.h : (float)geometry.h, name);
                                 client.WriteByOrder("R_oi_on", (byte)0, name);
                                 #region 鏃ュ織璁板綍
-                                WriteDBLog.Success(name, $"璇诲彇妗佹灦淇℃伅锛歕n杞瀷ID锛歿wp_type}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�1" + $"\n" +
+                                //WriteDBLog.Success(name, $"璇诲彇妗佹灦淇℃伅锛歕n杞瀷ID锛歿wp_type}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�1" + $"\n" +
+                                //    $"a锛歿(geometry == null ? (float)geometry1.a : (float)geometry.a)}\n" +
+                                //    $"b锛歿(geometry == null ? (float)geometry1.b : (float)geometry.b)}\n" +
+                                //    $"c锛歿(geometry == null ? (float)geometry1.c : (float)geometry.c)}\n" +
+                                //    $"d锛歿(geometry == null ? (float)geometry1.d : (float)geometry.d)}\n" +
+                                //    $"e锛歿(geometry == null ? (float)geometry1.e : (float)geometry.e)}\n" +
+                                //    $"f锛歿(geometry == null ? (float)geometry1.f : (float)geometry.f)}\n" +
+                                //    $"g锛歿(geometry == null ? (float)geometry1.g : (float)geometry.g)}\n" +
+                                //    $"h锛歿(geometry == null ? (float)geometry1.h : (float)geometry.h)}\n" +
+                                //    $"R_oi_on锛�0", "PCS");
+                                WriteLog.Write_Log(name, wp_id, "鍐欏叆淇℃伅锛�", $"璇诲彇妗佹灦淇℃伅锛歕n杞瀷ID锛歿wp_type}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�1" + $"\n" +
                                     $"a锛歿(geometry == null ? (float)geometry1.a : (float)geometry.a)}\n" +
                                     $"b锛歿(geometry == null ? (float)geometry1.b : (float)geometry.b)}\n" +
                                     $"c锛歿(geometry == null ? (float)geometry1.c : (float)geometry.c)}\n" +
@@ -133,7 +147,7 @@
                                     $"f锛歿(geometry == null ? (float)geometry1.f : (float)geometry.f)}\n" +
                                     $"g锛歿(geometry == null ? (float)geometry1.g : (float)geometry.g)}\n" +
                                     $"h锛歿(geometry == null ? (float)geometry1.h : (float)geometry.h)}\n" +
-                                    $"R_oi_on锛�0", "PCS");
+                                    $"R_oi_on锛�0");
                                 #endregion
                             }
                         }
@@ -146,7 +160,8 @@
                                 client.WriteByOrder("W_i_status", (byte)2, name);
                                 client.WriteByOrder("R_oi_on", (byte)0, name);
                                 #region 鏃ュ織璁板綍
-                                WriteDBLog.Error(name, $"璇诲彇妗佹灦淇℃伅锛歕n杞瀷ID锛歿wp_type}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�2\nR_oi_on锛�0\n\n鏈煡璇㈠埌妫�娴嬬嚎杞﹁疆淇℃伅", "PCS");
+                                //WriteDBLog.Error(name, $"璇诲彇妗佹灦淇℃伅锛歕n杞瀷ID锛歿wp_type}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�2\nR_oi_on锛�0\n\n鏈煡璇㈠埌妫�娴嬬嚎杞﹁疆淇℃伅", "PCS");
+                                WriteLog.Write_Log(name, wp_id, "閿欒淇℃伅锛�", $"璇诲彇妗佹灦淇℃伅锛歕n杞瀷ID锛歿wp_type}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�2\nR_oi_on锛�0\n\n鏈煡璇㈠埌妫�娴嬬嚎杞﹁疆淇℃伅");
                                 #endregion
                             }
                             else
@@ -162,7 +177,17 @@
                                 client.WriteByOrder("W_i_parameter_h", geometry == null ? (float)geometry1.h : (float)geometry.h, name);
                                 client.WriteByOrder("R_oi_on", (byte)0, name);
                                 #region 鏃ュ織璁板綍
-                                WriteDBLog.Success(name, $"璇诲彇妗佹灦淇℃伅锛歕n杞瀷ID锛歿wp_type}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�1" + $"\n" +
+                                //WriteDBLog.Success(name, $"璇诲彇妗佹灦淇℃伅锛歕n杞瀷ID锛歿wp_type}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�1" + $"\n" +
+                                //    $"a锛歿(geometry == null ? (float)geometry1.a : (float)geometry.a)}\n" +
+                                //    $"b锛歿(geometry == null ? (float)geometry1.b : (float)geometry.b)}\n" +
+                                //    $"c锛歿(geometry == null ? (float)geometry1.c : (float)geometry.c)}\n" +
+                                //    $"d锛歿(geometry == null ? (float)geometry1.d : (float)geometry.d)}\n" +
+                                //    $"e锛歿(geometry == null ? (float)geometry1.e : (float)geometry.e)}\n" +
+                                //    $"f锛歿(geometry == null ? (float)geometry1.f : (float)geometry.f)}\n" +
+                                //    $"g锛歿(geometry == null ? (float)geometry1.g : (float)geometry.g)}\n" +
+                                //    $"h锛歿(geometry == null ? (float)geometry1.h : (float)geometry.h)}\n" +
+                                //    $"R_oi_on锛�0", "PCS");
+                                WriteLog.Write_Log(name, wp_id, "鍐欏叆淇℃伅锛�", $"璇诲彇妗佹灦淇℃伅锛歕n杞瀷ID锛歿wp_type}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�1" + $"\n" +
                                     $"a锛歿(geometry == null ? (float)geometry1.a : (float)geometry.a)}\n" +
                                     $"b锛歿(geometry == null ? (float)geometry1.b : (float)geometry.b)}\n" +
                                     $"c锛歿(geometry == null ? (float)geometry1.c : (float)geometry.c)}\n" +
@@ -171,7 +196,7 @@
                                     $"f锛歿(geometry == null ? (float)geometry1.f : (float)geometry.f)}\n" +
                                     $"g锛歿(geometry == null ? (float)geometry1.g : (float)geometry.g)}\n" +
                                     $"h锛歿(geometry == null ? (float)geometry1.h : (float)geometry.h)}\n" +
-                                    $"R_oi_on锛�0", "PCS");
+                                    $"R_oi_on锛�0");
                                 #endregion
                             }
                         }
@@ -181,7 +206,8 @@
             }
             catch (Exception ex)
             {
-                WriteDBLog.Error("鏌ヨ杞﹁疆鏁版嵁", $"閿欒淇℃伅锛歿ex.Message}", "PCS");
+                //WriteDBLog.Error("鏌ヨ杞﹁疆鏁版嵁", $"閿欒淇℃伅锛歿ex.Message}", "PCS");
+                WriteLog.Write_Log("鎶ラ敊鏃ュ織", namea, "閿欒淇℃伅锛�", $"閿欒淇℃伅锛歿ex.Message}");
             }
         }
         #endregion
@@ -193,6 +219,7 @@
         /// <param name="client"></param>
         public void QueryOrder(PLCClient client)
         {
+            string namea = "";
             try
             {
                 VOLContext Context = new VOLContext();
@@ -208,6 +235,7 @@
                 List<string> names = new List<string>() { "1鍗曞厓杈婇亾涓嬫枡鏌ヨ璁㈠崟", "2鍗曞厓杈婇亾涓嬫枡鏌ヨ璁㈠崟", "3鍗曞厓杈婇亾涓嬫枡鏌ヨ璁㈠崟", "杈婇亾涓婃枡鏌ヨ璁㈠崟" };
                 foreach (string name in names)
                 {
+                    namea = name;
                     var details = plcRepository.Find(x => x.plcdetail_iotype == plc.plcinfo_iotyep && x.plcdetail_number == name).ToList();
                     var on = DBExtension.Read(details.Where(x => x.plcdetail_name == "R_oi_on").First(), client);
                     //var on = DBExtension.Read(details.Where(x => x.plcdetail_name == "R_oi_on" && x.plcdetail_number == name).First(), client);
@@ -217,10 +245,11 @@
                         var wp_id = client.ReadByOrder<string>("R_o_wp_id", name);
                         if (string.IsNullOrEmpty(wp_id))
                         {
-                            #region 鏃ュ織璁板綍
                             client.WriteByOrder("W_i_status", (byte)2, name);
                             client.WriteByOrder("R_oi_on", (byte)0, name);
-                            WriteDBLog.Error(name, $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿wp_id}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�2\nR_oi_on锛�0\n\n杞﹁疆SN鍙蜂负绌�", "PCS");
+                            #region 鏃ュ織璁板綍
+                            //WriteDBLog.Error(name, $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿wp_id}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�2\nR_oi_on锛�0\n\n杞﹁疆SN鍙蜂负绌�", "PCS");
+                            WriteLog.Write_Log(name, wp_id, "閿欒淇℃伅锛�", $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿wp_id}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�2\nR_oi_on锛�0\n\n杞﹁疆SN鍙蜂负绌�");
                             #endregion
                             continue;
                         }
@@ -232,7 +261,8 @@
                             client.WriteByOrder("W_i_status", (byte)2, name);
                             client.WriteByOrder("R_oi_on", (byte)0, name);
                             #region 鏃ュ織璁板綍
-                            WriteDBLog.Error(name, $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿wp_id}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�2\nR_oi_on锛�0\n\n鏈煡璇㈠埌宸ュ崟璇︽儏", "PCS");
+                            //WriteDBLog.Error(name, $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿wp_id}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�2\nR_oi_on锛�0\n\n鏈煡璇㈠埌宸ュ崟璇︽儏", "PCS");
+                            WriteLog.Write_Log(name, wp_id, "閿欒淇℃伅锛�", $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿wp_id}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�2\nR_oi_on锛�0\n\n鏈煡璇㈠埌宸ュ崟璇︽儏");
                             #endregion
                             continue;
                         }
@@ -270,7 +300,8 @@
                                 client.WriteByOrder("W_i_status", (byte)4, name);
                                 client.WriteByOrder("R_oi_on", (byte)0, name);
                                 #region 鏃ュ織璁板綍
-                                WriteDBLog.Error(name, $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿wp_id}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�4\nR_oi_on锛�0\n\n鎵嬪姩鍏ュ簱妯″紡鏈�夋嫨搴撳尯", "PCS");
+                                //WriteDBLog.Error(name, $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿wp_id}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�4\nR_oi_on锛�0\n\n鎵嬪姩鍏ュ簱妯″紡鏈�夋嫨搴撳尯", "PCS");
+                                WriteLog.Write_Log(name, wp_id, "閿欒淇℃伅锛�", $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿wp_id}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�4\nR_oi_on锛�0\n\n鎵嬪姩鍏ュ簱妯″紡鏈�夋嫨搴撳尯");
                                 #endregion
                                 continue;
                             }
@@ -283,7 +314,8 @@
                                 client.WriteByOrder("W_i_status", (byte)2, name);
                                 client.WriteByOrder("R_oi_on", (byte)0, name);
                                 #region 鏃ュ織璁板綍
-                                WriteDBLog.Error(name, $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿wp_id}\n杞瀷ID锛歿wp_type}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�2\nR_oi_on锛�0\n\n鏈煡璇㈠埌鏈哄姞宸ヨ溅杞俊鎭�", "PCS");
+                                //WriteDBLog.Error(name, $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿wp_id}\n杞瀷ID锛歿wp_type}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�2\nR_oi_on锛�0\n\n鏈煡璇㈠埌鏈哄姞宸ヨ溅杞俊鎭�", "PCS");
+                                WriteLog.Write_Log(name, wp_id, "閿欒淇℃伅锛�", $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿wp_id}\n杞瀷ID锛歿wp_type}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�2\nR_oi_on锛�0\n\n鏈煡璇㈠埌鏈哄姞宸ヨ溅杞俊鎭�");
                                 #endregion
                                 continue;
                             }
@@ -306,10 +338,14 @@
                                 //}
                                 client.WriteByOrder("R_oi_on", (byte)0, name);
                                 #region 鏃ュ織璁板綍
-                                WriteDBLog.Success(name, $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿wp_id}\n杞瀷ID锛歿wp_type}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�1" +
+                                WriteLog.Write_Log(name, wp_id, "鍐欏叆淇℃伅锛�", $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿wp_id}\n杞瀷ID锛歿wp_type}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�1" +
                                     $"\nW_i_job_id锛歿Mes_Work.jobID}\nW_i_drawing_id锛歿Mes_Work.drawingNo}\nW_i_heat_id锛歿Mes_Work.heatID}\nW_i_batch_id锛歿Mes_Work.heatBatchID}" +
                                     $"\nW_i_skip_op_SJ1锛歿(name == "3鍗曞厓杈婇亾涓嬫枡鏌ヨ璁㈠崟" ? true : mes_Head.skip_op_1)}\nW_i_skip_op_SJ2锛歿(name == "3鍗曞厓杈婇亾涓嬫枡鏌ヨ璁㈠崟" ? true : mes_Head.skip_op_2)}" +
-                                    $"\nW_i_skip_op_LT锛歿mes_Head.skip_op_3}\nR_oi_on锛�0", "PCS");
+                                    $"\nW_i_skip_op_LT锛歿mes_Head.skip_op_3}\nR_oi_on锛�0");
+                                //WriteDBLog.Success(name, $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿wp_id}\n杞瀷ID锛歿wp_type}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�1" +
+                                //    $"\nW_i_job_id锛歿Mes_Work.jobID}\nW_i_drawing_id锛歿Mes_Work.drawingNo}\nW_i_heat_id锛歿Mes_Work.heatID}\nW_i_batch_id锛歿Mes_Work.heatBatchID}" +
+                                //    $"\nW_i_skip_op_SJ1锛歿(name == "3鍗曞厓杈婇亾涓嬫枡鏌ヨ璁㈠崟" ? true : mes_Head.skip_op_1)}\nW_i_skip_op_SJ2锛歿(name == "3鍗曞厓杈婇亾涓嬫枡鏌ヨ璁㈠崟" ? true : mes_Head.skip_op_2)}" +
+                                //    $"\nW_i_skip_op_LT锛歿mes_Head.skip_op_3}\nR_oi_on锛�0", "PCS");
                                 #endregion
                             }
                         }
@@ -323,7 +359,8 @@
                                 client.WriteByOrder("W_i_status", (byte)2, name);
                                 client.WriteByOrder("R_oi_on", (byte)0, name);
                                 #region 鏃ュ織璁板綍
-                                WriteDBLog.Error(name, $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿wp_id}\n杞瀷ID锛歿wp_type}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�2\nR_oi_on锛�0\n\n鏈煡璇㈠埌妫�娴嬬嚎杞﹁疆淇℃伅", "PCS");
+                                //WriteDBLog.Error(name, $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿wp_id}\n杞瀷ID锛歿wp_type}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�2\nR_oi_on锛�0\n\n鏈煡璇㈠埌妫�娴嬬嚎杞﹁疆淇℃伅", "PCS");
+                                WriteLog.Write_Log(name, wp_id, "閿欒淇℃伅锛�", $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿wp_id}\n杞瀷ID锛歿wp_type}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�2\nR_oi_on锛�0\n\n鏈煡璇㈠埌妫�娴嬬嚎杞﹁疆淇℃伅");
                                 #endregion
                                 continue;
                             }
@@ -338,8 +375,10 @@
                                 client.WriteByOrder("W_i_batch_id", Mes_Work.heatBatchID, name);
                                 client.WriteByOrder("R_oi_on", (byte)0, name);
                                 #region 鏃ュ織璁板綍
-                                WriteDBLog.Success(name, $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿wp_id}\n杞瀷ID锛歿wp_type}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�1" + $"\nW_i_job_id锛歿Mes_Work.jobID}" +
-                                    $"\nW_i_drawing_id锛歿mes_Head.drawingNo}\nW_i_heat_id锛歿Mes_Work.heatID}\nW_i_batch_id锛歿Mes_Work.heatBatchID}\nR_oi_on锛�0", "PCS");
+                                WriteLog.Write_Log(name, wp_id, "鍐欏叆淇℃伅锛�", $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿wp_id}\n杞瀷ID锛歿wp_type}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�1" + $"\nW_i_job_id锛歿Mes_Work.jobID}" +
+                                    $"\nW_i_drawing_id锛歿mes_Head.drawingNo}\nW_i_heat_id锛歿Mes_Work.heatID}\nW_i_batch_id锛歿Mes_Work.heatBatchID}\nR_oi_on锛�0");
+                                //WriteDBLog.Success(name, $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿wp_id}\n杞瀷ID锛歿wp_type}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�1" + $"\nW_i_job_id锛歿Mes_Work.jobID}" +
+                                //    $"\nW_i_drawing_id锛歿mes_Head.drawingNo}\nW_i_heat_id锛歿Mes_Work.heatID}\nW_i_batch_id锛歿Mes_Work.heatBatchID}\nR_oi_on锛�0", "PCS");
                                 #endregion
                             }
                         }
@@ -348,7 +387,8 @@
             }
             catch (Exception ex)
             {
-                WriteDBLog.Error("鏌ヨ杞﹁疆璁㈠崟", $"閿欒淇℃伅锛歿ex.Message}", "PCS");
+                //WriteDBLog.Error("鏌ヨ杞﹁疆璁㈠崟", $"閿欒淇℃伅锛歿ex.Message}", "PCS");
+                WriteLog.Write_Log("鎶ラ敊鏃ュ織", namea, "閿欒淇℃伅锛�", $"閿欒淇℃伅锛歿ex.Message}");
             }
         }
         #endregion
@@ -404,6 +444,15 @@
                         }
                         #endregion
 
+                        var Stations = stationinfoRepository.Find(x => x.area == Pipeline.area_code(name)).OrderBy(x => x.lastUpdateTime).ToList();
+
+                        #region 涓嬫枡浣嶆槸鍚︿负绌虹姸鎬佸悓姝ョ粰妗佹灦
+                        foreach (var station in Stations)
+                        {
+                            client.WriteByOrder(station.stationCode, station.location_state != LocationStateEnum.Stroge.ToString(), name);
+                        }
+                        #endregion
+
                         if (finished && !updatefinished)
                         {
                             client.WriteByOrder("W_Enabl_Load", false, name);//鏄惁鍏佽
@@ -440,7 +489,7 @@
 
                             #region 鍒ゆ柇鍖哄煙鍙锋槸鍚︿竴鑷�
                             var area = client.ReadByOrder<Int16>("place_prog", name);//鏀炬枡瀹屾垚鐨勫尯鍩熷彿
-                            
+
                             if (AreaNr != area)
                             {
                                 Pipeline_client.WriteByOrder("W_AlarmSignal", (Int16)2, name);//鎶ヨ
@@ -450,7 +499,7 @@
                             }
                             #endregion
 
-                            var areaCode = PipelineJob.area_code(name);   //鏍规嵁涓嬫枡鍙e崟鍏冨悕鑾峰彇鍖哄煙浠g爜
+                            var areaCode = Pipeline.area_code(name);   //鏍规嵁涓嬫枡鍙e崟鍏冨悕鑾峰彇鍖哄煙浠g爜
                             var station = stationinfoRepository.Find(x => x.area == areaCode && x.stationCode.Substring(x.stationCode.Length - 1, 1) == AreaNr.ToString()).FirstOrDefault();
                             if (station != null)
                             {
@@ -551,14 +600,6 @@
                         #endregion
 
 
-                        var Stations = stationinfoRepository.Find(x => x.area == PipelineJob.area_code(name)).OrderBy(x => x.lastUpdateTime).ToList();
-
-                        #region 涓嬫枡浣嶆槸鍚︿负绌虹姸鎬佸悓姝ョ粰妗佹灦
-                        foreach (var station in Stations)
-                        {
-                            client.WriteByOrder(station.stationCode, station.location_state != LocationStateEnum.Stroge.ToString(), name);
-                        }
-                        #endregion
 
                         #region MyRegion
                         //var currentAreaNr = (Int16)DBExtension.Read(details.Where(x => x.plcdetail_name == "W_Are00aNr").First(), client);
@@ -569,8 +610,8 @@
                         #endregion
 
 
-                        var wheel = PipelineJob.QueryMateriel(Work.drawingNo);
-                        var wheel1 = PipelineJob.QueryMateriel1(Work.drawingNo);
+                        var wheel = Pipeline.QueryMateriel(Work.drawingNo);
+                        var wheel1 = Pipeline.QueryMateriel1(Work.drawingNo);
                         if (wheel == null && wheel1 == null)
                         {
                             #region 鏃ュ織璁板綍
@@ -851,13 +892,15 @@
                     }
                     catch (Exception ex)
                     {
-                        WriteDBLog.Error(name, $"閿欒淇℃伅锛歿ex.Message}", "PCS");
+                        //WriteDBLog.Error(name, $"閿欒淇℃伅锛歿ex.Message}", "PCS");
+                        WriteLog.Write_Log("鎶ラ敊鏃ュ織", name, "閿欒淇℃伅锛�", $"閿欒淇℃伅锛歿ex.Message}");
                     }
                 }
             }
             catch (Exception ex)
             {
-                WriteDBLog.Error("涓嬫枡鍖�", $"閿欒淇℃伅锛歿ex.Message}", "PCS");
+                //WriteDBLog.Error("涓嬫枡鍖�", $"閿欒淇℃伅锛歿ex.Message}", "PCS");
+                WriteLog.Write_Log("鎶ラ敊鏃ュ織", "涓嬫枡鍖�", "閿欒淇℃伅锛�", $"閿欒淇℃伅锛歿ex.Message}");
             }
         }
         #endregion

--
Gitblit v1.9.3