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); }
public Messages Execute(ActionEventArgs actionEventArgs) { 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)); 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 messages.AddMessages(dataCollect.Execute(actionEventArgs)); if (messages.IsSuccess()) { // 自动产生送检批 messages.AddMessages(this.GenerateLot(actionEventArgs)); //if (messages.IsSuccess()) //{ // //填写测试报表 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)); //} } } } 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) { // Added by Icyer 2006/10/08 if (((ConvertCardActionEventArgs)actionEventArgs).IsUndo == true) { return(this.UndoExecute((ConvertCardActionEventArgs)actionEventArgs)); } // Added end Messages messages = new Messages(); DataCollectDebug dataCollectDebug = new DataCollectDebug(this.GetType().ToString() + "Collect"); dataCollectDebug.WhenFunctionIn(messages); try { if (((ConvertCardActionEventArgs)actionEventArgs).ConvertToCard.Length <= 0) { throw new Exception("$CS_System_Params_Losted"); } ActionOnLineHelper helper = new ActionOnLineHelper(this.DataProvider); //填写SIMULATION 检查工单、ID、途程、操作 messages.AddMessages(helper.CheckID(actionEventArgs)); if (messages.IsSuccess()) { actionEventArgs.ProductInfo.NowSimulation.IDMergeRule = 1; //actionEventArgs.ProductInfo.NowSimulation.IDMergeRule/((SplitIDActionEventArgs)actionEventArgs).SplitedIDs.Length; actionEventArgs.ProductInfo.NowSimulation.TranslateCard = ((ConvertCardActionEventArgs)actionEventArgs).TransFromCard; actionEventArgs.ProductInfo.NowSimulation.TranslateCardSequence = actionEventArgs.ProductInfo.LastSimulation.RunningCardSequence; actionEventArgs.ProductInfo.NowSimulation.NGTimes = actionEventArgs.ProductInfo.LastSimulation.NGTimes; DataCollectFacade dataCollectFacade = new DataCollectFacade(this.DataProvider); //修改SIMULATION //Laws Lu,2005/08/15,新增 完工逻辑,在其他Check都通过的情况下,所有的RunningCard应该是GOOD状态 //暂时不考虑线外工序 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 actionEventArgs.ProductInfo.NowSimulation.MOSeq = actionEventArgs.ProductInfo.LastSimulation.MOSeq; // hiro.chen 2009.08.28 对tblsimulation,tblonwip,tblsimulationreport中Rcard转换操作 actionEventArgs.ProductInfo.LastSimulation.TranslateCard = (actionEventArgs as ConvertCardActionEventArgs).TransFromCard; actionEventArgs.ProductInfo.NowSimulation.TranslateCard = (actionEventArgs as ConvertCardActionEventArgs).TransFromCard; actionEventArgs.ProductInfo.LastSimulation.RunningCard = actionEventArgs.ProductInfo.NowSimulation.SourceCard; actionEventArgs.ProductInfo.NowSimulation.RunningCard = actionEventArgs.ProductInfo.NowSimulation.SourceCard; messages.AddMessages(helper.Execute(actionEventArgs)); if (messages.IsSuccess()) { //填写ID转换报表 OnWIPCardTransfer transf = dataCollectFacade.CreateNewOnWIPCardTransfer(); transf.RunningCard = ((ConvertCardActionEventArgs)actionEventArgs).ConvertToCard.Trim().ToUpper(); transf.RunningCardSequence = actionEventArgs.ProductInfo.NowSimulation.RunningCardSequence; transf.IDMergeType = ((ConvertCardActionEventArgs)actionEventArgs).IDMergeType; transf.TranslateCard = ((ConvertCardActionEventArgs)actionEventArgs).TransFromCard; transf.TranslateCardSequence = actionEventArgs.ProductInfo.LastSimulation.RunningCardSequence; transf.SourceCard = actionEventArgs.ProductInfo.NowSimulation.SourceCard; transf.ModelCode = actionEventArgs.ProductInfo.NowSimulation.ModelCode; transf.MOCode = actionEventArgs.ProductInfo.NowSimulation.MOCode; transf.ItemCode = actionEventArgs.ProductInfo.NowSimulation.ItemCode; transf.ResourceCode = actionEventArgs.ResourceCode; transf.OPCode = actionEventArgs.ProductInfo.NowSimulation.OPCode; transf.SourceCardSequence = actionEventArgs.ProductInfo.NowSimulation.SourceCardSequence; transf.RouteCode = actionEventArgs.ProductInfo.NowSimulation.RouteCode; transf.StepSequenceCode = actionEventArgs.ProductInfo.NowSimulationReport.StepSequenceCode; transf.SegmnetCode = actionEventArgs.ProductInfo.NowSimulationReport.SegmentCode; transf.TimePeriodCode = actionEventArgs.ProductInfo.NowSimulationReport.TimePeriodCode; transf.ShiftCode = actionEventArgs.ProductInfo.NowSimulationReport.ShiftCode; transf.ShiftTypeCode = actionEventArgs.ProductInfo.NowSimulationReport.ShiftTypeCode; transf.MaintainUser = actionEventArgs.UserCode; transf.MOSeq = actionEventArgs.ProductInfo.NowSimulationReport.MOSeq; dataCollectFacade.AddOnWIPCardTransfer(transf); //AMOI MARK START 20050806 增加按资源统计产量和完工统计 #region 填写统计报表 按资源统计 // Added by Icyer 2006/06/05 //if (actionEventArgs.NeedUpdateReport == true) //{ // 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)); //} #endregion } } } catch (Exception e) { messages.Add(new Message(e)); } dataCollectDebug.WhenFunctionOut(messages); return(messages); }
public UserControl.Messages Execute(ActionEventArgs cartonPackEventArgs) { Messages messages = new Messages(); DataCollectDebug dataCollectDebug = new DataCollectDebug(this.GetType().ToString() + "Collect"); dataCollectDebug.WhenFunctionIn(messages); try { ActionOnLineHelper dataCollect = new ActionOnLineHelper(this.DataProvider); messages.AddMessages(dataCollect.CheckID(cartonPackEventArgs)); if (messages.IsSuccess()) { if (((CartonPackEventArgs)cartonPackEventArgs).ProductInfo.NowSimulation == null) { throw new Exception("$System_Error"); } string cartonno = (cartonPackEventArgs as CartonPackEventArgs).CartonNo; string oldCartonNo = cartonPackEventArgs.ProductInfo.NowSimulation.CartonCode; if (cartonno != string.Empty) { cartonPackEventArgs.ProductInfo.NowSimulation.CartonCode = (cartonPackEventArgs as CartonPackEventArgs).CartonNo; } //Laws Lu,2005/08/15,新增 完工逻辑,在其他Check都通过的情况下,所有的RunningCard应该是GOOD状态 //暂时不考虑线外工序 DataCollectFacade dataCollectFacade = new DataCollectFacade(this.DataProvider); if (cartonPackEventArgs.ProductInfo.NowSimulation.RouteCode != "" && dataCollectFacade.OPIsMORouteLastOP( cartonPackEventArgs.ProductInfo.NowSimulation.MOCode , cartonPackEventArgs.ProductInfo.NowSimulation.RouteCode , cartonPackEventArgs.ProductInfo.NowSimulation.OPCode)) { cartonPackEventArgs.ProductInfo.NowSimulation.IsComplete = "1"; cartonPackEventArgs.ProductInfo.NowSimulation.EAttribute1 = "GOOD"; //完工自动入库 dataCollectFacade.AutoInventory(cartonPackEventArgs.ProductInfo.NowSimulation, cartonPackEventArgs.UserCode); } //End Laws Lu messages.AddMessages(dataCollect.Execute(cartonPackEventArgs)); DBDateTime dbDateTime; if (cartonPackEventArgs.ProductInfo.WorkDateTime != null) { dbDateTime = FormatHelper.GetNowDBDateTime(DataProvider); cartonPackEventArgs.ProductInfo.WorkDateTime = dbDateTime; } else { dbDateTime = cartonPackEventArgs.ProductInfo.WorkDateTime; } if (messages.IsSuccess()) { if (cartonno != string.Empty && cartonno != oldCartonNo) { Package.PackageFacade pf = new BenQGuru.eMES.Package.PackageFacade(DataProvider); object objCarton = pf.GetCARTONINFO(cartonno); if (objCarton != null) { BenQGuru.eMES.Domain.Package.CARTONINFO carton = objCarton as BenQGuru.eMES.Domain.Package.CARTONINFO; if (carton.CAPACITY == carton.COLLECTED + 1) { messages.Add(new UserControl.Message(MessageType.Normal, "$CARTON_ALREADY_FULL_PlEASE_CHANGE")); } if (carton.CAPACITY <= carton.COLLECTED) { messages.Add(new UserControl.Message(MessageType.Error, "$CARTON_ALREADY_FILL_OUT")); } else { pf.UpdateCollected((carton as BenQGuru.eMES.Domain.Package.CARTONINFO).CARTONNO); } } else if (cartonno != String.Empty) { object objExistCTN = pf.GetExistCARTONINFO(cartonno); if (objExistCTN != null) { messages.Add(new UserControl.Message(MessageType.Error, "$CARTON_ALREADY_FULL_PlEASE_CHANGE")); } else { BenQGuru.eMES.Domain.Package.CARTONINFO carton = new BenQGuru.eMES.Domain.Package.CARTONINFO(); carton.CAPACITY = ((new ItemFacade(DataProvider)).GetItem(cartonPackEventArgs.ProductInfo.NowSimulation.ItemCode, GlobalVariables.CurrentOrganizations.First().OrganizationID) as Item).ItemCartonQty; carton.COLLECTED = 1 /** oqcLotAddIDEventArgs.ProductInfo.NowSimulation.IDMergeRule*/; carton.PKCARTONID = System.Guid.NewGuid().ToString().ToUpper(); carton.CARTONNO = cartonno; carton.MUSER = cartonPackEventArgs.UserCode; carton.MDATE = dbDateTime.DBDate; carton.MTIME = dbDateTime.DBTime; //carton. //joe song 20060630 Carton Memo carton.EATTRIBUTE1 = (cartonPackEventArgs as CartonPackEventArgs).CartonMemo; if (carton.CAPACITY == 0)//Get carton capacity by item { messages.Add(new UserControl.Message(MessageType.Error , "$CS_PLEASE_MAINTEIN_ITEMCARTON $CS_Param_ID =" + cartonPackEventArgs.RunningCard)); } else { if (carton.CAPACITY == carton.COLLECTED) { messages.Add(new UserControl.Message(MessageType.Normal, "$CARTON_ALREADY_FULL_PlEASE_CHANGE")); } pf.AddCARTONINFO(carton); } } } // Update lot2card.eattribute1=cartonno OQCFacade oqcFacade = new OQCFacade(this.DataProvider); oqcFacade.UpdateLot2CardCartonCode(cartonPackEventArgs.ProductInfo.NowSimulation.RunningCard, cartonPackEventArgs.ProductInfo.NowSimulation.MOCode, cartonPackEventArgs.ProductInfo.NowSimulation.ItemCode, cartonno); } } // 产生汇总报表 //if (messages.IsSuccess()) //{ // ReportHelper reportCollect = new ReportHelper(this.DataProvider); // messages.AddMessages(reportCollect.ReportLineQuanMaster(this.DataProvider, cartonPackEventArgs.ActionType, cartonPackEventArgs.ProductInfo)); // messages.AddMessages(reportCollect.ReportResQuanMaster(this.DataProvider // , cartonPackEventArgs.ActionType, cartonPackEventArgs.ProductInfo)); //} } } catch (Exception e) { messages.Add(new Message(e)); } dataCollectDebug.WhenFunctionOut(messages); return(messages); }