From 300799c0b62ce998008c0f3691828a6cb82d36c4 Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Mon, 10 Sep 2018 20:53:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TypeIOCs/ForecastButcherInfo.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/B3ButcherManageToSale/TypeIOCs/ForecastButcherInfo.cs b/B3ButcherManageToSale/TypeIOCs/ForecastButcherInfo.cs index e5f5726..fe1f72c 100644 --- a/B3ButcherManageToSale/TypeIOCs/ForecastButcherInfo.cs +++ b/B3ButcherManageToSale/TypeIOCs/ForecastButcherInfo.cs @@ -75,5 +75,17 @@ namespace BWP.B3ButcherManageToSale.TypeIOCs query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("Stopped", false), DQCondition.EQ("Domain_ID", DomainContext.Current.ID))); return query.EExecuteList>(session); } + + public Money? GetGoodsSaleOutStoreNumber(IDmoContext context, long storeID, DateTime date, long goodsID) + { + var main = new JoinAlias("_main", typeof(SaleOutStore)); + var detail = new JoinAlias(typeof(SaleOutStore_Detail)); + var query = new DQueryDom(main); + query.From.AddJoin(JoinType.Inner, new DQDmoSource(detail), DQCondition.EQ(main, "ID", detail, "SaleOutStore_ID")); + query.Columns.Add(DQSelectColumn.Sum(detail, "UnitNum")); + query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ(DQExpression.Snippet("cast(_main.LoadTime as date)"), DQExpression.Value(date)), DQCondition.EQ("BillState", 单据状态.未审核), DQCondition.IsNotNull(DQExpression.Field(detail, "UnitNum")))); + query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ(detail, "SaleGoods_ID", goodsID), DQCondition.EQ("Store_ID", storeID))); + return query.EExecuteScalar?>(context.Session); + } } }