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(StatPayToU8BL))]
|
|
public interface IStatPayToU8BL : IExportU8BL
|
|
{
|
|
void Export(List<long> dmoIDs, long extSystemID, DateTime? date);
|
|
}
|
|
|
|
[LogicName("屠宰场结算单导U8采购入库单")]
|
|
[BindToFeature("B3ButcherManageExport.0005")]
|
|
[ExportID(B3FrameworksConsts.DmoTypeIDBases.B3ButcherManageExport, B3ButcherManageExportConsts.ExportIDOffsets.StatPayToU8)]
|
|
public class StatPayToU8BL : ExportU8BL<StatPay>, IStatPayToU8BL
|
|
{
|
|
protected override Ufinterface CreateUfinterface(IList<StatPay> 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);
|
|
}
|
|
}
|
|
}
|