From 57a4adcd9e5aa019b43a21568f5bab7b0569a167 Mon Sep 17 00:00:00 2001 From: fei550 <1420031550@qq.com> Date: Tue, 12 Nov 2024 17:56:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=90=E6=96=99=E5=85=A5=E5=BA=93=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E5=A2=9E=E5=8A=A0=E5=BA=8F=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vs/SGGL_SeDin_New/v17/.wsuo | Bin 64000 -> 66048 bytes DataBase/版本日志/SGGLDB_V2024-11-12.sql | 3 ++ SGGL/BLL/CLGL/TwConst.cs | 4 +-- SGGL/BLL/CLGL/TwInOutplandetailService.cs | 8 ++++- SGGL/BLL/CLGL/TwInOutplanmasterService.cs | 2 ++ SGGL/BLL/CLGL/TwInputdetailService.cs | 19 +++++++++++ SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx | 13 ++++++-- SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.cs | 11 +++++-- .../CLGL/InPlanMaster.aspx.designer.cs | 9 ++++++ SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx | 4 +-- SGGL/FineUIPro.Web/CLGL/InputMaster.aspx | 2 +- SGGL/FineUIPro.Web/CLGL/InputMaster.aspx.cs | 30 ++++++++++++------ SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx | 2 +- SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx | 2 +- SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx | 2 +- .../File/Fastreport/材料入库计划单.frx | 8 ++--- SGGL/Model/Model.cs | 24 ++++++++++++++ 17 files changed, 115 insertions(+), 28 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_V2024-11-12.sql diff --git a/.vs/SGGL_SeDin_New/v17/.wsuo b/.vs/SGGL_SeDin_New/v17/.wsuo index a6886c552170002e0ece760cd7229e6f0c330709..ab83a5a77d72d789b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Gz6fFqA;Ld`<0 zMAe}#p-+orA!;@>XttSiaYhm3A+h4R3_V+P19dKMz!_m&ILdLggR!NN z_FRd(sK4^Q_m?ROsVPz@i4nuU8n2Sll)x) zdC3CItFh|};GY|4XGJ}Tg6XXNkjOG*9#}mVE1i}87C5e-OyemrrDHIXW6SoUfi49F zma7|i%3i6I0IU)EUCYc3{X$UdL=*wYp%HN5f<eMRS4gT+Z_Wq5-OHUtT7z&7?*!Yn?29JVWFchkjI{x`x$VfW| z@h%a>&Ny5RZ-vhAM_NA=k1=@LWrMNqDVRGh!sQ-gMtCMkLAcdZD^=OyQ&0F05R30b zFto2d5NtegG!zImv~~ym{)633=SCy@Mn7<)W6cm5$d~iKe$LcfrxwVXg>UQ!Qz91( diff --git a/DataBase/版本日志/SGGLDB_V2024-11-12.sql b/DataBase/版本日志/SGGLDB_V2024-11-12.sql new file mode 100644 index 00000000..6e22e7d1 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2024-11-12.sql @@ -0,0 +1,3 @@ +alter table dbo.Tw_InOutPlanDetail + add SortIndex int +go \ No newline at end of file diff --git a/SGGL/BLL/CLGL/TwConst.cs b/SGGL/BLL/CLGL/TwConst.cs index 11f0e9a2..f597baa5 100644 --- a/SGGL/BLL/CLGL/TwConst.cs +++ b/SGGL/BLL/CLGL/TwConst.cs @@ -45,8 +45,8 @@ namespace BLL }; public static Dictionary PlanPrintMap = new Dictionary { - { "采购通知单" ,(int)TypeInt.采购入库}, - { "退料通知单" ,(int)TypeInt.退料入库}, + { "采购入库申请单" ,(int)TypeInt.采购入库}, + { "退料入库申请单" ,(int)TypeInt.退料入库}, { "其他入库通知单" ,(int)TypeInt.其他入库}, { "材料领用申请单" ,(int)TypeInt.领料出库}, { "补料申请单" ,(int)TypeInt.补料出库}, diff --git a/SGGL/BLL/CLGL/TwInOutplandetailService.cs b/SGGL/BLL/CLGL/TwInOutplandetailService.cs index 45998070..209b4374 100644 --- a/SGGL/BLL/CLGL/TwInOutplandetailService.cs +++ b/SGGL/BLL/CLGL/TwInOutplandetailService.cs @@ -37,6 +37,7 @@ namespace BLL (string.IsNullOrEmpty(table.InOutPlanMasterId) || x.InOutPlanMasterId.Contains(table.InOutPlanMasterId)) && (string.IsNullOrEmpty(table.PipelineComponentId) || x.PipelineComponentId.Contains(table.PipelineComponentId)) && (string.IsNullOrEmpty(table.MaterialCode) || x.MaterialCode.Contains(table.MaterialCode)) + orderby x.SortIndex select new Model.Tw_InOutDetailOutput { Id = x.Id, @@ -49,7 +50,7 @@ namespace BLL MaterialName = mat.MaterialName, MaterialDef= mat.MaterialDef, StockNum = stock.StockNum ?? 0, - } + } ; return q; @@ -94,6 +95,7 @@ namespace BLL MaterialCode = newtable.MaterialCode, PlanNum = newtable.PlanNum, ActNum = newtable.ActNum, + SortIndex = newtable.SortIndex }; Funs.DB.Tw_InOutPlanDetail.InsertOnSubmit(table); Funs.DB.SubmitChanges(); @@ -106,11 +108,14 @@ namespace BLL /// public static void AddList(IEnumerable list, string inoutPlanMasterId) { + int sortIndex = 1; foreach (var item in list) { item.Id= SQLHelper.GetNewID(); + item.SortIndex= sortIndex; item.InOutPlanMasterId = inoutPlanMasterId; Add(item); + sortIndex++; } } public static void Update(Model.Tw_InOutPlanDetail newtable) @@ -125,6 +130,7 @@ namespace BLL table.MaterialCode = newtable.MaterialCode; table.PlanNum = newtable.PlanNum; table.ActNum = newtable.ActNum; + table.SortIndex= newtable.SortIndex; Funs.DB.SubmitChanges(); } diff --git a/SGGL/BLL/CLGL/TwInOutplanmasterService.cs b/SGGL/BLL/CLGL/TwInOutplanmasterService.cs index c0dff8e3..6a19976b 100644 --- a/SGGL/BLL/CLGL/TwInOutplanmasterService.cs +++ b/SGGL/BLL/CLGL/TwInOutplanmasterService.cs @@ -43,6 +43,7 @@ namespace BLL from warehouseperson in warehousepersons.DefaultIfEmpty() join unit in Funs.DB.Base_Unit on x.ReqUnitId equals unit.UnitId into units from unit in units.DefaultIfEmpty() + orderby x.CreateDate descending where (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && (string.IsNullOrEmpty(table.ProjectId) || x.ProjectId.Contains(table.ProjectId)) && @@ -157,6 +158,7 @@ namespace BLL var result = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize).ToList(); // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); return from x in result + select new Model.Tw_InOutMasterOutput { Id = x.Id, diff --git a/SGGL/BLL/CLGL/TwInputdetailService.cs b/SGGL/BLL/CLGL/TwInputdetailService.cs index 2b8ec442..eef2c6e9 100644 --- a/SGGL/BLL/CLGL/TwInputdetailService.cs +++ b/SGGL/BLL/CLGL/TwInputdetailService.cs @@ -121,5 +121,24 @@ namespace BLL } + public static IEnumerable GePrintListByInputMasterIds(List inputMasterIds) + { + var q = from x in Funs.DB.Tw_InputDetail + join mat in Funs.DB.HJGL_MaterialCodeLib on x.MaterialCode equals mat.MaterialCode into mm + from mat in mm.DefaultIfEmpty() + join y in Funs.DB.Tw_InputMaster on x.InputMasterId equals y.Id + where inputMasterIds.Contains(x.InputMasterId) + orderby y.CusBillCode , x.MaterialCode + select new + { + 入库单编号 = y.CusBillCode, + 材料编码 = x.MaterialCode, + 材料名称 = mat.MaterialName, + 材料描述 = mat.MaterialDef, + 计划数量 = x.PlanNum, + 实际数量 = x.ActNum, + }; + return q; + } } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx b/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx index 40b7dcee..aaa8e40c 100644 --- a/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx +++ b/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx @@ -143,7 +143,14 @@ runat="server" BoxFlex="1" DataKeyNames="Id" AllowCellEditing="true" ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="MaterialCode" SortDirection="DESC" EnableColumnLines="true" - AllowPaging="true" IsDatabasePaging="true" PageSize="10000" > + AllowPaging="true" IsDatabasePaging="true" PageSize="10000" EnableTextSelection="True" > + + + + + + + @@ -151,8 +158,8 @@ - + diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.cs b/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.cs index 92ea05c1..74e95519 100644 --- a/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.cs +++ b/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.cs @@ -80,6 +80,7 @@ namespace FineUIPro.Web.CLGL { Model.Tw_InOutDetailOutput table = new Model.Tw_InOutDetailOutput(); table.InOutPlanMasterId = inOutPlanMasterId; + table.MaterialCode = txtMaterialCode.Text; var tb = BLL.TwInOutplandetailService.GetListData(table, Grid2); Grid2.DataSource = tb; Grid2.DataBind(); @@ -329,7 +330,6 @@ namespace FineUIPro.Web.CLGL this.btnMenuEdit.Hidden = false; this.btnGenInMaster.Hidden = false; this.btnRevokeGenInMaster.Hidden = false; - this.btnPassMaster.Hidden = false; } if (buttonList.Contains(BLL.Const.BtnDelete)) { @@ -438,8 +438,8 @@ namespace FineUIPro.Web.CLGL AuditDate = string.Format("{0:yyyy-MM-dd}", result.AuditDate), AuditManName2 = !string.IsNullOrEmpty(result.AuditMan2) ? BLL.Person_PersonsService.getSignatureUrl(result.AuditMan2) : "", AuditDate2 = string.Format("{0:yyyy-MM-dd}", result.AuditDate2), - WarehouseManName = !string.IsNullOrEmpty(result.WarehouseMan) ? BLL.Person_PersonsService.getSignatureUrl(result.WarehouseMan) : "", - WarehouseManAuditDate = string.Format("{0:yyyy-MM-dd}", result.WarehouseDate), + WarehouseManName = !string.IsNullOrEmpty(result.CreateManName) ? BLL.Person_PersonsService.getSignatureUrl(result.CreateManName) : "", + WarehouseManAuditDate = string.Format("{0:yyyy-MM-dd}", result.CreateDate), }; tw_PrintMasters.Add(printMaster); // orderApproveIn.ProjectManager = !string.IsNullOrEmpty(approveManModels.InputApproveMan.ProjectManager) ? BLL.Person_PersonsService.getSignatureUrl(approveManModels.InputApproveMan.ProjectManager) : ""; @@ -479,6 +479,7 @@ namespace FineUIPro.Web.CLGL var tw_PrintDetail = ( from x in Funs.DB.Tw_InOutPlanDetail join y in Funs.DB.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode where x.InOutPlanMasterId==Id + orderby x.SortIndex select new Model.Tw_PrintDetail { SortIndex =0, @@ -518,5 +519,9 @@ namespace FineUIPro.Web.CLGL } } + protected void txtMaterialCode_OnTextChanged(object sender, EventArgs e) + { + BindDetailGrid(Grid1.SelectedRowID); + } } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.designer.cs b/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.designer.cs index 0148b89c..401d9af5 100644 --- a/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.designer.cs @@ -221,6 +221,15 @@ namespace FineUIPro.Web.CLGL /// protected global::FineUIPro.Grid Grid2; + /// + /// txtMaterialCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtMaterialCode; + /// /// Label1 控件。 /// diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx b/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx index 9e9723ed..aa49ef31 100644 --- a/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx +++ b/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx @@ -17,7 +17,7 @@
- @@ -54,7 +54,7 @@ - diff --git a/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx b/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx index d4383db6..f6ec52fc 100644 --- a/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx +++ b/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx @@ -38,7 +38,7 @@ diff --git a/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx.cs b/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx.cs index ae32704b..9902df49 100644 --- a/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx.cs +++ b/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx.cs @@ -1,4 +1,5 @@ using BLL; +using MiniExcelLibs; using Model; using System; using System.Collections.Generic; @@ -243,15 +244,26 @@ namespace FineUIPro.Web.CLGL /// protected void btnOut_Click(object sender, EventArgs e) { - Response.ClearContent(); - string filename = Funs.GetNewFileName(); - Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("出入库计划主表" + filename, System.Text.Encoding.UTF8) + ".xls"); - Response.ContentType = "application/excel"; - Response.ContentEncoding = System.Text.Encoding.UTF8; - this.Grid1.PageSize = 500; - this.BindGrid(); - Response.Write(GetGridTableHtml(Grid1)); - Response.End(); + if (Grid1.SelectedRowIDArray.Length>0) + { + var printModel= TwInputdetailService.GePrintListByInputMasterIds(Grid1.SelectedRowIDArray.ToList()); + string path = Funs.RootPath + @"File\Excel\Temp\InputDetail.xlsx"; + path = path.Replace(".xlsx", string.Format("{0:yyyy-MM-dd-HH-mm}", DateTime.Now) + ".xlsx"); + + MiniExcel.SaveAs(path, printModel); + + string fileName = "入库明细表.xlsx"; + FileInfo info = new FileInfo(path); + long fileSize = info.Length; + System.Web.HttpContext.Current.Response.Clear(); + System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; + System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString()); + System.Web.HttpContext.Current.Response.TransmitFile(path, 0, fileSize); + System.Web.HttpContext.Current.Response.Flush(); + System.Web.HttpContext.Current.Response.Close(); + File.Delete(path); + } } /// diff --git a/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx b/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx index 32fb161f..1369d55e 100644 --- a/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx +++ b/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx @@ -35,7 +35,7 @@ runat="server" BoxFlex="1" DataKeyNames="Id" AllowCellEditing="true" ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="Id" SortDirection="DESC" OnSort="Grid1_Sort" EnableColumnLines="true" EnableTextSelection="True" - AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" > + AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" EnableTextSelection="True"> diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx index e655fdb0..a308f150 100644 --- a/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx +++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx @@ -165,7 +165,7 @@ diff --git a/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx b/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx index c2fdb37c..c3d6af57 100644 --- a/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx +++ b/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx @@ -158,7 +158,7 @@ <%-- - + using System; using System.Collections; using System.Collections.Generic; @@ -84,7 +84,7 @@ namespace FastReport } - + @@ -149,12 +149,12 @@ namespace FastReport - + - + diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 563f6c49..041b19b4 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -259100,6 +259100,8 @@ namespace Model private System.Nullable _ActNum; + private System.Nullable _SortIndex; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -259116,6 +259118,8 @@ namespace Model partial void OnPlanNumChanged(); partial void OnActNumChanging(System.Nullable value); partial void OnActNumChanged(); + partial void OnSortIndexChanging(System.Nullable value); + partial void OnSortIndexChanged(); #endregion public Tw_InOutPlanDetail() @@ -259243,6 +259247,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SortIndex", DbType="Int")] + public System.Nullable SortIndex + { + get + { + return this._SortIndex; + } + set + { + if ((this._SortIndex != value)) + { + this.OnSortIndexChanging(value); + this.SendPropertyChanging(); + this._SortIndex = value; + this.SendPropertyChanged("SortIndex"); + this.OnSortIndexChanged(); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged;