Ejemplo n.º 1
0
        private Messages CheckRcard(object act)
        {
            string   rcard = act.ToString().Trim().ToUpper();
            Messages msg   = new Messages();

            BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider domainProvider = null;
            if ((act as IDCTClient).DBConnection != null)
            {
                domainProvider = (act as IDCTClient).DBConnection as BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider;
            }
            else
            {
                domainProvider = Common.DomainDataProvider.DomainDataProviderManager.DomainDataProvider()
                                 as BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider;
                (act as IDCTClient).DBConnection = domainProvider;
            }

            ActionOnLineHelper actionOnLineHelper = new ActionOnLineHelper(domainProvider);

            msg = actionOnLineHelper.GetIDInfo(rcard);

            if (msg.IsSuccess())
            {
                ProductInfo productInfo = (ProductInfo)msg.GetData().Values[0];

                msg = actionOnLineHelper.CheckID(new ActionEventArgs(ActionType.DataCollectAction_GOOD,
                                                                     rcard, ((IDCTClient)act).LoginedUser, ((IDCTClient)act).ResourceCode));
            }


            return(msg);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 检查出TS是否允许,并填写部分SIMULATION
        /// </summary>
        /// <param name="iD"></param>
        /// <param name="actionType"></param>
        /// <param name="resourceCode"></param>
        /// <param name="userCode"></param>
        /// <param name="product"></param>
        /// <returns></returns>
//		public Messages CheckID(string iD,string actionType,string resourceCode,string userCode, ProductInfo product)
//		{
//			Messages messages=new Messages();
//			DataCollectDebug dataCollectDebug =new DataCollectDebug(this.GetType().ToString()+"CheckID");
//			dataCollectDebug.WhenFunctionIn(messages);
//			try
//			{
//				MOFacade moFacade=new MOFacade(this.DataProvider);
//				BaseModelFacade dataModel=new BaseModelFacade(this.DataProvider);
//				DataCollectFacade dataCollectFacade=new DataCollectFacade(this.DataProvider);
//				//IDataCollectModule dataCollect=new DataCollectOnLine();
//				ReworkFacade reworkFacade=new ReworkFacade(this.DataProvider);
//
//				#region 检查工单
//				MO mo=(MO)moFacade.GetMO(product.LastSimulation.MOCode);
//				//工单状态检查
//				if (!dataCollectFacade.CheckMO(mo))
//				{
//					throw new Exception("$MOStatus_Error"+mo.MOStatus);
//				}
//				#endregion
//				#region 检查ID状态
//				//根据TS中ID状态决定 TODO
//				Reject reject=(Reject)reworkFacade.GetReject(product.LastSimulation.RunningCard,
//					product.LastSimulation.RunningCardSequence);
//				if (reject==null)
//					throw new Exception("$CS_SystemError_LostRejectInfo $CS_Param_ID="+product.LastSimulation.RunningCard
//						+" $CS_Param_RunSeq="+product.LastSimulation.RunningCardSequence);
//				ItemRoute2OP op ;
//				if (reject.RejectStatus ==RejectStatus.UnReject)
//				{
//					//按正常走
//                    dataCollectDebug.DebugPoint(messages,"取消判退");
//					#region 检查途程
//					if ((actionType ==ActionType.DataCollectAction_OutLineGood )
//						||(actionType ==ActionType.DataCollectAction_OutLineNG )
//						)
//					{
//						dataCollectDebug.DebugPoint(messages,"线外站采集");
//						//线外站不需要检查Route,请自己填写SIMULATION信息
//						dataCollectDebug.WhenFunctionOut(messages);
//						return messages;
//					}
//					else
//					{
//						//当前站重复采集
//						if (dataModel.GetOperation2Resource(product.LastSimulation.OPCode,resourceCode)==null)
//						{
//							dataCollectDebug.DebugPoint(messages,"下一站采集");
//							op=dataCollectFacade.GetMORouteNextOP(product.LastSimulation.MOCode,product.LastSimulation.RouteCode,product.LastSimulation.OPCode);
//							if (op==null)
//								throw new Exception("$CS_Route_Failed_GetNotNextOP");
//							if (dataModel.GetOperation2Resource(op.OPCode,resourceCode)==null)
//							{
//								throw new Exception("$CS_Route_Failed $CS_Param_OPCode"+op.OPCode);
//							}
//						}
//						else
//						{
//							dataCollectDebug.DebugPoint(messages,"当前站重复采集");
//							//检查是否重复采集
//							dataCollectFacade.CheckRepeatCollect(product.LastSimulation.ActionList,actionType);
//							op=dataCollectFacade.GetMORouteOP(product.LastSimulation.ItemCode,product.LastSimulation.MOCode,
//								product.LastSimulation.RouteCode,product.LastSimulation.OPCode);
//						}
//					}
//					#endregion
//				}
//				else
//				if (reject.RejectStatus ==RejectStatus.Confirm)
//				{
//					ReworkSheet rework=(ReworkSheet) reworkFacade.GetReworkSheet( reject.ReworkCode );
//					if (rework.Status ==ReworkStatus.REWORKSTATUS_OPEN)
//					{
//						op=dataCollectFacade.GetMORouteFirstOP(product.LastSimulation.MOCode
//							,rework.NewRouteCode);
//					}
//					else
//					{
//						throw new Exception("$CS_IDisReject");
//					}
//				}
//				else
//				  throw new Exception("$CS_IDisReject");
//				#endregion
//				#region 检查ACTION
//				if (dataCollectFacade.CheckAction(product,op,actionType))
//				{
//				}
//				#endregion
//				#region 填写新SIMULATION
//				messages.AddMessages( dataCollectFacade.WriteSimulation(iD,actionType,resourceCode,userCode,product));
//				if (messages.IsSuccess())
//				{
//					//修改
//					product.NowSimulation.RouteCode =product.LastSimulation.RouteCode;
//					product.NowSimulation.OPCode =op.OPCode;
//					product.NowSimulation.ResourceCode=resourceCode;
//
//					product.NowSimulation.ActionList =";"+actionType+";";
//				}
//				#endregion
//			}
//			catch (Exception e)
//			{
//				messages.Add(new Message(e));
//			}
//			dataCollectDebug.WhenFunctionOut(messages);
//			return messages;
//		}
        public Messages CheckIDIn(ActionEventArgs actionEventArgs)
        {
            Messages         messages         = new Messages();
            DataCollectDebug dataCollectDebug = new DataCollectDebug(this.GetType().ToString() + "CheckIDIn");

            dataCollectDebug.WhenFunctionIn(messages);
            try
            {
                ActionOnLineHelper dataCollect = new ActionOnLineHelper(this.DataProvider);
                messages.AddMessages(dataCollect.CheckID(actionEventArgs));
                if (messages.IsSuccess())
                {
                    dataCollectDebug.DebugPoint(messages, "推途程成功");
                    //补充SIMULATION 不良信息
                    actionEventArgs.ProductInfo.NowSimulation.ProductStatus = ProductStatus.Reject;
                    actionEventArgs.ProductInfo.NowSimulation.NGTimes       = actionEventArgs.ProductInfo.NowSimulation.NGTimes + 1;
                }
            }
            catch (Exception e)
            {
                messages.Add(new Message(e));
            }
            dataCollectDebug.WhenFunctionOut(messages);
            return(messages);
        }
Ejemplo n.º 3
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">NULL</param>
        /// <returns></returns>
        public Messages  Execute(ActionEventArgs actionEventArgs)
        {
            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)
                {
                    // 获得LastSimulation
                    messages.AddMessages(helper.GetIDInfo(actionEventArgs.RunningCard));

                    if (messages.IsSuccess())
                    {
                        actionEventArgs.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())
                {
                    facade.CheckMO(actionEventArgs.ProductInfo.LastSimulation.MOCode, actionEventArgs.ProductInfo);
                    facade.GetRouteOPOnline(actionEventArgs.RunningCard, actionEventArgs.ActionType, actionEventArgs.ResourceCode, actionEventArgs.UserCode, actionEventArgs.ProductInfo);

                    DBDateTime dbDateTime;

                    dbDateTime = FormatHelper.GetNowDBDateTime(DataProvider);

                    actionEventArgs.ProductInfo.NowSimulation.MaintainUser = actionEventArgs.UserCode;

                    actionEventArgs.ProductInfo.NowSimulation.MaintainDate = dbDateTime.DBDate;
                    actionEventArgs.ProductInfo.NowSimulation.MaintainTime = dbDateTime.DBTime;

                    // 填写NowSimulationReport
                    actionEventArgs.ProductInfo.NowSimulationReport = helper.FillSimulationReport(actionEventArgs.ProductInfo);

                    // 填写SoftwareVersion报表
                    this.WriteSoftwareInfo((SoftwareActionEventArgs)actionEventArgs, facade);
                }
            }
            catch (Exception e)
            {
                messages.Add(new Message(e));
            }
            dataCollectDebug.WhenFunctionOut(messages);
            return(messages);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
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">NULL</param>
        /// <returns></returns>
        public Messages Execute(ActionEventArgs actionEventArgs)
        {
            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(this.CheckIDIn(actionEventArgs));
                if (messages.IsSuccess())
                {
                    //
                    messages.AddMessages(dataCollect.Execute(actionEventArgs));
                    if (messages.IsSuccess())
                    {
                        //填写包装报表 TODO
                    }
                }
            }
            catch (Exception e)
            {
                messages.Add(new Message(e));
            }
            dataCollectDebug.WhenFunctionOut(messages);
            return(messages);
        }
