Exemplo n.º 1
0
        public void AddMORunningCard(MORunningCard mORunningCard)
        {
            mORunningCard.Sequence = this.GetUniqueMORunningCardSequence();

            //this._helper.AddDomainObject( mORunningCard );
            this.DataProvider.Insert(mORunningCard);
        }
Exemplo n.º 2
0
        // Added by Icyer 2005/10/28
        //扩展一个带ActionCheckStatus参数的方法
        public Messages Execute(ActionEventArgs actionEventArgs, ActionCheckStatus actionCheckStatus)
        {
            ((GoToMOActionEventArgs)actionEventArgs).MOCode       = ((GoToMOActionEventArgs)actionEventArgs).MOCode.Trim().ToUpper();
            actionEventArgs.ProductInfo.NowSimulation.EAttribute1 = (actionEventArgs as GoToMOActionEventArgs).Memo;
            //actionEventArgs.ProductInfo.NowSimulation.RMABillCode = (actionEventArgs as GoToMOActionEventArgs).ProductInfo.CurrentMO.mor;

            actionEventArgs.LotCode = actionEventArgs.LotCode.Trim().ToUpper();

            Messages         messages         = new Messages();
            DataCollectDebug dataCollectDebug = new DataCollectDebug(this.GetType().ToString() + "Collect");

            dataCollectDebug.WhenFunctionIn(messages);

            if (((GoToMOActionEventArgs)actionEventArgs).MOCode.Trim() == String.Empty)
            {
                messages.Add(new UserControl.Message(MessageType.Error, "$CS_Please_Input_MOCode"));
            }

            if (((GoToMOActionEventArgs)actionEventArgs).LotCode.Trim() == String.Empty)
            {
                messages.Add(new UserControl.Message(MessageType.Error, "$CS_Please_Input_RunningCard"));
            }

            DataCollectFacade dataCollectFacade = new DataCollectFacade(this.DataProvider);
            MOFacade          moFacade          = new MOFacade(this.DataProvider);

            try
            {
                if (messages.IsSuccess())
                {
                    //调用含有ActionCheckStatus参数的CheckIn方法
                    messages.AddMessages(this.CheckIn(actionEventArgs, actionCheckStatus));
                    // Added by Icyer 2006/12/05
                    TakeDownCarton(actionEventArgs);
                    // Added end

                    if (!((GoToMOActionEventArgs)actionEventArgs).PassCheck)
                    {
                        throw new Exception("$CS_ID_Has_Already_Belong_To_This_MO $CS_Param_ID="
                                            + actionEventArgs.LotCode + " $Domain_MO=" + ((GoToMOActionEventArgs)actionEventArgs).MOCode);
                    }

                    if (messages.IsSuccess())
                    {
                        // 拆箱和拆Pallet

                        actionEventArgs.ProductInfo.NowSimulation.EAttribute1 = (actionEventArgs as GoToMOActionEventArgs).Memo;

                        if (actionCheckStatus.NeedUpdateSimulation)
                        {
                            ActionOnLineHelper dataCollect = new ActionOnLineHelper(this.DataProvider);
                            messages.AddMessages(dataCollect.Execute(actionEventArgs));
                        }
                        else
                        {
                            ActionOnLineHelper dataCollect = new ActionOnLineHelper(this.DataProvider);
                            messages.AddMessages(dataCollect.Execute(actionEventArgs, actionCheckStatus));
                        }

                        if (messages.IsSuccess())
                        {
                            moFacade.UpdateMOInPutQty(actionEventArgs.ProductInfo.NowSimulation.MOCode, actionEventArgs.CurrentMO, (int)actionEventArgs.ProductInfo.NowSimulation.LotQty);
                            //是否执行过updateItem2Route操作
                            if (actionCheckStatus.IsUpdateRefItem2Route == false)
                            {
                                this.updateItem2Route(actionEventArgs.ProductInfo.NowSimulation.ItemCode, actionEventArgs.ProductInfo.NowSimulation.RouteCode, actionEventArgs.UserCode);
                                actionCheckStatus.IsUpdateRefItem2Route = true;
                            }

                            MORunningCardFacade cardFacade = new MORunningCardFacade(this.DataProvider);
                            MORunningCard       card       = cardFacade.CreateNewMORunningCard();

                            card.MOCode             = ((GoToMOActionEventArgs)actionEventArgs).MOCode.ToString();
                            card.MORunningCardStart = actionEventArgs.LotCode;
                            card.MORunningCardEnd   = actionEventArgs.LotCode;
                            card.MaintainUser       = actionEventArgs.UserCode;

                            DBDateTime dbDateTime;
                            //Laws Lu,2006/11/13 uniform system collect date
                            //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;
                            }

                            card.MaintainDate = dbDateTime.DBDate;
                            card.MaintainTime = dbDateTime.DBTime;
                            // Added by Icyer 2007/07/02
                            MO mo = (MO)moFacade.GetMO(card.MOCode);
                            card.MOSeq = mo.MOSeq;
                            // Added end

                            //将Action加入列表
                            actionCheckStatus.ActionList.Add(actionEventArgs);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                messages.Add(new Message(e));
            }

            dataCollectDebug.WhenFunctionOut(messages);
            return(messages);
        }
Exemplo n.º 3
0
        public Messages Execute(ActionEventArgs actionEventArgs)
        {
            ((GoToMOActionEventArgs)actionEventArgs).MOCode = ((GoToMOActionEventArgs)actionEventArgs).MOCode.Trim().ToUpper();
            actionEventArgs.LotCode = actionEventArgs.LotCode.Trim().ToUpper();

            Messages         messages         = new Messages();
            DataCollectDebug dataCollectDebug = new DataCollectDebug(this.GetType().ToString() + "Collect");

            dataCollectDebug.WhenFunctionIn(messages);

            if (((GoToMOActionEventArgs)actionEventArgs).MOCode.Trim() == String.Empty)
            {
                messages.Add(new UserControl.Message(MessageType.Error, "$CS_Please_Input_MOCode"));
            }

            if (((GoToMOActionEventArgs)actionEventArgs).LotCode.Trim() == String.Empty)
            {
                messages.Add(new UserControl.Message(MessageType.Error, "$CS_Please_Input_RunningCard"));
            }
            //add by hiro.chen 08/11/18 checkISDown
            DataCollectFacade dataCollectFacade = new DataCollectFacade(this.DataProvider);

            //messages.AddMessages(dataCollectFacade.CheckISDown(((GoToMOActionEventArgs)actionEventArgs).LotCode.Trim()));
            //end

            try
            {
                if (messages.IsSuccess())
                {
                    actionEventArgs.ProductInfo.NowSimulation.EAttribute1 = (actionEventArgs as GoToMOActionEventArgs).Memo;
                    //actionEventArgs.ProductInfo.NowSimulation.RMABillCode = (actionEventArgs as GoToMOActionEventArgs).ProductInfo.CurrentMO.MOCode;

                    messages.AddMessages(this.CheckIn(actionEventArgs));
                    // Added by Icyer 2006/12/05
                    TakeDownCarton(actionEventArgs);
                    // Added end

                    //Laws Lu,2006/07/05 add support RMA
                    if (actionEventArgs.CurrentMO != null)
                    {
                        actionEventArgs.ProductInfo.NowSimulation.RMABillCode = actionEventArgs.CurrentMO.RMABillCode;
                    }

                    if (!((GoToMOActionEventArgs)actionEventArgs).PassCheck)
                    {
                        throw new Exception("$CS_ID_Has_Already_Belong_To_This_MO $CS_Param_ID="
                                            + actionEventArgs.LotCode + " $Domain_MO=" + ((GoToMOActionEventArgs)actionEventArgs).MOCode);
                    }

                    if (messages.IsSuccess())
                    {
                        ActionOnLineHelper dataCollect = new ActionOnLineHelper(this.DataProvider);
                        //actionEventArgs.ProductInfo.NowSimulation.Eattribute1 = (actionEventArgs as GoToMOActionEventArgs).Memo;

                        // Added By Hi1/Venus Feng on 20081114 for Hisense Version : remove pallet and carton
                        // 拆箱和拆Pallet
                        DataCollectFacade dcf = new DataCollectFacade(this.DataProvider);


                        // End Added

                        messages.AddMessages(dataCollect.Execute(actionEventArgs));

                        if (messages.IsSuccess())
                        {
                            //Laws Lu,2005/10/24,注释
                            // Added by Jane Shu	Date:2005/06/02
                            //							if ( actionEventArgs.ProductInfo.NowSimulation != null )
                            //							{
                            //this.updateMOQty(actionEventArgs.ProductInfo.NowSimulation.MOCode, actionEventArgs.UserCode);
                            this.updateItem2Route(actionEventArgs.ProductInfo.NowSimulation.ItemCode, actionEventArgs.ProductInfo.NowSimulation.RouteCode, actionEventArgs.UserCode);
                            //							}

                            // 将ID添加到MO范围表内		Added by Jane Shu	Date:2005/06/03
                            MORunningCardFacade cardFacade = new MORunningCardFacade(this.DataProvider);
                            MORunningCard       card       = cardFacade.CreateNewMORunningCard();

                            DBDateTime dbDateTime;
                            //Laws Lu,2006/11/13 uniform system collect date
                            //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;
                            }

                            card.MOCode             = ((GoToMOActionEventArgs)actionEventArgs).MOCode.ToString();
                            card.MORunningCardStart = actionEventArgs.LotCode;
                            card.MORunningCardEnd   = actionEventArgs.LotCode;
                            card.MaintainUser       = actionEventArgs.UserCode;

                            card.MaintainDate = dbDateTime.DBDate;
                            card.MaintainTime = dbDateTime.DBTime;

                            card.EAttribute1 = (actionEventArgs as GoToMOActionEventArgs).Memo;
                            // Added by Icyer 2007/07/02
                            MOFacade moFacade = new MOFacade(this.DataProvider);
                            MO       mo       = (MO)moFacade.GetMO(card.MOCode);
                            card.MOSeq = mo.MOSeq;
                            // Added end

                            cardFacade.AddMORunningCard(card);


                            //ReportHelper reportCollect = new ReportHelper(this.DataProvider);
                            //messages.AddMessages(reportCollect.ReportLineQuanMaster(this.DataProvider, actionEventArgs.ActionType, actionEventArgs.ProductInfo));
                        }
                    }
                }
            }
            catch (Exception e)
            {
                messages.Add(new Message(e));
            }

            dataCollectDebug.WhenFunctionOut(messages);
            return(messages);
        }
Exemplo n.º 4
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">转换后的ID组</param>
        /// <param name="datas2">NULL</param>
        /// <returns></returns>
        public Messages  Execute(ActionEventArgs actionEventArgs)
        {
            // Added by Icyer 2006/10/08
            if (((SplitIDActionEventArgs)actionEventArgs).IsUndo == true)
            {
                return(this.UndoExecute((SplitIDActionEventArgs)actionEventArgs));
            }
            // Added end

            Messages         messages         = new Messages();
            DataCollectDebug dataCollectDebug = new DataCollectDebug(this.GetType().ToString() + "Collect");

            dataCollectDebug.WhenFunctionIn(messages);
            try
            {
                if (((SplitIDActionEventArgs)actionEventArgs).SplitedIDs == null || ((SplitIDActionEventArgs)actionEventArgs).SplitedIDs.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         = actionEventArgs.ProductInfo.LastSimulation.RunningCard;
                    actionEventArgs.ProductInfo.NowSimulation.TranslateCardSequence = actionEventArgs.ProductInfo.LastSimulation.RunningCardSequence;
                    actionEventArgs.ProductInfo.NowSimulation.NGTimes = actionEventArgs.ProductInfo.LastSimulation.NGTimes;

                    DataCollectFacade dataCollectFacade = new DataCollectFacade(this.DataProvider);

                    for (int i = 0; i < ((SplitIDActionEventArgs)actionEventArgs).SplitedIDs.Length; i++)
                    {
                        //修改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";
                        }
                        //End Laws Lu
                        actionEventArgs.ProductInfo.NowSimulation.RunningCard = ((SplitIDActionEventArgs)actionEventArgs).SplitedIDs[i].ToString();
                        /* added by jessie lee,如果是 序列号转换 */
                        if (string.Compare((actionEventArgs as SplitIDActionEventArgs).IDMergeType, IDMergeType.IDMERGETYPE_IDMERGE, true) == 0)
                        {
                            /* 转换到同一张工单 */
                            if ((actionEventArgs as SplitIDActionEventArgs).UpdateSimulation)
                            {
                                actionEventArgs.ProductInfo.NowSimulation.RunningCardSequence
                                    = (actionEventArgs as SplitIDActionEventArgs).ExistIMEISeq + 10;
                            }
                            else
                            {
                                actionEventArgs.ProductInfo.NowSimulation.RunningCardSequence = ActionOnLineHelper.StartSeq;
                            }
                        }
                        else
                        {
                            /* 不是 序列号转换 */
                            actionEventArgs.ProductInfo.NowSimulation.RunningCardSequence = ActionOnLineHelper.StartSeq;
                        }
                        actionEventArgs.ProductInfo.NowSimulation.MOSeq = actionEventArgs.ProductInfo.LastSimulation.MOSeq;     // Added by Icyer 2007/07/03

                        messages.AddMessages(helper.Execute(actionEventArgs));

                        if (messages.IsSuccess())
                        {
                            //填写ID转换报表
                            OnWIPCardTransfer transf = dataCollectFacade.CreateNewOnWIPCardTransfer();

                            transf.RunningCard           = ((SplitIDActionEventArgs)actionEventArgs).SplitedIDs[i].ToString().Trim().ToUpper();
                            transf.RunningCardSequence   = actionEventArgs.ProductInfo.NowSimulation.RunningCardSequence;
                            transf.IDMergeType           = ((SplitIDActionEventArgs)actionEventArgs).IDMergeType;
                            transf.TranslateCard         = actionEventArgs.ProductInfo.LastSimulation.RunningCard;
                            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);

                            // 将ID添加到MO范围表内
                            MORunningCardFacade cardFacade = new MORunningCardFacade(this.DataProvider);
                            MORunningCard       card       = cardFacade.CreateNewMORunningCard();

                            card.MOCode             = actionEventArgs.ProductInfo.NowSimulation.MOCode;
                            card.MORunningCardStart = ((SplitIDActionEventArgs)actionEventArgs).SplitedIDs[i].ToString().Trim().ToUpper();
                            card.MORunningCardEnd   = card.MORunningCardStart;
                            card.MaintainUser       = actionEventArgs.UserCode;
                            card.MOSeq = actionEventArgs.ProductInfo.NowSimulation.MOSeq;

                            cardFacade.AddMORunningCard(card);
                            //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
                            //AMOI  MARK  END
                        }
                    }
                }
            }
            catch (Exception e)
            {
                messages.Add(new Message(e));
            }
            dataCollectDebug.WhenFunctionOut(messages);
            return(messages);
        }
Exemplo n.º 5
0
 public void DeleteMORunningCard(MORunningCard mORunningCard)
 {
     this._helper.DeleteDomainObject(mORunningCard);
 }
Exemplo n.º 6
0
 public void UpdateMORunningCard(MORunningCard mORunningCard)
 {
     this._helper.UpdateDomainObject(mORunningCard);
 }