schangxiang@126.com
2024-09-06 05f2a20bb792169bf7b8a101af8718b96449f55a
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/Special/DataCaptureHandler_OP7009.cs
@@ -1,4 +1,5 @@
using iWare_SCADA_BusinessLogical.BLL;
using iWare_SCADA_BusinessLogical.BLL.Important;
using iWare_SCADA_BusinessLogical.Utils;
using iWare_SCADA_Model;
using log4net;
@@ -88,11 +89,12 @@
                            //获取OP70未结束的工件列表
                            var ooDateTime = Convert.ToDateTime("0001-01-01");
                            var findTime = DateTime.Now.AddHours(-12);
                            List<WorkPieceProcess> noFinishWorkPieceProcessList = null;
                            using (DbModel db = new DbModel())
                            {
                                var dateTime = DateTime.Now;
                                noFinishWorkPieceProcessList = db.WorkPieceProcess.Where(x => x.CreatedTime >= DateTime.Now.AddHours(-12)
                                noFinishWorkPieceProcessList = db.WorkPieceProcess.Where(x => x.CreatedTime >= findTime
                                  && x.WorkingProcedureCurrent == WorkingProcedure
                                  && x.EndTime == ooDateTime).ToList();
                            }
@@ -109,8 +111,9 @@
                            wplog.EquipmentID = _dataCaptureConfig.EquipmentID;
                            wplog.Remarks = WorkingProcedure;
                            wplog.MonitoringPoint = DataCapturePointCode;
                            //wplog.CreatedUserName = DataCapturePointCode;
                            SystemBussinessHelper.SetWorkPieceLogMiddleForCreatedUserName(ref wplog, DataCapturePointCode, DataCapturePointCname);
                            wplog.CreatedTime = DateTimeHelper.GetDateTime();
                            wplog.CreatedUserName = DataCapturePointCode;
                            wplog.UpdatedTime = DateTimeHelper.GetDateTime();
                            wplog.UpdatedUserName = Environment.MachineName + "自动" + Thread.CurrentThread.ManagedThreadId.ToString();
                            wplog.OnlineTime = DateTimeHelper.GetDateTime();
@@ -157,7 +160,7 @@
                                foreach (var item in noFinishWorkPieceProcessList)
                                {
                                    wplog.WorkPieceID = item.WorkPieceID;
                                    WorkPieceInfoManager.QualityInfoCompleteForOP70(wplog, LogType.OP7009);
                                    QualityInfoCompleteManager.QualityInfoCompleteForOP70(wplog, LogType.OP7009);
                                    // threadStatusMonitor.Threadstatue = 1;
                                }
                            }