Browse Source

代宰收款

master
luanhui 8 years ago
parent
commit
3d071750e7
14 changed files with 767 additions and 22 deletions
  1. +55
    -9
      B3SubstituteKill.Web/B3SubstituteKill.Web.csproj
  2. +80
    -0
      B3SubstituteKill.Web/Pages/B3SubstituteKill/Bills/SubKillGathering_/SelectStatPayDialog.cs
  3. +76
    -0
      B3SubstituteKill.Web/Pages/B3SubstituteKill/Bills/SubKillGathering_/SelectStatPayDialog.xml
  4. +155
    -0
      B3SubstituteKill.Web/Pages/B3SubstituteKill/Bills/SubKillGathering_/SubKillGatheringEdit.cs
  5. +38
    -0
      B3SubstituteKill.Web/Pages/B3SubstituteKill/Bills/SubKillGathering_/SubKillGatheringList.cs
  6. +72
    -0
      B3SubstituteKill.Web/Pages/B3SubstituteKill/Bills/SubKillGathering_/SubKillGatheringList.xml
  7. +37
    -8
      B3SubstituteKill/B3SubstituteKill.csproj
  8. +81
    -0
      B3SubstituteKill/BL/Bills/SubKillGathering/SubKillGatheringBL.cs
  9. +16
    -2
      B3SubstituteKill/BO/Bills/StatPay/StatPay.cs
  10. +72
    -0
      B3SubstituteKill/BO/Bills/SubKillGathering/SubKillGathering.cs
  11. +61
    -0
      B3SubstituteKill/BO/Bills/SubKillGathering/SubKillGathering_Detail.cs
  12. +7
    -3
      B3SubstituteKill/Rpcs/SupplierRpc.cs
  13. +1
    -0
      B3SubstituteKill/Utils/B3SubstituteKillConsts.cs
  14. +16
    -0
      WebFolder/config/Plugins/B3SubstituteKill.plugin

+ 55
- 9
B3SubstituteKill.Web/B3SubstituteKill.Web.csproj View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@ -36,65 +36,97 @@
<Reference Include="B3Frameworks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a04fa581c0f74d43, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\tsref\Debug\B3Frameworks.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="B3Frameworks.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a04fa581c0f74d43, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\BwpB3Project\tsref\Debug\B3Frameworks.Web.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="B3ProcurementInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3a973053c7ebf11c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\BwpB3Project\tsref\Debug\B3ProcurementInterface.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="B3ProduceUnitedInfos, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3a973053c7ebf11c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\tsref\Debug\B3ProduceUnitedInfos.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="B3System, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a04fa581c0f74d43, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\BwpB3Project\tsref\Debug\B3System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Forks.EnterpriseServices, Version=3.1.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\BwpB3Project\tsref\Debug\Forks.EnterpriseServices.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Forks.JsonRpc.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\BwpB3Project\tsref\Debug\Forks.JsonRpc.Client.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Forks.Utils, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\BwpB3Project\tsref\Debug\Forks.Utils.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="MainSystem.Web, Version=1.3.0.0, Culture=neutral, PublicKeyToken=a04fa581c0f74d43, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\BwpB3Project\tsref\Debug\MainSystem.Web.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System.Core">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System.Web">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System.Xml.Linq">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Microsoft.CSharp">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System.Data">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System.Xml">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="TSingSoft.WebControls2, Version=2.1.0.0, Culture=neutral, PublicKeyToken=a04fa581c0f74d43, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\BwpB3Project\tsref\Debug\TSingSoft.WebControls2.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Wpf, Version=1.3.0.0, Culture=neutral, PublicKeyToken=a04fa581c0f74d43, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\BwpB3Project\tsref\Debug\Wpf.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Wpf.System, Version=1.3.0.0, Culture=neutral, PublicKeyToken=a04fa581c0f74d43, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\BwpB3Project\tsref\Debug\Wpf.System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Wpf.System.Web, Version=1.3.0.0, Culture=neutral, PublicKeyToken=a04fa581c0f74d43, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\BwpB3Project\tsref\Debug\Wpf.System.Web.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\version\B3SubstituteKill_version.cs">
<Link>B3SubstituteKill_version.cs</Link>
</Compile>
<Compile Include="Pages\B3SubstituteKill\BaseInfos\GenerationCostItem_\GenerationCostItemEdit.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
@ -137,6 +169,15 @@
<Compile Include="Pages\B3SubstituteKill\Bills\SubKillButcherOrder_\SubKillButcherOrderPrint.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3SubstituteKill\Bills\SubKillGathering_\SelectStatPayDialog.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3SubstituteKill\Bills\SubKillGathering_\SubKillGatheringEdit.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3SubstituteKill\Bills\SubKillGathering_\SubKillGatheringList.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3SubstituteKill\Bills\SubKillPriceBill_\SubKillPriceBillEdit.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
@ -173,6 +214,7 @@
<ProjectReference Include="..\B3SubstituteKill\B3SubstituteKill.csproj">
<Project>{b5b60a6b-95e6-44e0-b771-69a679a2a7b4}</Project>
<Name>B3SubstituteKill</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
@ -210,6 +252,10 @@
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Pages\B3SubstituteKill\Bills\SubKillGathering_\SelectStatPayDialog.xml" />
<EmbeddedResource Include="Pages\B3SubstituteKill\Bills\SubKillGathering_\SubKillGatheringList.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.


