From d5f80f2bae790fd13c159ff59568766b22495e30 Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周日, 09 6月 2024 14:09:10 +0800 Subject: [PATCH] 修复bug --- DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/DataCaptureHandler_05.cs | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-) diff --git a/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/DataCaptureHandler_05.cs b/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/DataCaptureHandler_05.cs index 891f868..9d4f860 100644 --- a/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/DataCaptureHandler_05.cs +++ b/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/DataCaptureHandler_05.cs @@ -17,7 +17,7 @@ /// <summary> /// 宸ュ簭瀹屾垚 /// </summary> - public class DataCaptureHandler_05: DataCaptureHandler + public class DataCaptureHandler_05 : DataCaptureHandler { public static readonly DataCaptureHandler_05 Instance = new DataCaptureHandler_05(); @@ -132,7 +132,7 @@ wplog.CreatedTime = DateTimeHelper.GetDateTime(); wplog.CreatedUserName = DataCapturePointCode; wplog.UpdatedTime = DateTimeHelper.GetDateTime(); - wplog.UpdatedUserName = Environment.MachineName+"鑷姩" + Thread.CurrentThread.ManagedThreadId.ToString(); + wplog.UpdatedUserName = Environment.MachineName + "鑷姩" + Thread.CurrentThread.ManagedThreadId.ToString(); wplog.IsDeleted = false; foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) { @@ -148,7 +148,7 @@ } set.SetValue(wplog, valuecol);//缁欏姩鎬佸瓧娈佃祴鍊� } - catch(Exception setex) + catch (Exception setex) { Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(_dataCaptureConfig.WorkingProcedure), $" {DataCapturePointCode}宸ュ簭鐩戞帶璇荤爜鏍囪 璇诲彇宸ヤ欢鐮佸姩鎬佽祴鍊笺�恵_dataCaptureConfig.WorkingProcedure ?? "绌哄瓧绗︿覆"}銆戝紓甯竰wplog.Id},璧嬪�煎垪鍚峓{col.DataCaptureColumnTabelName ?? "绌哄瓧绗︿覆"}]", setex); } @@ -172,14 +172,14 @@ { files.Add((FileInfo)file); } - files = files.OrderByDescending(o => o.LastWriteTime).ToList(); + files = files.OrderByDescending(o => o.LastWriteTime).ToList(); Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"OP80涓嬬嚎瀹屾垚璇诲彇鍒版枃浠秢files.Count()}涓伐浠秢wplog.WorkPieceID} 鏃堕棿{fileFindTime.Value.ToString()}"); foreach (var file in files) {//鍙栧�掑簭鍖归厤鐨勬枃浠跺悕涓哄伐浠跺彿鐨勬枃浠� if (file.Name.Contains(wplog.WorkPieceID)) { - Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"OP80涓嬬嚎瀹屾垚璇诲彇鍒版枃浠秢file.Name}锛屾槸鎸囧畾鐨勫伐浠�"); + Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"OP80涓嬬嚎瀹屾垚璇诲彇鍒版枃浠秢file.Name}锛屾槸鎸囧畾鐨勫伐浠秢wplog.WorkPieceID}"); var datatable = CSVHelper.ReadCSVList(file.FullName); List<string> rowFirst = new List<string>(); @@ -188,7 +188,7 @@ { rowFirst = datatable[0].Split(',').ToList(); rowSecond = datatable[1].Split(',').ToList(); - if(rowSecond.Count<11) + if (rowSecond.Count < 11) { continue; } @@ -224,22 +224,22 @@ item.涓嬮檺 = rowSecond[9 + i * 10]; item.鐘舵�� = rowSecond[10 + i * 10]; oP80Info.OP80ItemInfolist.Add(item); - if(item.鍚嶇О.Equals("Weight Class") || item.鍚嶇О.Equals("Weight Small End") - || item.鍚嶇О.Equals("Weight Big End") || item.鍚嶇О.Equals("Dime Small_End Class") + if (item.鍚嶇О.Equals("Weight Class") || item.鍚嶇О.Equals("Weight Small End") + || item.鍚嶇О.Equals("Weight Big End") || item.鍚嶇О.Equals("Dime Small_End Class") || item.鍚嶇О.Equals("Dime Big_End Class")) { } else { - if(!string.IsNullOrEmpty(item.鐘舵��)) + if (!string.IsNullOrEmpty(item.鐘舵��)) { oP80Info.OP80ItemStatusInfolist.Add(item); } } } - if(oP80Info.OP80ItemStatusInfolist.Count>0) + if (oP80Info.OP80ItemStatusInfolist.Count > 0) { - if(oP80Info.OP80ItemStatusInfolist.Any(o=>!o.鐘舵��.Equals("OK"))) + if (oP80Info.OP80ItemStatusInfolist.Any(o => !o.鐘舵��.Equals("OK"))) { wplog.QualityStateStr = "NG"; } @@ -293,7 +293,7 @@ } } - catch(Exception ex) + catch (Exception ex) { threadStatusMonitor.ErrorMsg = $" {RandomHelper.GenerateRandomCode(4)} 璇诲彇{DataCapturePointCode}涓嬬嚎鏍囪 瀹屾垚璇诲彇鏂囦欢鏁版嵁鏃跺紓甯革紝璇锋煡鐪嬫棩蹇楋紒"; Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"OP80涓嬬嚎瀹屾垚璇诲彇鏂囦欢鏁版嵁鏃跺紓甯�,閬垮厤宸ュ簭瀹屾垚寮傚父锛�", ex); -- Gitblit v1.9.3