コード例 #1
0
        /// <summary>
        /// </summary>
        /// <param name="entity"/>
        /// <returns/>
        public bool OnAfterLoad_ActInfo(ActInfo entity)
        {
            try
            {
                if (string.IsNullOrEmpty(entity.PRODUCT_ID))
                {
                    return(false);
                }

                MicronBEAssyWipInfo wipInfo = new MicronBEAssyWipInfo();
                wipInfo.LineID       = entity.LINE_ID;
                wipInfo.WipProductID = entity.PRODUCT_ID;
                wipInfo.UnitQty      = (double)entity.ACT_QTY;
                wipInfo.LotID        = "ACT";

                MicronBEAssyPlanWip actWip = new MicronBEAssyPlanWip(wipInfo);
                actWip.LotID = wipInfo.LotID;

                IComparable key = actWip.GetWipInfo().WipProductID;
                InputMart.Instance.MicronBEAssyActPlanWips.Add(key, actWip);

                return(false);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(false);
            }
        }
コード例 #2
0
ファイル: WriteHelper.cs プロジェクト: parkheenam/test
        public static void WriteUnpeg(MicronBEAssyPlanWip planWip, UnpegReason unpegReason)
        {
            try
            {
                MicronBEAssyWipInfo wipInfo = planWip.GetWipInfo();

                if (planWip.Product != null)
                {
                    WriteUnpeg(wipInfo.LineID, wipInfo.LotID, planWip.Product.ProductID,
                               planWip.MapStep.StepID, (decimal)wipInfo.UnitQty, (decimal)planWip.Qty,
                               planWip.Product.DesignID(), planWip.Product.IsBase(), wipInfo.CurrentState.ToString(),
                               unpegReason.ToString(), string.Empty);
                }
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
            }
        }
コード例 #3
0
        public static PlanWip CreatePlanWip(IWipInfo wip)
        {
            try
            {
                MicronBEAssyWipInfo wipInfo = wip as MicronBEAssyWipInfo;
                MicronBEAssyPlanWip planWip = new MicronBEAssyPlanWip(wipInfo);

                planWip.MapStep       = wipInfo.InitialStep;
                planWip.AvailableTime = FindHelper.GetEngineStartTime();
                planWip.Product       = wipInfo.Product;
                planWip.LotID         = wipInfo.LotID;
                planWip.State         = wipInfo.CurrentState.ToString();

                return(planWip);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(default(PlanWip));
            }
        }
コード例 #4
0
        /// <summary>
        /// </summary>
        /// <param name="entity"/>
        /// <returns/>
        public bool OnAfterLoad_Wip(Wip entity)
        {
            try
            {
                entity.LOT_ID             = UtilityHelper.Trim(entity.LOT_ID);
                entity.LINE_ID            = UtilityHelper.Trim(entity.LINE_ID);
                entity.STEP_ID            = UtilityHelper.Trim(entity.STEP_ID);
                entity.PROCESS_ID         = UtilityHelper.Trim(entity.PROCESS_ID);
                entity.PRODUCT_ID         = UtilityHelper.Trim(entity.PRODUCT_ID);
                entity.PRODUCT_NAME       = UtilityHelper.Trim(entity.PRODUCT_NAME);
                entity.HOLD_CODE          = UtilityHelper.Trim(entity.HOLD_CODE);
                entity.LOT_STATE          = UtilityHelper.Trim(entity.LOT_STATE);
                entity.EQP_ID             = UtilityHelper.Trim(entity.EQP_ID);
                entity.ASM_RESERVATION_ID = UtilityHelper.Trim(entity.ASM_RESERVATION_ID);

#if DEBUG
                if (entity.LOT_ID.StartsWith("BF8QK4N.5X"))
                {
                    Console.WriteLine();
                }

                if (entity.PRODUCT_ID == "BF8QK4N.5X")
                {
                    Console.WriteLine();
                }
#endif

                ProductDetail productDetail = FindHelper.FindProductDetail(entity.LINE_ID, entity.PRODUCT_ID);
                Mozart.SeePlan.Simulation.EntityState state = FindHelper.FindLotState(entity.LOT_STATE, entity.HOLD_CODE, entity.EQP_ID);

                if (productDetail == null)
                {
                    WriteHelper.WriteMasterDataErrorLog(MasterDataErrorEventType.WIP, entity.LINE_ID, entity.STEP_ID,
                                                        entity.LOT_ID, entity.PRODUCT_ID, string.Empty, string.Empty, entity.LOT_QTY, string.Empty, "Cannot find ProductMaster", string.Empty, "Wip");

                    WriteHelper.WriteUnpeg(entity, string.Empty, false, state, UnpegReason.MASTER_DATA, "Cannot find ProductMaster");
                    return(false);
                }

                MicronBEAssyProcess process = productDetail.Process;

                MicronBEAssyBEStep step = process.FindStep(entity.STEP_ID) as MicronBEAssyBEStep;

                if (step == null)
                {
                    WriteHelper.WriteMasterDataErrorLog(MasterDataErrorEventType.WIP, entity.LINE_ID, entity.STEP_ID,
                                                        entity.LOT_ID, entity.PRODUCT_ID, productDetail.DesignID, string.Empty, entity.LOT_QTY, string.Empty, "Cannot find ProcessStep", string.Format("PROCESS_ID : {0}", productDetail.Process.ProcessID), "Wip");

                    WriteHelper.WriteUnpeg(entity, productDetail.DesignID, false, state, UnpegReason.MASTER_DATA, "Cannot find ProcessStep");
                    return(false);
                }

                string  unpegReason = string.Empty;
                Product product     = FindHelper.FindWipProduct(entity, process, step, state, out unpegReason);

                if (product == null)
                {
                    WriteHelper.WriteMasterDataErrorLog(MasterDataErrorEventType.WIP, entity.LINE_ID, entity.STEP_ID,
                                                        entity.LOT_ID, entity.PRODUCT_ID, productDetail.DesignID, string.Empty, entity.LOT_QTY, string.Empty, "Cannot find ProcessStep", string.Format("PROCESS_ID : {0}", productDetail.Process.ProcessID), "Wip");

                    WriteHelper.WriteUnpeg(entity, productDetail.DesignID, false, state, UnpegReason.MASTER_DATA, unpegReason);
                    return(false);
                }

                MicronBEAssyWipInfo wipInfo = new MicronBEAssyWipInfo();
                wipInfo.LotID   = entity.LOT_ID;
                wipInfo.Product = product;
                wipInfo.Process = process;

                wipInfo.UnitQty      = (double)entity.LOT_QTY;
                wipInfo.InitialStep  = process.FindStep(entity.STEP_ID);
                wipInfo.CurrentState = state;
                wipInfo.LineID       = entity.LINE_ID;

                InputMart.Instance.MicronBEAssyWipInfo.Add(wipInfo.InitialStep.StepID, wipInfo);

                return(false);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(false);
            }
        }