Ejemplo n.º 6
0
        // Added by Icyer 2006/11/08
        /// <summary>
        /// 做Undo
        /// </summary>
        public Messages  UndoExecute(SplitIDActionEventArgs actionEventArgs)
        {
            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");
                }

                DataCollectFacade dataCollectFacade = new DataCollectFacade(this.DataProvider);
                object[]          oldSimulation     = dataCollectFacade.GetSimulationFromTCard(actionEventArgs.RunningCard);
                if (oldSimulation == null || oldSimulation.Length == 0)
                {
                    throw new Exception("$CS_System_Params_Losted");
                }
                if (oldSimulation.Length != actionEventArgs.SplitedIDs.Length)
                {
                    throw new Exception("$CS_System_Params_Losted");
                }

                ActionOnLineHelper  helper     = new ActionOnLineHelper(this.DataProvider);
                MORunningCardFacade cardFacade = new MORunningCardFacade(this.DataProvider);
                // 依次操作每个序列号更改
                for (int i = 0; i < actionEventArgs.SplitedIDs.Length; i++)
                {
                    // 更新Simulation
                    Simulation s           = (Simulation)oldSimulation[i];
                    string     oldRCard    = s.RunningCard;
                    decimal    oldRCardSeq = s.RunningCardSequence;
                    string     strNewRCard = actionEventArgs.SplitedIDs[i].ToString();
                    string     strSql      = "UPDATE tblSimulation SET RCard='" + strNewRCard + "' WHERE RCard='" + oldRCard + "' AND RCardSeq=" + oldRCardSeq.ToString();
                    this.DataProvider.CustomExecute(new SQLCondition(strSql));
                    // 更新SimulationReport
                    strSql = "UPDATE tblSimulationReport SET RCard='" + strNewRCard + "' WHERE RCard='" + oldRCard + "' AND RCardSeq=" + oldRCardSeq.ToString();
                    this.DataProvider.CustomExecute(new SQLCondition(strSql));
                    // 更新OnWIP
                    strSql = "UPDATE tblOnWIP SET RCard='" + strNewRCard + "' WHERE RCard='" + oldRCard + "' AND RCardSeq=" + oldRCardSeq.ToString();
                    this.DataProvider.CustomExecute(new SQLCondition(strSql));
                    // 更新OnWIPTrans
                    strSql = "UPDATE tblOnWIPCardTrans SET RCard='" + strNewRCard + "' WHERE RCard='" + oldRCard + "' AND RCardSeq=" + oldRCardSeq.ToString();
                    this.DataProvider.CustomExecute(new SQLCondition(strSql));
                    // 更新MOCard
                    strSql = "UPDATE tblmorcard SET MORCardStart='" + strNewRCard + "',MORCardEnd='" + strNewRCard + "' WHERE MORCardStart='" + oldRCard + "' AND MOCode='" + s.MOCode + "' ";
                    this.DataProvider.CustomExecute(new SQLCondition(strSql));
                    // 报表不用更新
                }
            }
            catch (Exception e)
            {
                messages.Add(new Message(e));
            }
            dataCollectDebug.WhenFunctionOut(messages);
            return(messages);
        }
