public Messages Execute(ActionEventArgs actionEventArgs, ActionCheckStatus actionCheckStatus) { Messages messages = new Messages(); DataCollectDebug dataCollectDebug = new DataCollectDebug(this.GetType().ToString() + "Collect"); dataCollectDebug.WhenFunctionIn(messages); try { ActionOnLineHelper dataCollect = new ActionOnLineHelper(this.DataProvider); //填写SIMULATION 检查工单、ID、途程、操作 messages.AddMessages(dataCollect.CheckID(actionEventArgs, actionCheckStatus)); if (messages.IsSuccess()) { //Laws Lu,2005/08/15,新增 完工逻辑,在其他Check都通过的情况下,所有的RunningCard应该是GOOD状态 //暂时不考虑线外工序 DataCollectFacade dataCollectFacade = new DataCollectFacade(this.DataProvider); if (actionEventArgs.ProductInfo.NowSimulation.RouteCode != "" && dataCollectFacade.OPIsMORouteLastOP( actionEventArgs.ProductInfo.NowSimulation.MOCode , actionEventArgs.ProductInfo.NowSimulation.RouteCode , actionEventArgs.ProductInfo.NowSimulation.OPCode)) { actionEventArgs.ProductInfo.NowSimulation.IsComplete = "1"; actionEventArgs.ProductInfo.NowSimulation.EAttribute1 = "GOOD"; //完工自动入库 dataCollectFacade.AutoInventory(actionEventArgs.ProductInfo.NowSimulation, actionEventArgs.UserCode); } actionEventArgs.ProductInfo.NowSimulation.ShelfNO = ""; //End Laws Lu if (actionCheckStatus.NeedUpdateSimulation == true) { messages.AddMessages(dataCollect.Execute(actionEventArgs)); } else { messages.AddMessages(dataCollect.Execute(actionEventArgs, actionCheckStatus)); } if (messages.IsSuccess()) { //填写测试报表 TODO //if (actionCheckStatus.NeedFillReport == true) //{ // ReportHelper reportCollect= new ReportHelper(this.DataProvider); // messages.AddMessages(reportCollect.ReportLineQuanMaster(this.DataProvider,actionEventArgs.ActionType,actionEventArgs.ProductInfo, actionCheckStatus)); // messages.AddMessages(reportCollect.ReportResQuanMaster(this.DataProvider,actionEventArgs.ActionType,actionEventArgs.ProductInfo, actionCheckStatus)); //} //将Action加入列表 actionCheckStatus.ActionList.Add(actionEventArgs); } } } catch (Exception e) { messages.Add(new Message(e)); } dataCollectDebug.WhenFunctionOut(messages); return(messages); }
//Laws Lu,2006/01/04,此方法已经放弃使用 public Messages Execute(ActionEventArgs actionEventArgs, ActionCheckStatus actionCheckStatus) { Messages messages = new Messages(); DataCollectDebug dataCollectDebug = new DataCollectDebug(this.GetType().ToString() + "Collect"); dataCollectDebug.WhenFunctionIn(messages); try { ActionOnLineHelper dataCollect = new ActionOnLineHelper(this.DataProvider); //填写SIMULATION 检查工单、ID、途程、操作 messages.AddMessages(dataCollect.CheckID(actionEventArgs)); if (messages.IsSuccess()) { messages.AddMessages(dataCollect.Execute(actionEventArgs)); if (messages.IsSuccess()) { //填写测试报表 //ReportHelper reportCollect = new ReportHelper(this.DataProvider); //messages.AddMessages(reportCollect.ReportLineQuanMaster(this.DataProvider, actionEventArgs.ActionType, actionEventArgs.ProductInfo)); //messages.AddMessages(reportCollect.ReportResQuanMaster(this.DataProvider, actionEventArgs.ActionType, actionEventArgs.ProductInfo)); //Laws Lu,2005/10/20,新增 使用配置文件来控制物料模块是否使用 if (System.Configuration.ConfigurationSettings.AppSettings["NeedMaterialModule"].Trim() == "1") { BenQGuru.eMES.Material.CastDownHelper castHelper = new BenQGuru.eMES.Material.CastDownHelper(DataProvider); ArrayList arRcard = new ArrayList(); castHelper.GetAllRCardByMo(ref arRcard, actionEventArgs.ProductInfo.NowSimulation.RunningCard, actionEventArgs.ProductInfo.NowSimulation.MOCode); if (arRcard.Count == 0) { arRcard.Add(actionEventArgs.RunningCard); } string runningCards = "('" + String.Join("','", (string[])arRcard.ToArray(typeof(string))) + "')"; object[] objs = (actionEventArgs as DropMaterialEventArgs).OnwipItems; //下料并归还库房 BenQGuru.eMES.Material.WarehouseFacade wfacade = new BenQGuru.eMES.Material.WarehouseFacade(this.DataProvider); wfacade.RemoveWarehouse( objs , runningCards , actionEventArgs.ProductInfo.NowSimulation.MOCode , actionEventArgs.UserCode , actionEventArgs.ProductInfo.NowSimulationReport.StepSequenceCode , actionEventArgs.ProductInfo.NowSimulation.OPCode); } } } } catch (Exception e) { messages.Add(new Message(e)); } dataCollectDebug.WhenFunctionOut(messages); return(messages); }
public Messages Execute(ActionEventArgs actionEventArgs, ActionCheckStatus actionCheckStatus) { Messages messages = new Messages(); DataCollectDebug dataCollectDebug = new DataCollectDebug(this.GetType().ToString() + "Collect"); dataCollectDebug.WhenFunctionIn(messages); Messages msgAutoGoMO = new Messages(); // Added by Icyer 2007/03/09 try { // Added by Icyer 2007/03/09 // 检测自动归属工单 ActionGoToMO actionGoToMO = new ActionGoToMO(this.DataProvider); msgAutoGoMO = actionGoToMO.AutoGoMO(actionEventArgs); // Added end // Added by Icyer 2006/12/03 // 自动做Undo messages.AddMessages((new ActionUndoNG(this.DataProvider)).UndoNG(actionEventArgs)); // Added end ActionOnLineHelper dataCollect = new ActionOnLineHelper(this.DataProvider); //填写SIMULATION 检查工单、ID、途程、操作 messages.AddMessages(dataCollect.CheckID(actionEventArgs, actionCheckStatus)); if (messages.IsSuccess()) { //Laws Lu,2005/08/15,新增 完工逻辑,在其他Check都通过的情况下,所有的RunningCard应该是GOOD状态 //暂时不考虑线外工序 DataCollectFacade dataCollectFacade = new DataCollectFacade(this.DataProvider); if (actionEventArgs.ProductInfo.NowSimulation.RouteCode != "" && dataCollectFacade.OPIsMORouteLastOP( actionEventArgs.ProductInfo.NowSimulation.MOCode , actionEventArgs.ProductInfo.NowSimulation.RouteCode , actionEventArgs.ProductInfo.NowSimulation.OPCode)) { actionEventArgs.ProductInfo.NowSimulation.IsComplete = "1"; actionEventArgs.ProductInfo.NowSimulation.EAttribute1 = "GOOD"; //完工自动入库 dataCollectFacade.AutoInventory(actionEventArgs.ProductInfo.NowSimulation, actionEventArgs.UserCode); } //End Laws Lu if (actionCheckStatus.NeedUpdateSimulation == true) { messages.AddMessages(dataCollect.Execute(actionEventArgs)); } else { messages.AddMessages(dataCollect.Execute(actionEventArgs, actionCheckStatus)); } if (messages.IsSuccess()) { // 自动产生送检批 messages.AddMessages(this.GenerateLot(actionEventArgs)); if (messages.IsSuccess()) { //填写测试报表 TODO //if (actionCheckStatus.NeedFillReport == true) //{ // ReportHelper reportCollect = new ReportHelper(this.DataProvider); // messages.AddMessages(reportCollect.ReportLineQuanMaster(this.DataProvider, actionEventArgs.ActionType, actionEventArgs.ProductInfo, actionCheckStatus)); // messages.AddMessages(reportCollect.ReportResQuanMaster(this.DataProvider, actionEventArgs.ActionType, actionEventArgs.ProductInfo, actionCheckStatus)); //} //将Action加入列表 actionCheckStatus.ActionList.Add(actionEventArgs); } } } } catch (Exception e) { messages.Add(new Message(e)); } dataCollectDebug.WhenFunctionOut(messages); //return messages; if (msgAutoGoMO.Count() < 1 || (msgAutoGoMO.IsSuccess() == true && messages.IsSuccess() == false)) { return(messages); } else { msgAutoGoMO.IgnoreError(); msgAutoGoMO.AddMessages(messages); return(msgAutoGoMO); } }
public Messages Execute(ActionEventArgs actionEventArgs, ActionCheckStatus actionCheckStatus) { Messages messages = new Messages(); DataCollectDebug dataCollectDebug = new DataCollectDebug(this.GetType().ToString() + "Collect"); dataCollectDebug.WhenFunctionIn(messages); try { if (((OutLineActionEventArgs)actionEventArgs).OPCode == string.Empty) { throw new Exception("$CS_Sys_OutLine_LostOPParam"); } string opCode = ((OutLineActionEventArgs)actionEventArgs).OPCode; //检查ErrorCode,ErrorGroup是否正确 TODO //如果CS能确保ErrorCode,ErrorGroup是正确的,此处逻辑可以去掉 if (actionEventArgs.ActionType == ActionType.DataCollectAction_OutLineNG) { } messages.AddMessages(this.CheckIDIn(actionEventArgs)); if (messages.IsSuccess()) { ActionOnLineHelper dataCollect = new ActionOnLineHelper(this.DataProvider); //补充SIMULATION 不良信息 if (actionEventArgs.ActionType == ActionType.DataCollectAction_OutLineNG) { actionEventArgs.ProductInfo.NowSimulation.ProductStatus = ProductStatus.NG; actionEventArgs.ProductInfo.NowSimulation.NGTimes = actionEventArgs.ProductInfo.NowSimulation.NGTimes + 1; } if (actionEventArgs.ActionType == ActionType.DataCollectAction_OutLineGood) { actionEventArgs.ProductInfo.NowSimulation.ProductStatus = ProductStatus.GOOD; //Laws Lu,2005/08/15,新增 完工逻辑,在其他Check都通过的情况下,所有的RunningCard应该是GOOD状态 //暂时不考虑线外工序 // DataCollectFacade dataCollectFacade = new DataCollectFacade(this.DataProvider); // if (actionEventArgs.ProductInfo.NowSimulation.RouteCode == "" && dataCollectFacade.OPIsMORouteLastOP( // actionEventArgs.ProductInfo.NowSimulation.MOCode // ,actionEventArgs.ProductInfo.NowSimulation.FromRoute // ,actionEventArgs.ProductInfo.NowSimulation.FromOP)) // { // actionEventArgs.ProductInfo.NowSimulation.IsComplete = "1"; // actionEventArgs.ProductInfo.NowSimulation.EAttribute1 = "GOOD"; // } //End Laws Lu } if (actionCheckStatus.NeedUpdateSimulation == true) { messages.AddMessages(dataCollect.Execute(actionEventArgs)); } else { messages.AddMessages(dataCollect.Execute(actionEventArgs, actionCheckStatus)); } if (messages.IsSuccess()) { if (actionCheckStatus.NeedFillReport == true) { // //填写测试报表 TODO //ReportHelper reportCollect= new ReportHelper(this.DataProvider); //messages.AddMessages(reportCollect.ReportLineQuanMaster(this.DataProvider,actionEventArgs.ActionType,actionEventArgs.ProductInfo)); //messages.AddMessages(reportCollect.ReportResQuanMaster(this.DataProvider,actionEventArgs.ActionType,actionEventArgs.ProductInfo)); if (actionEventArgs.ActionType == ActionType.DataCollectAction_OutLineNG) { messages.AddMessages(dataCollect.CollectErrorInformation(this.DataProvider, actionEventArgs.ActionType, actionEventArgs.ProductInfo, ((OutLineActionEventArgs)actionEventArgs).ErrorCodes, null, ((OutLineActionEventArgs)actionEventArgs).Memo)); //messages.AddMessages(reportCollect.ReportLineECOQuanMaster(this.DataProvider,actionEventArgs.ActionType,actionEventArgs.ProductInfo,((OutLineActionEventArgs)actionEventArgs).ErrorCodes)); } } } } } catch (Exception e) { messages.Add(new Message(e)); } dataCollectDebug.WhenFunctionOut(messages); return(messages); }
/// <summary> /// 不良品采集 /// </summary> /// <param name="domainDataProvider"></param> /// <param name="iD"></param> /// <param name="actionType"></param> /// <param name="resourceCode"></param> /// <param name="userCode"></param> /// <param name="product"></param> /// <param name="datas1"></param> /// <param name="datas2"></param> /// <returns></returns> public Messages Execute(ActionEventArgs actionEventArgs, ActionCheckStatus actionCheckStatus) { Messages messages = new Messages(); DataCollectDebug dataCollectDebug = new DataCollectDebug(this.GetType().ToString() + "Collect"); dataCollectDebug.WhenFunctionIn(messages); Messages msgAutoGoMO = new Messages(); // Added by Icyer 2007/03/09 try { // Added by Icyer 2007/03/09 // 检测自动归属工单 ActionGoToMO actionGoToMO = new ActionGoToMO(this.DataProvider); msgAutoGoMO = actionGoToMO.AutoGoMO(actionEventArgs); // Added end //检查ErrorCode,ErrorGroup是否正确 TODO //如果CS能确保ErrorCode,ErrorGroup是正确的,此处逻辑可以去掉 // Added by Icyer 2006/12/03 // 自动做Undo messages.AddMessages((new ActionUndoNG(this.DataProvider)).UndoNG(actionEventArgs)); // Added end ActionOnLineHelper dataCollect = new ActionOnLineHelper(this.DataProvider); //填写SIMULATION 检查工单、ID、途程、操作 messages.AddMessages(dataCollect.CheckID(actionEventArgs, actionCheckStatus)); if (messages.IsSuccess()) { //补充SIMULATION 不良信息 actionEventArgs.ProductInfo.NowSimulation.ProductStatus = ProductStatus.NG; actionEventArgs.ProductInfo.NowSimulation.NGTimes = actionEventArgs.ProductInfo.NowSimulation.NGTimes + 1; if (actionEventArgs.CurrentMO != null) { actionEventArgs.ProductInfo.NowSimulation.RMABillCode = actionEventArgs.CurrentMO.RMABillCode; } else { MO mo = (new MOFacade(DataProvider)).GetMO(actionEventArgs.ProductInfo.NowSimulation.MOCode) as MO; actionEventArgs.CurrentMO = mo; actionEventArgs.ProductInfo.NowSimulation.RMABillCode = mo.RMABillCode; } if (actionCheckStatus.NeedUpdateSimulation) { messages.AddMessages(dataCollect.Execute(actionEventArgs)); } else { messages.AddMessages(dataCollect.Execute(actionEventArgs, actionCheckStatus)); } if (messages.IsSuccess()) { if (actionCheckStatus.NeedFillReport == true) { //Laws Lu,2005/12/19,新增 获取ErrorGroup2ErrorCode if (actionEventArgs.ActionType == ActionType.DataCollectAction_NG) { actionEventArgs.ProductInfo.ECG2ErrCodes = ParseECG2Errs(((TSActionEventArgs)actionEventArgs).ErrorCodes, actionEventArgs.ActionType); } else { actionEventArgs.ProductInfo.ECG2ErrCodes = ParseECG2Errs(((TSActionEventArgs)actionEventArgs).ErrorInfor, actionEventArgs.ActionType); } //ReportHelper reportCollect = new ReportHelper(this.DataProvider); //messages.AddMessages(reportCollect.ReportLineQuanMaster(this.DataProvider, actionEventArgs.ActionType, actionEventArgs.ProductInfo)); //messages.AddMessages(reportCollect.ReportResQuanMaster(this.DataProvider, actionEventArgs.ActionType, actionEventArgs.ProductInfo)); //if (actionEventArgs.ActionType == ActionType.DataCollectAction_NG) // messages.AddMessages(reportCollect.ReportResECMaster(this.DataProvider, actionEventArgs.ActionType, actionEventArgs.ProductInfo, ((TSActionEventArgs)actionEventArgs).ErrorCodes)); //else // messages.AddMessages(reportCollect.ReportResECMaster(this.DataProvider, actionEventArgs.ActionType, actionEventArgs.ProductInfo, ((TSActionEventArgs)actionEventArgs).ErrorInfor)); //// if (actionEventArgs.ActionType==ActionType.DataCollectAction_NG) //// messages.AddMessages(reportCollect.ReportResECMaster(this.DataProvider,actionEventArgs.ActionType,actionEventArgs.ProductInfo,((TSActionEventArgs)actionEventArgs).ErrorCodes)); //// else //// messages.AddMessages(reportCollect.ReportResECMaster(this.DataProvider,actionEventArgs.ActionType,actionEventArgs.ProductInfo,((TSActionEventArgs)actionEventArgs).ErrorInfor)); //if (actionEventArgs.ActionType == ActionType.DataCollectAction_NG) // messages.AddMessages(reportCollect.ReportLineECOQuanMaster(this.DataProvider, actionEventArgs.ActionType, actionEventArgs.ProductInfo, ((TSActionEventArgs)actionEventArgs).ErrorCodes)); //else // messages.AddMessages(reportCollect.ReportLineECOQuanMaster(this.DataProvider, actionEventArgs.ActionType, actionEventArgs.ProductInfo, ((TSActionEventArgs)actionEventArgs).ErrorInfor)); } //填写测试报表 TODO if (actionEventArgs.ActionType == ActionType.DataCollectAction_SMTNG) { messages.AddMessages(dataCollect.CollectErrorInfor(this.DataProvider, actionEventArgs.ActionType, actionEventArgs.ProductInfo, ((TSActionEventArgs)actionEventArgs).ErrorInfor, ((TSActionEventArgs)actionEventArgs).Memo)); } else { messages.AddMessages(dataCollect.CollectErrorInformation(this.DataProvider, actionEventArgs.ActionType, actionEventArgs.ProductInfo, ((TSActionEventArgs)actionEventArgs).ErrorCodes, null, ((TSActionEventArgs)actionEventArgs).Memo)); } // Added By Hi1/Venus.Feng on 20080711 for Hisense Version : Auto Set RCard Reflow Route and OP by ErrorCode if (messages.IsSuccess() == true) { messages.AddMessages(this.SetRCardReflowByErrorCode(actionEventArgs)); } } if (messages.IsSuccess()) { DataCollectFacade dataCollectFacade = new DataCollectFacade(this.DataProvider); dataCollectFacade.TryToDeleteRCardFromLot(actionEventArgs.RunningCard); } } } catch (Exception e) { messages.Add(new Message(e)); } dataCollectDebug.WhenFunctionOut(messages); //return messages; if (msgAutoGoMO.Count() < 1 || (msgAutoGoMO.IsSuccess() == true && messages.IsSuccess() == false)) { return(messages); } else { msgAutoGoMO.IgnoreError(); msgAutoGoMO.AddMessages(messages); return(msgAutoGoMO); } }
private void WriteSoftwareInfo(SoftwareActionEventArgs actionEventArgs, DataCollectFacade facade, ActionCheckStatus actionCheckStatus) { SimulationReport report = actionEventArgs.ProductInfo.NowSimulationReport; OnWIPSoftVersion onWIPSoftVersion = facade.CreateNewOnWIPSoftVersion(); onWIPSoftVersion.SoftwareVersion = actionEventArgs.SoftwareVersion; onWIPSoftVersion.SoftwareName = actionEventArgs.SoftwareName; onWIPSoftVersion.RunningCard = report.RunningCard; onWIPSoftVersion.RunningCardSequence = report.RunningCardSequence; onWIPSoftVersion.MOCode = report.MOCode; onWIPSoftVersion.ItemCode = report.ItemCode; onWIPSoftVersion.ResourceCode = report.ResourceCode; onWIPSoftVersion.OPCode = report.OPCode; onWIPSoftVersion.RouteCode = report.RouteCode; onWIPSoftVersion.ModelCode = report.ModelCode; onWIPSoftVersion.MaintainDate = report.MaintainDate; onWIPSoftVersion.MaintainTime = report.MaintainTime; onWIPSoftVersion.MaintainUser = report.MaintainUser; onWIPSoftVersion.ShiftTypeCode = report.ShiftTypeCode; onWIPSoftVersion.StepSequenceCode = report.StepSequenceCode; onWIPSoftVersion.SegmnetCode = report.SegmentCode; onWIPSoftVersion.ShiftCode = report.ShiftCode; onWIPSoftVersion.TimePeriodCode = report.TimePeriodCode; onWIPSoftVersion.MOSeq = report.MOSeq; // Added by Icyer 2007/07/02 if (actionCheckStatus == null || actionCheckStatus.NeedUpdateSimulation == true) { facade.AddOnWIPSoftVersion(onWIPSoftVersion); } else { actionEventArgs.OnWIP.Add(onWIPSoftVersion); } }
public Messages Execute(ActionEventArgs actionEventArgs, ActionCheckStatus actionCheckStatus) { Messages messages = new Messages(); return(messages); }
public Messages Execute(ActionEventArgs actionEventArgs, ActionCheckStatus actionCheckStatus) { return(new Messages()); }
// Added by Icyer 2005/10/28 public Messages Execute(ActionEventArgs actionEventArgs, ActionCheckStatus actionCheckStatus) { Messages messages = new Messages(); DataCollectDebug dataCollectDebug = new DataCollectDebug(this.GetType().ToString() + "Collect"); dataCollectDebug.WhenFunctionIn(messages); try { DataCollectFacade facade = new DataCollectFacade(this.DataProvider); ActionOnLineHelper helper = new ActionOnLineHelper(this.DataProvider); if (actionEventArgs.ProductInfo == null) { actionEventArgs.ProductInfo = actionCheckStatus.ProductInfo; if (actionEventArgs.ProductInfo == null) { // 获得LastSimulation messages.AddMessages(helper.GetIDInfo(actionEventArgs.RunningCard)); if (messages.IsSuccess()) { actionEventArgs.ProductInfo = (ProductInfo)messages.GetData().Values[0]; actionCheckStatus.ProductInfo = (ProductInfo)messages.GetData().Values[0]; } } } if (actionEventArgs.ProductInfo == null) { throw new Exception("$NoProductInfo"); } if (actionEventArgs.ProductInfo.LastSimulation == null) { throw new Exception("$NoSimulationInfo"); } if (messages.IsSuccess()) { //如果没有检查过工单 if (actionCheckStatus.CheckedMO == false) { facade.CheckMO(actionEventArgs.ProductInfo.LastSimulation.MOCode, actionEventArgs.ProductInfo); } facade.GetRouteOPOnline(actionEventArgs.RunningCard, actionEventArgs.ActionType, actionEventArgs.ResourceCode, actionEventArgs.UserCode, actionEventArgs.ProductInfo, actionCheckStatus); //Laws Lu,2006/11/13 add uniform collect date time DBDateTime dbDateTime; dbDateTime = FormatHelper.GetNowDBDateTime(DataProvider); actionEventArgs.ProductInfo.NowSimulation.MaintainUser = actionEventArgs.UserCode; actionEventArgs.ProductInfo.NowSimulation.MaintainDate = dbDateTime.DBDate; actionEventArgs.ProductInfo.NowSimulation.MaintainTime = dbDateTime.DBTime; actionEventArgs.ProductInfo.NowSimulationReport = helper.FillSimulationReport(actionEventArgs.ProductInfo); // 填写SoftwareVersion报表 this.WriteSoftwareInfo((SoftwareActionEventArgs)actionEventArgs, facade, actionCheckStatus); //将Action加入列表 actionCheckStatus.ActionList.Add(actionEventArgs); } } catch (Exception e) { messages.Add(new Message(e)); } dataCollectDebug.WhenFunctionOut(messages); return(messages); }
private Messages SetReworkInformation(Messages messages, object[] Simulations, OQCRejectEventArgs actionEventArgs, ActionOnLineHelper dataCollect, ReworkFacade reworkFacade) { Messages newMessages = new Messages(); BenQGuru.eMES.TS.TSFacade tsFacade = new BenQGuru.eMES.TS.TSFacade(this.DataProvider); DataCollectFacade dcf = new DataCollectFacade(this._domainDataProvider); //ProductInfo preProduct =null; int i = 0; ActionCheckStatus actionCheckStatus = new ActionCheckStatus(); if (Resource == null) { BenQGuru.eMES.BaseSetting.BaseModelFacade dataModel = new BenQGuru.eMES.BaseSetting.BaseModelFacade(this.DataProvider); Resource = (Domain.BaseSetting.Resource)dataModel.GetResource(actionEventArgs.ResourceCode); } while (i < Simulations.Length) { try { #region 保存WIP ProductInfo productionInf = dataCollect.GetIDInfoBySimulation((Simulation)Simulations[i]); if (actionEventArgs.listActionCheckStatus.ContainsKey(productionInf.LastSimulation.MOCode)) { actionCheckStatus = (ActionCheckStatus)actionEventArgs.listActionCheckStatus[productionInf.LastSimulation.MOCode]; actionCheckStatus.ProductInfo = productionInf; actionCheckStatus.ProductInfo.Resource = Resource; // lastSimulation = productionInf.LastSimulation; actionCheckStatus.ActionList = new ArrayList(); } else { //actionCheckStatus.NeedUpdateSimulation = false; //actionCheckStatus.NeedFillReport = true; actionEventArgs.listActionCheckStatus.Add(productionInf.LastSimulation.MOCode, actionCheckStatus); } OQCRejectEventArgs oqcRejectEventArgs = new OQCRejectEventArgs( ActionType.DataCollectAction_OQCReject, ((Simulation)Simulations[i]).RunningCard, actionEventArgs.UserCode, actionEventArgs.ResourceCode, actionEventArgs.OQCLotNO, productionInf); newMessages.AddMessages(dataCollect.CheckID(oqcRejectEventArgs, actionCheckStatus)); // if (preProduct != null) // { // if (dataCollect.CompareSimulationCheck(preProduct.LastSimulation,oqcRejectEventArgs.ProductInfo.LastSimulation)) // { // dataCollect.CopyProduct(preProduct,oqcRejectEventArgs.ProductInfo); // dcf.WriteSimulationCheckOnlineOP(oqcRejectEventArgs.RunningCard,oqcRejectEventArgs.ActionType,oqcRejectEventArgs.ResourceCode, // oqcRejectEventArgs.UserCode,oqcRejectEventArgs.ProductInfo); // needCheck=false; // } // } // if (needCheck) // newMessages.AddMessages(dataCollect.CheckID(oqcRejectEventArgs)); if (!newMessages.IsSuccess()) { return(newMessages); } #region TS //Laws Lu,需要修改 曾经走过TS处理,没有考虑多次TS的情况,MOCode和Sequence也应该作为关键参数, BenQGuru.eMES.Domain.TS.TS ts = (BenQGuru.eMES.Domain.TS.TS)tsFacade.GetCardLastTSRecord(oqcRejectEventArgs.RunningCard); if (ActionType.DataCollectAction_OQCReject == oqcRejectEventArgs.ActionType && ts != null && ts.FromInputType == TS.TSFacade.TSSource_OnWIP ) { //Laws Lu,2006/07/07 修复在OQC前工序NG回流后,SN后仍然留在PK站 dcf.AdjustRouteOPOnline(oqcRejectEventArgs.RunningCard , ActionType.DataCollectAction_OQCReject , oqcRejectEventArgs.ResourceCode , oqcRejectEventArgs.UserCode , oqcRejectEventArgs.ProductInfo); //oqcRejectEventArgs.ProductInfo.NowSimulation.OPCode = op.OPCode; dcf.WriteSimulation( oqcRejectEventArgs.RunningCard , ActionType.DataCollectAction_OQCReject , oqcRejectEventArgs.ResourceCode , oqcRejectEventArgs.UserCode , oqcRejectEventArgs.ProductInfo); } #endregion //Laws Lu,2006/07/07 fix op if (oqcRejectEventArgs.ProductInfo.CurrentItemRoute2OP != null) { oqcRejectEventArgs.ProductInfo.NowSimulation.OPCode = oqcRejectEventArgs.ProductInfo.CurrentItemRoute2OP.OPCode; } else { object objNextOP = (new BaseModelFacade(DataProvider)).GetNextOperationOfRoute(oqcRejectEventArgs.ProductInfo.LastSimulation.RouteCode, oqcRejectEventArgs.ProductInfo.LastSimulation.OPCode); if (objNextOP != null) { oqcRejectEventArgs.ProductInfo.NowSimulation.OPCode = (objNextOP as Operation).OPCode; } } oqcRejectEventArgs.ProductInfo.NowSimulation.ProductStatus = ProductStatus.Reject; if (actionCheckStatus.NeedUpdateSimulation == true) { //把资源暂时替换成onwip需要正确资源 string resCode = oqcRejectEventArgs.ResourceCode; oqcRejectEventArgs.ResourceCode = actionEventArgs.rightResource; newMessages.AddMessages(dataCollect.Execute(oqcRejectEventArgs)); //转换回原来的资源 oqcRejectEventArgs.ResourceCode = resCode; } #endregion if (newMessages.IsSuccess()) { if (oqcRejectEventArgs.ProductInfo.NowSimulation == null) { throw new Exception("$System_Error"); } #region reject Reject reject = reworkFacade.CreateNewReject(); reject.ItemCode = oqcRejectEventArgs.ProductInfo.NowSimulation.ItemCode; reject.LOTNO = oqcRejectEventArgs.OQCLotNO; reject.MaintainUser = oqcRejectEventArgs.UserCode; reject.MOCode = oqcRejectEventArgs.ProductInfo.NowSimulation.MOCode; reject.ModelCode = oqcRejectEventArgs.ProductInfo.NowSimulation.ModelCode; reject.OPCode = oqcRejectEventArgs.ProductInfo.NowSimulation.OPCode; reject.RejectDate = oqcRejectEventArgs.ProductInfo.NowSimulation.MaintainDate; reject.RejectStatus = RejectStatus.Reject; reject.RejectTime = oqcRejectEventArgs.ProductInfo.NowSimulation.MaintainTime; reject.RejectUser = oqcRejectEventArgs.UserCode; reject.ResourceCode = oqcRejectEventArgs.ResourceCode; reject.RouteCode = oqcRejectEventArgs.ProductInfo.NowSimulation.RouteCode; reject.RunningCard = oqcRejectEventArgs.RunningCard; reject.RunningCardSequence = oqcRejectEventArgs.ProductInfo.NowSimulation.RunningCardSequence; reject.SegmentCode = oqcRejectEventArgs.ProductInfo.NowSimulationReport.SegmentCode; reject.SourceCard = oqcRejectEventArgs.ProductInfo.NowSimulation.SourceCard; reject.SourceCardSequence = oqcRejectEventArgs.ProductInfo.NowSimulation.SourceCardSequence; reject.StepSequenceCode = oqcRejectEventArgs.ProductInfo.NowSimulationReport.StepSequenceCode; reject.TranslateCard = oqcRejectEventArgs.ProductInfo.NowSimulation.TranslateCard; reject.TranslateCardSequence = oqcRejectEventArgs.ProductInfo.NowSimulation.TranslateCardSequence; reject.MOSeq = oqcRejectEventArgs.ProductInfo.NowSimulation.MOSeq; // Added by Icyer 2007/07/02 reworkFacade.AddReject(reject); #endregion } //Laws Lu,2005/08/25,新增 //样本如果有若干个已经经过“送修确认”转为“待修”状态(或者在维修中),那么批退不可以继续 //TSFacade tsFacade = new TSFacade(this._domainDataProvider); //Laws Lu,2005/08/25,新增 删除TS中的记录 //Laws Lu,2005/08/31,修改 只有FQC工序送修才能够被删除 if (oqcRejectEventArgs.ActionType == ActionType.DataCollectAction_OQCReject && ts != null && ts.FromInputType == TS.TSFacade.TSSource_OnWIP && ts.TSStatus == BenQGuru.eMES.Web.Helper.TSStatus.TSStatus_New) { if (ts.FromRouteCode == oqcRejectEventArgs.ProductInfo.LastSimulation.RouteCode && ts.FromOPCode == oqcRejectEventArgs.ProductInfo.LastSimulation.OPCode && ts.MOCode == oqcRejectEventArgs.ProductInfo.LastSimulation.MOCode && ts.RunningCardSequence == oqcRejectEventArgs.ProductInfo.LastSimulation.RunningCardSequence && ts.RunningCard == oqcRejectEventArgs.ProductInfo.LastSimulation.RunningCard) { tsFacade.DeleteCardInTS( oqcRejectEventArgs.ProductInfo.LastSimulation.MOCode , oqcRejectEventArgs.ProductInfo.LastSimulation.RunningCard , oqcRejectEventArgs.ProductInfo.LastSimulation.RunningCardSequence.ToString()); } } } catch (Exception ex) { newMessages.Add(new Message(ex)); } //preProduct=oqcRejectEventArgs.ProductInfo; i = i + 1; } //Laws Lu,2006/03/20 填写资源报表 //Laws Lu,2006/03/21 支持混单 Hashtable htOutput = new Hashtable(); foreach (Simulation sim in Simulations) { Simulation tmpSim = null; foreach (Simulation x in htOutput.Keys) { if (sim.MOCode == x.MOCode) { tmpSim = x; break; } } if (tmpSim != null) { htOutput[tmpSim] = Convert.ToInt32(htOutput[tmpSim]) + 1; } else { htOutput.Add(sim, 1); } } foreach (Simulation sim in htOutput.Keys) { ProductInfo product = null; Messages msgs = dataCollect.GetIDInfo(sim.RunningCard); if (msgs.IsSuccess()) { product = msgs.GetData().Values[0] as ProductInfo; } DBDateTime dbDateTime; dbDateTime = FormatHelper.GetNowDBDateTime(DataProvider); // dcf.AdjustRouteOPOnline( // product.LastSimulation.RunningCard, // actionEventArgs.ActionType, // actionEventArgs.ResourceCode, // actionEventArgs.UserCode, // product); product.NowSimulation.MaintainUser = actionEventArgs.UserCode; product.NowSimulation.MaintainDate = dbDateTime.DBDate; product.NowSimulation.MaintainTime = dbDateTime.DBTime; product.NowSimulation.LastAction = actionEventArgs.ActionType; product.NowSimulation.ProductStatus = ProductStatus.GOOD; product.NowSimulation.ResourceCode = Resource.ResourceCode; (new DataCollectFacade(DataProvider)).WriteSimulation( product.LastSimulation.RunningCard , ActionType.DataCollectAction_OQCPass , actionEventArgs.ResourceCode , actionEventArgs.UserCode , product); product.NowSimulation.RouteCode = product.LastSimulation.RouteCode; product.NowSimulation.OPCode = product.LastSimulation.OPCode;; product.NowSimulationReport = dataCollect.FillSimulationReport(product); //dataCollect.FillOnWip(pro); //newMessages.AddMessages((new ReportHelper(DataProvider)).SetReportResQuanMaster( // DataProvider // , actionEventArgs.ActionType // , product // , 0 // , Convert.ToInt32(htOutput[sim]) // , Convert.ToInt32(htOutput[sim]))); } return(newMessages); }
public Messages Execute(ActionEventArgs actionEventArgs, ActionCheckStatus actionCheckStatus) { Messages messages = new Messages(); DataCollectDebug dataCollectDebug = new DataCollectDebug(this.GetType().ToString() + "Collect"); dataCollectDebug.WhenFunctionIn(messages); try { ActionOnLineHelper dataCollect = new ActionOnLineHelper(this.DataProvider); //填写SIMULATION 检查工单、ID、途程、操作 messages.AddMessages(dataCollect.CheckID(actionEventArgs, actionCheckStatus)); if (messages.IsSuccess()) { // 0. 检查OQC Lot // 1. OQCFuncTestValue // 2. OQCFuncTestValueDetail // 3. OQCFuncTestValueEleDetail OQCFuncTestActionEventArgs args = (OQCFuncTestActionEventArgs)actionEventArgs; Simulation sim = args.ProductInfo.LastSimulation; OQCFacade oqcFacade = new OQCFacade(this.DataProvider); OQCLot oqcLot = (OQCLot)oqcFacade.GetOQCLot(sim.LOTNO, OQCFacade.Lot_Sequence_Default); if (oqcLot.LOTStatus != OQCLotStatus.OQCLotStatus_Examing && oqcLot.LOTStatus != OQCLotStatus.OQCLotStatus_NoExame) { messages.Add(new Message(MessageType.Error, "$OQCLot_Status_Must_Be_Examing")); } if (messages.IsSuccess()) { BenQGuru.eMES.BaseSetting.BaseModelFacade baseFacade = new BaseModelFacade(this.DataProvider); Resource resource = (Resource)baseFacade.GetResource(args.ResourceCode); Operation operation = (Operation)baseFacade.GetOperationByRouteAndResource(sim.RouteCode, resource.ResourceCode); if (operation == null) { operation = new Operation(); } // 1. OQCFuncTestValue OQCFuncTestValue testValue = new OQCFuncTestValue(); testValue.RunningCard = args.RunningCard; testValue.RunningCardSequence = sim.RunningCardSequence; testValue.ModelCode = sim.ModelCode; testValue.ItemCode = sim.ItemCode; testValue.MOCode = sim.MOCode; testValue.LotNO = sim.LOTNO; testValue.LotSequence = oqcLot.LotSequence; testValue.FuncTestGroupCount = args.oqcFuncTest.FuncTestGroupCount; testValue.MinDutyRatoMin = args.oqcFuncTest.MinDutyRatoMin; testValue.MinDutyRatoMax = args.oqcFuncTest.MinDutyRatoMax; testValue.MinDutyRatoValue = args.minDutyRatoValue; testValue.BurstMdFreMin = args.oqcFuncTest.BurstMdFreMin; testValue.BurstMdFreMax = args.oqcFuncTest.BurstMdFreMax; testValue.BurstMdFreValue = args.burstMdFreValue; testValue.ElectricTestCount = args.oqcFuncTest.ElectricTestCount; testValue.OPCode = operation.OPCode; testValue.StepSequenceCode = resource.StepSequenceCode; testValue.SegmentCode = resource.SegmentCode; testValue.ResourceCode = args.ResourceCode; if (args.Result == true) { testValue.ProductStatus = ProductStatus.GOOD; } else { testValue.ProductStatus = ProductStatus.NG; } testValue.MaintainUser = args.UserCode; DBDateTime dbDateTime; //Laws Lu,2006/11/13 uniform system collect date if (actionEventArgs.ProductInfo.WorkDateTime != null) { dbDateTime = actionEventArgs.ProductInfo.WorkDateTime; } else { dbDateTime = FormatHelper.GetNowDBDateTime(DataProvider); actionEventArgs.ProductInfo.WorkDateTime = dbDateTime; } testValue.MaintainDate = dbDateTime.DBDate; testValue.MaintainTime = dbDateTime.DBTime; /* modified by jessie lee, 2006/8/10 */ object obj = oqcFacade.GetOQCFuncTestValue(args.RunningCard, sim.RunningCardSequence); if (obj == null) { oqcFacade.AddOQCFuncTestValue(testValue); } else { oqcFacade.UpdateOQCFuncTestValue(testValue); //// Added by Icyer 2007/01/12 如果是重复测试,则需要先删除原来的数据 //OQCFuncTestValue testValueTmp = (OQCFuncTestValue)obj; //BenQGuru.eMES.SPCDataCenter.DataHandler deleteHandler = new BenQGuru.eMES.SPCDataCenter.DataHandler(this.DataProvider); //deleteHandler.DeleteData(SPCObjectList.OQC_FT_FREQUENCY, testValueTmp.ItemCode, testValueTmp.MOCode, testValueTmp.RunningCard, testValueTmp.RunningCardSequence, testValueTmp.MaintainDate); //// Added end } //// Added by Icyer 2006-08-11 //BenQGuru.eMES.SPCDataCenter.DataEntry dataEntry = new BenQGuru.eMES.SPCDataCenter.DataEntry(); //dataEntry.ModelCode = sim.ModelCode; //dataEntry.ItemCode = sim.ItemCode; //dataEntry.MOCode = sim.MOCode; //dataEntry.RunningCard = sim.RunningCard; //dataEntry.RunningCardSequence = sim.RunningCardSequence; //dataEntry.SegmentCode = resource.SegmentCode; //dataEntry.LineCode = resource.StepSequenceCode; //dataEntry.ResourceCode = resource.ResourceCode; //dataEntry.OPCode = sim.OPCode; //dataEntry.LotNo = sim.LOTNO; //dataEntry.TestDate = testValue.MaintainDate; //dataEntry.TestTime = testValue.MaintainTime; //if (args.Result == true) // dataEntry.TestResult = "P"; //else // dataEntry.TestResult = "F"; //dataEntry.TestUser = args.UserCode; //dataEntry.AddTestData(SPCObjectList.OQC_DUTY_RATO, args.minDutyRatoValue); //dataEntry.AddTestData(SPCObjectList.OQC_BURST_MD, args.burstMdFreValue); //for (int i = 0; i < args.oqcFuncTest.FuncTestGroupCount; i++) //{ // dataEntry.AddTestData(SPCObjectList.OQC_FT_FREQUENCY, i + 1, Convert.ToDecimal(args.listTestValueFre[i])); // Hashtable ht = (Hashtable)args.listTestValueEle[i]; // decimal[] dataEle = new decimal[Convert.ToInt32(args.oqcFuncTest.ElectricTestCount)]; // for (int n = 0; n < args.oqcFuncTest.ElectricTestCount; n++) // { // dataEle[n] = Convert.ToDecimal(ht[(n + 1).ToString()]); // } // dataEntry.AddTestData(SPCObjectList.OQC_FT_ELECTRIC, i + 1, dataEle); //} //BenQGuru.eMES.SPCDataCenter.DataHandler handler = new BenQGuru.eMES.SPCDataCenter.DataHandler(this.DataProvider); //messages.AddMessages(handler.CollectData(dataEntry)); //// Added end } } } catch (Exception e) { messages.Add(new Message(e)); } dataCollectDebug.WhenFunctionOut(messages); return(messages); }
private void WriteTryInfo(EcnTryActionEventArgs actionEventArgs, DataCollectFacade facade, ActionCheckStatus actionCheckStatus) { SimulationReport report = actionEventArgs.ProductInfo.NowSimulationReport; List <string> TryList = new List <string>(); if (actionEventArgs.TryNo.Trim().Length > 0) { string TryCode = actionEventArgs.TryNo.Trim(); if (TryCode.IndexOf(",") >= 0) { string[] TryCodeList = TryCode.Split(','); for (int i = 0; i < TryCodeList.Length; i++) { TryList.Add(TryCodeList[i]); } } else { TryList.Add(TryCode); } } if (TryList.Count > 0) { for (int i = 0; i < TryList.Count; i++) { OnWIPTRY onWIPTRY = facade.CreateNewOnWIPTRY(); onWIPTRY.TRYNO = TryList[i].ToString().ToUpper(); onWIPTRY.RunningCard = report.RunningCard; onWIPTRY.RunningCardSequence = report.RunningCardSequence; onWIPTRY.MOCode = report.MOCode; onWIPTRY.ItemCode = report.ItemCode; onWIPTRY.ResourceCode = report.ResourceCode; onWIPTRY.OPCode = report.OPCode; onWIPTRY.RouteCode = report.RouteCode; onWIPTRY.ModelCode = report.ModelCode; onWIPTRY.MaintainDate = report.MaintainDate; onWIPTRY.MaintainTime = report.MaintainTime; onWIPTRY.MaintainUser = report.MaintainUser; onWIPTRY.ShiftTypeCode = report.ShiftTypeCode; onWIPTRY.StepSequenceCode = report.StepSequenceCode; onWIPTRY.SegmnetCode = report.SegmentCode; onWIPTRY.ShiftCode = report.ShiftCode; onWIPTRY.TimePeriodCode = report.TimePeriodCode; onWIPTRY.MOSeq = report.MOSeq; // Added by Icyer 2007/07/02 if (actionCheckStatus == null || actionCheckStatus.NeedUpdateSimulation == true) { facade.AddOnWIPTRY(onWIPTRY); } else { actionEventArgs.OnWIP.Add(onWIPTRY); } } } }
private void WriteECNInfo(EcnTryActionEventArgs actionEventArgs, DataCollectFacade facade, ActionCheckStatus actionCheckStatus) { SimulationReport report = actionEventArgs.ProductInfo.NowSimulationReport; OnWIPECN onWIPECN = facade.CreateNewOnWIPECN(); onWIPECN.ECNNO = actionEventArgs.ECNNo; onWIPECN.RunningCard = report.RunningCard; onWIPECN.RunningCardSequence = report.RunningCardSequence; onWIPECN.MOCode = report.MOCode; onWIPECN.ItemCode = report.ItemCode; onWIPECN.ResourceCode = report.ResourceCode; onWIPECN.OPCode = report.OPCode; onWIPECN.RouteCode = report.RouteCode; onWIPECN.ModelCode = report.ModelCode; onWIPECN.MaintainDate = report.MaintainDate; onWIPECN.MaintainTime = report.MaintainTime; onWIPECN.MaintainUser = report.MaintainUser; onWIPECN.ShiftTypeCode = report.ShiftTypeCode; onWIPECN.StepSequenceCode = report.StepSequenceCode; onWIPECN.SegmnetCode = report.SegmentCode; onWIPECN.ShiftCode = report.ShiftCode; onWIPECN.TimePeriodCode = report.TimePeriodCode; onWIPECN.MOSeq = report.MOSeq; // Added by Icyer 2007/07/02 if (actionCheckStatus == null || actionCheckStatus.NeedUpdateSimulation == true) { facade.AddOnWIPECN(onWIPECN); } else { actionEventArgs.OnWIP.Add(onWIPECN); } }
public Messages Execute(ActionEventArgs actionEventArgs, ActionCheckStatus actionCheckStatus) { Messages messages = new Messages(); DataCollectDebug dataCollectDebug = new DataCollectDebug(this.GetType().ToString() + "Collect"); dataCollectDebug.WhenFunctionIn(messages); OQCGoodEventArgs oqcGoodEventArgs = actionEventArgs as OQCGoodEventArgs; //added by hiro.chen 08/11/18 :判断是否已下地 DataCollectFacade dcFacade = new DataCollectFacade(this.DataProvider); messages.AddMessages(dcFacade.CheckISDown(actionEventArgs.RunningCard)); if (!messages.IsSuccess()) { return(messages); } //end try { ActionOnLineHelper dataCollect = new ActionOnLineHelper(this.DataProvider); ActionOQCHelper oqcHelper = new ActionOQCHelper(this.DataProvider); OQCFacade oqcFacade = new OQCFacade(this.DataProvider); // Added By Hi1/Venus.feng on 20080720 for Hisense Version : Change OQC Flow DBDateTime currentDateTime = FormatHelper.GetNowDBDateTime(this.DataProvider); // Some Check #region CheckOQCLotStatus object objOQClot = oqcFacade.GetOQCLot(oqcGoodEventArgs.OQCLotNO, OQCFacade.Lot_Sequence_Default); if (objOQClot == null) { throw new Exception("$Error_OQCLotNotExisted"); } if (((OQCLot)objOQClot).LOTStatus == OQCLotStatus.OQCLotStatus_Initial) { throw new Exception("$Error_OQCLotNO_Cannot_Initial"); } if ((((OQCLot)objOQClot).LOTStatus == OQCLotStatus.OQCLotStatus_Reject) || ((((OQCLot)objOQClot).LOTStatus == OQCLotStatus.OQCLotStatus_Pass))) { throw new Exception("$Error_OQCLotNO_HasComplete"); } #endregion // Update tbloqc.status #region 修改OQCLot状态 OQCLot oqcLot = new OQCLot(); oqcLot.LOTNO = oqcGoodEventArgs.OQCLotNO; oqcLot.LotSequence = OQCFacade.Lot_Sequence_Default; oqcLot.LOTStatus = Web.Helper.OQCLotStatus.OQCLotStatus_Examing; oqcFacade.UpdateOQCLotStatus(oqcLot); #endregion // Update tbloqccardlotcklist #region OQCLOTCardCheckList if (oqcGoodEventArgs.OQCLOTCardCheckLists != null) { OQCLOTCardCheckList oqcLotCardCheckList; for (int i = 0; i < oqcGoodEventArgs.OQCLOTCardCheckLists.Length; i++) { if (oqcGoodEventArgs.OQCLOTCardCheckLists[i] != null) { oqcLotCardCheckList = oqcGoodEventArgs.OQCLOTCardCheckLists[i] as OQCLOTCardCheckList; oqcLotCardCheckList.MaintainDate = currentDateTime.DBDate; oqcLotCardCheckList.MaintainTime = currentDateTime.DBTime; oqcFacade.AddOQCLOTCardCheckList(oqcLotCardCheckList); } } } #endregion // Update tbloqclotcklist #region OQCLOTCheckList object obj = oqcFacade.GetOQCLOTCheckList(oqcGoodEventArgs.OQCLotNO, OQCFacade.Lot_Sequence_Default); if (obj == null) { OQCLOTCheckList oqcCheckList = oqcFacade.CreateNewOQCLOTCheckList(); oqcCheckList.AGradeTimes = OQCFacade.Decimal_Default_value; oqcCheckList.BGradeTimes = OQCFacade.Decimal_Default_value; oqcCheckList.CGradeTimes = OQCFacade.Decimal_Default_value; oqcCheckList.ZGradeTimes = OQCFacade.Decimal_Default_value; oqcCheckList.LOTNO = oqcGoodEventArgs.OQCLotNO; oqcCheckList.LotSequence = OQCFacade.Lot_Sequence_Default; oqcCheckList.MaintainUser = oqcGoodEventArgs.UserCode; oqcCheckList.MaintainDate = currentDateTime.DBDate; oqcCheckList.MaintainTime = currentDateTime.DBTime; oqcCheckList.Result = OQCLotStatus.OQCLotStatus_Examing; oqcFacade.AddOQCLOTCheckList(GetDefectStatic(oqcGoodEventArgs.OQCLOTCardCheckLists, oqcCheckList)); } else { OQCLOTCheckList oqcCheckList = obj as OQCLOTCheckList; oqcCheckList.MaintainUser = oqcGoodEventArgs.UserCode; oqcFacade.UpdateOQCLOTCheckList(GetDefectStatic(oqcGoodEventArgs.OQCLOTCardCheckLists, oqcCheckList)); } #endregion // Update tbllot2cardcheck #region OQCLot2CardCheck OQCLot2CardCheck oqcLot2CardCheck = oqcFacade.CreateNewOQCLot2CardCheck(); oqcLot2CardCheck.ItemCode = oqcGoodEventArgs.ProductInfo.LastSimulation.ItemCode; oqcLot2CardCheck.LOTNO = oqcGoodEventArgs.OQCLotNO; oqcLot2CardCheck.MaintainUser = oqcGoodEventArgs.UserCode; oqcLot2CardCheck.MOCode = oqcGoodEventArgs.ProductInfo.LastSimulation.MOCode; oqcLot2CardCheck.ModelCode = oqcGoodEventArgs.ProductInfo.LastSimulation.ModelCode; oqcLot2CardCheck.OPCode = oqcGoodEventArgs.ProductInfo.LastSimulation.OPCode; oqcLot2CardCheck.ResourceCode = oqcGoodEventArgs.ResourceCode; oqcLot2CardCheck.RouteCode = oqcGoodEventArgs.ProductInfo.LastSimulation.RouteCode; oqcLot2CardCheck.RunningCard = oqcGoodEventArgs.ProductInfo.LastSimulation.RunningCard; oqcLot2CardCheck.RunningCardSequence = oqcGoodEventArgs.ProductInfo.LastSimulation.RunningCardSequence; BaseModelFacade dataModel = new BaseModelFacade(this.DataProvider); Resource resource = (Resource)dataModel.GetResource(oqcGoodEventArgs.ResourceCode); oqcLot2CardCheck.SegmnetCode = resource.SegmentCode; TimePeriod period = oqcGoodEventArgs.ProductInfo.TimePeriod; if (period == null) { ShiftModelFacade shiftModel = new ShiftModelFacade(this.DataProvider); period = (TimePeriod)shiftModel.GetTimePeriod(resource.ShiftTypeCode, currentDateTime.DBTime); if (period == null) { throw new Exception("$OutOfPerid"); } } oqcLot2CardCheck.ShiftCode = period.ShiftCode; oqcLot2CardCheck.ShiftTypeCode = resource.ShiftTypeCode; oqcLot2CardCheck.Status = ProductStatus.GOOD; oqcLot2CardCheck.StepSequenceCode = resource.StepSequenceCode; oqcLot2CardCheck.TimePeriodCode = period.TimePeriodCode; oqcLot2CardCheck.IsDataLink = oqcGoodEventArgs.IsDataLink; oqcLot2CardCheck.MaintainDate = currentDateTime.DBDate; oqcLot2CardCheck.MaintainTime = currentDateTime.DBTime; oqcLot2CardCheck.CheckSequence = oqcGoodEventArgs.CheckSequence; oqcLot2CardCheck.EAttribute1 = oqcGoodEventArgs.Memo; oqcFacade.AddOQCLot2CardCheck(oqcLot2CardCheck); #endregion // Good don't need update lot2errorcode or lotcard2errorcode ////// Update tbloqclot2errorcode ////// Update tbloqclotcard2errorcode messages.Add(new Message(MessageType.Success, "$CS_SampleConfirmOK")); // End Added #region Marked by hi1/Venus.Feng on 20080720 for Hisense Version : Change OQC Flow /* * //填写SIMULATION 检查工单、ID、途程、操作 * messages.AddMessages( dataCollect.CheckID(oqcGoodEventArgs)); * if (messages.IsSuccess()) * { * // * if(oqcGoodEventArgs.ProductInfo.NowSimulation == null) * { * throw new Exception("$System_Error"); * } * //check oqclotstatus #region CheckOQCLotStatus * object objOQClot = oqcFacade.GetOQCLot(oqcGoodEventArgs.OQCLotNO,OQCFacade.Lot_Sequence_Default); * if(objOQClot == null) * { * throw new Exception("$Error_OQCLotNotExisted"); * } * if( ((OQCLot)objOQClot).LOTStatus == OQCLotStatus.OQCLotStatus_Initial) * { * throw new Exception("$Error_OQCLotNO_Cannot_Initial"); * } * if( (((OQCLot)objOQClot).LOTStatus == OQCLotStatus.OQCLotStatus_Reject)||((((OQCLot)objOQClot).LOTStatus == OQCLotStatus.OQCLotStatus_Pass) ) ) * { * throw new Exception("$Error_OQCLotNO_HasComplete"); * } #endregion * * * if (actionCheckStatus.NeedUpdateSimulation == true) * { * messages.AddMessages( dataCollect.Execute(oqcGoodEventArgs)); * } * if (messages.IsSuccess()) * { * DBDateTime dbDateTime; * //Laws Lu,2006/11/13 uniform system collect date * if(actionEventArgs.ProductInfo.WorkDateTime != null) * { * dbDateTime = actionEventArgs.ProductInfo.WorkDateTime; * * } * else * { * dbDateTime = FormatHelper.GetNowDBDateTime(DataProvider); * actionEventArgs.ProductInfo.WorkDateTime = dbDateTime; * } * * //判断是否第一笔,如果是修改oqclot #region 修改OQCLot状态 * // object[] objs = oqcFacade.ExtraQueryOQCLot2CardCheck(string.Empty,string.Empty,oqcGoodEventArgs.ProductInfo.NowSimulation.MOCode,oqcGoodEventArgs.OQCLotNO,OQCFacade.Lot_Sequence_Default.ToString()); * // if(objs == null) * // { * //object objLot = oqcFacade.GetOQCLot(oqcGoodEventArgs.OQCLotNO,OQCFacade.Lot_Sequence_Default); * OQCLot oqcLot = new OQCLot(); * oqcLot.LOTNO = oqcGoodEventArgs.OQCLotNO; * oqcLot.LotSequence = OQCFacade.Lot_Sequence_Default; * oqcLot.LOTStatus = Web.Helper.OQCLotStatus.OQCLotStatus_Examing; * oqcFacade.UpdateOQCLotStatus(oqcLot); * // } #endregion * * //add recrod to OQCLot2CardCheck #region OQCLot2CardCheck * OQCLot2CardCheck oqcLot2CardCheck = oqcFacade.CreateNewOQCLot2CardCheck(); * oqcLot2CardCheck.ItemCode = oqcGoodEventArgs.ProductInfo.NowSimulation.ItemCode; * oqcLot2CardCheck.LOTNO = oqcGoodEventArgs.OQCLotNO; * oqcLot2CardCheck.MaintainUser = oqcGoodEventArgs.UserCode; * oqcLot2CardCheck.MOCode = oqcGoodEventArgs.ProductInfo.NowSimulation.MOCode; * oqcLot2CardCheck.ModelCode = oqcGoodEventArgs.ProductInfo.NowSimulation.ModelCode; * oqcLot2CardCheck.OPCode = oqcGoodEventArgs.ProductInfo.NowSimulation.OPCode; * oqcLot2CardCheck.ResourceCode = oqcGoodEventArgs.ProductInfo.NowSimulation.ResourceCode; * oqcLot2CardCheck.RouteCode = oqcGoodEventArgs.ProductInfo.NowSimulation.RouteCode; * oqcLot2CardCheck.RunningCard = oqcGoodEventArgs.ProductInfo.NowSimulation.RunningCard; * oqcLot2CardCheck.RunningCardSequence = oqcGoodEventArgs.ProductInfo.NowSimulation.RunningCardSequence; * oqcLot2CardCheck.SegmnetCode = oqcGoodEventArgs.ProductInfo.NowSimulationReport.SegmentCode; * oqcLot2CardCheck.ShiftCode = oqcGoodEventArgs.ProductInfo.NowSimulationReport.ShiftCode; * oqcLot2CardCheck.ShiftTypeCode = oqcGoodEventArgs.ProductInfo.NowSimulationReport.ShiftTypeCode; * oqcLot2CardCheck.Status = ProductStatus.GOOD; * oqcLot2CardCheck.StepSequenceCode = oqcGoodEventArgs.ProductInfo.NowSimulationReport.StepSequenceCode; * oqcLot2CardCheck.TimePeriodCode = oqcGoodEventArgs.ProductInfo.NowSimulationReport.TimePeriodCode; * * oqcLot2CardCheck.IsDataLink = oqcGoodEventArgs.IsDataLink; //标识样本是不是来自数据连线 joe song 2006-06-08 * * oqcLot2CardCheck.MaintainDate = dbDateTime.DBDate; * oqcLot2CardCheck.MaintainTime = dbDateTime.DBTime; * oqcFacade.AddOQCLot2CardCheck(oqcLot2CardCheck); #endregion * * //OQCLOTCardCheckList * #region OQCLOTCardCheckList * if( oqcGoodEventArgs.OQCLOTCardCheckLists != null) * { * for(int i=0;i<oqcGoodEventArgs.OQCLOTCardCheckLists.Length;i++) * { * if( oqcGoodEventArgs.OQCLOTCardCheckLists[i] != null) * { * oqcFacade.AddOQCLOTCardCheckList(oqcGoodEventArgs.OQCLOTCardCheckLists[i] as OQCLOTCardCheckList); * } * } * } #endregion * * //OQCLOTCheckList 统计 #region OQCLOTCheckList * * * object obj = oqcFacade.GetOQCLOTCheckList(oqcGoodEventArgs.OQCLotNO,OQCFacade.Lot_Sequence_Default); * if(obj == null) * { * OQCLOTCheckList oqcCheckList = oqcFacade.CreateNewOQCLOTCheckList(); * oqcCheckList.AGradeTimes = OQCFacade.Decimal_Default_value; * oqcCheckList.BGradeTimes = OQCFacade.Decimal_Default_value; * oqcCheckList.CGradeTimes = OQCFacade.Decimal_Default_value; * oqcCheckList.LOTNO = oqcGoodEventArgs.OQCLotNO; * oqcCheckList.LotSequence = OQCFacade.Lot_Sequence_Default; * oqcCheckList.MaintainUser = oqcGoodEventArgs.UserCode; * oqcCheckList.MaintainDate = dbDateTime.DBDate; * oqcCheckList.MaintainTime = dbDateTime.DBTime; * oqcCheckList.Result = OQCLotStatus.OQCLotStatus_Examing; * * oqcFacade.AddOQCLOTCheckList(GetDefectStatic(oqcGoodEventArgs.OQCLOTCardCheckLists,oqcCheckList)); * } * else * { * OQCLOTCheckList oqcCheckList = obj as OQCLOTCheckList; * oqcCheckList.MaintainUser = oqcGoodEventArgs.UserCode; * * oqcFacade.UpdateOQCLOTCheckList(GetDefectStatic(oqcGoodEventArgs.OQCLOTCardCheckLists,oqcCheckList)); * } #endregion * * // #region this is for report add by crystal chu 2005/07/25 * // ReportHelper reportCollect= new ReportHelper(this.DataProvider); * // messages.AddMessages(reportCollect.ReportLineQuanMaster(this.DataProvider,oqcGoodEventArgs.ActionType,oqcGoodEventArgs.ProductInfo)); * // #endregion * * * } * } */ #endregion } catch (Exception e) { messages.Add(new Message(e)); } dataCollectDebug.WhenFunctionOut(messages); return(messages); }