Пример #1
0
        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 end
                ActionOnLineHelper dataCollect = new ActionOnLineHelper(this.DataProvider);
                //填写SIMULATION 检查工单、ID、途程、操作
                messages.AddMessages(dataCollect.CheckID(actionEventArgs));
                if (messages.IsSuccess())
                {
                    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);
            }
        }
Пример #2
0
        /// <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)
        {
            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())
                {
                    //补充SIMULATION 不良信息
                    actionEventArgs.ProductInfo.NowSimulation.ProductStatus = ProductStatus.NG;
                    actionEventArgs.ProductInfo.NowSimulation.NGTimes       = actionEventArgs.ProductInfo.NowSimulation.NGTimes + 1;
                    actionEventArgs.ProductInfo.NowSimulation.GoodQty       = 0;
                    actionEventArgs.ProductInfo.NowSimulation.NGQty         = actionEventArgs.ProductInfo.NowSimulation.LotQty;
                    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;
                    }

                    messages.AddMessages(dataCollect.Execute(actionEventArgs, null, false, false));
                    if (messages.IsSuccess())
                    {
                        //Laws Lu,2005/12/19,新增	获取ErrorGroup2ErrorCode
                        if (actionEventArgs.ActionType == ActionType.DataCollectAction_NG)
                        {
                            actionEventArgs.ProductInfo.ECG2ErrCodes = ParseECGECQty(((TSActionEventArgs)actionEventArgs).ErrorCodes, actionEventArgs.ActionType);
                        }
                        else
                        {
                            actionEventArgs.ProductInfo.ECG2ErrCodes = ParseECGECQty(((TSActionEventArgs)actionEventArgs).ErrorInfor, actionEventArgs.ActionType);
                        }

                        //填写测试不良数据
                        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.LotCode);
                    }
                }
            }
            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);
            }
        }
Пример #3
0
        // Added end

        //扩展一个带ActionCheckStatus和OPBOMDetail参数的方法
        public Messages Execute(ActionEventArgs actionEventArgs, ActionCheckStatus actionCheckStatus, object[] OPBOMDetail)
        {
            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, actionCheckStatus);
                // Added end

                ActionOnLineHelper dataCollect = new ActionOnLineHelper(this.DataProvider);
                //填写SIMULATION 检查工单、ID、途程、操作
                messages.AddMessages(dataCollect.CheckID(actionEventArgs, actionCheckStatus));

                if (messages.IsSuccess())
                {
                    //上料检查  分INNO、KEYPARTS TODO
                    //if (actionEventArgs.ActionType ==ActionType.DataCollectAction_CollectINNO)


                    if (actionCheckStatus.NeedUpdateSimulation == true)
                    {
                        messages.AddMessages(dataCollect.Execute(actionEventArgs));
                    }
                    else
                    {
                        messages.AddMessages(dataCollect.Execute(actionEventArgs, actionCheckStatus));
                    }

                    BenQGuru.eMES.Material.WarehouseFacade wfacade = null;
                    if (messages.IsSuccess())
                    {
                        DataCollectFacade dataCollectFacade = new DataCollectFacade(this.DataProvider);
                        #region 填写上料信息表  分INNO、KEYPARTS
                        if (actionEventArgs.ActionType == ActionType.DataCollectAction_CollectINNO)
                        {
                            if (System.Configuration.ConfigurationSettings.AppSettings["NeedMaterialModule"].Trim() == "1")
                            {
                                wfacade = ((CINNOActionEventArgs)actionEventArgs).Warehouse;
                            }

                            messages.AddMessages(InsertLotOnWipItem(actionEventArgs, dataCollectFacade, OPBOMDetail));
                            if (!messages.IsSuccess())
                            {
                                return(messages);
                            }
                        }

                        #endregion
                    }
                    // Added by Icyer 2005/08/16
                    // 上料扣库存
                    // 暂时屏蔽 FOR 夏新P3版本 MARK LEE 2005/08/22
                    // 取消屏蔽 Icyer 2005/08/23
                    //Laws Lu,2005/10/20,新增	使用配置文件来控制物料模块是否使用
                    if (System.Configuration.ConfigurationSettings.AppSettings["NeedMaterialModule"].Trim() == "1")
                    {
                        //BenQGuru.eMES.Material.WarehouseFacade wfacade = new WarehouseFacade(this.DataProvider);
                        if (wfacade != null)
                        {
                            wfacade.CollectMaterialStock(actionEventArgs.ProductInfo.NowSimulation.LotCode, actionEventArgs.ProductInfo.NowSimulation.LotSeq.ToString(), actionEventArgs.ProductInfo.NowSimulation.MOCode);
                        }
                    }
                    // Added end


                    //将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);
            }
        }