Ejemplo n.º 7
0
        //
        private Messages DoDataCollectAction(Common.DomainDataProvider.SQLDomainDataProvider domainProvider, IDCTClient client, string runningCard)
        {
            Messages messages = new Messages();

            ActionOnLineHelper _helper = new ActionOnLineHelper(domainProvider);

            messages = _helper.GetIDInfo(runningCard);
            ProductInfo product = (ProductInfo)messages.GetData().Values[0];

            /*
             * if (product == null || product.LastSimulation == null)
             * {
             *      messages.Add(new UserControl.Message(MessageType.Error, "$NoSimulation"));
             *      return messages;
             * }
             */

            CINNOActionEventArgs args = new CINNOActionEventArgs(
                ActionType.DataCollectAction_CollectINNO,
                runningCard,
                client.LoginedUser,
                client.ResourceCode,
                product,
                INNOCode,
                null
                );

            IAction action = new BenQGuru.eMES.DataCollect.Action.ActionFactory(domainProvider).CreateAction(ActionType.DataCollectAction_CollectINNO);

            domainProvider.BeginTransaction();
            try
            {
                messages.AddMessages(action.Execute(args));

                if (messages.IsSuccess())
                {
                    domainProvider.CommitTransaction();
                    messages.Add(new UserControl.Message(MessageType.Success, "$CS_INNO_CollectSuccess"));
                }
                else
                {
                    domainProvider.RollbackTransaction();
                }

                return(messages);
            }
            catch (Exception ex)
            {
                domainProvider.RollbackTransaction();
                messages.Add(new UserControl.Message(ex));
                return(messages);
            }
            finally
            {
                ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)domainProvider).PersistBroker.CloseConnection();
            }
        }
Ejemplo n.º 8
0
        //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);
        }
Ejemplo n.º 9
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);
            }
        }
Ejemplo n.º 10
0
        private ProductInfo GetProduct(string runningCard)
        {
            ProductInfo returnValue = null;

            DataCollect.ActionOnLineHelper onLine = new ActionOnLineHelper(this.DataProvider);
            Messages msg = onLine.GetIDInfo(runningCard);

            if (msg.IsSuccess())
            {
                returnValue = (ProductInfo)msg.GetData().Values[0];
            }

            return(returnValue);
        }
Ejemplo n.º 11
0
        private object[] transedRunningCardByProduct = null;    // Added by Icyer 2006/11/08
        public FCollectionIDMerge_OutLine()
        {
            //
            // Windows 窗体设计器支持所必需的
            //
            InitializeComponent();

            //
            // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
            //
            UserControl.UIStyleBuilder.FormUI(this);

            this._helper = new ActionOnLineHelper(this.DataProvider);
        }
Ejemplo n.º 12
0
        private Messages GetProduct(string rcard)
        {
            Messages           productmessages = new Messages();
            ActionOnLineHelper dataCollect     = new ActionOnLineHelper(DataProvider);

            try
            {
                productmessages.AddMessages(dataCollect.GetIDInfo(rcard));
            }
            catch (Exception e)
            {
                productmessages.Add(new UserControl.Message(e));
            }
            return(productmessages);
        }
Ejemplo n.º 13
0
        private Messages GetProduct(string rcard)
        {
            Messages productmessages = new Messages();

            product = null;
            ActionOnLineHelper dataCollect = new ActionOnLineHelper(this.DataProvider);

            productmessages.AddMessages(dataCollect.GetIDInfo(rcard.Trim().ToUpper()));
            if (productmessages.IsSuccess())
            {
                product = (ProductInfo)productmessages.GetData().Values[0];
            }
            dataCollect = null;
            return(productmessages);
        }
Ejemplo n.º 14
0
        private Messages CollectInfo(ActionOnLineHelper onLine, ProductInfo Product)
        {
            Messages msg = new Messages();

            GetKeyParts();

            DropMaterialEventArgs Args = new DropMaterialEventArgs(ActionType.DataCollectAction_DropMaterial, Product.LastSimulation.RunningCard,
                                                                   _usercode, _rescode,
                                                                   Product);

            Args.OnwipItems = Innos.ToArray();

            msg.AddMessages(onLine.ActionWithTransaction(Args));


            return(msg);
        }
Ejemplo n.º 15
0
        public FCollectionSoftware()
        {
            //
            // Windows 窗体设计器支持所必需的
            //
            InitializeComponent();

            //
            // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
            //


            UserControl.UIStyleBuilder.FormUI(this);
            this._helper = new ActionOnLineHelper(this.DataProvider);

            this.showInputHint();
            this.ucLEInput.TextFocus(false, true);
        }
Ejemplo n.º 16
0
        public FCollectMo()
        {
            //
            // Windows 窗体设计器支持所必需的
            //
            InitializeComponent();

            //
            // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
            //
            UserControl.UIStyleBuilder.FormUI(this);

            this.ucMessage.Add(">>$CS_Please_Input_MOCode");            //请输入工单代码
            this.ucLEMOCode.TextFocus(false, true);

            this._moFacade = new MOFacade(this.DataProvider);
            this._helper   = new ActionOnLineHelper(this.DataProvider);
        }
Ejemplo n.º 17
0
        private void DoAction(string rcard, string sourceCard)
        {
            Messages messages = new Messages();

            ActionOnLineHelper actionOnLineHelper = new ActionOnLineHelper(this.DataProvider);
            ActionFactory      actionFactory      = new ActionFactory(this.DataProvider);
            IAction            actionCartonPack   = actionFactory.CreateAction(ActionType.DataCollectAction_Carton);

            ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)DataProvider).PersistBroker.OpenConnection();
            DataProvider.BeginTransaction();
            try
            {
                messages.AddMessages(AddSingleIDIntoCartonAndTry(sourceCard, messages, actionCartonPack, actionOnLineHelper));
                if (!messages.IsSuccess())
                {
                    this.DataProvider.RollbackTransaction();
                    InitMessage("", false, 0, rcard, false);
                }
                else
                {
                    this.DataProvider.CommitTransaction();
                    InitMessage("", false, 0, rcard, true);
                }
            }
            catch (Exception ex)
            {
                this.DataProvider.RollbackTransaction();
                ApplicationRun.GetInfoForm().AddEx(ex.Message);
            }
            finally
            {
                ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)DataProvider).PersistBroker.CloseConnection();
                ApplicationRun.GetInfoForm().AddEx(this._FunctionName, "" + this.ucLabelRCardForCarton.Value, messages, false);
                if (!messages.IsSuccess())
                {
                    this.ucLabelRCardForCarton.TextFocus(false, true);
                }
            }
            //if (messages.IsSuccess())
            //{
            //    RefreshCartonNumber();
            //}
        }
