修改安全实施计划导出

This commit is contained in:
2023-07-17 14:46:24 +08:00
parent 8ee5629fc5
commit 322eca9cce
2 changed files with 108 additions and 2 deletions
@@ -564,8 +564,9 @@ namespace FineUIPro.Web.HSSE.ActionPlan
{
}
var approves = db.ActionPlan_ActionPlanListApprove.Where(x => x.ActionPlanListId == Id && x.ApproveType == BLL.Const.ActionPlanList_Reviewing).ToList();
var ActionPlan_ActionPlanListApproveList2 = db.ActionPlan_ActionPlanListApprove.Where(x => x.ActionPlanListId == Id && x.ApproveType == "6").ToList();
if (ActionPlan_ActionPlanListApproveList2.Count > 0)
if (ActionPlan_ActionPlanListApproveList2.Count > 0 || approves.Count > 0)
{
#region
//主要评审部门
@@ -607,6 +608,58 @@ namespace FineUIPro.Web.HSSE.ActionPlan
builder.Write("评审部门负责人/日期");
builder.EndRow();
#endregion
foreach (var item in approves)
{
//部门名称
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 80;
var departModel = db.Base_Depart.FirstOrDefault(x => x.DepartId == item.DepartId);
builder.Font.Bold = false;
if (departModel != null)
{
builder.Write(departModel.DepartName);
}
//评审意见
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 80;
builder.Font.Bold = false;
if (!string.IsNullOrEmpty(item.ApproveIdea))
{
builder.Write(item.ApproveIdea);
}
else
{
builder.Write("无");
}
//评审日期
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 70;
builder.Font.Bold = false;
if (item.ApproveDate != null)
{
string personName = Person_PersonsService.GetPersonsNameById(item.ApproveMan);
builder.Write(personName + " " + item.ApproveDate.ToString().Split(' ')[0]);
}
else
{
builder.Write("");
}
builder.EndRow();
}
foreach (var item in ActionPlan_ActionPlanListApproveList2)
{
//部门名称
@@ -550,8 +550,9 @@ namespace FineUIPro.Web.ZHGL.Plan
{
}
var approves = db.ActionPlan_ActionPlanListApprove.Where(x => x.ActionPlanListId == Id && x.ApproveType == BLL.Const.ActionPlanList_Reviewing).ToList();
var ActionPlan_ActionPlanListApproveList2 = db.ActionPlan_ActionPlanListApprove.Where(x => x.ActionPlanListId == Id && x.ApproveType == "6").ToList();
if (ActionPlan_ActionPlanListApproveList2.Count > 0)
if (ActionPlan_ActionPlanListApproveList2.Count > 0 || approves.Count > 0)
{
#region
//主要评审部门
@@ -593,6 +594,58 @@ namespace FineUIPro.Web.ZHGL.Plan
builder.Write("评审部门负责人/日期");
builder.EndRow();
#endregion
foreach (var item in approves)
{
//部门名称
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 80;
var departModel = db.Base_Depart.FirstOrDefault(x => x.DepartId == item.DepartId);
builder.Font.Bold = false;
if (departModel != null)
{
builder.Write(departModel.DepartName);
}
//评审意见
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 80;
builder.Font.Bold = false;
if (!string.IsNullOrEmpty(item.ApproveIdea))
{
builder.Write(item.ApproveIdea);
}
else
{
builder.Write("无");
}
//评审日期
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 70;
builder.Font.Bold = false;
if (item.ApproveDate != null)
{
string personName = Person_PersonsService.GetPersonsNameById(item.ApproveMan);
builder.Write(personName + " " + item.ApproveDate.ToString().Split(' ')[0]);
}
else
{
builder.Write("");
}
builder.EndRow();
}
foreach (var item in ActionPlan_ActionPlanListApproveList2)
{
//部门名称