Browse Source

需求单No.139586 在万福模块新增一个报表【结算导出】

master
yibo 7 years ago
parent
commit
43ab276e81
7 changed files with 224 additions and 2 deletions
  1. +9
    -0
      B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj
  2. +20
    -0
      B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Overlays/StatPayList_Ext.cs
  3. +138
    -0
      B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/StatPayAnalyse.cs
  4. +53
    -0
      B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/StatPayAnalyse.xml
  5. +1
    -0
      B3QingDaoWanFu.Web/PluginClass.cs
  6. +2
    -2
      B3QingDaoWanFu/TypeIOCs/StatPayBLTypeIoc.cs
  7. +1
    -0
      WebFolder/config/plugins/B3QingDaoWanFu.plugin

+ 9
- 0
B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj View File

@ -164,6 +164,9 @@
<Compile Include="Pages\B3QingDaoWanFu\Overlays\StatPayEdit_Ext.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3QingDaoWanFu\Overlays\StatPayList_Ext.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3QingDaoWanFu\Reports\ButcherPigInfo.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
@ -173,6 +176,9 @@
<Compile Include="Pages\B3QingDaoWanFu\Reports\PayInfoExport.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3QingDaoWanFu\Reports\StatPayAnalyse.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3QingDaoWanFu\Tools\CarLoadingBySendLinePage.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
@ -204,6 +210,9 @@
<ItemGroup>
<EmbeddedResource Include="Pages\B3QingDaoWanFu\Bills\CostRecord_\CostRecordList.xml" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Pages\B3QingDaoWanFu\Reports\StatPayAnalyse.xml" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.


+ 20
- 0
B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Overlays/StatPayList_Ext.cs View File

@ -0,0 +1,20 @@
using BWP.Web.Pages.B3ButcherManage.Bills.StatPay_;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TSingSoft.WebControls2;
namespace BWP.Web.Pages.B3QingDaoWanFu.Overlays
{
class StatPayList_Ext : StatPayList
{
protected override void InitToolBar(TSingSoft.WebControls2.HLayoutPanel toolbar)
{
base.InitToolBar(toolbar);
var button = new TSButton("养殖户分析") { UseSubmitBehavior = false };
button.OnClientClick = "preventEventDefault(event);OpenUrlInTopTab('B3QingDaoWanFu/Reports/StatPayAnalyse.aspx','养殖户分析');";
toolbar.Add(button);
}
}
}

+ 138
- 0
B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/StatPayAnalyse.cs View File

