From 25e3aafbd3b12f92689d22629c17e92574f84a01 Mon Sep 17 00:00:00 2001
From: yibo <361071264@qq.com>
Date: Sat, 5 May 2018 13:18:59 +0800
Subject: [PATCH] =?UTF-8?q?=E7=BB=93=E7=AE=97=E5=8D=95=E5=88=86=E6=9E=90?=
=?UTF-8?q?=E5=9C=A8=E5=AE=A2=E6=88=B7=E6=A8=A1=E5=9D=97=E8=B0=83=E6=95=B4?=
=?UTF-8?q?=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj | 3 +
.../B3QingDaoWanFu/Overlays/PayAnalyse_Ext.cs | 61 +++++++++++++++++++
B3QingDaoWanFu.Web/PluginClass.cs | 1 +
3 files changed, 65 insertions(+)
create mode 100644 B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Overlays/PayAnalyse_Ext.cs
diff --git a/B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj b/B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj
index e1af390..c976b18 100644
--- a/B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj
+++ b/B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj
@@ -170,6 +170,9 @@
ASPXCodeBehind
+
+ ASPXCodeBehind
+
ASPXCodeBehind
diff --git a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Overlays/PayAnalyse_Ext.cs b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Overlays/PayAnalyse_Ext.cs
new file mode 100644
index 0000000..e77e7c3
--- /dev/null
+++ b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Overlays/PayAnalyse_Ext.cs
@@ -0,0 +1,61 @@
+using BWP.B3ButcherManage.BO;
+using BWP.B3ButcherManage.NamedValueTemplate;
+using BWP.Web.Layout;
+using BWP.Web.Pages.B3ButcherManage.Reports;
+using BWP.Web.Utils;
+using Forks.EnterpriseServices.DomainObjects2;
+using Forks.EnterpriseServices.DomainObjects2.DQuery;
+using Forks.EnterpriseServices.SqlDoms;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using TSingSoft.WebControls2;
+
+namespace BWP.Web.Pages.B3QingDaoWanFu.Overlays
+{
+ class PayAnalyse_Ext : PayAnalyse
+ {
+ protected override void AddCustomerColumn(Utils.ReportDisplayOptionHelper helper)
+ {
+ }
+
+ DFNamedValueInput<付款对象> payTag;
+ protected override void AddCustomerCondition(Layout.LayoutManager layout)
+ {
+ base.AddCustomerCondition(layout);
+ payTag = layout.Add("PayTarget", QueryCreator.DFNameValueInput<付款对象>(mDFInfo.Fields["PayTarget"]));
+ payTag.EnableTopItem = false;
+ payTag.Fill("0", "供应商");
+ var c = layout.Config as AutoLayoutConfig;
+ c.Add("PayTarget");
+ }
+
+ protected override Forks.EnterpriseServices.DomainObjects2.DQuery.DQueryDom GetQueryDom()
+ {
+ var query = base.GetQueryDom();
+ var tag = DQSelectColumn.Create(DQExpression.Field("Supplier_Name"), "供应商");
+ if (payTag.Value == 付款对象.养殖户)
+ {
+ var detail = new JoinAlias(typeof(Pay_FarmerDetail));
+ query.From.AddJoin(JoinType.Left, new DQDmoSource(detail), DQCondition.EQ(query.From.RootSource.Alias, "ID", detail, "Pay_ID"));
+ tag = DQSelectColumn.Create(DQExpression.Field(detail, "Farmer_Name"), "养殖户");
+ var last = query.Columns.Last();
+ if (last.Name == "付款金额")
+ {
+ query.Columns.Remove(last);
+ query.Columns.Add(DQSelectColumn.Create(DQExpression.Sum(DQExpression.Field(detail, "Money")), "付款金额"));
+ }
+ }
+ query.Columns.Insert(0, tag);
+ query.GroupBy.Expressions.Add(tag.Expression);
+ query.Where.Conditions.Add(DQCondition.EQ("PayTarget", payTag.Value));
+ if (query.Columns.Last().Name == "付款金额")
+ {
+ SumColumnIndexs.Clear();
+ SumColumnIndexs.Add(query.Columns.Count - 1);
+ }
+ return query;
+ }
+ }
+}
diff --git a/B3QingDaoWanFu.Web/PluginClass.cs b/B3QingDaoWanFu.Web/PluginClass.cs
index bae75dd..84eac5d 100644
--- a/B3QingDaoWanFu.Web/PluginClass.cs
+++ b/B3QingDaoWanFu.Web/PluginClass.cs
@@ -24,6 +24,7 @@ namespace BWP.B3QingDaoWanFu
WpfPageFactory.RegisterPageOverlay(typeof(SaleOutStoreEdit).FullName, typeof(SaleOutStoreEdit_Ext).FullName);
WpfPageFactory.RegisterPageOverlay(typeof(StatPayList).FullName, typeof(StatPayList_Ext).FullName);
WpfPageFactory.RegisterPageOverlay(typeof(BWP.Web.Pages.B3ButcherManage.Bills.Pay_.PayEdit).FullName, typeof(PayEdit_Ext).FullName);
+ WpfPageFactory.RegisterPageOverlay(typeof(BWP.Web.Pages.B3ButcherManage.Reports.PayAnalyse).FullName, typeof(PayAnalyse_Ext).FullName);
GlobalFlags.On(B3ButcherManageConsts.GlobalFlags.StatPayAddRewardWithButcherUseWeight);
GlobalFlags.On(B3SaleConsts.Flags.MarketingActivityEnableAdjustPrice);
GlobalFlags.On(B3SaleConsts.Flags.SendOutStoreNoAvailableStorage);