From bd8936f8feb44c0d3e95a0d19685f2ab018670bf Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周三, 04 9月 2024 11:50:53 +0800
Subject: [PATCH] 不正常的码写入数据库

---
 DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/MonitorHelper.cs |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 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 dcaed5a..8c7be60 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,6 @@
 锘�
 using iWare_SCADA_Model;
+using log4net;
 using Newtonsoft.Json;
 using System;
 using System.Collections.Generic;
@@ -69,6 +70,26 @@
 
                     Log4NetHelper.WriteInfoLog(_LogType, str);
 
+                    //涓嶆甯哥殑鐮佸啓鍏ユ暟鎹簱
+                    var isRight = SystemBussinessHelper.ValidateIsRightWorkPieceID(workPieceID);
+                    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();
+                        }
+                    }
                 }
                 catch (Exception ex)
                 {

--
Gitblit v1.9.3