+ 80
- 0
B3SubstituteKill.Web/Pages/B3SubstituteKill/Bills/SubKillGathering_/SelectStatPayDialog.cs View File

@ -0,0 +1,80 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BWP.B3Frameworks;
using BWP.B3Frameworks.BO.MoneyTemplate;
using BWP.B3SubstituteKill.BO;
using BWP.Web.Utils;
using Forks.EnterpriseServices.DataForm;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using Forks.Utils;
using Forks.Utils.Collections;
using TSingSoft.WebControls2;
namespace BWP.Web.Pages.B3SubstituteKill.Bills.SubKillGathering_
{
class SelectStatPayDialog : DmoMultiSelectDialog<StatPay, SubKillGathering_Detail>
{
long _supplierID;
protected override void InitForm(System.Web.UI.HtmlControls.HtmlForm form)
{
_supplierID = Convert.ToInt64(Request.QueryString["Supplier_ID"]);
base.InitForm(form);
}
protected override void CreateQuery(VLayoutPanel vPanel)
{
var tablePanel = new TableLayoutPanel(10, 1);
tablePanel.Add(0, 1, 0, 1, new SimpleLabel("过磅单号"));
tablePanel.Add(1, 2, 0, 1, mQueryContainer.Add(new DFTextBox(mDFInfo.Fields["Weigh_ID"]), "Weigh_ID"));
tablePanel.Add(2, 3, 0, 1, new SimpleLabel("结算单号"));
tablePanel.Add(3, 4, 0, 1, mQueryContainer.Add(new DFTextBox(mDFInfo.Fields["ID"]), "ID"));
tablePanel.Add(4, 5, 0, 1, new SimpleLabel("结算日期"));
tablePanel.Add(5, 6, 0, 1, QueryCreator.DateRange(mDFInfo.Fields["Date"], mQueryContainer, "MinDate", "MaxDate"));
vPanel.Add(tablePanel);
base.CreateQuery(vPanel);
}
protected override DQueryDom GetQueryDom()
{
var query = mQueryContainer.Build();
var bill = query.From.RootSource.Alias;
query.Where.Conditions.Add(DQCondition.GreaterThan(DQExpression.Field("ReceiveMoney"), DQExpression.IfNull(DQExpression.Field("AlreadyReceiveMoney"), DQExpression.ConstValue(0))));
query.Where.Conditions.Add(DQCondition.EQ("Supplier_ID", _supplierID));
query.EAddCheckedCondition(bill);
query.Where.Conditions.Add(DQCondition.EQ("Domain_ID", DomainContext.Current.ID));
return query;
}
protected override void SetResultFromDFDataRow(SubKillGathering_Detail dmo, DFDataRow row)
{
dmo.StatPay_ID = (long?)row["ID"];
dmo.Weigh_ID = (long?)row["Weigh_ID"];
dmo.WeighTime = (DateTime?)row["WeighTime"];
dmo.StatPay_Date = (DateTime?)row["Date"];
dmo.StatPay_ReceiveMoney = (Money<>?)row["ReceiveMoney"];
dmo.AlreadyReceiveMoney = (Money<>?)row["AlreadyReceiveMoney"];
dmo.ThisReceiveMoney = (dmo.StatPay_ReceiveMoney ?? 0) - (dmo.AlreadyReceiveMoney ?? 0);
}
protected override void CreateQueryGridColumns(DFBrowseGrid grid)
{
grid.Columns.EAdd(new DFBrowseGridColumn("ID")).HeaderText = "结算单";
grid.Columns.EAdd(new DFBrowseGridColumn("Supplier_Name"));
grid.Columns.EAdd(new DFBrowseGridColumn("Date")).HeaderText = "结算日期";
grid.Columns.Add(new DFBrowseGridColumn("Weigh_ID"));
grid.Columns.Add(new DFBrowseGridColumn("WeighTime"));
grid.Columns.Add(new DFBrowseGridColumn("ReceiveMoney"));
grid.Columns.Add(new DFBrowseGridColumn("AlreadyReceiveMoney"));
grid.Columns.Add(new DFBrowseGridColumn("Remark"));
}
}
}

