From 079104061529badd81e45a838ec1d996a085279b Mon Sep 17 00:00:00 2001 From: wushukun <18860363876@163.com> Date: Mon, 9 Jul 2018 09:32:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=87=E7=A6=8F=E9=94=80?= =?UTF-8?q?=E5=94=AE=E5=8D=95=20=E8=AF=A6=E8=A7=81=E9=9C=80=E6=B1=82?= =?UTF-8?q?=E5=8D=95=20140443?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SaleOutStore_/SaleOutStoreSimpleAnayse.cs | 24 ++++- .../SaleOutStoreSimpleAnaysePrint.cs | 93 +++++++++---------- .../SaleOutStorePrintInfo.cs | 8 +- .../SaleOutStoreSimpleAnayse.cs | 5 +- 4 files changed, 71 insertions(+), 59 deletions(-) diff --git a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/SaleOutStore_/SaleOutStoreSimpleAnayse.cs b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/SaleOutStore_/SaleOutStoreSimpleAnayse.cs index 4ae70b7..8799edb 100644 --- a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/SaleOutStore_/SaleOutStoreSimpleAnayse.cs +++ b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/SaleOutStore_/SaleOutStoreSimpleAnayse.cs @@ -114,11 +114,11 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.SaleOutStore_ layout.Add("DeliverGoodsLine_ID", mQueryContainer.AddLink(new ChoiceBoxMultiSelectLink(deliverLineInput = QueryCreator.DFChoiceBoxEnableMultiSelection(_mainInfo.Fields["DeliverGoodsLine_ID"], B3SaleDataSources.送货线路), s => long.Parse(s)), "DeliverGoodsLine_ID")); layout["DeliverGoodsLine_ID"].NotAutoAddToContainer = true; - layout.Add("LoadTime", QueryCreator.TimeRange(_mainInfo.Fields["LoadTime"], mQueryContainer, "MinLoadTime", "MaxLoadTime")); + layout.Add("LoadTime", QueryCreator.TimeRange(_mainInfo.Fields["LoadTime"], mQueryContainer, "MinLoadTime", "MaxLoadTime",DateTime.Today, DateTime.Today.AddDays(1).AddSeconds(-1))); var state = mQueryContainer.Add(billStateInput = QueryCreator.一般单据状态(_mainInfo.Fields["BillState"], true, false, true, true), "BillState"); - ((ChoiceBox)state).Value = 单据状态.未审核.Value.ToString() + "|"; - state.DisplayValue = "未审核;"; + ((ChoiceBox)state).Value = 单据状态.已审核.Value.ToString() + "|"; + state.DisplayValue = "已审核;"; state.EnableInputArgument = true; layout.Add("BillState", state); @@ -156,7 +156,7 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.SaleOutStore_ vPanel.Add(layout.CreateLayout(), new VLayoutOption(HorizontalAlign.Left)); } - private Dictionary fieldInfo = new Dictionary() { {"Customer_Name", "购货客户" }, { "Goods_Name", "存货名称" },{ "Goods_Spec", "存货规格" }, { "Order_Detail_UnitNum", "订单数量" }, { "SecondNumber", "辅数量" }, { "Goods_SecondUnit", "辅单位" } }; + private Dictionary fieldInfo = new Dictionary() { {"Customer_Name", "购货客户" }, { "DeliverGoodsLine_Name", "送货线路名称" }, { "Goods_Name", "存货名称" },{ "Goods_Spec", "存货规格" }, { "Order_Detail_UnitNum", "订单数量" }, { "SecondNumber", "辅数量" }, { "Goods_SecondUnit", "辅单位" } }; protected override void PrepareData() @@ -166,7 +166,8 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.SaleOutStore_ var minLoad = mQueryContainer.GetControl("MinLoadTime"); var maxOrder = mQueryContainer.GetControl("MaxOrderDate"); var minOrder = mQueryContainer.GetControl("MinOrderDate"); - + var customer = mQueryContainer.GetControl("Customer_ID"); + var take = mQueryContainer.GetControl>("TakeGoods_Type"); var info = new SaleOutStorePrintInfo(); if (!maxLoad.IsEmpty) { @@ -187,8 +188,20 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.SaleOutStore_ { info.MinOrderDate = minOrder.Date; } + if(!customer.IsEmpty) + { + info.Customers = customer.Value; + } + if(!take.IsEmpty) + { + info.TakeGoodsTypes = string.Join("|", take.GetValues().Select(x => x.Value)); + } + info.BillStates = string.Join("|", billStateInput.GetValues().Select(x => x.Value)); info.DeliverGoodsLines = deliverLineInput.Value; + info.GoodsPropertyCatalogs = _goodsPropertyCatalog.Value; + info.GoodsPropertyCatalogDisplayValue = _goodsPropertyCatalog.DisplayValue; + info.Save(); printAction.Url = "SaleOutStoreSimpleAnaysePrint.aspx"; previewAction.Url = "SaleOutStoreSimpleAnaysePrint.aspx"; @@ -230,6 +243,7 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.SaleOutStore_ switch (item.Key) { case "Customer_Name": + case "DeliverGoodsLine_Name": dom.Columns.Add(DQSelectColumn.Create(DQExpression.Field(root, item.Key), item.Value)); dom.GroupBy.Expressions.Add(DQExpression.Field(root, item.Key)); break; diff --git a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/SaleOutStore_/SaleOutStoreSimpleAnaysePrint.cs b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/SaleOutStore_/SaleOutStoreSimpleAnaysePrint.cs index b92f9be..7dafd72 100644 --- a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/SaleOutStore_/SaleOutStoreSimpleAnaysePrint.cs +++ b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/SaleOutStore_/SaleOutStoreSimpleAnaysePrint.cs @@ -23,6 +23,8 @@ using BWP.B3Sale.BO; using BWP.B3Frameworks; using BWP.B3Frameworks.Utils; using System; +using BWP.B3UnitedInfos.BO; +using BWP.Web.Utils; namespace BWP.Web.Pages.B3QingDaoWanFu.SaleOutStore_ { @@ -119,6 +121,8 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.SaleOutStore_ int i = 0; var item = new SaleOutStoreSimpleAnayseBo(); item.Customer_Name = (string)reader[i++]; + item.DeliverGoodsLine_Name = (string)reader[i++]; + item.Goods_Name = (string)reader[i++]; item.Goods_Spec = (string)reader[i++]; item.OrderNumber = (Money?)reader[i++]; @@ -135,60 +139,13 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.SaleOutStore_ return list; } - #region - private string GetHtml() - { - var sb = new StringBuilder(); - - sb.Append(""); - sb.Append("存货名称"); - sb.Append(" 计划号"); - sb.Append("计数规格"); - sb.Append("盘数"); - sb.Append("袋数"); - sb.Append("重量"); - sb.Append("包装模式"); - sb.Append(""); - - - var query = GetQueryDom(); - using (var context = new TransactionContext()) - { - using (var reader = context.Session.ExecuteReader(query)) - { - - while (reader.Read()) - { - int i = 0; - sb.Append(""); - sb.Append(string.Format("{0}", reader[i++])); - sb.Append(string.Format("{0}", reader[i++])); - sb.Append(string.Format("{0}", reader[i++])); - sb.Append(string.Format("{0}", reader[i++])); - sb.Append(string.Format("{0}", reader[i++])); - sb.Append(string.Format("{0}", reader[i++])); - sb.Append(string.Format("{0}", reader[i++])); - sb.Append(""); - } - } - - - } - - - - - return sb.ToString(); - } - - #endregion public SaleOutStorePrintInfo info { get; set; } - private string[] fieldInfo = new string[] { "Customer_Name", "Goods_Name", "Goods_Spec", "Order_Detail_UnitNum", "SecondNumber", "Goods_SecondUnit" }; + private string[] fieldInfo = new string[] { "Customer_Name", "DeliverGoodsLine_Name","Goods_Name", "Goods_Spec", "Order_Detail_UnitNum", "SecondNumber", "Goods_SecondUnit" }; private DQueryDom GetQueryDom() { @@ -196,12 +153,25 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.SaleOutStore_ var root = new JoinAlias("__main", typeof(SaleOutStore)); var detail = new JoinAlias("__detail", typeof(SaleOutStore_Detail)); var dom = new DQueryDom(root); + + var goods = new JoinAlias(typeof(SaleGoods)); + var goodsProperty = new JoinAlias(typeof(GoodsProperty)); + var goodsPropertyCatalog = new JoinAlias(typeof(GoodsPropertyCatalog)); dom.From.AddJoin(JoinType.Left, new DQDmoSource(detail), DQCondition.EQ(root, "ID", detail, "SaleOutStore_ID")); + + dom.From.AddJoin(JoinType.Left, new DQDmoSource(goods), DQCondition.EQ(detail, "SaleGoods_ID", goods, "ID")); + dom.From.AddJoin(JoinType.Left, new DQDmoSource(goodsProperty), DQCondition.EQ(goodsProperty, "ID", goods, "GoodsProperty_ID")); + dom.From.AddJoin(JoinType.Left, new DQDmoSource(goodsPropertyCatalog), DQCondition.EQ(goodsProperty, "GoodsPropertyCatalog_ID", goodsPropertyCatalog, "ID")); + dom.Where.Conditions.Add(DQCondition.EQ(root, "Domain_ID", DomainContext.Current.ID)); + OrganizationUtil.AddOrganizationLimit(dom, typeof(SaleOutStore)); + + foreach (var item in fieldInfo) { switch (item) { case "Customer_Name": + case "DeliverGoodsLine_Name": dom.Columns.Add(DQSelectColumn.Field(item, root)); dom.GroupBy.Expressions.Add(DQExpression.Field(root, item)); break; @@ -246,6 +216,33 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.SaleOutStore_ { dom.Where.Conditions.Add(DQCondition.InList(DQExpression.Field(root, "DeliverGoodsLine_ID"), info.DeliverGoodsLines.Split('|').Select(x => DQExpression.Value(x)).ToArray())); } + + if (!string.IsNullOrEmpty(info.GoodsPropertyCatalogs)) + { + var strs = B3SaleWebUtil.GetDeepByTreeName(info.GoodsPropertyCatalogDisplayValue); + var conditions = new List(); + var values = info.GoodsPropertyCatalogs.Split('|'); + for (int index = 0; index < values.Length; index++) + { + var value = values[index]; + if (string.IsNullOrEmpty(value)) + continue; + conditions.Add(DQCondition.EQ(goodsPropertyCatalog, "TreeDeep" + strs[index] + "ID", value)); + } + dom.Where.Conditions.Add(DQCondition.Or(conditions)); + + + } + if (!string.IsNullOrEmpty(info.Customers)) + { + dom.Where.Conditions.Add(DQCondition.InList(DQExpression.Field(root, "Customer_ID"), info.Customers.Split('|').Select(x => DQExpression.Value(x)).ToArray())); + } + if (!string.IsNullOrEmpty(info.TakeGoodsTypes)) + { + dom.Where.Conditions.Add(DQCondition.InList(DQExpression.Field(root, "TakeGoods_Type"), info.TakeGoodsTypes.Split('|').Select(x => DQExpression.Value(x)).ToArray())); + } + + } dom.Where.Conditions.Add(DQCondition.EQ(root, "Domain_ID", DomainContext.Current.ID)); OrganizationUtil.AddOrganizationLimit(dom, typeof(SaleOutStore)); diff --git a/B3QingDaoWanFu/BO/SaleOutStorePrint/SaleOutStorePrintInfo.cs b/B3QingDaoWanFu/BO/SaleOutStorePrint/SaleOutStorePrintInfo.cs index 887ff8f..91a3a26 100644 --- a/B3QingDaoWanFu/BO/SaleOutStorePrint/SaleOutStorePrintInfo.cs +++ b/B3QingDaoWanFu/BO/SaleOutStorePrint/SaleOutStorePrintInfo.cs @@ -35,10 +35,10 @@ namespace BWP.B3QingDaoWanFu.BO public string DeliverGoodsLines { get; set; } public string BillStates { get; set; } - - - - + public string GoodsPropertyCatalogDisplayValue { get; set; } + public string GoodsPropertyCatalogs { get; set; } + public string Customers { get; set; } + public string TakeGoodsTypes { get; set; } private static string CreateCacheKey(Type type) { diff --git a/B3QingDaoWanFu/BO/SaleOutStorePrint/SaleOutStoreSimpleAnayse.cs b/B3QingDaoWanFu/BO/SaleOutStorePrint/SaleOutStoreSimpleAnayse.cs index b112d68..906ef8b 100644 --- a/B3QingDaoWanFu/BO/SaleOutStorePrint/SaleOutStoreSimpleAnayse.cs +++ b/B3QingDaoWanFu/BO/SaleOutStorePrint/SaleOutStoreSimpleAnayse.cs @@ -24,8 +24,9 @@ namespace BWP.B3QingDaoWanFu.BO [LogicName("购货客户")] public string Customer_Name { get; set; } - - + [LogicName("送货线路名称")] + public string DeliverGoodsLine_Name { get; set; } + [LogicName("订单数量")] public Money? OrderNumber { get; set; } [LogicName("辅数量")]