schangxiang@126.com
2024-09-02 15662d05c2e2a8620cdabf9038c94f7b64a106d2
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/BLL/WorkPieceInfoManager.cs
@@ -230,6 +230,7 @@
                            {
                                pro.EndTime = DateTimeHelper.GetDateTime();
                                pro.UpdatedUserName = loginfo.MonitoringPoint;
                                pro.UpdateDataCapturePointCname = loginfo.DataCapturePointCname;
                                pro.UpdatedTime = DateTimeHelper.GetDateTime();
                                pro.Remarks = "又一次上线,更新结束时间";
                            }
@@ -253,8 +254,10 @@
                            new_process.Id = Yitter.IdGenerator.YitIdHelper.NextId();
                            new_process.CreatedUserName = loginfo.MonitoringPoint;
                            new_process.DataCapturePointCname = loginfo.DataCapturePointCname;
                            new_process.CreatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local);
                            new_process.UpdatedUserName = loginfo.MonitoringPoint;
                            new_process.UpdateDataCapturePointCname = loginfo.DataCapturePointCname;
                            new_process.UpdatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local);
                            new_process.OperationType = OperationType.生产.ToString();
                            new_process.Remarks = "";
@@ -787,8 +790,10 @@
                            process.Id = Yitter.IdGenerator.YitIdHelper.NextId();
                            process.CreatedUserName = ResetUpdatedUserName(logMiddle);
                            process.DataCapturePointCname = logMiddle.DataCapturePointCname;
                            process.CreatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local);
                            process.UpdatedUserName = ResetUpdatedUserName(logMiddle);
                            process.UpdateDataCapturePointCname = logMiddle.DataCapturePointCname;
                            process.UpdatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local);
                            process.OperationType = OperationType.生产.ToString();
                            process.QualityDataInfoID = qualityData.Id;
@@ -799,6 +804,7 @@
                        {//其他的都只是修改
                            pro.QualityDataInfoID = qualityData.Id;
                            pro.UpdatedUserName = ResetUpdatedUserName(logMiddle);
                            pro.UpdateDataCapturePointCname = logMiddle.DataCapturePointCname;
                            pro.UpdatedTime = DateTimeHelper.GetDateTime();
                            //不再默认赋值为合格 【Editby shaocx,2024-08-16】
@@ -812,7 +818,7 @@
                            if (logMiddle.WorkingProcedure == "OP60")
                            {
                                pro.CreatedUserName = ResetUpdatedUserName(logMiddle);
                                pro.DataCapturePointCname = logMiddle.DataCapturePointCname;
                            }
                        }
@@ -992,6 +998,7 @@
                            cur_db_info.UpdatedUserName = loginfo.MonitoringPoint;
                            cur_db_info.UpdatedTime = DateTime.Now;
                            cur_db_info.Remarks = "工件NOOK推出";
                            loginfo2.Remarks = cur_db_info.Remarks;
                            if (!(cur_db_info.WorkingProcedureStartTime.HasValue && cur_db_info.WorkingProcedureStartTime > DateTime.Parse("1900/01/01")))
                            {
                                cur_db_info.WorkingProcedureStartTime = DateTimeHelper.GetDateTime();
@@ -1031,6 +1038,7 @@
                            pro.EndTime = DateTimeHelper.GetDateTime();
                            pro.Remarks = (pro.Remarks ?? "") + "NOOK结束";
                            pro.UpdatedUserName = loginfo.MonitoringPoint;
                            pro.UpdateDataCapturePointCname = loginfo.DataCapturePointCname;
                            pro.UpdatedTime = DateTimeHelper.GetDateTime();
                        }
@@ -1120,6 +1128,7 @@
                            cur_db_info.WorkPieceCurrentPositionOrder = cur_db_info.WorkingProcedurePlan.IndexOf(loginfo.WorkingProcedure) / 2;
                        }
                        cur_db_info.Remarks = "工件SPC抽检推出";
                        loginfo2.Remarks = cur_db_info.Remarks;
                        //更新上一工序的结束时间
                        var pro = db.WorkPieceProcess.Where(o => o.WorkPieceID == loginfo.WorkPieceID && o.WorkingProcedureCurrent == loginfo.WorkingProcedure
@@ -1129,6 +1138,7 @@
                            pro.EndTime = DateTimeHelper.GetDateTime();
                            pro.Remarks = (pro.Remarks ?? "") + "SPC抽检结束";
                            pro.UpdatedUserName = loginfo.MonitoringPoint;
                            pro.UpdateDataCapturePointCname = loginfo.DataCapturePointCname;
                            pro.UpdatedTime = DateTimeHelper.GetDateTime();
                        }
                        //每次SPC 都插入追溯表
@@ -1140,8 +1150,10 @@
                        process.QualityState = (int)QualityState.Suspected;
                        process.Id = Yitter.IdGenerator.YitIdHelper.NextId();
                        process.CreatedUserName = loginfo.MonitoringPoint;
                        process.DataCapturePointCname = loginfo.DataCapturePointCname;
                        process.CreatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local);
                        process.UpdatedUserName = loginfo.MonitoringPoint;
                        process.UpdateDataCapturePointCname = loginfo.DataCapturePointCname;
                        process.UpdatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local);
                        process.Remarks = "工件SPC抽检推出";
                        db.WorkPieceProcess.Add(process);
@@ -1384,8 +1396,10 @@
                                process.QualityState = WorkPieceInfoManager.GetQualityStateValue(logMiddle.QualityState);
                            }
                            process.CreatedUserName = logMiddle.MonitoringPoint;
                            process.DataCapturePointCname = logMiddle.DataCapturePointCname;
                            process.CreatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local);
                            process.UpdatedUserName = logMiddle.MonitoringPoint;
                            process.UpdateDataCapturePointCname = logMiddle.DataCapturePointCname;
                            process.UpdatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local);
                            process.OperationType = OperationType.生产.ToString();
                            process.Remarks = "";
@@ -1412,6 +1426,7 @@
                            }
                            pro.EndTime = DateTimeHelper.GetDateTime();
                            pro.UpdatedUserName = logMiddle.MonitoringPoint;
                            pro.UpdateDataCapturePointCname = logMiddle.DataCapturePointCname;
                            pro.UpdatedTime = DateTimeHelper.GetDateTime();
                            if (logMiddle.WorkingProcedure.Equals("OP80"))
                            {