From 75b2d905c9d106e826256c731bfacc42864785be Mon Sep 17 00:00:00 2001 From: gaofei <181547018@qq.com> Date: Thu, 1 Jun 2023 17:14:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B9=E7=9B=AE=E5=AE=89?= =?UTF-8?q?=E5=85=A8=E5=AE=9E=E6=96=BD=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../版本日志/SGGLDB_V2023-06-01_gaofei.sql | 94 +++ .../版本日志/SGGLDB_V2023-06-01修改明细.txt | 3 + .../0-5综合管理(Menu_ZHGL).sql | 27 +- SGGL/BLL/BLL.csproj | 1 + SGGL/BLL/Common/AttachFileService.cs | 21 + SGGL/BLL/Common/Const.cs | 46 +- .../ActionPlanListApproveService.cs | 482 ++++++++++++ .../HSSE/ActionPlan/ActionPlanListService.cs | 72 ++ SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 25 + .../HSSE/ActionPlan/ActionPlanList.aspx | 23 +- .../HSSE/ActionPlan/ActionPlanList.aspx.cs | 86 +- .../ActionPlanList.aspx.designer.cs | 27 + .../HSSE/ActionPlan/ActionPlanListEdit.aspx | 294 +++++-- .../ActionPlan/ActionPlanListEdit.aspx.cs | 737 +++++++++++++++++- .../ActionPlanListEdit.aspx.designer.cs | 242 +++++- .../HSSE/ActionPlan/ActionPlanListView.aspx | 133 +++- .../ActionPlan/ActionPlanListView.aspx.cs | 120 ++- .../ActionPlanListView.aspx.designer.cs | 192 ++++- .../ZHGL/Plan/ActionPlanList.aspx | 143 ++++ .../ZHGL/Plan/ActionPlanList.aspx.cs | 355 +++++++++ .../ZHGL/Plan/ActionPlanList.aspx.designer.cs | 231 ++++++ .../ZHGL/Plan/ActionPlanListEdit.aspx | 181 +++++ .../ZHGL/Plan/ActionPlanListEdit.aspx.cs | 613 +++++++++++++++ .../Plan/ActionPlanListEdit.aspx.designer.cs | 348 +++++++++ .../ZHGL/Plan/ActionPlanListView.aspx | 143 ++++ .../ZHGL/Plan/ActionPlanListView.aspx.cs | 172 ++++ .../Plan/ActionPlanListView.aspx.designer.cs | 258 ++++++ SGGL/Model/Model.cs | 551 ++++++++++++- 28 files changed, 5430 insertions(+), 190 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_V2023-06-01_gaofei.sql create mode 100644 DataBase/版本日志/SGGLDB_V2023-06-01修改明细.txt create mode 100644 SGGL/BLL/HSSE/ActionPlan/ActionPlanListApproveService.cs create mode 100644 SGGL/FineUIPro.Web/ZHGL/Plan/ActionPlanList.aspx create mode 100644 SGGL/FineUIPro.Web/ZHGL/Plan/ActionPlanList.aspx.cs create mode 100644 SGGL/FineUIPro.Web/ZHGL/Plan/ActionPlanList.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/ZHGL/Plan/ActionPlanListEdit.aspx create mode 100644 SGGL/FineUIPro.Web/ZHGL/Plan/ActionPlanListEdit.aspx.cs create mode 100644 SGGL/FineUIPro.Web/ZHGL/Plan/ActionPlanListEdit.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/ZHGL/Plan/ActionPlanListView.aspx create mode 100644 SGGL/FineUIPro.Web/ZHGL/Plan/ActionPlanListView.aspx.cs create mode 100644 SGGL/FineUIPro.Web/ZHGL/Plan/ActionPlanListView.aspx.designer.cs diff --git a/DataBase/版本日志/SGGLDB_V2023-06-01_gaofei.sql b/DataBase/版本日志/SGGLDB_V2023-06-01_gaofei.sql new file mode 100644 index 00000000..792e5eef --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-06-01_gaofei.sql @@ -0,0 +1,94 @@ + +CREATE TABLE [dbo].[ActionPlan_ActionPlanListApprove]( + [ActionPlanListApproveId] [nvarchar](50) NOT NULL, + [ActionPlanListId] [nvarchar](50) NULL, + [ApproveMan] [nvarchar](50) NULL, + [ApproveDate] [datetime] NULL, + [IsAgree] [bit] NULL, + [ApproveIdea] [nvarchar](200) NULL, + [ApproveType] [char](1) NULL, + [AttachUrl] [nvarchar](200) NULL, + [SignType] [nvarchar](20) NULL, + [Edition] [int] NULL, + CONSTRAINT [PK_ActionPlan_ActionPlanListApprove] PRIMARY KEY CLUSTERED +( + [ActionPlanListApproveId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +SET ANSI_PADDING OFF +GO + +ALTER TABLE [dbo].[ActionPlan_ActionPlanListApprove] WITH CHECK ADD CONSTRAINT [FK_ActionPlan_ActionPlanListApprove_ActionPlan_ActionPlanList] FOREIGN KEY([ActionPlanListId]) +REFERENCES [dbo].[ActionPlan_ActionPlanList] ([ActionPlanListId]) +GO + +ALTER TABLE [dbo].[ActionPlan_ActionPlanListApprove] CHECK CONSTRAINT [FK_ActionPlan_ActionPlanListApprove_ActionPlan_ActionPlanList] +GO + +ALTER TABLE [dbo].[ActionPlan_ActionPlanListApprove] WITH CHECK ADD CONSTRAINT [FK_ActionPlan_ActionPlanListApprove_Person_Persons] FOREIGN KEY([ApproveMan]) +REFERENCES [dbo].[Person_Persons] ([PersonId]) +GO + +ALTER TABLE [dbo].[ActionPlan_ActionPlanListApprove] CHECK CONSTRAINT [FK_ActionPlan_ActionPlanListApprove_Person_Persons] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ActionPlan_ActionPlanListApprove', @level2type=N'COLUMN',@level2name=N'ActionPlanListApproveId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ActionPlan_ActionPlanListApprove', @level2type=N'COLUMN',@level2name=N'ActionPlanListId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ActionPlan_ActionPlanListApprove', @level2type=N'COLUMN',@level2name=N'ApproveMan' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ActionPlan_ActionPlanListApprove', @level2type=N'COLUMN',@level2name=N'ApproveDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ƿͬ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ActionPlan_ActionPlanListApprove', @level2type=N'COLUMN',@level2name=N'IsAgree' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ActionPlan_ActionPlanListApprove', @level2type=N'COLUMN',@level2name=N'ApproveIdea' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ActionPlan_ActionPlanListApprove', @level2type=N'COLUMN',@level2name=N'ApproveType' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ActionPlan_ActionPlanListApprove', @level2type=N'COLUMN',@level2name=N'AttachUrl' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʵʩƻ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ActionPlan_ActionPlanListApprove' +GO + + + +alter table [dbo].[ActionPlan_ActionPlanList] add Edition int null +GO +alter table [dbo].[ActionPlan_ActionPlanList] add IsReview bit null +GO +alter table [dbo].[ActionPlan_ActionPlanList] add ReviewMan nvarchar(50) null +GO +alter table [dbo].[ActionPlan_ActionPlanList] add IsCompanyReview bit null +GO + +update Sys_Menu set SuperMenu='76E236DA-DDFC-4CE8-8CB8-02F8A27A8535' where MenuId='B9ADD006-BA46-4191-BCD1-CCB56767C82B' +GO + +--רҵ +INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +VALUES('76E236DA-DDFC-4CE8-8CB8-02F8A27A8535','רҵ','',35,'0','Menu_ZHGL',1,0,1) +GO + INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) + VALUES('B6A2B6EB-6B90-4953-B544-83FFF4F0EC19','ȫʵʩƻ','ZHGL/Plan/ActionPlanList.aspx',10,'76E236DA-DDFC-4CE8-8CB8-02F8A27A8535','Menu_ZHGL',1,1,1) + GO + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('1E0C71C7-91BD-443B-85DB-52CEB7A744D0','B6A2B6EB-6B90-4953-B544-83FFF4F0EC19','',1) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('B4D3A6B8-7B00-4553-B5B6-E5F0BB6A2A67','B6A2B6EB-6B90-4953-B544-83FFF4F0EC19','޸',2) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('D2816FF1-6256-428D-8BFB-055EE1543520','B6A2B6EB-6B90-4953-B544-83FFF4F0EC19','ɾ',3) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('F4A46E16-5FB0-486D-9D03-B06EF8A93E11','B6A2B6EB-6B90-4953-B544-83FFF4F0EC19','',4) + GO \ No newline at end of file diff --git a/DataBase/版本日志/SGGLDB_V2023-06-01修改明细.txt b/DataBase/版本日志/SGGLDB_V2023-06-01修改明细.txt new file mode 100644 index 00000000..2a23b1ac --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-06-01修改明细.txt @@ -0,0 +1,3 @@ +--ADD BY Gaofei 2023-06-01 +1、修改安全实施计划审批流程,增加公司级部门评审 +--END \ No newline at end of file diff --git a/DataBase/菜单初始化脚本/0-5综合管理(Menu_ZHGL).sql b/DataBase/菜单初始化脚本/0-5综合管理(Menu_ZHGL).sql index 90b63f76..2dfbd47d 100644 --- a/DataBase/菜单初始化脚本/0-5综合管理(Menu_ZHGL).sql +++ b/DataBase/菜单初始化脚本/0-5综合管理(Menu_ZHGL).sql @@ -195,14 +195,31 @@ GO VALUES('30F188D4-84D4-4D3C-8ECE-B499ACB1C3C8','70DEB27A-D6FF-4D57-879B-0270F2967FA0','打印',8) GO +--专业技术方案评审 INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) -VALUES('B9ADD006-BA46-4191-BCD1-CCB56767C82B','总包施工质量计划','ZHGL/Plan/MainPlan.aspx',35,'0','Menu_ZHGL',0,1,1) +VALUES('76E236DA-DDFC-4CE8-8CB8-02F8A27A8535','专业技术方案评审','',35,'0','Menu_ZHGL',1,0,1) GO - INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) - VALUES('EB908892-B220-4EFD-97F6-DBB4F63960EC','B9ADD006-BA46-4191-BCD1-CCB56767C82B','修改',1) - INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) - VALUES('EF4D5271-ECEF-4AF3-941C-02580696179E','B9ADD006-BA46-4191-BCD1-CCB56767C82B','保存',2) + INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) + VALUES('B6A2B6EB-6B90-4953-B544-83FFF4F0EC19','安全实施计划','ZHGL/Plan/ActionPlanList.aspx',10,'76E236DA-DDFC-4CE8-8CB8-02F8A27A8535','Menu_ZHGL',1,1,1) GO + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('1E0C71C7-91BD-443B-85DB-52CEB7A744D0','B6A2B6EB-6B90-4953-B544-83FFF4F0EC19','增加',1) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('B4D3A6B8-7B00-4553-B5B6-E5F0BB6A2A67','B6A2B6EB-6B90-4953-B544-83FFF4F0EC19','修改',2) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('D2816FF1-6256-428D-8BFB-055EE1543520','B6A2B6EB-6B90-4953-B544-83FFF4F0EC19','删除',3) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('F4A46E16-5FB0-486D-9D03-B06EF8A93E11','B6A2B6EB-6B90-4953-B544-83FFF4F0EC19','保存',4) + GO + + INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) + VALUES('B9ADD006-BA46-4191-BCD1-CCB56767C82B','总包施工质量计划','ZHGL/Plan/MainPlan.aspx',35,'76E236DA-DDFC-4CE8-8CB8-02F8A27A8535','Menu_ZHGL',0,1,1) + GO + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('EB908892-B220-4EFD-97F6-DBB4F63960EC','B9ADD006-BA46-4191-BCD1-CCB56767C82B','修改',1) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('EF4D5271-ECEF-4AF3-941C-02580696179E','B9ADD006-BA46-4191-BCD1-CCB56767C82B','保存',2) + GO INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) VALUES('ABB667AF-2C50-40A6-9FC9-FC34A96582E3','文件柜','',40,'0','Menu_ZHGL',0,1,1) diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index cbf99b83..74f9b667 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -393,6 +393,7 @@ + diff --git a/SGGL/BLL/Common/AttachFileService.cs b/SGGL/BLL/Common/AttachFileService.cs index 833ee119..a8cb0f8f 100644 --- a/SGGL/BLL/Common/AttachFileService.cs +++ b/SGGL/BLL/Common/AttachFileService.cs @@ -151,6 +151,27 @@ namespace BLL return res; } + /// + /// + /// + /// + /// + /// + public static Boolean Getfile(string toKeyId) + { + bool res = false; + var q = Funs.DB.AttachFile.FirstOrDefault((x => x.ToKeyId == toKeyId)); + if (q != null) + { + var file = q.AttachUrl; + if (!string.IsNullOrEmpty(file)) + { + res = true; + } + } + return res; + } + /// /// /// diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index b088dc6b..44026bc6 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -943,7 +943,10 @@ /// 同步记录 /// public const string RealNameSynchroRecordMenuId = "F36E6C54-E39F-4032-874D-548EE090A35B"; - + /// + /// 实施计划 + /// + public const string OfficeActionPlanListMenuId = "B6A2B6EB-6B90-4953-B544-83FFF4F0EC19"; /// /// 总包施工质量计划 /// @@ -3431,6 +3434,47 @@ public const string ProjectInformation_DrillPlanHalfYearReportId = "10"; #endregion + #region 安全流程定义 + #region 安全实施计划流程定义 + + /// + /// 重报 + /// + public const string ActionPlanList_ReCompile = "0"; + + /// + /// 编制 + /// + public static string ActionPlanList_Compile = "1"; + + /// + /// 会签 + /// + public static string ActionPlanList_Audit = "2"; + + /// + /// 评审负责人办理 + /// + public static string ActionPlanList_Review = "3"; + + /// + /// 施工管理部评审 + /// + public static string ActionPlanList_Reviewing = "4"; + + /// + /// 评审负责人办理 + /// + public static string ActionPlanList_Review2 = "5"; + + /// + /// 审批完成 + /// + public static string ActionPlanList_Complete = "C"; + + #endregion + #endregion + #region 质量 #region 质量管理 #region 基础设置 diff --git a/SGGL/BLL/HSSE/ActionPlan/ActionPlanListApproveService.cs b/SGGL/BLL/HSSE/ActionPlan/ActionPlanListApproveService.cs new file mode 100644 index 00000000..e18b6d9f --- /dev/null +++ b/SGGL/BLL/HSSE/ActionPlan/ActionPlanListApproveService.cs @@ -0,0 +1,482 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace BLL +{ + public class ActionPlanListApproveService + { + public static Model.ActionPlan_ActionPlanListApprove GetSee(string ActionPlanListId, string userId) + { + Model.SGGLDB db = Funs.DB; + return db.ActionPlan_ActionPlanListApprove.FirstOrDefault(x => x.ActionPlanListId == ActionPlanListId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null); + } + + public static Model.ActionPlan_ActionPlanListApprove GetReview(string ActionPlanListId) + { + Model.SGGLDB db = Funs.DB; + return db.ActionPlan_ActionPlanListApprove.FirstOrDefault(x => x.ActionPlanListId == ActionPlanListId && x.ApproveType == "R"); + } + + public static void See(string ActionPlanListId, string userId) + { + using (var db = new Model.SGGLDB(Funs.ConnString)) + { + var res = db.ActionPlan_ActionPlanListApprove.FirstOrDefault(x => x.ActionPlanListId == ActionPlanListId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null); + if (res != null) + { + res.ApproveDate = DateTime.Now; + db.SubmitChanges(); + } + } + } + + /// + /// 部门评审小组审批信息 + /// + /// + /// + public static List GetReviewings(string ActionPlanListId, int edtion) + { + return (from x in Funs.DB.ActionPlan_ActionPlanListApprove where x.ActionPlanListId == ActionPlanListId && x.ApproveType == BLL.Const.ActionPlanList_Reviewing && x.Edition == edtion select x).ToList(); + } + + /// + /// 部门评审小组审批信息 + /// + /// + /// + public static List GetReviewingEnds(string ActionPlanListId, int edtion) + { + return (from x in Funs.DB.ActionPlan_ActionPlanListApprove where x.ActionPlanListId == ActionPlanListId && x.ApproveType == BLL.Const.ActionPlanList_Reviewing && x.Edition == edtion && x.ApproveDate != null select x).ToList(); + } + + /// + /// 部门评审小组审批人员Id集合 + /// + /// + /// + public static List GetReviewingPersonIds(string ActionPlanListId) + { + using (var db = new Model.SGGLDB(Funs.ConnString)) + { + return (from x in db.ActionPlan_ActionPlanListApprove where x.ActionPlanListId == ActionPlanListId && x.ApproveType == BLL.Const.ActionPlanList_Reviewing select x.ApproveMan).ToList(); + } + } + + /// + /// 根据安全实施计划编号获取对应的所有未办理安全实施计划审批信息 + /// + /// 安全实施计划编号 + public static List GetActionPlanListApprovesNotHandleList(string ActionPlanListId) + { + Model.SGGLDB db = Funs.DB; + return (from x in Funs.DB.ActionPlan_ActionPlanListApprove where x.ActionPlanListId == ActionPlanListId && x.ApproveType != "S" && x.ApproveDate == null select x).ToList(); + } + + /// + /// 根据安全实施计划发布Id获取对应组会签人id集合信息 + /// + /// 安全实施计划发布Id + /// 安全实施计划审批集合 + public static List GetUserIdsApprovesBySignType(string ActionPlanListId, string signType) + { + var edtion = GetUserIdsApprovesBySignTypeEditon(ActionPlanListId); + return (from x in Funs.DB.ActionPlan_ActionPlanListApprove where x.ActionPlanListId == ActionPlanListId && x.ApproveType != "S" && x.SignType == signType && x.Edition == edtion select x.ApproveMan).ToList(); + } + + public static int? GetUserIdsApprovesBySignTypeEditon(string ActionPlanListId) + { + int edition = 0; + var actionPlanList = Funs.DB.ActionPlan_ActionPlanList.FirstOrDefault(p => p.ActionPlanListId == ActionPlanListId); + if (actionPlanList != null) + { + edition = Convert.ToInt32(actionPlanList.Edition); + } + return edition; + } + + /// + /// 修改安全实施计划审批信息 + /// + /// 安全实施计划审批实体 + public static void UpdateActionPlanListApprove(Model.ActionPlan_ActionPlanListApprove approve) + { + Model.SGGLDB db = Funs.DB; + Model.ActionPlan_ActionPlanListApprove newApprove = db.ActionPlan_ActionPlanListApprove.First(e => e.ActionPlanListApproveId == approve.ActionPlanListApproveId && e.ApproveDate == null); + newApprove.ActionPlanListId = approve.ActionPlanListId; + newApprove.ApproveMan = approve.ApproveMan; + newApprove.ApproveDate = approve.ApproveDate; + newApprove.ApproveIdea = approve.ApproveIdea; + newApprove.IsAgree = approve.IsAgree; + newApprove.ApproveType = approve.ApproveType; + newApprove.Edition = approve.Edition; + db.SubmitChanges(); + } + /// + /// 根据安全实施计划发布Id获取所以对应安全实施计划审批信息(查询全部会签状态) + /// + /// 安全实施计划发布Id + /// 安全实施计划审批集合 + public static List GetHandleActionPlanListApprovesByActionPlanListId(string ActionPlanListId, int edition) + { + var list = Funs.DB.ActionPlan_ActionPlanListApprove.Where(p => p.ActionPlanListId == ActionPlanListId && p.ApproveType == Const.ActionPlanList_Audit && p.Edition == edition).ToList(); + return list; + + } + + public static List GetHandleConstruct(string ActionPlanListId, int edition) + { + var list = Funs.DB.ActionPlan_ActionPlanListApprove.Where(p => p.ActionPlanListId == ActionPlanListId && p.ApproveType != "S" && p.ApproveDate != null && p.Edition == edition).ToList(); + return list; + + } + /// + /// 根据安全实施计划发布Id获取所以对应安全实施计划审批信息 + /// + /// 安全实施计划发布Id + /// 安全实施计划审批集合 + public static List GetActionPlanListApprovesByActionPlanListId(string ActionPlanListId, string state) + { + Model.SGGLDB db = Funs.DB; + var reDate = (from x in db.ActionPlan_ActionPlanListApprove where x.ActionPlanListId == ActionPlanListId && x.ApproveType == BLL.Const.ActionPlanList_ReCompile orderby x.ApproveDate descending select x.ApproveDate).FirstOrDefault(); + if (reDate == null) + { + return (from x in db.ActionPlan_ActionPlanListApprove where x.ActionPlanListId == ActionPlanListId && x.ApproveType == state select x).ToList(); + } + else + { + return (from x in db.ActionPlan_ActionPlanListApprove where x.ActionPlanListId == ActionPlanListId && x.ApproveType == state && (x.ApproveDate == null || x.ApproveDate > reDate) select x).ToList(); + } + } + + /// + /// 获取安全实施计划模板列表 + /// + /// + /// + /// + public static IList getListData(string ActionPlanListId) + { + Model.SGGLDB db = Funs.DB; + var res = from x in db.ActionPlan_ActionPlanListApprove + where x.ActionPlanListId == ActionPlanListId && x.ApproveDate != null && x.ApproveType != "S" + orderby x.ApproveDate + select x; + + //select new + //{ + // x.ActionPlanListApproveId, + // x.ActionPlanListId, + // x.ApproveMan, + // x.ApproveDate, + // x.IsAgree, + // x.ApproveIdea, + // x.ApproveType, + // x.SignType, + // //= x.IsAgree == true ? "是" : "否", + //}; + return res.ToList(); + } + + /// + /// 获取未代办的记录数量 + /// + /// + /// + /// + public static int getListActionPlanApproveCount(string ActionPlanListId, string man, string signType) + { + + var res = (from x in Funs.DB.ActionPlan_ActionPlanListApprove + where x.ActionPlanListId == ActionPlanListId && x.ApproveDate == null && x.ApproveType != "S" && x.ApproveMan.Equals(man) && x.SignType == signType + orderby x.ApproveDate + select x).Count(); + return res; + } + public static IList getListActionPlanApprove(string ActionPlanListId, string man) + { + + var res = (from x in Funs.DB.ActionPlan_ActionPlanListApprove + where x.ActionPlanListId == ActionPlanListId && x.ApproveDate == null && x.ApproveType != "S" && x.ApproveMan.Equals(man) + orderby x.ApproveDate + select x).ToList(); + return res; + } + /// + /// 删除未代办的记录 + /// + /// + public static void delActionPlanApprove(string ActionPlanListId, string man) + { + Model.SGGLDB db = Funs.DB; + var q = (from x in Funs.DB.ActionPlan_ActionPlanListApprove where x.ActionPlanListId == ActionPlanListId && x.ApproveType != "S" && x.ApproveMan.Equals(man) && x.ApproveDate == null select x).ToList(); + if (q.Count > 0) + { + db.ActionPlan_ActionPlanListApprove.DeleteAllOnSubmit(q); + db.SubmitChanges(); + } + } + + + /// + /// 根据安全实施计划编号删除对应的所有安全实施计划审批信息 + /// + /// 安全实施计划编号 + public static void DeleteActionPlanListApprovesByActionPlanListId(string ActionPlanListId) + { + Model.SGGLDB db = Funs.DB; + var q = (from x in Funs.DB.ActionPlan_ActionPlanListApprove where x.ActionPlanListId == ActionPlanListId select x).ToList(); + if (q.Count > 0) + { + db.ActionPlan_ActionPlanListApprove.DeleteAllOnSubmit(q); + db.SubmitChanges(); + } + } + /// + /// 根据安全实施计划编号获取一个安全实施计划审批信息 + /// + /// 安全实施计划编号 + /// 一个安全实施计划审批实体 + public static Model.ActionPlan_ActionPlanListApprove GetActionPlanListApproveByApproveMan(string ActionPlanListId, string approveMan) + { + + return Funs.DB.ActionPlan_ActionPlanListApprove.FirstOrDefault(x => x.ActionPlanListId == ActionPlanListId && x.ApproveMan == approveMan && x.ApproveType != "S" && x.ApproveDate == null); + } + public static Model.ActionPlan_ActionPlanListApprove GetConstructSoluAppByApproveMan(string ActionPlanListId, string approveMan, int edtion) + { + + return Funs.DB.ActionPlan_ActionPlanListApprove.FirstOrDefault(x => x.ActionPlanListId == ActionPlanListId && x.Edition == edtion && x.ApproveMan == approveMan && x.ApproveType != "S" && x.ApproveDate == null); + } + + public static Model.ActionPlan_ActionPlanListApprove GetConstructSolApproveByApproveMan(string ActionPlanListId, string approveMan) + { + return Funs.DB.ActionPlan_ActionPlanListApprove.FirstOrDefault(x => x.ActionPlanListId == ActionPlanListId && x.ApproveMan == approveMan && x.ApproveType != "S" && x.ApproveDate == null); + } + + + /// + /// 增加安全实施计划审批信息 + /// + /// 安全实施计划审批实体 + public static void AddActionPlanListApprove(Model.ActionPlan_ActionPlanListApprove approve) + { + var db = Funs.DB; + Model.ActionPlan_ActionPlanListApprove newApprove = new Model.ActionPlan_ActionPlanListApprove(); + if (string.IsNullOrWhiteSpace(approve.ActionPlanListApproveId)) + { + newApprove.ActionPlanListApproveId = SQLHelper.GetNewID(typeof(Model.ActionPlan_ActionPlanListApprove)); + } + else + { + newApprove.ActionPlanListApproveId = approve.ActionPlanListApproveId; + } + newApprove.ActionPlanListId = approve.ActionPlanListId; + newApprove.ApproveMan = approve.ApproveMan; + newApprove.ApproveDate = approve.ApproveDate; + newApprove.ApproveIdea = approve.ApproveIdea; + newApprove.IsAgree = approve.IsAgree; + newApprove.ApproveType = approve.ApproveType; + newApprove.SignType = approve.SignType; + newApprove.Edition = approve.Edition; + db.ActionPlan_ActionPlanListApprove.InsertOnSubmit(newApprove); + db.SubmitChanges(); + } + public static void AddActionPlanListApproveForApi(Model.ActionPlan_ActionPlanListApprove approve) + { + using (var db = new Model.SGGLDB(Funs.ConnString)) + { + Model.ActionPlan_ActionPlanListApprove newApprove = new Model.ActionPlan_ActionPlanListApprove(); + if (string.IsNullOrWhiteSpace(approve.ActionPlanListApproveId)) + { + newApprove.ActionPlanListApproveId = SQLHelper.GetNewID(typeof(Model.ActionPlan_ActionPlanListApprove)); + } + else + { + newApprove.ActionPlanListApproveId = approve.ActionPlanListApproveId; + } + newApprove.ActionPlanListId = approve.ActionPlanListId; + newApprove.ApproveMan = approve.ApproveMan; + newApprove.ApproveDate = approve.ApproveDate; + newApprove.ApproveIdea = approve.ApproveIdea; + newApprove.IsAgree = approve.IsAgree; + newApprove.ApproveType = approve.ApproveType; + newApprove.SignType = approve.SignType; + newApprove.Edition = approve.Edition; + db.ActionPlan_ActionPlanListApprove.InsertOnSubmit(newApprove); + db.SubmitChanges(); + } + } + public static List getListDataForApi(string ActionPlanListId, int edition) + { + using (var db = new Model.SGGLDB(Funs.ConnString)) + { + var q = from x in db.ActionPlan_ActionPlanListApprove + where x.ActionPlanListId == ActionPlanListId && x.Edition == edition && x.ApproveDate != null && x.ApproveType != "S" + orderby x.ApproveDate + select new + { + x.ActionPlanListApproveId, + x.ActionPlanListId, + x.ApproveMan, + ApproveManName = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), + x.ApproveDate, + x.IsAgree, + x.ApproveIdea, + x.ApproveType, + x.SignType, + }; + var list = q.ToList(); + List res = new List(); + foreach (var item in list) + { + Model.ActionPlan_ActionPlanListApprove ap = new Model.ActionPlan_ActionPlanListApprove(); + ap.ActionPlanListApproveId = item.ActionPlanListApproveId; + ap.ActionPlanListId = item.ActionPlanListId; + ap.ApproveMan = item.ApproveMan + "$" + item.ApproveManName; + ap.ApproveDate = item.ApproveDate; + ap.IsAgree = item.IsAgree; + ap.ApproveIdea = item.ApproveIdea; + ap.ApproveType = item.ApproveType; + ap.SignType = item.SignType; + ap.AttachUrl = AttachFileService.getFileUrl(ap.ActionPlanListApproveId); + res.Add(ap); + } + return res; + } + } + public static List getListDataForApi(string ActionPlanListId) + { + using (var db = new Model.SGGLDB(Funs.ConnString)) + { + var q = from x in db.ActionPlan_ActionPlanListApprove + where x.ActionPlanListId == ActionPlanListId && x.ApproveDate != null && x.ApproveType != "S" + orderby x.ApproveDate + select new + { + x.ActionPlanListApproveId, + x.ActionPlanListId, + x.ApproveMan, + ApproveManName = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), + x.ApproveDate, + x.IsAgree, + x.ApproveIdea, + x.ApproveType, + x.SignType, + }; + var list = q.ToList(); + List res = new List(); + foreach (var item in list) + { + Model.ActionPlan_ActionPlanListApprove ap = new Model.ActionPlan_ActionPlanListApprove(); + ap.ActionPlanListApproveId = item.ActionPlanListApproveId; + ap.ActionPlanListId = item.ActionPlanListId; + ap.ApproveMan = item.ApproveMan + "$" + item.ApproveManName; + ap.ApproveDate = item.ApproveDate; + ap.IsAgree = item.IsAgree; + ap.ApproveIdea = item.ApproveIdea; + ap.ApproveType = item.ApproveType; + ap.SignType = item.SignType; + ap.AttachUrl = AttachFileService.getFileUrl(ap.ActionPlanListApproveId); + res.Add(ap); + } + return res; + } + } + public static Model.ActionPlan_ActionPlanListApprove getCurrApproveForApi(string ActionPlanListId, string approveMan, int edition) + { + using (var db = new Model.SGGLDB(Funs.ConnString)) + { + Model.ActionPlan_ActionPlanListApprove newApprove = db.ActionPlan_ActionPlanListApprove.FirstOrDefault(e => e.ActionPlanListId == ActionPlanListId && e.ApproveMan == approveMan && e.Edition == edition && e.ApproveType != "S" && e.ApproveDate == null); + if (newApprove != null) + { + newApprove.ApproveIdea = Person_PersonsService.GetPersonsNameById(newApprove.ApproveMan); + } + return newApprove; + } + } + public static List getConApproveForApi(string ActionPlanListId, int edition) + { + using (var db = new Model.SGGLDB(Funs.ConnString)) + { + List res = new List(); + var newApproves = db.ActionPlan_ActionPlanListApprove.Where(e => e.ActionPlanListId == ActionPlanListId && e.Edition == edition && e.ApproveType == "2").ToList(); + if (newApproves != null) + { + foreach (Model.ActionPlan_ActionPlanListApprove newApprove in newApproves) + { + Model.ActionPlan_ActionPlanListApprove a = new Model.ActionPlan_ActionPlanListApprove(); + a.ActionPlanListApproveId = newApprove.ActionPlanListApproveId; + a.ActionPlanListId = newApprove.ActionPlanListId; + a.ApproveDate = newApprove.ApproveDate; + a.ApproveMan = newApprove.ApproveMan; + a.ApproveType = newApprove.ApproveType; + a.Edition = newApprove.Edition; + a.IsAgree = newApprove.IsAgree; + var name = Person_PersonsService.GetPersonsNameById(newApprove.ApproveMan); + if (!string.IsNullOrEmpty(name)) + { + a.ApproveMan = a.ApproveMan + "$" + name; + } + a.AttachUrl = AttachFileService.getFileUrl(a.ActionPlanListApproveId); + res.Add(a); + } + } + return res; + } + } + public static List getConApprovesForApi(string ActionPlanListId, int edition) + { + using (var db = new Model.SGGLDB(Funs.ConnString)) + { + List res = new List(); + var newApproves = db.ActionPlan_ActionPlanListApprove.Where(e => e.ActionPlanListId == ActionPlanListId && e.Edition == edition).ToList(); + if (newApproves != null) + { + foreach (Model.ActionPlan_ActionPlanListApprove newApprove in newApproves) + { + Model.ActionPlan_ActionPlanListApprove a = new Model.ActionPlan_ActionPlanListApprove(); + a.ActionPlanListApproveId = newApprove.ActionPlanListApproveId; + a.ActionPlanListId = newApprove.ActionPlanListId; + a.ApproveDate = newApprove.ApproveDate; + a.ApproveMan = newApprove.ApproveMan; + a.ApproveType = newApprove.ApproveType; + a.Edition = newApprove.Edition; + a.IsAgree = newApprove.IsAgree; + var name = Person_PersonsService.GetPersonsNameById(newApprove.ApproveMan); + if (!string.IsNullOrEmpty(name)) + { + a.ApproveMan = a.ApproveMan + "$" + name; + } + a.AttachUrl = AttachFileService.getFileUrl(a.ActionPlanListApproveId); + res.Add(a); + } + } + return res; + } + } + public static Model.ActionPlan_ActionPlanListApprove UpdateActionPlanListApproveForApi(Model.ActionPlan_ActionPlanListApprove approve) + { + using (var db = new Model.SGGLDB(Funs.ConnString)) + { + Model.ActionPlan_ActionPlanListApprove newApprove = db.ActionPlan_ActionPlanListApprove.First(e => e.ActionPlanListApproveId == approve.ActionPlanListApproveId); + if (!string.IsNullOrEmpty(approve.ActionPlanListId)) + newApprove.ActionPlanListId = approve.ActionPlanListId; + if (!string.IsNullOrEmpty(approve.ApproveMan)) + newApprove.ApproveMan = approve.ApproveMan; + if (approve.ApproveDate.HasValue) + newApprove.ApproveDate = approve.ApproveDate; + if (!string.IsNullOrEmpty(approve.ApproveIdea)) + newApprove.ApproveIdea = approve.ApproveIdea; + if (approve.IsAgree.HasValue) + newApprove.IsAgree = approve.IsAgree; + if (!string.IsNullOrEmpty(approve.ApproveType)) + newApprove.ApproveType = approve.ApproveType; + + db.SubmitChanges(); + AttachFileService.updateAttachFile(approve.AttachUrl, newApprove.ActionPlanListApproveId, Const.ProjectActionPlanListMenuId); + return newApprove; + } + } + } +} diff --git a/SGGL/BLL/HSSE/ActionPlan/ActionPlanListService.cs b/SGGL/BLL/HSSE/ActionPlan/ActionPlanListService.cs index ddef556d..d7527ef5 100644 --- a/SGGL/BLL/HSSE/ActionPlan/ActionPlanListService.cs +++ b/SGGL/BLL/HSSE/ActionPlan/ActionPlanListService.cs @@ -45,6 +45,10 @@ namespace BLL ActionPlanListName = actionPlanList.ActionPlanListName, VersionNo = actionPlanList.VersionNo, ProjectType = actionPlanList.ProjectType, + Edition = actionPlanList.Edition, + IsReview = actionPlanList.IsReview, + ReviewMan = actionPlanList.ReviewMan, + IsCompanyReview = actionPlanList.IsCompanyReview, ActionPlanListContents = actionPlanList.ActionPlanListContents, CompileMan = actionPlanList.CompileMan, CompileDate = actionPlanList.CompileDate, @@ -72,6 +76,10 @@ namespace BLL newActionPlanList.ActionPlanListName = actionPlanList.ActionPlanListName; newActionPlanList.VersionNo = actionPlanList.VersionNo; newActionPlanList.ProjectType = actionPlanList.ProjectType; + newActionPlanList.Edition = actionPlanList.Edition; + newActionPlanList.IsReview = actionPlanList.IsReview; + newActionPlanList.ReviewMan = actionPlanList.ReviewMan; + newActionPlanList.IsCompanyReview = actionPlanList.IsCompanyReview; newActionPlanList.ActionPlanListContents = actionPlanList.ActionPlanListContents; newActionPlanList.CompileMan = actionPlanList.CompileMan; newActionPlanList.CompileDate = actionPlanList.CompileDate; @@ -89,6 +97,7 @@ namespace BLL Model.ActionPlan_ActionPlanList actionPlanList = Funs.DB.ActionPlan_ActionPlanList.FirstOrDefault(e => e.ActionPlanListId == actionPlanListId); if (actionPlanList != null) { + BLL.ActionPlanListApproveService.DeleteActionPlanListApprovesByActionPlanListId(actionPlanListId); ////删除审核流程表 BLL.CommonService.DeleteFlowOperateByID(actionPlanList.ActionPlanListId); ///删除附件 @@ -99,5 +108,68 @@ namespace BLL Funs.DB.SubmitChanges(); } } + + /// + /// 把状态转换代号为文字形式 + /// + /// + /// + /// + public static string ConvertState(object state) + { + if (state != null) + { + if (state.ToString() == BLL.Const.ActionPlanList_ReCompile) + { + return "重报"; + } + else if (state.ToString() == BLL.Const.ActionPlanList_Compile) + { + return "编制"; + } + else if (state.ToString() == BLL.Const.ActionPlanList_Audit) + { + return "会签"; + } + else if (state.ToString() == BLL.Const.ActionPlanList_Review) + { + return "评审负责人办理"; + } + else if (state.ToString() == BLL.Const.ActionPlanList_Reviewing) + { + return "施工管理部评审"; + } + else if (state.ToString() == BLL.Const.ActionPlanList_Review2) + { + return "评审负责人办理"; + } + else if (state.ToString() == BLL.Const.ActionPlanList_Complete) + { + return "审批完成"; + } + } + return ""; + } + + public static string IsAgree(Object type, Object res) + { + string result = string.Empty; + if (type.ToString().Equals(Const.ActionPlanList_ReCompile) || type.ToString().Equals(Const.ActionPlanList_Compile)) + { + res = null; + } + if (res != null) + { + if (Convert.ToBoolean(res)) + { + result = "是"; + } + else + { + result = "否"; + } + } + return result; + } } } diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index f5bfeea4..a04267e9 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -40,6 +40,7 @@ 3 AnyCPU false + 7.2 pdbonly @@ -1534,6 +1535,9 @@ + + + @@ -13373,6 +13377,27 @@ WorkSummaryReportEdit.aspx + + ActionPlanList.aspx + ASPXCodeBehind + + + ActionPlanList.aspx + + + ActionPlanListEdit.aspx + ASPXCodeBehind + + + ActionPlanListEdit.aspx + + + ActionPlanListView.aspx + ASPXCodeBehind + + + ActionPlanListView.aspx + MainPlan.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/HSSE/ActionPlan/ActionPlanList.aspx b/SGGL/FineUIPro.Web/HSSE/ActionPlan/ActionPlanList.aspx index 3ef2bd7c..c5feb531 100644 --- a/SGGL/FineUIPro.Web/HSSE/ActionPlan/ActionPlanList.aspx +++ b/SGGL/FineUIPro.Web/HSSE/ActionPlan/ActionPlanList.aspx @@ -66,12 +66,20 @@ RendererFunction="renderProjectType"> - - + + + + + + + + + + @@ -90,7 +98,7 @@