Ejemplo n.º 18
0
        /// <summary>
        /// 获得产品信息
        /// </summary>
        /// <returns></returns>
        private Messages GetProduct()
        {
            Messages           productmessages = new Messages();
            ActionOnLineHelper dataCollect     = new ActionOnLineHelper(DataProvider);

            try
            {
                productmessages.AddMessages(dataCollect.GetIDInfo(txtRunningCard.Value.Trim()));
                if (productmessages.IsSuccess())
                {
                    product = (ProductInfo)productmessages.GetData().Values[0];
                }
            }
            catch (Exception e)
            {
                productmessages.Add(new UserControl.Message(e));
            }
            return(productmessages);
        }
Ejemplo n.º 19
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="actionEventArgs"> </param> params (0,lotno)
        /// <returns></returns>
        public Messages Execute(ActionEventArgs actionEventArgs)
        {
            Messages         messages         = new Messages();
            DataCollectDebug dataCollectDebug = new DataCollectDebug(this.GetType().ToString() + "Collect");

            dataCollectDebug.WhenFunctionIn(messages);
            try
            {
                ActionOnLineHelper dataCollect = new ActionOnLineHelper(this.DataProvider);
                ActionOQCHelper    oqcHelper   = new ActionOQCHelper(this.DataProvider);

                //填写SIMULATION 检查工单、ID、途程、操作
                messages.AddMessages(dataCollect.CheckID(actionEventArgs));
                if (messages.IsSuccess())
                {
                    //
                    if (actionEventArgs.ProductInfo.NowSimulation == null)
                    {
                        throw new Exception("$System_Error");
                    }
                    //check oqclotstatus
                    if (oqcHelper.IsOQCLotComplete(actionEventArgs.Params[0].ToString()))
                    {
                        throw new Exception("$Error_OQCLotNOHasComplete");
                    }
                    //检查在批中检查的产品的最后一笔信息全部为Good

                    messages.AddMessages(dataCollect.Execute(actionEventArgs));
                    if (messages.IsSuccess())
                    {
                        //修改批状态
                        //批退修改每个板子的最后一笔状态为reject
                    }
                }
            }
            catch (Exception e)
            {
                messages.Add(new Message(e));
            }
            dataCollectDebug.WhenFunctionOut(messages);
            return(messages);
        }
Ejemplo n.º 20
0
        public Messages UndoExecute(ConvertCardActionEventArgs actionEventArgs)
        {
            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");
                }

                DataCollectFacade dataCollectFacade = new DataCollectFacade(this.DataProvider);
                object[]          oldSimulation     = dataCollectFacade.GetSimulationFromTCard(actionEventArgs.RunningCard);
                if (oldSimulation == null || oldSimulation.Length == 0)
                {
                    throw new Exception("$CS_System_Params_Losted");
                }

                ActionOnLineHelper  helper     = new ActionOnLineHelper(this.DataProvider);
                MORunningCardFacade cardFacade = new MORunningCardFacade(this.DataProvider);

                // 更新Simulation
                Simulation s           = (Simulation)oldSimulation[0];
                string     oldRCard    = s.TranslateCard;
                decimal    oldRCardSeq = s.RunningCardSequence;
                string     strNewRCard = actionEventArgs.ConvertToCard.ToString();
                string     strSql      = "";

                // 更新OnWIPTrans
                strSql = "UPDATE tblOnWIPCardTrans SET RCard='" + strNewRCard + "' WHERE TCard='" + oldRCard + "'";
                this.DataProvider.CustomExecute(new SQLCondition(strSql));
            }
            catch (Exception e)
            {
                messages.Add(new Message(e));
            }
            dataCollectDebug.WhenFunctionOut(messages);
            return(messages);
        }
Ejemplo n.º 21
0
        /// <summary>
        /// 业务处理
        /// </summary>
        /// <returns></returns>
        private Messages DoAction(ProductInfo Product)
        {
            Messages           msg    = new Messages();
            ActionOnLineHelper onLine = new ActionOnLineHelper(DataProvider);

            try
            {
                msg.AddMessages(CollectInfo(onLine, Product));

                if (msg.IsSuccess())
                {
                    Messages msgTmp = CollectKeyPartTS(Product);
                    if (msgTmp.IsSuccess() == true)
                    {
                        msg.AddMessages(msgTmp);
                    }
                    else
                    {
                        msg = msgTmp;
                    }
                }

                if (msg.IsSuccess())
                {
                    DataProvider.CommitTransaction();
                }
                else
                {
                    DataProvider.RollbackTransaction();
                }
            }
            catch (Exception e)
            {
                DataProvider.RollbackTransaction();
                msg.Add(new UserControl.Message(e));
            }


            return(msg);
        }
