Browse Source

收购综合报表 加 热鲜查询条件。

master
yibo 8 years ago
parent
commit
a662f78faf
1 changed files with 27 additions and 3 deletions
  1. +27
    -3
      B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/ComprehensiveReport.cs

+ 27
- 3
B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/ComprehensiveReport.cs View File

@ -21,6 +21,7 @@ using Forks.EnterpriseServices.SqlDoms;
using TSingSoft.WebControls2;
using TSingSoft.WebControls2.DFGrids;
using TSingSoft.WebPluginFramework;
using BWP.B3Frameworks;
namespace BWP.Web.Pages.B3QingDaoWanFu.Reports
{
@ -164,14 +165,17 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Reports
DFNamedValueInput<> input;
layoutManager.Add("BillState", input = QueryCreator.(mDFInfo.Fields["BillState"], true));
input.Value = .;
var config = new AutoLayoutConfig() { Cols = 2 };
var config = new AutoLayoutConfig() { Cols = 4 };
layoutManager.Add("ID", new SimpleLabel("结算单号"), QueryCreator.DFTextBox(mDFInfo.Fields["ID"]));
layoutManager.Add("HotFreshType", new SimpleLabel("热鲜"), QueryCreator.DFNameValueInput<>(mDFInfo.Fields["BillState"]));
config.Add("AccountingUnit_ID");
config.Add("ID");
// config.Add("Weigh_ID");
config.Add("BillState");
config.Add("HotFreshType");
config.Add("Supplier_ID");
config.Add("SupplierClass_ID");
config.Add("Employee_ID");
@ -244,8 +248,9 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Reports
var weight = new JoinAlias("mainweight", typeof(WeighBill));
query.From.AddJoin(JoinType.Left, new DQDmoSource(weight), DQCondition.EQ(bill, "Weigh_ID", weight, "ID"));
var hotFreshInput = mQueryContainer.GetInput("HotFreshType");
if (hotFreshInput != null)
ButcherOrderTemp.AddJoinWithCondition(query, weight, hotFreshInput);
tempUnionDom.Register(query);
var unionAlias = new JoinAlias("tempUnionDom", typeof(tempUnionDom));
query.From.AddJoin(JoinType.Left, new DQDmoSource(unionAlias), DQCondition.EQ(bill, "ID", unionAlias, "StatPay_ID"));
@ -878,5 +883,24 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Reports
}
}
class ButcherOrderTemp
{
public long? Weigh_ID { get; set; }
public static void AddJoinWithCondition(DQueryDom root, JoinAlias weighBill, object hotFreshType)
{
var main = new JoinAlias(typeof(ButcherOrder));
var detail = new JoinAlias(typeof(ButcherOrder_Detail));
var query = new DQueryDom(detail);
query.From.AddJoin(JoinType.Inner, new DQDmoSource(main), DQCondition.EQ(main, "ID", detail, "ButcherOrder_ID"));
query.Columns.Add(DQSelectColumn.Field("WeighBill_ID"));
query.GroupBy.Expressions.Add(DQExpression.Field("WeighBill_ID"));
query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ(main, "Domain_ID", DomainContext.Current.ID), DQCondition.GreaterThanOrEqual(main, "BillState", .), DQCondition.EQ("HotFreshType", hotFreshType)));
var alias = new JoinAlias(typeof(ButcherOrderTemp));
root.RegisterQueryTable(typeof(ButcherOrderTemp), new string[] { "Weigh_ID" }, query);
root.From.AddJoin(JoinType.Inner, new DQDmoSource(alias), DQCondition.EQ(weighBill, "ID", alias, "Weigh_ID"));
}
}
}
}

Loading…
Cancel
Save