修改实施计划导出

This commit is contained in:
高飞 2023-07-26 17:47:39 +08:00
parent 738bdd8e3e
commit 803b559e7e
2 changed files with 132 additions and 104 deletions

View File

@ -703,64 +703,67 @@ namespace FineUIPro.Web.HSSE.ActionPlan
}
foreach (var item in ActionPlan_ActionPlanListApproveList2)
{
//部门名称
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;
var departModel = db.Base_Depart.FirstOrDefault(x => x.DepartId == item.DepartId);
builder.Font.Bold = false;
if (departModel != null)
if (item.ApproveMan != "905a75d6-e733-449f-9742-4dcd71e8d2e1" && item.DepartId != BLL.Const.Depart_CompanyLeaderId)
{
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 = 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;
var departModel = db.Base_Depart.FirstOrDefault(x => x.DepartId == item.DepartId);
builder.Font.Bold = false;
if (departModel != null)
{
var file = rootPath + getUser.SignatureUrl;
builder.InsertImage(file, 80, 20);
builder.Write(item.ApproveDate.ToString().Split(' ')[0]);
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 = 100;
builder.Font.Bold = false;
if (!string.IsNullOrEmpty(item.ApproveIdea))
{
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();
}
#endregion
}
@ -783,6 +786,13 @@ namespace FineUIPro.Web.HSSE.ActionPlan
builder.CellFormat.Width = 300;
builder.Font.Bold = true;
builder.RowFormat.Height = 40;
var AQApprove = (from x in db.ActionPlan_ActionPlanListApprove
where x.ApproveMan == "905a75d6-e733-449f-9742-4dcd71e8d2e1"
select x).FirstOrDefault();
if (AQApprove != null)
{
builder.Write(AQApprove.ApproveIdea + "\n\n");
}
builder.Write("公司安全总监/部门负责人:");
var personAQ = BLL.Person_PersonsService.GetPerson_PersonsById("905a75d6-e733-449f-9742-4dcd71e8d2e1"); //安全总监任学宁
if (!string.IsNullOrEmpty(personAQ.SignatureUrl) && File.Exists(rootPath + personAQ.SignatureUrl))
@ -817,13 +827,17 @@ namespace FineUIPro.Web.HSSE.ActionPlan
builder.CellFormat.Width = 300;
builder.Font.Bold = true;
builder.RowFormat.Height = 40;
builder.Write("公司主管生产/安全领导:");
var GSLDApprove = (from x in db.ActionPlan_ActionPlanListApprove
join y in db.Person_Persons
on x.ApproveMan equals y.PersonId
where x.ActionPlanListId == Id && x.DepartId == BLL.Const.Depart_CompanyLeaderId
select x).FirstOrDefault();
if (GSLDApprove != null)
{
builder.Write(GSLDApprove.ApproveIdea + "\n\n");
}
builder.Write("公司主管生产/安全领导:");
if (GSLDApprove != null)
{
var personGSLD = BLL.Person_PersonsService.GetPerson_PersonsById(GSLDApprove.ApproveMan);
if (!string.IsNullOrEmpty(personGSLD.SignatureUrl) && File.Exists(rootPath + personGSLD.SignatureUrl))

View File

@ -685,64 +685,67 @@ namespace FineUIPro.Web.ZHGL.Plan
}
foreach (var item in ActionPlan_ActionPlanListApproveList2)
{
//部门名称
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;
var departModel = db.Base_Depart.FirstOrDefault(x => x.DepartId == item.DepartId);
builder.Font.Bold = false;
if (departModel != null)
if (item.ApproveMan != "905a75d6-e733-449f-9742-4dcd71e8d2e1" && item.DepartId != BLL.Const.Depart_CompanyLeaderId)
{
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 = 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;
var departModel = db.Base_Depart.FirstOrDefault(x => x.DepartId == item.DepartId);
builder.Font.Bold = false;
if (departModel != null)
{
var file = rootPath + getUser.SignatureUrl;
builder.InsertImage(file, 80, 20);
builder.Write(item.ApproveDate.ToString().Split(' ')[0]);
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 = 100;
builder.Font.Bold = false;
if (!string.IsNullOrEmpty(item.ApproveIdea))
{
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();
}
#endregion
}
@ -765,6 +768,13 @@ namespace FineUIPro.Web.ZHGL.Plan
builder.CellFormat.Width = 300;
builder.Font.Bold = true;
builder.RowFormat.Height = 40;
var AQApprove = (from x in db.ActionPlan_ActionPlanListApprove
where x.ApproveMan == "905a75d6-e733-449f-9742-4dcd71e8d2e1"
select x).FirstOrDefault();
if (AQApprove != null)
{
builder.Write(AQApprove.ApproveIdea + "\n\n");
}
builder.Write("公司安全总监/部门负责人:");
var personAQ = BLL.Person_PersonsService.GetPerson_PersonsById("905a75d6-e733-449f-9742-4dcd71e8d2e1"); //安全总监任学宁
if (!string.IsNullOrEmpty(personAQ.SignatureUrl) && File.Exists(rootPath + personAQ.SignatureUrl))
@ -799,13 +809,17 @@ namespace FineUIPro.Web.ZHGL.Plan
builder.CellFormat.Width = 300;
builder.Font.Bold = true;
builder.RowFormat.Height = 40;
builder.Write("公司主管生产/安全领导:");
var GSLDApprove = (from x in db.ActionPlan_ActionPlanListApprove
join y in db.Person_Persons
on x.ApproveMan equals y.PersonId
where x.ActionPlanListId == Id && x.DepartId == BLL.Const.Depart_CompanyLeaderId
select x).FirstOrDefault();
if (GSLDApprove != null)
{
builder.Write(GSLDApprove.ApproveIdea + "\n\n");
}
builder.Write("公司主管生产/安全领导:");
if (GSLDApprove != null)
{
var personGSLD = BLL.Person_PersonsService.GetPerson_PersonsById(GSLDApprove.ApproveMan);
if (!string.IsNullOrEmpty(personGSLD.SignatureUrl) && File.Exists(rootPath + personGSLD.SignatureUrl))