This commit is contained in:
2023-08-04 17:07:06 +08:00
133 changed files with 4486 additions and 1325 deletions
@@ -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;
@@ -410,57 +410,59 @@ namespace FineUIPro.Web.HSSE.ActionPlan
{
projectName = "(" + projectName + ")";
}
else
{
projectName = "(无项目)";
}
projectName = projectName.Replace("/", "_");
newUrl = uploadfilepath.Replace(".doc", projectName + ".doc");
filePath = uploadfilepath.Replace(".doc", projectName + ".pdf");
if (File.Exists(newUrl))
{
File.Delete(newUrl);
}
File.Copy(uploadfilepath, newUrl);
///更新书签
Document doc = new Aspose.Words.Document(newUrl);
Aspose.Words.DocumentBuilder builder = new Aspose.Words.DocumentBuilder(doc);
builder.MoveToBookmark("tab");
builder.StartTable();
builder.CellFormat.Borders.LineStyle = LineStyle.Single;
builder.CellFormat.Borders.Color = System.Drawing.Color.Black;
builder.Bold = false;
builder.RowFormat.Height = 20;
builder.Font.Size = 9;
#region
//工程名称和项目部编制人员
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 = true;
builder.Write("工程名称");
//写入第一行
Bookmark bookmarkProjectName = doc.Range.Bookmarks["ProjectName"];
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
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 = 130;
builder.Font.Bold = false;
var project = ProjectService.GetProjectByProjectId(actionPlanList.ProjectId);
var ActionPlan_ActionPlanListApproveList = db.ActionPlan_ActionPlanListApprove.Where(x => x.ActionPlanListId == Id && x.ApproveType == "2").ToList();
if (project != null)
{
if (project.ProjectName.Length > 20 && ActionPlan_ActionPlanListApproveList.Count != 0)
{
builder.Write(project.ProjectName.Substring(0, 20) + "\n" +
project.ProjectName.Substring(20));
}
else
{
builder.Write(project.ProjectName);
}
if (bookmarkProjectName != null)
{
if (project != null)
{
if (project.ProjectName.Length > 20 && ActionPlan_ActionPlanListApproveList.Count != 0)
{
bookmarkProjectName.Text = project.ProjectName.Substring(0, 20) + "\n" +
project.ProjectName.Substring(20);
}
else
{
bookmarkProjectName.Text = project.ProjectName;
}
}
}
builder.EndRow();
Aspose.Words.DocumentBuilder builder = new Aspose.Words.DocumentBuilder(doc);
builder.MoveToBookmark("tab");
builder.StartTable();
builder.CellFormat.Borders.LineStyle = LineStyle.Single;
builder.CellFormat.Borders.Color = System.Drawing.Color.Black;
builder.Bold = false;
builder.RowFormat.Height = 20;
builder.Font.Size = 9;
#region
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
@@ -475,9 +477,18 @@ 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;//水平居中对齐
builder.CellFormat.Width = 130;
builder.CellFormat.Width = 300;
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
@@ -503,27 +514,43 @@ 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.CellFormat.Width = 150;
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;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 90;
builder.CellFormat.Width = 150;
builder.Write("");
}
else
{
builder.CellFormat.Width = 40;
builder.CellFormat.Width = 150;
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);
}
}
@@ -535,7 +562,7 @@ 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;//水平居中对齐
builder.CellFormat.Width = 70;
builder.CellFormat.Width = 100;
builder.Font.Bold = true;
builder.Write("项目部审核人");
@@ -544,10 +571,18 @@ 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;//水平居中对齐
builder.CellFormat.Width = 20;
string manname2 = man(ActionPlan_ActionPlanListApproveList[i + 1].ApproveMan);
builder.CellFormat.Width = 50;
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;
}
@@ -563,9 +598,12 @@ 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)
DateTime date = DateTime.Now;
if (ActionPlan_ActionPlanListApproveList2.Count > 0 || approves.Count > 0)
{
date = ActionPlan_ActionPlanListApproveList2.OrderByDescending(x => x.ApproveDate).FirstOrDefault().ApproveDate.Value;
#region
//主要评审部门
builder.InsertCell();
@@ -573,7 +611,7 @@ 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;//水平居中对齐
builder.CellFormat.Width = 230;
builder.CellFormat.Width = 400;
builder.Font.Bold = true;
builder.Write("主要评审部门");
builder.EndRow();
@@ -583,7 +621,7 @@ 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;//水平居中对齐
builder.CellFormat.Width = 80;
builder.CellFormat.Width = 150;
builder.Font.Bold = true;
builder.Write("评审部门");
@@ -592,7 +630,7 @@ 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;//水平居中对齐
builder.CellFormat.Width = 80;
builder.CellFormat.Width = 100;
builder.Font.Bold = true;
builder.Write("评审意见");
@@ -601,62 +639,134 @@ 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;//水平居中对齐
builder.CellFormat.Width = 70;
builder.CellFormat.Width = 150;
builder.Font.Bold = true;
builder.Write("评审部门负责人/日期");
builder.EndRow();
#endregion
foreach (var item in ActionPlan_ActionPlanListApproveList2)
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]);
//部门名称
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))
{
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
}
foreach (var item in ActionPlan_ActionPlanListApproveList2)
{
if (item.ApproveMan != "905a75d6-e733-449f-9742-4dcd71e8d2e1" && item.DepartId != BLL.Const.Depart_CompanyLeaderId && item.ApproveDate != null)
{
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;
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 = 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))
{
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();
}
builder.EndRow();
}
#endregion
}
@@ -676,13 +786,31 @@ namespace FineUIPro.Web.HSSE.ActionPlan
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Bottom;//底部对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Left;//水平居中对齐
builder.CellFormat.Width = 130;
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("公司安全总监/部门负责人:");
builder.Write(" 年");
builder.Write(" 月");
builder.Write(" 日");
var personAQ = BLL.Person_PersonsService.GetPerson_PersonsById("905a75d6-e733-449f-9742-4dcd71e8d2e1"); //安全总监任学宁
if (!string.IsNullOrEmpty(personAQ.SignatureUrl) && File.Exists(rootPath + personAQ.SignatureUrl))
{
var file = rootPath + personAQ.SignatureUrl;
builder.InsertImage(file, 80, 20);
builder.Write(date.ToString().Split(' ')[0]);
}
else
{
builder.Write(personAQ.PersonName + " " + date.ToString().Split(' ')[0]);
}
//builder.Write(" 年");
//builder.Write(" 月");
//builder.Write(" 日");
builder.EndRow();
builder.InsertCell();
@@ -692,20 +820,46 @@ namespace FineUIPro.Web.HSSE.ActionPlan
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 100;
builder.Font.Bold = true;
builder.Write("审");
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.Bottom;//底部对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Left;//水平居中对齐
builder.CellFormat.Width = 130;
builder.CellFormat.Width = 300;
builder.Font.Bold = true;
builder.RowFormat.Height = 40;
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("公司主管生产/安全领导:");
builder.Write(" 年");
builder.Write(" 月");
builder.Write(" 日");
if (GSLDApprove != null)
{
var personGSLD = BLL.Person_PersonsService.GetPerson_PersonsById(GSLDApprove.ApproveMan);
if (!string.IsNullOrEmpty(personGSLD.SignatureUrl) && File.Exists(rootPath + personGSLD.SignatureUrl))
{
var file = rootPath + personGSLD.SignatureUrl;
builder.InsertImage(file, 80, 20);
builder.Write(GSLDApprove.ApproveDate.ToString().Split(' ')[0]);
}
else
{
builder.Write(personGSLD.PersonName + " " + GSLDApprove.ApproveDate.ToString().Split(' ')[0]);
}
}
else
{
builder.Write(" 年");
builder.Write(" 月");
builder.Write(" 日");
}
builder.EndRow();
builder.Font.Bold = false;
@@ -715,17 +869,24 @@ namespace FineUIPro.Web.HSSE.ActionPlan
}
doc.Save(newUrl);
string fileName = Path.GetFileName(newUrl);
FileInfo info = new FileInfo(newUrl);
//生成PDF文件
string pdfUrl = newUrl.Replace(".doc", ".pdf");
Document doc1 = new Aspose.Words.Document(newUrl);
//验证参数
if (doc1 == null) { throw new Exception("Word文件无效"); }
doc1.Save(pdfUrl, Aspose.Words.SaveFormat.Pdf);//还可以改成其它格式
string fileName = Path.GetFileName(filePath);
FileInfo info = new FileInfo(pdfUrl);
long fileSize = info.Length;
Response.Clear();
Response.ContentType = "application/x-zip-compressed";
Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
Response.AddHeader("Content-Length", fileSize.ToString());
Response.TransmitFile(newUrl, 0, fileSize);
Response.TransmitFile(pdfUrl, 0, fileSize);
Response.Flush();
Response.Close();
File.Delete(newUrl);
File.Delete(pdfUrl);
}
catch (Exception ex)
{
@@ -473,8 +473,8 @@ namespace FineUIPro.Web.HSSE.ActionPlan
actionPlanList.States = actionPlanList1.States;
}
if (!CurrUser.PersonId.Equals(actionPlanList1.CompileMan))
{
//if (!CurrUser.PersonId.Equals(actionPlanList1.CompileMan))
//{
Model.ActionPlan_ActionPlanListApprove approve = ActionPlanListApproveService.GetConstructSoluAppByApproveMan(ActionPlanListId, CurrUser.PersonId, Convert.ToInt32(actionPlanList1.Edition));
if (type == BLL.Const.BtnSubmit)
{
@@ -484,30 +484,30 @@ namespace FineUIPro.Web.HSSE.ActionPlan
approve.IsAgree = Convert.ToBoolean(rblIsAgree.SelectedValue);
approve.ApproveIdea = txtOptions.Text.Trim();
ActionPlanListApproveService.UpdateActionPlanListApprove(approve);
}
else
{
if (type == BLL.Const.BtnSubmit)
{
if (actionPlanList1.States == Const.ActionPlanList_Audit)//==会签状态升级版本
{
Model.ActionPlan_ActionPlanListApprove reApprove = new Model.ActionPlan_ActionPlanListApprove();
reApprove.ActionPlanListId = actionPlanList.ActionPlanListId;
reApprove.ApproveDate = DateTime.Now;
reApprove.ApproveMan = actionPlanList1.CompileMan;
reApprove.ApproveType = Const.ActionPlanList_ReCompile;
edtion++;
reApprove.Edition = edtion;
ActionPlanListApproveService.AddActionPlanListApprove(reApprove);
}
else
{
Model.ActionPlan_ActionPlanListApprove approves = ActionPlanListApproveService.GetConstructSolApproveByApproveMan(ActionPlanListId, actionPlanList1.CompileMan);
approves.ApproveDate = DateTime.Now;
ActionPlanListApproveService.UpdateActionPlanListApprove(approves);
}
}
}
//}
//else
//{
// if (type == BLL.Const.BtnSubmit)
// {
// if (actionPlanList1.States == Const.ActionPlanList_Audit)//==会签状态升级版本
// {
// Model.ActionPlan_ActionPlanListApprove reApprove = new Model.ActionPlan_ActionPlanListApprove();
// reApprove.ActionPlanListId = actionPlanList.ActionPlanListId;
// reApprove.ApproveDate = DateTime.Now;
// reApprove.ApproveMan = actionPlanList1.CompileMan;
// reApprove.ApproveType = Const.ActionPlanList_ReCompile;
// edtion++;
// reApprove.Edition = edtion;
// ActionPlanListApproveService.AddActionPlanListApprove(reApprove);
// }
// else
// {
// Model.ActionPlan_ActionPlanListApprove approves = ActionPlanListApproveService.GetConstructSolApproveByApproveMan(ActionPlanListId, actionPlanList1.CompileMan);
// approves.ApproveDate = DateTime.Now;
// ActionPlanListApproveService.UpdateActionPlanListApprove(approves);
// }
// }
//}
}
else
{
@@ -10,7 +10,7 @@
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>编辑标准规范辨识</title>
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
@@ -37,9 +37,9 @@
</f:CheckBox>
</Items>
</f:Toolbar>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" >
<f:Toolbar ID="Toolbar1" Position="Top" runat="server">
<Items>
<f:TextBox ID="txtConstructionStandardIdentifyCode" runat="server" Label="编号" LabelAlign="Right"
<f:TextBox ID="txtConstructionStandardIdentifyCode" runat="server" Label="编号" LabelAlign="Right"
MaxLength="30" Readonly="true" Width="400px">
</f:TextBox>
<f:TextBox ID="txtRemark" runat="server" Label="备注" LabelAlign="Right" MaxLength="150" Width="400px">
@@ -49,10 +49,10 @@
</Toolbars>
<Items>
<f:Grid ID="Grid1" ShowBorder="false" ShowHeader="false" Title="标准规范辨识" EnableCollapse="true"
IsDatabasePaging="true" PageSize="10" AllowPaging="true" runat="server" BoxFlex="1"
DataKeyNames="StandardId" DataIDField="StandardId" AllowCellEditing="true"
IsDatabasePaging="true" PageSize="20" AllowPaging="true" runat="server" BoxFlex="1"
DataKeyNames="StandardId" DataIDField="StandardId" AllowCellEditing="true"
OnPageIndexChange="Grid1_PageIndexChange" EnableTextSelection="true"
EnableColumnLines="true" EnableCheckBoxSelect="true">
EnableColumnLines="true" EnableCheckBoxSelect="true">
<Columns>
<f:RenderField Width="100px" ColumnID="StandardGrade" DataField="StandardGrade" FieldType="String"
HeaderText="标准级别" HeaderTextAlign="Center" TextAlign="Left">
@@ -143,13 +143,56 @@ namespace FineUIPro.Web.HSSE.InformationProject
/// </summary>
private void BindGrid()
{
var q = from x in Funs.DB.View_InformationProject_ConstructionStandardSelectedItem
where x.StandardName != null
select x;
if (!this.ckbAll.Checked)
IQueryable<Model.View_InformationProject_ConstructionStandardSelectedItem> q;
if (this.ckbAll.Checked)
{
q = q.Where(e => e.ConstructionStandardIdentifyId == this.ConstructionStandardIdentifyId);
q = from x in Funs.DB.Law_HSSEStandardsList
join y in Funs.DB.InformationProject_ConstructionStandardSelectedItem on x.StandardId equals y.StandardId
join z in Funs.DB.InformationProject_ConstructionStandardIdentify on y.ConstructionStandardIdentifyId equals z.ConstructionStandardIdentifyId
where x.StandardName != null && z.ProjectId == this.CurrUser.LoginProjectId
select new Model.View_InformationProject_ConstructionStandardSelectedItem
{
ConstructionStandardSelectedItemId =y.ConstructionStandardSelectedItemId,
ConstructionStandardIdentifyId = y.ConstructionStandardIdentifyId,
ProjectId = this.CurrUser.LoginProjectId,
StandardId = x.StandardId,
StandardGrade = x.StandardGrade,
StandardNo = x.StandardNo,
StandardName = x.StandardName,
AttachUrl = x.AttachUrl,
IsSelected1 = x.IsSelected1,
IsSelected2 = x.IsSelected2,
IsSelected3 = x.IsSelected3,
IsSelected4 = x.IsSelected4,
IsSelected5 = x.IsSelected5,
IsSelected6 = x.IsSelected6,
IsSelected7 = x.IsSelected7,
IsSelected8 = x.IsSelected8,
IsSelected9 = x.IsSelected9,
IsSelected10 = x.IsSelected10,
IsSelected11 = x.IsSelected11,
IsSelected12 = x.IsSelected12,
IsSelected13 = x.IsSelected13,
IsSelected14 = x.IsSelected14,
IsSelected15 = x.IsSelected15,
IsSelected16 = x.IsSelected16,
IsSelected17 = x.IsSelected17,
IsSelected18 = x.IsSelected18,
IsSelected19 = x.IsSelected19,
IsSelected20 = x.IsSelected20,
IsSelected21 = x.IsSelected21,
IsSelected22 = x.IsSelected22,
IsSelected23 = x.IsSelected23,
IsSelected90 = x.IsSelected90
};
}
else
{
q = from x in Funs.DB.View_InformationProject_ConstructionStandardSelectedItem
where x.ConstructionStandardIdentifyId == this.ConstructionStandardIdentifyId
select x;
}
if (!string.IsNullOrEmpty(this.txtStandardGrade.Text.Trim()))
{
q = q.Where(e => e.StandardGrade.Contains(this.txtStandardGrade.Text.Trim()));
@@ -26,6 +26,9 @@
<f:DropDownList ID="drpYear" runat="server" Label="年份" LabelAlign="Right" Width="250px"
AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged">
</f:DropDownList>
<f:DropDownList ID="drpQuarters" runat="server" Label="季度" LabelAlign="Right" Width="250px"
AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged">
</f:DropDownList>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="btnNew" ToolTip="新增" Icon="Add" EnablePostBack="false" Hidden="true" Text="新增"
@@ -41,11 +44,19 @@
SortField="UnitName" FieldType="String" HeaderText="填报单位" HeaderTextAlign="Center"
TextAlign="Left" ExpandUnusedSpace="true">
</f:RenderField>
<f:RenderField Width="120px" ColumnID="ResponsiblePerson" DataField="ResponsiblePerson"
<f:RenderField Width="100px" ColumnID="YearStr" DataField="YearStr"
SortField="YearStr" FieldType="String" HeaderText="年份" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="QuarterStr" DataField="QuarterStr"
SortField="QuarterStr" FieldType="String" HeaderText="季度" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="ResponsiblePerson" DataField="ResponsiblePerson"
SortField="ResponsiblePerson" FieldType="String" HeaderText="负责人" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="ResponsiblePersonTel" DataField="ResponsiblePersonTel"
<f:RenderField Width="120px" ColumnID="ResponsiblePersonTel" DataField="ResponsiblePersonTel"
SortField="ResponsiblePersonTel" FieldType="String" HeaderText="负责人电话" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
@@ -53,7 +64,7 @@
SortField="ContactPerson" FieldType="String" HeaderText="联系人" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="ContactPersonTel" DataField="ContactPersonTel"
<f:RenderField Width="120px" ColumnID="ContactPersonTel" DataField="ContactPersonTel"
SortField="ContactPersonTel" FieldType="String" HeaderText="联系人电话" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
@@ -48,10 +48,12 @@ namespace FineUIPro.Web.HSSE.InformationProject
this.GetButtonPower();
BLL.ConstValue.InitConstValueDropDownList(this.drpYear, BLL.ConstValue.Group_0008, true);
BLL.ConstValue.InitConstValueDropDownList(this.drpQuarters, BLL.ConstValue.Group_0011, true);
this.btnNew.OnClientClick = Window1.GetShowReference("EPSummaryReportEdit.aspx") + "return false;";
Grid1.PageSize = 10;
//if (this.CurrUser != null && this.CurrUser.PageSize.HasValue)
//{
// Grid1.PageSize = this.CurrUser.PageSize.Value;
//}
this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
// 绑定表格
this.BindGrid();
@@ -66,6 +68,9 @@ namespace FineUIPro.Web.HSSE.InformationProject
+ @"report.ProjectId,"
+ @"report.UnitId,"
+ @"report.YearId,"
+ @"report.Quarter,"
+ @"ConstY.ConstText as YearStr,"
+ @"ConstQ.ConstText as QuarterStr,"
+ @"report.ResponsiblePerson,"
+ @"report.ResponsiblePersonTel,"
+ @"report.ContactPerson,"
@@ -82,6 +87,8 @@ namespace FineUIPro.Web.HSSE.InformationProject
+ @"report.Description9,"
+ @"Unit.UnitName "
+ @" FROM InformationProject_EPSummaryReport AS report "
+ @" LEFT JOIN Sys_Const AS ConstY ON ConstY.ConstValue = report.YearId and ConstY.GroupId='0008' "
+ @" LEFT JOIN Sys_Const AS ConstQ ON ConstQ.ConstValue = report.Quarter and ConstQ.GroupId='0011' "
+ @" LEFT JOIN Base_Unit AS Unit ON Unit.UnitId = report.UnitId WHERE 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
@@ -91,6 +98,11 @@ namespace FineUIPro.Web.HSSE.InformationProject
strSql += " AND report.YearId = @Year";
listStr.Add(new SqlParameter("@Year", Funs.GetNewInt(this.drpYear.SelectedValue)));
}
if (this.drpQuarters.SelectedValue != BLL.Const._Null)
{
strSql += " AND report.Quarter = @Quarter";
listStr.Add(new SqlParameter("@Quarter", Funs.GetNewInt(this.drpQuarters.SelectedValue)));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
@@ -66,6 +66,15 @@ namespace FineUIPro.Web.HSSE.InformationProject {
/// </remarks>
protected global::FineUIPro.DropDownList drpYear;
/// <summary>
/// drpQuarters 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpQuarters;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
@@ -18,6 +18,8 @@
<Items>
<f:DropDownList ID="ddlYearId" runat="server" Label="年度" Required="True" ShowRedStar="True">
</f:DropDownList>
<f:DropDownList ID="ddlQuarter" runat="server" Label="季度" Required="True" ShowRedStar="True">
</f:DropDownList>
<f:DatePicker ID="txtReportDate" runat="server" Label="报告时间" Required="true" ShowRedStar="true"></f:DatePicker>
</Items>
</f:FormRow>
@@ -59,7 +59,7 @@ namespace FineUIPro.Web.HSSE.InformationProject
this.ProjectId = Request.Params["projectId"];
}
BLL.ConstValue.InitConstValueDropDownList(this.ddlYearId, BLL.ConstValue.Group_0008, true);
BLL.ConstValue.InitConstValueDropDownList(this.ddlQuarter, BLL.ConstValue.Group_0011, true);
this.EPSummaryReportId = Request.Params["EPSummaryReportId"];
if (!string.IsNullOrEmpty(this.EPSummaryReportId))
{
@@ -71,6 +71,10 @@ namespace FineUIPro.Web.HSSE.InformationProject
if (report.YearId != null)
{
this.ddlYearId.SelectedValue = report.YearId.ToString();
if (report.Quarter.HasValue)
{
this.ddlQuarter.SelectedValue = report.Quarter.ToString();
}
this.txtReportDate.Text = report.ReportDate.HasValue ? string.Format("{0:yyyy-MM-dd}", report.ReportDate) : "";
this.txtResponsiblePerson.Text = report.ResponsiblePerson;
this.txtResponsiblePersonTel.Text = report.ResponsiblePersonTel;
@@ -91,7 +95,9 @@ namespace FineUIPro.Web.HSSE.InformationProject
}
else
{
DateTime showDate = DateTime.Now.AddMonths(-3);
this.ddlYearId.SelectedValue = DateTime.Now.Year.ToString();
this.ddlQuarter.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString();
this.txtReportDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
}
}
@@ -124,13 +130,16 @@ namespace FineUIPro.Web.HSSE.InformationProject
Model.InformationProject_EPSummaryReport report = new Model.InformationProject_EPSummaryReport
{
ProjectId = this.ProjectId,
UnitId = string.IsNullOrEmpty(this.CurrUser.UnitId) ? Const.UnitId_SEDIN : this.CurrUser.UnitId,
UnitId = string.IsNullOrEmpty(this.CurrUser.UnitId) ? BLL.Const.UnitId_SEDIN : this.CurrUser.UnitId,
};
if (this.ddlYearId.SelectedValue != BLL.Const._Null)
{
report.YearId = Funs.GetNewIntOrZero(this.ddlYearId.SelectedValue);
}
if (this.ddlQuarter.SelectedValue != BLL.Const._Null)
{
report.Quarter = Funs.GetNewIntOrZero(this.ddlQuarter.SelectedValue);
}
report.ResponsiblePerson = this.txtResponsiblePerson.Text.Trim();
report.ResponsiblePersonTel = this.txtResponsiblePersonTel.Text.Trim();
report.ContactPerson = this.txtContactPerson.Text.Trim();
@@ -154,8 +163,8 @@ namespace FineUIPro.Web.HSSE.InformationProject
else
{
Model.InformationProject_EPSummaryReport oldReport = (from x in Funs.DB.InformationProject_EPSummaryReport
where x.ProjectId == report.ProjectId && x.YearId == report.YearId
select x).FirstOrDefault();
where x.ProjectId == report.ProjectId && x.YearId == report.YearId && x.Quarter == report.Quarter
select x).FirstOrDefault();
if (oldReport == null)
{
this.EPSummaryReportId = SQLHelper.GetNewID(typeof(Model.InformationProject_EPSummaryReport));
@@ -166,7 +175,7 @@ namespace FineUIPro.Web.HSSE.InformationProject
}
else
{
Alert.ShowInTop("该度记录已存在", MessageBoxIcon.Warning);
Alert.ShowInTop("该度记录已存在", MessageBoxIcon.Warning);
return;
}
}
@@ -48,6 +48,15 @@ namespace FineUIPro.Web.HSSE.InformationProject {
/// </remarks>
protected global::FineUIPro.DropDownList ddlYearId;
/// <summary>
/// ddlQuarter 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlQuarter;
/// <summary>
/// txtReportDate 控件。
/// </summary>
@@ -1,6 +1,9 @@
using BLL;
using FineUIPro.Web.DataShow;
using Model;
using System;
using System.Linq;
using System.Runtime.InteropServices.ComTypes;
using System.Text;
using AspNet = System.Web.UI.WebControls;
@@ -327,15 +330,48 @@ namespace FineUIPro.Web.HSSE.SitePerson
protected void btnInRealName_Click(object sender, EventArgs e)
{
foreach (var item in Grid1.Rows)
int count = 0;
IQueryable<Model.SitePerson_PersonInOut> getDataList = Funs.DB.SitePerson_PersonInOut.Where(x => x.ProjectId == this.CurrUser.LoginProjectId);
if (this.rbInOutWay.SelectedValue != "0")
{
var getInOut = Funs.DB.SitePerson_PersonInOut.FirstOrDefault(x => x.PersonInOutId == item.RowID);
getDataList = getDataList.Where(x => x.InOutWay == this.rbInOutWay.SelectedValue);
}
if (!string.IsNullOrEmpty(this.drpUnit.SelectedValue) && this.drpUnit.SelectedValue != Const._Null)
{
getDataList = getDataList.Where(x => x.UnitId == this.drpUnit.SelectedValue);
}
if (!string.IsNullOrEmpty(this.txtPersonName.Text))
{
getDataList = getDataList.Where(x => x.PersonName.Contains(this.txtPersonName.Text.Trim()));
}
if (!string.IsNullOrEmpty(this.txtIdCard.Text))
{
getDataList = getDataList.Where(x => x.IdentityCard.Contains(this.txtIdCard.Text.Trim()));
}
DateTime? startDate = Funs.GetNewDateTime(this.txtStartDate.Text);
DateTime? endDate = Funs.GetNewDateTime(this.txtEndDate.Text);
if (startDate.HasValue)
{
getDataList = getDataList.Where(x => x.ChangeTime >= startDate);
}
if (endDate.HasValue)
{
getDataList = getDataList.Where(x => x.ChangeTime <= endDate);
}
foreach (var item in getDataList)
{
var getInOut = Funs.DB.SitePerson_PersonInOut.FirstOrDefault(x => x.PersonInOutId == item.PersonInOutId);
if (getInOut != null)
{
getInOut.PersonInOutId = SQLHelper.GetNewID();
item.PersonInOutId = SQLHelper.GetNewID();
PersonInOutService.InsertPersonInOutNowNow(getInOut);
count++;
}
}
Alert.ShowInTop("写入考勤" + count.ToString() + "条。", MessageBoxIcon.Success);
}
}
}