diff --git a/DataBase/版本日志/SGGLDB_V2023-07-25.sql b/DataBase/版本日志/SGGLDB_V2023-07-25.sql new file mode 100644 index 00000000..97a8e7a0 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-07-25.sql @@ -0,0 +1,27 @@ +alter table [dbo].[WBS_WorkPackage] add PreJobId nvarchar(50) null +GO +alter table [dbo].[WBS_WorkPackage] add PlanProjectQuantity decimal(18,2) null +GO +alter table [dbo].[WBS_WorkPackage] add RealProjectQuantity decimal(18,2) null +GO +alter table [dbo].[WBS_WorkPackage] add PlanStartDate datetime null +GO +alter table [dbo].[WBS_WorkPackage] add PlanEndDate datetime null +GO +alter table [dbo].[WBS_WorkPackage] add RealStartDate datetime null +GO +alter table [dbo].[WBS_WorkPackage] add RealEndDate datetime null +GO +alter table [dbo].[WBS_WorkPackage] add Unit nvarchar(50) null +GO +alter table [dbo].[WBS_WorkPackage] add IsMileStone bit null +GO + +alter table [dbo].[WBS_UnitWork] add PlanStartDate datetime null +GO +alter table [dbo].[WBS_UnitWork] add PlanEndDate datetime null +GO +alter table [dbo].[WBS_UnitWork] add RealStartDate datetime null +GO +alter table [dbo].[WBS_UnitWork] add RealEndDate datetime null +GO \ No newline at end of file diff --git a/DataBase/菜单初始化脚本/1-4进度管理(Menu_JDGL).sql b/DataBase/菜单初始化脚本/1-4进度管理(Menu_JDGL).sql index 94d52f2c..02b777c5 100644 --- a/DataBase/菜单初始化脚本/1-4进度管理(Menu_JDGL).sql +++ b/DataBase/菜单初始化脚本/1-4进度管理(Menu_JDGL).sql @@ -1,55 +1,63 @@ ---delete from Sys_ButtonToMenu where MenuId in (select MenuId from Sys_Menu where MenuType='Menu_JDGL') ---go ---delete from Sys_Menu where MenuType='Menu_JDGL' ---go +delete from Sys_ButtonToMenu where MenuId in (select MenuId from Sys_Menu where MenuType='Menu_JDGL') +go +delete from Sys_Menu where MenuType='Menu_JDGL' +go --INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) --VALUES('6890E0DD-9606-41BC-8700-D32FA5B65B66','施工进度','',10,'0','Menu_JDGL',0,0,1) --GO -INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) -VALUES('BAC3D994-03A8-466C-8975-A31039998BCC','施工进度统计','JDGL/Check/ProgressShow.aspx',10,'0','Menu_JDGL',0,1,1) -GO +--INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +--VALUES('BAC3D994-03A8-466C-8975-A31039998BCC','施工进度统计','JDGL/Check/ProgressShow.aspx',10,'0','Menu_JDGL',0,1,1) +--GO + +--INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +--VALUES('1172B112-2A12-4410-AD66-E5BA6B461475','施工进度赢得值曲线','JDGL/Check/ProgressStatistics.aspx',20,'0','Menu_JDGL',0,1,1) +--GO + +--INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +--VALUES('4288426D-E49B-4E5D-A495-7E6A76F269B5','周计划','',30,'0','Menu_JDGL',0,1,1) +--GO +--INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +--VALUES('98E9B88C-5BB8-4673-9B6C-69B446E57C11','4288426D-E49B-4E5D-A495-7E6A76F269B5','增加',1) +--INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +--VALUES('B69119FC-F0AB-4C07-83FB-48D2CEF00C5F','4288426D-E49B-4E5D-A495-7E6A76F269B5','修改',2) +--INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +--VALUES('DC33D5E2-2C3B-4C9B-9887-1CF2EB2A3C7F','4288426D-E49B-4E5D-A495-7E6A76F269B5','删除',3) +--INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +--VALUES('CBF94555-B633-44CC-9919-3CE579D368CD','4288426D-E49B-4E5D-A495-7E6A76F269B5','保存',4) +--GO + +--INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +--VALUES('C75F0853-8A2B-4B32-83B7-509278D11957','项目里程碑节点','',40,'0','Menu_JDGL',0,1,1) +--GO +--INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +--VALUES('3BCA8C5D-C781-4BF7-90C5-1EE569D0F810','C75F0853-8A2B-4B32-83B7-509278D11957','增加',1) +--INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +--VALUES('1AC052E6-0FA0-45C4-A8AB-A8C71931DEC6','C75F0853-8A2B-4B32-83B7-509278D11957','修改',2) +--INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +--VALUES('08B9E2EB-2998-4225-A6E5-F51597608000','C75F0853-8A2B-4B32-83B7-509278D11957','删除',3) +--INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +--VALUES('FAF17C45-6D8A-4679-90A8-B8AF4F86EFB8','C75F0853-8A2B-4B32-83B7-509278D11957','保存',4) +--GO + +--INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +--VALUES('3550F422-E520-4962-9816-B691B0EE2865','形象进度照片','',50,'0','Menu_JDGL',0,1,1) +--GO +--INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +--VALUES('92792060-5ED8-4A87-A355-93728321D4E8','3550F422-E520-4962-9816-B691B0EE2865','增加',1) +--INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +--VALUES('6859B3C5-A8CF-48CF-8F7C-EA707ED5710A','3550F422-E520-4962-9816-B691B0EE2865','修改',2) +--INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +--VALUES('274A6E9E-193A-498F-ABD3-A78437C79C00','3550F422-E520-4962-9816-B691B0EE2865','删除',3) +--INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +--VALUES('947CD34B-57C0-40EE-9773-53A75925D9AD','3550F422-E520-4962-9816-B691B0EE2865','保存',4) +--GO INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) -VALUES('1172B112-2A12-4410-AD66-E5BA6B461475','施工进度赢得值曲线','JDGL/Check/ProgressStatistics.aspx',20,'0','Menu_JDGL',0,1,1) +VALUES('E23F0879-3E9F-4E7B-9A2D-EFF34798D629','进度计划设置','JDGL/Check/PlanSet.aspx',10,'0','Menu_JDGL',0,1,1) +GO +INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +VALUES('F5055103-6182-43E0-93EC-7DD7BEF2B71C','E23F0879-3E9F-4E7B-9A2D-EFF34798D629','保存',4) GO -INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) -VALUES('4288426D-E49B-4E5D-A495-7E6A76F269B5','周计划','',30,'0','Menu_JDGL',0,1,1) -GO -INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) -VALUES('98E9B88C-5BB8-4673-9B6C-69B446E57C11','4288426D-E49B-4E5D-A495-7E6A76F269B5','增加',1) -INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) -VALUES('B69119FC-F0AB-4C07-83FB-48D2CEF00C5F','4288426D-E49B-4E5D-A495-7E6A76F269B5','修改',2) -INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) -VALUES('DC33D5E2-2C3B-4C9B-9887-1CF2EB2A3C7F','4288426D-E49B-4E5D-A495-7E6A76F269B5','删除',3) -INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) -VALUES('CBF94555-B633-44CC-9919-3CE579D368CD','4288426D-E49B-4E5D-A495-7E6A76F269B5','保存',4) -GO - -INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) -VALUES('C75F0853-8A2B-4B32-83B7-509278D11957','项目里程碑节点','',40,'0','Menu_JDGL',0,1,1) -GO -INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) -VALUES('3BCA8C5D-C781-4BF7-90C5-1EE569D0F810','C75F0853-8A2B-4B32-83B7-509278D11957','增加',1) -INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) -VALUES('1AC052E6-0FA0-45C4-A8AB-A8C71931DEC6','C75F0853-8A2B-4B32-83B7-509278D11957','修改',2) -INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) -VALUES('08B9E2EB-2998-4225-A6E5-F51597608000','C75F0853-8A2B-4B32-83B7-509278D11957','删除',3) -INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) -VALUES('FAF17C45-6D8A-4679-90A8-B8AF4F86EFB8','C75F0853-8A2B-4B32-83B7-509278D11957','保存',4) -GO - -INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) -VALUES('3550F422-E520-4962-9816-B691B0EE2865','形象进度照片','',50,'0','Menu_JDGL',0,1,1) -GO -INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) -VALUES('92792060-5ED8-4A87-A355-93728321D4E8','3550F422-E520-4962-9816-B691B0EE2865','增加',1) -INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) -VALUES('6859B3C5-A8CF-48CF-8F7C-EA707ED5710A','3550F422-E520-4962-9816-B691B0EE2865','修改',2) -INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) -VALUES('274A6E9E-193A-498F-ABD3-A78437C79C00','3550F422-E520-4962-9816-B691B0EE2865','删除',3) -INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) -VALUES('947CD34B-57C0-40EE-9773-53A75925D9AD','3550F422-E520-4962-9816-B691B0EE2865','保存',4) -GO \ No newline at end of file diff --git a/SGGL/BLL/CQMS/WBS/WorkPackageService.cs b/SGGL/BLL/CQMS/WBS/WorkPackageService.cs index f82496c3..644354cb 100644 --- a/SGGL/BLL/CQMS/WBS/WorkPackageService.cs +++ b/SGGL/BLL/CQMS/WBS/WorkPackageService.cs @@ -1,4 +1,6 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; +using System.Data; using System.Linq; namespace BLL @@ -30,6 +32,14 @@ namespace BLL newWorkPackage.IsApprove = WorkPackage.IsApprove; newWorkPackage.Costs = WorkPackage.Costs; newWorkPackage.SubItemType = WorkPackage.SubItemType; + newWorkPackage.PreJobId = WorkPackage.PreJobId; + newWorkPackage.PlanProjectQuantity = WorkPackage.PlanProjectQuantity; + newWorkPackage.RealProjectQuantity = WorkPackage.RealProjectQuantity; + newWorkPackage.PlanStartDate = WorkPackage.PlanStartDate; + newWorkPackage.PlanEndDate = WorkPackage.PlanEndDate; + newWorkPackage.RealStartDate = WorkPackage.RealStartDate; + newWorkPackage.RealEndDate = WorkPackage.RealEndDate; + newWorkPackage.Unit = WorkPackage.Unit; db.WBS_WorkPackage.InsertOnSubmit(newWorkPackage); db.SubmitChanges(); @@ -54,6 +64,15 @@ namespace BLL newWorkPackage.IsApprove = WorkPackage.IsApprove; newWorkPackage.Costs = WorkPackage.Costs; newWorkPackage.SubItemType = WorkPackage.SubItemType; + newWorkPackage.PreJobId = WorkPackage.PreJobId; + newWorkPackage.PlanProjectQuantity = WorkPackage.PlanProjectQuantity; + newWorkPackage.RealProjectQuantity = WorkPackage.RealProjectQuantity; + newWorkPackage.PlanStartDate = WorkPackage.PlanStartDate; + newWorkPackage.PlanEndDate = WorkPackage.PlanEndDate; + newWorkPackage.RealStartDate = WorkPackage.RealStartDate; + newWorkPackage.RealEndDate = WorkPackage.RealEndDate; + newWorkPackage.Unit = WorkPackage.Unit; + newWorkPackage.IsMileStone = WorkPackage.IsMileStone; db.SubmitChanges(); } @@ -218,5 +237,136 @@ namespace BLL Funs.FineUIPleaseSelect(dropName); } } + + /// + /// 获取模拟树表格 + /// + /// + public static DataTable GetAllTreeDataTable(string projectId) + { + using (var db = new Model.SGGLDB(Funs.ConnString)) + { + IQueryable workPackages = from x in db.WBS_WorkPackage where x.ProjectId == projectId select x; + IQueryable unitWorks = from x in db.WBS_UnitWork where x.ProjectId == projectId select x; + List getWBSs = (from x in db.View_WBS where x.ProjectId == projectId select x).ToList(); + List WBSList = new List(); + DataTable table = new DataTable(); + table.Columns.Add(new DataColumn("Id", typeof(String))); + table.Columns.Add(new DataColumn("SupId", typeof(String))); + table.Columns.Add(new DataColumn("Name", typeof(String))); + table.Columns.Add(new DataColumn("WBSType", typeof(String))); + table.Columns.Add(new DataColumn("ProjectId", typeof(String))); + table.Columns.Add(new DataColumn("ShowId", typeof(String))); + table.Columns.Add(new DataColumn("Weights", typeof(String))); + table.Columns.Add(new DataColumn("Unit", typeof(String))); + table.Columns.Add(new DataColumn("PlanProjectQuantity", typeof(String))); + table.Columns.Add(new DataColumn("RealProjectQuantity", typeof(String))); + table.Columns.Add(new DataColumn("PlanStartDate", typeof(DateTime))); + table.Columns.Add(new DataColumn("PlanEndDate", typeof(DateTime))); + table.Columns.Add(new DataColumn("RealStartDate", typeof(DateTime))); + table.Columns.Add(new DataColumn("RealEndDate", typeof(DateTime))); + table.Columns.Add(new DataColumn("IsMileStone", typeof(bool))); + if (getWBSs.Count() > 0) + { + List newList = new List(); + var projectTypes = getWBSs.Where(x => x.WBSType == "ProjectType" && x.SupId == "0"); + foreach (var item in projectTypes) + { + newList.Add(item); + AddDetail(newList, getWBSs.ToList(), item.Id); + } + DataRow row; + foreach (Model.View_WBS item in newList) + { + row = table.NewRow(); + row[0] = item.Id; + row[1] = item.SupId; + row[2] = item.Name; + row[3] = item.WBSType; + row[4] = item.ProjectId; + if (item.WBSType == "WorkPackage") + { + var childWorkPackages = from x in workPackages where x.SuperWorkPackageId == item.Id && x.IsApprove == true select x; + if (childWorkPackages.Count() == 0) + { + row[5] = item.Id; + var workPackage = workPackages.FirstOrDefault(x => x.WorkPackageId == item.Id); + if (workPackage != null) + { + if (workPackage.Weights != null) + { + row[6] = decimal.Round(Convert.ToDecimal(workPackage.Weights), 2); + } + row[7] = workPackage.Unit; + if (workPackage.PlanProjectQuantity != null) + { + row[8] = decimal.Round(Convert.ToDecimal(workPackage.PlanProjectQuantity), 2); + } + if (workPackage.RealProjectQuantity != null) + { + row[9] = decimal.Round(Convert.ToDecimal(workPackage.RealProjectQuantity), 2); + } + if (workPackage.PlanStartDate != null) + { + row[10] = workPackage.PlanStartDate; + } + if (workPackage.PlanEndDate != null) + { + row[11] = workPackage.PlanEndDate; + } + if (workPackage.RealStartDate != null) + { + row[12] = workPackage.RealStartDate; + } + if (workPackage.RealEndDate != null) + { + row[13] = workPackage.RealEndDate; + } + if (workPackage.IsMileStone != null) + { + row[14] = workPackage.IsMileStone; + } + } + } + } + else if (item.WBSType == "UnitWork") + { + var unitWork = unitWorks.FirstOrDefault(x => x.UnitWorkId == item.Id); + if (unitWork != null) + { + if (unitWork.PlanStartDate != null) + { + row[10] = unitWork.PlanStartDate; + } + if (unitWork.PlanEndDate != null) + { + row[11] = unitWork.PlanEndDate; + } + if (unitWork.RealStartDate != null) + { + row[12] = unitWork.RealStartDate; + } + if (unitWork.RealEndDate != null) + { + row[13] = unitWork.RealEndDate; + } + } + } + table.Rows.Add(row); + } + } + return table; + } + } + + private static void AddDetail(List newList, List oldList, string id) + { + var items = oldList.Where(x => x.SupId == id).OrderBy(x => x.Code); + foreach (var item in items) + { + newList.Add(item); + AddDetail(newList, oldList, item.Id); + } + } } } diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index b8934340..e5b1a509 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -4452,6 +4452,13 @@ #endregion + #region 进度 + /// + /// 项目施工WBS定制 + /// + public const string PlanSetMenuId = "E23F0879-3E9F-4E7B-9A2D-EFF34798D629"; + #endregion + #region 施工综合 #region 菜单Id /// diff --git a/SGGL/BLL/ProjectData/UnitWorkService.cs b/SGGL/BLL/ProjectData/UnitWorkService.cs index adde94de..92425604 100644 --- a/SGGL/BLL/ProjectData/UnitWorkService.cs +++ b/SGGL/BLL/ProjectData/UnitWorkService.cs @@ -58,6 +58,10 @@ namespace BLL newUnitWork.NDEUnit = UnitWork.NDEUnit; newUnitWork.Costs = UnitWork.Costs; newUnitWork.MainItemAndDesignProfessionalIds = UnitWork.MainItemAndDesignProfessionalIds; + newUnitWork.PlanStartDate = UnitWork.PlanStartDate; + newUnitWork.PlanEndDate = UnitWork.PlanEndDate; + newUnitWork.RealStartDate = UnitWork.RealStartDate; + newUnitWork.RealEndDate = UnitWork.RealEndDate; db.SubmitChanges(); } GetWeights(UnitWork.ProjectId); diff --git a/SGGL/FineUIPro.Web/File/Word/ZHGL/项目安全生产策划书评审表.doc b/SGGL/FineUIPro.Web/File/Word/ZHGL/项目安全生产策划书评审表.doc index c0a689c3..64393096 100644 --- a/SGGL/FineUIPro.Web/File/Word/ZHGL/项目安全生产策划书评审表.doc +++ b/SGGL/FineUIPro.Web/File/Word/ZHGL/项目安全生产策划书评审表.doc @@ -1,12 +1,3 @@ -ࡱ>  - Root Entry FaoSummaryInformation(DocumentSummaryInformation8WordDocument7 -  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqr -Oh+'0 px |phf Normal.dotmApril0@@@n  =WPS Office_11.1.0.14309_F1E327BC-269C-435d-A152-05C5408002CA -՜.+,D՜.+,HPX`h px 0t|KSOProductBuildVerICV2052-11.1.0.14309$2EBE727FC3BF4B18982EC9932273FC11_120TableIf -Data -WpsCustomData P KSKS7  ?  d -$-h<* 0 yv[hQuNV{RfNċ[h  ï&CJOJQJo(aJ5mH sH nHtH&CJOJQJo(aJ5mH sH nHtH&CJOJQJo(aJ5mH sH nHtH&CJOJQJo(aJ5mH sH nHtH dha$$dha$$dha$$5 0. A!#"$%S2P0p18&66666666 0@P`p6666 0@P`p 0@P`p 0@P`p 0@P`p 0@P`p 0@P`pZ@Zcke a$$1$0CJOJPJQJ^JaJKHmH sH nHtH_H$A@$؞k=W[SONi@Nnfh + @@ -11502,6 +11503,13 @@ index.aspx + + PlanSet.aspx + ASPXCodeBehind + + + PlanSet.aspx + ProgressShow.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/HSSE/ActionPlan/ActionPlanList.aspx.cs b/SGGL/FineUIPro.Web/HSSE/ActionPlan/ActionPlanList.aspx.cs index f4189c52..307a7d79 100644 --- a/SGGL/FineUIPro.Web/HSSE/ActionPlan/ActionPlanList.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/ActionPlan/ActionPlanList.aspx.cs @@ -410,58 +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; @@ -476,7 +477,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 = 130; + builder.CellFormat.Width = 300; builder.Font.Bold = false; var getCompileMan = Person_PersonsService.GetPerson_PersonsById(actionPlanList.CompileMan); if (!string.IsNullOrEmpty(getCompileMan.SignatureUrl) && File.Exists(rootPath + getCompileMan.SignatureUrl)) @@ -517,7 +518,7 @@ namespace FineUIPro.Web.HSSE.ActionPlan //判断是不是最后一个 if (ActionPlan_ActionPlanListApproveList.Count == i + 1) { - builder.CellFormat.Width = 40; + builder.CellFormat.Width = 150; builder.Font.Bold = false; if (!string.IsNullOrEmpty(getApproveMan.SignatureUrl) && File.Exists(rootPath + getApproveMan.SignatureUrl)) { @@ -534,12 +535,12 @@ 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 = 90; + builder.CellFormat.Width = 150; builder.Write(""); } else { - builder.CellFormat.Width = 40; + builder.CellFormat.Width = 150; builder.Font.Bold = false; if (!string.IsNullOrEmpty(getApproveMan.SignatureUrl) && File.Exists(rootPath + getApproveMan.SignatureUrl)) { @@ -561,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("项目部审核人"); @@ -570,7 +571,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 = 20; + builder.CellFormat.Width = 50; var getApproveMan2 = Person_PersonsService.GetPerson_PersonsById(ActionPlan_ActionPlanListApproveList[i + 1].ApproveMan); builder.Font.Bold = false; if (!string.IsNullOrEmpty(getApproveMan2.SignatureUrl) && File.Exists(rootPath + getApproveMan2.SignatureUrl)) @@ -608,7 +609,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(); @@ -618,7 +619,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("评审部门"); @@ -627,7 +628,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("评审意见"); @@ -636,7 +637,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 = 150; builder.Font.Bold = true; builder.Write("评审部门负责人/日期"); builder.EndRow(); @@ -649,7 +650,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 = false; builder.Write("施工管理部"); //评审意见 @@ -658,7 +659,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 = false; if (!string.IsNullOrEmpty(item.ApproveIdea)) { @@ -676,7 +677,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 = 150; builder.Font.Bold = false; if (item.ApproveDate != null) { @@ -706,7 +707,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; var departModel = db.Base_Depart.FirstOrDefault(x => x.DepartId == item.DepartId); builder.Font.Bold = false; if (departModel != null) @@ -719,7 +720,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 = false; if (!string.IsNullOrEmpty(item.ApproveIdea)) { @@ -737,7 +738,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 = 150; builder.Font.Bold = false; if (item.ApproveDate != null) { @@ -777,13 +778,13 @@ 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; builder.Write("公司安全总监/部门负责人:"); - builder.Write(" 年"); + builder.Write(" 年"); builder.Write(" 月"); - builder.Write(" 日"); + builder.Write(" 日"); builder.EndRow(); builder.InsertCell(); @@ -793,20 +794,20 @@ 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; builder.Write("公司主管生产/安全领导:"); - builder.Write(" 年"); + builder.Write(" 年"); builder.Write(" 月"); - builder.Write(" 日"); + builder.Write(" 日"); builder.EndRow(); builder.Font.Bold = false; @@ -816,17 +817,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) { diff --git a/SGGL/FineUIPro.Web/JDGL/Check/PlanSet.aspx b/SGGL/FineUIPro.Web/JDGL/Check/PlanSet.aspx new file mode 100644 index 00000000..108e4e79 --- /dev/null +++ b/SGGL/FineUIPro.Web/JDGL/Check/PlanSet.aspx @@ -0,0 +1,130 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PlanSet.aspx.cs" Inherits="FineUIPro.Web.JDGL.Check.PlanSet" %> + + + + + +进度计划设置 + + + +
+ + + + + + + + + + + + + + + + <%----%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/JDGL/Check/PlanSet.aspx.cs b/SGGL/FineUIPro.Web/JDGL/Check/PlanSet.aspx.cs new file mode 100644 index 00000000..9d34cda5 --- /dev/null +++ b/SGGL/FineUIPro.Web/JDGL/Check/PlanSet.aspx.cs @@ -0,0 +1,387 @@ +using BLL; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.JDGL.Check +{ + public partial class PlanSet : PageBase + { + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindGrid(); + } + } + #endregion + + private void BindGrid() + { + DataTable table = BLL.WorkPackageService.GetAllTreeDataTable(this.CurrUser.LoginProjectId); + Grid1.DataSource = table; + Grid1.DataBind(); + for (int i = 0; i < this.Grid1.Rows.Count; i++) + { + if (string.IsNullOrEmpty(this.Grid1.Rows[i].DataKeys[2].ToString())) + { + System.Web.UI.WebControls.CheckBox cbIsMileStone = (System.Web.UI.WebControls.CheckBox)(this.Grid1.Rows[i].FindControl("cbIsMileStone")); + cbIsMileStone.Visible = false; + foreach (GridColumn column in Grid1.Columns) + { + if (column.ColumnIndex != 0) + { + this.Grid1.Rows[i].CellCssClasses[column.ColumnIndex] = "f-grid-cell-uneditable"; + } + } + } + else + { + System.Web.UI.WebControls.CheckBox cbIsMileStone = (System.Web.UI.WebControls.CheckBox)(this.Grid1.Rows[i].FindControl("cbIsMileStone")); + Model.WBS_WorkPackage workPackage = BLL.WorkPackageService.GetWorkPackageByWorkPackageId(this.Grid1.Rows[i].DataKeys[2].ToString()); + if (workPackage != null && workPackage.IsMileStone == true) + { + cbIsMileStone.Checked = true; + } + } + } + } + + #region 保存 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.PlanSetMenuId, BLL.Const.BtnSave)) + { + Save(); + BindGrid(); + ShowNotify("保存成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHideReference()); + } + else + { + ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + } + } + + private void Save() + { + Model.SGGLDB db = Funs.DB; + var workPackages = from x in db.WBS_WorkPackage + where x.ProjectId == this.CurrUser.LoginProjectId + select x; + var unitWorks = from x in db.WBS_UnitWork + where x.ProjectId == this.CurrUser.LoginProjectId + select x; + string[] ids = this.hdId.Text.Split(','); + if (ids.Length > 0) + { + foreach (JObject mergedRow in Grid1.GetMergedData()) + { + JObject values = mergedRow.Value("values"); + int i = mergedRow.Value("index"); + if (this.Grid1.Rows[i].DataKeys[2] != null) + { + Model.WBS_WorkPackage workPackage = workPackages.FirstOrDefault(x => x.WorkPackageId == this.Grid1.Rows[i].DataKeys[2].ToString()); + if (workPackage != null) + { + string weights = values.Value("Weights"); + string unit = values.Value("Unit"); + string planProjectQuantity = values.Value("PlanProjectQuantity"); + string realProjectQuantity = values.Value("RealProjectQuantity"); + string planStartDate = values.Value("PlanStartDate"); + string planEndDate = values.Value("PlanEndDate"); + string realStartDate = values.Value("RealStartDate"); + string realEndDate = values.Value("RealEndDate"); + System.Web.UI.WebControls.CheckBox cbIsMileStone = (System.Web.UI.WebControls.CheckBox)(this.Grid1.Rows[i].FindControl("cbIsMileStone")); + workPackage.Weights = Funs.GetNewDecimal(weights); + workPackage.Unit = unit; + workPackage.PlanProjectQuantity = Funs.GetNewDecimal(planProjectQuantity); + workPackage.RealProjectQuantity = Funs.GetNewDecimal(realProjectQuantity); + workPackage.PlanStartDate = Funs.GetNewDateTime(planStartDate); + workPackage.PlanEndDate = Funs.GetNewDateTime(planEndDate); + workPackage.RealStartDate = Funs.GetNewDateTime(realStartDate); + workPackage.RealEndDate = Funs.GetNewDateTime(realEndDate); + workPackage.IsMileStone = cbIsMileStone.Checked; + BLL.WorkPackageService.UpdateWorkPackage(workPackage); + if (workPackage.PlanStartDate != null || workPackage.PlanEndDate != null || workPackage.RealStartDate != null || workPackage.RealEndDate != null) + { + UpdateWorkPackages(db, workPackage, workPackage.PlanStartDate, workPackage.PlanEndDate, workPackage.RealStartDate, workPackage.RealEndDate); + var unitWork = unitWorks.FirstOrDefault(x => x.UnitWorkId == workPackage.UnitWorkId); + if (workPackage.PlanStartDate != null) + { + if (unitWork.PlanStartDate == null) + { + unitWork.PlanStartDate = workPackage.PlanStartDate; + } + else + { + if (unitWork.PlanStartDate > workPackage.PlanStartDate) + { + unitWork.PlanStartDate = workPackage.PlanStartDate; + } + } + } + if (workPackage.PlanEndDate != null) + { + if (unitWork.PlanEndDate == null) + { + unitWork.PlanEndDate = workPackage.PlanEndDate; + } + else + { + if (unitWork.PlanEndDate < workPackage.PlanEndDate) + { + unitWork.PlanEndDate = workPackage.PlanEndDate; + } + } + } + if (workPackage.RealStartDate != null) + { + if (unitWork.RealStartDate == null) + { + unitWork.RealStartDate = workPackage.RealStartDate; + } + else + { + if (unitWork.RealStartDate > workPackage.RealStartDate) + { + unitWork.RealStartDate = workPackage.RealStartDate; + } + } + } + if (workPackage.RealEndDate != null) + { + if (unitWork.RealEndDate == null) + { + unitWork.RealEndDate = workPackage.RealEndDate; + } + else + { + if (unitWork.RealEndDate < workPackage.RealEndDate) + { + unitWork.RealEndDate = workPackage.RealEndDate; + } + } + } + } + db.SubmitChanges(); + } + } + } + } + } + + #region 更新工作包、工作项 + /// + /// 更新月工作包、工作项 + /// + /// + /// + /// + /// + private void UpdateWorkPackages(Model.SGGLDB db, Model.WBS_WorkPackage workPackage, DateTime? planStartDate, DateTime? planEndDate, DateTime? realStartDate, DateTime? realEndDate) + { + if (workPackage != null) + { + Model.WBS_WorkPackage parentWorkPackage = BLL.WorkPackageService.GetWorkPackageByWorkPackageId(workPackage.SuperWorkPackageId); + if (parentWorkPackage != null) + { + if (planStartDate != null) + { + if (parentWorkPackage.PlanStartDate == null) + { + parentWorkPackage.PlanStartDate = planStartDate; + } + else + { + if (parentWorkPackage.PlanStartDate > planStartDate) + { + parentWorkPackage.PlanStartDate = planStartDate; + } + } + } + if (planEndDate != null) + { + if (parentWorkPackage.PlanEndDate == null) + { + parentWorkPackage.PlanEndDate = planEndDate; + } + else + { + if (parentWorkPackage.PlanEndDate < planEndDate) + { + parentWorkPackage.PlanEndDate = planEndDate; + } + } + } + if (realStartDate != null) + { + if (parentWorkPackage.RealStartDate == null) + { + parentWorkPackage.RealStartDate = realStartDate; + } + else + { + if (parentWorkPackage.RealStartDate > realStartDate) + { + parentWorkPackage.RealStartDate = realStartDate; + } + } + } + if (realEndDate != null) + { + if (parentWorkPackage.RealEndDate == null) + { + parentWorkPackage.RealEndDate = realEndDate; + } + else + { + if (parentWorkPackage.RealEndDate < realEndDate) + { + parentWorkPackage.RealEndDate = realEndDate; + } + } + } + UpdateWorkPackages(db, parentWorkPackage, planStartDate, planEndDate, realStartDate, realEndDate); + } + } + } + + /// + /// 更新周工作包、工作项 + /// + /// + /// + /// + /// + private void UpdateWeekWbsSetDetail(string wbsSetId, DateTime months, DateTime startDate, DateTime endDate, decimal changeThisPlanValue, decimal changeThisRealCost, decimal changeThisPlanCost) + { + //Model.Wbs_WbsSet wbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(wbsSetId); + //if (wbsSet != null) + //{ + // Model.WBS_CostControlParentDetail parentDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonthsWeek(wbsSetId, months, startDate); + // if (parentDetail != null) + // { + // parentDetail.ThisPlanValue += changeThisPlanValue; + // parentDetail.ThisRealCost += changeThisRealCost; + // parentDetail.ThisPlanCost += changeThisPlanCost; + // BLL.CostControlParentDetailService.UpdateCostControlParentDetail(parentDetail); + // } + // else + // { + // parentDetail = new Model.WBS_CostControlParentDetail(); + // parentDetail.CostControlParentDetailId = SQLHelper.GetNewID(); + // parentDetail.ParentId = wbsSetId; + // parentDetail.Months = months; + // parentDetail.StartDate = startDate; + // parentDetail.EndDate = endDate; + // parentDetail.ThisPlanValue = changeThisPlanValue; + // parentDetail.ThisRealCost = changeThisRealCost; + // parentDetail.ThisPlanCost = changeThisPlanCost; + // BLL.CostControlParentDetailService.AddCostControlParentDetail(parentDetail); + // } + // if (wbsSet.SuperWbsSetId != null) //还存在上级节点,需要继续循环 + // { + // UpdateWeekWbsSetDetail(wbsSet.SuperWbsSetId, months, startDate, endDate, changeThisPlanValue, changeThisRealCost, changeThisPlanCost); + // } + //} + } + #endregion + + #region 更新装置 + /// + /// 更新月装置 + /// + /// + /// + /// + /// + private void UpdateInstallationDetail(Model.SGGLDB db, string installationId, DateTime months, decimal changeThisPlanValue, decimal changeThisRealCost, decimal changeThisPlanCost) + { + //Model.Project_Installation installation = BLL.Project_InstallationService.GetInstallationByInstallationId(installationId); + //if (installation != null) + //{ + // Model.WBS_CostControlParentDetail parentDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonths(installationId, months); + // if (parentDetail != null) + // { + // parentDetail.ThisPlanValue += changeThisPlanValue; + // parentDetail.ThisRealCost += changeThisRealCost; + // parentDetail.ThisPlanCost += changeThisPlanCost; + // //BLL.CostControlParentDetailService.UpdateCostControlParentDetail(parentDetail); + // } + // else + // { + // parentDetail = new Model.WBS_CostControlParentDetail(); + // parentDetail.CostControlParentDetailId = SQLHelper.GetNewID(); + // parentDetail.ParentId = installationId; + // parentDetail.Months = months; + // parentDetail.ThisPlanValue = changeThisPlanValue; + // parentDetail.ThisRealCost = changeThisRealCost; + // parentDetail.ThisPlanCost = changeThisPlanCost; + // //BLL.CostControlParentDetailService.AddCostControlParentDetail(parentDetail); + // db.WBS_CostControlParentDetail.InsertOnSubmit(parentDetail); + // } + // if (installation.SuperInstallationId != null) //还存在上级节点,需要继续循环 + // { + // UpdateInstallationDetail(db, installation.SuperInstallationId, months, changeThisPlanValue, changeThisRealCost, changeThisPlanCost); + // } + //} + } + + /// + /// 更新周装置 + /// + /// + /// + /// + /// + private void UpdateWeekInstallationDetail(string installationId, DateTime months, DateTime startDate, DateTime endDate, decimal changeThisPlanValue, decimal changeThisRealCost, decimal changeThisPlanCost) + { + //Model.Project_Installation installation = BLL.Project_InstallationService.GetInstallationByInstallationId(installationId); + //if (installation != null) + //{ + // Model.WBS_CostControlParentDetail parentDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonths(installationId, months); + // if (parentDetail != null) + // { + // parentDetail.ThisPlanValue += changeThisPlanValue; + // parentDetail.ThisRealCost += changeThisRealCost; + // parentDetail.ThisPlanCost += changeThisPlanCost; + // BLL.CostControlParentDetailService.UpdateCostControlParentDetail(parentDetail); + // } + // else + // { + // parentDetail = new Model.WBS_CostControlParentDetail(); + // parentDetail.CostControlParentDetailId = SQLHelper.GetNewID(); + // parentDetail.ParentId = installationId; + // parentDetail.Months = months; + // parentDetail.StartDate = startDate; + // parentDetail.EndDate = endDate; + // parentDetail.ThisPlanValue = changeThisPlanValue; + // parentDetail.ThisRealCost = changeThisRealCost; + // parentDetail.ThisPlanCost = changeThisPlanCost; + // BLL.CostControlParentDetailService.AddCostControlParentDetail(parentDetail); + // } + // if (installation.SuperInstallationId != null) //还存在上级节点,需要继续循环 + // { + // UpdateWeekInstallationDetail(installation.SuperInstallationId, months, startDate, endDate, changeThisPlanValue, changeThisRealCost, changeThisPlanCost); + // } + //} + } + #endregion + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/JDGL/Check/PlanSet.aspx.designer.cs b/SGGL/FineUIPro.Web/JDGL/Check/PlanSet.aspx.designer.cs new file mode 100644 index 00000000..32e0bca6 --- /dev/null +++ b/SGGL/FineUIPro.Web/JDGL/Check/PlanSet.aspx.designer.cs @@ -0,0 +1,168 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.JDGL.Check { + + + public partial class PlanSet { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// hdId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox hdId; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// IsMileStone 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TemplateField IsMileStone; + + /// + /// cbIsMileStone 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.CheckBox cbIsMileStone; + + /// + /// nbWeights 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox nbWeights; + + /// + /// txtUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtUnit; + + /// + /// nbPlanProjectQuantity 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox nbPlanProjectQuantity; + + /// + /// nbRealProjectQuantity 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox nbRealProjectQuantity; + + /// + /// txtPlanStartDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtPlanStartDate; + + /// + /// txtPlanEndDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtPlanEndDate; + + /// + /// txtRealStartDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtRealStartDate; + + /// + /// txtRealEndDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtRealEndDate; + } +} diff --git a/SGGL/FineUIPro.Web/ZHGL/Plan/ActionPlanList.aspx b/SGGL/FineUIPro.Web/ZHGL/Plan/ActionPlanList.aspx index d94bfeb4..6f498392 100644 --- a/SGGL/FineUIPro.Web/ZHGL/Plan/ActionPlanList.aspx +++ b/SGGL/FineUIPro.Web/ZHGL/Plan/ActionPlanList.aspx @@ -143,4 +143,4 @@ } - + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ZHGL/Plan/ActionPlanList.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Plan/ActionPlanList.aspx.cs index 1e997fe1..a2920c36 100644 --- a/SGGL/FineUIPro.Web/ZHGL/Plan/ActionPlanList.aspx.cs +++ b/SGGL/FineUIPro.Web/ZHGL/Plan/ActionPlanList.aspx.cs @@ -398,56 +398,53 @@ namespace FineUIPro.Web.ZHGL.Plan } 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; @@ -462,7 +459,7 @@ 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;//水平居中对齐 - builder.CellFormat.Width = 130; + builder.CellFormat.Width = 300; builder.Font.Bold = false; var getCompileMan = Person_PersonsService.GetPerson_PersonsById(actionPlanList.CompileMan); if (!string.IsNullOrEmpty(getCompileMan.SignatureUrl) && File.Exists(rootPath + getCompileMan.SignatureUrl)) @@ -503,7 +500,7 @@ namespace FineUIPro.Web.ZHGL.Plan //判断是不是最后一个 if (ActionPlan_ActionPlanListApproveList.Count == i + 1) { - builder.CellFormat.Width = 40; + builder.CellFormat.Width = 150; builder.Font.Bold = false; if (!string.IsNullOrEmpty(getApproveMan.SignatureUrl) && File.Exists(rootPath + getApproveMan.SignatureUrl)) { @@ -520,12 +517,12 @@ 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;//水平居中对齐 - builder.CellFormat.Width = 90; + builder.CellFormat.Width = 150; builder.Write(""); } else { - builder.CellFormat.Width = 40; + builder.CellFormat.Width = 150; builder.Font.Bold = false; if (!string.IsNullOrEmpty(getApproveMan.SignatureUrl) && File.Exists(rootPath + getApproveMan.SignatureUrl)) { @@ -547,7 +544,7 @@ 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;//水平居中对齐 - builder.CellFormat.Width = 70; + builder.CellFormat.Width = 100; builder.Font.Bold = true; builder.Write("项目部审核人"); @@ -556,7 +553,7 @@ 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;//水平居中对齐 - builder.CellFormat.Width = 20; + builder.CellFormat.Width = 50; var getApproveMan2 = Person_PersonsService.GetPerson_PersonsById(ActionPlan_ActionPlanListApproveList[i + 1].ApproveMan); builder.Font.Bold = false; if (!string.IsNullOrEmpty(getApproveMan2.SignatureUrl) && File.Exists(rootPath + getApproveMan2.SignatureUrl)) @@ -594,7 +591,7 @@ 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;//水平居中对齐 - builder.CellFormat.Width = 230; + builder.CellFormat.Width = 400; builder.Font.Bold = true; builder.Write("主要评审部门"); builder.EndRow(); @@ -604,7 +601,7 @@ 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;//水平居中对齐 - builder.CellFormat.Width = 80; + builder.CellFormat.Width = 150; builder.Font.Bold = true; builder.Write("评审部门"); @@ -613,7 +610,7 @@ 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;//水平居中对齐 - builder.CellFormat.Width = 80; + builder.CellFormat.Width = 100; builder.Font.Bold = true; builder.Write("评审意见"); @@ -622,7 +619,7 @@ 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;//水平居中对齐 - builder.CellFormat.Width = 70; + builder.CellFormat.Width = 150; builder.Font.Bold = true; builder.Write("评审部门负责人/日期"); builder.EndRow(); @@ -635,7 +632,7 @@ 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;//水平居中对齐 - builder.CellFormat.Width = 80; + builder.CellFormat.Width = 150; builder.Font.Bold = false; builder.Write("施工管理部"); //评审意见 @@ -644,7 +641,7 @@ 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;//水平居中对齐 - builder.CellFormat.Width = 80; + builder.CellFormat.Width = 100; builder.Font.Bold = false; if (!string.IsNullOrEmpty(item.ApproveIdea)) { @@ -662,7 +659,7 @@ 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;//水平居中对齐 - builder.CellFormat.Width = 70; + builder.CellFormat.Width = 150; builder.Font.Bold = false; if (item.ApproveDate != null) { @@ -692,7 +689,7 @@ 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;//水平居中对齐 - builder.CellFormat.Width = 80; + builder.CellFormat.Width = 150; var departModel = db.Base_Depart.FirstOrDefault(x => x.DepartId == item.DepartId); builder.Font.Bold = false; if (departModel != null) @@ -705,7 +702,7 @@ 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;//水平居中对齐 - builder.CellFormat.Width = 80; + builder.CellFormat.Width = 100; builder.Font.Bold = false; if (!string.IsNullOrEmpty(item.ApproveIdea)) { @@ -723,7 +720,7 @@ 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;//水平居中对齐 - builder.CellFormat.Width = 70; + builder.CellFormat.Width = 150; builder.Font.Bold = false; if (item.ApproveDate != null) { @@ -763,13 +760,13 @@ namespace FineUIPro.Web.ZHGL.Plan 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; builder.Write("公司安全总监/部门负责人:"); - builder.Write(" 年"); + builder.Write(" 年"); builder.Write(" 月"); - builder.Write(" 日"); + builder.Write(" 日"); builder.EndRow(); builder.InsertCell(); @@ -779,20 +776,20 @@ namespace FineUIPro.Web.ZHGL.Plan 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; builder.Write("公司主管生产/安全领导:"); - builder.Write(" 年"); + builder.Write(" 年"); builder.Write(" 月"); - builder.Write(" 日"); + builder.Write(" 日"); builder.EndRow(); builder.Font.Bold = false; @@ -802,17 +799,24 @@ namespace FineUIPro.Web.ZHGL.Plan } 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) { diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 4577002e..e4459f04 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -6696,6 +6696,14 @@ namespace Model } } + public System.Data.Linq.Table View_WBS + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table View_WBS_ControlItemAndCycle { get @@ -287728,6 +287736,123 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.View_WBS")] + public partial class View_WBS + { + + private string _Id; + + private string _SupId; + + private string _Code; + + private string _Name; + + private string _WBSType; + + private string _ProjectId; + + public View_WBS() + { + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Id", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + public string Id + { + get + { + return this._Id; + } + set + { + if ((this._Id != value)) + { + this._Id = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SupId", DbType="NVarChar(50)")] + public string SupId + { + get + { + return this._SupId; + } + set + { + if ((this._SupId != value)) + { + this._SupId = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Code", DbType="NVarChar(30)")] + public string Code + { + get + { + return this._Code; + } + set + { + if ((this._Code != value)) + { + this._Code = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(50)")] + public string Name + { + get + { + return this._Name; + } + set + { + if ((this._Name != value)) + { + this._Name = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WBSType", DbType="VarChar(11) NOT NULL", CanBeNull=false)] + public string WBSType + { + get + { + return this._WBSType; + } + set + { + if ((this._WBSType != value)) + { + this._WBSType = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")] + public string ProjectId + { + get + { + return this._ProjectId; + } + set + { + if ((this._ProjectId != value)) + { + this._ProjectId = value; + } + } + } + } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.View_WBS_ControlItemAndCycle")] public partial class View_WBS_ControlItemAndCycle { @@ -291336,6 +291461,14 @@ namespace Model private string _MainItemAndDesignProfessionalIds; + private System.Nullable _PlanStartDate; + + private System.Nullable _PlanEndDate; + + private System.Nullable _RealStartDate; + + private System.Nullable _RealEndDate; + private EntitySet _Accident_AccidentPersonRecord; private EntitySet _Accident_AccidentReport; @@ -291414,6 +291547,14 @@ namespace Model partial void OnCostsChanged(); partial void OnMainItemAndDesignProfessionalIdsChanging(string value); partial void OnMainItemAndDesignProfessionalIdsChanged(); + partial void OnPlanStartDateChanging(System.Nullable value); + partial void OnPlanStartDateChanged(); + partial void OnPlanEndDateChanging(System.Nullable value); + partial void OnPlanEndDateChanged(); + partial void OnRealStartDateChanging(System.Nullable value); + partial void OnRealStartDateChanged(); + partial void OnRealEndDateChanging(System.Nullable value); + partial void OnRealEndDateChanged(); #endregion public WBS_UnitWork() @@ -291717,6 +291858,86 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PlanStartDate", DbType="DateTime")] + public System.Nullable PlanStartDate + { + get + { + return this._PlanStartDate; + } + set + { + if ((this._PlanStartDate != value)) + { + this.OnPlanStartDateChanging(value); + this.SendPropertyChanging(); + this._PlanStartDate = value; + this.SendPropertyChanged("PlanStartDate"); + this.OnPlanStartDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PlanEndDate", DbType="DateTime")] + public System.Nullable PlanEndDate + { + get + { + return this._PlanEndDate; + } + set + { + if ((this._PlanEndDate != value)) + { + this.OnPlanEndDateChanging(value); + this.SendPropertyChanging(); + this._PlanEndDate = value; + this.SendPropertyChanged("PlanEndDate"); + this.OnPlanEndDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RealStartDate", DbType="DateTime")] + public System.Nullable RealStartDate + { + get + { + return this._RealStartDate; + } + set + { + if ((this._RealStartDate != value)) + { + this.OnRealStartDateChanging(value); + this.SendPropertyChanging(); + this._RealStartDate = value; + this.SendPropertyChanged("RealStartDate"); + this.OnRealStartDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RealEndDate", DbType="DateTime")] + public System.Nullable RealEndDate + { + get + { + return this._RealEndDate; + } + set + { + if ((this._RealEndDate != value)) + { + this.OnRealEndDateChanging(value); + this.SendPropertyChanging(); + this._RealEndDate = value; + this.SendPropertyChanged("RealEndDate"); + this.OnRealEndDateChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Accident_AccidentPersonRecord_ProjectData_WorkArea", Storage="_Accident_AccidentPersonRecord", ThisKey="UnitWorkId", OtherKey="WorkAreaId", DeleteRule="NO ACTION")] public EntitySet Accident_AccidentPersonRecord { @@ -292407,6 +292628,24 @@ namespace Model private string _SubItemType; + private string _PreJobId; + + private System.Nullable _PlanProjectQuantity; + + private System.Nullable _RealProjectQuantity; + + private System.Nullable _PlanStartDate; + + private System.Nullable _PlanEndDate; + + private System.Nullable _RealStartDate; + + private System.Nullable _RealEndDate; + + private string _Unit; + + private System.Nullable _IsMileStone; + private EntitySet _WBS_ControlItemAndCycle; private EntityRef _WBS_UnitWork; @@ -292451,6 +292690,24 @@ namespace Model partial void OnCostsChanged(); partial void OnSubItemTypeChanging(string value); partial void OnSubItemTypeChanged(); + partial void OnPreJobIdChanging(string value); + partial void OnPreJobIdChanged(); + partial void OnPlanProjectQuantityChanging(System.Nullable value); + partial void OnPlanProjectQuantityChanged(); + partial void OnRealProjectQuantityChanging(System.Nullable value); + partial void OnRealProjectQuantityChanged(); + partial void OnPlanStartDateChanging(System.Nullable value); + partial void OnPlanStartDateChanged(); + partial void OnPlanEndDateChanging(System.Nullable value); + partial void OnPlanEndDateChanged(); + partial void OnRealStartDateChanging(System.Nullable value); + partial void OnRealStartDateChanged(); + partial void OnRealEndDateChanging(System.Nullable value); + partial void OnRealEndDateChanged(); + partial void OnUnitChanging(string value); + partial void OnUnitChanged(); + partial void OnIsMileStoneChanging(System.Nullable value); + partial void OnIsMileStoneChanged(); #endregion public WBS_WorkPackage() @@ -292824,6 +293081,186 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PreJobId", DbType="NVarChar(50)")] + public string PreJobId + { + get + { + return this._PreJobId; + } + set + { + if ((this._PreJobId != value)) + { + this.OnPreJobIdChanging(value); + this.SendPropertyChanging(); + this._PreJobId = value; + this.SendPropertyChanged("PreJobId"); + this.OnPreJobIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PlanProjectQuantity", DbType="Decimal(18,2)")] + public System.Nullable PlanProjectQuantity + { + get + { + return this._PlanProjectQuantity; + } + set + { + if ((this._PlanProjectQuantity != value)) + { + this.OnPlanProjectQuantityChanging(value); + this.SendPropertyChanging(); + this._PlanProjectQuantity = value; + this.SendPropertyChanged("PlanProjectQuantity"); + this.OnPlanProjectQuantityChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RealProjectQuantity", DbType="Decimal(18,2)")] + public System.Nullable RealProjectQuantity + { + get + { + return this._RealProjectQuantity; + } + set + { + if ((this._RealProjectQuantity != value)) + { + this.OnRealProjectQuantityChanging(value); + this.SendPropertyChanging(); + this._RealProjectQuantity = value; + this.SendPropertyChanged("RealProjectQuantity"); + this.OnRealProjectQuantityChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PlanStartDate", DbType="DateTime")] + public System.Nullable PlanStartDate + { + get + { + return this._PlanStartDate; + } + set + { + if ((this._PlanStartDate != value)) + { + this.OnPlanStartDateChanging(value); + this.SendPropertyChanging(); + this._PlanStartDate = value; + this.SendPropertyChanged("PlanStartDate"); + this.OnPlanStartDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PlanEndDate", DbType="DateTime")] + public System.Nullable PlanEndDate + { + get + { + return this._PlanEndDate; + } + set + { + if ((this._PlanEndDate != value)) + { + this.OnPlanEndDateChanging(value); + this.SendPropertyChanging(); + this._PlanEndDate = value; + this.SendPropertyChanged("PlanEndDate"); + this.OnPlanEndDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RealStartDate", DbType="DateTime")] + public System.Nullable RealStartDate + { + get + { + return this._RealStartDate; + } + set + { + if ((this._RealStartDate != value)) + { + this.OnRealStartDateChanging(value); + this.SendPropertyChanging(); + this._RealStartDate = value; + this.SendPropertyChanged("RealStartDate"); + this.OnRealStartDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RealEndDate", DbType="DateTime")] + public System.Nullable RealEndDate + { + get + { + return this._RealEndDate; + } + set + { + if ((this._RealEndDate != value)) + { + this.OnRealEndDateChanging(value); + this.SendPropertyChanging(); + this._RealEndDate = value; + this.SendPropertyChanged("RealEndDate"); + this.OnRealEndDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Unit", DbType="NVarChar(50)")] + public string Unit + { + get + { + return this._Unit; + } + set + { + if ((this._Unit != value)) + { + this.OnUnitChanging(value); + this.SendPropertyChanging(); + this._Unit = value; + this.SendPropertyChanged("Unit"); + this.OnUnitChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsMileStone", DbType="Bit")] + public System.Nullable IsMileStone + { + get + { + return this._IsMileStone; + } + set + { + if ((this._IsMileStone != value)) + { + this.OnIsMileStoneChanging(value); + this.SendPropertyChanging(); + this._IsMileStone = value; + this.SendPropertyChanged("IsMileStone"); + this.OnIsMileStoneChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_WBS_ControlItemAndCycle_WBS_ControlItemAndCycle", Storage="_WBS_ControlItemAndCycle", ThisKey="WorkPackageId", OtherKey="WorkPackageId", DeleteRule="NO ACTION")] public EntitySet WBS_ControlItemAndCycle {