Browse Source

需求单No.137223:【畜类屠宰场管理】-【付款单】B3ButcherManage.0015导入用友12.1付款单 单据 。

master
gaowenwei 8 years ago
parent
commit
6b84d107e9
7 changed files with 264 additions and 0 deletions
  1. +6
    -0
      BWP.B3ButcherManageExport.Web/BWP.B3ButcherManageExport.Web.csproj
  2. +121
    -0
      BWP.B3ButcherManageExport.Web/Pages/B3ButcherManageExport/U8/PayToU8_/PayToU8List.cs
  3. +76
    -0
      BWP.B3ButcherManageExport.Web/Pages/B3ButcherManageExport/U8/PayToU8_/PayToU8List.xml
  4. +1
    -0
      BWP.B3ButcherManageExport/B3ButcherManageExportConsts.cs
  5. +58
    -0
      BWP.B3ButcherManageExport/BL/U8/PayToU8BL_/PayToU8BL.cs
  6. +1
    -0
      BWP.B3ButcherManageExport/BWP.B3ButcherManageExport.csproj
  7. +1
    -0
      WebFolder/Config/Plugins/B3ButcherManageExport.Plugin

+ 6
- 0
BWP.B3ButcherManageExport.Web/BWP.B3ButcherManageExport.Web.csproj View File

@ -86,6 +86,9 @@
<Compile Include="Pages\B3ButcherManageExport\NC_\PayToNc_\PayToNcList.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3ButcherManageExport\U8\PayToU8_\PayToU8List.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3ButcherManageExport\U8\StatPayToU8_\StatPayToU8List.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
@ -130,6 +133,9 @@
<ItemGroup>
<EmbeddedResource Include="Pages\B3ButcherManageExport\U8\StatPayToU8_\StatPayToU8List.xml" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Pages\B3ButcherManageExport\U8\PayToU8_\PayToU8List.xml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\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.


+ 121
- 0
BWP.B3ButcherManageExport.Web/Pages/B3ButcherManageExport/U8/PayToU8_/PayToU8List.cs View File

@ -0,0 +1,121 @@
using BWP.B3ButcherManage.BO;
using BWP.B3ButcherManageExport.BL;
using BWP.B3ExportBase;
using BWP.B3ExportBase.Utils;
using BWP.Web.Pages.B3ExportBase;
using Forks.EnterpriseServices.BusinessInterfaces;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TSingSoft.WebControls2;
using BWP.B3Frameworks;
namespace BWP.Web.Pages.B3ButcherManageExport.U8.PayToU8_
{
public class PayToU8List : ExportBaseList<Pay, IPayToU8BL>
{
protected override string Caption
{
get { return "屠宰场付款单导U8付款单"; }
}
protected override void AddDFBrowseGridColumn(DFBrowseGrid grid, string field)
{
base.AddDFBrowseGridColumn(grid, field);
if (field == "ID")
{
AddDFBrowseGridColumn(grid, "AccountingUnit_Name");
}
if (field == "BillState")
{
AddDFBrowseGridColumn(grid, "Date");
AddDFBrowseGridColumn(grid, "Supplier_Name");
AddDFBrowseGridColumn(grid, "Account_Name");
AddDFBrowseGridColumn(grid, "Money");
}
}
protected override void AddQueryControls(VLayoutPanel vPanel)
{
vPanel.Add(CreateDefaultBillQueryControls((panel, config) =>
{
config.Add("Account_ID");
config.Add("Supplier_ID");
config.Add("Employee_ID");
config.Add("Department_ID");
config.Add("AccountingUnit_ID");
config.Add("Date");
}));
}
protected override string DoExport(List<long> idList)
{
if (idList.Count == 0)
{
throw new ApplicationException("请选择单据!");
}
if (_dfcUrl.IsEmpty)
{
throw new ApplicationException("请选择外部系统!");
}
BL.Export(idList, long.Parse(_dfcUrl.Value), _billDate.Value);
return BIFactory.GetLastMessage();
}
private ChoiceBox _dfcUrl;
private DFDateInput _billDate;
protected override void AddExportControl(HLayoutPanel hbox)
{
hbox.Add(new SimpleLabel("外部系统"));
_dfcUrl = hbox.Add(new ChoiceBox());
_dfcUrl.DataKind = B3ExportBaseConsts.DataSources.;
_dfcUrl.EnableInputArgument = true;
_dfcUrl.SmartOrderEnabled = false;
_dfcUrl.EnableTopItem = true;
_dfcUrl.Width = 130;
hbox.Add(new SimpleLabel("单据日期"));
_billDate = hbox.Add(new DFDateInput());
_billDate.Value = DateTime.Today;
base.AddExportControl(hbox);
}
public override string Url
{
get { return "~/B3ButcherManageExport/U8/PayToU8_/PayToU8List.aspx"; }
}
protected override string EditUrl
{
get
{
return "B3ButcherManage/Bills/Pay_/PayEdit.aspx";
}
}
protected override DQueryDom GetQueryDom()
{
var dom = base.GetQueryDom();
dom.EAddCheckedCondition(dom.From.RootSource.Alias);
return dom;
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
if (!IsPostBack)
{
var tuple = ExportConfigUtil.LoadDefaultExtSystems(MethodID);
if (tuple != null)
{
_dfcUrl.Value = tuple.Item1.ToString();
_dfcUrl.DisplayValue = tuple.Item2;
}
}
}
}
}

