/// <summary> /// 根据品号获取品号工厂信息 /// </summary> /// <param name="itemID">品号ID集合</param> /// <param name="sitNo">工厂ID</param> /// <returns></returns> private DependencyObjectCollection GetItemForPlant(DependencyObjectCollection itemID, string siteNo, string programJobNo) { List <QueryProperty> properties = GetQueryProperty(siteNo); properties.Add(Formulas.IsNull(Formulas.Case(null, OOQL.CreateProperty("ITEM_PLANT.RECEIPT_OVERRUN_RATE"), new CaseItem[] { new CaseItem(OOQL.CreateConstants(programJobNo).Like(OOQL.CreateConstants("7%")) , OOQL.CreateProperty("ITEM_PLANT.ISSUE_OVERRUN_RATE")), new CaseItem(OOQL.CreateConstants(programJobNo).Like(OOQL.CreateConstants("8%")) , OOQL.CreateProperty("ITEM_PLANT.ISSUE_SHORTAGE_RATE")) }), OOQL.CreateConstants(0m, GeneralDBType.Decimal), "over_deliver_rate")); //超交率 QueryNode node = OOQL.Select( properties ) .From("ITEM", "ITEM") .LeftJoin("ITEM.ITEM_FEATURE", "ITEM_FEATURE") .On(OOQL.CreateProperty("ITEM.ITEM_ID") == OOQL.CreateProperty("ITEM_FEATURE.ITEM_ID")) .LeftJoin("UNIT") .On(OOQL.CreateProperty("ITEM.STOCK_UNIT_ID") == OOQL.CreateProperty("UNIT.UNIT_ID")) .LeftJoin("ITEM_PLANT") .On(OOQL.CreateProperty("ITEM.ITEM_ID") == OOQL.CreateProperty("ITEM_PLANT.ITEM_ID")) .LeftJoin("PLANT") .On(OOQL.CreateProperty("ITEM_PLANT.Owner_Org.ROid") == OOQL.CreateProperty("PLANT.PLANT_ID")) .Where(OOQL.AuthFilter("ITEM", "ITEM") & OOQL.CreateProperty("PLANT.PLANT_CODE") == OOQL.CreateConstants(siteNo) & OOQL.CreateProperty("ITEM.ITEM_ID").In(OOQL.CreateDyncParameter("IDS", itemID.Select(c => c["item_id"]).ToArray()))); return(UtilsClass.ExecuteDependencyObject(this.GetService <IQueryService>(), node)); }
/// <summary> /// 根据品号获取品号采购信息 /// </summary> /// <param name="itemID">品号ID集合</param> /// <param name="mainOrganization">采购域</param> /// <returns></returns> private DependencyObjectCollection GetItemForSupplyCenter(DependencyObjectCollection itemID, string siteNo, object mainOrganization, string programJobNo) { List <QueryProperty> properties = GetQueryProperty(siteNo); properties.Add(Formulas.IsNull(OOQL.CreateProperty("ITEM_PURCHASE.RECEIPT_OVER_RATE"), OOQL.CreateConstants(0m, GeneralDBType.Decimal) , "over_deliver_rate")); //超交率 QueryNode node = OOQL.Select( properties ) .From("ITEM", "ITEM") .LeftJoin("ITEM.ITEM_FEATURE", "ITEM_FEATURE") .On(OOQL.CreateProperty("ITEM.ITEM_ID") == OOQL.CreateProperty("ITEM_FEATURE.ITEM_ID")) .LeftJoin("UNIT") .On(OOQL.CreateProperty("ITEM.STOCK_UNIT_ID") == OOQL.CreateProperty("UNIT.UNIT_ID")) .LeftJoin("ITEM_PURCHASE") .On(OOQL.CreateProperty("ITEM.ITEM_ID") == OOQL.CreateProperty("ITEM_PURCHASE.ITEM_ID")) .Where(OOQL.AuthFilter("ITEM", "ITEM") & OOQL.CreateProperty("ITEM_PURCHASE.Owner_Org.ROid") == OOQL.CreateConstants(mainOrganization) & OOQL.CreateProperty("ITEM.ITEM_ID").In(OOQL.CreateDyncParameter("IDS", itemID.Select(c => c["item_id"]).ToArray()))); return(UtilsClass.ExecuteDependencyObject(this.GetService <IQueryService>(), node)); }