From 3d1e4f63388b801db3ffc859ac6f35465430b20e Mon Sep 17 00:00:00 2001 From: "754998852@qq.com" <754998852@qq.com> Date: Wed, 4 Sep 2024 16:31:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=89=E5=85=A8=E6=9C=88?= =?UTF-8?q?=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SGGLDB_WH_V2024-09-04-01phf.sql | 48 ++++++++ .../SGGLDB_WH_V2024-09-04-phf.sql | 21 ++++ .../ManagerMonthC/MonthReportCService.cs | 1 + SGGL/BLL/SQLHelper.cs | 39 +++++++ SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 2 +- .../HSSE/Manager/ManagerMonthCEdit.aspx.cs | 110 ++++++++++-------- 6 files changed, 172 insertions(+), 49 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_WH_V2024-09-04-01phf.sql create mode 100644 DataBase/版本日志/SGGLDB_WH_V2024-09-04-phf.sql diff --git a/DataBase/版本日志/SGGLDB_WH_V2024-09-04-01phf.sql b/DataBase/版本日志/SGGLDB_WH_V2024-09-04-01phf.sql new file mode 100644 index 00000000..8caf1c2d --- /dev/null +++ b/DataBase/版本日志/SGGLDB_WH_V2024-09-04-01phf.sql @@ -0,0 +1,48 @@ +Create PROCEDURE [dbo].[SpGetHsseKq] + @ProjectId nvarchar(50),/**/ + @startTime nvarchar(50),/*ʼʱ*/ + @endTime nvarchar(50),/*ʱ*/ + @UnitId nvarchar(50),/*0ûеλ 1ְ 2廷*/ + @returnVal int output +AS +/*ȡȫ±*/ +declare @sql nvarchar(500), +@kqcount int; + +IF(@UnitId='0') +BEGIN +select @returnVal=count(*) from ( select IdentityCard FROM SitePerson_Checking WHERE PROJECTID=''+@ProjectId+'' AND IntoOut='1' +AND IntoOutTime>=''+@startTime+'' AND IntoOutTime<=''+@endTime+'' Group by IdentityCard,CONVERT(varchar(100), IntoOutTime, 23) +)f; + +--select @sql= N' SELECT @kqcount= count(*) from (select IdentityCard FROM SitePerson_Checking WHERE PROJECTID='''+@ProjectId+''' AND IntoOut=''1'' +-- AND IntoOutTime>='''+@startTime+''' AND IntoOutTime<='''+@endTime+''' Group by IdentityCard,CONVERT(varchar(100), IntoOutTime, 23))f +--'; +--EXEC sp_executesql @sql, N'@kqcount int OUTPUT', @kqcount OUTPUT ; +--set @returnVal=@kqcount; + + +END +else +begin + if(@UnitId='1') + begin + select @returnVal=count(*) from ( select IdentityCard FROM SitePerson_Checking WHERE PROJECTID=''+@ProjectId+'' AND IntoOut='1' + AND IntoOutTime>=''+@startTime+'' AND IntoOutTime<=''+@endTime+'' + and UnitId<>'6d29ed79-e20a-4c19-bb91-d280ea2e442e' + Group by IdentityCard,CONVERT(varchar(100), IntoOutTime, 23) + )f; + + end + else + begin + select @returnVal=count(*) from ( select IdentityCard FROM SitePerson_Checking WHERE PROJECTID=''+@ProjectId+'' AND IntoOut='1' + AND IntoOutTime>=''+@startTime+'' AND IntoOutTime<=''+@endTime+'' + and UnitId='6d29ed79-e20a-4c19-bb91-d280ea2e442e' + Group by IdentityCard,CONVERT(varchar(100), IntoOutTime, 23) + )f; + + end + + +end \ No newline at end of file diff --git a/DataBase/版本日志/SGGLDB_WH_V2024-09-04-phf.sql b/DataBase/版本日志/SGGLDB_WH_V2024-09-04-phf.sql new file mode 100644 index 00000000..59fc28d6 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_WH_V2024-09-04-phf.sql @@ -0,0 +1,21 @@ +--޸Գ˵ +update sys_menu set SortIndex=0 where menuid='BC860C85-B224-48A6-B207-D7042BB71088'; + +update sys_menu set menuname='ϵͳʲ' where MenuId='F0E06491-B1DA-4510-ABCA-D09F4B24EE50'; + +update sys_menu set menuname='Գ¼' where MenuId='29F80818-17A5-4BC0-8C38-A17415B0AC83'; + +update sys_menu set menuname='ͶԳ¼' where MenuId='B62482DA-9A12-45AC-9427-D0CF8A78EE2C'; + +update sys_menu set menuname='ʦĿܽ' where MenuId='9EBA628D-E725-4A0B-B765-171F405D0821'; + +--ִٶȻе +CREATE INDEX ProjectId_Index ON SitePerson_Checking (ProjectId); +CREATE INDEX IdentityCard_Index ON SitePerson_Checking (IdentityCard); +CREATE INDEX IntoOutTime_Index ON SitePerson_Checking (IntoOutTime); +CREATE INDEX IntoOut_Index ON SitePerson_Checking (IntoOut); +CREATE INDEX UnitId ON SitePerson_Checking (UnitId); + +CREATE NONCLUSTERED INDEX [SitePerson_Checking_ProjectId_IntoOut_IntoOutTime_Index] +ON [dbo].[SitePerson_Checking] ([ProjectId],[IntoOut],[IntoOutTime]) +INCLUDE ([IdentityCard]); \ No newline at end of file diff --git a/SGGL/BLL/HSSE/Manager/ManagerMonthC/MonthReportCService.cs b/SGGL/BLL/HSSE/Manager/ManagerMonthC/MonthReportCService.cs index faca8a61..1be3270b 100644 --- a/SGGL/BLL/HSSE/Manager/ManagerMonthC/MonthReportCService.cs +++ b/SGGL/BLL/HSSE/Manager/ManagerMonthC/MonthReportCService.cs @@ -369,5 +369,6 @@ namespace BLL db.SubmitChanges(); } #endregion + } } diff --git a/SGGL/BLL/SQLHelper.cs b/SGGL/BLL/SQLHelper.cs index 2a79f500..936a0602 100644 --- a/SGGL/BLL/SQLHelper.cs +++ b/SGGL/BLL/SQLHelper.cs @@ -972,5 +972,44 @@ namespace BLL maxId = GetIntValue(str); return maxId; } + + /// + /// ͨ洢̻ȡ + /// + /// + /// + public static int RunProcGetHsseKq(string ProjectId,DateTime startTime,DateTime endTime,string UnitId) + { + string str = ""; + using (SqlConnection Connection = new SqlConnection(connectionString)) + { + try + { + Connection.Open(); + SqlCommand command = new SqlCommand("SpGetHsseKq", Connection) + { + CommandTimeout = 0, + CommandType = CommandType.StoredProcedure + }; + SqlParameter[] values = new SqlParameter[] + { + new SqlParameter("@ProjectId", ProjectId), + new SqlParameter("@startTime", startTime.ToString()), + new SqlParameter("@endTime", endTime.ToString()), + new SqlParameter("@UnitId", UnitId), + new SqlParameter("@returnVal", SqlDbType.Int) + }; + command.Parameters.AddRange(values); + command.Parameters["@returnVal"].Direction = ParameterDirection.Output; + command.ExecuteNonQuery(); + str = command.Parameters["@returnVal"].Value.ToString(); + } + finally + { + Connection.Close(); + } + return Convert.ToInt32(str); + } + } } } diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index fec7f569..29220861 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -19232,7 +19232,7 @@ - +