| @ -1,9 +0,0 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| namespace BWP.Web.B3ButcherManageExport { | |||
| class Class1 { | |||
| } | |||
| } | |||
| @ -0,0 +1,103 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using BWP.B3ButcherManage.BO; | |||
| using BWP.B3ButcherManageExport.BL; | |||
| using BWP.B3ExportBase; | |||
| using BWP.B3ExportBase.Utils; | |||
| using BWP.B3Frameworks; | |||
| using BWP.Web.Pages.B3ExportBase; | |||
| using Forks.EnterpriseServices.BusinessInterfaces; | |||
| using Forks.EnterpriseServices.DomainObjects2.DQuery; | |||
| using TSingSoft.WebControls2; | |||
| namespace BWP.Web.Pages.B3ButcherManageExport.EAS_ | |||
| { | |||
| public class PayToEasVoucherList : ExportBaseList<Pay, IPayToEasVoucherBL> { | |||
| protected override string Caption { | |||
| get { return "屠宰付款单导EAS凭证"; } | |||
| } | |||
| 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), null); | |||
| 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/EAS_/PayToEasVoucherList.aspx"; } | |||
| } | |||
| protected override string EditUrl { | |||
| get { | |||
| return "B3ButcherManage/Bills/Pay_/PayEdit.aspx"; | |||
| } | |||
| } | |||
| 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 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 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; | |||
| } | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @ -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> | |||
| @ -0,0 +1,20 @@ | |||
| using BWP.B3ProcurementInterface.BO; | |||
| using Forks.EnterpriseServices.DomainObjects2; | |||
| namespace BWP.B3ButcherManageExport { | |||
| public class B3ButcherManageExportConsts { | |||
| public static class ExportIDOffsets { | |||
| public const byte PayToEasVoucher = 1; | |||
| } | |||
| public class DmoTypeID { | |||
| public static short 供应商 { | |||
| get { return DmoTypeIDAttribute.GetID(typeof(Supplier)); } | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,56 @@ | |||
| using System; | |||
| using System.Collections; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using BWP.B3ButcherManage.BO; | |||
| using BWP.B3ExportBase; | |||
| using BWP.B3ExportBase.BL; | |||
| using BWP.B3Frameworks; | |||
| using Forks.EnterpriseServices; | |||
| using Forks.EnterpriseServices.BusinessInterfaces; | |||
| using TSingSoft.WebPluginFramework; | |||
| namespace BWP.B3ButcherManageExport.BL { | |||
| [BusinessInterface(typeof(PayToEasVoucherBL))] | |||
| public interface IPayToEasVoucherBL : IEasVoucherBL<Pay> { | |||
| void Export(List<long> dmoIDs, long extSystemID, DateTime? date); | |||
| } | |||
| [LogicName("屠宰付款单导EAS凭证")] | |||
| [BindToFeature("B3ButcherManageExport.0001")] | |||
| [ExportID(B3FrameworksConsts.DmoTypeIDBases.B3ButcherManageExport, B3ButcherManageExportConsts.ExportIDOffsets.PayToEasVoucher)] | |||
| public class PayToEasVoucherBL : EasVoucherBL<Pay>, IPayToEasVoucherBL { | |||
| 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); | |||
| } | |||
| public IEnumerable GroupBySupplier(IEnumerable<Pay> dmos) { | |||
| return dmos.GroupBy(x => x.Supplier_ID); | |||
| } | |||
| public IEnumerable GroupByMonth(IEnumerable<Pay> dmos) { | |||
| return dmos.GroupBy(x => (x.Date ?? BLContext.Today).Month); | |||
| } | |||
| public IEnumerable GroupByAccount(IEnumerable<Pay> dmos) { | |||
| return dmos.GroupBy(x => x.Account_ID); | |||
| } | |||
| public IEnumerable GroupByAccountingUnit(IEnumerable<Pay> dmos) { | |||
| return dmos.GroupBy(x => x.AccountingUnit_ID); | |||
| } | |||
| public decimal SumMoney(IEnumerable<Pay> dmos) { | |||
| return dmos.Sum(x => (x.Money ?? 0).Value); | |||
| } | |||
| } | |||
| } | |||