+ 76
- 0
B3SubstituteKill.Web/Pages/B3SubstituteKill/Bills/SubKillGathering_/SelectStatPayDialog.xml View File

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8" ?>
<Select xmlns="urn:XDQuery">
<Columns>
<Field name="ID"/>
</Columns>
<From>
<DmoClass class="BWP.B3SubstituteKill.BO.StatPay, B3SubstituteKill"/>
</From>
<Where>
<And>
<EQ>
<Field name="ID"/>
<QBE paramName="ID"/>
</EQ>
<EQ>
<Field name="Supplier_ID"/>
<QBE paramName="Supplier_ID"/>
</EQ>
<EQ>
<Field name="AccountingUnit_ID"/>
<QBE paramName="AccountingUnit_ID"/>
</EQ>
<EQ>
<Field name="Department_ID"/>
<QBE paramName="Department_ID"/>
</EQ>
<EQ>
<Field name="Employee_ID"/>
<QBE paramName="Employee_ID"/>
</EQ>
<EQ>
<Field name="IsLocked"/>
<QBE paramName="IsLocked"/>
</EQ>
<EQ>
<Field name="Weigh_ID"/>
<QBE paramName="Weigh_ID"/>
</EQ>
<Contains>
<Field name="Remark"/>
<QBE paramName="Remark"/>
</Contains>
<Contains>
<Field name="CreateUser_Name"/>
<QBE paramName="CreateUser_Name"/>
</Contains>
<Contains>
<Field name="CheckUser_Name"/>
<QBE paramName="CheckUser_Name"/>
</Contains>
<GreaterThanOrEqual>
<Field name="CreateTime"/>
<QBE paramName="MinCreateTime" />
</GreaterThanOrEqual>
<LessThanOrEqual>
<Field name="CreateTime"/>
<QBE paramName="MaxCreateTime"/>
</LessThanOrEqual>
<GreaterThanOrEqual>
<Field name="Date"/>
<QBE paramName="MinDate" />
</GreaterThanOrEqual>
<LessThanOrEqual>
<Field name="Date"/>
<QBE paramName="MaxDate"/>
</LessThanOrEqual>
<EQ>
<Field name="BillState"/>
<QBE paramName ="BillState"/>
</EQ>
</And>
</Where>
</Select>

+ 155
- 0
B3SubstituteKill.Web/Pages/B3SubstituteKill/Bills/SubKillGathering_/SubKillGatheringEdit.cs View File

