From e4f89a92209ebca77240edaa3b78f66eb6e4b3d5 Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周五, 06 9月 2024 08:58:43 +0800 Subject: [PATCH] 修复为null的问题 --- DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/MonitorHelper.cs | 35 ++++++++++++++++++++--------------- 1 files changed, 20 insertions(+), 15 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 8c7be60..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,4 +1,5 @@ 锘� +using iWare.Wms.Core; using iWare_SCADA_Model; using log4net; using Newtonsoft.Json; @@ -72,23 +73,27 @@ //涓嶆甯哥殑鐮佸啓鍏ユ暟鎹簱 var isRight = SystemBussinessHelper.ValidateIsRightWorkPieceID(workPieceID); + PieceLogTypeEnum pieceLogTypeEnum = PieceLogTypeEnum.姝e父; if (isRight == false) { - WorkPieceLog workPieceLog = new WorkPieceLog() - { - Id = Yitter.IdGenerator.YitIdHelper.NextId(), - WorkPieceID = workPieceID, - WorkingProcedure = _dataCaptureConfig.WorkingProcedure, - CreatedTime = DateTime.Now, - CreatedUserName = _dataCaptureConfig.DataCapturePointCode, - MyRemarks = "璇荤爜鍊煎紓甯�", - Remarks = "璇荤爜鍊煎紓甯�" - }; - using (DbModel db = new DbModel()) - { - db.WorkPieceLog.Add(workPieceLog); - db.SaveChanges(); - } + 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