From 216cdad9dee4bedfd718fe04fcd18fd351d462cf Mon Sep 17 00:00:00 2001 From: gaofei1985 <181547018@qq.com> Date: Mon, 17 Jul 2023 16:09:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=89=E5=85=A8=E5=AE=9E?= =?UTF-8?q?=E6=96=BD=E8=AE=A1=E5=88=92=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HSSE/ActionPlan/ActionPlanList.aspx.cs | 45 ++++++++++++++++--- .../ZHGL/Plan/ActionPlanList.aspx.cs | 45 ++++++++++++++++--- 2 files changed, 78 insertions(+), 12 deletions(-) diff --git a/SGGL/FineUIPro.Web/HSSE/ActionPlan/ActionPlanList.aspx.cs b/SGGL/FineUIPro.Web/HSSE/ActionPlan/ActionPlanList.aspx.cs index 57b81a6b..f4189c52 100644 --- a/SGGL/FineUIPro.Web/HSSE/ActionPlan/ActionPlanList.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/ActionPlan/ActionPlanList.aspx.cs @@ -478,7 +478,16 @@ namespace FineUIPro.Web.HSSE.ActionPlan builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐 builder.CellFormat.Width = 130; builder.Font.Bold = false; - builder.Write(BLL.Person_PersonsService.GetPersonsNameById(actionPlanList.CompileMan)); + var getCompileMan = Person_PersonsService.GetPerson_PersonsById(actionPlanList.CompileMan); + if (!string.IsNullOrEmpty(getCompileMan.SignatureUrl) && File.Exists(rootPath + getCompileMan.SignatureUrl)) + { + var file = rootPath + getCompileMan.SignatureUrl; + builder.InsertImage(file, 80, 20); + } + else + { + builder.Write(getCompileMan.PersonName); + } builder.EndRow(); #endregion @@ -504,13 +513,21 @@ namespace FineUIPro.Web.HSSE.ActionPlan builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First; builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐 builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐 - string manname = man(ActionPlan_ActionPlanListApproveList[i].ApproveMan); + var getApproveMan = Person_PersonsService.GetPerson_PersonsById(ActionPlan_ActionPlanListApproveList[i].ApproveMan); //判断是不是最后一个 if (ActionPlan_ActionPlanListApproveList.Count == i + 1) { builder.CellFormat.Width = 40; builder.Font.Bold = false; - builder.Write(manname); + if (!string.IsNullOrEmpty(getApproveMan.SignatureUrl) && File.Exists(rootPath + getApproveMan.SignatureUrl)) + { + var file = rootPath + getApproveMan.SignatureUrl; + builder.InsertImage(file, 80, 20); + } + else + { + builder.Write(getApproveMan.PersonName); + } builder.InsertCell(); builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None; @@ -524,7 +541,15 @@ namespace FineUIPro.Web.HSSE.ActionPlan { builder.CellFormat.Width = 40; builder.Font.Bold = false; - builder.Write(manname); + if (!string.IsNullOrEmpty(getApproveMan.SignatureUrl) && File.Exists(rootPath + getApproveMan.SignatureUrl)) + { + var file = rootPath + getApproveMan.SignatureUrl; + builder.InsertImage(file, 80, 20); + } + else + { + builder.Write(getApproveMan.PersonName); + } } @@ -546,9 +571,17 @@ namespace FineUIPro.Web.HSSE.ActionPlan builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐 builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐 builder.CellFormat.Width = 20; - string manname2 = man(ActionPlan_ActionPlanListApproveList[i + 1].ApproveMan); + var getApproveMan2 = Person_PersonsService.GetPerson_PersonsById(ActionPlan_ActionPlanListApproveList[i + 1].ApproveMan); builder.Font.Bold = false; - builder.Write(manname2); + if (!string.IsNullOrEmpty(getApproveMan2.SignatureUrl) && File.Exists(rootPath + getApproveMan2.SignatureUrl)) + { + var file = rootPath + getApproveMan2.SignatureUrl; + builder.InsertImage(file, 80, 20); + } + else + { + builder.Write(getApproveMan2.PersonName); + } builder.EndRow(); i += 1; } diff --git a/SGGL/FineUIPro.Web/ZHGL/Plan/ActionPlanList.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Plan/ActionPlanList.aspx.cs index 7dfd21ea..1e997fe1 100644 --- a/SGGL/FineUIPro.Web/ZHGL/Plan/ActionPlanList.aspx.cs +++ b/SGGL/FineUIPro.Web/ZHGL/Plan/ActionPlanList.aspx.cs @@ -464,7 +464,16 @@ namespace FineUIPro.Web.ZHGL.Plan builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐 builder.CellFormat.Width = 130; builder.Font.Bold = false; - builder.Write(BLL.Person_PersonsService.GetPersonsNameById(actionPlanList.CompileMan)); + var getCompileMan = Person_PersonsService.GetPerson_PersonsById(actionPlanList.CompileMan); + if (!string.IsNullOrEmpty(getCompileMan.SignatureUrl) && File.Exists(rootPath + getCompileMan.SignatureUrl)) + { + var file = rootPath + getCompileMan.SignatureUrl; + builder.InsertImage(file, 80, 20); + } + else + { + builder.Write(getCompileMan.PersonName); + } builder.EndRow(); #endregion @@ -490,13 +499,21 @@ namespace FineUIPro.Web.ZHGL.Plan builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First; builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐 builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐 - string manname = man(ActionPlan_ActionPlanListApproveList[i].ApproveMan); + var getApproveMan = Person_PersonsService.GetPerson_PersonsById(ActionPlan_ActionPlanListApproveList[i].ApproveMan); //判断是不是最后一个 if (ActionPlan_ActionPlanListApproveList.Count == i + 1) { builder.CellFormat.Width = 40; builder.Font.Bold = false; - builder.Write(manname); + if (!string.IsNullOrEmpty(getApproveMan.SignatureUrl) && File.Exists(rootPath + getApproveMan.SignatureUrl)) + { + var file = rootPath + getApproveMan.SignatureUrl; + builder.InsertImage(file, 80, 20); + } + else + { + builder.Write(getApproveMan.PersonName); + } builder.InsertCell(); builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None; @@ -510,7 +527,15 @@ namespace FineUIPro.Web.ZHGL.Plan { builder.CellFormat.Width = 40; builder.Font.Bold = false; - builder.Write(manname); + if (!string.IsNullOrEmpty(getApproveMan.SignatureUrl) && File.Exists(rootPath + getApproveMan.SignatureUrl)) + { + var file = rootPath + getApproveMan.SignatureUrl; + builder.InsertImage(file, 80, 20); + } + else + { + builder.Write(getApproveMan.PersonName); + } } @@ -532,9 +557,17 @@ namespace FineUIPro.Web.ZHGL.Plan builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐 builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐 builder.CellFormat.Width = 20; - string manname2 = man(ActionPlan_ActionPlanListApproveList[i + 1].ApproveMan); + var getApproveMan2 = Person_PersonsService.GetPerson_PersonsById(ActionPlan_ActionPlanListApproveList[i + 1].ApproveMan); builder.Font.Bold = false; - builder.Write(manname2); + if (!string.IsNullOrEmpty(getApproveMan2.SignatureUrl) && File.Exists(rootPath + getApproveMan2.SignatureUrl)) + { + var file = rootPath + getApproveMan2.SignatureUrl; + builder.InsertImage(file, 80, 20); + } + else + { + builder.Write(getApproveMan2.PersonName); + } builder.EndRow(); i += 1; }