@ -0,0 +1,155 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls;
using BWP.B3SubstituteKill.BL;
using BWP.B3SubstituteKill.BO;
using BWP.Web.Layout;
using BWP.Web.Utils;
using BWP.Web.WebControls;
using Forks.EnterpriseServices.DataForm;
using Forks.Utils.Collections;
using TSingSoft.WebControls2;
namespace BWP.Web.Pages.B3SubstituteKill.Bills.SubKillGathering_
{
class SubKillGatheringEdit : DepartmentWorkFlowBillEditPage<SubKillGathering, ISubKillGatheringBL>
{
protected override void BuildBasePropertiesEditor(TitlePanel titlePanel, CustomPageLayout.PageLayoutSection pageLayoutSection)
{
var layoutManager = new LayoutManager("", mDFInfo, mDFContainer);
var config = new AutoLayoutConfig();
config.Add("AccountingUnit_ID");
config.Add("Department_ID");
config.Add("Employee_ID");
config.Add("Date");
config.Add("Supplier_ID");
config.Add("Supplier_Tel");
config.Add("Supplier_Card_ID");
config.Add("Supplier_Address");
config.Add("Remark");
layoutManager.Config = config;
pageLayoutSection.ApplyLayout(layoutManager, config, mPageLayoutManager, mDFInfo);
titlePanel.Controls.Add(layoutManager.CreateLayout());
if (layoutManager.Contains("Supplier_ID"))
{
var supplierInput = layoutManager["Supplier_ID"].InputControl as DFChoiceBox;
if (supplierInput != null)
{
var script = @"
var txtValue =parseInt(__DFContainer.getValue('Supplier_ID'));
simpleRestCall('/MainSystem/B3SubstituteKill/Rpcs/SupplierRpc/GetSupplierAndPriceBillID',[txtValue,__DFContainer.getControl('Date').value],
function(result){
if(typeof(result.Address)!='undefined')
{
__DFContainer.setValue('Supplier_Address',result.Address);
}
else
{
__DFContainer.setValue('Supplier_Address','');
}
if(typeof(result.Tel)!='undefined')
{
__DFContainer.setValue('Supplier_Tel',result.Tel);
}
else
{
__DFContainer.setValue('Supplier_Tel','');
}
if(typeof(result.Supplier_Card_ID)!='undefined')
{
__DFContainer.setValue('Supplier_Card_ID',result.Card_ID);
}
else
{
__DFContainer.setValue('Supplier_Card_ID','');
}
},{ });";
supplierInput.OnClientSelected = script;
}
}
}
protected override void BuildBody(System.Web.UI.Control parent)
{
base.BuildBody(parent);
AddCostDetail(parent.EAdd(new TitlePanel("收款明细", "收款明细")));
}
DFEditGrid _detail;
private void AddCostDetail(TitlePanel titlePanel)
{
var vPanel = titlePanel.EAdd(new VLayoutPanel());
AddToolbarControl(vPanel);
var editor = new DFCollectionEditor<SubKillGathering_Detail>(() => Dmo.Details);
editor.AllowDeletionFunc = () => CanSave;
editor.CanDeleteFunc = detail => CanSave;
editor.IsEditableFunc = (field, detail) => CanSave;
_detail = vPanel.Add(new DFEditGrid(editor) { Width = Unit.Percentage(100) });
_detail.Columns.Add(new DFEditGridColumn<DFValueLabel>("StatPay_ID"));
_detail.Columns.Add(new DFEditGridColumn<DFValueLabel>("StatPay_Date"));
_detail.Columns.Add(new DFEditGridColumn<DFValueLabel>("Weigh_ID"));
_detail.Columns.EAdd(new DFEditGridColumn<DFValueLabel>("WeighTime"));
_detail.Columns.EAdd(new DFEditGridColumn<DFValueLabel>("StatPay_ReceiveMoney"));
_detail.Columns.EAdd(new DFEditGridColumn<DFValueLabel>("AlreadyReceiveMoney"));
_detail.Columns.EAdd(new DFEditGridColumn<DFTextBox>("ThisReceiveMoney"));
_detail.Columns.EAdd(new DFEditGridColumn<DFTextBox>("Remark"));
var section = mPageLayoutManager.AddSection("CostDetail", "收款明细");
titlePanel.SetPageLayoutSetting(mPageLayoutManager, section.Name);
section.ApplyLayout(_detail, mPageLayoutManager, DFInfo.Get(typeof(SubKillGathering_Detail)));
}
private void AddToolbarControl(VLayoutPanel vPanel)
{
if (CanSave)
{
var hPanel = vPanel.Add(new HLayoutPanel(), new VLayoutOption(HorizontalAlign.Left));
var dialogButton = hPanel.Add(new DialogButton
{
Text = "选择结算单",
Url = "SelectStatPayDialog.aspx?"
});
dialogButton.BeforeClientClick = "var sid=__DFContainer.getValue('Supplier_ID'); if (sid == '') { alert('先选择供应商');return false;}";
dialogButton.ClientDynamicParamGetter = "return 'Supplier_ID=' + __DFContainer.getValue('Supplier_ID')";
dialogButton.Click += delegate {
_detail.GetFromUI();
var details = DialogUtil.GetCachedObj<SubKillGathering_Detail>(this);
foreach (SubKillGathering_Detail detail in details)
{
if (Dmo.Details.Any(x => x.StatPay_ID == detail.StatPay_ID))
continue;
Dmo.Details.Add(detail);
}
_detail.DataBind();
};
}
}
public override void AppToUI()
{
base.AppToUI();
_detail.DataBind();
}
public override void GetFromUI()
{
base.GetFromUI();
_detail.GetFromUI();
}
}
}

+ 38
- 0
B3SubstituteKill.Web/Pages/B3SubstituteKill/Bills/SubKillGathering_/SubKillGatheringList.cs View File

@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BWP.B3SubstituteKill.BL;
using BWP.B3SubstituteKill.BO;
using TSingSoft.WebControls2;
namespace BWP.Web.Pages.B3SubstituteKill.Bills.SubKillGathering_
{
class SubKillGatheringList : DomainBillListPage<SubKillGathering, ISubKillGatheringBL>
{
protected override void AddQueryControls(VLayoutPanel vPanel)
{
vPanel.Add(CreateDefaultBillQueryControls((panel, config) =>
{
config.Add("AccountingUnit_ID");
config.Add("Department_ID");
config.Add("Employee_ID");
config.Add("Date");
config.Add("Supplier_ID");
}));
}
protected override void AddDFBrowseGridColumn(DFBrowseGrid grid, string field)
{
base.AddDFBrowseGridColumn(grid, field);
if (field == "BillState")
{
AddDFBrowseGridColumn(grid, "AccountingUnit_Name");
AddDFBrowseGridColumn(grid, "Department_Name");
AddDFBrowseGridColumn(grid, "Employee_Name");
AddDFBrowseGridColumn(grid, "Date");
AddDFBrowseGridColumn(grid, "Supplier_Name");
}
}
}
}

