From 569656b1e11d48df83625a88e8d00131335e7845 Mon Sep 17 00:00:00 2001 From: fei550 <1420031550@qq.com> Date: Fri, 7 Mar 2025 10:55:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=8D=95=E5=85=A5=E5=BA=93=E5=90=8E=E5=A4=87?= =?UTF-8?q?=E6=B3=A8=E6=B8=85=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vs/SGGL_SeDin_New/v17/.wsuo | Bin 71680 -> 70656 bytes .../v17/DocumentLayout.backup.json | 83 ++++ SGGL/BLL/CLGL/TwInputmasterService.cs | 9 +- .../CLGL/ArrivalStatistics.aspx.cs | 52 +-- SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.cs | 378 +++++++++--------- .../File/Fastreport/组件打印.frx | 8 +- 6 files changed, 317 insertions(+), 213 deletions(-) create mode 100644 .vs/SGGL_SeDin_New/v17/DocumentLayout.backup.json diff --git a/.vs/SGGL_SeDin_New/v17/.wsuo b/.vs/SGGL_SeDin_New/v17/.wsuo index 2db9ef7e90a90c550ab122d54ce7b21fc6f404b5..c9ebe86081af58ad2de09e0ea080d5f5351d8608 100644 GIT binary patch delta 4301 zcmdT{du&_P8NbJI5;wgLZk&hnXyQ0Abz3L+8S138mnAJDuj`Pg6gH*3ac*^WE6V>&6cj6EI_?Y{u4RL_LD0~4IF;38 zmHzTLR+uqP1LfGarD&@l8LeG+V(+euS#E4^M>r9l47wNFKExdeKO%r=LJ-$ttal(< zw2Q`5%)ET&cef<>Lz!|DA1Wr~Lz3yzkOp*Z&^T#=YCG1X4Qf-NH3irw&8*Hz)>;z3 z0zukN%)rmL7rzL(Ws7e`T1tG=ZssKW&`HQPbO@4!>_D2cAT}Y2;H8aLm?*H>$jUT> zV8?bXq5%QV6u9|DY>;ti5aI;^({8=0jV zCC1y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Fqk*=0&;c9WGmg_-`S{k+v99NuS?rx7qFG$GtYIr3?!WqlgtGgJDA8 zxSgD2Iq?>o@9SV7^ru2We;R6X#OSqHZ9bdVZuSw2J>tpcP^8&a{Drs?|A%E@_C5)|NZ~22=TAXWOkbA`hm1Dc4ip6)>+(iYH z{HaE&dHGESAFZm8YcH()IZZ12@h=!C&KM=*8y{L>c0Tme5F1W}qkpkTmdh(~;C`VF zT$AZi&)+U;;L1NPy?RN-x)R~NjZL-yFaG{%_|9hqaOG(MW;Z)QIU|5@aX(~l)-VzF zjd#QKvE&)0mg!+(v?nyBhS@jw!z+*PVrsBHSsVIY_OlRjlI3J&FK zWpQp(C*xpwV|~jtZW9mhh($B*ovc7|e>xinuGf^W;uQ)7q /// 根据计划单撤销入库单 diff --git a/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.cs b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.cs index 9976c2be..6acf52fe 100644 --- a/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.cs +++ b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.cs @@ -12,6 +12,12 @@ namespace FineUIPro.Web.CLGL { public partial class ArrivalStatistics : PageBase { + #region Methods + + protected void btnSearch_Click(object sender, EventArgs e) + { + BindGrid(); + } protected void Page_Load(object sender, EventArgs e) { @@ -20,14 +26,17 @@ namespace FineUIPro.Web.CLGL drpWarehouse.DataTextField = "Text"; drpWarehouse.DataValueField = "Value"; drpWarehouse.DataSource = BLL.DropListService.HJGL_WarehouseCode(); - drpWarehouse.DataBind(); + drpWarehouse.DataBind(); this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); // 绑定表格 - // this.BindGrid(); + // this.BindGrid(); } } + #endregion Methods + #region 绑定数据 + /// /// 绑定数据 /// @@ -61,14 +70,14 @@ namespace FineUIPro.Web.CLGL if (model?.MatchRate < 1 || model?.MatchRate == null) { Grid1.Rows[i].RowCssClass = "red"; - } } } - #endregion + #endregion 绑定数据 #region GV 数据操作 + /// /// 过滤表头 /// @@ -79,6 +88,17 @@ namespace FineUIPro.Web.CLGL // this.BindGrid(); //} + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue); + this.BindGrid(); + } + /// /// 分页 /// @@ -101,20 +121,10 @@ namespace FineUIPro.Web.CLGL this.Grid1.SortField = e.SortField; this.BindGrid(); } - - /// - /// 分页显示条数下拉框 - /// - /// - /// - protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) - { - this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue); - this.BindGrid(); - } - #endregion + #endregion GV 数据操作 #region 关闭弹出窗 + /// /// 关闭弹出窗 /// @@ -124,11 +134,11 @@ namespace FineUIPro.Web.CLGL { BindGrid(); } - #endregion - + #endregion 关闭弹出窗 #region 导出按钮 + /// 导出按钮 /// /// @@ -182,11 +192,7 @@ namespace FineUIPro.Web.CLGL return sb.ToString(); } - #endregion - protected void btnSearch_Click(object sender, EventArgs e) - { - BindGrid(); - } + #endregion 导出按钮 } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.cs b/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.cs index 22f05340..01bbcadb 100644 --- a/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.cs +++ b/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.cs @@ -15,6 +15,7 @@ namespace FineUIPro.Web.CLGL { public partial class InPlanMaster : PageBase { + #region Methods protected void Page_Load(object sender, EventArgs e) { @@ -27,34 +28,27 @@ namespace FineUIPro.Web.CLGL } } - #region 绑定数据 - private void InitDrpList() - { - this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); - drpWarehouse.DataTextField = "Text"; - drpWarehouse.DataValueField = "Value"; - drpWarehouse.DataSource = BLL.DropListService .HJGL_WarehouseCode(); - drpWarehouse.DataBind(); - Funs.FineUIPleaseSelect(this.drpWarehouse); - drpTypeInt.DataTextField = "Key"; - drpTypeInt.DataValueField = "Value"; - drpTypeInt.DataSource = BLL.TwConst.TypeIntMap.Where(x=>x.Key.Contains("入库")); - drpTypeInt.DataBind(); - Funs.FineUIPleaseSelect(this.drpTypeInt); - drpStates.DataTextField = "Key"; - drpStates.DataValueField = "Value"; - drpStates.DataSource = BLL.TwConst.StateMap; - drpStates.DataBind(); - Funs.FineUIPleaseSelect(this.drpStates); + #endregion Methods + #region 绑定数据 + + private void BindDetailGrid(string inOutPlanMasterId) + { + 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(); } + /// /// 绑定数据 /// private void BindGrid() { Model.Tw_InOutMasterOutput table = new Model.Tw_InOutMasterOutput(); - table.ProjectId=this.CurrUser.LoginProjectId; + table.ProjectId = this.CurrUser.LoginProjectId; table.InOutType = (int?)TwConst.InOutType.入库; if (drpTypeInt.SelectedValue != Const._Null) { @@ -69,25 +63,38 @@ namespace FineUIPro.Web.CLGL table.WarehouseCode = drpWarehouse.SelectedValue; } var tb = BLL.TwInOutplanmasterService.GetListData(table, Grid1); - Grid1.RecordCount = TwInOutplanmasterService.Count; + Grid1.RecordCount = TwInOutplanmasterService.Count; Grid1.DataSource = tb; Grid1.DataBind(); - Grid2.DataSource=null; + Grid2.DataSource = null; Grid2.DataBind(); } - private void BindDetailGrid(string inOutPlanMasterId) + + private void InitDrpList() { - 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(); + this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); + drpWarehouse.DataTextField = "Text"; + drpWarehouse.DataValueField = "Value"; + drpWarehouse.DataSource = BLL.DropListService.HJGL_WarehouseCode(); + drpWarehouse.DataBind(); + Funs.FineUIPleaseSelect(this.drpWarehouse); + drpTypeInt.DataTextField = "Key"; + drpTypeInt.DataValueField = "Value"; + drpTypeInt.DataSource = BLL.TwConst.TypeIntMap.Where(x => x.Key.Contains("入库")); + drpTypeInt.DataBind(); + Funs.FineUIPleaseSelect(this.drpTypeInt); + drpStates.DataTextField = "Key"; + drpStates.DataValueField = "Value"; + drpStates.DataSource = BLL.TwConst.StateMap; + drpStates.DataBind(); + Funs.FineUIPleaseSelect(this.drpStates); } - #endregion + + #endregion 绑定数据 #region GV 数据操作 + /// /// 过滤表头 /// @@ -98,6 +105,17 @@ namespace FineUIPro.Web.CLGL // this.BindGrid(); //} + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue); + this.BindGrid(); + } + /// /// 分页 /// @@ -109,6 +127,15 @@ namespace FineUIPro.Web.CLGL this.BindGrid(); } + protected void Grid1_RowClick(object sender, GridRowClickEventArgs e) + { + if (e.RowIndex >= 0) + { + string ID = Grid1.DataKeys[e.RowIndex][0].ToString(); + BindDetailGrid(ID); + } + } + /// /// 排序 /// @@ -120,41 +147,45 @@ namespace FineUIPro.Web.CLGL this.Grid1.SortField = e.SortField; this.BindGrid(); } - protected void Grid1_RowClick(object sender, GridRowClickEventArgs e) + + protected void Grid1_RowCommand(object sender, GridCommandEventArgs e) { - if (e.RowIndex >= 0) + if (e.CommandName == "btnInPlanMasterPrint") { - string ID = Grid1.DataKeys[e.RowIndex][0].ToString(); - BindDetailGrid(ID); + Print(e.RowID); } } - /// - /// 分页显示条数下拉框 - /// - /// - /// - protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) - { - this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue); - this.BindGrid(); - } - #endregion + + #endregion GV 数据操作 #region 数据编辑事件 - protected void btnSearch_Click(object sender, EventArgs e) - { - BindGrid(); - } - /// - /// 新增 + /// 批量删除 /// /// /// - protected void btnImport_Click(object sender, EventArgs e) + protected void btnDelete_Click(object sender, EventArgs e) { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InPlanMasterDataIn.aspx?", "导入 - "))); + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var model = BLL.TwInOutplanmasterService.GetById(rowID); + if (model.State == (int)TwConst.State.已审核 || model.State == (int)TwConst.State.已完成) + { + Alert.ShowInTop("请选择有效的计划!", MessageBoxIcon.Warning); + return; + } + else + { + BLL.TwInOutplanmasterService.DeleteById(rowID); + BindGrid(); + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + } } /// @@ -177,70 +208,6 @@ namespace FineUIPro.Web.CLGL } } - /// - /// Grid行双击事件 - /// - /// - /// - protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) - { - this.btnEdit_Click(null, null); - } - - /// - /// 批量删除 - /// - /// - /// - protected void btnDelete_Click(object sender, EventArgs e) - { - if (Grid1.SelectedRowIndexArray.Length > 0) - { - foreach (int rowIndex in Grid1.SelectedRowIndexArray) - { - string rowID = Grid1.DataKeys[rowIndex][0].ToString(); - var model = BLL.TwInOutplanmasterService.GetById(rowID); - if (model.State == (int)TwConst.State.已审核|| model.State == (int)TwConst.State.已完成) - { - Alert.ShowInTop("请选择有效的计划!", MessageBoxIcon.Warning); - return; - } - else - { - BLL.TwInOutplanmasterService.DeleteById(rowID); - BindGrid(); - ShowNotify("删除数据成功!", MessageBoxIcon.Success); - } - } - - - } - } - protected void btnPassMaster_OnClick(object sender, EventArgs e) - { - if (Grid1.SelectedRowIndexArray.Length == 0) - { - Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); - return; - } - string planId = Grid1.SelectedRowID; - var planMaster = BLL.TwInOutplanmasterService.GetById(planId); - if (planMaster.State != (int)TwConst.State.待审核) - { - Alert.ShowInTop("请选择有效的计划!", MessageBoxIcon.Warning); - return; - } - else - { - planMaster.State = (int)TwConst.State.已审核; - planMaster.AuditMan=this.CurrUser.PersonId; - planMaster.AuditDate = DateTime.Now; - TwInOutplanmasterService.Update(planMaster); - ShowNotify("审核通过!", MessageBoxIcon.Success); - BindGrid(); - } - - } protected void btnGenInMaster_Click(object sender, EventArgs e) { if (Grid1.SelectedRowIndexArray.Length == 0) @@ -258,23 +225,56 @@ namespace FineUIPro.Web.CLGL else { PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InPlanMasterEdit.aspx?Id={0}", Grid1.SelectedRowID, "编辑 - "))); - } - //if ( planMaster.State != (int)TwConst.State.已审核) - //{ - // Alert.ShowInTop("请选择有效的计划!", MessageBoxIcon.Warning); - // return; - //} - //else - //{ - // TwInputmasterService.GenInMasterByPlanId(planId); - // BindGrid(); - // ShowNotify("生成入库单成功!", MessageBoxIcon.Success); - //} + //if ( planMaster.State != (int)TwConst.State.已审核) + //{ + // Alert.ShowInTop("请选择有效的计划!", MessageBoxIcon.Warning); + // return; + //} + //else + //{ + // TwInputmasterService.GenInMasterByPlanId(planId); + // BindGrid(); + // ShowNotify("生成入库单成功!", MessageBoxIcon.Success); + //} + } + /// + /// 新增 + /// + /// + /// + protected void btnImport_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InPlanMasterDataIn.aspx?", "导入 - "))); + } + + protected void btnPassMaster_OnClick(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; } + string planId = Grid1.SelectedRowID; + var planMaster = BLL.TwInOutplanmasterService.GetById(planId); + if (planMaster.State != (int)TwConst.State.待审核) + { + Alert.ShowInTop("请选择有效的计划!", MessageBoxIcon.Warning); + return; + } + else + { + planMaster.State = (int)TwConst.State.已审核; + planMaster.AuditMan = this.CurrUser.PersonId; + planMaster.AuditDate = DateTime.Now; + TwInOutplanmasterService.Update(planMaster); + ShowNotify("审核通过!", MessageBoxIcon.Success); + BindGrid(); + } + } - protected void btnRevokeGenInMaster_Click(object sender, EventArgs e) + protected void btnRevokeGenInMaster_Click(object sender, EventArgs e) { if (Grid1.SelectedRowIndexArray.Length == 0) { @@ -292,13 +292,29 @@ namespace FineUIPro.Web.CLGL { TwInputmasterService.RevokeGenInMasterByPlanId(planId); BindGrid(); - ShowNotify("撤销入库单成功!",MessageBoxIcon.Success); - } - + ShowNotify("撤销入库单成功!", MessageBoxIcon.Success); + } } - #endregion + + protected void btnSearch_Click(object sender, EventArgs e) + { + BindGrid(); + } + + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + this.btnEdit_Click(null, null); + } + + #endregion 数据编辑事件 #region 关闭弹出窗 + /// /// 关闭弹出窗 /// @@ -308,9 +324,11 @@ namespace FineUIPro.Web.CLGL { BindGrid(); } - #endregion + + #endregion 关闭弹出窗 #region 获取权限按钮 + /// /// 获取按钮权限 /// @@ -342,9 +360,11 @@ namespace FineUIPro.Web.CLGL } } } - #endregion + + #endregion 获取权限按钮 #region 导出按钮 + /// 导出按钮 /// /// @@ -399,21 +419,18 @@ namespace FineUIPro.Web.CLGL return sb.ToString(); } - #endregion + #endregion 导出按钮 - protected void Grid1_RowCommand(object sender, GridCommandEventArgs e) + protected void txtMaterialCode_OnTextChanged(object sender, EventArgs e) { - if (e.CommandName == "btnInPlanMasterPrint") - { - Print(e.RowID); - } + BindDetailGrid(Grid1.SelectedRowID); } + private void Print(string Id) { BLL.FastReportService.ResetData(); if (string.IsNullOrEmpty(Id)) { - ShowNotify("请选择要打印的项", MessageBoxIcon.Warning); return; } @@ -422,12 +439,11 @@ namespace FineUIPro.Web.CLGL { Id = Id }; - var result =TwInOutplanmasterService.GetListData(queryModel).FirstOrDefault(); + var result = TwInOutplanmasterService.GetListData(queryModel).FirstOrDefault(); List tw_PrintMasters = new List(); List tw_PrintDetails = new List(); Model.Tw_PrintMaster printMaster = new Model.Tw_PrintMaster { - ReqUnitName = result.ReqUnitName, CusBillCode = result.CusBillCode, CreateDate = result.CreateDate.Value.ToString("yyyy-MM-dd"), @@ -452,47 +468,47 @@ namespace FineUIPro.Web.CLGL { InOutPlanMasterId = Id }; - var ListDetailRelation =TwInoutplandetailRelationService.GetTw_InOutPlanDetail_RelationByModle(queryModel2).ToList(); + var ListDetailRelation = TwInoutplandetailRelationService.GetTw_InOutPlanDetail_RelationByModle(queryModel2).ToList(); int SortIndex = 1; int SortIndex2 = 1; - var tw_PrintDetailRelation=(from x in ListDetailRelation - join y in Funs.DB.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode - join z in Funs.DB.HJGL_Pipeline on x.PipelineId equals z.PipelineId - join m in Funs.DB.WBS_UnitWork on z.UnitWorkId equals m.UnitWorkId - select new Model.Tw_PrintDetail - { - SortIndex=SortIndex++, - PipelineCode=z.PipelineCode, - PipelineComponentCode=x.PrefabricatedComponents, - MaterialCode=y.MaterialCode, - MaterialDef=y.MaterialDef, - MaterialSpec=y.MaterialSpec, - MaterialUnit=y.MaterialUnit, - PlanNum = (x.Number ?? 0).ToString(), - UnitWorkName = m.UnitWorkName, - }).ToList(); - var UnitWorkName= tw_PrintDetailRelation.FirstOrDefault()?.UnitWorkName; - Tw_PrintDetail tw_PrintDetailRelation2 = new Tw_PrintDetail - { - MaterialDef = "材料编码合计" - }; - 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 + var tw_PrintDetailRelation = (from x in ListDetailRelation + join y in Funs.DB.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode + join z in Funs.DB.HJGL_Pipeline on x.PipelineId equals z.PipelineId + join m in Funs.DB.WBS_UnitWork on z.UnitWorkId equals m.UnitWorkId select new Model.Tw_PrintDetail { - SortIndex =0, - PipelineCode = "-", - PipelineComponentCode = "-", + SortIndex = SortIndex++, + PipelineCode = z.PipelineCode, + PipelineComponentCode = x.PrefabricatedComponents, MaterialCode = y.MaterialCode, MaterialDef = y.MaterialDef, MaterialSpec = y.MaterialSpec, MaterialUnit = y.MaterialUnit, - PlanNum = (x.PlanNum ?? 0).ToString(), - ActNum = (x.ActNum ?? 0).ToString(), - UnitWorkName = UnitWorkName, + PlanNum = (x.Number ?? 0).ToString(), + UnitWorkName = m.UnitWorkName, }).ToList(); + var UnitWorkName = tw_PrintDetailRelation.FirstOrDefault()?.UnitWorkName; + Tw_PrintDetail tw_PrintDetailRelation2 = new Tw_PrintDetail + { + MaterialDef = "材料编码合计" + }; + 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, + PipelineCode = "-", + PipelineComponentCode = "-", + MaterialCode = y.MaterialCode, + MaterialDef = y.MaterialDef, + MaterialSpec = y.MaterialSpec, + MaterialUnit = y.MaterialUnit, + PlanNum = (x.PlanNum ?? 0).ToString(), + ActNum = (x.ActNum ?? 0).ToString(), + UnitWorkName = UnitWorkName, + }).ToList(); foreach (var item in tw_PrintDetail) { item.SortIndex = SortIndex2++; @@ -507,7 +523,7 @@ namespace FineUIPro.Web.CLGL } BLL.FastReportService.ResetData(); BLL.FastReportService.AddFastreportTable(Table1); - BLL.FastReportService.AddFastreportTable(Data); + BLL.FastReportService.AddFastreportTable(Data); string initTemplatePath = ""; string rootPath = Server.MapPath("~/"); initTemplatePath = "File\\Fastreport\\材料入库计划单.frx"; @@ -515,13 +531,7 @@ namespace FineUIPro.Web.CLGL if (File.Exists(rootPath + initTemplatePath)) { PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("~/Controls/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); - } } - - protected void txtMaterialCode_OnTextChanged(object sender, EventArgs e) - { - BindDetailGrid(Grid1.SelectedRowID); - } } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/File/Fastreport/组件打印.frx b/SGGL/FineUIPro.Web/File/Fastreport/组件打印.frx index 60734d65..7499a7e4 100644 --- a/SGGL/FineUIPro.Web/File/Fastreport/组件打印.frx +++ b/SGGL/FineUIPro.Web/File/Fastreport/组件打印.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -99,7 +99,7 @@ namespace FastReport } - + @@ -149,7 +149,7 @@ namespace FastReport - + @@ -164,7 +164,7 @@ namespace FastReport - + From 23f7bfbb1d0c8647a7c63d0ed76487d0c30d1921 Mon Sep 17 00:00:00 2001 From: fei550 <1420031550@qq.com> Date: Sun, 9 Mar 2025 22:20:21 +0800 Subject: [PATCH 2/2] 1 --- .../HJGL/WeldingManage/WeldJointService.cs | 99 +++++++++++++-- SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 3 + .../HJGL/InfoQuery/JointQuery.aspx.cs | 120 ++++++++++++++++-- 3 files changed, 199 insertions(+), 23 deletions(-) diff --git a/SGGL/BLL/HJGL/WeldingManage/WeldJointService.cs b/SGGL/BLL/HJGL/WeldingManage/WeldJointService.cs index 1f6b5ed3..160c451a 100644 --- a/SGGL/BLL/HJGL/WeldingManage/WeldJointService.cs +++ b/SGGL/BLL/HJGL/WeldingManage/WeldJointService.cs @@ -455,17 +455,96 @@ namespace BLL } public static List GetViewWeldJointsBymodel(Model.View_HJGL_WeldJoint model) { - var q = (from x in Funs.DB.View_HJGL_WeldJoint - where - (string.IsNullOrEmpty(model.ProjectId) || x.ProjectId.Contains(model.ProjectId)) - && (string.IsNullOrEmpty(model.UnitWorkId) || x.UnitWorkId.Contains(model.UnitWorkId)) - && (string.IsNullOrEmpty(model.PipelineId) || x.PipelineId.Contains(model.PipelineId)) - && (string.IsNullOrEmpty(model.PipelineCode) || x.PipelineCode.Contains(model.PipelineCode)) - && (string.IsNullOrEmpty(model.WeldJointCode) || x.WeldJointCode.Contains(model.WeldJointCode)) - orderby x.WeldJointCode - select x).AsParallel().ToList(); - return q; + var baseQuery = from x in Funs.DB.View_HJGL_WeldJoint select x; + if (!string.IsNullOrEmpty(model.ProjectId)) + baseQuery = baseQuery.Where(x => x.ProjectId == model.ProjectId); + if (!string.IsNullOrEmpty(model.UnitWorkId)) + baseQuery = baseQuery.Where(x => x.UnitWorkId == model.UnitWorkId); + if (!string.IsNullOrEmpty(model.PipelineId)) + baseQuery = baseQuery.Where(x => x.PipelineId == model.PipelineId); + if (!string.IsNullOrEmpty(model.PipelineCode)) + baseQuery = baseQuery.Where(x => x.PipelineCode.Contains(model.PipelineCode)); + if (!string.IsNullOrEmpty(model.WeldJointCode)) + baseQuery = baseQuery.Where(x => x.WeldJointCode.Contains(model.WeldJointCode)); + + return baseQuery.ToList(); } + public static IEnumerable GetIEnumerableViewWeldJointsBymodel(Model.View_HJGL_WeldJoint model) + { + var baseQuery = from x in Funs.DB.View_HJGL_WeldJoint select x; + if (!string.IsNullOrEmpty(model.ProjectId)) + baseQuery = baseQuery.Where(x => x.ProjectId == model.ProjectId); + if (!string.IsNullOrEmpty(model.UnitWorkId)) + baseQuery = baseQuery.Where(x => x.UnitWorkId == model.UnitWorkId); + if (!string.IsNullOrEmpty(model.PipelineId)) + baseQuery = baseQuery.Where(x => x.PipelineId == model.PipelineId); + if (!string.IsNullOrEmpty(model.PipelineCode)) + baseQuery = baseQuery.Where(x => x.PipelineCode.Contains(model.PipelineCode)); + if (!string.IsNullOrEmpty(model.WeldJointCode)) + baseQuery = baseQuery.Where(x => x.WeldJointCode.Contains(model.WeldJointCode)); + + return baseQuery.ToList() ; + } + public static (List Data, int Total)GetDataBymodel(Model.View_HJGL_WeldJoint model, int pageIndex = 0, int pageSize = 20) + { + // 阶段一:构建基础查询 + var baseQuery = Funs.DB.View_HJGL_WeldJoint.AsQueryable(); + + // 阶段二:构建动态查询条件 + if (!string.IsNullOrEmpty(model.ProjectId)) + baseQuery = baseQuery.Where(x => x.ProjectId == model.ProjectId); + if (!string.IsNullOrEmpty(model.UnitWorkId)) + baseQuery = baseQuery.Where(x => x.UnitWorkId == model.UnitWorkId); + if (!string.IsNullOrEmpty(model.PipelineId)) + baseQuery = baseQuery.Where(x => x.PipelineId == model.PipelineId); + if (!string.IsNullOrEmpty(model.PipelineCode)) + baseQuery = baseQuery.Where(x => x.PipelineCode .Contains(model.PipelineCode)); + if (!string.IsNullOrEmpty(model.WeldJointCode)) + baseQuery = baseQuery.Where(x => x.WeldJointCode.Contains( model.WeldJointCode)); + + // 阶段三:排序与分页控制(索引优化关键) + var orderedQuery = baseQuery.OrderBy(x => x.WeldJointCode); + + // 阶段四:分页执行(数据库层面分页) + var pagedData = orderedQuery + .Skip((pageIndex ) * pageSize) + .Take(pageSize) + .ToList(); + + // 获取总记录数(延迟计数优化) + var totalCount = baseQuery.Count(); + + return (pagedData, totalCount); + } + public static List GetViewWeldJointsBymodel(Model.View_HJGL_WeldJoint model, int pageIndex = 0, int pageSize = 20) + { + // 阶段一:构建基础查询 + var baseQuery = Funs.DB.View_HJGL_WeldJoint.AsQueryable(); + + // 阶段二:构建动态查询条件 + if (!string.IsNullOrEmpty(model.ProjectId)) + baseQuery = baseQuery.Where(x => x.ProjectId == model.ProjectId); + if (!string.IsNullOrEmpty(model.UnitWorkId)) + baseQuery = baseQuery.Where(x => x.UnitWorkId == model.UnitWorkId); + if (!string.IsNullOrEmpty(model.PipelineId)) + baseQuery = baseQuery.Where(x => x.PipelineId == model.PipelineId); + if (!string.IsNullOrEmpty(model.PipelineCode)) + baseQuery = baseQuery.Where(x => x.PipelineCode.Contains(model.PipelineCode)); + if (!string.IsNullOrEmpty(model.WeldJointCode)) + baseQuery = baseQuery.Where(x => x.WeldJointCode.Contains(model.WeldJointCode)); + + // 阶段三:排序与分页控制(索引优化关键) + var orderedQuery = baseQuery.OrderBy(x => x.WeldJointCode); + + // 阶段四:分页执行(数据库层面分页) + var pagedData = orderedQuery + .Skip((pageIndex) * pageSize) + .Take(pageSize) + .ToList(); + + return pagedData; + } + /// /// 根据壁厚计算焊口达因 /// diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index fd310b8d..884338d2 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -153,6 +153,9 @@ ..\packages\System.Text.Encoding.CodePages.4.5.0\lib\net461\System.Text.Encoding.CodePages.dll + + ..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll + diff --git a/SGGL/FineUIPro.Web/HJGL/InfoQuery/JointQuery.aspx.cs b/SGGL/FineUIPro.Web/HJGL/InfoQuery/JointQuery.aspx.cs index 6c1e79d4..3cbf319c 100644 --- a/SGGL/FineUIPro.Web/HJGL/InfoQuery/JointQuery.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/InfoQuery/JointQuery.aspx.cs @@ -11,6 +11,7 @@ using System.Drawing; using System.IO; using System.Linq; using System.Text; +using System.Web; using AspNet = System.Web.UI.WebControls; namespace FineUIPro.Web.HJGL.InfoQuery @@ -287,24 +288,33 @@ namespace FineUIPro.Web.HJGL.InfoQuery { Model.View_HJGL_WeldJoint model = new Model.View_HJGL_WeldJoint(); model.ProjectId = this.CurrUser.LoginProjectId; + model.WeldJointCode = this.txtWeldJointCode.Text; + if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2) { model.UnitWorkId = this.tvControlItem.SelectedNodeID; - + model.WeldJointCode = this.txtWeldJointCode.Text; + var list = BLL.WeldJointService.GetDataBymodel(model, Grid1.PageIndex, Grid1.PageSize); + Grid1.RecordCount = list.Total; + Grid1.DataSource = list.Data; + Grid1.DataBind(); } else if (this.tvControlItem.SelectedNode.CommandName == "管线") { model.PipelineId = this.tvControlItem.SelectedNodeID; - + var list = BLL.WeldJointService.GetViewWeldJointsBymodel(model); + View_HJGL_WeldJoint = list; + Grid1.RecordCount = list.Count; + var table = list.Skip(Grid1.PageSize * (Grid1.PageIndex)).Take(Grid1.PageSize).ToList(); + Grid1.DataSource = table; + Grid1.DataBind(); } - model.WeldJointCode = this.txtWeldJointCode.Text; - var list = BLL.WeldJointService.GetViewWeldJointsBymodel(model); - View_HJGL_WeldJoint = list; - Grid1.RecordCount = list.Count; - // var table = this.GetPagedDataTable(Grid1, list); - var table = list.Skip(Grid1.PageSize * (Grid1.PageIndex)).Take(Grid1.PageSize).ToList(); - Grid1.DataSource = table; - Grid1.DataBind(); + + + + + + } @@ -477,14 +487,15 @@ namespace FineUIPro.Web.HJGL.InfoQuery /// protected void btnOut_Click(object sender, EventArgs e) { - if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2) + if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2) //单位工程 { Model.View_HJGL_WeldJoint model = new Model.View_HJGL_WeldJoint(); - model.ProjectId = this.CurrUser.LoginProjectId; model.UnitWorkId = this.tvControlItem.SelectedNodeID; var list = BLL.WeldJointService.GetViewWeldJointsBymodel(model); View_HJGL_WeldJoint = list; - } + /* PrintByUnitWork(this.tvControlItem.SelectedNodeID); + return;*/ + } string path = Funs.RootPath + @"File\Excel\Temp\JointQuery.xlsx"; path = path.Replace(".xlsx", string.Format("{0:yyyy-MM-dd-HH-mm}", DateTime.Now) + ".xlsx"); @@ -546,6 +557,89 @@ namespace FineUIPro.Web.HJGL.InfoQuery //Response.Write(GetGridTableHtml(Grid1)); //Response.End(); } + protected void PrintByUnitWork(string unitWorkId) + { + const int pageSize = 10000; + int pageIndex = 0; + bool isFirstPage = true; + var model = new Model.View_HJGL_WeldJoint + { + ProjectId = this.CurrUser.LoginProjectId, + UnitWorkId = unitWorkId + }; + + // 生成唯一文件路径(带GUID哈希值) + string path = $@"{Funs.RootPath}File\Excel\Temp\JointQuery_{Guid.NewGuid().GetHashCode():x}.xlsx"; + var AllData = new List(); + using (var excelStream = new FileStream(path, FileMode.Create)) + { + while (true) + { + // 分页获取数据 + var pageData = BLL.WeldJointService.GetDataBymodel(model, pageIndex, pageSize); + + if (!pageData.Data.Any()) break; + + // 动态转换查询结果 + var currentChunk = pageData.Data.Select(x => new + { + 焊口号 = x.WeldJointCode, + 完成状态 = x.IsWeldOK, + 单位名称 = x.UnitName, + 流水段 = x.FlowingSection, + 材质1 = x.Material1Code, + 材质2 = x.Material2Code, + 达因 = x.Size, + 外径 = x.Dia, + 壁厚 = x.Thickness, + 规格 = x.Specification, + 焊缝类型 = x.WeldTypeCode, + 焊接方法 = x.WeldingMethodCode, + WPS编号 = x.WPQCode, + 坡口类型 = x.GrooveTypeCode, + 焊条 = x.WeldingRodCode, + 焊丝 = x.WeldingWireCode, + 预热温度 = x.PreTemperature, + 焊口属性 = x.JointAttribute, + 焊接日期 = x.WeldingDate, + 打底焊工号 = x.BackingWelderCode, + 打底焊工班组 = x.BackingWelderTeamGroupName, + 盖面焊工号 = x.CoverWelderCode, + 盖面焊工班组 = x.CoverWelderTeamGroupName, + 热处理报告编号 = x.HotProessReportNo, + 热处理检测结果 = x.HotProessResult, + 硬度报告编号 = x.HardReportNo, + 硬度检测结果 = x.HardResult, + 委托单编号 = x.TrustBatchCode, + 检测单编号 = x.NDECode, + 探伤类型 = x.DetectionTypeCode, + 探伤比例 = x.DetectionRateCode + + }).ToList(); + + AllData.AddRange(currentChunk); + // 内存清理 & 翻页操作 + currentChunk = null; + pageIndex++; + GC.Collect(GC.MaxGeneration, GCCollectionMode.Optimized, blocking: true); + } + + MiniExcel.SaveAs(path, AllData ); + + } + 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); // 多保险清理机制 + } + protected void btnOutNOComPipeline_Click(object sender, EventArgs e) { if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2)