From 6fc644cfee67b245cd3fd3485422ff216a2fca4e Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期日, 12 五月 2024 11:21:45 +0800
Subject: [PATCH] 删除30天前文本日志
---
代码管理/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs | 67 ++++++++++++++++++---------------
1 files changed, 37 insertions(+), 30 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 48cf3b6..ed61b2b 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"
@@ -207,7 +207,7 @@
catch (Exception ex)
{
//WriteDBLog.Error("鏌ヨ杞﹁疆鏁版嵁", $"閿欒淇℃伅锛歿ex.Message}", "PCS");
- WriteLog.Write_Log(namea, namea + "鎶ラ敊", "閿欒淇℃伅锛�", $"閿欒淇℃伅锛歿ex.Message}");
+ WriteLog.Write_Log("鎶ラ敊鏃ュ織", namea, "閿欒淇℃伅锛�", $"閿欒淇℃伅锛歿ex.Message}");
}
}
#endregion
@@ -388,7 +388,7 @@
catch (Exception ex)
{
//WriteDBLog.Error("鏌ヨ杞﹁疆璁㈠崟", $"閿欒淇℃伅锛歿ex.Message}", "PCS");
- WriteLog.Write_Log(namea, namea + "鎶ラ敊", "閿欒淇℃伅锛�", $"閿欒淇℃伅锛歿ex.Message}");
+ WriteLog.Write_Log("鎶ラ敊鏃ュ織", namea, "閿欒淇℃伅锛�", $"閿欒淇℃伅锛歿ex.Message}");
}
}
#endregion
@@ -444,14 +444,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
if (finished && !updatefinished)
{
@@ -499,7 +491,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)
{
@@ -526,21 +518,6 @@
throw new Exception($"{station.stationCode}宸插瓨鍦ㄨ溅杞甋N鍙凤細{Wheel_SN}");
}
- station.bindSN = string.IsNullOrEmpty(station.bindSN) ? Wheel_SN : station.bindSN + "," + Wheel_SN;
- station.billetID = string.IsNullOrEmpty(station.billetID) ? Mes_Work.billetID.ToString() : station.billetID + "," + Mes_Work.billetID;
- station.quantity++;
- if (station.quantity == 1)
- {
- station.stationType = Mes_Work.drawingNo;
- station.Number = Mes_Work.workOrder;
- station.heatNumber = Mes_Work.heatID;
- station.tray_status = "StrogeTray";
- }
-
- var count = stationinfoRepository.Update(station, true);
- if (count < 1)
- throw new Exception($"涓嬫枡浣嶄俊鎭洿鏂板け璐ワ紒涓嬫枡浣嶇紪鍙凤細{station.stationCode}");
-
#region 娓呯┖缁欐鏋剁殑涓嬫枡淇℃伅
client.WriteByOrder("W_IndexNr", (Int16)0, name);//鎵樼洏涓婄殑绗嚑涓溅杞�
client.WriteByOrder("W_Storage_Type", (Int16)0, name);//鎵樼洏绫诲瀷1-妯斁;2-绔栨斁(鏆傛椂鍙湁妯斁鎵樼洏)
@@ -556,6 +533,24 @@
// $"鍐欏叆妗佹灦淇℃伅锛歕nW_Storage_update锛歿true}\nW_Enabl_Load锛歿false}", "PCS");
#endregion
+ #region 璐т綅鐘舵�佹洿鏂�
+ station.bindSN = string.IsNullOrEmpty(station.bindSN) ? Wheel_SN : station.bindSN + "," + Wheel_SN;
+ station.billetID = string.IsNullOrEmpty(station.billetID) ? Mes_Work.billetID.ToString() : station.billetID + "," + Mes_Work.billetID;
+ station.quantity++;
+ if (station.quantity == 1)
+ {
+ station.stationType = Mes_Work.drawingNo;
+ station.Number = Mes_Work.workOrder;
+ station.heatNumber = Mes_Work.heatID;
+ station.tray_status = "StrogeTray";
+ }
+
+ var count = stationinfoRepository.Update(station, true);
+ if (count < 1)
+ throw new Exception($"涓嬫枡浣嶄俊鎭洿鏂板け璐ワ紒涓嬫枡浣嶇紪鍙凤細{station.stationCode}");
+ #endregion
+
+
#region 淇敼宸ュ崟鐘舵��
var Detail = mes_DetailRepository.FindFirst(x => x.jobID == Mes_Work.jobID && x.SN == Mes_Work.SN);
Detail.Status = "涓嬬嚎";
@@ -565,12 +560,22 @@
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);
if (count < 1)
throw new Exception($"宸ュ崟澶磋〃淇℃伅鏇存柊澶辫触锛佸伐鍗曞彿锛歿Head.jobID}");
#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
var Request = (bool)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_Request_Load").First(), client);
if (!Request) continue;
@@ -610,8 +615,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 鏃ュ織璁板綍
@@ -892,13 +897,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