+ 72
- 0
B3SubstituteKill.Web/Pages/B3SubstituteKill/Bills/SubKillGathering_/SubKillGatheringList.xml View File

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8" ?>
<Select xmlns="urn:XDQuery">
<Columns>
<Field name="ID"/>
</Columns>
<From>
<DmoClass class="BWP.B3SubstituteKill.BO.SubKillGathering, B3SubstituteKill"/>
</From>
<Where>
<And>
<EQ>
<Field name="ID"/>
<QBE paramName="ID"/>
</EQ>
<EQ>
<Field name="AccountingUnit_ID"/>
<QBE paramName="AccountingUnit_ID"/>
</EQ>
<EQ>
<Field name="Department_ID"/>
<QBE paramName="Department_ID"/>
</EQ>
<EQ>
<Field name="Employee_ID"/>
<QBE paramName="Employee_ID"/>
</EQ>
<EQ>
<Field name="Supplier_ID"/>
<QBE paramName="Supplier_ID"/>
</EQ>
<EQ>
<Field name="IsLocked"/>
<QBE paramName="IsLocked"/>
</EQ>
<Contains>
<Field name="Remark"/>
<QBE paramName="Remark"/>
</Contains>
<Contains>
<Field name="CreateUser_Name"/>
<QBE paramName="CreateUser_Name"/>
</Contains>
<Contains>
<Field name="CheckUser_Name"/>
<QBE paramName="CheckUser_Name"/>
</Contains>
<GreaterThanOrEqual>
<Field name="CreateTime"/>
<QBE paramName="MinCreateTime" />
</GreaterThanOrEqual>
<LessThanOrEqual>
<Field name="CreateTime"/>
<QBE paramName="MaxCreateTime"/>
</LessThanOrEqual>
<GreaterThanOrEqual>
<Field name="Date"/>
<QBE paramName="MinDate" />
</GreaterThanOrEqual>
<LessThanOrEqual>
<Field name="Date"/>
<QBE paramName="MaxDate"/>
</LessThanOrEqual>
<EQ>
<Field name="BillState"/>
<QBE paramName ="BillState"/>
</EQ>
</And>
</Where>
</Select>

+ 37
- 8
B3SubstituteKill/B3SubstituteKill.csproj View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@ -36,54 +36,81 @@
<Reference Include="B3Frameworks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a04fa581c0f74d43, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\BwpB3Project\tsref\Debug\B3Frameworks.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="B3Frameworks.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a04fa581c0f74d43, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\BwpB3Project\tsref\Debug\B3Frameworks.Web.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="B3ProcurementInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3a973053c7ebf11c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\BwpB3Project\tsref\Debug\B3ProcurementInterface.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="B3ProduceUnitedInfos, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3a973053c7ebf11c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\tsref\Debug\B3ProduceUnitedInfos.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Forks.EnterpriseServices, Version=3.1.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\BwpB3Project\tsref\Debug\Forks.EnterpriseServices.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Forks.Utils, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\BwpB3Project\tsref\Debug\Forks.Utils.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System.Core">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System.Xml.Linq">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Microsoft.CSharp">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System.Data">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System.Xml">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="TSingSoft.WebControls2, Version=2.1.0.0, Culture=neutral, PublicKeyToken=a04fa581c0f74d43, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\BwpB3Project\tsref\Debug\TSingSoft.WebControls2.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Wpf, Version=1.3.0.0, Culture=neutral, PublicKeyToken=a04fa581c0f74d43, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\BwpB3Project\tsref\Debug\Wpf.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Wpf.System, Version=1.3.0.0, Culture=neutral, PublicKeyToken=a04fa581c0f74d43, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\BwpB3Project\tsref\Debug\Wpf.System.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\version\B3SubstituteKill_version.cs">
<Link>B3SubstituteKill_version.cs</Link>
</Compile>
<Compile Include="BL\BaseInfos\GenerationCostItem\GenerationCostItemBL.cs" />
<Compile Include="BL\BaseInfos\SubKillProductLine\SubKillProductLineBL.cs" />
<Compile Include="BL\BaseInfos\SubKillFlag\SubKillFlagBL.cs" />
<Compile Include="BL\BaseInfos\SubKillCallBack\SubKillCallBackBL.cs" />
<Compile Include="BL\Bills\StatPay\StatPayBL.cs" />
<Compile Include="BL\Bills\SubKillButcherOrder\SubKillButcherOrderBL.cs" />
<Compile Include="BL\Bills\SubKillGathering\SubKillGatheringBL.cs" />
<Compile Include="BL\Bills\SubKillPriceBill\SubKillPriceBillBL.cs" />
<Compile Include="BL\Bills\SubKillWeightBill\WeightingInfoBL.cs" />
<Compile Include="BL\Bills\SubKillWeightBill\SubKillWeightBillBL.cs" />
@ -97,6 +124,8 @@
<Compile Include="BO\Bills\StatPay\StatPay_CostDetail.cs" />
<Compile Include="BO\Bills\SubKillButcherOrder\SubKillButcherOrder.cs" />
<Compile Include="BO\Bills\SubKillButcherOrder\SubKillButcherOrder_Detail.cs" />
<Compile Include="BO\Bills\SubKillGathering\SubKillGathering.cs" />
<Compile Include="BO\Bills\SubKillGathering\SubKillGathering_Detail.cs" />
<Compile Include="BO\Bills\SubKillPriceBill\SubKillPriceBill.cs" />
<Compile Include="BO\Bills\SubKillPriceBill\SubKillPriceBill_CallBackDetail.cs" />
<Compile Include="BO\Bills\SubKillPriceBill\SubKillPriceBill_CostItemDetail.cs" />