Ejemplo n.º 22
0
        /// <summary>
        /// 获得产品信息
        /// Laws Lu,2005/08/02,修改
        /// </summary>
        /// <returns></returns>
        private Messages GetProduct()
        {
            Messages           productmessages = new Messages();
            ActionOnLineHelper dataCollect     = new ActionOnLineHelper(this.DataProvider);

            //Add By Bernard @ 2010-11-03
            DataCollectFacade dataCollectFacade = new DataCollectFacade(this.DataProvider);
            string            sourceRCard       = dataCollectFacade.GetSourceCard(this.txtRunningCard.Value.Trim().ToUpper(), string.Empty);

            //end

            productmessages.AddMessages(dataCollect.GetIDInfo(sourceRCard.Trim().ToUpper()));
            if (productmessages.IsSuccess())
            {
                product = (ProductInfo)productmessages.GetData().Values[0];
            }
            else
            {
                product = new ProductInfo();
            }

            dataCollect = null;
            return(productmessages);
        }
Ejemplo n.º 23
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);
            }
        }
Ejemplo n.º 24
0
        public Messages Execute(ActionEventArgs actionEventArgs)
        {
            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())
                {
                    // 联美兰达下料不更新Simulation
                    //messages.AddMessages( dataCollect.Execute(actionEventArgs));
                    if (messages.IsSuccess())
                    {
                        /*	由于界面上会自动调用GOOD采集,因此不用写报表
                         * //填写测试报表
                         * 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);
                        }
                        else    // Added by Icyer 2006/11/16
                        {
                            DropMaterialEventArgs arg = (DropMaterialEventArgs)actionEventArgs;
                            if (arg.OnwipItems != null)
                            {
                                // 查询需要管控的KeyPart
                                ArrayList listKeyPart    = new ArrayList();
                                ArrayList listAllKeyPart = new ArrayList();

                                //ArrayList partsToUnload = new ArrayList();
                                //ArrayList partsToReplace = new ArrayList();

                                //for (int i = 0; i < arg.OnwipItems.Length; i++)
                                //{
                                //    BenQGuru.eMES.Material.InnoObject io = (BenQGuru.eMES.Material.InnoObject)arg.OnwipItems[i];

                                //    if (io.NewBarcode.Trim().Length > 0)
                                //        partsToReplace.Add(io);
                                //    else
                                //        partsToUnload.Add(io);
                                //}

                                string            sql               = string.Empty;
                                CastDownHelper    castDownHelper    = new CastDownHelper(DataProvider);
                                BaseModelFacade   baseModelFacade   = new BaseModelFacade(this.DataProvider);
                                DataCollectFacade dataCollectFacade = new DataCollectFacade(this.DataProvider);
                                ShiftModelFacade  shiftModelFacade  = new ShiftModelFacade(this.DataProvider);

                                DBDateTime dbDateTime = FormatHelper.GetNowDBDateTime(this.DataProvider);
                                foreach (InnoObject io in arg.OnwipItems)
                                {
                                    //获取arRcard
                                    ArrayList arRcard = new ArrayList();
                                    castDownHelper.GetAllRCard(ref arRcard, actionEventArgs.ProductInfo.NowSimulation.RunningCard);
                                    if (arRcard.Count == 0)
                                    {
                                        arRcard.Add(actionEventArgs.RunningCard);
                                    }

                                    //获取dropop
                                    Operation2Resource objOP  = baseModelFacade.GetOperationByResource(arg.ResourceCode);
                                    string             dropop = string.Empty;
                                    if (objOP != null)
                                    {
                                        dropop = objOP.OPCode;
                                    }

                                    #region 针对旧料所作的动作

                                    string runningCards = "('" + String.Join("','", (string[])arRcard.ToArray(typeof(string))) + "')";
                                    sql = string.Format("update TBLONWIPITEM set TRANSSTATUS='{0}',ActionType=" + (int)MaterialType.DropMaterial +
                                                        ",DropOP = '" + dropop + "'" +
                                                        ",DropUser='******'" +
                                                        ",DropDate=" + dbDateTime.DBDate +
                                                        ",DropTime=" + dbDateTime.DBTime +
                                                        " where RCARD in {1} and ActionType='{2}'" +
                                                        " and MCARD in ('" + io.MCard.Trim().ToUpper() + "')"
                                                        , TransactionStatus.TransactionStatus_YES
                                                        , runningCards
                                                        , (int)Web.Helper.MaterialType.CollectMaterial);
                                    this.DataProvider.CustomExecute(new SQLCondition(sql));

                                    if (io.MCardType == MCardType.MCardType_Keyparts)
                                    {
                                        sql = "update TBLSIMULATIONREPORT set IsLoadedPart='0',LoadedRCard='' " +
                                              " where RCARD in ('" + io.MCard.Trim().ToUpper() + "')";
                                        this.DataProvider.CustomExecute(new SQLCondition(sql));

                                        sql = "update TBLITEMLOTDETAIL set SERIALSTATUS='STORAGE' " +
                                              " where SERIALNO in ('" + io.MCard.Trim().ToUpper() + "')";
                                        this.DataProvider.CustomExecute(new SQLCondition(sql));
                                    }

                                    #endregion

                                    #region 针对新料所做的动作

                                    if (io.NewBarcode.Trim().Length > 0)
                                    {
                                        object[] oldOnWIPItemList = dataCollectFacade.QueryOnWIPItem(io.MCard, runningCards, ((int)Web.Helper.MaterialType.DropMaterial).ToString());

                                        if (oldOnWIPItemList != null && oldOnWIPItemList.Length > 0)
                                        {
                                            OnWIPItem oldOnWIPItem = (OnWIPItem)oldOnWIPItemList[0];
                                            OnWIPItem newOnWIPItem = dataCollectFacade.CreateNewOnWIPItem();

                                            newOnWIPItem.RunningCard      = oldOnWIPItem.RunningCard;
                                            newOnWIPItem.MSequence        = oldOnWIPItem.MSequence;
                                            newOnWIPItem.MOCode           = oldOnWIPItem.MOCode;
                                            newOnWIPItem.ModelCode        = oldOnWIPItem.ModelCode;
                                            newOnWIPItem.ItemCode         = oldOnWIPItem.ItemCode;
                                            newOnWIPItem.MItemCode        = oldOnWIPItem.MItemCode;
                                            newOnWIPItem.MCardType        = oldOnWIPItem.MCardType;
                                            newOnWIPItem.Qty              = oldOnWIPItem.Qty;
                                            newOnWIPItem.RouteCode        = oldOnWIPItem.RouteCode;
                                            newOnWIPItem.OPCode           = oldOnWIPItem.OPCode;
                                            newOnWIPItem.ResourceCode     = oldOnWIPItem.ResourceCode;
                                            newOnWIPItem.SegmentCode      = oldOnWIPItem.SegmentCode;
                                            newOnWIPItem.StepSequenceCode = oldOnWIPItem.StepSequenceCode;
                                            newOnWIPItem.EAttribute1      = oldOnWIPItem.EAttribute1;
                                            newOnWIPItem.MOSeq            = oldOnWIPItem.MOSeq;

                                            newOnWIPItem.MCARD          = io.NewBarcode;
                                            newOnWIPItem.LotNO          = io.NewLotNo;
                                            newOnWIPItem.PCBA           = io.NewPCBA;
                                            newOnWIPItem.BIOS           = io.NewBIOS;
                                            newOnWIPItem.Version        = io.NewVersion;
                                            newOnWIPItem.VendorItemCode = io.NewVendorItemCode;
                                            newOnWIPItem.VendorCode     = io.NewVendorCode;
                                            newOnWIPItem.DateCode       = io.NewDateCode;

                                            newOnWIPItem.TransactionStatus = TransactionStatus.TransactionStatus_NO;
                                            newOnWIPItem.ActionType        = (int)Web.Helper.MaterialType.CollectMaterial;
                                            newOnWIPItem.MaintainUser      = actionEventArgs.UserCode;
                                            newOnWIPItem.MaintainDate      = dbDateTime.DBDate;
                                            newOnWIPItem.MaintainTime      = dbDateTime.DBTime;

                                            //RunningCardSequence取当前RCard的最小再减一
                                            newOnWIPItem.RunningCardSequence = dataCollectFacade.GetMinRCardSequenceFromOnWipItem(runningCards);

                                            //重新抓取ShiftTypeCode、ShiftCode、TimePeriodCode
                                            StepSequence stepSequence = (StepSequence)baseModelFacade.GetStepSequence(newOnWIPItem.StepSequenceCode);
                                            if (stepSequence == null)
                                            {
                                                newOnWIPItem.ShiftTypeCode = stepSequence.ShiftTypeCode;
                                            }
                                            else
                                            {
                                                newOnWIPItem.ShiftTypeCode = oldOnWIPItem.ShiftTypeCode;
                                            }

                                            TimePeriod timePeriod = (TimePeriod)shiftModelFacade.GetTimePeriod(newOnWIPItem.ShiftTypeCode, dbDateTime.DBTime);
                                            if (timePeriod != null)
                                            {
                                                newOnWIPItem.TimePeriodCode = timePeriod.TimePeriodCode;
                                                newOnWIPItem.ShiftCode      = timePeriod.ShiftCode;
                                            }

                                            dataCollectFacade.AddOnWIPItem(newOnWIPItem);
                                        }

                                        if (io.MCardType == MCardType.MCardType_Keyparts)
                                        {
                                            sql = "update TBLSIMULATIONREPORT set IsLoadedPart='1',LoadedRCard='" + String.Join(",", (string[])arRcard.ToArray(typeof(string))) + "' " +
                                                  " where RCARD in ('" + io.NewBarcode.Trim().ToUpper() + "')";
                                            this.DataProvider.CustomExecute(new SQLCondition(sql));

                                            sql = "update TBLITEMLOTDETAIL set SERIALSTATUS='UNSTORAGE' " +
                                                  " where SERIALNO in ('" + io.NewBarcode.Trim().ToUpper() + "')";
                                            this.DataProvider.CustomExecute(new SQLCondition(sql));
                                        }

                                        // Added By Hi1/Venus.feng on 20081114 for Hisense Version : Add Remove Pallet and Carton
                                        // 拆箱和拆Pallet
                                        DataCollectFacade dcf = new DataCollectFacade(this.DataProvider);

                                        if (messages.IsSuccess())
                                        {
                                            messages.AddMessages(dcf.RemoveFromPallet(io.NewBarcode.Trim().ToUpper(), actionEventArgs.UserCode, true));
                                            if (messages.IsSuccess())
                                            {
                                                messages.ClearMessages();
                                            }
                                        }

                                        if (messages.IsSuccess())
                                        {
                                            messages.AddMessages(dcf.RemoveFromCarton(io.NewBarcode.Trim().ToUpper(), actionEventArgs.UserCode));
                                            if (messages.IsSuccess())
                                            {
                                                messages.ClearMessages();
                                            }
                                        }
                                        // End Added
                                    }

                                    #endregion
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                messages.Add(new Message(e));
            }
            dataCollectDebug.WhenFunctionOut(messages);
            return(messages);
        }
Ejemplo n.º 25
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 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);
            }
        }
Ejemplo n.º 26
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);
        }
Ejemplo n.º 27
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);
            }
        }
Ejemplo n.º 28
0
        public Messages AutoGoMO(ActionEventArgs actionEventArgs, ActionCheckStatus actionCheckStatus)
        {
            Messages msg = new Messages();

            // 如果当前序列号是在制品,则不会做归属工单
            if (actionEventArgs.ProductInfo != null &&
                actionEventArgs.ProductInfo.LastSimulation != null &&
                actionEventArgs.ProductInfo.LastSimulation.IsComplete != "1")
            {
                return(msg);
            }

            DBDateTime dbDateTime;

            dbDateTime = FormatHelper.GetNowDBDateTime(DataProvider);

            string strResCode = actionEventArgs.ResourceCode;
            string strRCard   = actionEventArgs.LotCode;
            // 根据资源检查是否需要归属工单
            Resource2MO res2mo = GetResource2MOByResource(strResCode, dbDateTime);

            if (res2mo == null)         // 如果没有设置,表示不用归属工单,直接返回
            {
                return(msg);
            }
            // 检查序列号格式
            msg.AddMessages(CheckRCardFormatByResource2MO(res2mo, actionEventArgs.LotCode, actionEventArgs));
            if (msg.IsSuccess() == false)
            {
                return(msg);
            }
            // 解析工单
            string strMOCode = BuildMOCodeByResource2MO(res2mo, actionEventArgs.LotCode, actionEventArgs, dbDateTime);
            // 执行归属工单的操作
            GoToMOActionEventArgs gomoArg = new GoToMOActionEventArgs(ActionType.DataCollectAction_GoMO,
                                                                      actionEventArgs.LotCode,
                                                                      actionEventArgs.UserCode,
                                                                      actionEventArgs.ResourceCode,
                                                                      actionEventArgs.ProductInfo,
                                                                      strMOCode);
            IAction gomoAction = new ActionFactory(this.DataProvider).CreateAction(ActionType.DataCollectAction_GoMO);

            try
            {
                if (actionCheckStatus != null)
                {
                    msg.AddMessages(((IActionWithStatus)gomoAction).Execute(gomoArg, actionCheckStatus));
                }
                else
                {
                    msg.AddMessages(gomoAction.Execute(gomoArg));
                }
            }
            catch (Exception e)
            {
                msg.Add(new Message(e));
            }
            if (msg.IsSuccess() == true)
            {
                msg.Add(new UserControl.Message(MessageType.Success, "$CS_GOMOSUCCESS"));

                if (actionCheckStatus == null || actionCheckStatus.NeedUpdateSimulation == true)
                {
                    ActionOnLineHelper onLine     = new ActionOnLineHelper(this.DataProvider);
                    Messages           msgProduct = onLine.GetIDInfo(actionEventArgs.LotCode);
                    actionEventArgs.ProductInfo = (ProductInfo)msgProduct.GetData().Values[0];
                }
                else
                {
                    actionEventArgs.ProductInfo.LastSimulation   = new ExtendSimulation(gomoArg.ProductInfo.NowSimulation);
                    actionCheckStatus.ProductInfo.LastSimulation = actionEventArgs.ProductInfo.LastSimulation;
                }
            }

            return(msg);
        }
Ejemplo n.º 29
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);
        }
Ejemplo n.º 30
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);
        }