From 71eac2c7a937d3a4ce5a84e63e6ad4dbfd23f1cc Mon Sep 17 00:00:00 2001 From: gaofei1985 <181547018@qq.com> Date: Wed, 26 Jul 2023 09:35:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E5=92=8C=E5=AE=9E=E6=96=BD?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DataBase/版本日志/SGGLDB_V2023-07-25.sql | 25 +++++++++- SGGL/BLL/Common/Const.cs | 5 ++ .../HSSE/ActionPlan/ActionPlanList.aspx.cs | 47 ++++++++++++++++--- .../ZHGL/Plan/ActionPlanList.aspx.cs | 47 ++++++++++++++++--- SGGL/Model/Model.cs | 4 +- 5 files changed, 113 insertions(+), 15 deletions(-) diff --git a/DataBase/版本日志/SGGLDB_V2023-07-25.sql b/DataBase/版本日志/SGGLDB_V2023-07-25.sql index 97a8e7a0..92e4826a 100644 --- a/DataBase/版本日志/SGGLDB_V2023-07-25.sql +++ b/DataBase/版本日志/SGGLDB_V2023-07-25.sql @@ -24,4 +24,27 @@ 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 +GO + + +CREATE VIEW [dbo].[View_WBS] +AS +select '1' as Id,'0' as SupId ,'JZ' as Code, '' as Name,'ProjectType' as WBSType, +ProjectId from dbo.WBS_UnitWork +Union +select UnitWorkId as Id,ProjectType as SupId ,UnitWorkCode as Code, UnitWorkCode+'-'+UnitWorkName as Name,'UnitWork' as WBSType, +ProjectId from dbo.WBS_UnitWork +Union all +select WorkPackageId as id,UnitWorkId as SupId,WorkPackageCode as Code, PackageContent as Name,'WorkPackage' as WBSType, +ProjectId from dbo.WBS_WorkPackage w where IsApprove=1 and SuperWorkPackageId is null +Union all +select WorkPackageId as id,SuperWorkPackageId as SupId,WorkPackageCode as Code, PackageContent as Name,'WorkPackage' as WBSType, +ProjectId from dbo.WBS_WorkPackage w where IsApprove=1 and SuperWorkPackageId is not null + + + + + +GO + + diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index e5b1a509..2d1365e0 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -211,6 +211,11 @@ /// public const string Depart_constructionId = "ab1eb44a-1821-48ee-86f2-64b7e6425efa"; + /// + ///公司领导部门id + /// + public const string Depart_CompanyLeaderId = "c09c17b7-742a-4d1e-aa26-5470b6782d1e"; + /// ///测试项目id /// diff --git a/SGGL/FineUIPro.Web/HSSE/ActionPlan/ActionPlanList.aspx.cs b/SGGL/FineUIPro.Web/HSSE/ActionPlan/ActionPlanList.aspx.cs index 307a7d79..bba2f340 100644 --- a/SGGL/FineUIPro.Web/HSSE/ActionPlan/ActionPlanList.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/ActionPlan/ActionPlanList.aspx.cs @@ -600,8 +600,10 @@ namespace FineUIPro.Web.HSSE.ActionPlan } var approves = db.ActionPlan_ActionPlanListApprove.Where(x => x.ActionPlanListId == Id && x.ApproveType == BLL.Const.ActionPlanList_Reviewing).ToList(); var ActionPlan_ActionPlanListApproveList2 = db.ActionPlan_ActionPlanListApprove.Where(x => x.ActionPlanListId == Id && x.ApproveType == "6").ToList(); + DateTime date = DateTime.Now; if (ActionPlan_ActionPlanListApproveList2.Count > 0 || approves.Count > 0) { + date = ActionPlan_ActionPlanListApproveList2.OrderByDescending(x => x.ApproveDate).FirstOrDefault().ApproveDate.Value; #region 主要评审部门 //主要评审部门 builder.InsertCell(); @@ -782,9 +784,20 @@ namespace FineUIPro.Web.HSSE.ActionPlan builder.Font.Bold = true; builder.RowFormat.Height = 40; builder.Write("公司安全总监/部门负责人:"); - builder.Write(" 年"); - builder.Write(" 月"); - builder.Write(" 日"); + var personAQ = BLL.Person_PersonsService.GetPerson_PersonsById("905a75d6-e733-449f-9742-4dcd71e8d2e1"); //安全总监任学宁 + if (!string.IsNullOrEmpty(personAQ.SignatureUrl) && File.Exists(rootPath + personAQ.SignatureUrl)) + { + var file = rootPath + personAQ.SignatureUrl; + builder.InsertImage(file, 80, 20); + builder.Write(date.ToString().Split(' ')[0]); + } + else + { + builder.Write(personAQ.PersonName + " " + date.ToString().Split(' ')[0]); + } + //builder.Write(" 年"); + //builder.Write(" 月"); + //builder.Write(" 日"); builder.EndRow(); builder.InsertCell(); @@ -805,9 +818,31 @@ namespace FineUIPro.Web.HSSE.ActionPlan builder.Font.Bold = true; builder.RowFormat.Height = 40; builder.Write("公司主管生产/安全领导:"); - builder.Write(" 年"); - builder.Write(" 月"); - builder.Write(" 日"); + var GSLDApprove = (from x in db.ActionPlan_ActionPlanListApprove + join y in db.Person_Persons + on x.ApproveMan equals y.PersonId + where x.ActionPlanListId == Id && x.DepartId == BLL.Const.Depart_CompanyLeaderId + select x).FirstOrDefault(); + if (GSLDApprove != null) + { + var personGSLD = BLL.Person_PersonsService.GetPerson_PersonsById(GSLDApprove.ApproveMan); + if (!string.IsNullOrEmpty(personGSLD.SignatureUrl) && File.Exists(rootPath + personGSLD.SignatureUrl)) + { + var file = rootPath + personGSLD.SignatureUrl; + builder.InsertImage(file, 80, 20); + builder.Write(GSLDApprove.ApproveDate.ToString().Split(' ')[0]); + } + else + { + builder.Write(personGSLD.PersonName + " " + GSLDApprove.ApproveDate.ToString().Split(' ')[0]); + } + } + else + { + builder.Write(" 年"); + builder.Write(" 月"); + builder.Write(" 日"); + } builder.EndRow(); builder.Font.Bold = false; diff --git a/SGGL/FineUIPro.Web/ZHGL/Plan/ActionPlanList.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Plan/ActionPlanList.aspx.cs index a2920c36..6cb6ae07 100644 --- a/SGGL/FineUIPro.Web/ZHGL/Plan/ActionPlanList.aspx.cs +++ b/SGGL/FineUIPro.Web/ZHGL/Plan/ActionPlanList.aspx.cs @@ -582,8 +582,10 @@ namespace FineUIPro.Web.ZHGL.Plan } var approves = db.ActionPlan_ActionPlanListApprove.Where(x => x.ActionPlanListId == Id && x.ApproveType == BLL.Const.ActionPlanList_Reviewing).ToList(); var ActionPlan_ActionPlanListApproveList2 = db.ActionPlan_ActionPlanListApprove.Where(x => x.ActionPlanListId == Id && x.ApproveType == "6").ToList(); + DateTime date = DateTime.Now; if (ActionPlan_ActionPlanListApproveList2.Count > 0 || approves.Count > 0) { + date = ActionPlan_ActionPlanListApproveList2.OrderByDescending(x => x.ApproveDate).FirstOrDefault().ApproveDate.Value; #region 主要评审部门 //主要评审部门 builder.InsertCell(); @@ -764,9 +766,20 @@ namespace FineUIPro.Web.ZHGL.Plan builder.Font.Bold = true; builder.RowFormat.Height = 40; builder.Write("公司安全总监/部门负责人:"); - builder.Write(" 年"); - builder.Write(" 月"); - builder.Write(" 日"); + var personAQ = BLL.Person_PersonsService.GetPerson_PersonsById("905a75d6-e733-449f-9742-4dcd71e8d2e1"); //安全总监任学宁 + if (!string.IsNullOrEmpty(personAQ.SignatureUrl) && File.Exists(rootPath + personAQ.SignatureUrl)) + { + var file = rootPath + personAQ.SignatureUrl; + builder.InsertImage(file, 80, 20); + builder.Write(date.ToString().Split(' ')[0]); + } + else + { + builder.Write(personAQ.PersonName + " " + date.ToString().Split(' ')[0]); + } + //builder.Write(" 年"); + //builder.Write(" 月"); + //builder.Write(" 日"); builder.EndRow(); builder.InsertCell(); @@ -787,9 +800,31 @@ namespace FineUIPro.Web.ZHGL.Plan builder.Font.Bold = true; builder.RowFormat.Height = 40; builder.Write("公司主管生产/安全领导:"); - builder.Write(" 年"); - builder.Write(" 月"); - builder.Write(" 日"); + var GSLDApprove = (from x in db.ActionPlan_ActionPlanListApprove + join y in db.Person_Persons + on x.ApproveMan equals y.PersonId + where x.ActionPlanListId == Id && x.DepartId == BLL.Const.Depart_CompanyLeaderId + select x).FirstOrDefault(); + if (GSLDApprove != null) + { + var personGSLD = BLL.Person_PersonsService.GetPerson_PersonsById(GSLDApprove.ApproveMan); + if (!string.IsNullOrEmpty(personGSLD.SignatureUrl) && File.Exists(rootPath + personGSLD.SignatureUrl)) + { + var file = rootPath + personGSLD.SignatureUrl; + builder.InsertImage(file, 80, 20); + builder.Write(GSLDApprove.ApproveDate.ToString().Split(' ')[0]); + } + else + { + builder.Write(personGSLD.PersonName + " " + GSLDApprove.ApproveDate.ToString().Split(' ')[0]); + } + } + else + { + builder.Write(" 年"); + builder.Write(" 月"); + builder.Write(" 日"); + } builder.EndRow(); builder.Font.Bold = false; diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 1660bfb2..8b5f4777 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -11402,7 +11402,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ApproveIdea", DbType="NVarChar(200)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ApproveIdea", DbType="NVarChar(2000)")] public string ApproveIdea { get @@ -148713,7 +148713,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AttentPerson", DbType="NVarChar(500)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AttentPerson", DbType="NVarChar(3000)")] public string AttentPerson { get