+ 81
- 0
B3SubstituteKill/BL/Bills/SubKillGathering/SubKillGatheringBL.cs View File

@ -0,0 +1,81 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BWP.B3Frameworks;
using BWP.B3Frameworks.BL;
using BWP.B3Frameworks.BO.MoneyTemplate;
using BWP.B3SubstituteKill.BO;
using Forks.EnterpriseServices;
using Forks.EnterpriseServices.BusinessInterfaces;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using Forks.EnterpriseServices.SqlDoms;
using Forks.Utils;
using TSingSoft.WebPluginFramework;
namespace BWP.B3SubstituteKill.BL
{
[BusinessInterface(typeof(SubKillGatheringBL))]
[LogicName("代宰收款")]
public interface ISubKillGatheringBL : IDepartmentWorkFlowBillBL<SubKillGathering>
{ }
public class SubKillGatheringBL : DepartmentWorkFlowBillBL<SubKillGathering>, ISubKillGatheringBL
{
protected override void doCheck(SubKillGathering dmo)
{
// foreach (var detail in dmo.Details)
// {
// var notPayMoney = (detail.StatPay_ReceiveMoney ?? 0) - (detail.AlreadyReceiveMoney ?? 0);
// if ((detail.ThisReceiveMoney ?? 0) > notPayMoney)
// {
// throw new ApplicationException(string.Format("结算单No.{0} 本次收款金额{1}大于未收款金额{2}", detail.StatPay_ID, detail.ThisReceiveMoney, notPayMoney));
// }
// }
base.doCheck(dmo);
UpdateStatPayMoney(dmo);
}
protected override void doUnCheck(SubKillGathering dmo)
{
base.doUnCheck(dmo);
UpdateStatPayMoney(dmo);
}
private void UpdateStatPayMoney(SubKillGathering dmo)
{
var statPayIds = dmo.Details.Select(x => x.StatPay_ID).ToList();
var detail = new JoinAlias(typeof(SubKillGathering_Detail));
var bill = new JoinAlias(typeof(SubKillGathering));
var dom = new DQueryDom(detail);
dom.From.AddJoin(JoinType.Inner, new DQDmoSource(bill), DQCondition.EQ(bill, "ID", detail, "SubKillGathering_ID"));
dom.EAddCheckedCondition(bill);
dom.Where.Conditions.EFieldInList("StatPay_ID", statPayIds);
dom.Columns.Add(DQSelectColumn.Sum(detail, "ThisReceiveMoney"));
dom.Columns.Add(DQSelectColumn.Field("StatPay_ID", detail));
dom.Columns.Add(DQSelectColumn.Sum(detail, "AlreadyReceiveMoney"));
dom.GroupBy.Expressions.Add(DQExpression.Field(detail, "StatPay_ID"));
var tupleList = dom.EExecuteList<Money<>?, long, Money<>?>(Session);
foreach (var statPayId in statPayIds)
{
// var money = tupleList.Sum(x => x.Item2 == statPayId ? ((x.Item1 ?? 0).Value+(x.Item3 ?? 0).Value) : 0m);
var money = tupleList.Sum(x => x.Item2 == statPayId ? (x.Item1 ?? 0).Value : 0m);
var update = new DQUpdateDom(typeof(StatPay));
update.Columns.Add(new DQUpdateColumn("AlreadyReceiveMoney", money));
update.Columns.Add(new DQUpdateColumn("RowVersion",
DQExpression.Add(DQExpression.Field("RowVersion"), DQExpression.ConstValue(1))));
update.Where.Conditions.Add(DQCondition.EQ("ID", statPayId));
Session.ExecuteNonQuery(update);
}
}
}
}

+ 16
- 2
B3SubstituteKill/BO/Bills/StatPay/StatPay.cs View File