@ -0,0 +1,138 @@
using BWP.B3ButcherManage;
using BWP.B3ButcherManage.BO;
using BWP.B3Frameworks;
using BWP.B3Frameworks.BO.MoneyTemplate;
using BWP.Web.Layout;
using BWP.Web.Utils;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using Forks.EnterpriseServices.SqlDoms;
using Forks.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TSingSoft.WebControls2;
using TSingSoft.WebPluginFramework;
namespace BWP.Web.Pages.B3QingDaoWanFu.Reports
{
class StatPayAnalyse : DFGridReportPage<StatPay>
{
protected override string AccessRoleName
{
get { return "B3QingDaoWanFu.报表.结算单分析"; }
}
protected override string Caption
{
get { return "结算单分析"; }
}
protected override string QueryOptionsTabName
{
get
{
return "显示字段";
}
}
protected override void InitForm(System.Web.UI.HtmlControls.HtmlForm form)
{
base.InitForm(form);
mDFGrid.AllowRowGroup = true;
}
public override Forks.EnterpriseServices.DataForm.PagedDFDataTable GetPagedDFDataTable(TSingSoft.WebControls2.DFGrids.QuerySettings settings)
{
var result = base.GetPagedDFDataTable(settings);
if (ColumnNames.Contains("实付金额"))
result.Data.SumRow["实付金额"] = GetTotalActualMoney();
return result;
}
Money<>? GetTotalActualMoney()
{
var query = base.GetQueryDom();
var n = new DQueryDom(new JoinAlias(typeof(StatPay)));
n.Where.Conditions.Add(DQCondition.And(query.Where.Conditions));
n.Columns.Add(DQSelectColumn.Sum("ActualMoney"));
return n.EExecuteScalar<Money<>?>();
}
public override Forks.EnterpriseServices.DataForm.DFDataTable GetDFDataTable(TSingSoft.WebControls2.DFGrids.QuerySettings settings)
{
var result = base.GetDFDataTable(settings);
if (ColumnNames.Contains("实付金额"))
result.SumRow["实付金额"] = GetTotalActualMoney();
return result;
}
protected override void InitQueryPanel(WebControls.QueryPanel queryPanel)
{
base.InitQueryPanel(queryPanel);
queryPanel.ConditonPanel.EAdd(CreateDatePanel());
}
private HLayoutPanel CreateDatePanel()
{
var panel = new HLayoutPanel();
panel.Add(new SimpleLabel("核算日期"));
panel.Add(QueryCreator.DateRange(mDFInfo.Fields["Date"], mQueryContainer, "MinDate", "MaxDate", DateTime.Today, null));
return panel;
}
protected override void AddQueryControls(VLayoutPanel vPanel)
{
var layout = new LayoutManager("Main", mDFInfo, mQueryContainer);
var config = new AutoLayoutConfig { Cols = 4 };
config.Add("ID");
config.Add("BillState");
config.Add("Supplier_ID");
config.Add("Employee_ID");
config.Add("PurchaseType_ID");
config.Add("Weigh_ID");
config.Add("WeighTime");
layout.Config = config;
vPanel.Add(layout.CreateLayout());
}
ReportDisplayOptionHelper mDisplayHelper = new ReportDisplayOptionHelper();
protected override void AddQueryOptions(VLayoutPanel vPanel)//显示字段
{
mDisplayHelper.AddOptionItem("结算单号", "_bill", "ID", false);
mDisplayHelper.AddOptionItem("结算日期", "_bill", "Date", false);
mDisplayHelper.AddOptionItem("过磅单号", "_bill", "Weigh_ID", false);
mDisplayHelper.AddOptionItem("过磅日期", "_bill", "WeighTime", false);
mDisplayHelper.AddOptionItem("实付金额", "_bill", "ActualMoney", false);
mDisplayHelper.AddOptionItem("养殖户", "_detail", "Farmer_Name", false);
mDisplayHelper.AddOptionItem("身份证号", "_detail", "Farmer_IDCard", false);
mDisplayHelper.AddOptionItem("地址", "_detail", "Farmer_Address", false);
mDisplayHelper.AddOptionItem("电话", "_detail", "Farmer_Tel", false);
mDisplayHelper.AddOptionItem("棚前头数", "_detail", "Number", false, true);
mDisplayHelper.AddOptionItem("棚前重量", "_detail", "ExeWeight", false, true);
mDisplayHelper.AddOptionItem("棚前金额", "_detail", "ExtMoney", false, true);
AddQueryOption("选项", mDisplayHelper.GetAllDisplayNames(), mDisplayHelper.GetDefaultSelelectedDisplayNames());
base.AddQueryOptions(vPanel);
}
protected override DQueryDom GetQueryDom()
{
var query = base.GetQueryDom();
var root = query.From.RootSource.Alias;
var detail = new JoinAlias("_detail", typeof(Weigh_FarmerDetail));
query.From.AddJoin(JoinType.Left, new DQDmoSource(detail), DQCondition.EQ(root, "Weigh_ID", detail, "Weigh_ID"));
mDisplayHelper.AddAlias("_bill", JoinAlias.Create("_bill"));
mDisplayHelper.AddAlias("_detail", JoinAlias.Create("_detail"));
mDisplayHelper.AddSelectColumns(query, (name) => OptionIsSelected("选项", name), SumColumnNames, ColumnNames);
query.Where.Conditions.Add(DQCondition.EQ(root, "Domain_ID", DomainContext.Current.ID));
return query;
}
}
}

