From add3a14bee713fb558eac9460f1375ffb8e23894 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期五, 07 六月 2024 21:53:33 +0800
Subject: [PATCH] 代码优化

---
 代码管理/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 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 d372017..2a00245 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"
@@ -187,16 +187,16 @@
                         var mes_Head = mes_HeadRepository.FindFirst(x => x.jobID == Mes_Work.jobID);
 
                         //闇�娣诲姞鏌ヨ杞﹁疆SN鍙疯鍗曢�昏緫   闇�娣诲姞鍏ュ簱妯″紡鍒ゆ柇锛屾墜鍔ㄥ叆搴撴ā寮忛渶浜哄伐娣诲姞鍏ュ簱搴撳尯锛屽惁鍒欐姤璀�
-                        var pattern = patternRepository.FindFirst(x => x.pattern_name == "鍏ュ簱妯″紡").pattern_state;
-                        if (pattern != 1 && string.IsNullOrEmpty(mes_Head.area))
-                        {
-                            client.WriteByOrder("W_i_status", (byte)4, name);
-                            client.WriteByOrder("R_oi_on", (byte)0, name);
-                            #region 鏃ュ織璁板綍
-                            WriteLog.Write_Log(name, wp_id, "閿欒淇℃伅锛�", $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿wp_id}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�4\nR_oi_on锛�0\n\n鎵嬪姩鍏ュ簱妯″紡鏈�夋嫨搴撳尯");
-                            #endregion
-                            continue;
-                        }
+                        //var pattern = patternRepository.FindFirst(x => x.pattern_name == "鍏ュ簱妯″紡").pattern_state;
+                        //if (pattern != 1 && string.IsNullOrEmpty(mes_Head.area))
+                        //{
+                        //    client.WriteByOrder("W_i_status", (byte)4, name);
+                        //    client.WriteByOrder("R_oi_on", (byte)0, name);
+                        //    #region 鏃ュ織璁板綍
+                        //    WriteLog.Write_Log(name, wp_id, "閿欒淇℃伅锛�", $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿wp_id}\n\n鍐欏叆妗佹灦淇℃伅锛歕nW_i_status锛�4\nR_oi_on锛�0\n\n鎵嬪姩鍏ュ簱妯″紡鏈�夋嫨搴撳尯");
+                        //    #endregion
+                        //    continue;
+                        //}
                         var geometry = Pipeline.QueryMateriel(Mes_Work.drawingNo);
                         if (geometry == null)
                         {
@@ -406,13 +406,13 @@
                                 var Detail = mes_DetailRepository.FindFirst(x => x.jobID == Mes_Work.jobID && x.SN == Mes_Work.SN);
                                 Detail.Status = "涓嬬嚎";
                                 Detail.FinishTime = DateTime.Now;
-                                count = mes_DetailRepository.Update(Detail, true);
+                                count = mes_DetailRepository.Update(Detail, x => new { x.Status, x.FinishTime }, true);
                                 if (count < 1)
                                     throw new Exception($"宸ュ崟瀛愯〃淇℃伅鏇存柊澶辫触锛佽溅杞甋N鍙凤細{Detail.SN}");
                                 var Head = mes_HeadRepository.FindFirst(x => x.jobID == Detail.jobID);
                                 Head.finishNum = Head.finishNum + 1;
                                 if (Head.finishNum == Head.quantity) Head.FinishTime = DateTime.Now;
-                                count = mes_HeadRepository.Update(Head, true);
+                                count = mes_HeadRepository.Update(Head, x => new { x.finishNum, x.FinishTime }, true);
                                 if (count < 1)
                                     throw new Exception($"宸ュ崟澶磋〃淇℃伅鏇存柊澶辫触锛佸伐鍗曞彿锛歿Head.jobID}");
                                 #endregion

--
Gitblit v1.9.3