@ -24,8 +24,8 @@ namespace BWP.B3SubstituteKill.BO
public class StatPay : DepartmentWorkFlowBill
{
private DateTime? date = DateTime.Now;
[LogicName("过磅时间")]
[DFExtProperty("WebControlType", DFEditControl.DateTimeInput)]
[LogicName("结算日期")]
[DFExtProperty("WebControlType", DFEditControl.DateInput)]
[DFNotEmpty]
public DateTime? Date
{
@ -77,6 +77,20 @@ namespace BWP.B3SubstituteKill.BO
[DFExtProperty("WebControlType", DFEditControl.StaticText)]
public Money<>? ReceiveMoney { get; set; }
[LogicName("已收金额")]
public Money<>? AlreadyReceiveMoney { get; set; }
[LogicName("过磅单")]
[DFExtProperty("WebControlType", DFEditControl.StaticText)]
public long? Weigh_ID { get; set; }
[LogicName("过磅时间")]
[ReferenceTo(typeof(SubKillWeightBill), "Date")]
[Join("Weigh_ID", "ID")]
public DateTime? WeighTime { get; set; }
private StatPay_CostDetailCollection _mCostDetails = new StatPay_CostDetailCollection();
[OneToMany(typeof(StatPay_CostDetail), "ID")]
[Join("ID", "StatPay_ID")]


+ 72
- 0
B3SubstituteKill/BO/Bills/SubKillGathering/SubKillGathering.cs View File

@ -0,0 +1,72 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BWP.B3Frameworks;
using BWP.B3Frameworks.Attributes;
using BWP.B3Frameworks.BO;
using BWP.B3ProcurementInterface.BO;
using BWP.B3ProcurementInterface.Utils;
using BWP.B3SubstituteKill.Utils;
using Forks.EnterpriseServices;
using Forks.EnterpriseServices.DataForm;
using Forks.EnterpriseServices.DomainObjects2;
using TSingSoft.WebControls2;
namespace BWP.B3SubstituteKill.BO
{
[DFClass, Serializable]
[LogicName("代宰收款")]
[DmoTypeID(B3FrameworksConsts.DmoTypeIDBases.B3SubstituteKill, B3SubstituteKillConsts.DmoTypeIDOffsets.SubKillGathering)]
[EditUrl("~/B3SubstituteKill/Bills/SubKillGathering_/SubKillGatheringEdit.aspx")]
public class SubKillGathering : DepartmentWorkFlowBill
{
private DateTime? date = DateTime.Now;
[LogicName("收款日期")]
[DFExtProperty("WebControlType", DFEditControl.DateInput)]
[DFNotEmpty]
public DateTime? Date
{
get { return date; }
set { date = value; }
}
[DFDataKind(B3ProcurementInterfaceDataSources.供应商用于屠宰场)]
[DFExtProperty(B3FrameworksConsts.DFExtProperties.DisplayField, "Supplier_Name")]
[DFExtProperty(B3FrameworksConsts.DFExtProperties.QueryDataKind, B3ProcurementInterfaceDataSources.供应商用于屠宰场全部)]
[DFExtProperty("WebControlType", DFEditControl.ChoiceBox)]
[DFPrompt("供应商")]
[DFNotEmpty]
public long? Supplier_ID { get; set; }
[ReferenceTo(typeof(Supplier), "Name")]
[Join("Supplier_ID", "ID")]
[DFPrompt("供应商")]
public string Supplier_Name { get; set; }
[ReferenceTo(typeof(Supplier), "Tel")]
[Join("Supplier_ID", "ID")]
[DFPrompt("联系方式")]
public string Supplier_Tel { get; set; }
[ReferenceTo(typeof(Supplier), "Card_ID")]
[Join("Supplier_ID", "ID")]
[DFPrompt("身份证号")]
public string Supplier_Card_ID { get; set; }
[ReferenceTo(typeof(Supplier), "Address")]
[Join("Supplier_ID", "ID")]
[DFPrompt("地址")]
public string Supplier_Address { get; set; }
private SubKillGathering_DetailCollection _mDetails = new SubKillGathering_DetailCollection();
[OneToMany(typeof(SubKillGathering_Detail), "ID")]
[Join("ID", "SubKillGathering_ID")]
public SubKillGathering_DetailCollection Details
{
get { return _mDetails; }
set { _mDetails = value; }
}
}
}

+ 61
- 0
B3SubstituteKill/BO/Bills/SubKillGathering/SubKillGathering_Detail.cs View File

@ -0,0 +1,61 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BWP.B3Frameworks.BO;
using BWP.B3Frameworks.BO.MoneyTemplate;
using Forks.EnterpriseServices;
using Forks.EnterpriseServices.DataForm;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.Utils;
namespace BWP.B3SubstituteKill.BO
{
[DFClass, Serializable, LogicName("代宰收款_明细")]
public class SubKillGathering_Detail:Base
{
public long SubKillGathering_ID { get; set; }
[LogicName("结算单")]
public long? StatPay_ID { get; set; }
[LogicName("结算日期")]
[ReferenceTo(typeof(StatPay), "Date")]
[Join("StatPay_ID", "ID")]
public DateTime? StatPay_Date { get; set; }
[LogicName("过磅时间")]
[ReferenceTo(typeof(StatPay), "WeighTime")]
[Join("StatPay_ID", "ID")]
public DateTime? WeighTime { get; set; }
[LogicName("过磅单")]
[ReferenceTo(typeof(StatPay), "Weigh_ID")]
[Join("StatPay_ID", "ID")]
public long? Weigh_ID { get; set; }
[LogicName("应收金额")]
[ReferenceTo(typeof(StatPay), "ReceiveMoney")]
[Join("StatPay_ID", "ID")]
public Money<>? StatPay_ReceiveMoney { get; set; }
[LogicName("已收金额")]
public Money<>? AlreadyReceiveMoney { get; set; }
[LogicName("本次收款金额")]
public Money<>? ThisReceiveMoney { get; set; }
[LogicName("摘要")]
public string Remark { get; set; }
}
[Serializable]
public class SubKillGathering_DetailCollection : DmoCollection<SubKillGathering_Detail>
{ }
}

+ 7
- 3
B3SubstituteKill/Rpcs/SupplierRpc.cs View File

@ -20,16 +20,20 @@ namespace BWP.B3SubstituteKill.Rpcs
public static class SupplierRpc
{
[Rpc]
public static Supplier GetSupplierAndPriceBillID(long? supplierId, DateTime? date)
public static Supplier GetSupplierAndPriceBillID(long supplierId, string strdate)
{
var supplier = new Supplier();
DateTime? date=null;
if (!string.IsNullOrWhiteSpace(strdate))
{
date = Convert.ToDateTime(strdate);
}
var res = WebBLUtil.GetSingleDmo<Supplier>("ID", supplierId, "Tel", "Card_ID", "Address");
if (res != null)
{
supplier = res;
if (date.HasValue)
supplier.SupplierApply_ID = GetPriceBillID(supplierId.Value, date.Value);
supplier.SupplierApply_ID = GetPriceBillID(supplierId, date.Value);
}
return supplier;
}


+ 1
- 0
B3SubstituteKill/Utils/B3SubstituteKillConsts.cs View File

@ -27,6 +27,7 @@ namespace BWP.B3SubstituteKill.Utils
public const byte WeightingInfo = 3;
public const byte SubKillButcherOrder = 4;
public const byte StatPay = 5;
public const byte SubKillGathering = 6;
}
}
}

