From 09a12e1094e90fe83c5578de64b56e9237c60507 Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周四, 05 9月 2024 14:13:33 +0800 Subject: [PATCH] 代码回归 --- DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/MonitorHelper.cs | 30 ++++++++++++++++++++++++++++-- 1 files changed, 28 insertions(+), 2 deletions(-) diff --git a/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/MonitorHelper.cs b/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/MonitorHelper.cs index 6864ea7..00b509a 100644 --- a/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/MonitorHelper.cs +++ b/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/MonitorHelper.cs @@ -1,5 +1,7 @@ 锘� +using iWare.Wms.Core; using iWare_SCADA_Model; +using log4net; using Newtonsoft.Json; using System; using System.Collections.Generic; @@ -53,7 +55,7 @@ /// </summary> /// <param name="value"></param> /// <returns></returns> - public static void MonitorTestForLine(DataCaptureConfig _dataCaptureConfig, object value, List<DataCaptureColumnConfig> colConfig, WorkPieceLog wplog) + public static void MonitorTestForLine(DataCaptureConfig _dataCaptureConfig, object value, List<DataCaptureColumnConfig> colConfig, string workPieceID) { Task.Run(() => { @@ -64,11 +66,35 @@ var str = ""; - str += $",涓婄嚎鑾峰彇浜岀淮鐮佸�� ,鍊兼槸{wplog.WorkPieceID.ToString()}"; + str += $",涓婄嚎鑾峰彇浜岀淮鐮佸�� ,鍊兼槸{workPieceID}"; //str += $",鏁翠綋瀵硅薄 wplog鏄瘂JsonConvert.SerializeObject(wplog)}"; Log4NetHelper.WriteInfoLog(_LogType, str); + //涓嶆甯哥殑鐮佸啓鍏ユ暟鎹簱 + var isRight = SystemBussinessHelper.ValidateIsRightWorkPieceID(workPieceID); + PieceLogTypeEnum pieceLogTypeEnum = PieceLogTypeEnum.姝e父; + if (isRight == false) + { + pieceLogTypeEnum = PieceLogTypeEnum.璇荤爜鍊煎紓甯�; + } + WorkPieceLog workPieceLog = new WorkPieceLog() + { + Id = Yitter.IdGenerator.YitIdHelper.NextId(), + WorkPieceID = workPieceID, + WorkingProcedure = _dataCaptureConfig.WorkingProcedure, + CreatedTime = DateTime.Now, + CreatedUserName = _dataCaptureConfig.DataCapturePointCode, + MyRemarks = "", + Remarks = pieceLogTypeEnum.ToString(), + PieceLogType = (int)pieceLogTypeEnum, + PieceLogTypeName = pieceLogTypeEnum.ToString() + }; + using (DbModel db = new DbModel()) + { + db.WorkPieceLog.Add(workPieceLog); + db.SaveChanges(); + } } catch (Exception ex) { -- Gitblit v1.9.3