|
|
|
@ -1,9 +1,7 @@ |
|
|
|
using BWP.B3ButcherManage; |
|
|
|
using BWP.B3ButcherManage.BO; |
|
|
|
using BWP.B3ButcherManage.NamedValueTemplate; |
|
|
|
using BWP.B3Frameworks; |
|
|
|
using BWP.B3Frameworks.BO.MoneyTemplate; |
|
|
|
using BWP.B3Frameworks.BO.NamedValueTemplate; |
|
|
|
using BWP.Web.Layout; |
|
|
|
using BWP.Web.Utils; |
|
|
|
using Forks.EnterpriseServices.DomainObjects2; |
|
|
|
@ -138,7 +136,6 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Reports |
|
|
|
mDisplayHelper.AddOptionItem("棚前头数", "_detail", "Number", false, true); |
|
|
|
mDisplayHelper.AddOptionItem("棚前重量", "_detail", "ExeWeight", false, true); |
|
|
|
mDisplayHelper.AddOptionItem("棚前金额", "_detail", "ExtMoney", false, true); |
|
|
|
mDisplayHelper.AddOptionItem("付款对象", "_pay", "PayTarget", false); |
|
|
|
AddQueryOption("选项", mDisplayHelper.GetAllDisplayNames(), mDisplayHelper.GetDefaultSelelectedDisplayNames()); |
|
|
|
|
|
|
|
base.AddQueryOptions(vPanel); |
|
|
|
@ -151,42 +148,15 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Reports |
|
|
|
var root = query.From.RootSource.Alias; |
|
|
|
var weight = new JoinAlias("_weight", typeof(WeighBill)); |
|
|
|
var detail = new JoinAlias("_detail", typeof(Weigh_FarmerDetail)); |
|
|
|
var pay = new JoinAlias("_pay", typeof(PayTemp)); |
|
|
|
PayTemp.Register(query); |
|
|
|
query.From.AddJoin(JoinType.Left, new DQDmoSource(weight), DQCondition.EQ(root, "Weigh_ID", weight, "ID")); |
|
|
|
query.From.AddJoin(JoinType.Left, new DQDmoSource(detail), DQCondition.EQ(root, "Weigh_ID", detail, "Weigh_ID")); |
|
|
|
query.From.AddJoin(JoinType.Left, new DQDmoSource(pay), DQCondition.EQ(pay, "StatPay_ID", root, "ID")); |
|
|
|
mDisplayHelper.AddAlias("_bill", root); |
|
|
|
mDisplayHelper.AddAlias("_weight", weight); |
|
|
|
mDisplayHelper.AddAlias("_detail", detail); |
|
|
|
mDisplayHelper.AddAlias("_pay", pay); |
|
|
|
|
|
|
|
mDisplayHelper.AddSelectColumns(query, (name) => OptionIsSelected("选项", name), SumColumnNames, ColumnNames); |
|
|
|
query.Where.Conditions.Add(DQCondition.EQ(root, "Domain_ID", DomainContext.Current.ID)); |
|
|
|
return query; |
|
|
|
} |
|
|
|
|
|
|
|
class PayTemp |
|
|
|
{ |
|
|
|
public long StatPay_ID { get; set; } |
|
|
|
|
|
|
|
public NamedValue<付款对象>? PayTarget { get; set; } |
|
|
|
|
|
|
|
public static void Register(DQueryDom root) |
|
|
|
{ |
|
|
|
var payDetail = new JoinAlias(typeof(Pay_Detail)); |
|
|
|
var pay = new JoinAlias("_pay", typeof(Pay)); |
|
|
|
|
|
|
|
var query = new DQueryDom(pay); |
|
|
|
query.From.AddJoin(JoinType.Inner, new DQDmoSource(payDetail), DQCondition.EQ(payDetail, "Pay_ID", pay, "ID")); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("StatPay_ID", payDetail)); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("PayTarget")); |
|
|
|
query.GroupBy.Expressions.Add(DQExpression.Field(payDetail, "StatPay_ID")); |
|
|
|
query.GroupBy.Expressions.Add(DQExpression.Field("PayTarget")); |
|
|
|
query.Where.Conditions.Add(DQCondition.And(DQCondition.GreaterThanOrEqual("BillState", 单据状态.已审核), DQCondition.EQ("Domain_ID", DomainContext.Current.ID))); |
|
|
|
|
|
|
|
root.RegisterQueryTable(typeof(PayTemp), new string[] { "StatPay_ID", "PayTarget" }, query); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |