public void InitPageParameter() { #region 已投料 IList <ProductLineInProcessLocationDetail> productLineIpList = new List <ProductLineInProcessLocationDetail>(); if (tbProductLine.Text.Trim() != string.Empty) { productLineIpList = TheProductLineInProcessLocationDetailMgr.GetProductLineInProcessLocationDetail(this.tbProductLine.Text.Trim(), BusinessConstants.CODE_MASTER_STATUS_VALUE_CREATE); } this.GV_List_Feeded.DataSource = productLineIpList; this.GV_List_Feeded.DataBind(); #endregion #region 新投料 //todo 根据flow得到Material的list IList <BomDetail> bomDetailList = new List <BomDetail>(); IList <MaterialIn> materialInList = new List <MaterialIn>(); if (this.tbProductLine.Text.Trim() != string.Empty) { bomDetailList = TheFlowMgr.GetBatchFeedBomDetail(this.tbProductLine.Text.Trim()); } //暂时放在页面,后面再抽出来 Flow flow = TheFlowMgr.LoadFlow(this.tbProductLine.Text.Trim(), true); if (bomDetailList != null && bomDetailList.Count > 0) { foreach (BomDetail bomDetail in bomDetailList) { MaterialIn materialIn = new MaterialIn(); materialIn.Location = bomDetail.Location; materialIn.Operation = bomDetail.Operation; materialIn.RawMaterial = bomDetail.Item; //来源库位查找逻辑BomDetail-->RoutingDetail-->FlowDetail-->Flow Location bomLocFrom = bomDetail.Location; if (flow.Routing != null) { //在Routing上查找,并检验Routing上的工序和BOM上的是否匹配 RoutingDetail routingDetail = TheRoutingDetailMgr.LoadRoutingDetail(flow.Routing, bomDetail.Operation, bomDetail.Reference); if (routingDetail != null) { if (bomLocFrom == null) { bomLocFrom = routingDetail.Location; } } } if (bomLocFrom == null) { bomLocFrom = bomDetail.DefaultLocation; } materialIn.Location = bomLocFrom; bool isInclude = false; foreach (MaterialIn m in materialInList) { if (m.Location.Code == materialIn.Location.Code && m.Operation == materialIn.Operation && m.RawMaterial.Code == materialIn.RawMaterial.Code) { isInclude = true; } } if (!isInclude) { materialInList.Add(materialIn); } } } this.GV_List.DataSource = materialInList; this.GV_List.DataBind(); #endregion }