From a5f0631f2667b2b3ffc0032688654c419ca874d3 Mon Sep 17 00:00:00 2001 From: duanluohua Date: Mon, 22 Oct 2018 12:38:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=80=A5=E5=AE=B0=E5=8D=95=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=9A=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BL/Bill/WeightBillBL/WeightBillBL.cs | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/B3SheepButcherManage/BL/Bill/WeightBillBL/WeightBillBL.cs b/B3SheepButcherManage/BL/Bill/WeightBillBL/WeightBillBL.cs index 253079a..94b2e4f 100644 --- a/B3SheepButcherManage/BL/Bill/WeightBillBL/WeightBillBL.cs +++ b/B3SheepButcherManage/BL/Bill/WeightBillBL/WeightBillBL.cs @@ -154,19 +154,19 @@ namespace BWP.B3SheepButcherManage.BL var planNumber = tuple.Item1 ?? 0; var butcherNumber = tuple.Item2 ?? 0; - //var hurryDetail = new JoinAlias(typeof(HurryButcher_Detail)); - //var hurry = new JoinAlias(typeof(HurryButcher)); - //var hurryDom = new DQueryDom(hurryDetail); - //hurryDom.From.AddJoin(JoinType.Left, new DQDmoSource(hurry), DQCondition.EQ(hurryDetail, "HurryButcher_ID", hurry, "ID")); - //hurryDom.Where.Conditions.Add(DQCondition.EQ("Weigh_Detail_ID", weighDetailID)); - //hurryDom.Where.Conditions.Add(DQCondition.Or( - // DQCondition.EQ(hurry, "BillState", 单据状态.已审核), - // DQCondition.EQ(hurry, "BillState", 单据状态.已完毕))); - //hurryDom.Columns.Add(DQSelectColumn.Sum("Number")); - //var hurryNumber = (int?)Session.ExecuteScalar(hurryDom); - - //butcherNumber = (butcherNumber) + (hurryNumber ?? 0); - //planNumber = (planNumber) + (hurryNumber ?? 0); + var hurryDetail = new JoinAlias(typeof(HurryButcher_Detail)); + var hurry = new JoinAlias(typeof(HurryButcher)); + var hurryDom = new DQueryDom(hurryDetail); + hurryDom.From.AddJoin(JoinType.Left, new DQDmoSource(hurry), DQCondition.EQ(hurryDetail, "HurryButcher_ID", hurry, "ID")); + hurryDom.Where.Conditions.Add(DQCondition.EQ("Weigh_Detail_ID", weighDetailID)); + hurryDom.Where.Conditions.Add(DQCondition.Or( + DQCondition.EQ(hurry, "BillState", 单据状态.已审核), + DQCondition.EQ(hurry, "BillState", 单据状态.已完毕))); + hurryDom.Columns.Add(DQSelectColumn.Sum("Number")); + var hurryNumber = (int?)Session.ExecuteScalar(hurryDom); + + butcherNumber = (butcherNumber) + (hurryNumber ?? 0); + planNumber = (planNumber) + (hurryNumber ?? 0); var updatedom = new DQUpdateDom(typeof(WeightBill_Record)); updatedom.Where.Conditions.Add(DQCondition.EQ("ID", weighDetailID));