+ 53
- 0
B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/StatPayAnalyse.xml View File

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8" ?>
<Select xmlns="urn:XDQuery">
<Columns>
</Columns>
<From>
<DmoClass class="BWP.B3ButcherManage.BO.StatPay, B3ButcherManage" alias="_bill"/>
</From>
<Where>
<And>
<EQ>
<Field name="ID"/>
<QBE paramName="ID"/>
</EQ>
<EQ>
<Field name="Supplier_ID"/>
<QBE paramName="Supplier_ID"/>
</EQ>
<EQ>
<Field name="Employee_ID"/>
<QBE paramName="Employee_ID"/>
</EQ>
<EQ>
<Field name="PurchaseType_ID"/>
<QBE paramName="PurchaseType_ID"/>
</EQ>
<EQ>
<Field name="Weigh_ID"/>
<QBE paramName="Weigh_ID"/>
</EQ>
<GreaterThanOrEqual>
<Field name="Date"/>
<QBE paramName="MinDate" />
</GreaterThanOrEqual>
<LessThanOrEqual>
<Field name="Date"/>
<QBE paramName="MaxDate"/>
</LessThanOrEqual>
<GreaterThanOrEqual>
<Field name="WeighTime"/>
<QBE paramName="MinWeighTime" />
</GreaterThanOrEqual>
<LessThanOrEqual>
<Field name="WeighTime"/>
<QBE paramName="MaxWeighTime"/>
</LessThanOrEqual>
<EQ>
<Field name="BillState"/>
<QBE paramName="BillState"/>
</EQ>
</And>
</Where>
</Select>

+ 1
- 0
B3QingDaoWanFu.Web/PluginClass.cs View File

@ -20,6 +20,7 @@ namespace BWP.B3QingDaoWanFu
WpfPageFactory.RegisterPageOverlay(typeof(StatPayEdit).FullName, typeof(StatPayEdit_Ext).FullName);
WpfPageFactory.RegisterPageOverlay(typeof(StatPayAnalyse).FullName, typeof(StatPayAnalyse_Ext).FullName);
WpfPageFactory.RegisterPageOverlay(typeof(SaleOutStoreEdit).FullName, typeof(SaleOutStoreEdit_Ext).FullName);
WpfPageFactory.RegisterPageOverlay(typeof(StatPayList).FullName, typeof(StatPayList_Ext).FullName);
GlobalFlags.On(B3ButcherManageConsts.GlobalFlags.StatPayAddRewardWithButcherUseWeight);
GlobalFlags.On(B3SaleConsts.Flags.MarketingActivityEnableAdjustPrice);
GlobalFlags.On(B3SaleConsts.Flags.SendOutStoreNoAvailableStorage);


+ 2
- 2
B3QingDaoWanFu/TypeIOCs/StatPayBLTypeIoc.cs View File

@ -58,14 +58,14 @@ namespace BWP.B3QingDaoWanFu.TypeIOCs
}
}
List<Tuple<long, decimal?, decimal?>> GetFarmerDetail(IDmoSession session, long weightID)
List<Tuple<long, int?, decimal?>> GetFarmerDetail(IDmoSession session, long weightID)
{
var query = new DQueryDom(new JoinAlias(typeof(Weigh_FarmerDetail)));
query.Where.Conditions.Add(DQCondition.EQ("Weigh_ID", weightID));
query.Columns.Add(DQSelectColumn.Field("ID"));
query.Columns.Add(DQSelectColumn.Field("Number"));
query.Columns.Add(DQSelectColumn.Field("Money"));
return query.EExecuteList<long, decimal?, decimal?>(session);
return query.EExecuteList<long, int?, decimal?>(session);
}
void UpdateProperty(long id, IDmoSession session, params Tuple<string, object>[] par)


+ 1
- 0
WebFolder/config/plugins/B3QingDaoWanFu.plugin View File

@ -22,6 +22,7 @@
<Function index="0" name="收购综合报表"/>
<Function index="1" name="异常猪分析"/>
<Function index="2" name="付款清单导出"/>
<Function index="3" name="结算单分析"/>
</FunctionGroup>
<FunctionGroup name="配置" roleSchemas="employee">
<Function index="0" name="结账客户设备配置"/>


Loading…
Cancel
Save