+ 76
- 0
BWP.B3ButcherManageExport.Web/Pages/B3ButcherManageExport/U8/PayToU8_/PayToU8List.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.B3ButcherManage.BO.Pay, B3ButcherManage"/>
</From>
<Where>
<And>
<EQ>
<Field name="ID"/>
<QBE paramName="ID"/>
</EQ>
<EQ>
<Field name="Supplier_ID"/>
<QBE paramName="Supplier_ID"/>
</EQ>
<EQ>
<Field name="Account_ID"/>
<QBE paramName="Account_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>
<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>

+ 1
- 0
BWP.B3ButcherManageExport/B3ButcherManageExportConsts.cs View File

@ -10,6 +10,7 @@ namespace BWP.B3ButcherManageExport {
public const byte AdvancePayToNc = 3;
public const byte PayToNc = 4;
public const byte StatPayToU8 = 5;
public const byte PayToU8 = 6;
}
public class DmoTypeID {


+ 58
- 0
BWP.B3ButcherManageExport/BL/U8/PayToU8BL_/PayToU8BL.cs View File

@ -0,0 +1,58 @@
using BWP.B3ButcherManage.BO;
using BWP.B3ExportBase;
using BWP.B3ExportBase.BL;
using BWP.B3ExportBase.BO;
using BWP.B3Frameworks;
using Forks.EnterpriseServices;
using Forks.EnterpriseServices.BusinessInterfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TSingSoft.WebPluginFramework;
using TSingSoft.WebPluginFramework.BIPlugins.BLEvents;
namespace BWP.B3ButcherManageExport.BL
{
[BusinessInterface(typeof(PayToU8BL))]
public interface IPayToU8BL : IExportU8BL
{
void Export(List<long> dmoIDs, long extSystemID, DateTime? date);
}
[LogicName("屠宰场付款单导U8付款单")]
[BindToFeature("B3ButcherManageExport.0006")]
[ExportID(B3FrameworksConsts.DmoTypeIDBases.B3ButcherManageExport, B3ButcherManageExportConsts.ExportIDOffsets.PayToU8)]
public class PayToU8BL : ExportU8BL<Pay>, IPayToU8BL
{
protected override Ufinterface CreateUfinterface(IList<Pay> dmos)
{
var scriptHelper = new PythonScriptHelper(string.Empty, Config.Script, this);
var inv = SaleInvoices.CreateSaleInvoice();
scriptHelper.AddLocalVar("dmos", dmos);
scriptHelper.AddLocalVar("invoices", inv);
scriptHelper.Execute();
var i = 0;
foreach (var invoice in inv.Bills)
{
BillIDs.Add(i, invoice.B2BillIDs);
i++;
}
return inv;
}
private DateTime _date;
public DateTime Date
{
get { return _date; }
set { _date = value; }
}
public void Export(List<long> dmoIDs, long extSystemID, DateTime? date)
{
_date = date ?? BLContext.Today;
Export(dmoIDs, extSystemID);
}
}
}

+ 1
- 0
BWP.B3ButcherManageExport/BWP.B3ButcherManageExport.csproj View File

@ -76,6 +76,7 @@
<Compile Include="BL\EAS\StatPayToEasVoucherBL.cs" />
<Compile Include="BL\NC\AdvancePayToNcBL_\AdvancePayToNcBL.cs" />
<Compile Include="BL\NC\PayToNcBL_\PayToNcBL.cs" />
<Compile Include="BL\U8\PayToU8BL_\PayToU8BL.cs" />
<Compile Include="BL\U8\StatPayToU8BL_\StatPayToU8BL.cs" />
<Compile Include="BO\NC\NcUfinterface.cs" />
<Compile Include="BO\NC\NCVourcher.cs" />


+ 1
- 0
WebFolder/Config/Plugins/B3ButcherManageExport.Plugin View File

@ -21,6 +21,7 @@
<Feature id="0003" name="B3预付款单导NC凭证"/>
<Feature id="0004" name="B3付款单导NC凭证"/>
<Feature id="0005" name="B3结算单导U8采购入库单"/>
<Feature id="0006" name="B3付款单导U8付款单"/>
</Features>
</Plugin>

Loading…
Cancel
Save