internal static ProductDetail NewProductDetail(ProductMaster entity, MicronBEAssyProcess process) { try { ProductDetail productDetail = new ProductDetail(); productDetail.LineID = entity.LINE_ID; productDetail.ProductID = entity.PRODUCT_ID; productDetail.ProductName = entity.PRODUCT_NAME; productDetail.Process = process; productDetail.DesignID = entity.DESIGN_ID; productDetail.MaterialGroup = entity.MATERIAL_GROUP; productDetail.PkgFamily = entity.PKG_FAMILY; productDetail.PkgType = entity.PKG_TYPE; productDetail.PkgLeadCount = entity.PKG_LEAD_COUNT; productDetail.PkgWidth = entity.PKG_WIDTH; productDetail.PkgLength = entity.PKG_LENGTH; productDetail.PkgHeight = entity.PKG_HEIGHT; productDetail.NetDie = entity.NET_DIE; return(productDetail); } catch (Exception e) { WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0} MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name)); return(null); } }
/// <summary> /// </summary> /// <param name="pegPart"/> /// <returns/> public Step GETLASTPEGGINGSTEP(Mozart.SeePlan.Pegging.PegPart pegPart) { try { MicronBEAssyBEPegPart pp = pegPart as MicronBEAssyBEPegPart; MicronBEAssyProcess process = pp.Product.Process as MicronBEAssyProcess; return(process.LastStep); } catch (Exception e) { WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0} MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name)); return(default(Step)); } }
public static void SetSteps(MicronBEAssyBatch batch, Product product) { try { if (product.IsMcp()) { AssyMcpProduct mcpProduct = null; if (product is AssyMcpPart) { mcpProduct = (product as AssyMcpPart).FinalProduct as AssyMcpProduct; } else { mcpProduct = product as AssyMcpProduct; } foreach (AssyMcpPart mcpPart in mcpProduct.AllParts) { //if (mcpPart.IsMain == false) // continue; MicronBEAssyProcess proc = mcpPart.Process as MicronBEAssyProcess; int seq = mcpPart.CompSeq; //if (proc.ProcessType == ProcessType.COW) //{ // if (mcpPart.IsMidPart == false && mcpPart.IsBase)//COW 1차는 Merge 후 2차 DA에서 진행하기 때문에 없다고 판단해야함. // { // continue; // } //} AddSteps(batch, proc, seq); } AddSteps(batch, mcpProduct.Process as MicronBEAssyProcess, mcpProduct.MaxSequence); } else { AddSteps(batch, product.Process as MicronBEAssyProcess, 1); } } catch (Exception e) { WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0} MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name)); } }
internal static MicronBEAssyProcess NewProcess(string lineID, string processID) { try { MicronBEAssyProcess process = new MicronBEAssyProcess(processID); process.LineID = lineID; process.DieAttachSteps = new List <MicronBEAssyBEStep>(); return(process); } catch (Exception e) { WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0} MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name)); return(null); } }
/// <summary> /// </summary> /// <param name="entity"/> /// <returns/> public bool OnAfterLoad_ProductMaster(ProductMaster entity) { try { entity.LINE_ID = UtilityHelper.Trim(entity.LINE_ID); entity.PRODUCT_ID = UtilityHelper.Trim(entity.PRODUCT_ID); entity.PRODUCT_NAME = UtilityHelper.Trim(entity.PRODUCT_NAME); entity.PROCESS_ID = UtilityHelper.Trim(entity.PROCESS_ID); entity.DESIGN_ID = UtilityHelper.Trim(entity.DESIGN_ID); entity.MATERIAL_GROUP = UtilityHelper.Trim(entity.MATERIAL_GROUP); entity.PKG_FAMILY = UtilityHelper.Trim(entity.PKG_FAMILY); entity.PKG_TYPE = UtilityHelper.Trim(entity.PKG_TYPE); MicronBEAssyProcess process = FindHelper.FindProcess(entity.LINE_ID, entity.PROCESS_ID); if (process != null) { Tuple <string, string> key = new Tuple <string, string>(entity.LINE_ID, entity.PRODUCT_ID); if (InputMart.Instance.ProductDetail.ContainsKey(key) == false) { ProductDetail detail = NewHelper.NewProductDetail(entity, process); InputMart.Instance.ProductDetail.Add(key, detail); } } else { WriteHelper.WriteMasterDataErrorLog(MasterDataErrorEventType.PROCESS, entity.LINE_ID, string.Empty, string.Empty, entity.PRODUCT_ID, entity.DESIGN_ID, string.Empty, 0, string.Empty, ErrorMessageHelper.CANNOT_FIND_PROCESS_STEP, string.Format("PROCESS_ID : {0}", entity.PROCESS_ID), entity.GetType().Name); } return(false); } catch (Exception e) { WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0} MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name)); return(false); } }
private static void AddSteps(MicronBEAssyBatch batch, MicronBEAssyProcess proc, int seq) { try { foreach (MicronBEAssyBEStep step in proc.Steps) { //if (step.StepGroup == StepGroup.NONE) // continue; string key = step.StepID; if (batch.StepList.ContainsKey(key) == false) { batch.StepList.Add(key, step); } } } catch (Exception e) { WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0} MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name)); } }
internal static Product FindWipProduct(Wip entity, MicronBEAssyProcess process, MicronBEAssyBEStep step, Mozart.SeePlan.Simulation.EntityState state, out string unpegReason) { Product product = null; unpegReason = string.Empty; #if DEBUG if (entity.PRODUCT_ID == "264153") { Console.WriteLine(); } if (entity.PRODUCT_ID == "264157") { Console.WriteLine(); } #endif int daThroughtCnt = step.DaThroughCount; if (step.StepGroup == Constants.DieAttach && state != EntityState.RUN) { daThroughtCnt = daThroughtCnt - 1;//DA 대기중인 재공은 DA를 진행하지 않은 상태로 판단 } Product wipProduct = FindHelper.FindProduct(entity.LINE_ID, entity.PRODUCT_ID); if (wipProduct is MicronBEAssyProduct) { product = wipProduct; } else if (wipProduct != null && wipProduct is AssyMcpProduct && daThroughtCnt >= 1) { AssyMcpProduct mcpProduct = wipProduct as AssyMcpProduct; if (daThroughtCnt == mcpProduct.MaxSequence) { product = mcpProduct; } else { AssyMcpPart midPart = FindHelper.FindProduct(entity.LINE_ID, entity.PRODUCT_ID, true, true, daThroughtCnt) as AssyMcpPart; if (midPart != null) { product = midPart; } #if DEBUG if (midPart == null) { Console.WriteLine(); } #endif } } else { //임시로직 - 로직이 정해지먼 재정의 해야함. //초기화시 CompSeq가 확정된 Part를 찾을 수 없기 때문에 대표로 Part를 하나 찾아서 정의를 해야함. ICollection <AssyMcpPart> products = FindHelper.FindAssyInParts(entity.LINE_ID, entity.PRODUCT_ID); if (products != null && products.Count > 0) { product = products.ElementAt(0); } } if (product == null) { if (step.StepID == Constants.LOTSRECEIVED) { unpegReason = "Cannot find McpBom or ProductRoute"; } else { unpegReason = "Cannot find McpBom"; } } return(product); }
/// <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); } }