修改实施计划导出

This commit is contained in:
高飞 2023-07-27 09:17:32 +08:00
parent da7aaf15bd
commit 3c1ac7f7fa
2 changed files with 103 additions and 97 deletions

View File

@ -389,7 +389,7 @@ namespace FineUIPro.Web.HSSE.ActionPlan
string Id = Grid1.SelectedRowID;
Model.ActionPlan_ActionPlanList actionPlanList = BLL.ActionPlanListService.GetActionPlanListById(Id);
if (actionPlanList.States != BLL.Const.ActionPlanList_Complete)
if (actionPlanList.States != BLL.Const.ActionPlanList_Complete && this.CurrUser.PersonId != BLL.Const.sysglyId && this.CurrUser.PersonId != BLL.Const.hfnbdId)
{
Alert.ShowInTop("状态必须为审批完成的才能导出!", MessageBoxIcon.Warning);
return;
@ -646,64 +646,67 @@ namespace FineUIPro.Web.HSSE.ActionPlan
#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 = 150;
builder.Font.Bold = false;
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 = 100;
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 = 150;
builder.Font.Bold = false;
if (item.ApproveDate != null)
{
var getUser = Person_PersonsService.GetPerson_PersonsById(item.ApproveMan);
if (!string.IsNullOrEmpty(getUser.SignatureUrl) && File.Exists(rootPath + getUser.SignatureUrl))
//部门名称
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 = 150;
builder.Font.Bold = false;
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 = 100;
builder.Font.Bold = false;
if (!string.IsNullOrEmpty(item.ApproveIdea))
{
var file = rootPath + getUser.SignatureUrl;
builder.InsertImage(file, 80, 20);
builder.Write(item.ApproveDate.ToString().Split(' ')[0]);
builder.Write(item.ApproveIdea);
}
else
{
builder.Write(getUser.PersonName + " " + item.ApproveDate.ToString().Split(' ')[0]);
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 = 150;
builder.Font.Bold = false;
if (item.ApproveDate != null)
{
var getUser = Person_PersonsService.GetPerson_PersonsById(item.ApproveMan);
if (!string.IsNullOrEmpty(getUser.SignatureUrl) && File.Exists(rootPath + getUser.SignatureUrl))
{
var file = rootPath + getUser.SignatureUrl;
builder.InsertImage(file, 80, 20);
builder.Write(item.ApproveDate.ToString().Split(' ')[0]);
}
else
{
builder.Write(getUser.PersonName + " " + item.ApproveDate.ToString().Split(' ')[0]);
}
}
else
{
builder.Write("");
}
builder.EndRow();
}
else
{
builder.Write("");
}
builder.EndRow();
}
foreach (var item in ActionPlan_ActionPlanListApproveList2)
{
if (item.ApproveMan != "905a75d6-e733-449f-9742-4dcd71e8d2e1" && item.DepartId != BLL.Const.Depart_CompanyLeaderId)
if (item.ApproveMan != "905a75d6-e733-449f-9742-4dcd71e8d2e1" && item.DepartId != BLL.Const.Depart_CompanyLeaderId && item.ApproveDate != null)
{
//部门名称
builder.InsertCell();

View File

@ -371,7 +371,7 @@ namespace FineUIPro.Web.ZHGL.Plan
string Id = Grid1.SelectedRowID;
Model.ActionPlan_ActionPlanList actionPlanList = BLL.ActionPlanListService.GetActionPlanListById(Id);
if (actionPlanList.States != BLL.Const.ActionPlanList_Complete)
if (actionPlanList.States != BLL.Const.ActionPlanList_Complete && this.CurrUser.PersonId != BLL.Const.sysglyId && this.CurrUser.PersonId != BLL.Const.hfnbdId)
{
Alert.ShowInTop("状态必须为审批完成的才能导出!", MessageBoxIcon.Warning);
return;
@ -628,64 +628,67 @@ namespace FineUIPro.Web.ZHGL.Plan
#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 = 150;
builder.Font.Bold = false;
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 = 100;
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 = 150;
builder.Font.Bold = false;
if (item.ApproveDate != null)
{
var getUser = Person_PersonsService.GetPerson_PersonsById(item.ApproveMan);
if (!string.IsNullOrEmpty(getUser.SignatureUrl) && File.Exists(rootPath + getUser.SignatureUrl))
//部门名称
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 = 150;
builder.Font.Bold = false;
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 = 100;
builder.Font.Bold = false;
if (!string.IsNullOrEmpty(item.ApproveIdea))
{
var file = rootPath + getUser.SignatureUrl;
builder.InsertImage(file, 80, 20);
builder.Write(item.ApproveDate.ToString().Split(' ')[0]);
builder.Write(item.ApproveIdea);
}
else
{
builder.Write(getUser.PersonName + " " + item.ApproveDate.ToString().Split(' ')[0]);
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 = 150;
builder.Font.Bold = false;
if (item.ApproveDate != null)
{
var getUser = Person_PersonsService.GetPerson_PersonsById(item.ApproveMan);
if (!string.IsNullOrEmpty(getUser.SignatureUrl) && File.Exists(rootPath + getUser.SignatureUrl))
{
var file = rootPath + getUser.SignatureUrl;
builder.InsertImage(file, 80, 20);
builder.Write(item.ApproveDate.ToString().Split(' ')[0]);
}
else
{
builder.Write(getUser.PersonName + " " + item.ApproveDate.ToString().Split(' ')[0]);
}
}
else
{
builder.Write("");
}
builder.EndRow();
}
else
{
builder.Write("");
}
builder.EndRow();
}
foreach (var item in ActionPlan_ActionPlanListApproveList2)
{
if (item.ApproveMan != "905a75d6-e733-449f-9742-4dcd71e8d2e1" && item.DepartId != BLL.Const.Depart_CompanyLeaderId)
if (item.ApproveMan != "905a75d6-e733-449f-9742-4dcd71e8d2e1" && item.DepartId != BLL.Const.Depart_CompanyLeaderId && item.ApproveDate != null)
{
//部门名称
builder.InsertCell();
@ -769,7 +772,7 @@ namespace FineUIPro.Web.ZHGL.Plan
builder.Font.Bold = true;
builder.RowFormat.Height = 40;
var AQApprove = (from x in db.ActionPlan_ActionPlanListApprove
where x.ApproveMan == "905a75d6-e733-449f-9742-4dcd71e8d2e1"
where x.ApproveMan == "905a75d6-e733-449f-9742-4dcd71e8d2e1"
select x).FirstOrDefault();
if (AQApprove != null)
{