From ab6587bb3c4b1b0273b9c6e886d18cdfe0caf963 Mon Sep 17 00:00:00 2001 From: robin <3504557@qq,com> Date: Thu, 1 Nov 2018 17:47:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=94=80=E5=94=AE=E5=87=BA?= =?UTF-8?q?=E5=BA=93=E5=8D=95=20=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- B3_QiLianMuGe.Web/B3_QiLianMuGe.Web.csproj | 13 +- B3_QiLianMuGe.Web/Pages/B3_QiLianMuGe/Test.cs | 28 ++++ .../ToK3Cloud/SaleOutStoreToK3CloudList.cs | 140 ++++++++++++++++++ .../ToK3Cloud/SaleOutStoreToK3CloudList.xml | 81 ++++++++++ B3_QiLianMuGe/B3QiLianMuGeConsts.cs | 10 ++ B3_QiLianMuGe/B3_QiLianMuGe.csproj | 10 +- B3_QiLianMuGe/BL/SaleOutStoreToK3CloudBL.cs | 72 +++++++++ .../销售出库单导金蝶云凭证.py | 85 +++++++++++ WebFolder/config/plugins/B3_QiLianMuGe.plugin | 3 +- 9 files changed, 439 insertions(+), 3 deletions(-) create mode 100644 B3_QiLianMuGe.Web/Pages/B3_QiLianMuGe/Test.cs create mode 100644 B3_QiLianMuGe.Web/Pages/B3_QiLianMuGe/ToK3Cloud/SaleOutStoreToK3CloudList.cs create mode 100644 B3_QiLianMuGe.Web/Pages/B3_QiLianMuGe/ToK3Cloud/SaleOutStoreToK3CloudList.xml create mode 100644 B3_QiLianMuGe/B3QiLianMuGeConsts.cs create mode 100644 B3_QiLianMuGe/BL/SaleOutStoreToK3CloudBL.cs create mode 100644 B3_QiLianMuGe/BL/script/销售出库单导金蝶云凭证.py diff --git a/B3_QiLianMuGe.Web/B3_QiLianMuGe.Web.csproj b/B3_QiLianMuGe.Web/B3_QiLianMuGe.Web.csproj index 07e3b30..89b2fc1 100644 --- a/B3_QiLianMuGe.Web/B3_QiLianMuGe.Web.csproj +++ b/B3_QiLianMuGe.Web/B3_QiLianMuGe.Web.csproj @@ -36,6 +36,11 @@ ..\..\..\tsref\Debug\B3ButcherManage.dll False + + + False + ..\..\..\tsref\Debug\B3ExportBase.Web.dll + False D:\BwpB3Project\tsref\Debug\B3Frameworks.dll @@ -128,11 +133,17 @@ Customer_version.cs + + ASPXCodeBehind + + + ASPXCodeBehind + - + diff --git a/B3_QiLianMuGe.Web/Pages/B3_QiLianMuGe/Test.cs b/B3_QiLianMuGe.Web/Pages/B3_QiLianMuGe/Test.cs new file mode 100644 index 0000000..658b525 --- /dev/null +++ b/B3_QiLianMuGe.Web/Pages/B3_QiLianMuGe/Test.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web.UI; +using System.Web.UI.WebControls; +using TSingSoft.WebControls2; + +namespace BWP.Web.Pages.B3_QiLianMuGe { + class Test : AppBasePage { + protected override void InitForm(System.Web.UI.HtmlControls.HtmlForm form) { + form.Controls.Add(new LiteralControl("

测试

")); + + var vPanel = new VLayoutPanel(); + form.Controls.Add(vPanel); + + var text = vPanel.Add(new DFTextBox()); + text.TextMode = TextBoxMode.MultiLine; + text.Width = 300; + text.Height = 150; + var submit = vPanel.Add(new TSButton()); + submit.Text = "测试"; + submit.Click += delegate { + // K3CloudHelper.Login(); + }; + } + } +} diff --git a/B3_QiLianMuGe.Web/Pages/B3_QiLianMuGe/ToK3Cloud/SaleOutStoreToK3CloudList.cs b/B3_QiLianMuGe.Web/Pages/B3_QiLianMuGe/ToK3Cloud/SaleOutStoreToK3CloudList.cs new file mode 100644 index 0000000..323a11e --- /dev/null +++ b/B3_QiLianMuGe.Web/Pages/B3_QiLianMuGe/ToK3Cloud/SaleOutStoreToK3CloudList.cs @@ -0,0 +1,140 @@ +using System; +using System.Collections.Generic; +using System.Web.UI.WebControls; +using B3_QiLianMuGe.BL; +using BWP.B3ExportBase; +using BWP.B3ExportBase.Utils; +using BWP.B3Frameworks; +using BWP.B3Frameworks.BO.NamedValueTemplate; +using BWP.B3Sale.BO; +using BWP.B3Sale.Utils; +using BWP.Web.Pages.B3ExportBase; +using BWP.Web.Utils; +using Forks.EnterpriseServices.BusinessInterfaces; +using Forks.EnterpriseServices.DomainObjects2; +using Forks.EnterpriseServices.DomainObjects2.DQuery; +using Forks.EnterpriseServices.SqlDoms; +using Forks.Utils.Collections; +using TSingSoft.WebControls2; + +namespace BWP.Web.Pages.B3_QiLianMuGe.ToK3Cloud +{ + public class SaleOutStoreToK3CloudList : ExportBaseList { + protected override string Caption { + get { return "销售出库单导金蝶云凭证"; } + } + + public override string Url { + get { return "~/B3_QiLianMuGe/ToK3Cloud/SaleOutStoreToK3CloudList.aspx"; } + } + + protected override string EditUrl { + get { + return "B3Sale/Bills/SaleOutStore_/SaleOutStoreEdit.aspx"; + } + } + + protected override string DoExport(List idList) { + if (idList.Count == 0) { + throw new ApplicationException("请选择单据!"); + } + if (_dfcUrl.IsEmpty) { + throw new ApplicationException("请选择外部系统!"); + } + BL.Export(idList, long.Parse(_dfcUrl.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); + } + + private ChoiceBox _deliverGoodsLineID; + protected override void AddQueryControls(VLayoutPanel vPanel) { + vPanel.Add(CreateDefaultBillQueryControls((panel, config) => { + DFNamedValueInput<单据状态> billStateInput; + panel.Add("BillState", billStateInput = QueryCreator.一般单据状态(mDFInfo.Fields["BillState"])); + billStateInput.Value = 单据状态.已审核; + panel.Add("OrderDate", QueryCreator.DateRange(mDFInfo.Fields["OrderDate"], mQueryContainer, "MinOrderDate", "MaxOrderDate")); + panel.Add("LoadTime", QueryCreator.DateRange(mDFInfo.Fields["LoadTime"], mQueryContainer, "MinLoadTime", "MaxLoadTime")); + panel.Add("ArriveTime", QueryCreator.DateRange(mDFInfo.Fields["ArriveTime"], mQueryContainer, "MinArriveTime", "MaxArriveTime")); + panel.Add("Customer_ID", QueryCreator.DFChoiceBox(mDFInfo.Fields["Customer_ID"], B3SaleDataSources.客户)); + panel.Add("AccountingUnit_ID", QueryCreator.DFChoiceBox(mDFInfo.Fields["AccountingUnit_ID"], B3FrameworksConsts.DataSources.授权会计单位全部)); + panel.Add("Department_ID", QueryCreator.DFChoiceBox(mDFInfo.Fields["Department_ID"], B3FrameworksConsts.DataSources.授权部门全部)); + panel.Add("Employee_ID", QueryCreator.DFChoiceBox(mDFInfo.Fields["Employee_ID"], B3FrameworksConsts.DataSources.授权员工全部)); + panel.Add("Store_ID", QueryCreator.DFChoiceBox(mDFInfo.Fields["Store_ID"], B3FrameworksConsts.DataSources.授权仓库全部)); + panel.Add("DeliverGoodsLine_ID", new SimpleLabel("送货线路排序"), _deliverGoodsLineID = new ChoiceBox() { DataKind = B3SaleDataSources.送货线路, Width = Unit.Empty, EnableTopItem = true, EnableInputArgument = true }); + panel["DeliverGoodsLine_ID"].NotAutoAddToContainer = true; + + config.Add("OrderDate"); + config.Add("LoadTime"); + config.Add("ArriveTime"); + config.Add("Customer_ID"); + config.Add("AccountingUnit_ID"); + config.Add("Department_ID"); + config.Add("Employee_ID"); + config.Add("Store_ID"); + config.Add("DeliverGoodsLine_ID"); + config.Add("BillState"); + })); + + } + + protected override void AddDFBrowseGridColumn(DFBrowseGrid grid, string field) { + base.AddDFBrowseGridColumn(grid, field); + if (field == "BillState") { + AddDFBrowseGridColumn(grid, "Customer_Name"); + AddDFBrowseGridColumn(grid, "AccountingUnit_Name"); + AddDFBrowseGridColumn(grid, "Store_Name"); + AddDFBrowseGridColumn(grid, "Department_Name"); + AddDFBrowseGridColumn(grid, "Employee_Name"); + AddDFBrowseGridColumn(grid, "OrderDate"); + AddDFBrowseGridColumn(grid, "LoadTime"); + AddDFBrowseGridColumn(grid, "ArriveTime"); + AddDFBrowseGridColumn(grid, "AllUnitNum"); + mBrowseGrid.Columns.EAdd(new DFBrowseGridColumn("Money")).SumMode = SumMode.Sum; + AddDFBrowseGridColumn(grid, "DeliverGoodsLine_Name"); + } + } + + protected override DQueryDom GetQueryDom() { + var dom = base.GetQueryDom(); + if (!string.IsNullOrEmpty(_deliverGoodsLineID.Value)) { + dom.OrderBy.Expressions.Clear(); + var deliverGoodsLineDetail = new JoinAlias(typeof(DeliverGoodsLine_Detail)); + dom.From.AddJoin(JoinType.Right, new DQDmoSource(deliverGoodsLineDetail), + DQCondition.And( + DQCondition.EQ(dom.From.RootSource.Alias, "Customer_ID", deliverGoodsLineDetail, "Customer_ID"), + DQCondition.EQ(deliverGoodsLineDetail, "DeliverGoodsLine_ID", _deliverGoodsLineID.Value))); + dom.OrderBy.Expressions.Add(DQOrderByExpression.Create(deliverGoodsLineDetail, "SequenceNumber", false)); + } + 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; + } + } + } + } +} diff --git a/B3_QiLianMuGe.Web/Pages/B3_QiLianMuGe/ToK3Cloud/SaleOutStoreToK3CloudList.xml b/B3_QiLianMuGe.Web/Pages/B3_QiLianMuGe/ToK3Cloud/SaleOutStoreToK3CloudList.xml new file mode 100644 index 0000000..42af826 --- /dev/null +++ b/B3_QiLianMuGe.Web/Pages/B3_QiLianMuGe/ToK3Cloud/SaleOutStoreToK3CloudList.xml @@ -0,0 +1,81 @@ + + \ No newline at end of file diff --git a/B3_QiLianMuGe/B3QiLianMuGeConsts.cs b/B3_QiLianMuGe/B3QiLianMuGeConsts.cs new file mode 100644 index 0000000..13ac0f5 --- /dev/null +++ b/B3_QiLianMuGe/B3QiLianMuGeConsts.cs @@ -0,0 +1,10 @@ +namespace B3_QiLianMuGe +{ + public class B3QiLianMuGeConsts { + + public static class ExportIDOffsets + { + public const byte SaleOutStoreToK3Cloud = 1; + } + } +} \ No newline at end of file diff --git a/B3_QiLianMuGe/B3_QiLianMuGe.csproj b/B3_QiLianMuGe/B3_QiLianMuGe.csproj index 7c4753c..0942462 100644 --- a/B3_QiLianMuGe/B3_QiLianMuGe.csproj +++ b/B3_QiLianMuGe/B3_QiLianMuGe.csproj @@ -36,6 +36,10 @@ ..\..\..\tsref\Debug\B3ButcherManage.dll False
+ + False + ..\..\..\tsref\Debug\B3ExportBase.dll + False D:\BwpB3Project\tsref\Debug\B3Frameworks.dll @@ -125,13 +129,17 @@ Customer_version.cs + + - + + +