private static DcnTarget SelectTarget_FixPlan(this DcnMaster mst, FixPlanDCN fixPlan) { if (fixPlan == null) { return(null); } var targetList = mst.AllTargets; if (targetList == null || targetList.Count == 0) { return(null); } var find = targetList.Find(t => t.ShopID == fixPlan.SHOP_ID && t.ProductID == fixPlan.PRODUCT_ID && t.RemainQty > 0); return(find); }
public static void AddFixPlan(FixPlanDCN entity) { if (entity == null) { return; } if (entity.PLAN_QTY <= 0) { return; } var dcnMst = ReleasePlanMaster.DcnMst; string eqpID = entity.EQP_ID; if (string.IsNullOrEmpty(eqpID)) { return; } var prod = BopHelper.FindProduct(entity.SHOP_ID, entity.PRODUCT_ID); if (prod == null) { return; } List <FixPlanDCN> list; if (dcnMst.FixPlans.TryGetValue(eqpID, out list) == false) { dcnMst.FixPlans.Add(eqpID, list = new List <FixPlanDCN>()); } LcdHelper.AddSort(list, entity, FixPlanComparer.Default); }
private static bool Allocate_FixPlan(this DcnMaster mst, DcnBucket bck, DcnTarget target, FixPlanDCN fixPlan, DateTime now) { int allocQty = fixPlan.PLAN_QTY; if (allocQty <= 0) { return(false); } FabProduct prod = target == null ? null : target.Product; if (prod == null) { prod = BopHelper.FindProduct(fixPlan.SHOP_ID, fixPlan.PRODUCT_ID); } if (prod == null) { return(false); } var plan = bck.Allocate(prod, allocQty, target, now); //전체 Alloc Plan 기록 if (plan != null) { plan.FixPlan = fixPlan; plan.AllocSeq = mst.AllPlans.Count + 1; mst.AllPlans.Add(plan); mst.Current.Add(plan); } bool isNoAlloc = plan == null; if (isNoAlloc) { return(false); } return(true); }