+ 16
- 0
WebFolder/config/Plugins/B3SubstituteKill.plugin View File

@ -124,6 +124,21 @@
<Function index="10" name="完毕"/>
<Function index="11" name="撤销完毕"/>
</FunctionGroup>
<FunctionGroup name="代宰收款" roleSchemas="employee">
<Function index="0" name="访问" />
<Function index="1" name="新建" />
<Function index="2" name="编辑" />
<Function index="3" name="删除" />
<Function index="4" name="审核" />
<Function index="5" name="撤销" />
<Function index="6" name="锁定" />
<Function index="7" name="解锁" />
<Function index="8" name="管理" />
<Function index="9" name="作废" />
<Function index="10" name="完毕"/>
<Function index="11" name="撤销完毕"/>
</FunctionGroup>
</Security>
<Menus>
<Menu id="0001" name="/B3代宰模块/基础信息/代宰费用" roles="B3SubstituteKill.代宰费用.访问" url="B3SubstituteKill/BaseInfos/GenerationCostItem_/GenerationCostItemList.aspx"/>
@ -136,6 +151,7 @@
<Menu id="0008" name="/B3代宰模块/业务单据/代宰排宰" roles="B3SubstituteKill.代宰排宰.访问" url="B3SubstituteKill/Bills/SubKillButcherOrder_/SubKillButcherOrderList.aspx"/>
<Menu id="0009" name="/B3代宰模块/报表分析/代宰排宰分析" roles="B3SubstituteKill.代宰排宰.数据分析" url="B3SubstituteKill/Reports/SubKillButcherOrderAnalyse_/SubKillButcherOrderAnalyse.aspx"/>
<Menu id="0010" name="/B3代宰模块/业务单据/代宰结算" roles="B3SubstituteKill.代宰结算.访问" url="B3SubstituteKill/Bills/StatPay_/StatPayList.aspx"/>
<Menu id="0011" name="/B3代宰模块/业务单据/代宰收款" roles="B3SubstituteKill.代宰收款.访问" url="B3SubstituteKill/Bills/SubKillGathering_/SubKillGatheringList.aspx"/>
</Menus>
<Features>


Loading…
Cancel
Save