From 8b2308c6dfe4e594d3f8ed4f3e975e986999a36f Mon Sep 17 00:00:00 2001 From: wushukun <18860363876@163.com> Date: Wed, 30 May 2018 14:23:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=A6=E8=A7=81=E9=94=99=E8=AF=AF=E5=8D=95?= =?UTF-8?q?=2045997?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Pages/TypeIOCs/CarLoadingTypeIOC.cs | 34 ++++++++++++++----- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs b/B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs index e0294f4..a89fc53 100644 --- a/B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs +++ b/B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs @@ -137,18 +137,29 @@ namespace BWP.Web.Pages.TypeIOCs { var isfirst = true; var count = grouping.Count(); - foreach (TempClassForCarLoadingWanFu wanFu in grouping.OrderBy(x=>x.SaleOutStore_Detail_ID)) + //先以客户进行分组 再以销售出库单号进行分组 然后排序 + var group = grouping.GroupBy(x => x.SaleOutStore_ID); + foreach(var one in group) { - if (isfirst) + foreach(TempClassForCarLoadingWanFu wanFu in one.OrderBy(x=>x.SaleOutStore_Detail_ID)) { - isfirst = false; - sb.AppendLine(""+ wanFu.Customer_Name+ ""+wanFu.Goods_Name+""+wanFu.Goods_Spec+""+wanFu.OrderSecondNumber+""+wanFu.Goods_MainUnit+""+wanFu.OrderUnitNum+""+wanFu.UnitNum+""+wanFu.Remark+""); - } - else - { - sb.AppendLine("" + wanFu.Goods_Name + "" + wanFu.Goods_Spec + "" + wanFu.OrderSecondNumber + "" + wanFu.Goods_MainUnit + "" + wanFu.OrderUnitNum + "" + wanFu.UnitNum + "" + wanFu.Remark + ""); + if (isfirst) + { + isfirst = false; + sb.AppendLine("" + wanFu.Customer_Name + "" + wanFu.Goods_Name + "" + wanFu.Goods_Spec + "" + wanFu.OrderSecondNumber + "" + wanFu.Goods_MainUnit + "" + wanFu.OrderUnitNum + "" + wanFu.UnitNum + "" + wanFu.Remark + ""); + } + else + { + sb.AppendLine("" + wanFu.Goods_Name + "" + wanFu.Goods_Spec + "" + wanFu.OrderSecondNumber + "" + wanFu.Goods_MainUnit + "" + wanFu.OrderUnitNum + "" + wanFu.UnitNum + "" + wanFu.Remark + ""); + } } } + + + //foreach (TempClassForCarLoadingWanFu wanFu in group.OrderBy(x=>x.SaleOutStore_Detail_ID)) + //{ + + //} } private List GetWanFuCarLoadingList(CarLoading dmo) @@ -175,7 +186,7 @@ namespace BWP.Web.Pages.TypeIOCs query.Columns.Add(DQSelectColumn.Field("UnitNum", outstoreDetail, "UnitNum")); query.Columns.Add(DQSelectColumn.Field("Remark", detail)); query.Columns.Add(DQSelectColumn.Field("ID", outstoreDetail, "SaleOutStore_Detail_ID")); - + query.Columns.Add(DQSelectColumn.Field("SaleOutStore_ID", outstoreDetail, "SaleOutStore_ID")); query.Where.Conditions.Add(DQCondition.EQ(bill,"ID", dmo.ID)); if (StoreIDs != null && StoreIDs.Count > 0) @@ -202,6 +213,8 @@ namespace BWP.Web.Pages.TypeIOCs model.UnitNum = (Money?)reader[6]; model.Remark = (string)reader[7]; model.SaleOutStore_Detail_ID = (long?)reader[8]; + model.SaleOutStore_ID = (long?)reader[9]; + list.Add(model); } } @@ -390,7 +403,10 @@ namespace BWP.Web.Pages.TypeIOCs [DFClass,Serializable] class TempClassForCarLoadingWanFu { + //销售出库单明细ID public long? SaleOutStore_Detail_ID { get; set; } + //销售出库单ID + public long? SaleOutStore_ID { get; set; } [LogicName("客户")] public string Customer_Name { get; set; }