diff --git a/.vs/SGGL_SeDin/v17/.wsuo b/.vs/SGGL_SeDin/v17/.wsuo
index 1488becb..b58594d2 100644
Binary files a/.vs/SGGL_SeDin/v17/.wsuo and b/.vs/SGGL_SeDin/v17/.wsuo differ
diff --git a/DataBase/版本日志/SGGLDB_V2023-08-04.sql b/DataBase/版本日志/SGGLDB_V2023-08-04.sql
new file mode 100644
index 00000000..165baecc
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2023-08-04.sql
@@ -0,0 +1,174 @@
+
+ alter table Sys_HttpLog add MeThod nvarchar(50)
+ go
+
+INSERT Sys_Menu (MenuId,MenuName,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
+VALUES ( N'831FA803-E2E9-4674-9B56-44E5A5DDCB1A',N'ԶϱŶԽ',10,N'0',N'Menu_ZHGL',1,0,1)
+
+INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsEnd,IsUsed)
+VALUES('FFD221D7-AE05-447F-8727-80058A04F401','ӿ','TaskScheduling/InterFace/InterFaceSet.aspx',20,'831FA803-E2E9-4674-9B56-44E5A5DDCB1A','Menu_ZHGL',1,1)
+GO
+INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex)
+VALUES ( N'3D57D9D0-163A-493A-93B4-FF34F7ECD05A',N'FFD221D7-AE05-447F-8727-80058A04F401',N'',1)
+INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex)
+VALUES ( N'518962FE-4E79-4812-8CCD-2EC351DA1EB7',N'FFD221D7-AE05-447F-8727-80058A04F401',N'',2)
+INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex)
+VALUES ( N'65C09E8A-1C07-4155-A970-AE2D3DADA794',N'FFD221D7-AE05-447F-8727-80058A04F401',N'ɾ',3)
+INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex)
+VALUES ( N'A4617107-FF92-4446-B037-6D2E15CAAE5C',N'FFD221D7-AE05-447F-8727-80058A04F401',N'',4)
+INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsEnd,IsUsed)
+VALUES('FFD221D7-AE05-447F-8727-80058A04F402','嵥','TaskScheduling/InterFace/InterFaceTask.aspx',30,'831FA803-E2E9-4674-9B56-44E5A5DDCB1A','Menu_ZHGL',1,1)
+GO
+INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex)
+VALUES ( N'0AA0B45D-28B8-4DEE-9BEE-0CFF08DB42BD',N'FFD221D7-AE05-447F-8727-80058A04F402',N'',1)
+INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex)
+VALUES ( N'77D8A100-82E3-4640-ABB9-61DDB66A1596',N'FFD221D7-AE05-447F-8727-80058A04F402',N'',2)
+INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex)
+VALUES ( N'D8621A85-7D2D-4AA8-9C80-321B82FAC36F',N'FFD221D7-AE05-447F-8727-80058A04F402',N'ɾ',3)
+INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex)
+VALUES ( N'9E233D11-8160-41A0-AAC6-FAA472E839BD',N'FFD221D7-AE05-447F-8727-80058A04F402',N'',4)
+INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsEnd,IsUsed)
+VALUES('FFD221D7-AE05-447F-8727-80058A04F404','ݵ־','TaskScheduling/InterFace/IFLogList.aspx',40,'831FA803-E2E9-4674-9B56-44E5A5DDCB1A','Menu_ZHGL',1,1)
+GO
+ go
+ CREATE TABLE [dbo].[InterFaceLog](
+ [InterFaceLogId] [nvarchar](50) NOT NULL,
+ [UserId] [nvarchar](50) NULL,
+ [UnitId] [nvarchar](50) NULL,
+ [InterFaceName] [nchar](10) NULL,
+ [InterFaceUrl] [varchar](max) NULL,
+ [InterFaceMehtod] [nchar](10) NULL,
+ [InterFaceBody] [varchar](max) NULL,
+ [InterFaceReturnData] [varchar](max) NULL,
+ [InterFaceLogDate] [datetime] NULL,
+ [InterFaceType] [nvarchar](50) NULL,
+ [LogSate] [bit] NULL,
+ [IP] [nvarchar](50) NULL,
+ CONSTRAINT [PK_InterFaceLog] PRIMARY KEY CLUSTERED
+(
+ [InterFaceLogId] ASC
+)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
+) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
+
+GO
+
+SET ANSI_PADDING OFF
+GO
+
+
+
+CREATE TABLE [dbo].[InterFaceSet](
+ [InterFaceSetId] [nvarchar](50) NOT NULL,
+ [InterFaceName] [nvarchar](100) NULL,
+ [InterFaceUrl] [nvarchar](500) NULL,
+ [UrlReqMethod] [varchar](50) NULL,
+ [UnitId] [nvarchar](50) NULL,
+ [AuthUnitIds] [nvarchar](1020) NULL,
+ [AuthUnitName] [nvarchar](2000) NULL,
+ [IsOpen] [bit] NULL,
+ [ValidPeriod] [nvarchar](20) NULL,
+ [TxtRemarks] [nvarchar](2000) NULL,
+ [InterFaceForUrl] [nvarchar](500) NULL,
+ [ForUrlReqMethod] [varchar](50) NULL,
+ [IsCallBack] [bit] NULL,
+ [InterFaceCallBackUrl] [nvarchar](500) NULL,
+ [CallBackUrlReqMethod] [varchar](50) NULL,
+ CONSTRAINT [PK_InterFaceSet] PRIMARY KEY CLUSTERED
+(
+ [InterFaceSetId] 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
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ӿñ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InterFaceSet', @level2type=N'COLUMN',@level2name=N'InterFaceSetId'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ӿ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InterFaceSet', @level2type=N'COLUMN',@level2name=N'InterFaceName'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ӿڵַ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InterFaceSet', @level2type=N'COLUMN',@level2name=N'InterFaceUrl'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Դλ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InterFaceSet', @level2type=N'COLUMN',@level2name=N'UnitId'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ȩλɶѡʹãƴ20' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InterFaceSet', @level2type=N'COLUMN',@level2name=N'AuthUnitIds'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ƿ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InterFaceSet', @level2type=N'COLUMN',@level2name=N'IsOpen'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ƶʣƴ߿ʱ磺08-1215-1822-24' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InterFaceSet', @level2type=N'COLUMN',@level2name=N'ValidPeriod'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ע' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InterFaceSet', @level2type=N'COLUMN',@level2name=N'TxtRemarks'
+GO
+
+
+
+CREATE TABLE [dbo].[InterFaceTask](
+ [InterFaceTaskId] [nvarchar](50) NOT NULL,
+ [InterFaceName] [nvarchar](100) NULL,
+ [InterFaceSetLists] [nvarchar](max) NULL,
+ [Frequency] [nchar](10) NULL,
+ [CreateTime] [datetime] NULL,
+ [Enable] [bit] NULL,
+ CONSTRAINT [PK_InterFaceDetail] PRIMARY KEY CLUSTERED
+(
+ [InterFaceTaskId] ASC
+)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
+) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
+
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ӿ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InterFaceTask', @level2type=N'COLUMN',@level2name=N'InterFaceName'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ӿϢ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InterFaceTask', @level2type=N'COLUMN',@level2name=N'InterFaceSetLists'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ƶ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InterFaceTask', @level2type=N'COLUMN',@level2name=N'Frequency'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InterFaceTask', @level2type=N'COLUMN',@level2name=N'CreateTime'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ƿ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InterFaceTask', @level2type=N'COLUMN',@level2name=N'Enable'
+GO
+
+
+delete from Sys_Const where GroupId='InterfacePopup';
+
+insert into Sys_Const ([ID],[ConstText],[ConstValue],[SortIndex],[GroupId]) values (NEWID(),'AccidentEvent', '/DataShow/Accident.aspx',1,'InterfacePopup') --¹¼
+insert into Sys_Const ([ID],[ConstText],[ConstValue],[SortIndex],[GroupId]) values (NEWID(),'ConstructionEquipment', '/DataShow/ConstructionEquipment.aspx',1,'InterfacePopup')--ʩ豸
+insert into Sys_Const ([ID],[ConstText],[ConstValue],[SortIndex],[GroupId]) values (NEWID(),'EmergencyManagement', '/DataShow/Emergency.aspx',1,'InterfacePopup')--Ӧ
+insert into Sys_Const ([ID],[ConstText],[ConstValue],[SortIndex],[GroupId]) values (NEWID(),'EnvironmentalData', '/DataShow/Environmental.aspx',1,'InterfacePopup')--
+insert into Sys_Const ([ID],[ConstText],[ConstValue],[SortIndex],[GroupId]) values (NEWID(),'HiddenRectification', '/DataShow/HiddenRectification.aspx',1,'InterfacePopup')--Ų
+insert into Sys_Const ([ID],[ConstText],[ConstValue],[SortIndex],[GroupId]) values (NEWID(),'HighRiskWorkPermit', '/DataShow/License.aspx',1,'InterfacePopup')--߷ҵ
+insert into Sys_Const ([ID],[ConstText],[ConstValue],[SortIndex],[GroupId]) values (NEWID(),'LargeDangerousProject', '/DataShow/LargeEngineering.aspx',1,'InterfacePopup')--Σ
+insert into Sys_Const ([ID],[ConstText],[ConstValue],[SortIndex],[GroupId]) values (NEWID(),'ProjectInfomation', '/DataShow/Project.aspx',1,'InterfacePopup')--ĿϢ
+insert into Sys_Const ([ID],[ConstText],[ConstValue],[SortIndex],[GroupId]) values (NEWID(),'SafeCheck', '/DataShow/Check.aspx',1,'InterfacePopup')--ȫල
+insert into Sys_Const ([ID],[ConstText],[ConstValue],[SortIndex],[GroupId]) values (NEWID(),'SafeCost', '/DataShow/SecurityCost.aspx',1,'InterfacePopup')--ȫ
+insert into Sys_Const ([ID],[ConstText],[ConstValue],[SortIndex],[GroupId]) values (NEWID(),'SafePerson_Branch', '/DataShow/CompanyPerson.aspx',1,'InterfacePopup')--֧
+insert into Sys_Const ([ID],[ConstText],[ConstValue],[SortIndex],[GroupId]) values (NEWID(),'SafePerson_HeadOffice', '/DataShow/CompanyPerson.aspx',1,'InterfacePopup')--ҵܲ
+insert into Sys_Const ([ID],[ConstText],[ConstValue],[SortIndex],[GroupId]) values (NEWID(),'SafePerson_ProjectPerson', '/DataShow/ProjectPerson.aspx',1,'InterfacePopup')--ĿԱ
+insert into Sys_Const ([ID],[ConstText],[ConstValue],[SortIndex],[GroupId]) values (NEWID(),'SafeRiskData', '/DataShow/SecurityRisk.aspx',1,'InterfacePopup')--ȫ
+insert into Sys_Const ([ID],[ConstText],[ConstValue],[SortIndex],[GroupId]) values (NEWID(),'SafeTrainData', '/DataShow/EduTrain.aspx',1,'InterfacePopup')--ȫѵ
+insert into Sys_Const ([ID],[ConstText],[ConstValue],[SortIndex],[GroupId]) values (NEWID(),'SafetyMeetingData', '/DataShow/Meeting.aspx',1,'InterfacePopup')--ȫ
+insert into Sys_Const ([ID],[ConstText],[ConstValue],[SortIndex],[GroupId]) values (NEWID(),'WorkingHourData', '/DataShow/WorkingHours.aspx',1,'InterfacePopup')--ʱ
+insert into Sys_Const ([ID],[ConstText],[ConstValue],[SortIndex],[GroupId]) values (NEWID(),'QualityTrainingData', '/DataShow/QualityTraining.aspx',1,'InterfacePopup')--ѵ
+insert into Sys_Const ([ID],[ConstText],[ConstValue],[SortIndex],[GroupId]) values (NEWID(),'MeasuringInstrumentsData', '/DataShow/QualityInstruments.aspx',1,'InterfacePopup')--
+insert into Sys_Const ([ID],[ConstText],[ConstValue],[SortIndex],[GroupId]) values (NEWID(),'ManagerData', '/DataShow/QualityPerson.aspx',1,'InterfacePopup')--Ա
+insert into Sys_Const ([ID],[ConstText],[ConstValue],[SortIndex],[GroupId]) values (NEWID(),'QualityProblem', '/DataShow/QualityProblem.aspx',1,'InterfacePopup')--
+insert into Sys_Const ([ID],[ConstText],[ConstValue],[SortIndex],[GroupId]) values (NEWID(),'QualityControlPoint', '/DataShow/QualityControlPoint.aspx',1,'InterfacePopup')--Ƶ
+insert into Sys_Const ([ID],[ConstText],[ConstValue],[SortIndex],[GroupId]) values (NEWID(),'QualityAcceptance', '/DataShow/QualityAcceptance.aspx',1,'InterfacePopup')--
+insert into Sys_Const ([ID],[ConstText],[ConstValue],[SortIndex],[GroupId]) values (NEWID(),'ProjectDivision', '/DataShow/ProjectDivision.aspx',1,'InterfacePopup')--̻
+insert into Sys_Const ([ID],[ConstText],[ConstValue],[SortIndex],[GroupId]) values (NEWID(),'HjData', '/DataShow/HJGLWelding.aspx',1,'InterfacePopup')--
+insert into Sys_Const ([ID],[ConstText],[ConstValue],[SortIndex],[GroupId]) values (NEWID(),'DefectAnalysis', '/DataShow/HJGLDefect.aspx',1,'InterfacePopup')--ȱݷ
+
+insert into Sys_Const ([ID],[ConstText],[ConstValue],[SortIndex],[GroupId]) values (NEWID(),'', 'http://114.247.88.97:20080/',1,'SafeReferer')--referer
+insert into Sys_Const ([ID],[ConstText],[ConstValue],[SortIndex],[GroupId]) values (NEWID(),'nbd', 'https://lygcgs.com.cn/',1,'SafeReferer')--referer
diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj
index 7a509cd3..4d65d650 100644
--- a/SGGL/BLL/BLL.csproj
+++ b/SGGL/BLL/BLL.csproj
@@ -67,6 +67,9 @@
..\packages\Microsoft.Bcl.AsyncInterfaces.5.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll
+
+ ..\packages\Microsoft.Extensions.Logging.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll
+
..\packages\Microsoft.Office.Interop.Excel.15.0.4795.1000\lib\net20\Microsoft.Office.Interop.Excel.dll
True
@@ -104,6 +107,9 @@
..\packages\QRCoder.1.4.3\lib\net40\QRCoder.dll
+
+ ..\packages\Quartz.3.5.0\lib\netstandard2.0\Quartz.dll
+
..\packages\RestSharp.106.15.0\lib\net452\RestSharp.dll
@@ -112,8 +118,15 @@
..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll
+
+ ..\packages\System.Configuration.ConfigurationManager.4.7.0\lib\net461\System.Configuration.ConfigurationManager.dll
+
+
+
+ ..\packages\System.Diagnostics.DiagnosticSource.4.7.1\lib\net46\System.Diagnostics.DiagnosticSource.dll
+
@@ -122,6 +135,7 @@
..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll
+
@@ -131,7 +145,18 @@
..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll
+
+
+ ..\packages\System.Security.AccessControl.4.7.0\lib\net461\System.Security.AccessControl.dll
+
+
+ ..\packages\System.Security.Permissions.4.7.0\lib\net461\System.Security.Permissions.dll
+
+
+ ..\packages\System.Security.Principal.Windows.4.7.0\lib\net461\System.Security.Principal.Windows.dll
+
+
..\packages\System.Text.Encodings.Web.5.0.0\lib\net461\System.Text.Encodings.Web.dll
@@ -141,6 +166,7 @@
..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll
+
..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll
@@ -653,12 +679,20 @@
+
+
+
+
+
+
+
+
diff --git a/SGGL/BLL/Common/CommonService.cs b/SGGL/BLL/Common/CommonService.cs
index beaa8f91..983748f1 100644
--- a/SGGL/BLL/Common/CommonService.cs
+++ b/SGGL/BLL/Common/CommonService.cs
@@ -327,6 +327,20 @@ namespace BLL
}
#endregion
+ #region 得到本单位信息
+ ///
+ /// 得到本单位信息
+ ///
+ ///
+ public static Model.Base_Unit GetIsThisUnit()
+ {
+ string thisUnitId = BLL.Const.UnitId_SEDIN;
+ var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
+ return base_Unit;
+ }
+ #endregion
+
+
///
/// 是否赛鼎或分公司
///
diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs
index b8934340..12f4d746 100644
--- a/SGGL/BLL/Common/Const.cs
+++ b/SGGL/BLL/Common/Const.cs
@@ -1,4 +1,6 @@
-namespace BLL
+using System;
+
+namespace BLL
{
public static class Const
{
@@ -62,6 +64,10 @@
/// 微信订阅模板ID
///
public const string WX_TemplateID = "hKFrcahyXEjGSrLM4qBPpjXAkFldnrqxU_mARd1IF4o";
+ ///
+ /// 时间书签(用于筛选数据范围)
+ ///
+ public static DateTime DtmarkTime = DateTime.Parse("2023-01-01");
#endregion
#region 按钮描述
@@ -4803,6 +4809,13 @@
/// 实业数据
///
public const string SYHSEData_SYHSEMenuId = "64EE5EC2-F725-4656-9110-5AF83C18FB6C";
+
+ ///
+ /// 接口设置
+ ///
+ public const string InterFaceSetMenuId = "FFD221D7-AE05-447F-8727-80058A04F401";
+ public const string InterFaceTaskMenuId = "FFD221D7-AE05-447F-8727-80058A04F402";
+ public const string IFLogListMenuId = "FFD221D7-AE05-447F-8727-80058A04F404";
#endregion
#region 数据同步状态
diff --git a/SGGL/BLL/Common/ConstValue.cs b/SGGL/BLL/Common/ConstValue.cs
index 681602b5..a94e5291 100644
--- a/SGGL/BLL/Common/ConstValue.cs
+++ b/SGGL/BLL/Common/ConstValue.cs
@@ -92,6 +92,15 @@ namespace BLL
{
return Funs.DB.Sys_Const.FirstOrDefault(e => e.ConstValue == constValue && e.GroupId == groupId);
}
+ public static void DeleteConstValueBygroupId(string groupId)
+ {
+ var q = Funs.DB.Sys_Const.Where(x => x.GroupId == groupId);
+ if (q != null)
+ {
+ Funs.DB.Sys_Const.DeleteAllOnSubmit(q.ToList());
+ Funs.DB.SubmitChanges();
+ }
+ }
#region 根据多ID得到名称字符串
///
@@ -376,6 +385,14 @@ namespace BLL
/// 作业状态 -危大工程清单 组id
///
public const string Group_WorkStates = "WorkStates";
+ ///
+ /// 子公司弹窗界面
+ ///
+ public const string Group_InterfacePopup = "InterfacePopup";
+ ///
+ /// 穿透界面Referer白名单
+ ///
+ public const string Group_SafeReferer = "SafeReferer";
#endregion
}
}
\ No newline at end of file
diff --git a/SGGL/BLL/Common/Funs.cs b/SGGL/BLL/Common/Funs.cs
index 59a84938..1a17c65b 100644
--- a/SGGL/BLL/Common/Funs.cs
+++ b/SGGL/BLL/Common/Funs.cs
@@ -3,12 +3,15 @@ namespace BLL
using MiniExcelLibs;
using Model;
using NPOI.SS.Formula.Functions;
+ using Quartz;
+ using RestSharp;
using System;
using System.Collections.Generic;
using System.Data;
using System.Globalization;
using System.IO;
using System.Linq;
+ using System.Net;
using System.Reflection;
using System.Text;
@@ -33,7 +36,11 @@ namespace BLL
return dataBaseLinkList;
}
}
-
+ public static IScheduler ScheduledTasks
+ {
+ get;
+ set;
+ }
///
/// ݿַ
@@ -1311,7 +1318,34 @@ namespace BLL
}
}
}
+ public static string RequestGet(string Baseurl, string Token)
+ {
+ ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
+ var client = new RestClient(Baseurl);
+ client.Timeout = -1;
+ var request = new RestRequest(Method.GET);
+ request.AddHeader("token", Token);
+ IRestResponse response = client.Execute(request);
+ Console.WriteLine(response.Content);
+ return response.Content;
+ }
+ public static string RequestPost(string Baseurl, string Token, string JsonBody)
+ {
+ ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
+
+ var client = new RestClient(Baseurl);
+ client.Timeout = -1;
+ var request = new RestRequest(Method.POST);
+ request.AddHeader("token", Token);
+ if (!string.IsNullOrEmpty(JsonBody))
+ {
+ request.AddJsonBody(JsonBody);
+ }
+
+ IRestResponse response = client.Execute(request);
+ return response.Content;
+ }
}
}
diff --git a/SGGL/BLL/DropListService.cs b/SGGL/BLL/DropListService.cs
index 6911bff9..343bac2d 100644
--- a/SGGL/BLL/DropListService.cs
+++ b/SGGL/BLL/DropListService.cs
@@ -1,4 +1,6 @@
-namespace BLL
+using System.Collections.Generic;
+
+namespace BLL
{
using System.Linq;
using System.Web.UI.WebControls;
@@ -427,5 +429,15 @@
return list;
}
#endregion
+
+ // 定义允许上传的文件类型列表
+ public static List allowExtensions = new List
+ {
+ ".txt", ".doc", ".docx", ".pdf", ".xls", ".xlsx", ".ppt",".pptx",// 文本和办公文档文件类型
+ ".jpg", ".jpeg", ".png", ".bmp", ".gif", // 图片文件类型
+ ".mp3", ".wav", ".wma", ".ogg", ".ape", ".flac", // 音频文件类型
+ ".mp4", ".avi", ".flv", ".wmv", ".mov", ".rmvb", // 视频文件类型
+ ".zip", ".rar", ".7z" // 压缩包文件类型
+ };
}
}
diff --git a/SGGL/BLL/SysManage/LogService.cs b/SGGL/BLL/SysManage/LogService.cs
index 551618ac..83601548 100644
--- a/SGGL/BLL/SysManage/LogService.cs
+++ b/SGGL/BLL/SysManage/LogService.cs
@@ -73,7 +73,37 @@ namespace BLL
}
}
}
-
+ ///
+ /// Ӳ־
+ ///
+ ///
+ ///
+ public static void AddLog(string userId, string opLog)
+ {
+ //SetOvertime(userId);
+ Model.SGGLDB db = Funs.DB;
+ Model.Sys_Log log = new Model.Sys_Log
+ {
+ LogId = SQLHelper.GetNewID(typeof(Model.Sys_Log)),
+ HostName = Dns.GetHostName()
+ };
+ IPAddress[] ips = Dns.GetHostAddresses(log.HostName);
+ if (ips.Length > 0)
+ {
+ foreach (IPAddress ip in ips)
+ {
+ if (ip.ToString().IndexOf('.') != -1)
+ {
+ log.Ip = ip.ToString();
+ }
+ }
+ }
+ log.OperationTime = DateTime.Now;
+ log.OperationLog = opLog;
+ log.UserId = userId;
+ db.Sys_Log.InsertOnSubmit(log);
+ db.SubmitChanges();
+ }
///
/// Ӳ־
///
diff --git a/SGGL/BLL/SysManage/SysHttplogService.cs b/SGGL/BLL/SysManage/SysHttplogService.cs
new file mode 100644
index 00000000..12bcfdf7
--- /dev/null
+++ b/SGGL/BLL/SysManage/SysHttplogService.cs
@@ -0,0 +1,143 @@
+using FineUIPro;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+
+namespace BLL
+{
+
+ public static class SysHttplogService
+ {
+ public static Model.SGGLDB db = Funs.DB;
+
+
+ #region 获取列表
+ ///
+ /// 记录数
+ ///
+ public static int count
+ {
+ get;
+ set;
+ }
+ public static List GetSys_HttpLogByModle(Model.Sys_HttpLog table)
+ {
+ var q = from x in db.Sys_HttpLog
+ where
+ (string.IsNullOrEmpty(table.HttpLogId) || x.HttpLogId.Contains(table.HttpLogId)) &&
+ (string.IsNullOrEmpty(table.UserName) || x.UserName.Contains(table.UserName)) &&
+ (string.IsNullOrEmpty(table.HttpUrl) || x.HttpUrl.Contains(table.HttpUrl)) &&
+ (string.IsNullOrEmpty(table.LogTxt) || x.LogTxt.Contains(table.LogTxt)) &&
+ (string.IsNullOrEmpty(table.MeThod) || x.MeThod.Contains(table.MeThod)) //&&
+ // (!table.LogTime.HasValue || (x.LogTime.HasValue && x.LogTime.Value.Date == table.LogTime.Value.Date))
+
+ select x
+ ;
+ if (table.LogTime.HasValue)
+ {
+ q = q.Where(x => x.LogTime.Value.Date.CompareTo(table.LogTime.Value.Date) == 0);
+ }
+ return q.OrderByDescending(x => x.LogTime).ToList();
+ }
+
+ /// 获取分页列表
+ ///
+ /// 页码
+ /// 每页数量
+ ///
+ public static IEnumerable getListData(Model.Sys_HttpLog table, Grid Grid1)
+ {
+ var q = GetSys_HttpLogByModle(table);
+ count = q.Count();
+ if (count == 0)
+ {
+ return null;
+ }
+ q = q.Skip(Grid1.PageSize * (Grid1.PageIndex)).Take(Grid1.PageSize).ToList();
+ // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
+ return from x in q
+ select new
+ {
+ x.HttpLogId,
+ x.LogTime,
+ x.UserName,
+ x.HttpUrl,
+ x.LogTxt,
+ x.MeThod,
+
+ };
+ }
+ #endregion
+
+ public static Model.Sys_HttpLog GetSys_HttpLogById(string HttpLogId)
+ {
+ return db.Sys_HttpLog.FirstOrDefault(x => x.HttpLogId == HttpLogId);
+ }
+
+
+ public static void AddSys_HttpLog(Model.Sys_HttpLog newtable)
+ {
+
+ Model.Sys_HttpLog table = new Model.Sys_HttpLog
+ {
+ HttpLogId = newtable.HttpLogId,
+ LogTime = newtable.LogTime,
+ UserName = newtable.UserName,
+ HttpUrl = newtable.HttpUrl,
+ LogTxt = newtable.LogTxt,
+ MeThod = newtable.MeThod,
+ };
+ db.Sys_HttpLog.InsertOnSubmit(table);
+ db.SubmitChanges();
+ }
+
+ public static void AddBulkSys_HttpLog(List newtables)
+ {
+
+ db.Sys_HttpLog.InsertAllOnSubmit(newtables);
+ db.SubmitChanges();
+ }
+
+
+ public static void UpdateSys_HttpLog(Model.Sys_HttpLog newtable)
+ {
+
+ Model.Sys_HttpLog table = db.Sys_HttpLog.FirstOrDefault(x => x.HttpLogId == newtable.HttpLogId);
+ if (table != null)
+ {
+ table.HttpLogId = newtable.HttpLogId;
+ table.LogTime = newtable.LogTime;
+ table.UserName = newtable.UserName;
+ table.HttpUrl = newtable.HttpUrl;
+ table.LogTxt = newtable.LogTxt;
+ table.MeThod = newtable.MeThod;
+ db.SubmitChanges();
+ }
+
+ }
+ public static void DeleteSys_HttpLogById(string HttpLogId)
+ {
+
+ Model.Sys_HttpLog table = db.Sys_HttpLog.FirstOrDefault(x => x.HttpLogId == HttpLogId);
+ if (table != null)
+ {
+ db.Sys_HttpLog.DeleteOnSubmit(table);
+ db.SubmitChanges();
+ }
+
+ }
+
+ public static void DeleteALLSys_HttpLog()
+ {
+ if (db.Sys_HttpLog != null)
+ {
+ db.Sys_HttpLog.DeleteAllOnSubmit(db.Sys_HttpLog);
+ db.SubmitChanges();
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/SGGL/BLL/TaskScheduling/InterFaceService/DataForJTApiService.cs b/SGGL/BLL/TaskScheduling/InterFaceService/DataForJTApiService.cs
new file mode 100644
index 00000000..c72bcb90
--- /dev/null
+++ b/SGGL/BLL/TaskScheduling/InterFaceService/DataForJTApiService.cs
@@ -0,0 +1,132 @@
+namespace BLL
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ public static class DataForJTApiService
+ {
+ public static Model.SGGLDB db = Funs.DB;
+
+ ///
+ /// ȡӿϢ
+ ///
+ /// Id
+ /// ӿϢ
+ public static Model.InterFaceSet GetFaceSetById(string InterFaceSetId)
+ {
+ return Funs.DB.InterFaceSet.FirstOrDefault(e => e.InterFaceSetId == InterFaceSetId);
+ }
+
+ ///
+ /// ӽӿϢ
+ ///
+ /// ӿ
+ public static void AddFaceSet(Model.InterFaceSet faceset)
+ {
+ Model.SGGLDB db = Funs.DB;
+ string newKeyID = SQLHelper.GetNewID(typeof(Model.InterFaceSet));
+ Model.InterFaceSet newSet = new Model.InterFaceSet
+ {
+ InterFaceSetId = newKeyID,
+ InterFaceName = faceset.InterFaceName,
+ AuthUnitIds = faceset.AuthUnitIds,
+ AuthUnitName = faceset.AuthUnitName,
+ InterFaceUrl = faceset.InterFaceUrl,
+ ValidPeriod = faceset.ValidPeriod,
+ UnitId = faceset.UnitId,
+ TxtRemarks = faceset.TxtRemarks,
+ IsOpen = faceset.IsOpen,
+ };
+ db.InterFaceSet.InsertOnSubmit(newSet);
+ db.SubmitChanges();
+ }
+
+ ///
+ /// ĽӿϢ
+ ///
+ /// ӿʵ
+ public static void UpdateFaceSet(Model.InterFaceSet user)
+ {
+ Model.SGGLDB db = Funs.DB;
+ Model.InterFaceSet newSet = db.InterFaceSet.FirstOrDefault(e => e.InterFaceSetId == user.InterFaceSetId);
+ if (newSet != null)
+ {
+ newSet.InterFaceName = user.InterFaceName;
+ newSet.AuthUnitIds = user.AuthUnitIds;
+ newSet.AuthUnitName = user.AuthUnitName;
+ newSet.InterFaceUrl = user.InterFaceUrl;
+ newSet.UnitId = user.UnitId;
+ newSet.ValidPeriod = user.ValidPeriod;
+ newSet.UnitId = user.UnitId;
+ newSet.TxtRemarks = user.TxtRemarks;
+ newSet.IsOpen = user.IsOpen;
+ db.SubmitChanges();
+ }
+ }
+
+
+ ///
+ /// IdɾϢ
+ ///
+ ///
+ public static void DeleteFaceSet(string SetId)
+ {
+ Model.SGGLDB db = Funs.DB;
+ Model.InterFaceSet FaceSet = db.InterFaceSet.FirstOrDefault(e => e.InterFaceSetId == SetId);
+ if (FaceSet != null)
+ {
+ var logs = from x in db.Sys_Log where x.UserId == SetId select x;
+ if (logs.Count() > 0)
+ {
+ db.Sys_Log.DeleteAllOnSubmit(logs);
+ }
+ db.InterFaceSet.DeleteOnSubmit(FaceSet);
+ db.SubmitChanges();
+ }
+ }
+
+ /////
+ ///// ϱݼ¼
+ /////
+ ///// ϱ
+ /////
+ //public static string SaveUpData(Model.InterFaceItem newItem)
+ //{
+ // if (newItem.FaceLogDate.Count() == 0)
+ // return "ݲΪգ";
+ // using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString))
+ // {
+ // List InterFaceLogIdList=new List ();
+ // List logList = new List();
+ // string message = string.Empty;
+ // var InterFaceSetList = db.InterFaceSet.Where(x => x.InterFaceName != "");
+ // foreach (var item in newItem.FaceLogDate)
+ // {
+ // //ýӿƴ ݱ
+ // var faceset = InterFaceSetList.FirstOrDefault(p => p.InterFaceName == item.InterFaceName);
+ // if (faceset != null)
+ // {
+ // Model.InterFaceLog FaceLog = new Model.InterFaceLog();
+ // FaceLog.InterFaceLogId = Guid.NewGuid().ToString();
+ // FaceLog.TxtContent = item.TxtContent;
+ // FaceLog.InterFaceLogDate = Convert.ToDateTime(item.InterFaceLogDate);
+ // FaceLog.LogSate = false;
+ // FaceLog.CollCropCode = item.CollCropCode;
+ // FaceLog.IP = item.IP;
+ // FaceLog.UnitId = item.UnitId;
+ // FaceLog.InterFaceDetailId ="";
+ // logList.Add(FaceLog);
+ // }
+ // else //ýӿƲ ¼ǰʾ
+ // {
+ // InterFaceLogIdList.Add(item.InterFaceName);
+ // }
+ // }
+ // db.InterFaceLog.InsertAllOnSubmit(logList);
+ // db.SubmitChanges();
+ // }
+ // return "ͬɹ";
+ //}
+ }
+}
diff --git a/SGGL/BLL/TaskScheduling/InterFaceService/InterFaceLogService .cs b/SGGL/BLL/TaskScheduling/InterFaceService/InterFaceLogService .cs
new file mode 100644
index 00000000..073b2938
--- /dev/null
+++ b/SGGL/BLL/TaskScheduling/InterFaceService/InterFaceLogService .cs
@@ -0,0 +1,186 @@
+using FineUIPro;
+using Newtonsoft.Json;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Drawing.Printing;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+
+
+namespace BLL
+{
+
+ public static class InterFaceLogService
+ {
+ public static Model.SGGLDB db = Funs.DB;
+
+ public const string Type1 = "上报";
+ public const string Type2= "下发";
+ public const string Type3 = "回调";
+
+ #region 获取列表
+ ///
+ /// 记录数
+ ///
+ public static int count
+ {
+ get;
+ set;
+ }
+ public static List GetInterFaceLogByModle(Model.InterFaceLog table)
+ {
+ var q= from x in db.InterFaceLog
+ where
+ ( string.IsNullOrEmpty(table.InterFaceLogId)||x.InterFaceLogId.Contains(table.InterFaceLogId)) &&
+ ( string.IsNullOrEmpty(table.UserId)||x.UserId.Contains(table.UserId)) &&
+ ( string.IsNullOrEmpty(table.UnitId)||x.UnitId.Contains(table.UnitId)) &&
+ ( string.IsNullOrEmpty(table.InterFaceName)||x.InterFaceName.Contains(table.InterFaceName)) &&
+ ( string.IsNullOrEmpty(table.InterFaceUrl)||x.InterFaceUrl.Contains(table.InterFaceUrl)) &&
+ ( string.IsNullOrEmpty(table.InterFaceMehtod)||x.InterFaceMehtod.Contains(table.InterFaceMehtod)) &&
+ ( string.IsNullOrEmpty(table.InterFaceBody)||x.InterFaceBody.Contains(table.InterFaceBody)) &&
+ ( string.IsNullOrEmpty(table.InterFaceReturnData)||x.InterFaceReturnData.Contains(table.InterFaceReturnData)) &&
+ ( string.IsNullOrEmpty(table.InterFaceType)||x.InterFaceType.Contains(table.InterFaceType)) &&
+ ( string.IsNullOrEmpty(table.IP)||x.IP.Contains(table.IP))
+ orderby x.InterFaceLogDate descending
+ select x
+ ;
+
+ return q.ToList();
+ }
+
+ /// 获取分页列表
+ ///
+ /// 页码
+ /// 每页数量
+ ///
+ public static IEnumerable getListData(Model.InterFaceLog table, Grid Grid1)
+ {
+ var q= GetInterFaceLogByModle(table);
+ count = q.Count();
+ if (count == 0)
+ {
+ return null;
+ }
+ q = q.Skip(Grid1.PageSize * (Grid1.PageIndex)).Take(Grid1.PageSize).ToList();
+ // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
+ return (from x in q
+ select new
+ {
+ x.InterFaceLogId,
+ x.UserId,
+ x.UnitId,
+ x.InterFaceName,
+ x.InterFaceUrl,
+ x.InterFaceMehtod,
+ x.InterFaceBody,
+ x.InterFaceReturnData,
+ x.InterFaceLogDate,
+ x.InterFaceType,
+ x.LogSate,
+ x.IP,
+
+ });
+ }
+ #endregion
+
+ public static Model.InterFaceLog GetInterFaceLogById(string InterFaceLogId)
+ {
+ return db.InterFaceLog.FirstOrDefault(x=>x.InterFaceLogId==InterFaceLogId);
+ }
+
+
+ public static void AddInterFaceLog(Model.InterFaceLog newtable)
+ {
+
+
+ Model.InterFaceLog table = new Model.InterFaceLog{
+ InterFaceLogId=newtable.InterFaceLogId,
+ UserId=newtable.UserId,
+ UnitId=newtable.UnitId,
+ InterFaceName=newtable.InterFaceName,
+ InterFaceUrl=newtable.InterFaceUrl,
+ InterFaceMehtod=newtable.InterFaceMehtod,
+ InterFaceBody=newtable.InterFaceBody,
+ InterFaceReturnData=newtable.InterFaceReturnData,
+ InterFaceLogDate=newtable.InterFaceLogDate,
+ InterFaceType=newtable.InterFaceType,
+ LogSate=newtable.LogSate,
+ IP=newtable.IP,
+ };
+ Funs.DB.InterFaceLog.InsertOnSubmit(table);
+ Funs.DB.SubmitChanges();
+ }
+ public static void WriteInterFaceLog(string InterFaceSetlId, string InterFaceBody, string ReturnData, string InterFaceType,bool isSuccess)
+ {
+ var InterfaceSetModel = InterFaceSetService.GetInterFaceSetById(InterFaceSetlId);
+ Model.InterFaceLog table = new Model.InterFaceLog();
+ table.InterFaceLogId = SQLHelper.GetNewID(typeof(Model.InterFaceLog));
+ table.UserId = Const.sysglyId;
+ table.InterFaceLogDate = DateTime.Now;
+ table.IP = "";
+ table.InterFaceName = InterfaceSetModel.InterFaceName;
+ table.InterFaceBody = InterFaceBody;
+ table.InterFaceReturnData = ReturnData;
+ table.InterFaceType = InterFaceType;
+ table.LogSate = isSuccess;
+ switch (InterFaceType)
+ {
+ case Type1:
+ table.UnitId = InterfaceSetModel.UnitId;
+ table.InterFaceUrl = InterfaceSetModel.InterFaceUrl;
+ table.InterFaceMehtod = InterfaceSetModel.UrlReqMethod;
+
+ break;
+ case Type2:
+ table.UnitId = InterfaceSetModel.AuthUnitIds;
+ table.InterFaceUrl = InterfaceSetModel.InterFaceForUrl;
+ table.InterFaceMehtod = InterfaceSetModel.ForUrlReqMethod;
+ break;
+ case Type3:
+ table.UnitId = InterfaceSetModel.UnitId;
+ table.InterFaceUrl = InterfaceSetModel.InterFaceCallBackUrl;
+ table.InterFaceMehtod = InterfaceSetModel.CallBackUrlReqMethod;
+ break;
+ }
+ Funs.DB.InterFaceLog.InsertOnSubmit(table);
+ Funs.DB.SubmitChanges();
+ }
+
+ public static void UpdateInterFaceLog(Model.InterFaceLog newtable)
+ {
+
+ Model.InterFaceLog table = db.InterFaceLog.FirstOrDefault(x=>x.InterFaceLogId==newtable.InterFaceLogId);
+ if (table != null)
+ {
+ table.InterFaceLogId=newtable.InterFaceLogId;
+ table.UserId=newtable.UserId;
+ table.UnitId=newtable.UnitId;
+ table.InterFaceName=newtable.InterFaceName;
+ table.InterFaceUrl=newtable.InterFaceUrl;
+ table.InterFaceMehtod=newtable.InterFaceMehtod;
+ table.InterFaceBody=newtable.InterFaceBody;
+ table.InterFaceReturnData=newtable.InterFaceReturnData;
+ table.InterFaceLogDate=newtable.InterFaceLogDate;
+ table.InterFaceType=newtable.InterFaceType;
+ table.LogSate=newtable.LogSate;
+ table.IP=newtable.IP;
+ Funs.DB.SubmitChanges();
+ }
+
+ }
+ public static void DeleteInterFaceLogById (string InterFaceLogId)
+ {
+
+ Model.InterFaceLog table =Funs.DB.InterFaceLog.FirstOrDefault(x=>x.InterFaceLogId==InterFaceLogId);
+ if (table != null)
+ {
+ Funs.DB.InterFaceLog.DeleteOnSubmit(table);
+ Funs.DB.SubmitChanges();
+ }
+
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/SGGL/BLL/TaskScheduling/InterFaceService/InterFaceSetService .cs b/SGGL/BLL/TaskScheduling/InterFaceService/InterFaceSetService .cs
new file mode 100644
index 00000000..15f62596
--- /dev/null
+++ b/SGGL/BLL/TaskScheduling/InterFaceService/InterFaceSetService .cs
@@ -0,0 +1,184 @@
+using FineUIPro;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+
+namespace BLL
+{
+
+ public static class InterFaceSetService
+ {
+
+
+ #region 获取列表
+ ///
+ /// 记录数
+ ///
+ public static int count
+ {
+ get;
+ set;
+ }
+ public static List GetInterFaceSetByModle(Model.InterFaceSet table)
+ {
+ var q= from x in Funs.DB.InterFaceSet
+ where
+ ( string.IsNullOrEmpty(table.InterFaceSetId)||x.InterFaceSetId.Contains(table.InterFaceSetId)) &&
+ ( string.IsNullOrEmpty(table.InterFaceName)||x.InterFaceName.Contains(table.InterFaceName)) &&
+ ( string.IsNullOrEmpty(table.InterFaceUrl)||x.InterFaceUrl.Contains(table.InterFaceUrl)) &&
+ ( string.IsNullOrEmpty(table.UnitId)||x.UnitId.Contains(table.UnitId)) &&
+ ( string.IsNullOrEmpty(table.AuthUnitIds)||x.AuthUnitIds.Contains(table.AuthUnitIds)) &&
+ ( string.IsNullOrEmpty(table.AuthUnitName)||x.AuthUnitName.Contains(table.AuthUnitName)) &&
+ ( string.IsNullOrEmpty(table.ValidPeriod)||x.ValidPeriod.Contains(table.ValidPeriod)) &&
+ ( string.IsNullOrEmpty(table.TxtRemarks)||x.TxtRemarks.Contains(table.TxtRemarks)) &&
+ ( string.IsNullOrEmpty(table.InterFaceForUrl)||x.InterFaceForUrl.Contains(table.InterFaceForUrl)) &&
+ ( string.IsNullOrEmpty(table.InterFaceCallBackUrl)||x.InterFaceCallBackUrl.Contains(table.InterFaceCallBackUrl))
+ select x
+ ;
+
+ return q.ToList();
+ }
+
+ /// 获取分页列表
+ ///
+ /// 页码
+ /// 每页数量
+ ///
+ public static IEnumerable getListData(Model.InterFaceSet table, Grid Grid1)
+ {
+ var q= GetInterFaceSetByModle(table);
+ count = q.Count();
+ if (count == 0)
+ {
+ return null;
+ }
+ // q= q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList();
+ // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
+ return from x in q
+ select new
+ {
+ x.InterFaceSetId,
+ x.InterFaceName,
+ x.InterFaceUrl,
+ x.UnitId,
+ x.AuthUnitIds,
+ x.AuthUnitName,
+ x.IsOpen,
+ x.ValidPeriod,
+ x.TxtRemarks,
+ x.InterFaceForUrl,
+ x.IsCallBack,
+ x.InterFaceCallBackUrl,
+ x.UrlReqMethod,
+ x.CallBackUrlReqMethod,
+ x.ForUrlReqMethod
+
+ };
+ }
+ #endregion
+
+ public static Model.InterFaceSet GetInterFaceSetById(string InterFaceSetId)
+ {
+ return Funs.DB.InterFaceSet.FirstOrDefault(x=>x.InterFaceSetId==InterFaceSetId);
+ }
+ public static List GetInterFaceSets()
+ {
+ var q = (from x in Funs.DB.InterFaceSet select x).ToList();
+ return q;
+ }
+
+ public static void AddInterFaceSet(Model.InterFaceSet newtable)
+ {
+
+ Model.InterFaceSet table = new Model.InterFaceSet{
+ InterFaceSetId=newtable.InterFaceSetId,
+ InterFaceName=newtable.InterFaceName,
+ InterFaceUrl=newtable.InterFaceUrl,
+ UnitId=newtable.UnitId,
+ AuthUnitIds=newtable.AuthUnitIds,
+ AuthUnitName=newtable.AuthUnitName,
+ IsOpen=newtable.IsOpen,
+ ValidPeriod=newtable.ValidPeriod,
+ TxtRemarks=newtable.TxtRemarks,
+ InterFaceForUrl=newtable.InterFaceForUrl,
+ IsCallBack=newtable.IsCallBack,
+ InterFaceCallBackUrl=newtable.InterFaceCallBackUrl,
+ UrlReqMethod=newtable.UrlReqMethod,
+ ForUrlReqMethod=newtable.ForUrlReqMethod,
+ CallBackUrlReqMethod= newtable.CallBackUrlReqMethod,
+ };
+ Funs.DB.InterFaceSet.InsertOnSubmit(table);
+ Funs.DB.SubmitChanges();
+ }
+
+
+ public static void UpdateInterFaceSet(Model.InterFaceSet newtable)
+ {
+
+ Model.InterFaceSet table = Funs.DB.InterFaceSet.FirstOrDefault(x=>x.InterFaceSetId==newtable.InterFaceSetId);
+ if (table != null)
+ {
+ table.InterFaceSetId=newtable.InterFaceSetId;
+ table.InterFaceName=newtable.InterFaceName;
+ table.InterFaceUrl=newtable.InterFaceUrl;
+ table.UnitId=newtable.UnitId;
+ table.AuthUnitIds=newtable.AuthUnitIds;
+ table.AuthUnitName=newtable.AuthUnitName;
+ table.IsOpen=newtable.IsOpen;
+ table.ValidPeriod=newtable.ValidPeriod;
+ table.TxtRemarks=newtable.TxtRemarks;
+ table.InterFaceForUrl=newtable.InterFaceForUrl;
+ table.IsCallBack=newtable.IsCallBack;
+ table.InterFaceCallBackUrl=newtable.InterFaceCallBackUrl;
+ table.UrlReqMethod=newtable.UrlReqMethod;
+ table.ForUrlReqMethod=newtable.ForUrlReqMethod;
+ table.CallBackUrlReqMethod=newtable.CallBackUrlReqMethod;
+ Funs.DB.SubmitChanges();
+ }
+
+ }
+ public static void DeleteInterFaceSetById (string InterFaceSetId)
+ {
+
+ Model.InterFaceSet table =Funs.DB.InterFaceSet.FirstOrDefault(x=>x.InterFaceSetId==InterFaceSetId);
+ if (table != null)
+ {
+ Funs.DB.InterFaceSet.DeleteOnSubmit(table);
+ Funs.DB.SubmitChanges();
+ }
+
+ }
+ public static void InitInterFaceDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
+ {
+ dropName.DataValueField = "InterFaceSetId";
+ dropName.DataTextField = "InterFaceName";
+ dropName.DataSource = GetInterFaceSets();
+ dropName.DataBind();
+ if (isShowPlease)
+ {
+ Funs.FineUIPleaseSelect(dropName);
+ }
+ }
+ public static ListItem[] GetReqMethod()
+ {
+ ListItem[] listItem = new ListItem[2];
+ listItem[0] = new ListItem("Get", "Get");
+ listItem[1] = new ListItem("Post", "Post");
+ return listItem;
+ }
+ public static void InitReqMethodDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
+ {
+ dropName.DataValueField = "Value";
+ dropName.DataTextField = "Text";
+ dropName.DataSource = GetReqMethod();
+ dropName.DataBind();
+ if (isShowPlease)
+ {
+ Funs.FineUIPleaseSelect(dropName);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/SGGL/BLL/TaskScheduling/InterFaceService/InterFaceTaskService .cs b/SGGL/BLL/TaskScheduling/InterFaceService/InterFaceTaskService .cs
new file mode 100644
index 00000000..ce3b8fe3
--- /dev/null
+++ b/SGGL/BLL/TaskScheduling/InterFaceService/InterFaceTaskService .cs
@@ -0,0 +1,323 @@
+using FineUIPro;
+using Model;
+using Newtonsoft.Json;
+using Quartz;
+using RestSharp;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+
+namespace BLL
+{
+
+ public static class InterFaceTaskService
+ {
+ public static Model.SGGLDB db = Funs.DB;
+
+
+ #region 获取列表
+ ///
+ /// 记录数
+ ///
+ public static int count
+ {
+ get;
+ set;
+ }
+ public static List GetInterFaceTaskByModle(Model.InterFaceTask table)
+ {
+ var q= from x in db.InterFaceTask
+ where
+ ( string.IsNullOrEmpty(table.InterFaceTaskId)||x.InterFaceTaskId.Contains(table.InterFaceTaskId)) &&
+ ( string.IsNullOrEmpty(table.InterFaceName)||x.InterFaceName.Contains(table.InterFaceName)) &&
+ ( string.IsNullOrEmpty(table.InterFaceSetLists)||x.InterFaceSetLists.Contains(table.InterFaceSetLists)) &&
+ ( string.IsNullOrEmpty(table.Frequency)||x.Frequency.Contains(table.Frequency)) &&
+ (table.Enable ==null|| x.Enable==table.Enable)
+ select x
+ ;
+
+ return q.ToList();
+ }
+
+ /// 获取分页列表
+ ///
+ /// 页码
+ /// 每页数量
+ ///
+ public static IEnumerable getListData(Model.InterFaceTask table, Grid Grid1)
+ {
+ var q= GetInterFaceTaskByModle(table);
+ count = q.Count();
+ if (count == 0)
+ {
+ return null;
+ }
+ // q= q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList();
+ // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
+ return from x in q
+ select new
+ {
+ x.InterFaceTaskId,
+ x.InterFaceName,
+ x.InterFaceSetLists,
+ x.Frequency,
+ x.CreateTime,
+ x.Enable,
+
+ };
+ }
+ #endregion
+
+ public static Model.InterFaceTask GetInterFaceTaskById(string InterFaceTaskId)
+ {
+ return db.InterFaceTask.FirstOrDefault(x=>x.InterFaceTaskId==InterFaceTaskId);
+ }
+ public static void AddInterFaceTask(Model.InterFaceTask newtable)
+ {
+
+ Model.InterFaceTask table = new Model.InterFaceTask{
+ InterFaceTaskId=newtable.InterFaceTaskId,
+ InterFaceName=newtable.InterFaceName,
+ InterFaceSetLists=newtable.InterFaceSetLists,
+ Frequency=newtable.Frequency,
+ CreateTime=newtable.CreateTime,
+ Enable=newtable.Enable,
+ };
+ db.InterFaceTask.InsertOnSubmit(table);
+ db.SubmitChanges();
+ }
+
+
+ public static void UpdateInterFaceTask(Model.InterFaceTask newtable)
+ {
+
+ Model.InterFaceTask table = db.InterFaceTask.FirstOrDefault(x=>x.InterFaceTaskId==newtable.InterFaceTaskId);
+ if (table != null)
+ {
+ table.InterFaceTaskId=newtable.InterFaceTaskId;
+ table.InterFaceName=newtable.InterFaceName;
+ table.InterFaceSetLists=newtable.InterFaceSetLists;
+ table.Frequency=newtable.Frequency;
+ table.CreateTime=newtable.CreateTime;
+ table.Enable=newtable.Enable;
+ db.SubmitChanges();
+ }
+
+ }
+ public static void DeleteInterFaceTaskById (string InterFaceTaskId)
+ {
+
+ Model.InterFaceTask table =db.InterFaceTask.FirstOrDefault(x=>x.InterFaceTaskId==InterFaceTaskId);
+ if (table != null)
+ {
+ db.InterFaceTask.DeleteOnSubmit(table);
+ db.SubmitChanges();
+ }
+
+ }
+ #region 执行任务
+ public static void ExecuteTasks(string InterFaceTaskId)
+ {
+
+ var model = GetInterFaceTaskById(InterFaceTaskId);
+ var InterFaceSetlIds = model.InterFaceSetLists.Split(',');
+ foreach (var item in InterFaceSetlIds)
+ {
+ ExecuteTasksByInterFaceSetlId(item);
+
+ }
+ }
+ ///
+ /// 执行接口
+ ///
+ /// 接口id
+ public static void ExecuteTasksByInterFaceSetlId(string InterFaceSetlId)
+ {
+ var InterfaceSetModel = InterFaceSetService.GetInterFaceSetById(InterFaceSetlId);
+ if (InterfaceSetModel == null)
+ {
+ return;
+ }
+ try
+ {
+
+ var sourseData = GetSourseData(InterfaceSetModel.InterFaceUrl, InterfaceSetModel.UrlReqMethod);
+ bool sourseisSuccess = false;
+ if (sourseData.code == 1)
+ {
+ sourseisSuccess = true;
+ }
+ InterFaceLogService.WriteInterFaceLog(InterFaceSetlId, "", JsonConvert.SerializeObject(sourseData), InterFaceLogService.Type1, sourseisSuccess);
+ if (sourseData.code == 0)
+ {
+ return;
+ }
+ var TargetData = GetTargetData(InterfaceSetModel.InterFaceForUrl, sourseData, InterfaceSetModel.ForUrlReqMethod);
+
+ bool TargetisSuccess = false;
+ if (TargetData.code == 1)
+ {
+ TargetisSuccess = true;
+ }
+ InterFaceLogService.WriteInterFaceLog(InterFaceSetlId, JsonConvert.SerializeObject(sourseData.data), JsonConvert.SerializeObject(TargetData), InterFaceLogService.Type2, TargetisSuccess);
+
+ if (TargetData.code == 0 || InterfaceSetModel.IsCallBack == false)
+ {
+ return;
+ }
+ var callbackData = ExecuteCallBack(InterfaceSetModel.InterFaceCallBackUrl, sourseData, InterfaceSetModel.CallBackUrlReqMethod);
+
+ bool CallBackisSuccess = false;
+ if (TargetData.code == 1)
+ {
+ CallBackisSuccess = true;
+ }
+ InterFaceLogService.WriteInterFaceLog(InterFaceSetlId, JsonConvert.SerializeObject(sourseData.data), JsonConvert.SerializeObject(callbackData), InterFaceLogService.Type3, CallBackisSuccess);
+
+ }
+ catch (Exception ex )
+ {
+ Model.InterFaceLog interFaceLog=new InterFaceLog();
+ interFaceLog.InterFaceLogId=Guid.NewGuid().ToString();
+ interFaceLog.InterFaceType = "异常";
+ interFaceLog.LogSate = false;
+ interFaceLog.InterFaceLogDate= DateTime.Now;
+ interFaceLog.InterFaceName = InterfaceSetModel.InterFaceName;
+ interFaceLog.InterFaceReturnData = ex.ToString();
+ InterFaceLogService.AddInterFaceLog(interFaceLog);
+ }
+
+ }
+ public static Model.ReturnData GetSourseData(string baseurl,string ReqMethod)
+ {
+ Model.ReturnData returnData = new ReturnData();
+ string token = "C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0";
+ string Content = "";
+ switch (ReqMethod)
+ {
+ case "Get":
+ Content = Funs.RequestGet(baseurl, token);
+ break;
+ case "Post":
+ Content = Funs.RequestPost(baseurl, token, "");
+ break;
+ }
+ //var client = new RestClient(baseurl);
+ //client.Timeout = -1;
+ //var request = new RestRequest(Method.POST);
+ //request.AddHeader("token", "AF17168B-87BD-4GLY-1111-F0A0A1158F9B");
+ //IRestResponse response = client.Execute(request);
+ //Console.WriteLine(response.Content);
+ try
+ {
+ returnData = JsonConvert.DeserializeObject(Content);
+ }
+ catch (Exception)
+ {
+ returnData.code = 0;
+ returnData.message = "获取数据失败:" + Content;
+ }
+
+
+ return returnData;
+ }
+ public static Model.ResponeData GetTargetData(string baseurl, ReturnData DataInput, string ReqMethod)
+ {
+ Model.ResponeData responeData = new ResponeData();
+ if (DataInput.code == 1)
+ {
+
+ string token = DataInput.token;
+ string returnContent = "";
+ switch (ReqMethod)
+ {
+ case "Get":
+ returnContent = Funs.RequestGet(baseurl, token);
+ break;
+ case "Post":
+ returnContent = Funs.RequestPost(baseurl, token, JsonConvert.SerializeObject(DataInput.data));
+ break;
+ }
+ //var client = new RestClient(baseurl);
+ //client.Timeout = -1;
+ //if (isPost)
+ //{
+ // var request = new RestRequest(Method.POST);
+ // request.AddHeader("token", DataInput.token);
+ // request.AddJsonBody(JsonConvert.SerializeObject(DataInput.data));
+ // IRestResponse response = client.Execute(request);
+ // returnContent = response.Content;
+
+ //}
+ //else
+ //{
+ // var request = new RestRequest(Method.GET);
+ // request.AddHeader("token", DataInput.token);
+ // IRestResponse response = client.Execute(request);
+ // returnContent = response.Content;
+
+ //}
+ try
+ {
+ responeData = JsonConvert.DeserializeObject(returnContent);
+ }
+ catch (Exception)
+ {
+ responeData.code = 0;
+ responeData.message = "推送数据失败:" + returnContent;
+
+ }
+ return responeData;
+ }
+ else
+ {
+
+ }
+ return responeData;
+ }
+ public static ReturnData ExecuteCallBack(string baseurl, ReturnData DataInput,string ReqMethod)
+ {
+ Model.ReturnData returnData = new ReturnData();
+ if (DataInput.code == 1)
+ {
+ string token = "AF17168B-87BD-4GLY-1111-F0A0A1158F9B";
+ string Content = "";
+ switch (ReqMethod)
+ {
+ case "Get":
+ Content = Funs.RequestGet(baseurl, token);
+ break;
+ case "Post":
+ Content = Funs.RequestPost(baseurl, token, JsonConvert.SerializeObject(DataInput.data));
+ break;
+ }
+
+ //var client = new RestClient(baseurl);
+ //client.Timeout = -1;
+ //var request = new RestRequest(Method.POST);
+ //request.AddHeader("token", "AF17168B-87BD-4GLY-1111-F0A0A1158F9B");
+ //request.AddJsonBody(JsonConvert.SerializeObject(DataInput.data));
+ //IRestResponse response = client.Execute(request);
+ //returnContent = response.Content;
+ try
+ {
+ returnData = JsonConvert.DeserializeObject(Content);
+ }
+ catch (Exception)
+ {
+ returnData.code = 0;
+ returnData.message = "回调失败:" + Content;
+
+ }
+
+ }
+ return returnData;
+ }
+ #endregion
+
+
+ }
+}
\ No newline at end of file
diff --git a/SGGL/BLL/TaskScheduling/TimerTask/CustomJobListener.cs b/SGGL/BLL/TaskScheduling/TimerTask/CustomJobListener.cs
new file mode 100644
index 00000000..a7e571d5
--- /dev/null
+++ b/SGGL/BLL/TaskScheduling/TimerTask/CustomJobListener.cs
@@ -0,0 +1,15 @@
+using Quartz;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace BLL
+{
+ public class CustomJobListener
+ {
+
+ }
+}
diff --git a/SGGL/BLL/TaskScheduling/TimerTask/TaskJob.cs b/SGGL/BLL/TaskScheduling/TimerTask/TaskJob.cs
new file mode 100644
index 00000000..2b519454
--- /dev/null
+++ b/SGGL/BLL/TaskScheduling/TimerTask/TaskJob.cs
@@ -0,0 +1,30 @@
+using Quartz;
+using System.Threading;
+using System;
+using System.Threading.Tasks;
+
+namespace BLL
+{
+ public class MyJob : IJob
+ {
+ public async Task Execute(IJobExecutionContext context)
+ {
+ JobKey key = context.JobDetail.Key;
+
+ // note: use context.MergedJobDataMap in production code
+ JobDataMap dataMap = context.JobDetail.JobDataMap;
+ string InterFaceTaskId = dataMap.GetString("InterFaceTaskId");
+
+ //使用异步任务来实现
+ await Task.Run(() =>
+ {
+
+ InterFaceTaskService.ExecuteTasks(InterFaceTaskId);
+
+
+ //Console.WriteLine($"{DateTime.Now}【{Thread.CurrentThread.ManagedThreadId}】:自定义的工作正在执行... ...");
+ });
+ }
+ }
+}
+
diff --git a/SGGL/BLL/TaskScheduling/TimerTask/TimerTaskBase.cs b/SGGL/BLL/TaskScheduling/TimerTask/TimerTaskBase.cs
new file mode 100644
index 00000000..c4459a66
--- /dev/null
+++ b/SGGL/BLL/TaskScheduling/TimerTask/TimerTaskBase.cs
@@ -0,0 +1,165 @@
+
+ using System;
+ using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Collections.Specialized;
+using System.Drawing.Printing;
+using System.Linq;
+using System.Security.Cryptography.X509Certificates;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+ using Quartz;
+ using Quartz.Impl;
+
+ namespace BLL
+ {
+ public class QuartzServices
+ {
+
+ public static async Task Init()
+ {
+
+
+ //初始化计划者
+ StdSchedulerFactory factory = new StdSchedulerFactory();
+ // StdSchedulerFactory factory = new StdSchedulerFactory(properties);
+ IScheduler scheduler = await factory.GetScheduler();
+ var jobAndTriggerMapping = new Dictionary>();
+ // 将映射关系包装成制度字典集合
+ var model = new Model.InterFaceTask();
+ model.Enable = true;
+ var list = InterFaceTaskService.GetInterFaceTaskByModle(model);
+ foreach (var item in list)
+ {
+
+ var jobDetail1 = GetJobDetailByInterFaceTaskId(item.InterFaceTaskId);
+ var trigger1 = GetTriggerByTime(item.InterFaceTaskId, item.Frequency);
+ //给计划者添加Job和触发器
+ jobAndTriggerMapping[jobDetail1] = trigger1;
+ //keyValuePairs.Add(item.InterFaceTaskId, scheduler);
+ //Funs.ScheduledTasks = keyValuePairs;
+ }
+ var readOnlyjobAndTriggerMapping = new ReadOnlyDictionary>(jobAndTriggerMapping);
+ await scheduler.ScheduleJobs(readOnlyjobAndTriggerMapping, true);
+ await scheduler.Start(); //只有启动了,里面的任务才会定时触发
+ Funs.ScheduledTasks = scheduler;
+
+ }
+
+ public static void ISchedulerShupDown(IScheduler scheduler)
+ {
+ scheduler.Shutdown();
+
+ }
+ ///
+ /// 同步任务调度
+ ///
+ ///
+ ///
+ public static async Task SyncISchedulerById(string InterFaceTaskId)
+ {
+ try
+ {
+ StdSchedulerFactory factory = new StdSchedulerFactory();
+ var model = InterFaceTaskService.GetInterFaceTaskById(InterFaceTaskId);
+ // var item = Funs.ScheduledTasks.Where(x => x.Key == InterFaceTaskId).FirstOrDefault();
+ IScheduler scheduler = Funs.ScheduledTasks;
+ JobKey jk = new JobKey(InterFaceTaskId, "group1");
+ if (model != null)
+ {
+ if (model.Enable == true)
+ {
+ if (scheduler.GetJobDetail(jk, default) != null)
+ {
+ var jobDetail1 = GetJobDetailByInterFaceTaskId(model.InterFaceTaskId);
+ var trigger1 = GetTriggerByTime(model.InterFaceTaskId, model.Frequency);
+ await scheduler.ScheduleJob(jobDetail1, trigger1,true);
+
+ }
+ else
+ {
+
+ var jobDetail1 = GetJobDetailByInterFaceTaskId(model.InterFaceTaskId);
+ var trigger1 = GetTriggerByTime(model.InterFaceTaskId, model.Frequency);
+ await scheduler.ScheduleJob(jobDetail1, trigger1,true);
+ }
+
+ }
+ else
+ {
+ if (scheduler.GetJobDetail(jk, default) != null)
+ {
+ await scheduler.DeleteJob(jk, default);
+
+
+ // SyncScheduledTasks(model.InterFaceTaskId, scheduler, 2);
+ }
+
+ }
+
+ }
+ Funs.ScheduledTasks = scheduler;
+
+ }
+ catch (Exception ex)
+ {
+ string a = ex.ToString();
+ throw;
+ }
+
+ }
+ ///
+ /// 同步任务列表
+ ///
+ ///
+ ///
+ /// 0 增 1 修改 2删除
+ public static void SyncScheduledTasks(string InterFaceTaskId, IScheduler scheduler, int type)
+ {
+ if (type == 0)
+ {
+ // Funs.ScheduledTasks.Add(InterFaceTaskId, scheduler);
+ }
+ else if (type == 1)
+ {
+ // Funs.ScheduledTasks.Remove(InterFaceTaskId);
+ // Funs.ScheduledTasks.Add(InterFaceTaskId, scheduler);
+ }
+ else if (type == 2)
+ {
+ // Funs.ScheduledTasks.Remove(InterFaceTaskId);
+ }
+ }
+ public static IJobDetail GetJobDetailByInterFaceTaskId(string InterFaceTaskId)
+ { //创建Job
+ IJobDetail jobDetail1 = JobBuilder.Create()
+ .WithIdentity(InterFaceTaskId, "group1")//给Job身份
+ .WithDescription("任务的描述,方便查找")
+ .UsingJobData("InterFaceTaskId", InterFaceTaskId)
+ .Build();
+ return jobDetail1;
+ }
+ public static ReadOnlyCollection GetTriggerByTime(string InterFaceTaskId, string time)
+ {
+ string cron = "0 0 0/& * * ? ";
+ cron = cron.Replace("&", time);
+ // cron = "0 0/1 * * * ? ";
+ //创建触发器
+ var trigger1 = new ReadOnlyCollection(
+ new List()
+ {
+ TriggerBuilder.Create()
+ .WithIdentity(InterFaceTaskId, "group1") //给触发器身份
+ .WithDescription("触发器的描述,方便查找")
+ .StartAt(new DateTimeOffset(DateTime.Now.AddSeconds(10))) //.StartNow()都是启动触发器方式
+ .WithCronSchedule(cron) //定时策略,Cron表达式
+ .Build()
+ });
+ return trigger1;
+
+ }
+ }
+ }
+
+
\ No newline at end of file
diff --git a/SGGL/BLL/ZHGL/DataSync/CQMSDataService.cs b/SGGL/BLL/ZHGL/DataSync/CQMSDataService.cs
index f985458a..52805f65 100644
--- a/SGGL/BLL/ZHGL/DataSync/CQMSDataService.cs
+++ b/SGGL/BLL/ZHGL/DataSync/CQMSDataService.cs
@@ -11,38 +11,27 @@ namespace BLL
{
public static class CQMSDataService
{
- public static Model.SGGLDB db = Funs.DB;
-
- ///
- /// 集团接口地址
- ///
- public static string CNCECServerUrl
- {
- get;
- set;
- }
+ public static SGGLDB db = Funs.DB;
#region 获取列表
///
/// 记录数
///
- public static int count
- {
- get;
- set;
- }
+ public static int count { get; set; }
- public static List GetCQMSData_CQMSByModle(Model.CQMSData_CQMS table)
+ public static List GetCQMSData_CQMSByModle(CQMSData_CQMS table)
{
+ var db = Funs.DB;
var q = from x in db.CQMSData_CQMS
where
- (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
- (string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
- (string.IsNullOrEmpty(table.CollCropCode) || x.CollCropCode.Contains(table.CollCropCode)) &&
- (string.IsNullOrEmpty(table.UnitName) || x.UnitName.Contains(table.UnitName))
+ (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
+ (string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
+ (string.IsNullOrEmpty(table.CollCropCode) || x.CollCropCode.Contains(table.CollCropCode)) &&
+ (string.IsNullOrEmpty(table.UnitName) || x.UnitName.Contains(table.UnitName))
+ orderby x.ReportDate descending
select x
- ;
+ ;
return q.ToList();
}
@@ -52,14 +41,11 @@ namespace BLL
/// 页码
/// 每页数量
///
- public static IEnumerable getListData(Model.CQMSData_CQMS table, Grid Grid1)
+ public static IEnumerable getListData(CQMSData_CQMS table, Grid Grid1)
{
var q = GetCQMSData_CQMSByModle(table);
count = q.Count();
- if (count == 0)
- {
- return null;
- }
+ if (count == 0) return null;
// q= q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList();
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
return from x in q
@@ -101,15 +87,16 @@ namespace BLL
x.InspectionLotNum,
x.State,
x.CreateDate,
- x.CreateMan,
+ x.CreateMan
};
}
#endregion 获取列表
- public static void AddCQMSData_CQMS(Model.CQMSData_CQMS newtable)
+ public static void AddCQMSData_CQMS(CQMSData_CQMS newtable)
{
- Model.CQMSData_CQMS table = new Model.CQMSData_CQMS
+ var db = Funs.DB;
+ var table = new CQMSData_CQMS
{
Id = newtable.Id,
UnitId = newtable.UnitId,
@@ -147,15 +134,16 @@ namespace BLL
InspectionLotNum = newtable.InspectionLotNum,
State = newtable.State,
CreateDate = newtable.CreateDate,
- CreateMan = newtable.CreateMan,
+ CreateMan = newtable.CreateMan
};
db.CQMSData_CQMS.InsertOnSubmit(table);
db.SubmitChanges();
}
- public static void DeleteCQMSData_CQMSById(string Id)
+ public static void DeleteCQMSData_CQMSById(string id)
{
- Model.CQMSData_CQMS table = db.CQMSData_CQMS.FirstOrDefault(x => x.Id == Id);
+ var db = Funs.DB;
+ var table = db.CQMSData_CQMS.FirstOrDefault(x => x.Id == id);
if (table != null)
{
db.CQMSData_CQMS.DeleteOnSubmit(table);
@@ -163,16 +151,17 @@ namespace BLL
}
}
- public static Model.CQMSData_CQMS GetCQMSData_CQMSById(string Id)
+ public static CQMSData_CQMS GetCQMSData_CQMSById(string id)
{
- return db.CQMSData_CQMS.FirstOrDefault(x => x.Id == Id);
+ var db = Funs.DB;
+ return db.CQMSData_CQMS.FirstOrDefault(x => x.Id == id);
}
- public static Model.CQMSData GetItemById(string Id)
+ public static CQMSData GetItemById(string id)
{
- var model = GetCQMSData_CQMSById(Id);
- CQMSData data = new CQMSData();
- CqmsDataItem item = new CqmsDataItem();
+ var model = GetCQMSData_CQMSById(id);
+ var data = new CQMSData();
+ var item = new CqmsDataItem();
if (model != null)
{
item.Id = model.Id;
@@ -215,55 +204,56 @@ namespace BLL
item.SubdivisionalWorksNum = model.SubdivisionalWorksNum;
item.InspectionLotNum = model.InspectionLotNum;
}
- List cqmsDataItems = new List();
+
+ var cqmsDataItems = new List();
cqmsDataItems.Add(item);
data.CQMSDataItems = cqmsDataItems;
return data;
}
- public static Model.CQMSData GetTodayCQMSData_CQMS()
+ public static CQMSData GetTodayCQMSData_CQMS()
{
+ // var q = GetTodayData();
+ var data = new CQMSData();
+ data = StatisticalData();
- var q = GetTodayData();
- CQMSData data = new CQMSData();
- if (q != null && q.State == Const.CNCEC_State_S)
- {
- data = GetDataByCQMSData_CQMS(q);
- }
- else
- {
- data = StatisticalData();
- }
+ //if (q != null && q.State == Const.CNCEC_State_S)
+ //{
+ // // data = GetDataByCQMSData_CQMS(q);
+ // data = StatisticalData();
+ //}
+ //else
+ //{
+ // data = StatisticalData();
+ //}
return data;
}
- public static Model.CQMSData_CQMS GetTodayData()
+ public static CQMSData_CQMS GetTodayData()
{
var q = (from x in Funs.DB.CQMSData_CQMS
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
select x).FirstOrDefault();
return q;
}
- public static void UpdateTodyData_State()
+
+ public static void UpdateTodyData_State()
{
var q = GetTodayData();
- if (q!=null )
+ if (q != null)
{
q.State = Const.CNCEC_State_1;
UpdateCQMSData_CQMS(q);
-
}
}
+
public static bool IsReportByDate(DateTime dateTime)
{
var result = false;
var q = (from x in Funs.DB.CQMSData_CQMS
- where x.ReportDate >= dateTime.Date && x.ReportDate < (dateTime.Date.AddDays(1).Date)
+ where x.ReportDate >= dateTime.Date && x.ReportDate < dateTime.Date.AddDays(1).Date
select x).ToList();
- if (q != null && q.Count > 0)
- {
- result = true;
- }
+ if (q.Count > 0) result = true;
return result;
}
@@ -277,33 +267,33 @@ namespace BLL
var q = (from x in Funs.DB.CQMSData_CQMS
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
select x).ToList();
- if (q != null && q.Count > 0)
- {
- result = true;
- }
+ if (q.Count > 0) result = true;
return result;
}
- public static Model.ReturnData PushCNCEC(string Id)
+ public static ReturnData PushCncec(string id)
{
- string baseurl = "/api/CQMSData/SaveCQMSData";
- var item = GetItemById(Id);
- string str = JsonConvert.SerializeObject(item);
- var responeData = BLL.ServerService.PushCNCEC(str, baseurl);
+ var baseurl = "/api/CQMSData/SaveCQMSData";
+ var item = GetItemById(id);
+ var str = JsonConvert.SerializeObject(item);
+ var responeData = ServerService.PushCNCEC(str, baseurl);
return responeData;
}
public static CQMSData StatisticalData()
{
- var base_Unit = BLL.UnitService.GetUnitByUnitId(BLL.Const.UnitId_SEDIN);
+ var thisUnitId = string.Empty;
+ var thisUnit = CommonService.GetIsThisUnit();
+ if (thisUnit != null) thisUnitId = thisUnit.UnitId;
+ var base_Unit = UnitService.GetUnitByUnitId(thisUnitId);
Project_CQMSDataService.StatisticalAllProjectData();
var ProjectData = (from x in Funs.DB.Project_CQMSData_CQMS
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
select x).ToList();
- Model.CQMSData_CQMS table = new Model.CQMSData_CQMS
+ var table = new CQMSData_CQMS
{
- UnitId = BLL.Const.UnitId_SEDIN,
+ UnitId = thisUnitId,
CollCropCode = base_Unit.CollCropCode,
UnitName = base_Unit.UnitName,
ReportDate = DateTime.Now.Date,
@@ -311,8 +301,8 @@ namespace BLL
TechnicalDisclosePersonNum = ProjectData.Sum(x => x.TechnicalDisclosePersonNum),
UseNum = ProjectData.Sum(x => x.UseNum),
OKNum = ProjectData.Sum(x => x.OKNum),
- CompanyPersonNum = ProjectData.Sum(x => x.CompanyPersonNum),
- BranchPersonNum = ProjectData.Sum(x => x.BranchPersonNum),
+ CompanyPersonNum = GetCompanyPersonNum(),
+ BranchPersonNum = GetBranchPersonNum(),
ProjectPersonNum = ProjectData.Sum(x => x.ProjectPersonNum),
ProblemNum = ProjectData.Sum(x => x.ProblemNum),
ProblemCompletedNum = ProjectData.Sum(x => x.ProblemCompletedNum),
@@ -337,7 +327,7 @@ namespace BLL
SubdivisionalWorksNum = ProjectData.Sum(x => x.SubdivisionalWorksNum),
InspectionLotNum = ProjectData.Sum(x => x.InspectionLotNum),
CreateMan = Const.sysglyId,
- CreateDate = DateTime.Now,
+ CreateDate = DateTime.Now
};
if (IsReportByToday())
{
@@ -351,14 +341,16 @@ namespace BLL
table.State = Const.CNCEC_State_0;
AddCQMSData_CQMS(table);
}
- CQMSData data = new CQMSData();
+
+ var data = new CQMSData();
data = GetDataByCQMSData_CQMS(table);
return data;
}
- public static CQMSData GetDataByCQMSData_CQMS(Model.CQMSData_CQMS table)
+
+ public static CQMSData GetDataByCQMSData_CQMS(CQMSData_CQMS table)
{
- CQMSData data = new CQMSData();
- CqmsDataItem item = new CqmsDataItem();
+ var data = new CQMSData();
+ var item = new CqmsDataItem();
item.Id = table.Id;
item.ReportDate = table.ReportDate.Value.ToShortDateString();
item.UnitId = table.UnitId;
@@ -398,14 +390,16 @@ namespace BLL
item.SubProjectNum = table.SubProjectNum;
item.SubdivisionalWorksNum = table.SubdivisionalWorksNum;
item.InspectionLotNum = table.InspectionLotNum;
- List cqmsDataItems = new List();
+ var cqmsDataItems = new List();
cqmsDataItems.Add(item);
data.CQMSDataItems = cqmsDataItems;
return data;
}
- public static void UpdateCQMSData_CQMS(Model.CQMSData_CQMS newtable)
+
+ public static void UpdateCQMSData_CQMS(CQMSData_CQMS newtable)
{
- Model.CQMSData_CQMS table = db.CQMSData_CQMS.FirstOrDefault(x => x.Id == newtable.Id);
+ var db = Funs.DB;
+ var table = db.CQMSData_CQMS.FirstOrDefault(x => x.Id == newtable.Id);
if (table != null)
{
table.Id = newtable.Id;
@@ -448,5 +442,38 @@ namespace BLL
db.SubmitChanges();
}
}
+
+ ///
+ /// 获取企业总部人数
+ ///
+ ///
+ public static int GetCompanyPersonNum()
+ {
+ var unitId = string.Empty;
+ var thisUnit = CommonService.GetIsThisUnit();
+ if (thisUnit != null) unitId = thisUnit.UnitId;
+ var result = (from x in Funs.DB.Person_Persons
+ join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
+ where x.IsPost == true && y.IsCQMS == true && x.UnitId == unitId
+ select x).Count();
+ return 0;
+ }
+
+ ///
+ /// 获取分支机构人数
+ ///
+ ///
+ public static int GetBranchPersonNum()
+ {
+ var unitId = string.Empty;
+ var thisUnit = CommonService.GetIsThisUnit();
+ if (thisUnit != null) unitId = thisUnit.UnitId;
+ var result = (from x in Funs.DB.Person_Persons
+ join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
+ join z in Funs.DB.Base_Unit on x.UnitId equals z.UnitId
+ where x.IsPost == true && y.IsCQMS == true && x.UnitId != unitId && z.IsBranch== true
+ select x).Count();
+ return 0;
+ }
}
}
\ No newline at end of file
diff --git a/SGGL/BLL/ZHGL/DataSync/HJGLData_DefectService.cs b/SGGL/BLL/ZHGL/DataSync/HJGLData_DefectService.cs
index 1ab237ad..9eb9625c 100644
--- a/SGGL/BLL/ZHGL/DataSync/HJGLData_DefectService.cs
+++ b/SGGL/BLL/ZHGL/DataSync/HJGLData_DefectService.cs
@@ -31,7 +31,7 @@ namespace BLL
(string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
(string.IsNullOrEmpty(table.CollCropCode) || x.CollCropCode.Contains(table.CollCropCode)) &&
(string.IsNullOrEmpty(table.UnitName) || x.UnitName.Contains(table.UnitName)) &&
- (string.IsNullOrEmpty(table.DefectName) || x.DefectName.Contains(table.DefectName))
+ (string.IsNullOrEmpty(table.DefectName) || x.DefectName.Contains(table.DefectName))
select x
;
@@ -51,7 +51,7 @@ namespace BLL
{
return null;
}
- // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
+ // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
return from x in q
select new
{
@@ -75,7 +75,7 @@ namespace BLL
{
var q = from x in db.HJGLData_Defect
where x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0
- select x;
+ select x;
return q.ToList();
}
@@ -128,7 +128,7 @@ namespace BLL
public static void DeleteHJGLData_DefectByDate(DateTime? reportDate)
{
- var table = db.HJGLData_Defect.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0);
+ var table = db.HJGLData_Defect.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0);
if (table != null)
{
db.HJGLData_Defect.DeleteAllOnSubmit(table);
diff --git a/SGGL/BLL/ZHGL/DataSync/HJGLData_HJGLService.cs b/SGGL/BLL/ZHGL/DataSync/HJGLData_HJGLService.cs
index ecdbc8a5..9f3b2590 100644
--- a/SGGL/BLL/ZHGL/DataSync/HJGLData_HJGLService.cs
+++ b/SGGL/BLL/ZHGL/DataSync/HJGLData_HJGLService.cs
@@ -5,34 +5,34 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
+using Newtonsoft.Json.Linq;
+
namespace BLL
{
public static class HJGLData_HJGLService
{
- public static Model.SGGLDB db = Funs.DB;
+ public static SGGLDB db = Funs.DB;
#region 获取列表
///
/// 记录数
///
- public static int count
- {
- get;
- set;
- }
+ public static int count { get; set; }
- public static List GetHJGLData_HJGLByModle(Model.HJGLData_HJGL table)
+ public static List GetHJGLData_HJGLByModle(HJGLData_HJGL table)
{
+ var db = Funs.DB;
var q = from x in db.HJGLData_HJGL
where
- (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
- (string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
- (string.IsNullOrEmpty(table.CollCropCode) || x.CollCropCode.Contains(table.CollCropCode)) &&
- (string.IsNullOrEmpty(table.UnitName) || x.UnitName.Contains(table.UnitName))
+ (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
+ (string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
+ (string.IsNullOrEmpty(table.CollCropCode) || x.CollCropCode.Contains(table.CollCropCode)) &&
+ (string.IsNullOrEmpty(table.UnitName) || x.UnitName.Contains(table.UnitName))
+ orderby x.ReportDate descending
select x
- ;
+ ;
return q.ToList();
}
@@ -42,14 +42,11 @@ namespace BLL
/// 页码
/// 每页数量
///
- public static IEnumerable getListData(Model.HJGLData_HJGL table, Grid Grid1)
+ public static IEnumerable getListData(HJGLData_HJGL table, Grid Grid1)
{
var q = GetHJGLData_HJGLByModle(table);
count = q.Count();
- if (count == 0)
- {
- return null;
- }
+ if (count == 0) return null;
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
return from x in q
select new
@@ -66,15 +63,16 @@ namespace BLL
x.OKFilmNum,
x.State,
x.CreateDate,
- x.CreateMan,
+ x.CreateMan
};
}
#endregion 获取列表
- public static void AddHJGLData_HJGL(Model.HJGLData_HJGL newtable)
+ public static void AddHJGLData_HJGL(HJGLData_HJGL newtable)
{
- Model.HJGLData_HJGL table = new Model.HJGLData_HJGL
+ var db = Funs.DB;
+ var table = new HJGLData_HJGL
{
Id = newtable.Id,
UnitId = newtable.UnitId,
@@ -88,7 +86,7 @@ namespace BLL
OKFilmNum = newtable.OKFilmNum,
State = newtable.State,
CreateDate = newtable.CreateDate,
- CreateMan = newtable.CreateMan,
+ CreateMan = newtable.CreateMan
};
db.HJGLData_HJGL.InsertOnSubmit(table);
db.SubmitChanges();
@@ -96,7 +94,8 @@ namespace BLL
public static void DeleteHJGLData_HJGLById(string Id)
{
- Model.HJGLData_HJGL table = db.HJGLData_HJGL.FirstOrDefault(x => x.Id == Id);
+ var db = Funs.DB;
+ var table = db.HJGLData_HJGL.FirstOrDefault(x => x.Id == Id);
if (table != null)
{
db.HJGLData_HJGL.DeleteOnSubmit(table);
@@ -104,19 +103,20 @@ namespace BLL
}
}
- public static Model.HJGLData_HJGL GetHJGLData_HJGLById(string Id)
+ public static HJGLData_HJGL GetHJGLData_HJGLById(string Id)
{
+ var db = Funs.DB;
return db.HJGLData_HJGL.FirstOrDefault(x => x.Id == Id);
}
- public static Model.HJGLData GetItemById(string Id)
+ public static HJGLData GetItemById(string Id)
{
- HJGLDataItem item = new HJGLDataItem();
- HJGLData data = new HJGLData();
+ var item = new HJGLDataItem();
+ var data = new HJGLData();
var data_HJGL = GetHJGLData_HJGLById(Id);
if (data_HJGL != null)
{
- var data_HJGL_detail = BLL.HJGLData_DefectService.GetHJGLData_DefectByDate(data_HJGL.ReportDate);
+ var data_HJGL_detail = HJGLData_DefectService.GetHJGLData_DefectByDate(data_HJGL.ReportDate);
item.CollCropCode = data_HJGL.CollCropCode;
item.CompleteDineNum = data_HJGL.CompleteDineNum;
@@ -132,76 +132,82 @@ namespace BLL
{
foreach (var detail in data_HJGL_detail)
{
- HJGLDataDefectItems hjglDataDefectItem = new HJGLDataDefectItems();
+ var hjglDataDefectItem = new HJGLDataDefectItems();
hjglDataDefectItem.DefectNum = detail.DefectNum;
hjglDataDefectItem.DefectName = detail.DefectName;
hjglDataDefectItem.Id = detail.Id;
list.Add(hjglDataDefectItem);
}
+
item.HJGLDataDefectItems = list;
}
}
- List hJGLDataItems = new List();
+
+ var hJGLDataItems = new List();
hJGLDataItems.Add(item);
data.HJGLDataItems = hJGLDataItems;
return data;
}
- public static Model.HJGLData GetTodayHJGLData_HJGL()
+ public static HJGLData GetTodayHJGLData_HJGL()
{
var q = GetTodayData();
- HJGLData data = new HJGLData();
+ var data = new HJGLData();
+ if (CommonService.GetIsThisUnit().CollCropCode == "91410200170644116B")
+ {
+ return GetELECLTodayHJGLData_HJGL();
+ }
if (q != null && q.State == Const.CNCEC_State_S)
- {
-
- HJGLDataItem item = new HJGLDataItem();
- item.CollCropCode = q.CollCropCode;
- item.CompleteDineNum = q.CompleteDineNum;
- item.Id = q.Id;
- item.OKFilmNum = q.OKFilmNum;
- item.ReportDate = q.ReportDate.Value.ToShortDateString();
- item.TotalDineNum = q.TotalDineNum;
- item.TotalFilmNum = q.TotalFilmNum;
- item.UnitId = q.UnitId;
- item.WelderNum = q.WelderNum;
- item.HJGLDataDefectItems = Project_HJGLData_DefectService.getTodayProject_HJGLData_Defect();
- List hJGLDataItems = new List();
- hJGLDataItems.Add(item);
- data.HJGLDataItems = hJGLDataItems;
- }
- else
- {
data = StatisticalData();
- }
+ else
+ data = StatisticalData();
return data;
}
- public static Model.HJGLData_HJGL GetTodayData()
+ ///
+ /// 获取十一化建焊接数据
+ ///
+ ///
+ public static HJGLData GetELECLTodayHJGLData_HJGL()
+ {
+ var data = new HJGLData();
+ string baseurl = "http://36.99.162.230:9493/sgglapi/api/CNCECServer/PostGetHJGLData";
+ string token = Const.sysglyId;
+ string response = Funs.RequestPost(baseurl, token, "");
+ var json = JsonConvert.DeserializeObject(response) as JObject;
+ if (json != null && json["code"]?.ToString() == "1")
+ {
+ var str = json["data"]?.ToString();
+ if (str != null) data = JsonConvert.DeserializeObject(str);
+ }
+ return data;
+
+ }
+
+ public static HJGLData_HJGL GetTodayData()
{
var q = (from x in Funs.DB.HJGLData_HJGL
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
select x).FirstOrDefault();
return q;
}
+
public static void UpdateTodyData_State()
{
var q = GetTodayData();
- if (q!=null)
+ if (q != null)
{
q.State = Const.CNCEC_State_1;
UpdateHJGLData_HJGL(q);
}
-
}
+
public static bool IsReportByDate(DateTime dateTime)
{
var result = false;
var q = (from x in Funs.DB.HJGLData_HJGL
- where x.ReportDate >= dateTime.Date && x.ReportDate < (dateTime.Date.AddDays(1).Date)
+ where x.ReportDate >= dateTime.Date && x.ReportDate < dateTime.Date.AddDays(1).Date
select x).ToList();
- if (q != null && q.Count > 0)
- {
- result = true;
- }
+ if (q != null && q.Count > 0) result = true;
return result;
}
@@ -215,37 +221,37 @@ namespace BLL
var q = (from x in Funs.DB.HJGLData_HJGL
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
select x).ToList();
- if (q != null && q.Count > 0)
- {
- result = true;
- }
+ if (q.Count > 0) result = true;
return result;
}
- public static Model.ReturnData PushCNCEC(string Id)
+ public static ReturnData PushCncec(string Id)
{
- string baseurl = "/api/HJGLData/SaveHJGLData";
+ var baseurl = "/api/HJGLData/SaveHJGLData";
var item = GetItemById(Id);
- string str = JsonConvert.SerializeObject(item);
- var responeData = BLL.ServerService.PushCNCEC(str, baseurl);
+ var str = JsonConvert.SerializeObject(item);
+ var responeData = ServerService.PushCNCEC(str, baseurl);
return responeData;
}
public static HJGLData StatisticalData()
{
- HJGLData data = new HJGLData();
- string thisUnitId = BLL.Const.UnitId_SEDIN;
- var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
+ var data = new HJGLData();
+ var thisUnitId = string.Empty;
+ var thisUnit = CommonService.GetIsThisUnit();
+ if (thisUnit != null) thisUnitId = thisUnit.UnitId;
+ var baseUnit = UnitService.GetUnitByUnitId(thisUnitId);
var ProjectData = (from x in Funs.DB.Project_HJGLData_HJGL
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
select x).ToList();
Project_HJGLData_HJGLService.StatisticalAllProjectData();
+ Project_HJGLData_DefectService.StatisticalAllProjectData();
- Model.HJGLData_HJGL table = new Model.HJGLData_HJGL
+ var table = new HJGLData_HJGL
{
UnitId = thisUnitId,
- CollCropCode = base_Unit.CollCropCode,
- UnitName = base_Unit.UnitName,
+ CollCropCode = baseUnit.CollCropCode,
+ UnitName = baseUnit.UnitName,
ReportDate = DateTime.Now.Date,
WelderNum = ProjectData.Sum(x => x.WelderNum),
TotalDineNum = ProjectData.Sum(x => x.TotalDineNum),
@@ -253,7 +259,7 @@ namespace BLL
TotalFilmNum = ProjectData.Sum(x => x.TotalFilmNum),
OKFilmNum = ProjectData.Sum(x => x.OKFilmNum),
CreateMan = Const.sysglyId,
- CreateDate = DateTime.Now,
+ CreateDate = DateTime.Now
};
if (IsReportByToday())
{
@@ -268,7 +274,8 @@ namespace BLL
AddHJGLData_HJGL(table);
}
- HJGLDataItem item = new HJGLDataItem();
+
+ var item = new HJGLDataItem();
item.CollCropCode = table.CollCropCode;
item.CompleteDineNum = table.CompleteDineNum;
item.Id = table.Id;
@@ -279,19 +286,17 @@ namespace BLL
item.UnitId = table.UnitId;
item.WelderNum = table.WelderNum;
item.HJGLDataDefectItems = Project_HJGLData_DefectService.getTodayProject_HJGLData_Defect();
- List hJGLDataItems = new List();
+ var hJGLDataItems = new List();
hJGLDataItems.Add(item);
data.HJGLDataItems = hJGLDataItems;
return data;
-
-
-
}
- public static void UpdateHJGLData_HJGL(Model.HJGLData_HJGL newtable)
+ public static void UpdateHJGLData_HJGL(HJGLData_HJGL newtable)
{
- Model.HJGLData_HJGL table = db.HJGLData_HJGL.FirstOrDefault(x => x.Id == newtable.Id);
+ var db = Funs.DB;
+ var table = db.HJGLData_HJGL.FirstOrDefault(x => x.Id == newtable.Id);
if (table != null)
{
table.Id = newtable.Id;
diff --git a/SGGL/BLL/ZHGL/DataSync/HSSEData_HSSEService.cs b/SGGL/BLL/ZHGL/DataSync/HSSEData_HSSEService.cs
index a12cdefc..dd232097 100644
--- a/SGGL/BLL/ZHGL/DataSync/HSSEData_HSSEService.cs
+++ b/SGGL/BLL/ZHGL/DataSync/HSSEData_HSSEService.cs
@@ -1,55 +1,810 @@
-using FineUIPro;
-using Model;
-using Newtonsoft.Json;
-using System;
+using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
+using FineUIPro;
+using Model;
+using Newtonsoft.Json;
namespace BLL
{
public static class HSSEData_HSSEService
{
- public static Model.SGGLDB db = Funs.DB;
+ public static SGGLDB Db = Funs.DB;
+
+ public static void AddHSSEData_HSSE(HSSEData_HSSE newtable)
+ {
+ using (var db = new SGGLDB(Funs.ConnString))
+ {
+ var table = new HSSEData_HSSE
+ {
+ Id = newtable.Id,
+ UnitId = newtable.UnitId,
+ CollCropCode = newtable.CollCropCode,
+ UnitName = newtable.UnitName,
+ ReportDate = newtable.ReportDate,
+ BeUnderConstructionNum = newtable.BeUnderConstructionNum,
+ ShutdownNum = newtable.ShutdownNum,
+ JoinConstructionPersonNum = newtable.JoinConstructionPersonNum,
+ MajorProjectsUnderConstructionNum = newtable.MajorProjectsUnderConstructionNum,
+ TotalWorkingHour = newtable.TotalWorkingHour,
+ LostWorkingHour = newtable.LostWorkingHour,
+ SafeWorkingHour = newtable.SafeWorkingHour,
+ SafeTrainNum = newtable.SafeTrainNum,
+ SpecialTrainNum = newtable.SpecialTrainNum,
+ SpecialOperationTrainNum = newtable.SpecialOperationTrainNum,
+ TotalEnergyConsumption = newtable.TotalEnergyConsumption,
+ IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption,
+ NewWaterConsumption = newtable.NewWaterConsumption,
+ HeadOfficeInspectorGeneralNum = newtable.HeadOfficeInspectorGeneralNum,
+ HeadOfficeFullTimeNum = newtable.HeadOfficeFullTimeNum,
+ BranchInspectorGeneralNum = newtable.BranchInspectorGeneralNum,
+ BranchFullTimeNum = newtable.BranchFullTimeNum,
+ ProjectInspectorGeneralNum = newtable.ProjectInspectorGeneralNum,
+ ProjectFullTimeNum = newtable.ProjectFullTimeNum,
+ ProjectSafetyMonitorNum = newtable.ProjectSafetyMonitorNum,
+ SafetyInjectionEngineer = newtable.SafetyInjectionEngineer,
+ CertificateANum = newtable.CertificateANum,
+ CertificateBNum = newtable.CertificateBNum,
+ CertificateCNum = newtable.CertificateCNum,
+ SafetyCommitteeMeetingNum = newtable.SafetyCommitteeMeetingNum,
+ EnterpriseTopicsMeetingNum = newtable.EnterpriseTopicsMeetingNum,
+ ProjectSafetyLeadingGroupMeetingNum = newtable.ProjectSafetyLeadingGroupMeetingNum,
+ ProjectSafetyMeetingNum = newtable.ProjectSafetyMeetingNum,
+ CompanyLeadShiftCheckNum = newtable.CompanyLeadShiftCheckNum,
+ CompanyComprehensiveCheckNum = newtable.CompanyComprehensiveCheckNum,
+ CompanySpecialCheckNum = newtable.CompanySpecialCheckNum,
+ ProjectLeadShiftCheckNum = newtable.ProjectLeadShiftCheckNum,
+ ProjectSpecialCheckNum = newtable.ProjectSpecialCheckNum,
+ ProjectMajorCheckNum = newtable.ProjectMajorCheckNum,
+ NearMissNum = newtable.NearMissNum,
+ RecordableEventNum = newtable.RecordableEventNum,
+ GeneralAccidentNum = newtable.GeneralAccidentNum,
+ MajorAccidentNum = newtable.MajorAccidentNum,
+ SeriousAccidentNum = newtable.SeriousAccidentNum,
+ SpecialSeriousAccidentNum = newtable.SpecialSeriousAccidentNum,
+ CompanyComprehensivePlanNum = newtable.CompanyComprehensivePlanNum,
+ CompanySpecialPlanNum = newtable.CompanySpecialPlanNum,
+ CompanyOnSiteDisposalPlan = newtable.CompanyOnSiteDisposalPlan,
+ CompanyDrillNum = newtable.CompanyDrillNum,
+ ProjectComprehensivePlanNum = newtable.ProjectComprehensivePlanNum,
+ ProjectSpecialPlanNum = newtable.ProjectSpecialPlanNum,
+ ProjectOnSiteDisposalPlan = newtable.ProjectOnSiteDisposalPlan,
+ ProjectDrillNum = newtable.ProjectDrillNum,
+ CostExtract = newtable.CostExtract,
+ CostUse = newtable.CostUse,
+ UseEquipmentNum = newtable.UseEquipmentNum,
+ SpecialEquipmentNum = newtable.SpecialEquipmentNum,
+ LicensesNum = newtable.LicensesNum,
+ LicensesCloseNum = newtable.LicensesCloseNum,
+ GeneralClosedNum = newtable.GeneralClosedNum,
+ GeneralNotClosedNum = newtable.GeneralNotClosedNum,
+ MajorClosedNum = newtable.MajorClosedNum,
+ MajorNotClosedNum = newtable.MajorNotClosedNum,
+ GeneralRiskNum = newtable.GeneralRiskNum,
+ LowRiskNum = newtable.LowRiskNum,
+ MediumRiskNum = newtable.MediumRiskNum,
+ HighRiskNum = newtable.HighRiskNum,
+ CompletedNum = newtable.CompletedNum,
+ TrainPersonNum = newtable.TrainPersonNum,
+ ConstructionNum = newtable.ConstructionNum,
+ FinishedNum = newtable.FinishedNum,
+ SuperCompletedNum = newtable.SuperCompletedNum,
+ SuperTrainPersonNum = newtable.SuperTrainPersonNum,
+ SuperConstructionNum = newtable.SuperConstructionNum,
+ SuperFinishedNum = newtable.SuperFinishedNum,
+ State = newtable.State,
+ CreateDate = newtable.CreateDate,
+ CreateMan = newtable.CreateMan
+ };
+ db.HSSEData_HSSE.InsertOnSubmit(table);
+ db.SubmitChanges();
+ }
+ }
+
+ public static void DeleteHSSEData_HSSEById(string id)
+ {
+ using (var db = new SGGLDB(Funs.ConnString))
+ {
+ var table = db.HSSEData_HSSE.FirstOrDefault(x => x.Id == id);
+ if (table != null)
+ {
+ db.HSSEData_HSSE.DeleteOnSubmit(table);
+ db.SubmitChanges();
+ }
+ }
+ }
+
+ public static HSSEData_HSSE GetHSSEData_HSSEById(string id)
+ {
+ using (var db = new SGGLDB(Funs.ConnString))
+ {
+ return db.HSSEData_HSSE.FirstOrDefault(x => x.Id == id);
+ }
+ }
+
+ public static HSSEData GetItemById(string id)
+ {
+ var item = new HsseDataItem();
+ var data = new HSSEData();
+ var dataHsse = GetHSSEData_HSSEById(id);
+ if (dataHsse != null)
+ {
+ item.BeUnderConstructionNum = dataHsse.BeUnderConstructionNum;
+ item.BranchFullTimeNum = dataHsse.BranchFullTimeNum;
+ item.BranchInspectorGeneralNum = dataHsse.BranchInspectorGeneralNum;
+ item.CertificateANum = dataHsse.CertificateANum;
+ item.CertificateBNum = dataHsse.CertificateBNum;
+ item.CertificateCNum = dataHsse.CertificateCNum;
+ item.CollCropCode = dataHsse.CollCropCode;
+ item.CompanyComprehensiveCheckNum = dataHsse.CompanyComprehensiveCheckNum;
+ item.CompanyComprehensivePlanNum = dataHsse.CompanyComprehensivePlanNum;
+ item.CompanyDrillNum = dataHsse.CompanyDrillNum;
+ item.CompanyLeadShiftCheckNum = dataHsse.CompanyLeadShiftCheckNum;
+ item.CompanyOnSiteDisposalPlan = dataHsse.CompanyOnSiteDisposalPlan;
+ item.CompanySpecialCheckNum = dataHsse.CompanySpecialCheckNum;
+ item.CompanySpecialPlanNum = dataHsse.CompanySpecialPlanNum;
+ item.CompletedNum = dataHsse.CompletedNum;
+ item.ConstructionNum = dataHsse.ConstructionNum;
+ item.CostExtract = dataHsse.CostExtract;
+ item.CostUse = dataHsse.CostUse;
+ item.EnterpriseTopicsMeetingNum = dataHsse.EnterpriseTopicsMeetingNum;
+ item.FinishedNum = dataHsse.FinishedNum;
+ item.GeneralAccidentNum = dataHsse.GeneralAccidentNum;
+ item.GeneralClosedNum = dataHsse.GeneralClosedNum;
+ item.GeneralNotClosedNum = dataHsse.GeneralNotClosedNum;
+ item.GeneralRate = "";
+ item.GeneralRiskNum = dataHsse.GeneralRiskNum;
+ item.HeadOfficeFullTimeNum = dataHsse.HeadOfficeFullTimeNum;
+ item.HeadOfficeInspectorGeneralNum = dataHsse.HeadOfficeInspectorGeneralNum;
+ item.HighRiskNum = dataHsse.HighRiskNum;
+ item.Id = dataHsse.Id;
+ item.IncomeComprehensiveEnergyConsumption = dataHsse.IncomeComprehensiveEnergyConsumption;
+ item.JoinConstructionPersonNum = dataHsse.JoinConstructionPersonNum;
+ item.LicensesCloseNum = dataHsse.LicensesCloseNum;
+ item.LicensesNum = dataHsse.LicensesNum;
+ item.LostWorkingHour = dataHsse.LostWorkingHour;
+ item.LowRiskNum = dataHsse.LowRiskNum;
+ item.MajorAccidentNum = dataHsse.MajorAccidentNum;
+ item.MajorClosedNum = dataHsse.MajorClosedNum;
+ item.MajorNotClosedNum = dataHsse.MajorNotClosedNum;
+ item.MajorProjectsUnderConstructionNum = dataHsse.MajorProjectsUnderConstructionNum;
+ item.MajorRate = "";
+ item.MediumRiskNum = dataHsse.MediumRiskNum;
+ item.NearMissNum = dataHsse.NearMissNum;
+ item.NewWaterConsumption = dataHsse.NewWaterConsumption;
+ item.ProjectComprehensivePlanNum = dataHsse.ProjectComprehensivePlanNum;
+ item.ProjectDrillNum = dataHsse.ProjectDrillNum;
+ item.ProjectFullTimeNum = dataHsse.ProjectFullTimeNum;
+ item.ProjectInspectorGeneralNum = dataHsse.ProjectInspectorGeneralNum;
+ item.ProjectLeadShiftCheckNum = dataHsse.ProjectLeadShiftCheckNum;
+ item.ProjectMajorCheckNum = dataHsse.ProjectMajorCheckNum;
+ item.ProjectOnSiteDisposalPlan = dataHsse.ProjectOnSiteDisposalPlan;
+ item.ProjectSafetyLeadingGroupMeetingNum = dataHsse.ProjectSafetyLeadingGroupMeetingNum;
+ item.ProjectSafetyMeetingNum = dataHsse.ProjectSafetyMeetingNum;
+ item.ProjectSafetyMonitorNum = dataHsse.ProjectSafetyMonitorNum;
+ item.ProjectSpecialCheckNum = dataHsse.ProjectSpecialCheckNum;
+ item.ProjectSpecialPlanNum = dataHsse.ProjectSpecialPlanNum;
+ item.RecordableEventNum = dataHsse.RecordableEventNum;
+ item.ReportDate = dataHsse.ReportDate.Value.ToShortDateString();
+ item.SafeTrainNum = dataHsse.SafeTrainNum;
+ item.SafetyCommitteeMeetingNum = dataHsse.SafetyCommitteeMeetingNum;
+ item.SafetyInjectionEngineer = dataHsse.SafetyInjectionEngineer;
+ item.SafeWorkingHour = dataHsse.SafeWorkingHour;
+ item.SeriousAccidentNum = dataHsse.SeriousAccidentNum;
+ item.ShutdownNum = dataHsse.ShutdownNum;
+ item.SpecialEquipmentNum = dataHsse.SpecialEquipmentNum;
+ item.SpecialOperationTrainNum = dataHsse.SpecialOperationTrainNum;
+ item.SpecialSeriousAccidentNum = dataHsse.SpecialSeriousAccidentNum;
+ item.SpecialTrainNum = dataHsse.SpecialTrainNum;
+ item.SuperCompletedNum = dataHsse.SuperCompletedNum;
+ item.SuperConstructionNum = dataHsse.SuperConstructionNum;
+ item.SuperFinishedNum = dataHsse.SuperFinishedNum;
+ item.SuperTrainPersonNum = dataHsse.SuperTrainPersonNum;
+ item.TotalEnergyConsumption = dataHsse.TotalEnergyConsumption;
+ item.TotalWorkingHour = dataHsse.TotalWorkingHour;
+ item.TrainPersonNum = dataHsse.TrainPersonNum;
+ item.UnitId = dataHsse.UnitId;
+ item.UseEquipmentNum = dataHsse.UseEquipmentNum;
+ var hSseDataHiddens =
+ HSSEData_HiddenDangerDetailService.GetHSSEData_HiddenDangerDetailByDate(dataHsse.ReportDate);
+ if (hSseDataHiddens != null)
+ {
+ var list = hSseDataHiddens.Select(detail => new HSSEDataHiddenDangerDetailItem
+ {
+ Id = detail.Id,
+ NeedRectifyNum = detail.NeedRectifyNum,
+ TotalNum = detail.TotalNum,
+ TypeName = detail.TypeName
+ }).ToList();
+
+ item.HiddenDangerDetailItems = list;
+ }
+ }
+
+ var hsseDataItems = new List { item };
+ data.HSSEDataItems = hsseDataItems;
+ return data;
+ }
+
+ public static HSSEData GetItemByHSSEData_HSSE(HSSEData_HSSE dataHsse,
+ List hSseDataHiddens)
+ {
+ var item = new HsseDataItem();
+ var data = new HSSEData();
+ if (dataHsse != null)
+ {
+ item.BeUnderConstructionNum = dataHsse.BeUnderConstructionNum;
+ item.BranchFullTimeNum = dataHsse.BranchFullTimeNum;
+ item.BranchInspectorGeneralNum = dataHsse.BranchInspectorGeneralNum;
+ item.CertificateANum = dataHsse.CertificateANum;
+ item.CertificateBNum = dataHsse.CertificateBNum;
+ item.CertificateCNum = dataHsse.CertificateCNum;
+ item.CollCropCode = dataHsse.CollCropCode;
+ item.CompanyComprehensiveCheckNum = dataHsse.CompanyComprehensiveCheckNum;
+ item.CompanyComprehensivePlanNum = dataHsse.CompanyComprehensivePlanNum;
+ item.CompanyDrillNum = dataHsse.CompanyDrillNum;
+ item.CompanyLeadShiftCheckNum = dataHsse.CompanyLeadShiftCheckNum;
+ item.CompanyOnSiteDisposalPlan = dataHsse.CompanyOnSiteDisposalPlan;
+ item.CompanySpecialCheckNum = dataHsse.CompanySpecialCheckNum;
+ item.CompanySpecialPlanNum = dataHsse.CompanySpecialPlanNum;
+ item.CompletedNum = dataHsse.CompletedNum;
+ item.ConstructionNum = dataHsse.ConstructionNum;
+ item.CostExtract = dataHsse.CostExtract;
+ item.CostUse = dataHsse.CostUse;
+ item.EnterpriseTopicsMeetingNum = dataHsse.EnterpriseTopicsMeetingNum;
+ item.FinishedNum = dataHsse.FinishedNum;
+ item.GeneralAccidentNum = dataHsse.GeneralAccidentNum;
+ item.GeneralClosedNum = dataHsse.GeneralClosedNum;
+ item.GeneralNotClosedNum = dataHsse.GeneralNotClosedNum;
+ item.GeneralRate = "";
+ item.GeneralRiskNum = dataHsse.GeneralRiskNum;
+ item.HeadOfficeFullTimeNum = dataHsse.HeadOfficeFullTimeNum;
+ item.HeadOfficeInspectorGeneralNum = dataHsse.HeadOfficeInspectorGeneralNum;
+ item.HighRiskNum = dataHsse.HighRiskNum;
+ item.Id = dataHsse.Id;
+ item.IncomeComprehensiveEnergyConsumption = dataHsse.IncomeComprehensiveEnergyConsumption;
+ item.JoinConstructionPersonNum = dataHsse.JoinConstructionPersonNum;
+ item.LicensesCloseNum = dataHsse.LicensesCloseNum;
+ item.LicensesNum = dataHsse.LicensesNum;
+ item.LostWorkingHour = dataHsse.LostWorkingHour;
+ item.LowRiskNum = dataHsse.LowRiskNum;
+ item.MajorAccidentNum = dataHsse.MajorAccidentNum;
+ item.MajorClosedNum = dataHsse.MajorClosedNum;
+ item.MajorNotClosedNum = dataHsse.MajorNotClosedNum;
+ item.MajorProjectsUnderConstructionNum = dataHsse.MajorProjectsUnderConstructionNum;
+ item.MajorRate = "";
+ item.MediumRiskNum = dataHsse.MediumRiskNum;
+ item.NearMissNum = dataHsse.NearMissNum;
+ item.NewWaterConsumption = dataHsse.NewWaterConsumption;
+ item.ProjectComprehensivePlanNum = dataHsse.ProjectComprehensivePlanNum;
+ item.ProjectDrillNum = dataHsse.ProjectDrillNum;
+ item.ProjectFullTimeNum = dataHsse.ProjectFullTimeNum;
+ item.ProjectInspectorGeneralNum = dataHsse.ProjectInspectorGeneralNum;
+ item.ProjectLeadShiftCheckNum = dataHsse.ProjectLeadShiftCheckNum;
+ item.ProjectMajorCheckNum = dataHsse.ProjectMajorCheckNum;
+ item.ProjectOnSiteDisposalPlan = dataHsse.ProjectOnSiteDisposalPlan;
+ item.ProjectSafetyLeadingGroupMeetingNum = dataHsse.ProjectSafetyLeadingGroupMeetingNum;
+ item.ProjectSafetyMeetingNum = dataHsse.ProjectSafetyMeetingNum;
+ item.ProjectSafetyMonitorNum = dataHsse.ProjectSafetyMonitorNum;
+ item.ProjectSpecialCheckNum = dataHsse.ProjectSpecialCheckNum;
+ item.ProjectSpecialPlanNum = dataHsse.ProjectSpecialPlanNum;
+ item.RecordableEventNum = dataHsse.RecordableEventNum;
+ item.ReportDate = dataHsse.ReportDate.Value.ToShortDateString();
+ item.SafeTrainNum = dataHsse.SafeTrainNum;
+ item.SafetyCommitteeMeetingNum = dataHsse.SafetyCommitteeMeetingNum;
+ item.SafetyInjectionEngineer = dataHsse.SafetyInjectionEngineer;
+ item.SafeWorkingHour = dataHsse.SafeWorkingHour;
+ item.SeriousAccidentNum = dataHsse.SeriousAccidentNum;
+ item.ShutdownNum = dataHsse.ShutdownNum;
+ item.SpecialEquipmentNum = dataHsse.SpecialEquipmentNum;
+ item.SpecialOperationTrainNum = dataHsse.SpecialOperationTrainNum;
+ item.SpecialSeriousAccidentNum = dataHsse.SpecialSeriousAccidentNum;
+ item.SpecialTrainNum = dataHsse.SpecialTrainNum;
+ item.SuperCompletedNum = dataHsse.SuperCompletedNum;
+ item.SuperConstructionNum = dataHsse.SuperConstructionNum;
+ item.SuperFinishedNum = dataHsse.SuperFinishedNum;
+ item.SuperTrainPersonNum = dataHsse.SuperTrainPersonNum;
+ item.TotalEnergyConsumption = dataHsse.TotalEnergyConsumption;
+ item.TotalWorkingHour = dataHsse.TotalWorkingHour;
+ item.TrainPersonNum = dataHsse.TrainPersonNum;
+ item.UnitId = dataHsse.UnitId;
+ item.UseEquipmentNum = dataHsse.UseEquipmentNum;
+ if (hSseDataHiddens != null)
+ {
+ var list = hSseDataHiddens.Select(detail =>
+ new HSSEDataHiddenDangerDetailItem
+ {
+ Id = detail.Id,
+ NeedRectifyNum = detail.NeedRectifyNum,
+ TotalNum = detail.TotalNum,
+ TypeName = detail.TypeName
+ }).ToList();
+
+ item.HiddenDangerDetailItems = list;
+ }
+ }
+
+ var hsseDataItems = new List { item };
+ data.HSSEDataItems = hsseDataItems;
+ return data;
+ }
+
+ public static HSSEData GetTodayHSSEData_HSSE()
+ {
+ HSSEData data;
+ var q = (from x in Funs.DB.HSSEData_HSSE
+ where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
+ select x).FirstOrDefault();
+ if (q != null && q.State == Const.CNCEC_State_S)
+ // data = GetItemByHSSEData_HSSE(q, Project_HSSEData_HiddenDangerDetailService.GetTodayModel()); ;
+ data = StatisticalData();
+ else
+ data = StatisticalData();
+ return data;
+ }
+
+ public static HSSEData_HSSE GetTodayData()
+ {
+ var q = (from x in Funs.DB.HSSEData_HSSE
+ where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
+ select x).FirstOrDefault();
+ return q;
+ }
+
+ public static void UpdateTodyData_State()
+ {
+ var q = GetTodayData();
+ if (q != null)
+ {
+ q.State = Const.CNCEC_State_1;
+ UpdateHSSEData_HSSE(q);
+ }
+ }
+
+ public static bool IsReportByDate(DateTime dateTime)
+ {
+ var result = false;
+ var q = (from x in Funs.DB.HSSEData_HSSE
+ where x.ReportDate >= dateTime.Date && x.ReportDate < dateTime.Date.AddDays(1).Date
+ select x).ToList();
+ if (q.Count > 0) result = true;
+ return result;
+ }
+
+ ///
+ /// 判断当天是否已上报
+ ///
+ ///
+ public static bool IsReportByToday()
+ {
+ var result = false;
+ var q = (from x in Funs.DB.HSSEData_HSSE
+ where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
+ select x).ToList();
+ if (q.Count > 0) result = true;
+ return result;
+ }
+
+ public static ReturnData PushCncec(string id)
+ {
+ var baseurl = "/api/HSSEData/SaveHSSEData";
+ var item = GetItemById(id);
+ var str = JsonConvert.SerializeObject(item);
+ var responeData = ServerService.PushCNCEC(str, baseurl);
+ return responeData;
+ }
+
+ public static HSSEData StatisticalData()
+ {
+ var thisUnitId = string.Empty;
+ var thisUnit = CommonService.GetIsThisUnit();
+ if (thisUnit != null) thisUnitId = thisUnit.UnitId;
+ var baseUnit = UnitService.GetUnitByUnitId(thisUnitId);
+ Project_HSSEData_HSSEService.StatisticalAllProjectData();
+ Project_HSSEData_HiddenDangerDetailService.StatisticalAllProjectData();
+
+ var projectData = (from x in Funs.DB.Project_HSSEData_HSSE
+ where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
+ select x).ToList();
+ var totalEnergyConsumption = ChemicalReportItemService.GetLatstTimeTotalEnergyConsumption();
+ var incomeComprehensiveEnergyConsumption =
+ ChemicalReportItemService.GetLatstTimeIncomeComprehensiveEnergyConsumption();
+ var newWaterConsumption = ChemicalReportItemService.GetLatstTimeNewWaterConsumption();
+
+ var table = new HSSEData_HSSE
+ {
+ UnitId = thisUnitId,
+ CollCropCode = baseUnit.CollCropCode,
+ UnitName = baseUnit.UnitName,
+ ReportDate = DateTime.Now.Date,
+ BeUnderConstructionNum = projectData.Sum(x => x.BeUnderConstructionNum),
+ ShutdownNum = projectData.Sum(x => x.ShutdownNum),
+ JoinConstructionPersonNum = projectData.Sum(x => x.JoinConstructionPersonNum),
+ MajorProjectsUnderConstructionNum = projectData.Sum(x => x.MajorProjectsUnderConstructionNum),
+ TotalWorkingHour = projectData.Sum(x => x.TotalWorkingHour),
+ LostWorkingHour = projectData.Sum(x => x.LostWorkingHour),
+ SafeWorkingHour = projectData.Sum(x => x.SafeWorkingHour),
+ SafeTrainNum = projectData.Sum(x => x.SafeTrainNum),
+ SpecialTrainNum = projectData.Sum(x => x.SpecialTrainNum),
+ SpecialOperationTrainNum = projectData.Sum(x => x.SpecialOperationTrainNum),
+ TotalEnergyConsumption = totalEnergyConsumption,
+ IncomeComprehensiveEnergyConsumption = incomeComprehensiveEnergyConsumption,
+ NewWaterConsumption = newWaterConsumption,
+ HeadOfficeInspectorGeneralNum = GetHeadOfficeInspectorGeneralNum(),
+ HeadOfficeFullTimeNum = GetHeadOfficeFullTimeNum(),
+ BranchInspectorGeneralNum = GetBranchInspectorGeneralNum(),
+ BranchFullTimeNum = GetBranchFullTimeNum(),
+ ProjectInspectorGeneralNum = projectData.Sum(x => x.ProjectInspectorGeneralNum),
+ ProjectFullTimeNum = projectData.Sum(x => x.ProjectFullTimeNum),
+ ProjectSafetyMonitorNum = projectData.Sum(x => x.ProjectSafetyMonitorNum),
+ SafetyInjectionEngineer = projectData.Sum(x => x.SafetyInjectionEngineer),
+ CertificateANum = projectData.Sum(x => x.CertificateANum),
+ CertificateBNum = projectData.Sum(x => x.CertificateBNum),
+ CertificateCNum = projectData.Sum(x => x.CertificateCNum),
+ SafetyCommitteeMeetingNum = GetSafetyCommitteeMeetingNum(),
+ EnterpriseTopicsMeetingNum = GetEnterpriseTopicsMeetingNum(),
+ ProjectSafetyLeadingGroupMeetingNum = projectData.Sum(x => x.ProjectSafetyLeadingGroupMeetingNum),
+ ProjectSafetyMeetingNum = projectData.Sum(x => x.ProjectSafetyMeetingNum),
+ CompanyLeadShiftCheckNum = GetCompanyLeadShiftCheckNum(),
+ CompanyComprehensiveCheckNum = GetCompanyComprehensiveCheckNum(),
+ CompanySpecialCheckNum = GetCompanySpecialCheckNum(),
+ ProjectLeadShiftCheckNum = projectData.Sum(x => x.ProjectLeadShiftCheckNum),
+ ProjectSpecialCheckNum = projectData.Sum(x => x.ProjectSpecialCheckNum),
+ ProjectMajorCheckNum = projectData.Sum(x => x.ProjectMajorCheckNum),
+ NearMissNum = projectData.Sum(x => x.NearMissNum),
+ RecordableEventNum = projectData.Sum(x => x.RecordableEventNum),
+ GeneralAccidentNum = projectData.Sum(x => x.GeneralAccidentNum),
+ MajorAccidentNum = projectData.Sum(x => x.MajorAccidentNum),
+ SeriousAccidentNum = projectData.Sum(x => x.SeriousAccidentNum),
+ SpecialSeriousAccidentNum = projectData.Sum(x => x.SpecialSeriousAccidentNum),
+ CompanyComprehensivePlanNum = GetCompanyComprehensivePlanNum(),
+ CompanySpecialPlanNum = GetCompanySpecialPlanNum(),
+ CompanyOnSiteDisposalPlan = GetCompanyOnSiteDisposalPlan(),
+ CompanyDrillNum = GetCompanyDrillNum(),
+ ProjectComprehensivePlanNum = projectData.Sum(x => x.ProjectComprehensivePlanNum),
+ ProjectSpecialPlanNum = projectData.Sum(x => x.ProjectSpecialPlanNum),
+ ProjectOnSiteDisposalPlan = projectData.Sum(x => x.ProjectOnSiteDisposalPlan),
+ ProjectDrillNum = projectData.Sum(x => x.ProjectDrillNum),
+ CostExtract = projectData.Sum(x => x.CostExtract),
+ CostUse = projectData.Sum(x => x.CostUse),
+ UseEquipmentNum = projectData.Sum(x => x.UseEquipmentNum),
+ SpecialEquipmentNum = projectData.Sum(x => x.SpecialEquipmentNum),
+ LicensesNum = projectData.Sum(x => x.LicensesNum),
+ LicensesCloseNum = projectData.Sum(x => x.LicensesCloseNum),
+ GeneralClosedNum = projectData.Sum(x => x.GeneralClosedNum),
+ GeneralNotClosedNum = projectData.Sum(x => x.GeneralNotClosedNum),
+ MajorClosedNum = projectData.Sum(x => x.MajorClosedNum),
+ MajorNotClosedNum = projectData.Sum(x => x.MajorNotClosedNum),
+ GeneralRiskNum = projectData.Sum(x => x.GeneralRiskNum),
+ LowRiskNum = projectData.Sum(x => x.LowRiskNum),
+ MediumRiskNum = projectData.Sum(x => x.MediumRiskNum),
+ HighRiskNum = projectData.Sum(x => x.HighRiskNum),
+ CompletedNum = projectData.Sum(x => x.CompletedNum),
+ TrainPersonNum = projectData.Sum(x => x.TrainPersonNum),
+ ConstructionNum = projectData.Sum(x => x.ConstructionNum),
+ FinishedNum = projectData.Sum(x => x.FinishedNum),
+ SuperCompletedNum = projectData.Sum(x => x.SuperCompletedNum),
+ SuperTrainPersonNum = projectData.Sum(x => x.SuperTrainPersonNum),
+ SuperConstructionNum = projectData.Sum(x => x.SuperConstructionNum),
+ SuperFinishedNum = projectData.Sum(x => x.SuperFinishedNum),
+ CreateMan = Const.sysglyId,
+ CreateDate = DateTime.Now
+ };
+ if (IsReportByToday())
+ {
+ table.Id = GetTodayData().Id;
+ table.State = Const.CNCEC_State_1;
+ UpdateHSSEData_HSSE(table);
+ }
+ else
+ {
+ table.Id = SQLHelper.GetNewID();
+ table.State = Const.CNCEC_State_0;
+ AddHSSEData_HSSE(table);
+ }
+
+ var data = GetItemByHSSEData_HSSE(table, Project_HSSEData_HiddenDangerDetailService.GetTodayModel());
+ return data;
+ }
+
+ public static void UpdateHSSEData_HSSE(HSSEData_HSSE newtable)
+ {
+ using (var db = new SGGLDB(Funs.ConnString))
+ {
+ var table = db.HSSEData_HSSE.FirstOrDefault(x => x.Id == newtable.Id);
+ if (table != null)
+ {
+ table.Id = newtable.Id;
+ table.UnitId = newtable.UnitId;
+ table.CollCropCode = newtable.CollCropCode;
+ table.UnitName = newtable.UnitName;
+ table.ReportDate = newtable.ReportDate;
+ table.BeUnderConstructionNum = newtable.BeUnderConstructionNum;
+ table.ShutdownNum = newtable.ShutdownNum;
+ table.JoinConstructionPersonNum = newtable.JoinConstructionPersonNum;
+ table.MajorProjectsUnderConstructionNum = newtable.MajorProjectsUnderConstructionNum;
+ table.TotalWorkingHour = newtable.TotalWorkingHour;
+ table.LostWorkingHour = newtable.LostWorkingHour;
+ table.SafeWorkingHour = newtable.SafeWorkingHour;
+ table.SafeTrainNum = newtable.SafeTrainNum;
+ table.SpecialTrainNum = newtable.SpecialTrainNum;
+ table.SpecialOperationTrainNum = newtable.SpecialOperationTrainNum;
+ table.TotalEnergyConsumption = newtable.TotalEnergyConsumption;
+ table.IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption;
+ table.NewWaterConsumption = newtable.NewWaterConsumption;
+ table.HeadOfficeInspectorGeneralNum = newtable.HeadOfficeInspectorGeneralNum;
+ table.HeadOfficeFullTimeNum = newtable.HeadOfficeFullTimeNum;
+ table.BranchInspectorGeneralNum = newtable.BranchInspectorGeneralNum;
+ table.BranchFullTimeNum = newtable.BranchFullTimeNum;
+ table.ProjectInspectorGeneralNum = newtable.ProjectInspectorGeneralNum;
+ table.ProjectFullTimeNum = newtable.ProjectFullTimeNum;
+ table.ProjectSafetyMonitorNum = newtable.ProjectSafetyMonitorNum;
+ table.SafetyInjectionEngineer = newtable.SafetyInjectionEngineer;
+ table.CertificateANum = newtable.CertificateANum;
+ table.CertificateBNum = newtable.CertificateBNum;
+ table.CertificateCNum = newtable.CertificateCNum;
+ table.SafetyCommitteeMeetingNum = newtable.SafetyCommitteeMeetingNum;
+ table.EnterpriseTopicsMeetingNum = newtable.EnterpriseTopicsMeetingNum;
+ table.ProjectSafetyLeadingGroupMeetingNum = newtable.ProjectSafetyLeadingGroupMeetingNum;
+ table.ProjectSafetyMeetingNum = newtable.ProjectSafetyMeetingNum;
+ table.CompanyLeadShiftCheckNum = newtable.CompanyLeadShiftCheckNum;
+ table.CompanyComprehensiveCheckNum = newtable.CompanyComprehensiveCheckNum;
+ table.CompanySpecialCheckNum = newtable.CompanySpecialCheckNum;
+ table.ProjectLeadShiftCheckNum = newtable.ProjectLeadShiftCheckNum;
+ table.ProjectSpecialCheckNum = newtable.ProjectSpecialCheckNum;
+ table.ProjectMajorCheckNum = newtable.ProjectMajorCheckNum;
+ table.NearMissNum = newtable.NearMissNum;
+ table.RecordableEventNum = newtable.RecordableEventNum;
+ table.GeneralAccidentNum = newtable.GeneralAccidentNum;
+ table.MajorAccidentNum = newtable.MajorAccidentNum;
+ table.SeriousAccidentNum = newtable.SeriousAccidentNum;
+ table.SpecialSeriousAccidentNum = newtable.SpecialSeriousAccidentNum;
+ table.CompanyComprehensivePlanNum = newtable.CompanyComprehensivePlanNum;
+ table.CompanySpecialPlanNum = newtable.CompanySpecialPlanNum;
+ table.CompanyOnSiteDisposalPlan = newtable.CompanyOnSiteDisposalPlan;
+ table.CompanyDrillNum = newtable.CompanyDrillNum;
+ table.ProjectComprehensivePlanNum = newtable.ProjectComprehensivePlanNum;
+ table.ProjectSpecialPlanNum = newtable.ProjectSpecialPlanNum;
+ table.ProjectOnSiteDisposalPlan = newtable.ProjectOnSiteDisposalPlan;
+ table.ProjectDrillNum = newtable.ProjectDrillNum;
+ table.CostExtract = newtable.CostExtract;
+ table.CostUse = newtable.CostUse;
+ table.UseEquipmentNum = newtable.UseEquipmentNum;
+ table.SpecialEquipmentNum = newtable.SpecialEquipmentNum;
+ table.LicensesNum = newtable.LicensesNum;
+ table.LicensesCloseNum = newtable.LicensesCloseNum;
+ table.GeneralClosedNum = newtable.GeneralClosedNum;
+ table.GeneralNotClosedNum = newtable.GeneralNotClosedNum;
+ table.MajorClosedNum = newtable.MajorClosedNum;
+ table.MajorNotClosedNum = newtable.MajorNotClosedNum;
+ table.GeneralRiskNum = newtable.GeneralRiskNum;
+ table.LowRiskNum = newtable.LowRiskNum;
+ table.MediumRiskNum = newtable.MediumRiskNum;
+ table.HighRiskNum = newtable.HighRiskNum;
+ table.CompletedNum = newtable.CompletedNum;
+ table.TrainPersonNum = newtable.TrainPersonNum;
+ table.ConstructionNum = newtable.ConstructionNum;
+ table.FinishedNum = newtable.FinishedNum;
+ table.SuperCompletedNum = newtable.SuperCompletedNum;
+ table.SuperTrainPersonNum = newtable.SuperTrainPersonNum;
+ table.SuperConstructionNum = newtable.SuperConstructionNum;
+ table.SuperFinishedNum = newtable.SuperFinishedNum;
+ table.State = newtable.State;
+ table.CreateMan = newtable.CreateMan;
+ table.CreateDate = newtable.CreateDate;
+ db.SubmitChanges();
+ }
+ }
+ }
+
+ ///
+ /// 获取企业总部总监人数
+ ///
+ ///
+ public static int GetHeadOfficeInspectorGeneralNum()
+ {
+ var unitId = string.Empty;
+ var thisUnit = CommonService.GetIsThisUnit();
+ if (thisUnit != null) unitId = thisUnit.UnitId;
+ var result = (from x in Funs.DB.Person_Persons
+ where x.IsPost == true && x.WorkPostId == Const.WorkPost_HSSEDirector && x.UnitId == unitId
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取企业总部专职人数
+ ///
+ ///
+ public static int GetHeadOfficeFullTimeNum()
+ {
+ var unitId = string.Empty;
+ var thisUnit = CommonService.GetIsThisUnit();
+ if (thisUnit != null) unitId = thisUnit.UnitId;
+ var result = (from x in Funs.DB.Person_Persons
+ join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
+ where x.IsPost == true && y.IsHsse == true && x.UnitId == unitId
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取分支机构总监人数
+ ///
+ ///
+ public static int GetBranchInspectorGeneralNum()
+ {
+ var unitId = string.Empty;
+ var thisUnit = CommonService.GetIsThisUnit();
+ if (thisUnit != null) unitId = thisUnit.UnitId;
+ var result = (from x in Funs.DB.Person_Persons
+ join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
+ where x.IsPost == true && x.WorkPostId == Const.WorkPost_HSSEDirector && x.UnitId != unitId && y.IsBranch==true
+ select x).Count();
+ return 0;
+ }
+
+ ///
+ /// 获取分支机构专职人数
+ ///
+ ///
+ public static int GetBranchFullTimeNum()
+ {
+ var unitId = string.Empty;
+ var thisUnit = CommonService.GetIsThisUnit();
+ if (thisUnit != null) unitId = thisUnit.UnitId;
+ var result = (from x in Funs.DB.Person_Persons
+ join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
+ join z in Funs.DB.Base_Unit on x.UnitId equals z.UnitId
+
+ where x.IsPost == true && y.IsHsse == true && x.UnitId != unitId && z.IsBranch == true
+ select x).Count();
+ return 0;
+ }
+
+ ///
+ /// 获取企业安委会会议数
+ ///
+ ///
+ public static int GetSafetyCommitteeMeetingNum()
+ {
+ var result =
+ (from x in Funs.DB.Meeting_CompanySafetyMeeting where x.CompileDate > Const.DtmarkTime select x)
+ .Count();
+ return result;
+ }
+
+ ///
+ /// 获取企业专题会议数
+ ///
+ ///
+ public static int GetEnterpriseTopicsMeetingNum()
+ {
+ var result = (from x in Funs.DB.Meeting_CompanySpecialMeeting
+ where x.CompileDate > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取企业负责人带班检查次数
+ ///
+ ///
+ public static int GetCompanyLeadShiftCheckNum()
+ {
+ var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
+ where x.CheckType == "1" && x.CheckDate > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取企业综合检查次数
+ ///
+ ///
+ public static int GetCompanyComprehensiveCheckNum()
+ {
+ var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
+ where x.CheckType == "2" && x.CheckDate > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取企业专项检查次数
+ ///
+ ///
+ public static int GetCompanySpecialCheckNum()
+ {
+ var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
+ where x.CheckType == "3" && x.CheckDate > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取企业级综合预案数
+ ///
+ ///
+ public static int GetCompanyComprehensivePlanNum()
+ {
+ var result = (from x in Funs.DB.Emergency_EmergencyList_Unit
+ join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
+ where y.EmergencyTypeName.Contains("综合") && x.CompileDate > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取企业级专项预案数
+ ///
+ ///
+ public static int GetCompanySpecialPlanNum()
+ {
+ var result = (from x in Funs.DB.Emergency_EmergencyList_Unit
+ join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
+ where y.EmergencyTypeName.Contains("专项") && x.CompileDate > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取企业级现场处置预案
+ ///
+ ///
+ public static int GetCompanyOnSiteDisposalPlan()
+ {
+ var result = (from x in Funs.DB.Emergency_EmergencyList_Unit
+ join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
+ where y.EmergencyTypeName.Contains("现场处置") && x.CompileDate > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取企业级演练次数
+ ///
+ ///
+ public static int GetCompanyDrillNum()
+ {
+ var result = (from x in Funs.DB.Emergency_DrillRecordList_Unit
+ where x.CompileDate > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
#region 获取列表
///
- /// 记录数
+ /// 记录数
///
- public static int count
- {
- get;
- set;
- }
+ public static int Count { get; set; }
- public static List GetHSSEData_HSSEByModle(Model.HSSEData_HSSE table)
+ public static List GetHSSEData_HSSEByModle(HSSEData_HSSE table)
{
+ var db = Funs.DB;
var q = from x in db.HSSEData_HSSE
where
- (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
- (string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
- (string.IsNullOrEmpty(table.CollCropCode) || x.CollCropCode.Contains(table.CollCropCode)) &&
- (string.IsNullOrEmpty(table.UnitName) || x.UnitName.Contains(table.UnitName))
+ (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
+ (string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
+ (string.IsNullOrEmpty(table.CollCropCode) || x.CollCropCode.Contains(table.CollCropCode)) &&
+ (string.IsNullOrEmpty(table.UnitName) || x.UnitName.Contains(table.UnitName))
+ orderby x.ReportDate descending
select x
- ;
+ ;
return q.ToList();
}
- /// 获取分页列表
+ // ReSharper disable once InvalidXmlDocComment
///
- /// 页码
- /// 每页数量
///
- public static IEnumerable getListData(Model.HSSEData_HSSE table, Grid Grid1)
+ public static IEnumerable GetListData(HSSEData_HSSE table, Grid Grid1)
{
var q = GetHSSEData_HSSEByModle(table);
- count = q.Count();
- if (count == 0)
- {
- return null;
- }
+ Count = q.Count();
+ if (Count == 0) return null;
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
return from x in q
select new
@@ -131,764 +886,10 @@ namespace BLL
x.SuperFinishedNum,
x.State,
x.CreateDate,
- x.CreateMan,
+ x.CreateMan
};
}
#endregion 获取列表
-
- public static void AddHSSEData_HSSE(Model.HSSEData_HSSE newtable)
- {
- Model.HSSEData_HSSE table = new Model.HSSEData_HSSE
- {
- Id = newtable.Id,
- UnitId = newtable.UnitId,
- CollCropCode = newtable.CollCropCode,
- UnitName = newtable.UnitName,
- ReportDate = newtable.ReportDate,
- BeUnderConstructionNum = newtable.BeUnderConstructionNum,
- ShutdownNum = newtable.ShutdownNum,
- JoinConstructionPersonNum = newtable.JoinConstructionPersonNum,
- MajorProjectsUnderConstructionNum = newtable.MajorProjectsUnderConstructionNum,
- TotalWorkingHour = newtable.TotalWorkingHour,
- LostWorkingHour = newtable.LostWorkingHour,
- SafeWorkingHour = newtable.SafeWorkingHour,
- SafeTrainNum = newtable.SafeTrainNum,
- SpecialTrainNum = newtable.SpecialTrainNum,
- SpecialOperationTrainNum = newtable.SpecialOperationTrainNum,
- TotalEnergyConsumption = newtable.TotalEnergyConsumption,
- IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption,
- NewWaterConsumption = newtable.NewWaterConsumption,
- HeadOfficeInspectorGeneralNum = newtable.HeadOfficeInspectorGeneralNum,
- HeadOfficeFullTimeNum = newtable.HeadOfficeFullTimeNum,
- BranchInspectorGeneralNum = newtable.BranchInspectorGeneralNum,
- BranchFullTimeNum = newtable.BranchFullTimeNum,
- ProjectInspectorGeneralNum = newtable.ProjectInspectorGeneralNum,
- ProjectFullTimeNum = newtable.ProjectFullTimeNum,
- ProjectSafetyMonitorNum = newtable.ProjectSafetyMonitorNum,
- SafetyInjectionEngineer = newtable.SafetyInjectionEngineer,
- CertificateANum = newtable.CertificateANum,
- CertificateBNum = newtable.CertificateBNum,
- CertificateCNum = newtable.CertificateCNum,
- SafetyCommitteeMeetingNum = newtable.SafetyCommitteeMeetingNum,
- EnterpriseTopicsMeetingNum = newtable.EnterpriseTopicsMeetingNum,
- ProjectSafetyLeadingGroupMeetingNum = newtable.ProjectSafetyLeadingGroupMeetingNum,
- ProjectSafetyMeetingNum = newtable.ProjectSafetyMeetingNum,
- CompanyLeadShiftCheckNum = newtable.CompanyLeadShiftCheckNum,
- CompanyComprehensiveCheckNum = newtable.CompanyComprehensiveCheckNum,
- CompanySpecialCheckNum = newtable.CompanySpecialCheckNum,
- ProjectLeadShiftCheckNum = newtable.ProjectLeadShiftCheckNum,
- ProjectSpecialCheckNum = newtable.ProjectSpecialCheckNum,
- ProjectMajorCheckNum = newtable.ProjectMajorCheckNum,
- NearMissNum = newtable.NearMissNum,
- RecordableEventNum = newtable.RecordableEventNum,
- GeneralAccidentNum = newtable.GeneralAccidentNum,
- MajorAccidentNum = newtable.MajorAccidentNum,
- SeriousAccidentNum = newtable.SeriousAccidentNum,
- SpecialSeriousAccidentNum = newtable.SpecialSeriousAccidentNum,
- CompanyComprehensivePlanNum = newtable.CompanyComprehensivePlanNum,
- CompanySpecialPlanNum = newtable.CompanySpecialPlanNum,
- CompanyOnSiteDisposalPlan = newtable.CompanyOnSiteDisposalPlan,
- CompanyDrillNum = newtable.CompanyDrillNum,
- ProjectComprehensivePlanNum = newtable.ProjectComprehensivePlanNum,
- ProjectSpecialPlanNum = newtable.ProjectSpecialPlanNum,
- ProjectOnSiteDisposalPlan = newtable.ProjectOnSiteDisposalPlan,
- ProjectDrillNum = newtable.ProjectDrillNum,
- CostExtract = newtable.CostExtract,
- CostUse = newtable.CostUse,
- UseEquipmentNum = newtable.UseEquipmentNum,
- SpecialEquipmentNum = newtable.SpecialEquipmentNum,
- LicensesNum = newtable.LicensesNum,
- LicensesCloseNum = newtable.LicensesCloseNum,
- GeneralClosedNum = newtable.GeneralClosedNum,
- GeneralNotClosedNum = newtable.GeneralNotClosedNum,
- MajorClosedNum = newtable.MajorClosedNum,
- MajorNotClosedNum = newtable.MajorNotClosedNum,
- GeneralRiskNum = newtable.GeneralRiskNum,
- LowRiskNum = newtable.LowRiskNum,
- MediumRiskNum = newtable.MediumRiskNum,
- HighRiskNum = newtable.HighRiskNum,
- CompletedNum = newtable.CompletedNum,
- TrainPersonNum = newtable.TrainPersonNum,
- ConstructionNum = newtable.ConstructionNum,
- FinishedNum = newtable.FinishedNum,
- SuperCompletedNum = newtable.SuperCompletedNum,
- SuperTrainPersonNum = newtable.SuperTrainPersonNum,
- SuperConstructionNum = newtable.SuperConstructionNum,
- SuperFinishedNum = newtable.SuperFinishedNum,
- State = newtable.State,
- CreateDate = newtable.CreateDate,
- CreateMan = newtable.CreateMan,
- };
- db.HSSEData_HSSE.InsertOnSubmit(table);
- db.SubmitChanges();
- }
-
- public static void DeleteHSSEData_HSSEById(string Id)
- {
- Model.HSSEData_HSSE table = db.HSSEData_HSSE.FirstOrDefault(x => x.Id == Id);
- if (table != null)
- {
- db.HSSEData_HSSE.DeleteOnSubmit(table);
- db.SubmitChanges();
- }
- }
-
- public static Model.HSSEData_HSSE GetHSSEData_HSSEById(string Id)
- {
- return db.HSSEData_HSSE.FirstOrDefault(x => x.Id == Id);
- }
- public static Model.HSSEData GetItemById(string Id)
- {
- HsseDataItem item = new HsseDataItem();
- HSSEData data = new HSSEData();
- var data_HSSE = GetHSSEData_HSSEById(Id);
- if (data_HSSE != null)
- {
- item.BeUnderConstructionNum = data_HSSE.BeUnderConstructionNum;
- item.BranchFullTimeNum = data_HSSE.BranchFullTimeNum;
- item.BranchInspectorGeneralNum = data_HSSE.BranchInspectorGeneralNum;
- item.CertificateANum = data_HSSE.CertificateANum;
- item.CertificateBNum = data_HSSE.CertificateBNum;
- item.CertificateCNum = data_HSSE.CertificateCNum;
- item.CollCropCode = data_HSSE.CollCropCode;
- item.CompanyComprehensiveCheckNum = data_HSSE.CompanyComprehensiveCheckNum;
- item.CompanyComprehensivePlanNum = data_HSSE.CompanyComprehensivePlanNum;
- item.CompanyDrillNum = data_HSSE.CompanyDrillNum;
- item.CompanyLeadShiftCheckNum = data_HSSE.CompanyLeadShiftCheckNum;
- item.CompanyOnSiteDisposalPlan = data_HSSE.CompanyOnSiteDisposalPlan;
- item.CompanySpecialCheckNum = data_HSSE.CompanySpecialCheckNum;
- item.CompanySpecialPlanNum = data_HSSE.CompanySpecialPlanNum;
- item.CompletedNum = data_HSSE.CompletedNum;
- item.ConstructionNum = data_HSSE.ConstructionNum;
- item.CostExtract = data_HSSE.CostExtract;
- item.CostUse = data_HSSE.CostUse;
- item.EnterpriseTopicsMeetingNum = data_HSSE.EnterpriseTopicsMeetingNum;
- item.FinishedNum = data_HSSE.FinishedNum;
- item.GeneralAccidentNum = data_HSSE.GeneralAccidentNum;
- item.GeneralClosedNum = data_HSSE.GeneralClosedNum;
- item.GeneralNotClosedNum = data_HSSE.GeneralNotClosedNum;
- item.GeneralRate = "";
- item.GeneralRiskNum = data_HSSE.GeneralRiskNum;
- item.HeadOfficeFullTimeNum = data_HSSE.HeadOfficeFullTimeNum;
- item.HeadOfficeInspectorGeneralNum = data_HSSE.HeadOfficeInspectorGeneralNum;
- item.HighRiskNum = data_HSSE.HighRiskNum;
- item.Id = data_HSSE.Id;
- item.IncomeComprehensiveEnergyConsumption = data_HSSE.IncomeComprehensiveEnergyConsumption;
- item.JoinConstructionPersonNum = data_HSSE.JoinConstructionPersonNum;
- item.LicensesCloseNum = data_HSSE.LicensesCloseNum;
- item.LicensesNum = data_HSSE.LicensesNum;
- item.LostWorkingHour = data_HSSE.LostWorkingHour;
- item.LowRiskNum = data_HSSE.LowRiskNum;
- item.MajorAccidentNum = data_HSSE.MajorAccidentNum;
- item.MajorClosedNum = data_HSSE.MajorClosedNum;
- item.MajorNotClosedNum = data_HSSE.MajorNotClosedNum;
- item.MajorProjectsUnderConstructionNum = data_HSSE.MajorProjectsUnderConstructionNum;
- item.MajorRate = "";
- item.MediumRiskNum = data_HSSE.MediumRiskNum;
- item.NearMissNum = data_HSSE.NearMissNum;
- item.NewWaterConsumption = data_HSSE.NewWaterConsumption;
- item.ProjectComprehensivePlanNum = data_HSSE.ProjectComprehensivePlanNum;
- item.ProjectDrillNum = data_HSSE.ProjectDrillNum;
- item.ProjectFullTimeNum = data_HSSE.ProjectFullTimeNum;
- item.ProjectInspectorGeneralNum = data_HSSE.ProjectInspectorGeneralNum;
- item.ProjectLeadShiftCheckNum = data_HSSE.ProjectLeadShiftCheckNum;
- item.ProjectMajorCheckNum = data_HSSE.ProjectMajorCheckNum;
- item.ProjectOnSiteDisposalPlan = data_HSSE.ProjectOnSiteDisposalPlan;
- item.ProjectSafetyLeadingGroupMeetingNum = data_HSSE.ProjectSafetyLeadingGroupMeetingNum;
- item.ProjectSafetyMeetingNum = data_HSSE.ProjectSafetyMeetingNum;
- item.ProjectSafetyMonitorNum = data_HSSE.ProjectSafetyMonitorNum;
- item.ProjectSpecialCheckNum = data_HSSE.ProjectSpecialCheckNum;
- item.ProjectSpecialPlanNum = data_HSSE.ProjectSpecialPlanNum;
- item.RecordableEventNum = data_HSSE.RecordableEventNum;
- item.ReportDate = data_HSSE.ReportDate.Value.ToShortDateString();
- item.SafeTrainNum = data_HSSE.SafeTrainNum;
- item.SafetyCommitteeMeetingNum = data_HSSE.SafetyCommitteeMeetingNum;
- item.SafetyInjectionEngineer = data_HSSE.SafetyInjectionEngineer;
- item.SafeWorkingHour = data_HSSE.SafeWorkingHour;
- item.SeriousAccidentNum = data_HSSE.SeriousAccidentNum;
- item.ShutdownNum = data_HSSE.ShutdownNum;
- item.SpecialEquipmentNum = data_HSSE.SpecialEquipmentNum;
- item.SpecialOperationTrainNum = data_HSSE.SpecialOperationTrainNum;
- item.SpecialSeriousAccidentNum = data_HSSE.SpecialSeriousAccidentNum;
- item.SpecialTrainNum = data_HSSE.SpecialTrainNum;
- item.SuperCompletedNum = data_HSSE.SuperCompletedNum;
- item.SuperConstructionNum = data_HSSE.SuperConstructionNum;
- item.SuperFinishedNum = data_HSSE.SuperFinishedNum;
- item.SuperTrainPersonNum = data_HSSE.SuperTrainPersonNum;
- item.TotalEnergyConsumption = data_HSSE.TotalEnergyConsumption;
- item.TotalWorkingHour = data_HSSE.TotalWorkingHour;
- item.TrainPersonNum = data_HSSE.TrainPersonNum;
- item.UnitId = data_HSSE.UnitId;
- item.UseEquipmentNum = data_HSSE.UseEquipmentNum;
- var hSSEData_Hiddens = HSSEData_HiddenDangerDetailService.GetHSSEData_HiddenDangerDetailByDate(data_HSSE.ReportDate);
- if (hSSEData_Hiddens != null)
- {
- var list = new List();
- foreach (var detail in hSSEData_Hiddens)
- {
- HSSEDataHiddenDangerDetailItem hSSEDataHiddenDangerDetailItem = new HSSEDataHiddenDangerDetailItem();
-
- hSSEDataHiddenDangerDetailItem.Id = detail.Id;
- hSSEDataHiddenDangerDetailItem.NeedRectifyNum = detail.NeedRectifyNum;
- hSSEDataHiddenDangerDetailItem.TotalNum = detail.TotalNum;
- hSSEDataHiddenDangerDetailItem.TypeName = detail.TypeName;
- list.Add(hSSEDataHiddenDangerDetailItem);
- }
- item.HiddenDangerDetailItems = list;
- }
- }
- List hsseDataItems = new List();
- hsseDataItems.Add(item);
- data.HSSEDataItems = hsseDataItems;
- return data;
- }
- public static Model.HSSEData GetItemByHSSEData_HSSE(Model.HSSEData_HSSE data_HSSE, List hSSEData_Hiddens)
- {
- HsseDataItem item = new HsseDataItem();
- HSSEData data = new HSSEData();
- if (data_HSSE != null)
- {
- item.BeUnderConstructionNum = data_HSSE.BeUnderConstructionNum;
- item.BranchFullTimeNum = data_HSSE.BranchFullTimeNum;
- item.BranchInspectorGeneralNum = data_HSSE.BranchInspectorGeneralNum;
- item.CertificateANum = data_HSSE.CertificateANum;
- item.CertificateBNum = data_HSSE.CertificateBNum;
- item.CertificateCNum = data_HSSE.CertificateCNum;
- item.CollCropCode = data_HSSE.CollCropCode;
- item.CompanyComprehensiveCheckNum = data_HSSE.CompanyComprehensiveCheckNum;
- item.CompanyComprehensivePlanNum = data_HSSE.CompanyComprehensivePlanNum;
- item.CompanyDrillNum = data_HSSE.CompanyDrillNum;
- item.CompanyLeadShiftCheckNum = data_HSSE.CompanyLeadShiftCheckNum;
- item.CompanyOnSiteDisposalPlan = data_HSSE.CompanyOnSiteDisposalPlan;
- item.CompanySpecialCheckNum = data_HSSE.CompanySpecialCheckNum;
- item.CompanySpecialPlanNum = data_HSSE.CompanySpecialPlanNum;
- item.CompletedNum = data_HSSE.CompletedNum;
- item.ConstructionNum = data_HSSE.ConstructionNum;
- item.CostExtract = data_HSSE.CostExtract;
- item.CostUse = data_HSSE.CostUse;
- item.EnterpriseTopicsMeetingNum = data_HSSE.EnterpriseTopicsMeetingNum;
- item.FinishedNum = data_HSSE.FinishedNum;
- item.GeneralAccidentNum = data_HSSE.GeneralAccidentNum;
- item.GeneralClosedNum = data_HSSE.GeneralClosedNum;
- item.GeneralNotClosedNum = data_HSSE.GeneralNotClosedNum;
- item.GeneralRate = "";
- item.GeneralRiskNum = data_HSSE.GeneralRiskNum;
- item.HeadOfficeFullTimeNum = data_HSSE.HeadOfficeFullTimeNum;
- item.HeadOfficeInspectorGeneralNum = data_HSSE.HeadOfficeInspectorGeneralNum;
- item.HighRiskNum = data_HSSE.HighRiskNum;
- item.Id = data_HSSE.Id;
- item.IncomeComprehensiveEnergyConsumption = data_HSSE.IncomeComprehensiveEnergyConsumption;
- item.JoinConstructionPersonNum = data_HSSE.JoinConstructionPersonNum;
- item.LicensesCloseNum = data_HSSE.LicensesCloseNum;
- item.LicensesNum = data_HSSE.LicensesNum;
- item.LostWorkingHour = data_HSSE.LostWorkingHour;
- item.LowRiskNum = data_HSSE.LowRiskNum;
- item.MajorAccidentNum = data_HSSE.MajorAccidentNum;
- item.MajorClosedNum = data_HSSE.MajorClosedNum;
- item.MajorNotClosedNum = data_HSSE.MajorNotClosedNum;
- item.MajorProjectsUnderConstructionNum = data_HSSE.MajorProjectsUnderConstructionNum;
- item.MajorRate = "";
- item.MediumRiskNum = data_HSSE.MediumRiskNum;
- item.NearMissNum = data_HSSE.NearMissNum;
- item.NewWaterConsumption = data_HSSE.NewWaterConsumption;
- item.ProjectComprehensivePlanNum = data_HSSE.ProjectComprehensivePlanNum;
- item.ProjectDrillNum = data_HSSE.ProjectDrillNum;
- item.ProjectFullTimeNum = data_HSSE.ProjectFullTimeNum;
- item.ProjectInspectorGeneralNum = data_HSSE.ProjectInspectorGeneralNum;
- item.ProjectLeadShiftCheckNum = data_HSSE.ProjectLeadShiftCheckNum;
- item.ProjectMajorCheckNum = data_HSSE.ProjectMajorCheckNum;
- item.ProjectOnSiteDisposalPlan = data_HSSE.ProjectOnSiteDisposalPlan;
- item.ProjectSafetyLeadingGroupMeetingNum = data_HSSE.ProjectSafetyLeadingGroupMeetingNum;
- item.ProjectSafetyMeetingNum = data_HSSE.ProjectSafetyMeetingNum;
- item.ProjectSafetyMonitorNum = data_HSSE.ProjectSafetyMonitorNum;
- item.ProjectSpecialCheckNum = data_HSSE.ProjectSpecialCheckNum;
- item.ProjectSpecialPlanNum = data_HSSE.ProjectSpecialPlanNum;
- item.RecordableEventNum = data_HSSE.RecordableEventNum;
- item.ReportDate = data_HSSE.ReportDate.Value.ToShortDateString();
- item.SafeTrainNum = data_HSSE.SafeTrainNum;
- item.SafetyCommitteeMeetingNum = data_HSSE.SafetyCommitteeMeetingNum;
- item.SafetyInjectionEngineer = data_HSSE.SafetyInjectionEngineer;
- item.SafeWorkingHour = data_HSSE.SafeWorkingHour;
- item.SeriousAccidentNum = data_HSSE.SeriousAccidentNum;
- item.ShutdownNum = data_HSSE.ShutdownNum;
- item.SpecialEquipmentNum = data_HSSE.SpecialEquipmentNum;
- item.SpecialOperationTrainNum = data_HSSE.SpecialOperationTrainNum;
- item.SpecialSeriousAccidentNum = data_HSSE.SpecialSeriousAccidentNum;
- item.SpecialTrainNum = data_HSSE.SpecialTrainNum;
- item.SuperCompletedNum = data_HSSE.SuperCompletedNum;
- item.SuperConstructionNum = data_HSSE.SuperConstructionNum;
- item.SuperFinishedNum = data_HSSE.SuperFinishedNum;
- item.SuperTrainPersonNum = data_HSSE.SuperTrainPersonNum;
- item.TotalEnergyConsumption = data_HSSE.TotalEnergyConsumption;
- item.TotalWorkingHour = data_HSSE.TotalWorkingHour;
- item.TrainPersonNum = data_HSSE.TrainPersonNum;
- item.UnitId = data_HSSE.UnitId;
- item.UseEquipmentNum = data_HSSE.UseEquipmentNum;
- if (hSSEData_Hiddens != null)
- {
- var list = new List();
- foreach (var detail in hSSEData_Hiddens)
- {
- HSSEDataHiddenDangerDetailItem hSSEDataHiddenDangerDetailItem = new HSSEDataHiddenDangerDetailItem();
-
- hSSEDataHiddenDangerDetailItem.Id = detail.Id;
- hSSEDataHiddenDangerDetailItem.NeedRectifyNum = detail.NeedRectifyNum;
- hSSEDataHiddenDangerDetailItem.TotalNum = detail.TotalNum;
- hSSEDataHiddenDangerDetailItem.TypeName = detail.TypeName;
- list.Add(hSSEDataHiddenDangerDetailItem);
- }
- item.HiddenDangerDetailItems = list;
- }
- }
- List hsseDataItems = new List();
- hsseDataItems.Add(item);
- data.HSSEDataItems = hsseDataItems;
- return data;
- }
- public static Model.HSSEData GetTodayHSSEData_HSSE()
- {
- var q = (from x in Funs.DB.HSSEData_HSSE
- where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
- select x).FirstOrDefault();
- HSSEData data = new HSSEData();
- if (q != null && q.State == Const.CNCEC_State_S)
- {
- data = GetItemByHSSEData_HSSE(q, Project_HSSEData_HiddenDangerDetailService.GetTodayModel()); ;
- }
- else
- {
- data = StatisticalData();
- }
- return data;
- }
- public static Model.HSSEData_HSSE GetTodayData()
- {
- var q = (from x in Funs.DB.HSSEData_HSSE
- where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
- select x).FirstOrDefault();
- return q;
- }
- public static void UpdateTodyData_State()
- {
- var q = GetTodayData();
- if (q!=null)
- {
- q.State = Const.CNCEC_State_1;
- UpdateHSSEData_HSSE(q);
- }
-
- }
- public static bool IsReportByDate(DateTime dateTime)
- {
- var result = false;
- var q = (from x in Funs.DB.HSSEData_HSSE
- where x.ReportDate >= dateTime.Date && x.ReportDate < (dateTime.Date.AddDays(1).Date)
- select x).ToList();
- if (q != null && q.Count > 0)
- {
- result = true;
- }
- return result;
- }
-
- ///
- /// 判断当天是否已上报
- ///
- ///
- public static bool IsReportByToday()
- {
- var result = false;
- var q = (from x in Funs.DB.HSSEData_HSSE
- where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
- select x).ToList();
- if (q != null && q.Count > 0)
- {
- result = true;
- }
- return result;
- }
-
- public static Model.ReturnData PushCNCEC(string Id)
- {
- string baseurl = "/api/HSSEData/SaveHSSEData";
- var item = GetItemById(Id);
- string str = JsonConvert.SerializeObject(item);
- var responeData = BLL.ServerService.PushCNCEC(str, baseurl);
- return responeData;
- }
-
- public static HSSEData StatisticalData()
- {
- HSSEData data = new HSSEData();
- string thisUnitId = BLL.Const.UnitId_SEDIN;
- var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
- Project_HSSEData_HSSEService.StatisticalAllProjectData();
-
- var ProjectData = (from x in Funs.DB.Project_HSSEData_HSSE
- where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
- select x).ToList();
- //int TotalEnergyConsumption= Information_EnvironmentalDataService.GetLatstTimeTotalEnergyConsumption();
- //int IncomeComprehensiveEnergyConsumption = Information_EnvironmentalDataService.GetLatstTimeIncomeComprehensiveEnergyConsumption();
- //int NewWaterConsumption = Information_EnvironmentalDataService.GetLatstTimeNewWaterConsumption();
-
- Model.HSSEData_HSSE table = new Model.HSSEData_HSSE
- {
- UnitId = thisUnitId,
- CollCropCode = base_Unit.CollCropCode,
- UnitName = base_Unit.UnitName,
- ReportDate = DateTime.Now.Date,
- BeUnderConstructionNum = ProjectData.Sum(x => x.BeUnderConstructionNum),
- ShutdownNum = ProjectData.Sum(x => x.ShutdownNum),
- JoinConstructionPersonNum = ProjectData.Sum(x => x.JoinConstructionPersonNum),
- MajorProjectsUnderConstructionNum = ProjectData.Sum(x => x.MajorProjectsUnderConstructionNum),
- TotalWorkingHour = ProjectData.Sum(x => x.TotalWorkingHour),
- LostWorkingHour = ProjectData.Sum(x => x.LostWorkingHour),
- SafeWorkingHour = ProjectData.Sum(x => x.SafeWorkingHour),
- SafeTrainNum = ProjectData.Sum(x => x.SafeTrainNum),
- SpecialTrainNum = ProjectData.Sum(x => x.SpecialTrainNum),
- SpecialOperationTrainNum = ProjectData.Sum(x => x.SpecialOperationTrainNum),
- TotalEnergyConsumption = 0,
- IncomeComprehensiveEnergyConsumption = 0,
- NewWaterConsumption = 0,
- HeadOfficeInspectorGeneralNum = GetHeadOfficeInspectorGeneralNum(),
- HeadOfficeFullTimeNum = GetHeadOfficeFullTimeNum(),
- BranchInspectorGeneralNum = GetBranchInspectorGeneralNum(),
- BranchFullTimeNum = GetBranchFullTimeNum(),
- ProjectInspectorGeneralNum = ProjectData.Sum(x => x.ProjectInspectorGeneralNum),
- ProjectFullTimeNum = ProjectData.Sum(x => x.ProjectFullTimeNum),
- ProjectSafetyMonitorNum = ProjectData.Sum(x => x.ProjectSafetyMonitorNum),
- SafetyInjectionEngineer = ProjectData.Sum(x => x.SafetyInjectionEngineer),
- CertificateANum = ProjectData.Sum(x => x.CertificateANum),
- CertificateBNum = ProjectData.Sum(x => x.CertificateBNum),
- CertificateCNum = ProjectData.Sum(x => x.CertificateCNum),
- SafetyCommitteeMeetingNum = GetSafetyCommitteeMeetingNum(),
- EnterpriseTopicsMeetingNum = GetEnterpriseTopicsMeetingNum(),
- ProjectSafetyLeadingGroupMeetingNum = ProjectData.Sum(x => x.ProjectSafetyLeadingGroupMeetingNum),
- ProjectSafetyMeetingNum = ProjectData.Sum(x => x.ProjectSafetyMeetingNum),
- CompanyLeadShiftCheckNum = GetCompanyLeadShiftCheckNum(),
- CompanyComprehensiveCheckNum = GetCompanyComprehensiveCheckNum(),
- CompanySpecialCheckNum = GetCompanySpecialCheckNum(),
- ProjectLeadShiftCheckNum = ProjectData.Sum(x => x.ProjectLeadShiftCheckNum),
- ProjectSpecialCheckNum = ProjectData.Sum(x => x.ProjectSpecialCheckNum),
- ProjectMajorCheckNum = ProjectData.Sum(x => x.ProjectMajorCheckNum),
- NearMissNum = ProjectData.Sum(x => x.NearMissNum),
- RecordableEventNum = ProjectData.Sum(x => x.RecordableEventNum),
- GeneralAccidentNum = ProjectData.Sum(x => x.GeneralAccidentNum),
- MajorAccidentNum = ProjectData.Sum(x => x.MajorAccidentNum),
- SeriousAccidentNum = ProjectData.Sum(x => x.SeriousAccidentNum),
- SpecialSeriousAccidentNum = ProjectData.Sum(x => x.SpecialSeriousAccidentNum),
- CompanyComprehensivePlanNum = GetCompanyComprehensivePlanNum(),
- CompanySpecialPlanNum = GetCompanySpecialPlanNum(),
- CompanyOnSiteDisposalPlan = GetCompanyOnSiteDisposalPlan(),
- CompanyDrillNum = GetCompanyDrillNum(),
- ProjectComprehensivePlanNum = ProjectData.Sum(x => x.ProjectComprehensivePlanNum),
- ProjectSpecialPlanNum = ProjectData.Sum(x => x.ProjectSpecialPlanNum),
- ProjectOnSiteDisposalPlan = ProjectData.Sum(x => x.ProjectOnSiteDisposalPlan),
- ProjectDrillNum = ProjectData.Sum(x => x.ProjectDrillNum),
- CostExtract = ProjectData.Sum(x => x.CostExtract),
- CostUse = ProjectData.Sum(x => x.CostUse),
- UseEquipmentNum = ProjectData.Sum(x => x.UseEquipmentNum),
- SpecialEquipmentNum = ProjectData.Sum(x => x.SpecialEquipmentNum),
- LicensesNum = ProjectData.Sum(x => x.LicensesNum),
- LicensesCloseNum = ProjectData.Sum(x => x.LicensesCloseNum),
- GeneralClosedNum = ProjectData.Sum(x => x.GeneralClosedNum),
- GeneralNotClosedNum = ProjectData.Sum(x => x.GeneralNotClosedNum),
- MajorClosedNum = ProjectData.Sum(x => x.MajorClosedNum),
- MajorNotClosedNum = ProjectData.Sum(x => x.MajorNotClosedNum),
- GeneralRiskNum = ProjectData.Sum(x => x.GeneralRiskNum),
- LowRiskNum = ProjectData.Sum(x => x.LowRiskNum),
- MediumRiskNum = ProjectData.Sum(x => x.MediumRiskNum),
- HighRiskNum = ProjectData.Sum(x => x.HighRiskNum),
- CompletedNum = ProjectData.Sum(x => x.CompletedNum),
- TrainPersonNum = ProjectData.Sum(x => x.TrainPersonNum),
- ConstructionNum = ProjectData.Sum(x => x.ConstructionNum),
- FinishedNum = ProjectData.Sum(x => x.FinishedNum),
- SuperCompletedNum = ProjectData.Sum(x => x.SuperCompletedNum),
- SuperTrainPersonNum = ProjectData.Sum(x => x.SuperTrainPersonNum),
- SuperConstructionNum = ProjectData.Sum(x => x.SuperConstructionNum),
- SuperFinishedNum = ProjectData.Sum(x => x.SuperFinishedNum),
- CreateMan = Const.sysglyId,
- CreateDate = DateTime.Now,
- };
- if (IsReportByToday())
- {
- table.Id = GetTodayData().Id;
- table.State = Const.CNCEC_State_1;
- UpdateHSSEData_HSSE(table);
- }
- else
- {
- table.Id = SQLHelper.GetNewID();
- table.State = Const.CNCEC_State_0;
- AddHSSEData_HSSE(table);
- }
- data = GetItemByHSSEData_HSSE(table, Project_HSSEData_HiddenDangerDetailService.GetTodayModel());
- return data;
- }
- public static void UpdateHSSEData_HSSE(Model.HSSEData_HSSE newtable)
- {
- Model.HSSEData_HSSE table = db.HSSEData_HSSE.FirstOrDefault(x => x.Id == newtable.Id);
- if (table != null)
- {
- table.Id = newtable.Id;
- table.UnitId = newtable.UnitId;
- table.CollCropCode = newtable.CollCropCode;
- table.UnitName = newtable.UnitName;
- table.ReportDate = newtable.ReportDate;
- table.BeUnderConstructionNum = newtable.BeUnderConstructionNum;
- table.ShutdownNum = newtable.ShutdownNum;
- table.JoinConstructionPersonNum = newtable.JoinConstructionPersonNum;
- table.MajorProjectsUnderConstructionNum = newtable.MajorProjectsUnderConstructionNum;
- table.TotalWorkingHour = newtable.TotalWorkingHour;
- table.LostWorkingHour = newtable.LostWorkingHour;
- table.SafeWorkingHour = newtable.SafeWorkingHour;
- table.SafeTrainNum = newtable.SafeTrainNum;
- table.SpecialTrainNum = newtable.SpecialTrainNum;
- table.SpecialOperationTrainNum = newtable.SpecialOperationTrainNum;
- table.TotalEnergyConsumption = newtable.TotalEnergyConsumption;
- table.IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption;
- table.NewWaterConsumption = newtable.NewWaterConsumption;
- table.HeadOfficeInspectorGeneralNum = newtable.HeadOfficeInspectorGeneralNum;
- table.HeadOfficeFullTimeNum = newtable.HeadOfficeFullTimeNum;
- table.BranchInspectorGeneralNum = newtable.BranchInspectorGeneralNum;
- table.BranchFullTimeNum = newtable.BranchFullTimeNum;
- table.ProjectInspectorGeneralNum = newtable.ProjectInspectorGeneralNum;
- table.ProjectFullTimeNum = newtable.ProjectFullTimeNum;
- table.ProjectSafetyMonitorNum = newtable.ProjectSafetyMonitorNum;
- table.SafetyInjectionEngineer = newtable.SafetyInjectionEngineer;
- table.CertificateANum = newtable.CertificateANum;
- table.CertificateBNum = newtable.CertificateBNum;
- table.CertificateCNum = newtable.CertificateCNum;
- table.SafetyCommitteeMeetingNum = newtable.SafetyCommitteeMeetingNum;
- table.EnterpriseTopicsMeetingNum = newtable.EnterpriseTopicsMeetingNum;
- table.ProjectSafetyLeadingGroupMeetingNum = newtable.ProjectSafetyLeadingGroupMeetingNum;
- table.ProjectSafetyMeetingNum = newtable.ProjectSafetyMeetingNum;
- table.CompanyLeadShiftCheckNum = newtable.CompanyLeadShiftCheckNum;
- table.CompanyComprehensiveCheckNum = newtable.CompanyComprehensiveCheckNum;
- table.CompanySpecialCheckNum = newtable.CompanySpecialCheckNum;
- table.ProjectLeadShiftCheckNum = newtable.ProjectLeadShiftCheckNum;
- table.ProjectSpecialCheckNum = newtable.ProjectSpecialCheckNum;
- table.ProjectMajorCheckNum = newtable.ProjectMajorCheckNum;
- table.NearMissNum = newtable.NearMissNum;
- table.RecordableEventNum = newtable.RecordableEventNum;
- table.GeneralAccidentNum = newtable.GeneralAccidentNum;
- table.MajorAccidentNum = newtable.MajorAccidentNum;
- table.SeriousAccidentNum = newtable.SeriousAccidentNum;
- table.SpecialSeriousAccidentNum = newtable.SpecialSeriousAccidentNum;
- table.CompanyComprehensivePlanNum = newtable.CompanyComprehensivePlanNum;
- table.CompanySpecialPlanNum = newtable.CompanySpecialPlanNum;
- table.CompanyOnSiteDisposalPlan = newtable.CompanyOnSiteDisposalPlan;
- table.CompanyDrillNum = newtable.CompanyDrillNum;
- table.ProjectComprehensivePlanNum = newtable.ProjectComprehensivePlanNum;
- table.ProjectSpecialPlanNum = newtable.ProjectSpecialPlanNum;
- table.ProjectOnSiteDisposalPlan = newtable.ProjectOnSiteDisposalPlan;
- table.ProjectDrillNum = newtable.ProjectDrillNum;
- table.CostExtract = newtable.CostExtract;
- table.CostUse = newtable.CostUse;
- table.UseEquipmentNum = newtable.UseEquipmentNum;
- table.SpecialEquipmentNum = newtable.SpecialEquipmentNum;
- table.LicensesNum = newtable.LicensesNum;
- table.LicensesCloseNum = newtable.LicensesCloseNum;
- table.GeneralClosedNum = newtable.GeneralClosedNum;
- table.GeneralNotClosedNum = newtable.GeneralNotClosedNum;
- table.MajorClosedNum = newtable.MajorClosedNum;
- table.MajorNotClosedNum = newtable.MajorNotClosedNum;
- table.GeneralRiskNum = newtable.GeneralRiskNum;
- table.LowRiskNum = newtable.LowRiskNum;
- table.MediumRiskNum = newtable.MediumRiskNum;
- table.HighRiskNum = newtable.HighRiskNum;
- table.CompletedNum = newtable.CompletedNum;
- table.TrainPersonNum = newtable.TrainPersonNum;
- table.ConstructionNum = newtable.ConstructionNum;
- table.FinishedNum = newtable.FinishedNum;
- table.SuperCompletedNum = newtable.SuperCompletedNum;
- table.SuperTrainPersonNum = newtable.SuperTrainPersonNum;
- table.SuperConstructionNum = newtable.SuperConstructionNum;
- table.SuperFinishedNum = newtable.SuperFinishedNum;
- table.State = newtable.State;
- table.CreateMan = newtable.CreateMan;
- table.CreateDate = newtable.CreateDate;
- db.SubmitChanges();
- }
- }
-
- ///
- /// 获取企业总部总监人数
- ///
- ///
- public static int GetHeadOfficeInspectorGeneralNum()
- {
- //string unitId = string.Empty;
- //var thisUnit = CommonService.GetIsThisUnit();
- //if (thisUnit != null)
- //{
- // unitId = thisUnit.UnitId;
- //}
- //int result = (from x in Funs.DB.Person_CompanyBranchPerson
- // where x.IsOnJob == true && x.WorkPostId == BLL.Const.WorkPost_HSSEDirector && x.UnitId == unitId
- // select x).Count();
- return 0;
- }
- ///
- /// 获取企业总部专职人数
- ///
- ///
- public static int GetHeadOfficeFullTimeNum()
- {
- //string unitId = string.Empty;
- //var thisUnit = CommonService.GetIsThisUnit();
- //if (thisUnit != null)
- //{
- // unitId = thisUnit.UnitId;
- //}
- //int result = (from x in Funs.DB.Person_CompanyBranchPerson
- // join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
- // where x.IsOnJob == true && y.IsHsse == true && x.UnitId == unitId
- // select x).Count();
- return 0;
- }
- ///
- /// 获取分支机构总监人数
- ///
- ///
- public static int GetBranchInspectorGeneralNum()
- {
- //string unitId = string.Empty;
- //var thisUnit = CommonService.GetIsThisUnit();
- //if (thisUnit != null)
- //{
- // unitId = thisUnit.UnitId;
- //}
- //int result = (from x in Funs.DB.Person_CompanyBranchPerson
- // where x.IsOnJob == true && x.WorkPostId == BLL.Const.WorkPost_HSSEDirector && x.UnitId != unitId
- // select x).Count();
- return 0;
- }
- ///
- /// 获取分支机构专职人数
- ///
- ///
- public static int GetBranchFullTimeNum()
- {
- //string unitId = string.Empty;
- //var thisUnit = CommonService.GetIsThisUnit();
- //if (thisUnit != null)
- //{
- // unitId = thisUnit.UnitId;
- //}
- //int result = (from x in Funs.DB.Person_CompanyBranchPerson
- // join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
- // where x.IsOnJob == true && y.IsHsse == true && x.UnitId != unitId
- // select x).Count();
- return 0;
- }
-
- ///
- /// 获取企业安委会会议数
- ///
- ///
- public static int GetSafetyCommitteeMeetingNum()
- {
- //DateTime date = DateTime.Now;
- //int result = (from x in Funs.DB.Meeting_CompanySafetyMeeting where x.CompanySafetyMeetingDate.Value.Year == date.Year && x.CompanySafetyMeetingDate.Value.Month == date.Month && x.CompanySafetyMeetingDate.Value.Day == date.Day select x).Count();
- return 0;
- }
- ///
- /// 获取企业专题会议数
- ///
- ///
- public static int GetEnterpriseTopicsMeetingNum()
- {
- //DateTime date = DateTime.Now;
- //int result = (from x in Funs.DB.Meeting_CompanySpecialMeeting where x.CompanySpecialMeetingDate.Value.Year == date.Year && x.CompanySpecialMeetingDate.Value.Month == date.Month && x.CompanySpecialMeetingDate.Value.Day == date.Day select x).Count();
- return 0;
- }
-
- ///
- /// 获取企业负责人带班检查次数
- ///
- ///
- public static int GetCompanyLeadShiftCheckNum()
- {
- //DateTime date = DateTime.Now;
- //int result = (from x in Funs.DB.Supervise_SuperviseCheckReport where x.CheckType == "1" && x.CheckDate.Value.Year == date.Year && x.CheckDate.Value.Month == date.Month && x.CheckDate.Value.Day == date.Day select x).Count();
- return 0;
- }
- ///
- /// 获取企业综合检查次数
- ///
- ///
- public static int GetCompanyComprehensiveCheckNum()
- {
- //DateTime date = DateTime.Now;
- //int result = (from x in Funs.DB.Supervise_SuperviseCheckReport where x.CheckType == "2" && x.CheckDate.Value.Year == date.Year && x.CheckDate.Value.Month == date.Month && x.CheckDate.Value.Day == date.Day select x).Count();
- return 0;
- }
- ///
- /// 获取企业专项检查次数
- ///
- ///
- public static int GetCompanySpecialCheckNum()
- {
- //DateTime date = DateTime.Now;
- //int result = (from x in Funs.DB.Supervise_SuperviseCheckReport where x.CheckType == "3" && x.CheckDate.Value.Year == date.Year && x.CheckDate.Value.Month == date.Month && x.CheckDate.Value.Day == date.Day select x).Count();
- return 0;
- }
- ///
- /// 获取企业级综合预案数
- ///
- ///
- public static int GetCompanyComprehensivePlanNum()
- {
- //DateTime date = DateTime.Now;
- //int result = (from x in Funs.DB.Emergency_EmergencyList_Unit
- // join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
- // where x.CompileDate.Value.Year == date.Year && x.CompileDate.Value.Month == date.Month
- // && x.CompileDate.Value.Day == date.Day && y.EmergencyTypeName.Contains("综合")
- // select x).Count();
- return 0;
- }
- ///
- /// 获取企业级专项预案数
- ///
- ///
- public static int GetCompanySpecialPlanNum()
- {
- //DateTime date = DateTime.Now;
- //int result = (from x in Funs.DB.Emergency_EmergencyList_Unit
- // join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
- // where x.CompileDate.Value.Year == date.Year && x.CompileDate.Value.Month == date.Month
- // && x.CompileDate.Value.Day == date.Day && y.EmergencyTypeName.Contains("专项")
- // select x).Count();
- return 0;
- }
- ///
- /// 获取企业级现场处置预案
- ///
- ///
- public static int GetCompanyOnSiteDisposalPlan()
- {
- //DateTime date = DateTime.Now;
- //int result = (from x in Funs.DB.Emergency_EmergencyList_Unit
- // join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
- // where x.CompileDate.Value.Year == date.Year && x.CompileDate.Value.Month == date.Month
- // && x.CompileDate.Value.Day == date.Day && y.EmergencyTypeName.Contains("现场处置")
- // select x).Count();
- return 0;
- }
- ///
- /// 获取企业级演练次数
- ///
- ///
- public static int GetCompanyDrillNum()
- {
- //DateTime date = DateTime.Now;
- //int result = (from x in Funs.DB.Emergency_DrillRecordList_Unit
- // where x.DrillRecordDate.Value.Year == date.Year && x.DrillRecordDate.Value.Month == date.Month
- // && x.DrillRecordDate.Value.Day == date.Day
- // select x).Count();
- return 0;
- }
}
}
\ No newline at end of file
diff --git a/SGGL/BLL/ZHGL/DataSync/HSSEData_HiddenDangerDetailService.cs b/SGGL/BLL/ZHGL/DataSync/HSSEData_HiddenDangerDetailService.cs
index 850bf62b..7b8cfb2c 100644
--- a/SGGL/BLL/ZHGL/DataSync/HSSEData_HiddenDangerDetailService.cs
+++ b/SGGL/BLL/ZHGL/DataSync/HSSEData_HiddenDangerDetailService.cs
@@ -31,7 +31,7 @@ namespace BLL
(string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
(string.IsNullOrEmpty(table.CollCropCode) || x.CollCropCode.Contains(table.CollCropCode)) &&
(string.IsNullOrEmpty(table.UnitName) || x.UnitName.Contains(table.UnitName)) &&
- (string.IsNullOrEmpty(table.TypeName) || x.TypeName.Contains(table.TypeName))
+ (string.IsNullOrEmpty(table.TypeName) || x.TypeName.Contains(table.TypeName))
select x
;
@@ -51,7 +51,7 @@ namespace BLL
{
return null;
}
- // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
+ // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
return from x in q
select new
{
diff --git a/SGGL/BLL/ZHGL/DataSync/Hazard_RealTimeDeviceService.cs b/SGGL/BLL/ZHGL/DataSync/Hazard_RealTimeDeviceService.cs
index ba6f0cad..597cc39c 100644
--- a/SGGL/BLL/ZHGL/DataSync/Hazard_RealTimeDeviceService.cs
+++ b/SGGL/BLL/ZHGL/DataSync/Hazard_RealTimeDeviceService.cs
@@ -61,7 +61,7 @@ namespace BLL
(string.IsNullOrEmpty(table.ProjectId) || x.ProjectId.Contains(table.ProjectId)) &&
(string.IsNullOrEmpty(table.Value) || x.Value.Contains(table.Value)) &&
(string.IsNullOrEmpty(table.FactoryId) || x.FactoryId.Contains(table.FactoryId)) &&
- (string.IsNullOrEmpty(table.ReceiveDate) || x.ReceiveDate.Contains(table.ReceiveDate))
+ (string.IsNullOrEmpty(table.ReceiveDate) || x.ReceiveDate.Contains(table.ReceiveDate))
select x
;
diff --git a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_CQMSDataService.cs b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_CQMSDataService.cs
index 4e758604..1defd16f 100644
--- a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_CQMSDataService.cs
+++ b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_CQMSDataService.cs
@@ -17,7 +17,7 @@ namespace BLL
///
/// CQMS数据类型
///
- public enum CQMSDateType
+ public enum CQMSDateType
{
///
/// 质量培训数据
@@ -145,9 +145,9 @@ namespace BLL
}
public static List GetProject_CQMSData_CQMSByprojectid(string projectid)
{
- var q =( from x in db.Project_CQMSData_CQMS
- where x.ProjectId == projectid
- select x).ToList();
+ var q = (from x in db.Project_CQMSData_CQMS
+ where x.ProjectId == projectid
+ select x).ToList();
return q;
}
///
@@ -283,7 +283,7 @@ namespace BLL
///
///
///
- public static bool IsReportByDate(DateTime dateTime,string projectid)
+ public static bool IsReportByDate(DateTime dateTime, string projectid)
{
var result = false;
var q = (from x in Funs.DB.Project_CQMSData_CQMS
@@ -320,26 +320,31 @@ namespace BLL
///
/// 项目id
/// 数据类型
- public static void StatisticalData(string projectid,CQMSDateType cQMSDateType)
+ public static void StatisticalData(string projectid, CQMSDateType cQMSDateType)
{
- string thisUnitId = BLL.Const.UnitId_SEDIN;
- var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
+ string thisUnitId = string.Empty;
+ var thisUnit = CommonService.GetIsThisUnit();
+ if (thisUnit != null)
+ {
+ thisUnitId = thisUnit.UnitId;
+ }
+ var baseUnit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
Model.Project_CQMSData_CQMS table = new Model.Project_CQMSData_CQMS();
if (IsReportByToday(projectid))
{
- table= getTodayProject_CQMSData_CQMS(projectid);
+ table = getTodayProject_CQMSData_CQMS(projectid);
}
else
{
table.Id = SQLHelper.GetNewID();
}
table.UnitId = thisUnitId;
- table.CollCropCode = base_Unit.CollCropCode;
- table.UnitName = base_Unit.UnitName;
+ table.CollCropCode = baseUnit.CollCropCode;
+ table.UnitName = baseUnit.UnitName;
table.ProjectId = projectid;
table.ReportDate = DateTime.Now.Date;
- if (cQMSDateType== CQMSDateType.QualityTraining|| cQMSDateType == CQMSDateType.All)
+ if (cQMSDateType == CQMSDateType.QualityTraining || cQMSDateType == CQMSDateType.All)
{
table.TrainPersonNum = GetTrainPersonNum(projectid);
table.TechnicalDisclosePersonNum = GetTechnicalDisclosePersonNum(projectid);
@@ -347,7 +352,7 @@ namespace BLL
if (cQMSDateType == CQMSDateType.MeasuringInstruments || cQMSDateType == CQMSDateType.All)
{
table.UseNum = GetUseNum(projectid);
- table.OKNum = GetOKNum(projectid);
+ table.OKNum = GetOkNum(projectid);
}
if (cQMSDateType == CQMSDateType.ManagerData || cQMSDateType == CQMSDateType.All)
{
@@ -371,11 +376,11 @@ namespace BLL
if (cQMSDateType == CQMSDateType.QualityAcceptance || cQMSDateType == CQMSDateType.All)
{
table.KeyProcessNum = GetKeyProcessNum(projectid);
- table.KeyProcessOKNum = GetKeyProcessOKNum(projectid);
+ table.KeyProcessOKNum = GetKeyProcessOkNum(projectid);
table.SpecialProcessNum = GetSpecialProcessNum(projectid);
- table.SpecialProcessOKNum = GetSpecialProcessOKNum(projectid);
+ table.SpecialProcessOKNum = GetSpecialProcessOkNum(projectid);
table.ConcealedWorksNum = GetConcealedWorksNum(projectid);
- table.ConcealedWorksOKNum = GetConcealedWorksOKNum(projectid);
+ table.ConcealedWorksOKNum = GetConcealedWorksOkNum(projectid);
table.UnitProjectOnesNum = GetUnitProjectOnesNum(projectid);
table.UnitProjectOnesOKNum = GetUnitProjectOnesOKNum(projectid);
table.MaterialInRecheckNum = GetMaterialInRecheckNum(projectid);
@@ -388,7 +393,7 @@ namespace BLL
table.SubProjectNum = GetSubProjectNum(projectid);
table.SubdivisionalWorksNum = GetSubdivisionalWorksNum(projectid);
table.InspectionLotNum = GetInspectionLotNum(projectid);
- }
+ }
if (IsReportByToday(projectid))
{
@@ -406,11 +411,10 @@ namespace BLL
///
public static int GetTrainPersonNum(string projectid)
{
- //DateTime date = DateTime.Now;
- //int result = (from x in Funs.DB.Comprehensive_InspectionPerson
- // where x.ProjectId == projectid && x.IsTrain == true && x.CompileDate.Value.Year == date.Year && x.CompileDate.Value.Month == date.Month && x.CompileDate.Value.Day == date.Day
- // select x).Count();
- return 0;
+ var result = (from x in Funs.DB.Comprehensive_InspectionPerson
+ where x.ProjectId == projectid && x.IsTrain == true && x.CompileDate > Const.DtmarkTime
+ select x).Count();
+ return result;
}
///
/// 获取技术交底人次数
@@ -418,12 +422,11 @@ namespace BLL
///
public static int GetTechnicalDisclosePersonNum(string projectid)
{
- //DateTime date = DateTime.Now;
- //var result = (from x in Funs.DB.Comprehensive_DesignDetails
- // where x.ProjectId == projectid && x.DetailsDate.Value.Year == date.Year && x.DetailsDate.Value.Month == date.Month && x.DetailsDate.Value.Day == date.Day
- // select x.JoinPersonNum ).ToList().Sum(x=>x.Value);
- //var q = Funs.GetNewIntOrZero(result.ToString());
- return 0;
+ var result = (from x in Funs.DB.Comprehensive_DesignDetails
+ where x.ProjectId == projectid && x.CompileDate > Const.DtmarkTime
+ select x.JoinPersonNum).ToList().Sum(x => x.Value);
+ var q = Funs.GetNewIntOrZero(result.ToString());
+ return q;
}
///
/// 获取在用计量器具数
@@ -431,21 +434,23 @@ namespace BLL
///
public static int GetUseNum(string projectid)
{
- //int result = (from x in Funs.DB.Comprehensive_InspectionMachine
- // where x.ProjectId == projectid && x.IsOnSite == true && x.InspectionType.Contains("计量")
- // select x).Count();
- return 0;
+ int result = (from x in Funs.DB.Comprehensive_InspectionMachine
+ where x.ProjectId == projectid && x.IsOnSite == true && x.InspectionType.Contains("计量")
+ && x.CompileDate > Const.DtmarkTime
+ select x).Count();
+ return result;
}
///
/// 获取校准合格数
///
///
- public static int GetOKNum(string projectid)
+ public static int GetOkNum(string projectid)
{
- //int result = (from x in Funs.DB.Comprehensive_InspectionMachine
- // where x.ProjectId == projectid && x.IsOnSite == true && x.InspectionType.Contains("计量") && x.IsCheckOK == true
- // select x).Count();
- return 0;
+ int result = (from x in Funs.DB.Comprehensive_InspectionMachine
+ where x.ProjectId == projectid && x.IsOnSite == true && x.InspectionType.Contains("计量") && x.IsCheckOK == true
+ && x.CompileDate > Const.DtmarkTime
+ select x).Count();
+ return result;
}
///
/// 获取企业总部人数
@@ -471,11 +476,11 @@ namespace BLL
///
public static int GetProjectPersonNum(string projectid)
{
- //int result = (from x in Funs.DB.Comprehensive_InspectionPerson
- // join y in Funs.DB.Base_WorkPost on x.PostId equals y.WorkPostId
- // where x.ProjectId == projectid && y.IsCQMS == true && x.IsOnSite == true
- // select x).Count();
- return 0;
+ int result = (from x in Funs.DB.SitePerson_Person
+ join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
+ where x.ProjectId == projectid && y.IsCQMS == true && x.States=="1"
+ select x).Count();
+ return result;
}
///
/// 获取问题个数
@@ -484,7 +489,7 @@ namespace BLL
public static int GetProblemNum(string projectid)
{
int result = (from x in Funs.DB.Check_CheckControl
- where x.ProjectId == projectid && x.CheckDate <= DateTime.Now
+ where x.ProjectId == projectid && x.CheckDate > Const.DtmarkTime
select x).Count();
return result;
}
@@ -495,7 +500,7 @@ namespace BLL
public static int GetProblemCompletedNum(string projectid)
{
int result = (from x in Funs.DB.Check_CheckControl
- where x.ProjectId == projectid && x.CheckDate <= DateTime.Now && x.State == "7"
+ where x.ProjectId == projectid && x.CheckDate > Const.DtmarkTime && x.State == "7"
select x).Count();
return result;
}
@@ -506,7 +511,7 @@ namespace BLL
public static int GetProblemNotCompletedNum(string projectid)
{
int result = (from x in Funs.DB.Check_CheckControl
- where x.ProjectId == projectid && x.CheckDate <= DateTime.Now && x.State != "7"
+ where x.ProjectId == projectid && x.CheckDate > Const.DtmarkTime && x.State != "7"
select x).Count();
return result;
}
@@ -516,10 +521,10 @@ namespace BLL
///
public static int GetSNum(string projectid)
{
- //int result = (from x in Funs.DB.WBS_BreakdownProject
- // where x.ProjectId == projectid && x.Class.Contains("S")
- // select x).Count();
- return 0;
+ int result = (from x in Funs.DB.WBS_BreakdownProject
+ where x.ProjectId == projectid && x.Class.Contains("S") && x.IsSelected == true && x.CompileDate > Const.DtmarkTime
+ select x).Count();
+ return result;
}
///
/// 获取A级数
@@ -527,10 +532,10 @@ namespace BLL
///
public static int GetANum(string projectid)
{
- //int result = (from x in Funs.DB.WBS_BreakdownProject
- // where x.ProjectId == projectid && x.Class.Contains("A")
- // select x).Count();
- return 0;
+ int result = (from x in Funs.DB.WBS_BreakdownProject
+ where x.ProjectId == projectid && x.Class.Contains("A") && x.IsSelected == true && x.CompileDate > Const.DtmarkTime
+ select x).Count();
+ return result;
}
///
/// 获取B级数
@@ -538,10 +543,10 @@ namespace BLL
///
public static int GetBNum(string projectid)
{
- //int result = (from x in Funs.DB.WBS_BreakdownProject
- // where x.ProjectId == projectid && x.Class.Contains("B")
- // select x).Count();
- return 0;
+ int result = (from x in Funs.DB.WBS_BreakdownProject
+ where x.ProjectId == projectid && x.Class.Contains("B") && x.IsSelected == true && x.CompileDate > Const.DtmarkTime
+ select x).Count();
+ return result;
}
///
/// 获取C级数
@@ -549,10 +554,10 @@ namespace BLL
///
public static int GetCNum(string projectid)
{
- //int result = (from x in Funs.DB.WBS_BreakdownProject
- // where x.ProjectId == projectid && x.Class.Contains("C")
- // select x).Count();
- return 0;
+ int result = (from x in Funs.DB.WBS_BreakdownProject
+ where x.ProjectId == projectid && x.Class.Contains("C") && x.IsSelected == true && x.CompileDate > Const.DtmarkTime
+ select x).Count();
+ return result;
}
///
/// 获取关键工序验收数
@@ -560,24 +565,24 @@ namespace BLL
///
public static int GetKeyProcessNum(string projectid)
{
- //int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
- // join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
- // where y.ProjectId == projectid && y.CheckAcceptType == "1"
- // select x).Count();
- return 0;
+ int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
+ join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
+ where y.ProjectId == projectid && y.CheckAcceptType == "1" && x.CreateDate > Const.DtmarkTime
+ select x).Count();
+ return result;
}
///
/// 获取关键工序验收合格数
///
///
- public static int GetKeyProcessOKNum(string projectid)
+ public static int GetKeyProcessOkNum(string projectid)
{
- //int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
- // join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
- // join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
- // where y.ProjectId == projectid && y.CheckAcceptType == "1" && z.IsOnceQualified == true
- // select x).Count();
- return 0;
+ int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
+ join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
+ join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
+ where y.ProjectId == projectid && y.CheckAcceptType == "1" && z.IsOnceQualified == true && x.CreateDate > Const.DtmarkTime
+ select x).Count();
+ return result;
}
///
/// 获取特殊过程验收数
@@ -585,24 +590,24 @@ namespace BLL
///
public static int GetSpecialProcessNum(string projectid)
{
- //int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
- // join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
- // where y.ProjectId == projectid && y.CheckAcceptType == "2"
- // select x).Count();
- return 0;
+ int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
+ join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
+ where y.ProjectId == projectid && y.CheckAcceptType == "2" && x.CreateDate > Const.DtmarkTime
+ select x).Count();
+ return result;
}
///
/// 获取特殊过程验收合格数
///
///
- public static int GetSpecialProcessOKNum(string projectid)
+ public static int GetSpecialProcessOkNum(string projectid)
{
- //int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
- // join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
- // join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
- // where y.ProjectId == projectid && y.CheckAcceptType == "2" && z.IsOnceQualified == true
- // select x).Count();
- return 0;
+ var result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
+ join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
+ join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
+ where y.ProjectId == projectid && y.CheckAcceptType == "2" && z.IsOnceQualified == true && x.CreateDate > Const.DtmarkTime
+ select x).Count();
+ return result;
}
///
/// 获取隐蔽工程验收数
@@ -610,24 +615,24 @@ namespace BLL
///
public static int GetConcealedWorksNum(string projectid)
{
- //int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
- // join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
- // where y.ProjectId == projectid && y.CheckAcceptType == "3"
- // select x).Count();
- return 0;
+ int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
+ join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
+ where y.ProjectId == projectid && y.CheckAcceptType == "3" && x.CreateDate > Const.DtmarkTime
+ select x).Count();
+ return result;
}
///
/// 获取隐蔽工程验收合格数
///
///
- public static int GetConcealedWorksOKNum(string projectid)
+ public static int GetConcealedWorksOkNum(string projectid)
{
- //int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
- // join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
- // join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
- // where y.ProjectId == projectid && y.CheckAcceptType == "3" && z.IsOnceQualified == true
- // select x).Count();
- return 0;
+ int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
+ join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
+ join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
+ where y.ProjectId == projectid && y.CheckAcceptType == "3" && z.IsOnceQualified == true && x.CreateDate > Const.DtmarkTime
+ select x).Count();
+ return result;
}
///
/// 获取单位工程一次验收数
@@ -635,11 +640,11 @@ namespace BLL
///
public static int GetUnitProjectOnesNum(string projectid)
{
- //int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
- // join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
- // where y.ProjectId == projectid && y.CheckAcceptType == "4"
- // select x).Count();
- return 0;
+ int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
+ join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
+ where y.ProjectId == projectid && y.CheckAcceptType == "4" && x.CreateDate > Const.DtmarkTime
+ select x).Count();
+ return result;
}
///
/// 获取单位工程一次验收合格数
@@ -647,12 +652,12 @@ namespace BLL
///
public static int GetUnitProjectOnesOKNum(string projectid)
{
- //int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
- // join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
- // join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
- // where y.ProjectId == projectid && y.CheckAcceptType == "4" && z.IsOnceQualified == true
- // select x).Count();
- return 0;
+ int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
+ join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
+ join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
+ where y.ProjectId == projectid && y.CheckAcceptType == "4" && z.IsOnceQualified == true && x.CreateDate > Const.DtmarkTime
+ select x).Count();
+ return result;
}
///
/// 获取材料进场复验数
@@ -660,11 +665,11 @@ namespace BLL
///
public static int GetMaterialInRecheckNum(string projectid)
{
- //int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
- // join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
- // where y.ProjectId == projectid && y.CheckAcceptType == "5"
- // select x).Count();
- return 0;
+ int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
+ join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
+ where y.ProjectId == projectid && y.CheckAcceptType == "5" && x.CreateDate > Const.DtmarkTime
+ select x).Count();
+ return result;
}
///
/// 获取材料进场复验合格数
@@ -672,12 +677,12 @@ namespace BLL
///
public static int GetMaterialInRecheckOKNum(string projectid)
{
- //int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
- // join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
- // join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
- // where y.ProjectId == projectid && y.CheckAcceptType == "5" && z.IsOnceQualified == true
- // select x).Count();
- return 0;
+ int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
+ join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
+ join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
+ where y.ProjectId == projectid && y.CheckAcceptType == "5" && z.IsOnceQualified == true && x.CreateDate > Const.DtmarkTime
+ select x).Count();
+ return result;
}
///
/// 获取单项工程个数
@@ -685,10 +690,10 @@ namespace BLL
///
public static int GetSingleProjectNum(string projectid)
{
- //int result = (from x in Funs.DB.Project_Installation
- // where x.ProjectId == projectid && x.SuperInstallationId == "0"
- // select x).Count();
- return 0;
+ int result = (from x in Funs.DB.WBS_UnitWork
+ where x.ProjectId == projectid
+ select x).Count();
+ return result;
}
///
/// 获取单位工程个数
@@ -707,10 +712,10 @@ namespace BLL
///
public static int GetSubProjectNum(string projectid)
{
- //int result = (from x in Funs.DB.WBS_DivisionProject
- // where x.ProjectId == projectid && x.SubItemType == "1"
- // select x).Count();
- return 0;
+ int result = (from x in Funs.DB.WBS_DivisionProject
+ where x.ProjectId == projectid && x.SubItemType == "1" && x.IsSelected == true
+ select x).Count();
+ return result;
}
///
/// 获取分项工程个数
@@ -718,10 +723,10 @@ namespace BLL
///
public static int GetSubdivisionalWorksNum(string projectid)
{
- //int result = (from x in Funs.DB.WBS_DivisionProject
- // where x.ProjectId == projectid && x.SubItemType == "3"
- // select x).Count();
- return 0;
+ int result = (from x in Funs.DB.WBS_DivisionProject
+ where x.ProjectId == projectid && x.SubItemType == "3" && x.IsSelected == true
+ select x).Count();
+ return result;
}
///
/// 获取检验批个数
@@ -729,10 +734,10 @@ namespace BLL
///
public static int GetInspectionLotNum(string projectid)
{
- //int result = (from x in Funs.DB.WBS_BreakdownProject
- // where x.ProjectId == projectid
- // select x).Count();
- return 0;
+ int result = (from x in Funs.DB.WBS_BreakdownProject
+ where x.ProjectId == projectid && x.IsSelected == true
+ select x).Count();
+ return result;
}
diff --git a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_HJGLService.cs b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_HJGLService.cs
index c910a3e9..aa4ce0ff 100644
--- a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_HJGLService.cs
+++ b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_HJGLService.cs
@@ -105,11 +105,11 @@ namespace BLL
return db.Project_HJGLData_HJGL.FirstOrDefault(x => x.Id == Id);
}
- public static List GetProject_HJGLData_HJGLByProjectid (string Projectid)
+ public static List GetProject_HJGLData_HJGLByProjectid(string Projectid)
{
- var q =( from x in db.Project_HJGLData_HJGL
- where x.ProjectId == Projectid
- select x).ToList();
+ var q = (from x in db.Project_HJGLData_HJGL
+ where x.ProjectId == Projectid
+ select x).ToList();
return q;
}
public static void AddProject_HJGLData_HJGL(Model.Project_HJGLData_HJGL newtable)
@@ -226,9 +226,14 @@ namespace BLL
///
/// 项目id
/// 数据类型
- public static void StatisticalData(string projectid,HJGLDateType hJGLDateType)
+ public static void StatisticalData(string projectid, HJGLDateType hJGLDateType)
{
- string thisUnitId = BLL.Const.UnitId_SEDIN;
+ string thisUnitId = string.Empty;
+ var thisUnit = CommonService.GetIsThisUnit();
+ if (thisUnit != null)
+ {
+ thisUnitId = thisUnit.UnitId;
+ }
var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
Model.Project_HJGLData_HJGL table = new Model.Project_HJGLData_HJGL();
if (IsReportByToday(projectid))
@@ -237,7 +242,7 @@ namespace BLL
}
else
{
- table.Id = SQLHelper.GetNewID();
+ table.Id = SQLHelper.GetNewID();
}
table.UnitId = thisUnitId;
table.CollCropCode = base_Unit.CollCropCode;
@@ -245,7 +250,7 @@ namespace BLL
table.ProjectId = projectid;
table.ReportDate = DateTime.Now.Date;
- if (hJGLDateType== HJGLDateType.TotalNumberOfWelders|| hJGLDateType == HJGLDateType.All)
+ if (hJGLDateType == HJGLDateType.TotalNumberOfWelders || hJGLDateType == HJGLDateType.All)
{
table.WelderNum = GetWelderNum(projectid);
@@ -265,9 +270,9 @@ namespace BLL
}
if (hJGLDateType == HJGLDateType.DefectAnalysis || hJGLDateType == HJGLDateType.All)
{
- Project_HJGLData_DefectService.StatisticalData(projectid);
+ // Project_HJGLData_DefectService.StatisticalData(projectid);
}
-
+
if (IsReportByToday(projectid))
{
UpdateProject_HJGLData_HJGL(table);
@@ -320,7 +325,7 @@ namespace BLL
{
int result = (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.HJGL_Batch_NDE on x.NDEID equals y.NDEID
- where y.ProjectId == projectid
+ where y.ProjectId == projectid
select x.TotalFilm).ToList().Sum(x => x.Value);
return result;
}
@@ -332,7 +337,7 @@ namespace BLL
{
int result = (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.HJGL_Batch_NDE on x.NDEID equals y.NDEID
- where y.ProjectId == projectid
+ where y.ProjectId == projectid
select x.PassFilm).ToList().Sum(x => x.Value);
return result;
}
diff --git a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HSSEService.cs b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HSSEService.cs
index 190aed7f..1fa3acad 100644
--- a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HSSEService.cs
+++ b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HSSEService.cs
@@ -1,131 +1,1486 @@
-using FineUIPro;
-using System;
+using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
-using System.Text;
+using FineUIPro;
using Model;
-using Newtonsoft.Json;
-using static BLL.Project_HJGLData_HJGLService;
namespace BLL
{
-
public static class Project_HSSEData_HSSEService
{
- public static Model.SGGLDB db = Funs.DB;
///
- /// HSSE数据类型
+ /// HSSE数据类型
///
public enum HSSEDateType
{
-
///
- /// 全部数据
+ /// 全部数据
///
All,
+
///
- /// 项目信息数据
+ /// 项目信息数据
///
ProjectInformation,
+
///
- /// 工时数据
+ /// 工时数据
///
WorkingHours,
+
///
- /// 教育培训数据
+ /// 教育培训数据
///
EducationAndTraining,
+
///
- /// 环保数据
+ /// 环保数据
///
Environmental,
+
///
- /// 安监人员数据
+ /// 安监人员数据
///
OfSafetySupervisors,
+
///
- /// 安全会议数据
+ /// 安全会议数据
///
SafetyMeeting,
+
///
- /// 监督检查数据
+ /// 监督检查数据
///
SupervisionAndInspection,
+
///
- /// 事故事件数据
+ /// 事故事件数据
///
AccidentEvent,
+
///
- /// 应急管理数据
+ /// 应急管理数据
///
EmergencyManagement,
+
///
- /// 安全费用数据
+ /// 安全费用数据
///
SecurityCost,
+
///
- /// 施工机具数据
+ /// 施工机具数据
///
ConstructionEquipment,
+
///
- /// 作业许可数据
+ /// 作业许可数据
///
WorkPermit,
+
///
- /// 隐患排查数据
+ /// 隐患排查数据
///
HiddenDangerTroubleshooting,
+
///
- /// 安全风险数据
+ /// 安全风险数据
///
SecurityRisk,
+
///
- /// 隐患类别数据
+ /// 隐患类别数据
///
HiddenDangerCategory,
+
///
- /// 危大工程数据
+ /// 危大工程数据
///
DangerousProject
- };
- #region 获取列表
- ///
- /// 记录数
- ///
- public static int count
- {
- get;
- set;
}
- public static List GetProject_HSSEData_HSSEByModle(Model.Project_HSSEData_HSSE table)
+
+ public static SGGLDB db = Funs.DB;
+
+ ///
+ /// 新增实体
+ ///
+ ///
+ public static void AddProject_HSSEData_HSSE(Project_HSSEData_HSSE newtable)
+ {
+ using (var db = new SGGLDB(Funs.ConnString))
+ {
+ var table = new Project_HSSEData_HSSE
+ {
+ Id = newtable.Id,
+ ProjectId = newtable.ProjectId,
+ UnitId = newtable.UnitId,
+ CollCropCode = newtable.CollCropCode,
+ UnitName = newtable.UnitName,
+ ReportDate = newtable.ReportDate,
+ BeUnderConstructionNum = newtable.BeUnderConstructionNum,
+ ShutdownNum = newtable.ShutdownNum,
+ JoinConstructionPersonNum = newtable.JoinConstructionPersonNum,
+ MajorProjectsUnderConstructionNum = newtable.MajorProjectsUnderConstructionNum,
+ TotalWorkingHour = newtable.TotalWorkingHour,
+ LostWorkingHour = newtable.LostWorkingHour,
+ SafeWorkingHour = newtable.SafeWorkingHour,
+ SafeTrainNum = newtable.SafeTrainNum,
+ SpecialTrainNum = newtable.SpecialTrainNum,
+ SpecialOperationTrainNum = newtable.SpecialOperationTrainNum,
+ TotalEnergyConsumption = newtable.TotalEnergyConsumption,
+ IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption,
+ NewWaterConsumption = newtable.NewWaterConsumption,
+ HeadOfficeInspectorGeneralNum = newtable.HeadOfficeInspectorGeneralNum,
+ HeadOfficeFullTimeNum = newtable.HeadOfficeFullTimeNum,
+ BranchInspectorGeneralNum = newtable.BranchInspectorGeneralNum,
+ BranchFullTimeNum = newtable.BranchFullTimeNum,
+ ProjectInspectorGeneralNum = newtable.ProjectInspectorGeneralNum,
+ ProjectFullTimeNum = newtable.ProjectFullTimeNum,
+ ProjectSafetyMonitorNum = newtable.ProjectSafetyMonitorNum,
+ SafetyInjectionEngineer = newtable.SafetyInjectionEngineer,
+ CertificateANum = newtable.CertificateANum,
+ CertificateBNum = newtable.CertificateBNum,
+ CertificateCNum = newtable.CertificateCNum,
+ SafetyCommitteeMeetingNum = newtable.SafetyCommitteeMeetingNum,
+ EnterpriseTopicsMeetingNum = newtable.EnterpriseTopicsMeetingNum,
+ ProjectSafetyLeadingGroupMeetingNum = newtable.ProjectSafetyLeadingGroupMeetingNum,
+ ProjectSafetyMeetingNum = newtable.ProjectSafetyMeetingNum,
+ CompanyLeadShiftCheckNum = newtable.CompanyLeadShiftCheckNum,
+ CompanyComprehensiveCheckNum = newtable.CompanyComprehensiveCheckNum,
+ CompanySpecialCheckNum = newtable.CompanySpecialCheckNum,
+ ProjectLeadShiftCheckNum = newtable.ProjectLeadShiftCheckNum,
+ ProjectSpecialCheckNum = newtable.ProjectSpecialCheckNum,
+ ProjectMajorCheckNum = newtable.ProjectMajorCheckNum,
+ NearMissNum = newtable.NearMissNum,
+ RecordableEventNum = newtable.RecordableEventNum,
+ GeneralAccidentNum = newtable.GeneralAccidentNum,
+ MajorAccidentNum = newtable.MajorAccidentNum,
+ SeriousAccidentNum = newtable.SeriousAccidentNum,
+ SpecialSeriousAccidentNum = newtable.SpecialSeriousAccidentNum,
+ CompanyComprehensivePlanNum = newtable.CompanyComprehensivePlanNum,
+ CompanySpecialPlanNum = newtable.CompanySpecialPlanNum,
+ CompanyOnSiteDisposalPlan = newtable.CompanyOnSiteDisposalPlan,
+ CompanyDrillNum = newtable.CompanyDrillNum,
+ ProjectComprehensivePlanNum = newtable.ProjectComprehensivePlanNum,
+ ProjectSpecialPlanNum = newtable.ProjectSpecialPlanNum,
+ ProjectOnSiteDisposalPlan = newtable.ProjectOnSiteDisposalPlan,
+ ProjectDrillNum = newtable.ProjectDrillNum,
+ CostExtract = newtable.CostExtract,
+ CostUse = newtable.CostUse,
+ UseEquipmentNum = newtable.UseEquipmentNum,
+ SpecialEquipmentNum = newtable.SpecialEquipmentNum,
+ LicensesNum = newtable.LicensesNum,
+ LicensesCloseNum = newtable.LicensesCloseNum,
+ GeneralClosedNum = newtable.GeneralClosedNum,
+ GeneralNotClosedNum = newtable.GeneralNotClosedNum,
+ MajorClosedNum = newtable.MajorClosedNum,
+ MajorNotClosedNum = newtable.MajorNotClosedNum,
+ GeneralRiskNum = newtable.GeneralRiskNum,
+ LowRiskNum = newtable.LowRiskNum,
+ MediumRiskNum = newtable.MediumRiskNum,
+ HighRiskNum = newtable.HighRiskNum,
+ CompletedNum = newtable.CompletedNum,
+ TrainPersonNum = newtable.TrainPersonNum,
+ ConstructionNum = newtable.ConstructionNum,
+ FinishedNum = newtable.FinishedNum,
+ SuperCompletedNum = newtable.SuperCompletedNum,
+ SuperTrainPersonNum = newtable.SuperTrainPersonNum,
+ SuperConstructionNum = newtable.SuperConstructionNum,
+ SuperFinishedNum = newtable.SuperFinishedNum
+ };
+ db.Project_HSSEData_HSSE.InsertOnSubmit(table);
+ db.SubmitChanges();
+ }
+ }
+
+ ///
+ /// 删除实体
+ ///
+ ///
+ public static void DeleteProject_HSSEData_HSSEById(string Id)
+ {
+ using (var db = new SGGLDB(Funs.ConnString))
+ {
+ var table = db.Project_HSSEData_HSSE.FirstOrDefault(x => x.Id == Id);
+ if (table != null)
+ {
+ db.Project_HSSEData_HSSE.DeleteOnSubmit(table);
+ db.SubmitChanges();
+ }
+ }
+ }
+
+ ///
+ /// 根据id获取实体
+ ///
+ ///
+ ///
+ public static Project_HSSEData_HSSE GetProject_HSSEData_HSSEById(string Id)
+ {
+ return db.Project_HSSEData_HSSE.FirstOrDefault(x => x.Id == Id);
+ }
+
+ public static List GetProject_HSSEData_HSSEByProjectid(string Projectid)
+ {
+ using (var db = new SGGLDB(Funs.ConnString))
+ {
+ var q = (from x in db.Project_HSSEData_HSSE
+ where x.ProjectId == Projectid
+ select x).ToList();
+ return q;
+ }
+ }
+
+ public static void UpdateProject_HSSEData_HSSE(Project_HSSEData_HSSE newtable)
+ {
+ using (var db = new SGGLDB(Funs.ConnString))
+ {
+ var table = db.Project_HSSEData_HSSE.FirstOrDefault(x => x.Id == newtable.Id);
+ if (table != null)
+ {
+ table.Id = newtable.Id;
+ table.ProjectId = newtable.ProjectId;
+ table.UnitId = newtable.UnitId;
+ table.CollCropCode = newtable.CollCropCode;
+ table.UnitName = newtable.UnitName;
+ table.ReportDate = newtable.ReportDate;
+ table.BeUnderConstructionNum = newtable.BeUnderConstructionNum;
+ table.ShutdownNum = newtable.ShutdownNum;
+ table.JoinConstructionPersonNum = newtable.JoinConstructionPersonNum;
+ table.MajorProjectsUnderConstructionNum = newtable.MajorProjectsUnderConstructionNum;
+ table.TotalWorkingHour = newtable.TotalWorkingHour;
+ table.LostWorkingHour = newtable.LostWorkingHour;
+ table.SafeWorkingHour = newtable.SafeWorkingHour;
+ table.SafeTrainNum = newtable.SafeTrainNum;
+ table.SpecialTrainNum = newtable.SpecialTrainNum;
+ table.SpecialOperationTrainNum = newtable.SpecialOperationTrainNum;
+ table.TotalEnergyConsumption = newtable.TotalEnergyConsumption;
+ table.IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption;
+ table.NewWaterConsumption = newtable.NewWaterConsumption;
+ table.HeadOfficeInspectorGeneralNum = newtable.HeadOfficeInspectorGeneralNum;
+ table.HeadOfficeFullTimeNum = newtable.HeadOfficeFullTimeNum;
+ table.BranchInspectorGeneralNum = newtable.BranchInspectorGeneralNum;
+ table.BranchFullTimeNum = newtable.BranchFullTimeNum;
+ table.ProjectInspectorGeneralNum = newtable.ProjectInspectorGeneralNum;
+ table.ProjectFullTimeNum = newtable.ProjectFullTimeNum;
+ table.ProjectSafetyMonitorNum = newtable.ProjectSafetyMonitorNum;
+ table.SafetyInjectionEngineer = newtable.SafetyInjectionEngineer;
+ table.CertificateANum = newtable.CertificateANum;
+ table.CertificateBNum = newtable.CertificateBNum;
+ table.CertificateCNum = newtable.CertificateCNum;
+ table.SafetyCommitteeMeetingNum = newtable.SafetyCommitteeMeetingNum;
+ table.EnterpriseTopicsMeetingNum = newtable.EnterpriseTopicsMeetingNum;
+ table.ProjectSafetyLeadingGroupMeetingNum = newtable.ProjectSafetyLeadingGroupMeetingNum;
+ table.ProjectSafetyMeetingNum = newtable.ProjectSafetyMeetingNum;
+ table.CompanyLeadShiftCheckNum = newtable.CompanyLeadShiftCheckNum;
+ table.CompanyComprehensiveCheckNum = newtable.CompanyComprehensiveCheckNum;
+ table.CompanySpecialCheckNum = newtable.CompanySpecialCheckNum;
+ table.ProjectLeadShiftCheckNum = newtable.ProjectLeadShiftCheckNum;
+ table.ProjectSpecialCheckNum = newtable.ProjectSpecialCheckNum;
+ table.ProjectMajorCheckNum = newtable.ProjectMajorCheckNum;
+ table.NearMissNum = newtable.NearMissNum;
+ table.RecordableEventNum = newtable.RecordableEventNum;
+ table.GeneralAccidentNum = newtable.GeneralAccidentNum;
+ table.MajorAccidentNum = newtable.MajorAccidentNum;
+ table.SeriousAccidentNum = newtable.SeriousAccidentNum;
+ table.SpecialSeriousAccidentNum = newtable.SpecialSeriousAccidentNum;
+ table.CompanyComprehensivePlanNum = newtable.CompanyComprehensivePlanNum;
+ table.CompanySpecialPlanNum = newtable.CompanySpecialPlanNum;
+ table.CompanyOnSiteDisposalPlan = newtable.CompanyOnSiteDisposalPlan;
+ table.CompanyDrillNum = newtable.CompanyDrillNum;
+ table.ProjectComprehensivePlanNum = newtable.ProjectComprehensivePlanNum;
+ table.ProjectSpecialPlanNum = newtable.ProjectSpecialPlanNum;
+ table.ProjectOnSiteDisposalPlan = newtable.ProjectOnSiteDisposalPlan;
+ table.ProjectDrillNum = newtable.ProjectDrillNum;
+ table.CostExtract = newtable.CostExtract;
+ table.CostUse = newtable.CostUse;
+ table.UseEquipmentNum = newtable.UseEquipmentNum;
+ table.SpecialEquipmentNum = newtable.SpecialEquipmentNum;
+ table.LicensesNum = newtable.LicensesNum;
+ table.LicensesCloseNum = newtable.LicensesCloseNum;
+ table.GeneralClosedNum = newtable.GeneralClosedNum;
+ table.GeneralNotClosedNum = newtable.GeneralNotClosedNum;
+ table.MajorClosedNum = newtable.MajorClosedNum;
+ table.MajorNotClosedNum = newtable.MajorNotClosedNum;
+ table.GeneralRiskNum = newtable.GeneralRiskNum;
+ table.LowRiskNum = newtable.LowRiskNum;
+ table.MediumRiskNum = newtable.MediumRiskNum;
+ table.HighRiskNum = newtable.HighRiskNum;
+ table.CompletedNum = newtable.CompletedNum;
+ table.TrainPersonNum = newtable.TrainPersonNum;
+ table.ConstructionNum = newtable.ConstructionNum;
+ table.FinishedNum = newtable.FinishedNum;
+ table.SuperCompletedNum = newtable.SuperCompletedNum;
+ table.SuperTrainPersonNum = newtable.SuperTrainPersonNum;
+ table.SuperConstructionNum = newtable.SuperConstructionNum;
+ table.SuperFinishedNum = newtable.SuperFinishedNum;
+ db.SubmitChanges();
+ }
+ }
+ }
+
+ ///
+ /// 判断该项目的该日期是否统计数据
+ ///
+ ///
+ ///
+ ///
+ public static bool IsReportByDate(DateTime dateTime, string projectid)
+ {
+ var result = false;
+ var q = (from x in Funs.DB.Project_HSSEData_HSSE
+ where x.ReportDate >= dateTime.Date && x.ReportDate < dateTime.Date.AddDays(1).Date &&
+ x.ProjectId == projectid
+ select x).ToList();
+ if (q != null && q.Count > 0) result = true;
+ return result;
+ }
+
+ ///
+ /// 判断当天是否已上报
+ ///
+ ///
+ public static bool IsReportByToday(string projectid)
+ {
+ var result = false;
+ var q = (from x in Funs.DB.Project_HSSEData_HSSE
+ where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date &&
+ x.ProjectId == projectid
+ select x).ToList();
+ if (q != null && q.Count > 0) result = true;
+ return result;
+ }
+
+ ///
+ /// 根据projectid,获取该项目当天的统计数据
+ ///
+ ///
+ ///
+ public static Project_HSSEData_HSSE getProject_HSSEData_HSSEByDate(string projectid)
+ {
+ var q = (from x in Funs.DB.Project_HSSEData_HSSE
+ where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date &&
+ x.ProjectId == projectid
+ select x).FirstOrDefault();
+ return q;
+ }
+
+ ///
+ /// 统计所有在建项目数据
+ ///
+ public static void StatisticalAllProjectData()
+ {
+ var projectlist = ProjectService.GetProjectWorkList();
+ foreach (var item in projectlist) StatisticalData(item.ProjectId, HSSEDateType.All);
+ }
+
+ ///
+ /// 统计数据
+ ///
+ ///
+ ///
+ public static void StatisticalData(string projectid, HSSEDateType hSseDateType)
+ {
+ var thisUnitId = string.Empty;
+ var thisUnit = CommonService.GetIsThisUnit();
+ if (thisUnit != null) thisUnitId = thisUnit.UnitId;
+ var baseUnit = UnitService.GetUnitByUnitId(thisUnitId);
+ var table = new Project_HSSEData_HSSE();
+ if (IsReportByToday(projectid))
+ table = getProject_HSSEData_HSSEByDate(projectid);
+ else
+ table.Id = SQLHelper.GetNewID();
+ table.UnitId = thisUnitId;
+ table.CollCropCode = baseUnit.CollCropCode;
+ table.UnitName = baseUnit.UnitName;
+ table.ProjectId = projectid;
+ table.ReportDate = DateTime.Now.Date;
+ if (hSseDateType == HSSEDateType.ProjectInformation || hSseDateType == HSSEDateType.All)
+ {
+ table.BeUnderConstructionNum = GetBeUnderConstructionNum(projectid);
+ table.ShutdownNum = GetShutdownNum(projectid);
+ table.JoinConstructionPersonNum = GetJoinConstructionPersonNum(projectid);
+ table.MajorProjectsUnderConstructionNum = GetMajorProjectsUnderConstructionNum(projectid);
+ }
+
+ if (hSseDateType == HSSEDateType.WorkingHours || hSseDateType == HSSEDateType.All)
+ {
+ table.TotalWorkingHour = GetTotalWorkingHour(projectid);
+ table.LostWorkingHour = GetLostWorkingHour(projectid);
+ table.SafeWorkingHour = GetSafeWorkingHour(projectid);
+ }
+
+ if (hSseDateType == HSSEDateType.EducationAndTraining || hSseDateType == HSSEDateType.All)
+ {
+ table.SafeTrainNum = GetSafeTrainNum(projectid);
+ table.SpecialTrainNum = GetSpecialTrainNum(projectid);
+ table.SpecialOperationTrainNum = GetSpecialOperationTrainNum(projectid);
+ }
+
+ if (hSseDateType == HSSEDateType.Environmental || hSseDateType == HSSEDateType.All)
+ {
+ table.TotalEnergyConsumption = GetTotalEnergyConsumption(projectid);
+ table.IncomeComprehensiveEnergyConsumption = GetIncomeComprehensiveEnergyConsumption(projectid);
+ table.NewWaterConsumption = GetNewWaterConsumption(projectid);
+ }
+
+ if (hSseDateType == HSSEDateType.OfSafetySupervisors || hSseDateType == HSSEDateType.All)
+ {
+ table.HeadOfficeInspectorGeneralNum = GetHeadOfficeInspectorGeneralNum(projectid);
+ table.HeadOfficeFullTimeNum = GetHeadOfficeFullTimeNum(projectid);
+ table.BranchInspectorGeneralNum = GetBranchInspectorGeneralNum(projectid);
+ table.BranchFullTimeNum = GetBranchFullTimeNum(projectid);
+ table.ProjectInspectorGeneralNum = GetProjectInspectorGeneralNum(projectid);
+ table.ProjectFullTimeNum = GetProjectFullTimeNum(projectid);
+ table.ProjectSafetyMonitorNum = GetProjectSafetyMonitorNum(projectid);
+ table.SafetyInjectionEngineer = GetSafetyInjectionEngineer(projectid);
+ table.CertificateANum = GetCertificateANum(projectid);
+ table.CertificateBNum = GetCertificateBNum(projectid);
+ table.CertificateCNum = GetCertificateCNum(projectid);
+ }
+
+ if (hSseDateType == HSSEDateType.SafetyMeeting || hSseDateType == HSSEDateType.All)
+ {
+ table.SafetyCommitteeMeetingNum = GetSafetyCommitteeMeetingNum(projectid);
+ table.EnterpriseTopicsMeetingNum = GetEnterpriseTopicsMeetingNum(projectid);
+ table.ProjectSafetyLeadingGroupMeetingNum = GetProjectSafetyLeadingGroupMeetingNum(projectid);
+ table.ProjectSafetyMeetingNum = GetProjectSafetyMeetingNum(projectid);
+ }
+
+ if (hSseDateType == HSSEDateType.SupervisionAndInspection || hSseDateType == HSSEDateType.All)
+ {
+ table.CompanyLeadShiftCheckNum = GetCompanyLeadShiftCheckNum(projectid);
+ table.CompanyComprehensiveCheckNum = GetCompanyComprehensiveCheckNum(projectid);
+ table.CompanySpecialCheckNum = GetCompanySpecialCheckNum(projectid);
+ table.ProjectLeadShiftCheckNum = GetProjectLeadShiftCheckNum(projectid);
+ table.ProjectSpecialCheckNum = GetProjectSpecialCheckNum(projectid);
+ table.ProjectMajorCheckNum = GetProjectMajorCheckNum(projectid);
+ }
+
+ if (hSseDateType == HSSEDateType.AccidentEvent || hSseDateType == HSSEDateType.All)
+ {
+ table.NearMissNum = GetNearMissNum(projectid);
+ table.RecordableEventNum = GetRecordableEventNum(projectid);
+ table.GeneralAccidentNum = GetGeneralAccidentNum(projectid);
+ table.MajorAccidentNum = GetMajorAccidentNum(projectid);
+ table.SeriousAccidentNum = GetSeriousAccidentNum(projectid);
+ table.SpecialSeriousAccidentNum = GetSpecialSeriousAccidentNum(projectid);
+ }
+
+ if (hSseDateType == HSSEDateType.EmergencyManagement || hSseDateType == HSSEDateType.All)
+ {
+ table.CompanyComprehensivePlanNum = GetCompanyComprehensivePlanNum(projectid);
+ table.CompanySpecialPlanNum = GetCompanySpecialPlanNum(projectid);
+ table.CompanyOnSiteDisposalPlan = GetCompanyOnSiteDisposalPlan(projectid);
+ table.CompanyDrillNum = GetCompanyDrillNum(projectid);
+ table.ProjectComprehensivePlanNum = GetProjectComprehensivePlanNum(projectid);
+ table.ProjectSpecialPlanNum = GetProjectSpecialPlanNum(projectid);
+ table.ProjectOnSiteDisposalPlan = GetProjectOnSiteDisposalPlan(projectid);
+ table.ProjectDrillNum = GetProjectDrillNum(projectid);
+ }
+
+ if (hSseDateType == HSSEDateType.SecurityCost || hSseDateType == HSSEDateType.All)
+ {
+ table.CostExtract = GetCostExtract(projectid);
+ table.CostUse = GetCostUse(projectid);
+ }
+
+ if (hSseDateType == HSSEDateType.ConstructionEquipment || hSseDateType == HSSEDateType.All)
+ {
+ table.UseEquipmentNum = GetUseEquipmentNum(projectid);
+ table.SpecialEquipmentNum = GetSpecialEquipmentNum(projectid);
+ }
+
+ if (hSseDateType == HSSEDateType.WorkPermit || hSseDateType == HSSEDateType.All)
+ {
+ table.LicensesNum = GetLicensesNum(projectid);
+ table.LicensesCloseNum = GetLicensesCloseNum(projectid);
+ }
+
+ if (hSseDateType == HSSEDateType.HiddenDangerTroubleshooting || hSseDateType == HSSEDateType.All)
+ {
+ table.GeneralClosedNum = GetGeneralClosedNum(projectid);
+ table.GeneralNotClosedNum = GetGeneralNotClosedNum(projectid);
+ table.MajorClosedNum = GetMajorClosedNum(projectid);
+ table.MajorNotClosedNum = GetMajorNotClosedNum(projectid);
+ }
+
+ if (hSseDateType == HSSEDateType.SecurityRisk || hSseDateType == HSSEDateType.All)
+ {
+ table.GeneralRiskNum = GetGeneralRiskNum(projectid);
+ table.LowRiskNum = GetLowRiskNum(projectid);
+ table.MediumRiskNum = GetMediumRiskNum(projectid);
+ table.HighRiskNum = GetHighRiskNum(projectid);
+ }
+
+ if (hSseDateType == HSSEDateType.HiddenDangerCategory || hSseDateType == HSSEDateType.All)
+ {
+ string thisUnitId1 = string.Empty;
+ var thisUnit1 = CommonService.GetIsThisUnit();
+ if (thisUnit1 != null)
+ {
+ thisUnitId1 = thisUnit1.UnitId;
+ }
+ var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId1);
+ DateTime date = DateTime.Now;
+ Model.SGGLDB db1 = Funs.DB;
+ var list = from x in db1.HSSE_Hazard_HazardRegister
+ select x;
+ var types = (from x in db1.HSSE_Hazard_HazardRegisterTypes
+ join y in list on x.RegisterTypesId equals y.RegisterTypesId
+ select new { x.RegisterTypesId, x.RegisterTypesName }).Distinct().ToList();
+ foreach (var type in types)
+ {
+ Model.Project_HSSEData_HiddenDangerDetail table1 = new Model.Project_HSSEData_HiddenDangerDetail
+ {
+ UnitId = thisUnitId1,
+ CollCropCode = base_Unit.CollCropCode,
+ UnitName = base_Unit.UnitName,
+ ProjectId = projectid,
+ ReportDate = DateTime.Now.Date,
+ TypeName = type.RegisterTypesName,
+ TotalNum = list.Count(x => x.RegisterTypesId == type.RegisterTypesId),
+ NeedRectifyNum = list.Count(x => x.RegisterTypesId == type.RegisterTypesId && (x.States == "1")),
+ };
+ if (Project_HSSEData_HiddenDangerDetailService.IsReportByToday(projectid, type.RegisterTypesName))
+ {
+ table1.Id = Project_HSSEData_HiddenDangerDetailService.GetTodayModelByProjectAndType(projectid, type.RegisterTypesName).Id;
+ Project_HSSEData_HiddenDangerDetailService.UpdateProject_HSSEData_HiddenDangerDetail(table1);
+ }
+ else
+ {
+ table1.Id = SQLHelper.GetNewID();
+ Project_HSSEData_HiddenDangerDetailService.AddProject_HSSEData_HiddenDangerDetail(table1);
+ }
+ }
+ }
+
+ if (hSseDateType == HSSEDateType.DangerousProject || hSseDateType == HSSEDateType.All)
+ {
+ table.CompletedNum = GetCompletedNum(projectid);
+ table.TrainPersonNum = GetTrainPersonNum(projectid);
+ table.ConstructionNum = GetConstructionNum(projectid);
+ table.FinishedNum = GetFinishedNum(projectid);
+ table.SuperCompletedNum = GetSuperCompletedNum(projectid);
+ table.SuperTrainPersonNum = GetSuperTrainPersonNum(projectid);
+ table.SuperConstructionNum = GetSuperConstructionNum(projectid);
+ table.SuperFinishedNum = GetSuperFinishedNum(projectid);
+ }
+
+ if (IsReportByToday(projectid))
+ UpdateProject_HSSEData_HSSE(table);
+ else
+ AddProject_HSSEData_HSSE(table);
+ HSSEData_HSSEService.UpdateTodyData_State();
+ }
+
+ ///
+ /// 获取在建项目数
+ ///
+ ///
+ public static int GetBeUnderConstructionNum(string projectid)
+ {
+ var result = (from x in Funs.DB.Base_Project
+ where x.ProjectState == "1" && x.ProjectId == projectid
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取停工项目数
+ ///
+ ///
+ public static int GetShutdownNum(string projectid)
+ {
+ var result = (from x in Funs.DB.Base_Project
+ where x.ProjectState == "2" && x.ProjectId == projectid
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取参建人数
+ ///
+ ///
+ public static int GetJoinConstructionPersonNum(string projectid)
+ {
+ var result = (from x in Funs.DB.SitePerson_Person
+ where x.ProjectId == projectid && x.States=="1"
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取在施危大工程数
+ ///
+ ///
+ public static int GetMajorProjectsUnderConstructionNum(string projectid)
+ {
+ var result = (from x in Funs.DB.Solution_LargerHazard
+ where x.ProjectId == projectid && x.States == "2" && x.RecordTime > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取总工时数
+ ///
+ ///
+ public static int GetTotalWorkingHour(string projectid)
+ {
+ var result = (from x in Funs.DB.SitePerson_DayReportDetail
+ join y in Funs.DB.SitePerson_DayReport on x.DayReportId equals y.DayReportId
+ where y.ProjectId == projectid && y.CompileDate > Const.DtmarkTime
+ select x.PersonWorkTime ?? 0).ToList().Sum();
+ var q = Funs.GetNewIntOrZero(result.ToString().Split('.')[0]);
+
+ return q;
+ }
+
+ ///
+ /// 获取损失工时数
+ ///
+ ///
+ public static int GetLostWorkingHour(string projectid)
+ {
+ var result =
+ (from x in Funs.DB.Accident_AccidentHandle
+ where x.ProjectId == projectid && x.CompileDate > Const.DtmarkTime
+ select x.WorkHoursLoss)
+ .ToList().Sum(x => x.Value)
+ + (from x in Funs.DB.Accident_AccidentReport
+ where x.ProjectId == projectid && x.CompileDate > Const.DtmarkTime
+ select x.WorkingHoursLoss)
+ .ToList().Sum(x => x.Value);
+ var q = Funs.GetNewIntOrZero(result.ToString().Split('.')[0]);
+
+ return q;
+ }
+
+ ///
+ /// 获取安全工时数
+ ///
+ ///
+ public static int GetSafeWorkingHour(string projectid)
+ {
+ var result1 = (from x in Funs.DB.SitePerson_DayReportDetail
+ join y in Funs.DB.SitePerson_DayReport on x.DayReportId equals y.DayReportId
+ where y.ProjectId == projectid && y.CompileDate > Const.DtmarkTime
+ select x.PersonWorkTime ?? 0).ToList().Sum();
+ var result2 =
+ (from x in Funs.DB.Accident_AccidentHandle
+ where x.ProjectId == projectid && x.CompileDate > Const.DtmarkTime
+ select x.WorkHoursLoss)
+ .ToList().Sum(x => x.Value)
+ + (from x in Funs.DB.Accident_AccidentReport
+ where x.ProjectId == projectid && x.CompileDate > Const.DtmarkTime
+ select x.WorkingHoursLoss)
+ .ToList().Sum(x => x.Value);
+ var result = result1 - result2;
+ var q = Funs.GetNewIntOrZero(result.ToString().Split('.')[0]);
+
+ return q;
+ }
+
+ ///
+ /// 获取三级安全教育培训数
+ ///
+ ///
+ public static int GetSafeTrainNum(string projectid)
+ {
+ var result = (from x in Funs.DB.EduTrain_TrainRecord
+ join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
+ where x.ProjectId == projectid && y.TrainType == "1" && x.TrainStartDate > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取专项培训数
+ ///
+ ///
+ public static int GetSpecialTrainNum(string projectid)
+ {
+ var result = (from x in Funs.DB.EduTrain_TrainRecord
+ join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
+ where x.ProjectId == projectid && y.TrainType == "2" && x.TrainStartDate > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取特种作业培训数
+ ///
+ ///
+ public static int GetSpecialOperationTrainNum(string projectid)
+ {
+ var result = (from x in Funs.DB.EduTrain_TrainRecord
+ join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
+ where x.ProjectId == projectid && y.TrainType == "3" && x.TrainStartDate > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取能耗总量
+ ///
+ ///
+ public static int GetTotalEnergyConsumption(string projectid)
+ {
+ var result = 0;
+ return result;
+ }
+
+ ///
+ /// 获取万元营业收入综合能耗
+ ///
+ ///
+ public static int GetIncomeComprehensiveEnergyConsumption(string projectid)
+ {
+ var result = 0;
+ return result;
+ }
+
+ ///
+ /// 获取二氧化碳
+ ///
+ ///
+ public static int GetNewWaterConsumption(string projectid)
+ {
+ var result = 0;
+ return result;
+ }
+
+ ///
+ /// 获取企业总部总监人数
+ ///
+ ///
+ public static int GetHeadOfficeInspectorGeneralNum(string projectid)
+ {
+ var result = 0;
+ return result;
+ }
+
+ ///
+ /// 获取企业总部专职人数
+ ///
+ ///
+ public static int GetHeadOfficeFullTimeNum(string projectid)
+ {
+ var result = 0;
+ return result;
+ }
+
+ ///
+ /// 获取分支机构总监人数
+ ///
+ ///
+ public static int GetBranchInspectorGeneralNum(string projectid)
+ {
+ var result = 0;
+ return result;
+ }
+
+ ///
+ /// 获取分支机构专职人数
+ ///
+ ///
+ public static int GetBranchFullTimeNum(string projectid)
+ {
+ var result = 0;
+ return result;
+ }
+
+ ///
+ /// 获取项目总监人数
+ ///
+ ///
+ public static int GetProjectInspectorGeneralNum(string projectid)
+ {
+ var result = (from x in Funs.DB.SitePerson_Person
+ where x.ProjectId == projectid && x.WorkPostId == Const.WorkPost_ProjectHSSEDirector && x.States=="1"
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取项目专职人数
+ ///
+ ///
+ public static int GetProjectFullTimeNum(string projectid)
+ {
+ var result = (from x in Funs.DB.SitePerson_Person
+ join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
+ where x.ProjectId == projectid && y.IsHsse == true && x.States == "1"
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取项目安全监护人数
+ ///
+ ///
+ public static int GetProjectSafetyMonitorNum(string projectid)
+ {
+ var result = (from x in Funs.DB.SitePerson_Person
+ where x.ProjectId == projectid && x.IsSafetyMonitoring == true && x.States == "1"
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取在岗执业注安师
+ ///
+ ///
+ public static int GetSafetyInjectionEngineer(string projectid)
+ {
+ var result = (from x in Funs.DB.SitePerson_Person
+ join y in Funs.DB.Base_Certificate on x.CertificateId equals y.CertificateId
+ where x.ProjectId == projectid && y.IsRegisterHSSE == true && x.States == "1"
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取A证人员
+ ///
+ ///
+ public static int GetCertificateANum(string projectid)
+ {
+ var result = (from x in Funs.DB.SitePerson_Person
+ join y in Funs.DB.Base_Certificate on x.CertificateId equals y.CertificateId
+ where x.ProjectId == projectid && y.CertificateType == "A" && x.States == "1"
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取B证人员
+ ///
+ ///
+ public static int GetCertificateBNum(string projectid)
+ {
+ var result = (from x in Funs.DB.SitePerson_Person
+ join y in Funs.DB.Base_Certificate on x.CertificateId equals y.CertificateId
+ where x.ProjectId == projectid && y.CertificateType == "B" && x.States == "1"
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取C证人员
+ ///
+ ///
+ public static int GetCertificateCNum(string projectid)
+ {
+ var result = (from x in Funs.DB.SitePerson_Person
+ join y in Funs.DB.Base_Certificate on x.CertificateId equals y.CertificateId
+ where x.ProjectId == projectid && y.CertificateType == "C" && x.States == "1"
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取企业安委会会议数
+ ///
+ ///
+ public static int GetSafetyCommitteeMeetingNum(string projectid)
+ {
+ var result = 0;
+ return result;
+ }
+
+ ///
+ /// 获取企业专题会议数
+ ///
+ ///
+ public static int GetEnterpriseTopicsMeetingNum(string projectid)
+ {
+ var result = 0;
+ return result;
+ }
+
+ ///
+ /// 获取项目安全领导小组会议数
+ ///
+ ///
+ public static int GetProjectSafetyLeadingGroupMeetingNum(string projectid)
+ {
+ var result = (from x in Funs.DB.Meeting_SafetyLeaderGroupMeeting
+ where x.ProjectId == projectid && x.CompileDate > Const.DtmarkTime
+ select x)
+ .Count();
+ return result;
+ }
+
+ ///
+ /// 获取项目安全例会数
+ ///
+ ///
+ public static int GetProjectSafetyMeetingNum(string projectid)
+ {
+ var result = (from x in Funs.DB.Meeting_WeekMeeting
+ where x.ProjectId == projectid && x.CompileDate > Const.DtmarkTime
+ select x).Count()
+ + (from x in Funs.DB.Meeting_MonthMeeting
+ where x.ProjectId == projectid && x.CompileDate > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取企业负责人带班检查次数
+ ///
+ ///
+ public static int GetCompanyLeadShiftCheckNum(string projectid)
+ {
+ var result = 0;
+ return result;
+ }
+
+ ///
+ /// 获取企业综合检查次数
+ ///
+ ///
+ public static int GetCompanyComprehensiveCheckNum(string projectid)
+ {
+ var result = 0;
+ return result;
+ }
+
+ ///
+ /// 获取企业专项检查次数
+ ///
+ ///
+ public static int GetCompanySpecialCheckNum(string projectid)
+ {
+ var result = 0;
+ return result;
+ }
+
+ ///
+ /// 获取项目负责人带班检查次数
+ ///
+ ///
+ public static int GetProjectLeadShiftCheckNum(string projectid)
+ {
+ var result = (from x in Funs.DB.Check_ProjectLeaderCheck
+ where x.ProjectId == projectid && x.CompileDate > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取项目专项检查次数
+ ///
+ ///
+ public static int GetProjectSpecialCheckNum(string projectid)
+ {
+ var result = (from x in Funs.DB.Check_CheckSpecial
+ where x.ProjectId == projectid && x.CheckTime > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取项目专业检查次数
+ ///
+ ///
+ public static int GetProjectMajorCheckNum(string projectid)
+ {
+ var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
+ where x.ProjectId == projectid && x.CheckTime > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取未遂事件数
+ ///
+ ///
+ public static int GetNearMissNum(string projectid)
+ {
+ var result = (from x in Funs.DB.Accident_AccidentPersonRecord
+ join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
+ where x.ProjectId == projectid && x.IsAttempt == "1" && x.CompileDate > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取可记录事件数
+ ///
+ ///
+ public static int GetRecordableEventNum(string projectid)
+ {
+ var result = (from x in Funs.DB.Accident_AccidentPersonRecord
+ join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
+ where x.ProjectId == projectid && x.CompileDate > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取一般事故数
+ ///
+ ///
+ public static int GetGeneralAccidentNum(string projectid)
+ {
+ var result = (from x in Funs.DB.Accident_AccidentReport
+ where x.ProjectId == projectid && x.AccidentDegree == "1" && x.CompileDate > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取较大事故数
+ ///
+ ///
+ public static int GetMajorAccidentNum(string projectid)
+ {
+ var result = (from x in Funs.DB.Accident_AccidentReport
+ where x.ProjectId == projectid && x.AccidentDegree == "2" && x.CompileDate > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取重大事故数
+ ///
+ ///
+ public static int GetSeriousAccidentNum(string projectid)
+ {
+ var result = (from x in Funs.DB.Accident_AccidentReport
+ where x.ProjectId == projectid && x.AccidentDegree == "3" && x.CompileDate > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取特别重大事故数
+ ///
+ ///
+ public static int GetSpecialSeriousAccidentNum(string projectid)
+ {
+ var result = (from x in Funs.DB.Accident_AccidentReport
+ where x.ProjectId == projectid && x.AccidentDegree == "4"
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取企业级综合预案数
+ ///
+ ///
+ public static int GetCompanyComprehensivePlanNum(string projectid)
+ {
+ var result = 0;
+ return result;
+ }
+
+ ///
+ /// 获取企业级专项预案数
+ ///
+ ///
+ public static int GetCompanySpecialPlanNum(string projectid)
+ {
+ var result = 0;
+ return result;
+ }
+
+ ///
+ /// 获取企业级现场处置预案
+ ///
+ ///
+ public static int GetCompanyOnSiteDisposalPlan(string projectid)
+ {
+ var result = 0;
+ return result;
+ }
+
+ ///
+ /// 获取企业级演练次数
+ ///
+ ///
+ public static int GetCompanyDrillNum(string projectid)
+ {
+ var result = 0;
+ return result;
+ }
+
+ ///
+ /// 获取项目级综合预案
+ ///
+ ///
+ public static int GetProjectComprehensivePlanNum(string projectid)
+ {
+ var result = (from x in Funs.DB.Emergency_EmergencyList
+ join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
+ where x.ProjectId == projectid && y.EmergencyTypeName.Contains("综合") && x.CompileDate > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取项目级专项预案数
+ ///
+ ///
+ public static int GetProjectSpecialPlanNum(string projectid)
+ {
+ var result = (from x in Funs.DB.Emergency_EmergencyList
+ join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
+ where x.ProjectId == projectid && y.EmergencyTypeName.Contains("专项") && x.CompileDate > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取项目级现场处置预案
+ ///
+ ///
+ public static int GetProjectOnSiteDisposalPlan(string projectid)
+ {
+ var result = (from x in Funs.DB.Emergency_EmergencyList
+ join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
+ where x.ProjectId == projectid && y.EmergencyTypeName.Contains("现场处置") &&
+ x.CompileDate > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取项目级演练次数
+ ///
+ ///
+ public static int GetProjectDrillNum(string projectid)
+ {
+ var result = (from x in Funs.DB.Emergency_DrillRecordList
+ where x.ProjectId == projectid && x.CompileDate > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取费用提取(万元)
+ ///
+ ///
+ public static int GetCostExtract(string projectid)
+ {
+ var result = 0;
+ return result;
+ }
+
+ ///
+ /// 获取费用使用(万元)
+ ///
+ ///
+ public static int GetCostUse(string projectid)
+ {
+ var result = 0;
+ var costs = (from x in Funs.DB.CostGoods_CostSmallDetailItem
+ join y in Funs.DB.CostGoods_CostSmallDetail
+ on x.CostSmallDetailId equals y.CostSmallDetailId
+ where y.ProjectId == projectid && y.CompileDate > Const.DtmarkTime
+ select x.CostMoney ?? 0).ToList().Sum();
+ result = Funs.GetNewIntOrZero(costs.ToString().Split('.')[0]);
+ return result;
+ }
+
+ ///
+ /// 获取施工机具在用数
+ ///
+ ///
+ public static int GetUseEquipmentNum(string projectid)
+ {
+ /*var result = (from x in Funs.DB.InApproveManager_EquipmentInItem
+ join y in Funs.DB.InApproveManager_EquipmentIn on x.EquipmentInId equals y.EquipmentInId
+ where y.ProjectId == projectid && x.IsUsed == true
+ select x).Count() +
+ (from x in Funs.DB.InApproveManager_GeneralEquipmentInItem
+ join y in Funs.DB.InApproveManager_GeneralEquipmentIn on x.GeneralEquipmentInId equals y
+ .GeneralEquipmentInId
+ where y.ProjectId == projectid && x.IsUsed == true
+ select x).Count();*/
+ return 0;
+ }
+
+ ///
+ /// 获取施工机具特种设备数
+ ///
+ ///
+ public static int GetSpecialEquipmentNum(string projectid)
+ {
+ /*var result = (from x in Funs.DB.InApproveManager_EquipmentInItem
+ join y in Funs.DB.InApproveManager_EquipmentIn on x.EquipmentInId equals y.EquipmentInId
+ where y.ProjectId == projectid && x.IsUsed == true
+ select x).Count();*/
+ return 0;
+ }
+
+ ///
+ /// 获取作业许可项数
+ ///
+ ///
+ public static int GetLicensesNum(string projectid)
+ {
+ /*var result = (from x in Funs.DB.License_LicenseManager
+ where x.ProjectId == projectid && x.IsHighRisk == true && x.CompileDate > Const.DtmarkTime
+ select x).Count();*/
+ return 0;
+ }
+
+ ///
+ /// 获取作业许可关闭项数
+ ///
+ ///
+ public static int GetLicensesCloseNum(string projectid)
+ {
+ /*var result = (from x in Funs.DB.License_LicenseManager
+ where x.ProjectId == projectid && x.IsHighRisk == true && x.WorkStates == "3" &&
+ x.CompileDate > Const.DtmarkTime
+ select x).Count();*/
+ return 0;
+ }
+
+ ///
+ /// 获取一般隐患整改闭环项
+ ///
+ ///
+ public static int GetGeneralClosedNum(string projectid)
+ {
+ /*var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
+ where x.ProjectId == projectid && x.Risk_Level == "一般" && x.States == "3" &&
+ x.CheckTime > Const.DtmarkTime
+ select x).Count();*/
+ return 0;
+ }
+
+ ///
+ /// 获取一般隐患未整改完成项
+ ///
+ ///
+ public static int GetGeneralNotClosedNum(string projectid)
+ {
+ /*var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
+ where x.ProjectId == projectid && x.Risk_Level == "一般" && x.States != "3" &&
+ x.CheckTime > Const.DtmarkTime
+ select x).Count();*/
+ return 0;
+ }
+
+ ///
+ /// 获取重大隐患整改闭环项
+ ///
+ ///
+ public static int GetMajorClosedNum(string projectid)
+ {
+ /*var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
+ where x.ProjectId == projectid && x.Risk_Level == "重大" && x.States == "3" &&
+ x.CheckTime > Const.DtmarkTime
+ select x).Count();*/
+ return 0;
+ }
+
+ ///
+ /// 获取重大隐患未整改完成项
+ ///
+ ///
+ public static int GetMajorNotClosedNum(string projectid)
+ {
+ /*var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
+ where x.ProjectId == projectid && x.Risk_Level == "重大" && x.States != "3" &&
+ x.CheckTime > Const.DtmarkTime
+ select x).Count();*/
+ return 0;
+ }
+
+ ///
+ /// 获取一般风险数
+ ///
+ ///
+ public static int GetGeneralRiskNum(string projectid)
+ {
+ var result = (from x in Funs.DB.Hazard_HazardSelectedItem
+ join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
+ where x.ProjectId == projectid && y.RiskLevel == 2 && x.IsStart == true
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取低风险数
+ ///
+ ///
+ public static int GetLowRiskNum(string projectid)
+ {
+ var result = (from x in Funs.DB.Hazard_HazardSelectedItem
+ join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
+ where x.ProjectId == projectid && y.RiskLevel == 1 && x.IsStart == true
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取中风险数
+ ///
+ ///
+ public static int GetMediumRiskNum(string projectid)
+ {
+ var result = (from x in Funs.DB.Hazard_HazardSelectedItem
+ join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
+ where x.ProjectId == projectid && y.RiskLevel == 3 && x.IsStart == true
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取高风险数
+ ///
+ ///
+ public static int GetHighRiskNum(string projectid)
+ {
+ var result = (from x in Funs.DB.Hazard_HazardSelectedItem
+ join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
+ where x.ProjectId == projectid && y.RiskLevel == 4 && x.IsStart == true
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取危大工程审批完成数
+ ///
+ ///
+ public static int GetCompletedNum(string projectid)
+ {
+ var result = (from x in Funs.DB.Solution_LargerHazard
+ where x.ProjectId == projectid && x.States == "1" && x.IsSuperLargerHazard == false &&
+ x.RecordTime > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取危大工程培训人次数
+ ///
+ ///
+ public static int GetTrainPersonNum(string projectid)
+ {
+ var result = (from x in Funs.DB.Solution_LargerHazard
+ where x.ProjectId == projectid && x.IsSuperLargerHazard == false && x.RecordTime > Const.DtmarkTime
+ select x.TrainPersonNum).ToList().Sum(x => x.Value);
+ return result;
+ }
+
+ ///
+ /// 获取危大工程施工个数
+ ///
+ ///
+ public static int GetConstructionNum(string projectid)
+ {
+ var result = (from x in Funs.DB.Solution_LargerHazard
+ where x.ProjectId == projectid && x.States == "2" && x.IsSuperLargerHazard == false &&
+ x.RecordTime > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取危大工程完工个数
+ ///
+ ///
+ public static int GetFinishedNum(string projectid)
+ {
+ var result = (from x in Funs.DB.Solution_LargerHazard
+ where x.ProjectId == projectid && x.States == "3" && x.IsSuperLargerHazard == false &&
+ x.RecordTime > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取超危大工程审批完成数
+ ///
+ ///
+ public static int GetSuperCompletedNum(string projectid)
+ {
+ var result = (from x in Funs.DB.Solution_LargerHazard
+ where x.ProjectId == projectid && x.States == "1" && x.IsSuperLargerHazard == true &&
+ x.RecordTime > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取超危大工程培训人次数
+ ///
+ ///
+ public static int GetSuperTrainPersonNum(string projectid)
+ {
+ var result =
+ (from x in Funs.DB.Solution_LargerHazard
+ where x.ProjectId == projectid && x.IsSuperLargerHazard == true && x.RecordTime > Const.DtmarkTime
+ select x.TrainPersonNum).ToList().Sum(x => x.Value);
+ return result;
+ }
+
+ ///
+ /// 获取超危大工程施工个数
+ ///
+ ///
+ public static int GetSuperConstructionNum(string projectid)
+ {
+ var result = (from x in Funs.DB.Solution_LargerHazard
+ where x.ProjectId == projectid && x.States == "2" && x.IsSuperLargerHazard == true &&
+ x.RecordTime > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取超危大工程完工个数
+ ///
+ ///
+ public static int GetSuperFinishedNum(string projectid)
+ {
+ var result = (from x in Funs.DB.Solution_LargerHazard
+ where x.ProjectId == projectid && x.States == "3" && x.IsSuperLargerHazard == true &&
+ x.RecordTime > Const.DtmarkTime
+ select x).Count();
+ return result;
+ }
+
+ #region 获取列表
+
+ ///
+ /// 记录数
+ ///
+ public static int Count { get; set; }
+
+ public static List GetProject_HSSEData_HSSEByModle(Project_HSSEData_HSSE table)
{
var q = from x in db.Project_HSSEData_HSSE
where
- (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
- (string.IsNullOrEmpty(table.ProjectId) || x.Id.Contains(table.ProjectId)) &&
- (string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
- (string.IsNullOrEmpty(table.CollCropCode) || x.CollCropCode.Contains(table.CollCropCode)) &&
- (string.IsNullOrEmpty(table.UnitName) || x.UnitName.Contains(table.UnitName))
+ (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
+ (string.IsNullOrEmpty(table.ProjectId) || x.Id.Contains(table.ProjectId)) &&
+ (string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
+ (string.IsNullOrEmpty(table.CollCropCode) || x.CollCropCode.Contains(table.CollCropCode)) &&
+ (string.IsNullOrEmpty(table.UnitName) || x.UnitName.Contains(table.UnitName))
select x
- ;
+ ;
return q.ToList();
}
/// 获取分页列表
- ///
- /// 页码
- /// 每页数量
+ ///
+ ///
///
- public static IEnumerable getListData(Model.Project_HSSEData_HSSE table, Grid Grid1)
+ public static IEnumerable GetListData(Project_HSSEData_HSSE table, Grid grid1)
{
var q = GetProject_HSSEData_HSSEByModle(table);
- count = q.Count();
- if (count == 0)
- {
- return null;
- }
+ Count = q.Count();
+ if (Count == 0) return null;
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
return from x in q
select new
@@ -205,1198 +1560,10 @@ namespace BLL
x.SuperCompletedNum,
x.SuperTrainPersonNum,
x.SuperConstructionNum,
- x.SuperFinishedNum,
-
+ x.SuperFinishedNum
};
}
+
#endregion
- ///
- /// 新增实体
- ///
- ///
- public static void AddProject_HSSEData_HSSE(Model.Project_HSSEData_HSSE newtable)
- {
-
- Model.Project_HSSEData_HSSE table = new Model.Project_HSSEData_HSSE
- {
- Id = newtable.Id,
- ProjectId = newtable.ProjectId,
- UnitId = newtable.UnitId,
- CollCropCode = newtable.CollCropCode,
- UnitName = newtable.UnitName,
- ReportDate = newtable.ReportDate,
- BeUnderConstructionNum = newtable.BeUnderConstructionNum,
- ShutdownNum = newtable.ShutdownNum,
- JoinConstructionPersonNum = newtable.JoinConstructionPersonNum,
- MajorProjectsUnderConstructionNum = newtable.MajorProjectsUnderConstructionNum,
- TotalWorkingHour = newtable.TotalWorkingHour,
- LostWorkingHour = newtable.LostWorkingHour,
- SafeWorkingHour = newtable.SafeWorkingHour,
- SafeTrainNum = newtable.SafeTrainNum,
- SpecialTrainNum = newtable.SpecialTrainNum,
- SpecialOperationTrainNum = newtable.SpecialOperationTrainNum,
- TotalEnergyConsumption = newtable.TotalEnergyConsumption,
- IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption,
- NewWaterConsumption = newtable.NewWaterConsumption,
- HeadOfficeInspectorGeneralNum = newtable.HeadOfficeInspectorGeneralNum,
- HeadOfficeFullTimeNum = newtable.HeadOfficeFullTimeNum,
- BranchInspectorGeneralNum = newtable.BranchInspectorGeneralNum,
- BranchFullTimeNum = newtable.BranchFullTimeNum,
- ProjectInspectorGeneralNum = newtable.ProjectInspectorGeneralNum,
- ProjectFullTimeNum = newtable.ProjectFullTimeNum,
- ProjectSafetyMonitorNum = newtable.ProjectSafetyMonitorNum,
- SafetyInjectionEngineer = newtable.SafetyInjectionEngineer,
- CertificateANum = newtable.CertificateANum,
- CertificateBNum = newtable.CertificateBNum,
- CertificateCNum = newtable.CertificateCNum,
- SafetyCommitteeMeetingNum = newtable.SafetyCommitteeMeetingNum,
- EnterpriseTopicsMeetingNum = newtable.EnterpriseTopicsMeetingNum,
- ProjectSafetyLeadingGroupMeetingNum = newtable.ProjectSafetyLeadingGroupMeetingNum,
- ProjectSafetyMeetingNum = newtable.ProjectSafetyMeetingNum,
- CompanyLeadShiftCheckNum = newtable.CompanyLeadShiftCheckNum,
- CompanyComprehensiveCheckNum = newtable.CompanyComprehensiveCheckNum,
- CompanySpecialCheckNum = newtable.CompanySpecialCheckNum,
- ProjectLeadShiftCheckNum = newtable.ProjectLeadShiftCheckNum,
- ProjectSpecialCheckNum = newtable.ProjectSpecialCheckNum,
- ProjectMajorCheckNum = newtable.ProjectMajorCheckNum,
- NearMissNum = newtable.NearMissNum,
- RecordableEventNum = newtable.RecordableEventNum,
- GeneralAccidentNum = newtable.GeneralAccidentNum,
- MajorAccidentNum = newtable.MajorAccidentNum,
- SeriousAccidentNum = newtable.SeriousAccidentNum,
- SpecialSeriousAccidentNum = newtable.SpecialSeriousAccidentNum,
- CompanyComprehensivePlanNum = newtable.CompanyComprehensivePlanNum,
- CompanySpecialPlanNum = newtable.CompanySpecialPlanNum,
- CompanyOnSiteDisposalPlan = newtable.CompanyOnSiteDisposalPlan,
- CompanyDrillNum = newtable.CompanyDrillNum,
- ProjectComprehensivePlanNum = newtable.ProjectComprehensivePlanNum,
- ProjectSpecialPlanNum = newtable.ProjectSpecialPlanNum,
- ProjectOnSiteDisposalPlan = newtable.ProjectOnSiteDisposalPlan,
- ProjectDrillNum = newtable.ProjectDrillNum,
- CostExtract = newtable.CostExtract,
- CostUse = newtable.CostUse,
- UseEquipmentNum = newtable.UseEquipmentNum,
- SpecialEquipmentNum = newtable.SpecialEquipmentNum,
- LicensesNum = newtable.LicensesNum,
- LicensesCloseNum = newtable.LicensesCloseNum,
- GeneralClosedNum = newtable.GeneralClosedNum,
- GeneralNotClosedNum = newtable.GeneralNotClosedNum,
- MajorClosedNum = newtable.MajorClosedNum,
- MajorNotClosedNum = newtable.MajorNotClosedNum,
- GeneralRiskNum = newtable.GeneralRiskNum,
- LowRiskNum = newtable.LowRiskNum,
- MediumRiskNum = newtable.MediumRiskNum,
- HighRiskNum = newtable.HighRiskNum,
- CompletedNum = newtable.CompletedNum,
- TrainPersonNum = newtable.TrainPersonNum,
- ConstructionNum = newtable.ConstructionNum,
- FinishedNum = newtable.FinishedNum,
- SuperCompletedNum = newtable.SuperCompletedNum,
- SuperTrainPersonNum = newtable.SuperTrainPersonNum,
- SuperConstructionNum = newtable.SuperConstructionNum,
- SuperFinishedNum = newtable.SuperFinishedNum,
- };
- db.Project_HSSEData_HSSE.InsertOnSubmit(table);
- db.SubmitChanges();
- }
- ///
- /// 删除实体
- ///
- ///
- public static void DeleteProject_HSSEData_HSSEById(string Id)
- {
-
- Model.Project_HSSEData_HSSE table = db.Project_HSSEData_HSSE.FirstOrDefault(x => x.Id == Id);
- if (table != null)
- {
- db.Project_HSSEData_HSSE.DeleteOnSubmit(table);
- db.SubmitChanges();
- }
-
- }
- ///
- /// 根据id获取实体
- ///
- ///
- ///
- public static Model.Project_HSSEData_HSSE GetProject_HSSEData_HSSEById(string Id)
- {
- return db.Project_HSSEData_HSSE.FirstOrDefault(x => x.Id == Id);
- }
- public static List GetProject_HSSEData_HSSEByProjectid(string Projectid)
- {
- var q = (from x in db.Project_HSSEData_HSSE
- where x.ProjectId == Projectid
- select x).ToList();
- return q;
-
- }
- public static void UpdateProject_HSSEData_HSSE(Model.Project_HSSEData_HSSE newtable)
- {
-
- Model.Project_HSSEData_HSSE table = db.Project_HSSEData_HSSE.FirstOrDefault(x => x.Id == newtable.Id);
- if (table != null)
- {
- table.Id = newtable.Id;
- table.ProjectId = newtable.ProjectId;
- table.UnitId = newtable.UnitId;
- table.CollCropCode = newtable.CollCropCode;
- table.UnitName = newtable.UnitName;
- table.ReportDate = newtable.ReportDate;
- table.BeUnderConstructionNum = newtable.BeUnderConstructionNum;
- table.ShutdownNum = newtable.ShutdownNum;
- table.JoinConstructionPersonNum = newtable.JoinConstructionPersonNum;
- table.MajorProjectsUnderConstructionNum = newtable.MajorProjectsUnderConstructionNum;
- table.TotalWorkingHour = newtable.TotalWorkingHour;
- table.LostWorkingHour = newtable.LostWorkingHour;
- table.SafeWorkingHour = newtable.SafeWorkingHour;
- table.SafeTrainNum = newtable.SafeTrainNum;
- table.SpecialTrainNum = newtable.SpecialTrainNum;
- table.SpecialOperationTrainNum = newtable.SpecialOperationTrainNum;
- table.TotalEnergyConsumption = newtable.TotalEnergyConsumption;
- table.IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption;
- table.NewWaterConsumption = newtable.NewWaterConsumption;
- table.HeadOfficeInspectorGeneralNum = newtable.HeadOfficeInspectorGeneralNum;
- table.HeadOfficeFullTimeNum = newtable.HeadOfficeFullTimeNum;
- table.BranchInspectorGeneralNum = newtable.BranchInspectorGeneralNum;
- table.BranchFullTimeNum = newtable.BranchFullTimeNum;
- table.ProjectInspectorGeneralNum = newtable.ProjectInspectorGeneralNum;
- table.ProjectFullTimeNum = newtable.ProjectFullTimeNum;
- table.ProjectSafetyMonitorNum = newtable.ProjectSafetyMonitorNum;
- table.SafetyInjectionEngineer = newtable.SafetyInjectionEngineer;
- table.CertificateANum = newtable.CertificateANum;
- table.CertificateBNum = newtable.CertificateBNum;
- table.CertificateCNum = newtable.CertificateCNum;
- table.SafetyCommitteeMeetingNum = newtable.SafetyCommitteeMeetingNum;
- table.EnterpriseTopicsMeetingNum = newtable.EnterpriseTopicsMeetingNum;
- table.ProjectSafetyLeadingGroupMeetingNum = newtable.ProjectSafetyLeadingGroupMeetingNum;
- table.ProjectSafetyMeetingNum = newtable.ProjectSafetyMeetingNum;
- table.CompanyLeadShiftCheckNum = newtable.CompanyLeadShiftCheckNum;
- table.CompanyComprehensiveCheckNum = newtable.CompanyComprehensiveCheckNum;
- table.CompanySpecialCheckNum = newtable.CompanySpecialCheckNum;
- table.ProjectLeadShiftCheckNum = newtable.ProjectLeadShiftCheckNum;
- table.ProjectSpecialCheckNum = newtable.ProjectSpecialCheckNum;
- table.ProjectMajorCheckNum = newtable.ProjectMajorCheckNum;
- table.NearMissNum = newtable.NearMissNum;
- table.RecordableEventNum = newtable.RecordableEventNum;
- table.GeneralAccidentNum = newtable.GeneralAccidentNum;
- table.MajorAccidentNum = newtable.MajorAccidentNum;
- table.SeriousAccidentNum = newtable.SeriousAccidentNum;
- table.SpecialSeriousAccidentNum = newtable.SpecialSeriousAccidentNum;
- table.CompanyComprehensivePlanNum = newtable.CompanyComprehensivePlanNum;
- table.CompanySpecialPlanNum = newtable.CompanySpecialPlanNum;
- table.CompanyOnSiteDisposalPlan = newtable.CompanyOnSiteDisposalPlan;
- table.CompanyDrillNum = newtable.CompanyDrillNum;
- table.ProjectComprehensivePlanNum = newtable.ProjectComprehensivePlanNum;
- table.ProjectSpecialPlanNum = newtable.ProjectSpecialPlanNum;
- table.ProjectOnSiteDisposalPlan = newtable.ProjectOnSiteDisposalPlan;
- table.ProjectDrillNum = newtable.ProjectDrillNum;
- table.CostExtract = newtable.CostExtract;
- table.CostUse = newtable.CostUse;
- table.UseEquipmentNum = newtable.UseEquipmentNum;
- table.SpecialEquipmentNum = newtable.SpecialEquipmentNum;
- table.LicensesNum = newtable.LicensesNum;
- table.LicensesCloseNum = newtable.LicensesCloseNum;
- table.GeneralClosedNum = newtable.GeneralClosedNum;
- table.GeneralNotClosedNum = newtable.GeneralNotClosedNum;
- table.MajorClosedNum = newtable.MajorClosedNum;
- table.MajorNotClosedNum = newtable.MajorNotClosedNum;
- table.GeneralRiskNum = newtable.GeneralRiskNum;
- table.LowRiskNum = newtable.LowRiskNum;
- table.MediumRiskNum = newtable.MediumRiskNum;
- table.HighRiskNum = newtable.HighRiskNum;
- table.CompletedNum = newtable.CompletedNum;
- table.TrainPersonNum = newtable.TrainPersonNum;
- table.ConstructionNum = newtable.ConstructionNum;
- table.FinishedNum = newtable.FinishedNum;
- table.SuperCompletedNum = newtable.SuperCompletedNum;
- table.SuperTrainPersonNum = newtable.SuperTrainPersonNum;
- table.SuperConstructionNum = newtable.SuperConstructionNum;
- table.SuperFinishedNum = newtable.SuperFinishedNum;
- db.SubmitChanges();
- }
-
- }
- ///
- /// 判断该项目的该日期是否统计数据
- ///
- ///
- ///
- ///
- public static bool IsReportByDate(DateTime dateTime, string projectid)
- {
- var result = false;
- var q = (from x in Funs.DB.Project_HSSEData_HSSE
- where x.ReportDate >= dateTime.Date && x.ReportDate < (dateTime.Date.AddDays(1).Date) && x.ProjectId == projectid
- select x).ToList();
- if (q != null && q.Count > 0)
- {
- result = true;
- }
- return result;
- }
- ///
- /// 判断当天是否已上报
- ///
- ///
- public static bool IsReportByToday(string projectid)
- {
- var result = false;
- var q = (from x in Funs.DB.Project_HSSEData_HSSE
- where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date && x.ProjectId == projectid
- select x).ToList();
- if (q != null && q.Count > 0)
- {
- result = true;
- }
- return result;
- }
- ///
- /// 根据projectid,获取该项目当天的统计数据
- ///
- ///
- ///
- public static Model.Project_HSSEData_HSSE getProject_HSSEData_HSSEByDate(string projectid)
- {
- var q = (from x in Funs.DB.Project_HSSEData_HSSE
- where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date && x.ProjectId == projectid
- select x).FirstOrDefault();
- return q;
- }
-
- ///
- /// 统计所有在建项目数据
- ///
- public static void StatisticalAllProjectData()
- {
- var projectlist = ProjectService.GetProjectWorkList();
- foreach (var item in projectlist)
- {
- StatisticalData(item.ProjectId, HSSEDateType.All);
- }
- }
- ///
- /// 统计数据
- ///
- ///
- public static void StatisticalData(string projectid, HSSEDateType hSSEDateType)
- {
- string thisUnitId = BLL.Const.UnitId_SEDIN;
- var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
- Model.Project_HSSEData_HSSE table = new Model.Project_HSSEData_HSSE();
- if (IsReportByToday(projectid))
- {
- table = getProject_HSSEData_HSSEByDate(projectid);
- }
- else
- {
- table.Id = SQLHelper.GetNewID();
- }
- table.UnitId = thisUnitId;
- table.CollCropCode = base_Unit.CollCropCode;
- table.UnitName = base_Unit.UnitName;
- table.ProjectId = projectid;
- table.ReportDate = DateTime.Now.Date;
- if (hSSEDateType == HSSEDateType.ProjectInformation || hSSEDateType == HSSEDateType.All)
- {
- table.BeUnderConstructionNum = GetBeUnderConstructionNum(projectid);
- table.ShutdownNum = GetShutdownNum(projectid);
- table.JoinConstructionPersonNum = GetJoinConstructionPersonNum(projectid);
- table.MajorProjectsUnderConstructionNum = GetMajorProjectsUnderConstructionNum(projectid);
- }
- if (hSSEDateType == HSSEDateType.WorkingHours || hSSEDateType == HSSEDateType.All)
- {
- table.TotalWorkingHour = GetTotalWorkingHour(projectid);
- table.LostWorkingHour = GetLostWorkingHour(projectid);
- table.SafeWorkingHour = GetSafeWorkingHour(projectid);
- }
- if (hSSEDateType == HSSEDateType.EducationAndTraining || hSSEDateType == HSSEDateType.All)
- {
- table.SafeTrainNum = GetSafeTrainNum(projectid);
- table.SpecialTrainNum = GetSpecialTrainNum(projectid);
- table.SpecialOperationTrainNum = GetSpecialOperationTrainNum(projectid);
- }
- if (hSSEDateType == HSSEDateType.Environmental || hSSEDateType == HSSEDateType.All)
- {
- table.TotalEnergyConsumption = GetTotalEnergyConsumption(projectid);
- table.IncomeComprehensiveEnergyConsumption = GetIncomeComprehensiveEnergyConsumption(projectid);
- table.NewWaterConsumption = GetNewWaterConsumption(projectid);
-
- }
- if (hSSEDateType == HSSEDateType.OfSafetySupervisors || hSSEDateType == HSSEDateType.All)
- {
- table.HeadOfficeInspectorGeneralNum = GetHeadOfficeInspectorGeneralNum(projectid);
- table.HeadOfficeFullTimeNum = GetHeadOfficeFullTimeNum(projectid);
- table.BranchInspectorGeneralNum = GetBranchInspectorGeneralNum(projectid);
- table.BranchFullTimeNum = GetBranchFullTimeNum(projectid);
- table.ProjectInspectorGeneralNum = GetProjectInspectorGeneralNum(projectid);
- table.ProjectFullTimeNum = GetProjectFullTimeNum(projectid);
- table.ProjectSafetyMonitorNum = GetProjectSafetyMonitorNum(projectid);
- table.SafetyInjectionEngineer = GetSafetyInjectionEngineer(projectid);
- table.CertificateANum = GetCertificateANum(projectid);
- table.CertificateBNum = GetCertificateBNum(projectid);
- table.CertificateCNum = GetCertificateCNum(projectid);
- }
- if (hSSEDateType == HSSEDateType.SafetyMeeting || hSSEDateType == HSSEDateType.All)
- {
- table.SafetyCommitteeMeetingNum = GetSafetyCommitteeMeetingNum(projectid);
- table.EnterpriseTopicsMeetingNum = GetEnterpriseTopicsMeetingNum(projectid);
- table.ProjectSafetyLeadingGroupMeetingNum = GetProjectSafetyLeadingGroupMeetingNum(projectid);
- table.ProjectSafetyMeetingNum = GetProjectSafetyMeetingNum(projectid);
- }
- if (hSSEDateType == HSSEDateType.SupervisionAndInspection || hSSEDateType == HSSEDateType.All)
- {
- table.CompanyLeadShiftCheckNum = GetCompanyLeadShiftCheckNum(projectid);
- table.CompanyComprehensiveCheckNum = GetCompanyComprehensiveCheckNum(projectid);
- table.CompanySpecialCheckNum = GetCompanySpecialCheckNum(projectid);
- table.ProjectLeadShiftCheckNum = GetProjectLeadShiftCheckNum(projectid);
- table.ProjectSpecialCheckNum = GetProjectSpecialCheckNum(projectid);
- table.ProjectMajorCheckNum = GetProjectMajorCheckNum(projectid);
-
- }
- if (hSSEDateType == HSSEDateType.AccidentEvent || hSSEDateType == HSSEDateType.All)
- {
- table.NearMissNum = GetNearMissNum(projectid);
- table.RecordableEventNum = GetRecordableEventNum(projectid);
- table.GeneralAccidentNum = GetGeneralAccidentNum(projectid);
- table.MajorAccidentNum = GetMajorAccidentNum(projectid);
- table.SeriousAccidentNum = GetSeriousAccidentNum(projectid);
- table.SpecialSeriousAccidentNum = GetSpecialSeriousAccidentNum(projectid);
- }
- if (hSSEDateType == HSSEDateType.EmergencyManagement || hSSEDateType == HSSEDateType.All)
- {
- table.CompanyComprehensivePlanNum = GetCompanyComprehensivePlanNum(projectid);
- table.CompanySpecialPlanNum = GetCompanySpecialPlanNum(projectid);
- table.CompanyOnSiteDisposalPlan = GetCompanyOnSiteDisposalPlan(projectid);
- table.CompanyDrillNum = GetCompanyDrillNum(projectid);
- table.ProjectComprehensivePlanNum = GetProjectComprehensivePlanNum(projectid);
- table.ProjectSpecialPlanNum = GetProjectSpecialPlanNum(projectid);
- table.ProjectOnSiteDisposalPlan = GetProjectOnSiteDisposalPlan(projectid);
- table.ProjectDrillNum = GetProjectDrillNum(projectid);
- }
- if (hSSEDateType == HSSEDateType.SecurityCost || hSSEDateType == HSSEDateType.All)
- {
- table.CostExtract = GetCostExtract(projectid);
- table.CostUse = GetCostUse(projectid);
- }
- if (hSSEDateType == HSSEDateType.ConstructionEquipment || hSSEDateType == HSSEDateType.All)
- {
- table.UseEquipmentNum = GetUseEquipmentNum(projectid);
- table.SpecialEquipmentNum = GetSpecialEquipmentNum(projectid);
- }
- if (hSSEDateType == HSSEDateType.WorkPermit || hSSEDateType == HSSEDateType.All)
- {
- table.LicensesNum = GetLicensesNum(projectid);
- table.LicensesCloseNum = GetLicensesCloseNum(projectid);
- }
- if (hSSEDateType == HSSEDateType.HiddenDangerTroubleshooting || hSSEDateType == HSSEDateType.All)
- {
- table.GeneralClosedNum = GetGeneralClosedNum(projectid);
- table.GeneralNotClosedNum = GetGeneralNotClosedNum(projectid);
- table.MajorClosedNum = GetMajorClosedNum(projectid);
- table.MajorNotClosedNum = GetMajorNotClosedNum(projectid);
- }
- if (hSSEDateType == HSSEDateType.SecurityRisk || hSSEDateType == HSSEDateType.All)
- {
- table.GeneralRiskNum = GetGeneralRiskNum(projectid);
- table.LowRiskNum = GetLowRiskNum(projectid);
- table.MediumRiskNum = GetMediumRiskNum(projectid);
- table.HighRiskNum = GetHighRiskNum(projectid);
- }
- if (hSSEDateType == HSSEDateType.HiddenDangerCategory || hSSEDateType == HSSEDateType.All)
- {
- Project_HSSEData_HiddenDangerDetailService.StatisticalData(projectid);
- }
- if (hSSEDateType == HSSEDateType.DangerousProject || hSSEDateType == HSSEDateType.All)
- {
- table.CompletedNum = GetCompletedNum(projectid);
- table.TrainPersonNum = GetTrainPersonNum(projectid);
- table.ConstructionNum = GetConstructionNum(projectid);
- table.FinishedNum = GetFinishedNum(projectid);
- table.SuperCompletedNum = GetSuperCompletedNum(projectid);
- table.SuperTrainPersonNum = GetSuperTrainPersonNum(projectid);
- table.SuperConstructionNum = GetSuperConstructionNum(projectid);
- table.SuperFinishedNum = GetSuperFinishedNum(projectid);
- }
- if (IsReportByToday(projectid))
- {
- UpdateProject_HSSEData_HSSE(table);
- }
- else
- {
- AddProject_HSSEData_HSSE(table);
- }
- HSSEData_HSSEService.UpdateTodyData_State();
-
- }
- ///
- /// 获取在建项目数
- ///
- ///
- public static int GetBeUnderConstructionNum(string projectid)
- {
- int result = (from x in Funs.DB.Base_Project where x.ProjectState == "1" && x.ProjectId == projectid select x).Count();
- return result;
- }
- ///
- /// 获取停工项目数
- ///
- ///
- public static int GetShutdownNum(string projectid)
- {
- int result = (from x in Funs.DB.Base_Project where x.ProjectState == "2" && x.ProjectId == projectid select x).Count();
- return result;
- }
- ///
- /// 获取参建人数
- ///
- ///
- public static int GetJoinConstructionPersonNum(string projectid)
- {
- int result = (from x in Funs.DB.SitePerson_Person where x.ProjectId == projectid && x.States == "1" select x).Count();
- return result;
- }
- ///
- /// 获取在施危大工程数
- ///
- ///
- public static int GetMajorProjectsUnderConstructionNum(string projectid)
- {
- int result = (from x in Funs.DB.Solution_LargerHazard where x.ProjectId == projectid && x.States == "2" select x).Count();
- return result;
- }
- ///
- /// 获取总工时数
- ///
- ///
- public static int GetTotalWorkingHour(string projectid)
- {
- DateTime date = DateTime.Now;
- var result = (from x in Funs.DB.SitePerson_DayReportDetail
- join y in Funs.DB.SitePerson_DayReport on x.DayReportId equals y.DayReportId
- where y.ProjectId == projectid && y.CompileDate.Value.Year == date.Year && y.CompileDate.Value.Month == date.Month && y.CompileDate.Value.Day == date.Day
- select x.PersonWorkTime).ToList().Sum(x => x.Value);
- var q = Funs.GetNewIntOrZero(result.ToString());
- return q;
- }
- ///
- /// 获取损失工时数
- ///
- ///
- public static int GetLostWorkingHour(string projectid)
- {
- DateTime date = DateTime.Now;
- var result = (from x in Funs.DB.Accident_AccidentHandle where x.ProjectId == projectid && x.AccidentDate.Year == date.Year && x.AccidentDate.Month == date.Month && x.AccidentDate.Day == date.Day select x.WorkHoursLoss).ToList().Sum(x => x.Value)
- + (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day select x.WorkingHoursLoss).ToList().Sum(x => x.Value);
- var q = Funs.GetNewIntOrZero(result.ToString());
-
- return q;
- }
- ///
- /// 获取安全工时数
- ///
- ///
- public static int GetSafeWorkingHour(string projectid)
- {
- DateTime date = DateTime.Now;
- var result1 = (from x in Funs.DB.SitePerson_DayReportDetail
- join y in Funs.DB.SitePerson_DayReport on x.DayReportId equals y.DayReportId
- where y.ProjectId == projectid && y.CompileDate.Value.Year == date.Year && y.CompileDate.Value.Month == date.Month && y.CompileDate.Value.Day == date.Day
- select x.PersonWorkTime).ToList().Sum(x => x.Value);
- var result2 = (from x in Funs.DB.Accident_AccidentHandle where x.ProjectId == projectid && x.AccidentDate.Year == date.Year && x.AccidentDate.Month == date.Month && x.AccidentDate.Day == date.Day select x.WorkHoursLoss).ToList().Sum(x => x.Value)
- + (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day select x.WorkingHoursLoss).ToList().Sum(x => x.Value);
- var result = result1 - result2;
- var q = Funs.GetNewIntOrZero(result.ToString());
-
- return q;
- }
- ///
- /// 获取三级安全教育培训数
- ///
- ///
- public static int GetSafeTrainNum(string projectid)
- {
- //DateTime date = DateTime.Now;
- //int result = (from x in Funs.DB.EduTrain_TrainRecord
- // join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
- // where x.ProjectId == projectid && x.TrainStartDate.Value.Year == date.Year && x.TrainStartDate.Value.Month == date.Month && x.TrainStartDate.Value.Day == date.Day && y.TrainType == "1"
- // select x).Count();
- return 0;
- }
- ///
- /// 获取专项培训数
- ///
- ///
- public static int GetSpecialTrainNum(string projectid)
- {
- //DateTime date = DateTime.Now;
- //int result = (from x in Funs.DB.EduTrain_TrainRecord
- // join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
- // where x.ProjectId == projectid && x.TrainStartDate.Value.Year == date.Year && x.TrainStartDate.Value.Month == date.Month && x.TrainStartDate.Value.Day == date.Day && y.TrainType == "2"
- // select x).Count();
- return 0;
- }
- ///
- /// 获取特种作业培训数
- ///
- ///
- public static int GetSpecialOperationTrainNum(string projectid)
- {
- //DateTime date = DateTime.Now;
- //int result = (from x in Funs.DB.EduTrain_TrainRecord
- // join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
- // where x.ProjectId == projectid && x.TrainStartDate.Value.Year == date.Year && x.TrainStartDate.Value.Month == date.Month && x.TrainStartDate.Value.Day == date.Day && y.TrainType == "3"
- // select x).Count();
- return 0;
- }
- ///
- /// 获取能耗总量
- ///
- ///
- public static int GetTotalEnergyConsumption(string projectid)
- {
- int result = 0;
- return result;
- }
- ///
- /// 获取万元营业收入综合能耗
- ///
- ///
- public static int GetIncomeComprehensiveEnergyConsumption(string projectid)
- {
- int result = 0;
- return result;
- }
- ///
- /// 获取用新水量
- ///
- ///
- public static int GetNewWaterConsumption(string projectid)
- {
- int result = 0;
- return result;
- }
- ///
- /// 获取企业总部总监人数
- ///
- ///
- public static int GetHeadOfficeInspectorGeneralNum(string projectid)
- {
- int result = 0;
- return result;
- }
- ///
- /// 获取企业总部专职人数
- ///
- ///
- public static int GetHeadOfficeFullTimeNum(string projectid)
- {
- int result = 0;
- return result;
- }
- ///
- /// 获取分支机构总监人数
- ///
- ///
- public static int GetBranchInspectorGeneralNum(string projectid)
- {
- int result = 0;
- return result;
- }
- ///
- /// 获取分支机构专职人数
- ///
- ///
- public static int GetBranchFullTimeNum(string projectid)
- {
- int result = 0;
- return result;
- }
- ///
- /// 获取项目总监人数
- ///
- ///
- public static int GetProjectInspectorGeneralNum(string projectid)
- {
- //int result = (from x in Funs.DB.SitePerson_Person
- // where x.ProjectId == projectid && x.WorkPostId == BLL.Const.WorkPost_ProjectHSSEDirector && x.IsUsed == true
- // select x).Count();
- return 0;
- }
- ///
- /// 获取项目专职人数
- ///
- ///
- public static int GetProjectFullTimeNum(string projectid)
- {
- int result = (from x in Funs.DB.SitePerson_Person
- join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
- where x.ProjectId == projectid && y.IsHsse == true && x.States == "1"
- select x).Count();
- return result;
- }
- ///
- /// 获取项目安全监护人数
- ///
- ///
- public static int GetProjectSafetyMonitorNum(string projectid)
- {
- //int result = (from x in Funs.DB.SitePerson_Person
- // where x.ProjectId == projectid && x.IsSafetyMonitoring == true && x.IsUsed == true
- // select x).Count();
- return 0;
- }
- ///
- /// 获取在岗执业注安师
- ///
- ///
- public static int GetSafetyInjectionEngineer(string projectid)
- {
- //int result = (from x in Funs.DB.SitePerson_Person
- // join y in Funs.DB.Base_Certificate on x.CertificateId equals y.CertificateId
- // where x.ProjectId == projectid && y.IsRegisterHSSE == true && x.IsUsed == true
- // select x).Count();
- return 0;
- }
- ///
- /// 获取A证人员
- ///
- ///
- public static int GetCertificateANum(string projectid)
- {
- //int result = (from x in Funs.DB.SitePerson_Person
- // join y in Funs.DB.Base_Certificate on x.CertificateId equals y.CertificateId
- // where x.ProjectId == projectid && y.CertificateType == "A" && x.IsUsed == true
- // select x).Count();
- return 0;
- }
- ///
- /// 获取B证人员
- ///
- ///
- public static int GetCertificateBNum(string projectid)
- {
- //int result = (from x in Funs.DB.SitePerson_Person
- // join y in Funs.DB.Base_Certificate on x.CertificateId equals y.CertificateId
- // where x.ProjectId == projectid && y.CertificateType == "B" && x.IsUsed == true
- // select x).Count();
- return 0;
- }
- ///
- /// 获取C证人员
- ///
- ///
- public static int GetCertificateCNum(string projectid)
- {
- //int result = (from x in Funs.DB.SitePerson_Person
- // join y in Funs.DB.Base_Certificate on x.CertificateId equals y.CertificateId
- // where x.ProjectId == projectid && y.CertificateType == "C" && x.IsUsed == true
- // select x).Count();
- return 0;
- }
- ///
- /// 获取企业安委会会议数
- ///
- ///
- public static int GetSafetyCommitteeMeetingNum(string projectid)
- {
- int result = 0;
- return result;
- }
- ///
- /// 获取企业专题会议数
- ///
- ///
- public static int GetEnterpriseTopicsMeetingNum(string projectid)
- {
- int result = 0;
- return result;
- }
- ///
- /// 获取项目安全领导小组会议数
- ///
- ///
- public static int GetProjectSafetyLeadingGroupMeetingNum(string projectid)
- {
- //DateTime date = DateTime.Now;
- //int result = (from x in Funs.DB.Meeting_SafetyLeaderGroupMeeting where x.ProjectId == projectid && x.SafetyLeaderGroupMeetingDate.Value.Year == date.Year && x.SafetyLeaderGroupMeetingDate.Value.Month == date.Month && x.SafetyLeaderGroupMeetingDate.Value.Day == date.Day select x).Count();
- return 0;
- }
- ///
- /// 获取项目安全例会数
- ///
- ///
- public static int GetProjectSafetyMeetingNum(string projectid)
- {
- DateTime date = DateTime.Now;
- int result = (from x in Funs.DB.Meeting_WeekMeeting where x.ProjectId == projectid && x.WeekMeetingDate.Value.Year == date.Year && x.WeekMeetingDate.Value.Month == date.Month && x.WeekMeetingDate.Value.Day == date.Day select x).Count()
- + (from x in Funs.DB.Meeting_MonthMeeting where x.ProjectId == projectid && x.MonthMeetingDate.Value.Year == date.Year && x.MonthMeetingDate.Value.Month == date.Month && x.MonthMeetingDate.Value.Day == date.Day select x).Count();
- return result;
- }
- ///
- /// 获取企业负责人带班检查次数
- ///
- ///
- public static int GetCompanyLeadShiftCheckNum(string projectid)
- {
- int result = 0;
- return result;
- }
- ///
- /// 获取企业综合检查次数
- ///
- ///
- public static int GetCompanyComprehensiveCheckNum(string projectid)
- {
- int result = 0;
- return result;
- }
- ///
- /// 获取企业专项检查次数
- ///
- ///
- public static int GetCompanySpecialCheckNum(string projectid)
- {
- int result = 0;
- return result;
- }
- ///
- /// 获取项目负责人带班检查次数
- ///
- ///
- public static int GetProjectLeadShiftCheckNum(string projectid)
- {
- //DateTime date = DateTime.Now;
- //int result = (from x in Funs.DB.Check_ProjectLeaderCheck where x.ProjectId == projectid && x.CheckDate.Value.Year == date.Year && x.CheckDate.Value.Month == date.Month && x.CheckDate.Value.Day == date.Day select x).Count();
- return 0;
- }
- ///
- /// 获取项目专项检查次数
- ///
- ///
- public static int GetProjectSpecialCheckNum(string projectid)
- {
- DateTime date = DateTime.Now;
- int result = (from x in Funs.DB.Check_CheckSpecial where x.ProjectId == projectid && x.CheckTime.Value.Year == date.Year && x.CheckTime.Value.Month == date.Month && x.CheckTime.Value.Day == date.Day select x).Count();
- return result;
- }
- ///
- /// 获取项目专业检查次数
- ///
- ///
- public static int GetProjectMajorCheckNum(string projectid)
- {
- DateTime date = DateTime.Now;
- int result = (from x in Funs.DB.HSSE_Hazard_HazardRegister where x.ProjectId == projectid && x.CheckTime.Value.Year == date.Year && x.CheckTime.Value.Month == date.Month && x.CheckTime.Value.Day == date.Day select x).Count();
- return result;
- }
- ///
- /// 获取未遂事件数
- ///
- ///
- public static int GetNearMissNum(string projectid)
- {
- DateTime date = DateTime.Now;
- int result = (from x in Funs.DB.Accident_AccidentPersonRecord
- join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
- where x.ProjectId == projectid && x.AccidentDate.Year == date.Year && x.AccidentDate.Month == date.Month && x.AccidentDate.Day == date.Day && y.AccidentTypeName.Contains("未遂")
- select x).Count();
- return result;
- }
- ///
- /// 获取可记录事件数
- ///
- ///
- public static int GetRecordableEventNum(string projectid)
- {
- DateTime date = DateTime.Now;
- int result = (from x in Funs.DB.Accident_AccidentPersonRecord
- join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
- where x.ProjectId == projectid && x.AccidentDate.Year == date.Year && x.AccidentDate.Month == date.Month && x.AccidentDate.Day == date.Day && !y.AccidentTypeName.Contains("未遂")
- select x).Count();
- return result;
- }
- ///
- /// 获取一般事故数
- ///
- ///
- public static int GetGeneralAccidentNum(string projectid)
- {
- //DateTime date = DateTime.Now;
- //int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day && x.AccidentDegree == "1" select x).Count();
- return 0;
- }
- ///
- /// 获取较大事故数
- ///
- ///
- public static int GetMajorAccidentNum(string projectid)
- {
- //DateTime date = DateTime.Now;
- //int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day && x.AccidentDegree == "2" select x).Count();
- return 0;
- }
- ///
- /// 获取重大事故数
- ///
- ///
- public static int GetSeriousAccidentNum(string projectid)
- {
- //DateTime date = DateTime.Now;
- //int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day && x.AccidentDegree == "3" select x).Count();
- return 0;
- }
- ///
- /// 获取特别重大事故数
- ///
- ///
- public static int GetSpecialSeriousAccidentNum(string projectid)
- {
- //DateTime date = DateTime.Now;
- //int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day && x.AccidentDegree == "4" select x).Count();
- return 0;
- }
- ///
- /// 获取企业级综合预案数
- ///
- ///
- public static int GetCompanyComprehensivePlanNum(string projectid)
- {
- int result = 0;
- return result;
- }
- ///
- /// 获取企业级专项预案数
- ///
- ///
- public static int GetCompanySpecialPlanNum(string projectid)
- {
- int result = 0;
- return result;
- }
- ///
- /// 获取企业级现场处置预案
- ///
- ///
- public static int GetCompanyOnSiteDisposalPlan(string projectid)
- {
- int result = 0;
- return result;
- }
- ///
- /// 获取企业级演练次数
- ///
- ///
- public static int GetCompanyDrillNum(string projectid)
- {
- int result = 0;
- return result;
- }
- ///
- /// 获取项目级综合预案
- ///
- ///
- public static int GetProjectComprehensivePlanNum(string projectid)
- {
- DateTime date = DateTime.Now;
- int result = (from x in Funs.DB.Emergency_EmergencyList
- join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
- where x.ProjectId == projectid && x.CompileDate.Value.Year == date.Year && x.CompileDate.Value.Month == date.Month
- && x.CompileDate.Value.Day == date.Day && y.EmergencyTypeName.Contains("综合")
- select x).Count();
- return result;
- }
- ///
- /// 获取项目级专项预案数
- ///
- ///
- public static int GetProjectSpecialPlanNum(string projectid)
- {
- DateTime date = DateTime.Now;
- int result = (from x in Funs.DB.Emergency_EmergencyList
- join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
- where x.ProjectId == projectid && x.CompileDate.Value.Year == date.Year && x.CompileDate.Value.Month == date.Month
- && x.CompileDate.Value.Day == date.Day && y.EmergencyTypeName.Contains("专项")
- select x).Count();
- return result;
- }
- ///
- /// 获取项目级现场处置预案
- ///
- ///
- public static int GetProjectOnSiteDisposalPlan(string projectid)
- {
- DateTime date = DateTime.Now;
- int result = (from x in Funs.DB.Emergency_EmergencyList
- join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
- where x.ProjectId == projectid && x.CompileDate.Value.Year == date.Year && x.CompileDate.Value.Month == date.Month
- && x.CompileDate.Value.Day == date.Day && y.EmergencyTypeName.Contains("现场处置")
- select x).Count();
- return result;
- }
- ///
- /// 获取项目级演练次数
- ///
- ///
- public static int GetProjectDrillNum(string projectid)
- {
- DateTime date = DateTime.Now;
- int result = (from x in Funs.DB.Emergency_DrillRecordList
- where x.ProjectId == projectid && x.DrillRecordDate.Value.Year == date.Year && x.DrillRecordDate.Value.Month == date.Month
- && x.DrillRecordDate.Value.Day == date.Day
- select x).Count();
- return result;
- }
- ///
- /// 获取费用提取(万元)
- ///
- ///
- public static int GetCostExtract(string projectid)
- {
- int result = 0;
- return result;
- }
- ///
- /// 获取费用使用(万元)
- ///
- ///
- public static int GetCostUse(string projectid)
- {
- int result = 0;
- return result;
- }
- ///
- /// 获取施工机具在用数
- ///
- ///
- public static int GetUseEquipmentNum(string projectid)
- {
- //int result = (from x in Funs.DB.InApproveManager_EquipmentInItem
- // join y in Funs.DB.InApproveManager_EquipmentIn on x.EquipmentInId equals y.EquipmentInId
- // where y.ProjectId == projectid && x.IsUsed == true
- // select x).Count() +
- // (from x in Funs.DB.InApproveManager_GeneralEquipmentInItem
- // join y in Funs.DB.InApproveManager_GeneralEquipmentIn on x.GeneralEquipmentInId equals y.GeneralEquipmentInId
- // where y.ProjectId == projectid && x.IsUsed == true
- // select x).Count();
- return 0;
- }
- ///
- /// 获取施工机具特种设备数
- ///
- ///
- public static int GetSpecialEquipmentNum(string projectid)
- {
- //int result = (from x in Funs.DB.InApproveManager_EquipmentInItem
- // join y in Funs.DB.InApproveManager_EquipmentIn on x.EquipmentInId equals y.EquipmentInId
- // where y.ProjectId == projectid && x.IsUsed == true
- // select x).Count();
- return 0;
- }
- ///
- /// 获取作业许可项数
- ///
- ///
- public static int GetLicensesNum(string projectid)
- {
- //int result = (from x in Funs.DB.License_LicenseManager
- // where x.ProjectId == projectid && x.IsHighRisk == true
- // select x).Count();
- return 0;
- }
- ///
- /// 获取作业许可关闭项数
- ///
- ///
- public static int GetLicensesCloseNum(string projectid)
- {
- //int result = (from x in Funs.DB.License_LicenseManager
- // where x.ProjectId == projectid && x.IsHighRisk == true && x.WorkStates == "3"
- // select x).Count();
- return 0;
- }
- ///
- /// 获取一般隐患整改闭环项
- ///
- ///
- public static int GetGeneralClosedNum(string projectid)
- {
- int result = (from x in Funs.DB.Check_RectifyNoticesItem
- join y in Funs.DB.Check_RectifyNotices on x.RectifyNoticesId equals y.RectifyNoticesId
- where y.ProjectId == projectid && y.HiddenHazardType == "1" && x.IsRectify == true
- select x).Count();
- return result;
- }
- ///
- /// 获取一般隐患未整改完成项
- ///
- ///
- public static int GetGeneralNotClosedNum(string projectid)
- {
- int result = (from x in Funs.DB.Check_RectifyNoticesItem
- join y in Funs.DB.Check_RectifyNotices on x.RectifyNoticesId equals y.RectifyNoticesId
- where y.ProjectId == projectid && y.HiddenHazardType == "1" && (x.IsRectify == false || x.IsRectify == null)
- select x).Count();
- return result;
- }
- ///
- /// 获取重大隐患整改闭环项
- ///
- ///
- public static int GetMajorClosedNum(string projectid)
- {
- int result = (from x in Funs.DB.Check_RectifyNoticesItem
- join y in Funs.DB.Check_RectifyNotices on x.RectifyNoticesId equals y.RectifyNoticesId
- where y.ProjectId == projectid && y.HiddenHazardType == "3" && x.IsRectify == true
- select x).Count();
- return result;
- }
- ///
- /// 获取重大隐患未整改完成项
- ///
- ///
- public static int GetMajorNotClosedNum(string projectid)
- {
- int result = (from x in Funs.DB.Check_RectifyNoticesItem
- join y in Funs.DB.Check_RectifyNotices on x.RectifyNoticesId equals y.RectifyNoticesId
- where y.ProjectId == projectid && y.HiddenHazardType == "3" && (x.IsRectify == false || x.IsRectify == null)
- select x).Count();
- return result;
- }
- ///
- /// 获取一般风险数
- ///
- ///
- public static int GetGeneralRiskNum(string projectid)
- {
- //int result = (from x in Funs.DB.Hazard_HazardSelectedItem
- // join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
- // where x.ProjectId == projectid && y.RiskLevel == 2 && x.IsStart == true
- // select x).Count();
- return 0;
- }
- ///
- /// 获取低风险数
- ///
- ///
- public static int GetLowRiskNum(string projectid)
- {
- //int result = (from x in Funs.DB.Hazard_HazardSelectedItem
- // join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
- // where x.ProjectId == projectid && y.RiskLevel == 1 && x.IsStart == true
- // select x).Count();
- return 0;
- }
- ///
- /// 获取中风险数
- ///
- ///
- public static int GetMediumRiskNum(string projectid)
- {
- //int result = (from x in Funs.DB.Hazard_HazardSelectedItem
- // join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
- // where x.ProjectId == projectid && y.RiskLevel == 3 && x.IsStart == true
- // select x).Count();
- return 0;
- }
- ///
- /// 获取高风险数
- ///
- ///
- public static int GetHighRiskNum(string projectid)
- {
- //int result = (from x in Funs.DB.Hazard_HazardSelectedItem
- // join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
- // where x.ProjectId == projectid && y.RiskLevel == 4 && x.IsStart == true
- // select x).Count();
- return 0;
- }
- ///
- /// 获取危大工程审批完成数
- ///
- ///
- public static int GetCompletedNum(string projectid)
- {
- //int result = (from x in Funs.DB.Solution_LargerHazard
- // where x.ProjectId == projectid && x.States == "1" && x.IsSuperLargerHazard == false
- // select x).Count();
- return 0;
- }
- ///
- /// 获取危大工程培训人次数
- ///
- ///
- public static int GetTrainPersonNum(string projectid)
- {
- //int result = (from x in Funs.DB.Solution_LargerHazard
- // where x.ProjectId == projectid && x.IsSuperLargerHazard == false
- // select x.TrainPersonNum ).ToList().Sum(x=>x.Value);
- return 0;
- }
- ///
- /// 获取危大工程施工个数
- ///
- ///
- public static int GetConstructionNum(string projectid)
- {
- //int result = (from x in Funs.DB.Solution_LargerHazard
- // where x.ProjectId == projectid && x.States == "2" && x.IsSuperLargerHazard == false
- // select x).Count();
- return 0;
- }
- ///
- /// 获取危大工程完工个数
- ///
- ///
- public static int GetFinishedNum(string projectid)
- {
- //int result = (from x in Funs.DB.Solution_LargerHazard
- // where x.ProjectId == projectid && x.States == "3" && x.IsSuperLargerHazard == false
- // select x).Count();
- return 0;
- }
- ///
- /// 获取超危大工程审批完成数
- ///
- ///
- public static int GetSuperCompletedNum(string projectid)
- {
- //int result = (from x in Funs.DB.Solution_LargerHazard
- // where x.ProjectId == projectid && x.States == "1" && x.IsSuperLargerHazard == true
- // select x).Count();
- return 0;
- }
- ///
- /// 获取超危大工程培训人次数
- ///
- ///
- public static int GetSuperTrainPersonNum(string projectid)
- {
- //int result = (from x in Funs.DB.Solution_LargerHazard where x.ProjectId == projectid && x.IsSuperLargerHazard == true select x.TrainPersonNum).ToList().Sum(x => x.Value);
- return 0;
- }
- ///
- /// 获取超危大工程施工个数
- ///
- ///
- public static int GetSuperConstructionNum(string projectid)
- {
- //int result = (from x in Funs.DB.Solution_LargerHazard
- // where x.ProjectId == projectid && x.States == "2" && x.IsSuperLargerHazard == true
- // select x).Count();
- return 0;
- }
- ///
- /// 获取超危大工程完工个数
- ///
- ///
- public static int GetSuperFinishedNum(string projectid)
- {
- //int result = (from x in Funs.DB.Solution_LargerHazard
- // where x.ProjectId == projectid && x.States == "3" && x.IsSuperLargerHazard == true
- // select x).Count();
- return 0;
- }
-
}
}
\ No newline at end of file
diff --git a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HiddenDangerDetailService.cs b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HiddenDangerDetailService.cs
index 7858c2ab..701239c3 100644
--- a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HiddenDangerDetailService.cs
+++ b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HiddenDangerDetailService.cs
@@ -1,5 +1,6 @@
using FineUIPro;
using Microsoft.SqlServer.Dts.Runtime;
+using Model;
using System;
using System.Collections;
using System.Collections.Generic;
@@ -83,59 +84,73 @@ namespace BLL
///
public static List GetProject_HSSEData_HiddenDangerDetailByDate(DateTime? reportDate, string projectid)
{
- var q = from x in db.Project_HSSEData_HiddenDangerDetail
- where x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0 && x.ProjectId == projectid
- select x;
- return q.ToList();
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ var q = from x in db.Project_HSSEData_HiddenDangerDetail
+ where x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0 && x.ProjectId == projectid
+ select x;
+ return q.ToList();
+ }
}
public static void AddProject_HSSEData_HiddenDangerDetail(Model.Project_HSSEData_HiddenDangerDetail newtable)
{
-
- Model.Project_HSSEData_HiddenDangerDetail table = new Model.Project_HSSEData_HiddenDangerDetail
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
- Id = newtable.Id,
- ProjectId = newtable.ProjectId,
- UnitId = newtable.UnitId,
- CollCropCode = newtable.CollCropCode,
- UnitName = newtable.UnitName,
- ReportDate = newtable.ReportDate,
- TypeName = newtable.TypeName,
- TotalNum = newtable.TotalNum,
- NeedRectifyNum = newtable.NeedRectifyNum,
- };
- db.Project_HSSEData_HiddenDangerDetail.InsertOnSubmit(table);
- db.SubmitChanges();
+ Model.Project_HSSEData_HiddenDangerDetail table = new Model.Project_HSSEData_HiddenDangerDetail
+ {
+ Id = newtable.Id,
+ ProjectId = newtable.ProjectId,
+ UnitId = newtable.UnitId,
+ CollCropCode = newtable.CollCropCode,
+ UnitName = newtable.UnitName,
+ ReportDate = newtable.ReportDate,
+ TypeName = newtable.TypeName,
+ TotalNum = newtable.TotalNum,
+ NeedRectifyNum = newtable.NeedRectifyNum,
+ };
+ db.Project_HSSEData_HiddenDangerDetail.InsertOnSubmit(table);
+ db.SubmitChanges();
+ }
}
-
- public static void UpdateProject_HSSEData_HiddenDangerDetail(Model.Project_HSSEData_HiddenDangerDetail newtable)
+ public static void AddBulkProject_HSSEData_HiddenDangerDetails(List newtables)
{
- Model.Project_HSSEData_HiddenDangerDetail table = db.Project_HSSEData_HiddenDangerDetail.FirstOrDefault(x => x.Id == newtable.Id);
- if (table != null)
+ db.Project_HSSEData_HiddenDangerDetail.InsertAllOnSubmit(newtables);
+ db.SubmitChanges();
+ }
+ public static void UpdateProject_HSSEData_HiddenDangerDetail(Model.Project_HSSEData_HiddenDangerDetail newtable)
+ {
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
- table.Id = newtable.Id;
- table.ProjectId = table.ProjectId;
- table.UnitId = newtable.UnitId;
- table.CollCropCode = newtable.CollCropCode;
- table.UnitName = newtable.UnitName;
- table.ReportDate = newtable.ReportDate;
- table.TypeName = newtable.TypeName;
- table.TotalNum = newtable.TotalNum;
- table.NeedRectifyNum = newtable.NeedRectifyNum;
- db.SubmitChanges();
+
+ Model.Project_HSSEData_HiddenDangerDetail table = db.Project_HSSEData_HiddenDangerDetail.FirstOrDefault(x => x.Id == newtable.Id);
+ if (table != null)
+ {
+ table.Id = newtable.Id;
+ table.ProjectId = table.ProjectId;
+ table.UnitId = newtable.UnitId;
+ table.CollCropCode = newtable.CollCropCode;
+ table.UnitName = newtable.UnitName;
+ table.ReportDate = newtable.ReportDate;
+ table.TypeName = newtable.TypeName;
+ table.TotalNum = newtable.TotalNum;
+ table.NeedRectifyNum = newtable.NeedRectifyNum;
+ db.SubmitChanges();
+ }
}
}
public static void DeleteProject_HSSEData_HiddenDangerDetailById(string Id)
{
-
- Model.Project_HSSEData_HiddenDangerDetail table = db.Project_HSSEData_HiddenDangerDetail.FirstOrDefault(x => x.Id == Id);
- if (table != null)
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
- db.Project_HSSEData_HiddenDangerDetail.DeleteOnSubmit(table);
- db.SubmitChanges();
+ Model.Project_HSSEData_HiddenDangerDetail table = db.Project_HSSEData_HiddenDangerDetail.FirstOrDefault(x => x.Id == Id);
+ if (table != null)
+ {
+ db.Project_HSSEData_HiddenDangerDetail.DeleteOnSubmit(table);
+ db.SubmitChanges();
+ }
}
-
}
///
/// 根据项目id和日期删除隐患类别数据
@@ -144,14 +159,24 @@ namespace BLL
///
public static void DeleteProject_HSSEData_HiddenDangerDetailByDate(DateTime? reportDate, string projectid)
{
-
- var table = db.Project_HSSEData_HiddenDangerDetail.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0 && x.ProjectId == projectid);
- if (table != null)
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
+
+ var table = db.Project_HSSEData_HiddenDangerDetail.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0 && x.ProjectId == projectid);
db.Project_HSSEData_HiddenDangerDetail.DeleteAllOnSubmit(table);
db.SubmitChanges();
}
+ }
+ public static void DeleteProject_HSSEData_HiddenDangerDetailByDate(DateTime? reportDate)
+ {
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+
+ var table = db.Project_HSSEData_HiddenDangerDetail.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0);
+ db.Project_HSSEData_HiddenDangerDetail.DeleteAllOnSubmit(table);
+ db.SubmitChanges();
+ }
}
///
/// 根据projectid判断当天项目是否已统计数据
@@ -185,66 +210,71 @@ namespace BLL
public static List GetTodayModel()
{
var q = (from x in Funs.DB.Project_HSSEData_HiddenDangerDetail
- where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
+ where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
group x by x.TypeName into g
select new Model.HSSEDataHiddenDangerDetailItem
{
Id = SQLHelper.GetNewID(),
- TypeName= g.Key,
- NeedRectifyNum= g.Sum(p => p.NeedRectifyNum),
- TotalNum= g.Sum(p => p.TotalNum)
+ TypeName = g.Key,
+ NeedRectifyNum = g.Sum(p => p.NeedRectifyNum),
+ TotalNum = g.Sum(p => p.TotalNum)
}).ToList();
return q;
}
public static void StatisticalAllProjectData()
{
- var projectlist = ProjectService.GetProjectWorkList();
- foreach (var item in projectlist)
+ var db = Funs.DB;
+
+ var projectids = ProjectService.GetProjectWorkList().Select(x => x.ProjectId).ToList();
+ var thisUnitId = string.Empty;
+ var thisUnit = CommonService.GetIsThisUnit();
+ if (thisUnit != null)
{
- StatisticalData(item.ProjectId);
+ thisUnitId = thisUnit.UnitId;
}
+ var baseUnit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
+ var list = from x in db.HSSE_Hazard_HazardRegister
+ where projectids.Contains(x.ProjectId)
+ select x;
+ var data = (from x in list
+ join y in db.HSSE_Hazard_HazardRegisterTypes on x.RegisterTypesId equals y.RegisterTypesId
+ group x by new
+ { x.ProjectId, x.RegisterTypesId, y.RegisterTypesName }
+ into g
+ select new
+ {
+ UnitId = thisUnitId,
+ CollCropCode = baseUnit.CollCropCode,
+ UnitName = baseUnit.UnitName,
+ ProjectId = g.Key.ProjectId,
+ ReportDate = DateTime.Now.Date,
+ TypeName = g.Key.RegisterTypesName,
+ TotalNum = g.Count(),
+ NeedRectifyNum = g.Count(x => x.States == "1"),
+ }).ToList();
+ DeleteProject_HSSEData_HiddenDangerDetailByDate(DateTime.Now.Date);
+ var projectHsseDataHiddenDangerDetails = new List();
+ foreach (var item in data)
+ {
+ Project_HSSEData_HiddenDangerDetail table = new Project_HSSEData_HiddenDangerDetail
+ {
+ Id = SQLHelper.GetNewID(),
+ UnitId = item.UnitId,
+ CollCropCode = item.CollCropCode,
+ UnitName = item.UnitName,
+ ProjectId = item.ProjectId,
+ ReportDate = item.ReportDate,
+ TypeName = item.TypeName,
+ TotalNum = item.TotalNum,
+ NeedRectifyNum = item.NeedRectifyNum,
+
+ };
+ projectHsseDataHiddenDangerDetails.Add(table);
+ }
+ AddBulkProject_HSSEData_HiddenDangerDetails(projectHsseDataHiddenDangerDetails);
+
}
- ///
- /// 统计数据
- ///
- ///
- public static void StatisticalData(string projectid)
- {
- //var base_Unit = BLL.UnitService.GetUnitByUnitId(BLL.Const.UnitId_SEDIN);
- //DateTime date = DateTime.Now;
- //Model.SGGLDB db = Funs.DB;
- //var list = from x in db.Check_RectifyNoticesItem
- // join y in db.Check_RectifyNotices on x.RectifyNoticesId equals y.RectifyNoticesId
- // where y.ProjectId == projectid && y.CheckedDate.Value.Year == date.Year && y.CheckedDate.Value.Month == date.Month && y.CheckedDate.Value.Day == date.Day
- // select x;
- //var types = (from x in db.Technique_Rectify
- // join y in list on x.RectifyId equals y.RectifyId
- // select new { x.RectifyId, x.RectifyName }).Distinct().ToList();
- //foreach (var type in types)
- //{
- // Model.Project_HSSEData_HiddenDangerDetail table = new Model.Project_HSSEData_HiddenDangerDetail
- // {
- // UnitId = BLL.Const.UnitId_SEDIN,
- // CollCropCode = base_Unit.CollCropCode,
- // UnitName = base_Unit.UnitName,
- // ProjectId = projectid,
- // ReportDate = DateTime.Now.Date,
- // TypeName = type.RectifyName,
- // TotalNum = list.Count(x => x.RectifyId == type.RectifyId),
- // NeedRectifyNum = list.Count(x => x.RectifyId == type.RectifyId && (x.IsRectify == null || x.IsRectify == false)),
- // };
- // if (IsReportByToday(projectid, type.RectifyName))
- // {
- // table.Id = GetTodayModelByProjectAndType(projectid, type.RectifyName).Id;
- // UpdateProject_HSSEData_HiddenDangerDetail(table);
- // }
- // else
- // {
- // table.Id = SQLHelper.GetNewID();
- // AddProject_HSSEData_HiddenDangerDetail(table);
- // }
- //}
- }
+
///
/// 获取类别名称
///
diff --git a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_SYHSEData_SYHSEService.cs b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_SYHSEData_SYHSEService.cs
index d9a22652..8753500e 100644
--- a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_SYHSEData_SYHSEService.cs
+++ b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_SYHSEData_SYHSEService.cs
@@ -57,7 +57,7 @@ namespace BLL
public static int count
{
get;
- set;
+ set;
}
public static List GetProject_SYHSEData_SYHSEByModle(Model.Project_SYHSEData_SYHSE table)
{
@@ -67,7 +67,7 @@ namespace BLL
(string.IsNullOrEmpty(table.ProjectId) || x.Id.Contains(table.ProjectId)) &&
(string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
(string.IsNullOrEmpty(table.CollCropCode) || x.CollCropCode.Contains(table.CollCropCode)) &&
- (string.IsNullOrEmpty(table.UnitName) || x.UnitName.Contains(table.UnitName))
+ (string.IsNullOrEmpty(table.UnitName) || x.UnitName.Contains(table.UnitName))
select x
;
@@ -81,13 +81,13 @@ namespace BLL
///
public static IEnumerable getListData(Model.Project_SYHSEData_SYHSE table, Grid Grid1)
{
- var q = GetProject_SYHSEData_SYHSEByModle(table);
+ var q = GetProject_SYHSEData_SYHSEByModle(table);
count = q.Count();
if (count == 0)
{
return null;
}
- //q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
+ //q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
return from x in q
select new
{
@@ -196,7 +196,7 @@ namespace BLL
if (table != null)
{
table.Id = newtable.Id;
- table.ProjectId=newtable.ProjectId;
+ table.ProjectId = newtable.ProjectId;
table.UnitId = newtable.UnitId;
table.CollCropCode = newtable.CollCropCode;
table.UnitName = newtable.UnitName;
@@ -295,9 +295,14 @@ namespace BLL
///
///
///
- public static void StatisticalData(string projectid,SYHSESDateType sYHSESDateType)
+ public static void StatisticalData(string projectid, SYHSESDateType sYHSESDateType)
{
- string thisUnitId = BLL.Const.UnitId_SEDIN;
+ string thisUnitId = string.Empty;
+ var thisUnit = CommonService.GetIsThisUnit();
+ if (thisUnit != null)
+ {
+ thisUnitId = thisUnit.UnitId;
+ }
var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
Model.Project_SYHSEData_SYHSE table = new Model.Project_SYHSEData_SYHSE();
if (IsReportByToday(projectid))
@@ -314,7 +319,7 @@ namespace BLL
table.ProjectId = projectid;
table.ReportDate = DateTime.Now.Date;
- if (sYHSESDateType== SYHSESDateType.RiskControl || sYHSESDateType == SYHSESDateType.All)
+ if (sYHSESDateType == SYHSESDateType.RiskControl || sYHSESDateType == SYHSESDateType.All)
{
table.GeneralRiskNum = GetGeneralRiskNum(projectid);
table.LowRiskNum = GetLowRiskNum(projectid);
diff --git a/SGGL/BLL/ZHGL/DataSync/SYHSEData_DataService.cs b/SGGL/BLL/ZHGL/DataSync/SYHSEData_DataService.cs
index 04f3edc7..cadc7971 100644
--- a/SGGL/BLL/ZHGL/DataSync/SYHSEData_DataService.cs
+++ b/SGGL/BLL/ZHGL/DataSync/SYHSEData_DataService.cs
@@ -30,7 +30,7 @@ namespace BLL
var q = from x in db.SYHSEData_Data
where
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
- (string.IsNullOrEmpty(table.FactoryId) || x.FactoryId.Contains(table.FactoryId))
+ (string.IsNullOrEmpty(table.FactoryId) || x.FactoryId.Contains(table.FactoryId))
select x
;
@@ -89,31 +89,31 @@ namespace BLL
}
public static Model.NewSYHSEData GetItemById(string Id)
{
- var data=GetSYHSEData_DataById(Id);
+ var data = GetSYHSEData_DataById(Id);
var data_realtime = HazardRealtimedeviceService.GetHazard_RealTimeDeviceByDate(data.ReportDate);
- var data_hidden= SyhsedataHiddendangercheckService.GetSYHSEData_HiddenDangerCheckByDate(data.ReportDate);
- var data_risk= SyhsedataRiskcontrolService.GetSYHSEData_RiskControlByDate(data.ReportDate);
+ var data_hidden = SyhsedataHiddendangercheckService.GetSYHSEData_HiddenDangerCheckByDate(data.ReportDate);
+ var data_risk = SyhsedataRiskcontrolService.GetSYHSEData_RiskControlByDate(data.ReportDate);
NewSYHSEData APIData = new NewSYHSEData();
- var APIDataList_Item= new List();
- var APIDataList_Relatime= new List();
- var APIDataList_Hidden= new List();
- var APIDataList_Risk= new List();
+ var APIDataList_Item = new List();
+ var APIDataList_Relatime = new List();
+ var APIDataList_Hidden = new List();
+ var APIDataList_Risk = new List();
foreach (var tb in data_realtime)
{
var q = new NewSYHSEDataRealTimeDeviceItem()
{
- Id=tb.ID,
- HazardName=tb.HazardName,
- HazardLevel=tb.HazardLevel,
- DeviceName=tb.DeviceName,
- Medium=tb.Medium,
- MeasurementUnit=tb.MeasurementUnit,
- DateTime=tb.DateTime.ToString(),
- Value=tb.Value,
-
+ Id = tb.ID,
+ HazardName = tb.HazardName,
+ HazardLevel = tb.HazardLevel,
+ DeviceName = tb.DeviceName,
+ Medium = tb.Medium,
+ MeasurementUnit = tb.MeasurementUnit,
+ DateTime = tb.DateTime.ToString(),
+ Value = tb.Value,
+
};
APIDataList_Relatime.Add(q);
@@ -123,10 +123,10 @@ namespace BLL
{
var q = new NewSYHSEDataHiddenDangerCheckItem()
{
- Id=tb.Id,
- HiddenDangerName=tb.HiddenDangerName,
- TotalNum=tb.TotalNum.HasValue ? tb.TotalNum.Value:0,
- OKNum=tb.OKNum.HasValue ? tb.OKNum.Value : 0,
+ Id = tb.Id,
+ HiddenDangerName = tb.HiddenDangerName,
+ TotalNum = tb.TotalNum.HasValue ? tb.TotalNum.Value : 0,
+ OKNum = tb.OKNum.HasValue ? tb.OKNum.Value : 0,
};
APIDataList_Hidden.Add(q);
@@ -136,30 +136,31 @@ namespace BLL
{
var q = new NewSYHSEDataRiskControlItem()
- {
- Id=tb.Id,
- RiskControlName=tb.RiskControlName,
-
- };
+ {
+ Id = tb.Id,
+ RiskControlName = tb.RiskControlName,
+
+ };
APIDataList_Risk.Add(q);
}
+ var thisUnit = CommonService.GetIsThisUnit();
NewSYHSEDataItem Item = new NewSYHSEDataItem();
Item.Id = data.Id;
- Item.ReportDate=data.ReportDate.ToString();
- Item.UnitId = Const.UnitId_SEDIN;
- Item.CollCropCode = UnitService.GetUnitByUnitId(Const.UnitId_SEDIN).CollCropCode;
- Item.UnitName= UnitService.GetUnitByUnitId(Const.UnitId_SEDIN).UnitName;
+ Item.ReportDate = data.ReportDate.ToString();
+ Item.UnitId = thisUnit.UnitId;
+ Item.CollCropCode = thisUnit.CollCropCode;
+ Item.UnitName = thisUnit.UnitName;
Item.FactoryId = data.FactoryId;
- Item.FactoryCode = BLL.Base_FactoryService.GetBase_FactoryById(data.FactoryId).FactoryCode;
- Item.FactoryName = BLL.Base_FactoryService.GetBase_FactoryById(data.FactoryId).FactoryName;
- Item.Address = BLL.Base_FactoryService.GetBase_FactoryById(data.FactoryId).Address;
- Item.MapCoordinates= BLL.Base_FactoryService.GetBase_FactoryById(data.FactoryId).MapCoordinates;
- Item.SafetyMnaHours = data.SafetyMnaHours.HasValue ? data.SafetyMnaHours.Value : 0;
- Item.GeneralRiskNum = data.GeneralRiskNum.HasValue ? data.GeneralRiskNum.Value : 0;
- Item.LowRiskNum = data.LowRiskNum.HasValue ? data.LowRiskNum.Value : 0;
- Item.MoreRiskNum = data.MoreRiskNum.HasValue ? data.MoreRiskNum.Value : 0;
- Item.GreatRiskNum = data.GreatRiskNum.HasValue ? data.GreatRiskNum.Value : 0;
+ Item.FactoryCode = ProjectService.GetProjectByProjectId(data.FactoryId).ProjectCode;
+ Item.FactoryName = ProjectService.GetProjectByProjectId(data.FactoryId).ProjectName;
+ Item.Address = ProjectService.GetProjectByProjectId(data.FactoryId).ProjectAddress;
+ Item.MapCoordinates = ProjectService.GetProjectByProjectId(data.FactoryId).MapCoordinates;
+ Item.SafetyMnaHours = data.SafetyMnaHours.HasValue ? data.SafetyMnaHours.Value : 0;
+ Item.GeneralRiskNum = data.GeneralRiskNum.HasValue ? data.GeneralRiskNum.Value : 0;
+ Item.LowRiskNum = data.LowRiskNum.HasValue ? data.LowRiskNum.Value : 0;
+ Item.MoreRiskNum = data.MoreRiskNum.HasValue ? data.MoreRiskNum.Value : 0;
+ Item.GreatRiskNum = data.GreatRiskNum.HasValue ? data.GreatRiskNum.Value : 0;
Item.NewSYHSEDataRiskControlItems = APIDataList_Risk;
Item.NewSYHSEDataRealTimeDeviceItems = APIDataList_Relatime;
Item.NewSYHSEDataHiddenDangerCheckItems = APIDataList_Hidden;
@@ -167,7 +168,7 @@ namespace BLL
APIDataList_Item.Add(Item);
APIData.NewSYHSEDataItems = APIDataList_Item;
-
+
return APIData;
}
diff --git a/SGGL/BLL/ZHGL/DataSync/SYHSEData_HiddenDangerCheckService.cs b/SGGL/BLL/ZHGL/DataSync/SYHSEData_HiddenDangerCheckService.cs
index 1c17e777..e275e37a 100644
--- a/SGGL/BLL/ZHGL/DataSync/SYHSEData_HiddenDangerCheckService.cs
+++ b/SGGL/BLL/ZHGL/DataSync/SYHSEData_HiddenDangerCheckService.cs
@@ -29,7 +29,7 @@ namespace BLL
where
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
(string.IsNullOrEmpty(table.FactoryId) || x.FactoryId.Contains(table.FactoryId)) &&
- (string.IsNullOrEmpty(table.HiddenDangerName) || x.HiddenDangerName.Contains(table.HiddenDangerName))
+ (string.IsNullOrEmpty(table.HiddenDangerName) || x.HiddenDangerName.Contains(table.HiddenDangerName))
select x
;
diff --git a/SGGL/BLL/ZHGL/DataSync/SYHSEData_RiskControlService.cs b/SGGL/BLL/ZHGL/DataSync/SYHSEData_RiskControlService.cs
index cf013d66..030ba134 100644
--- a/SGGL/BLL/ZHGL/DataSync/SYHSEData_RiskControlService.cs
+++ b/SGGL/BLL/ZHGL/DataSync/SYHSEData_RiskControlService.cs
@@ -29,7 +29,7 @@ namespace BLL
where
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
(string.IsNullOrEmpty(table.FactoryId) || x.FactoryId.Contains(table.FactoryId)) &&
- (string.IsNullOrEmpty(table.RiskControlName) || x.RiskControlName.Contains(table.RiskControlName))
+ (string.IsNullOrEmpty(table.RiskControlName) || x.RiskControlName.Contains(table.RiskControlName))
select x
;
diff --git a/SGGL/BLL/ZHGL/DataSync/SYHSEData_SYHSEService.cs b/SGGL/BLL/ZHGL/DataSync/SYHSEData_SYHSEService.cs
index 730066a2..be7ec9bd 100644
--- a/SGGL/BLL/ZHGL/DataSync/SYHSEData_SYHSEService.cs
+++ b/SGGL/BLL/ZHGL/DataSync/SYHSEData_SYHSEService.cs
@@ -87,12 +87,14 @@ namespace BLL
public static List GetSYHSEData_SYHSEByModle(Model.SYHSEData_SYHSE table)
{
+ Model.SGGLDB db = Funs.DB;
var q = from x in db.SYHSEData_SYHSE
where
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
(string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
(string.IsNullOrEmpty(table.CollCropCode) || x.CollCropCode.Contains(table.CollCropCode)) &&
(string.IsNullOrEmpty(table.UnitName) || x.UnitName.Contains(table.UnitName))
+ orderby x.ReportDate descending
select x
;
@@ -102,6 +104,7 @@ namespace BLL
public static void AddSYHSEData_SYHSE(Model.SYHSEData_SYHSE newtable)
{
+ Model.SGGLDB db = Funs.DB;
Model.SYHSEData_SYHSE table = new Model.SYHSEData_SYHSE
{
Id = newtable.Id,
@@ -153,6 +156,7 @@ namespace BLL
public static void DeleteSYHSEData_SYHSEById(string Id)
{
+ Model.SGGLDB db = Funs.DB;
Model.SYHSEData_SYHSE table = db.SYHSEData_SYHSE.FirstOrDefault(x => x.Id == Id);
if (table != null)
{
@@ -269,6 +273,7 @@ namespace BLL
public static Model.SYHSEData_SYHSE GetSYHSEData_SYHSEById(string Id)
{
+ Model.SGGLDB db = Funs.DB;
return db.SYHSEData_SYHSE.FirstOrDefault(x => x.Id == Id);
}
@@ -278,7 +283,8 @@ namespace BLL
SYHSEData data = new SYHSEData();
if (q != null && q.State == Const.CNCEC_State_S)
{
- data = GetItemBySyhseData_SYHSE(q);
+ // data = GetItemBySyhseData_SYHSE(q);
+ data = StatisticalData();
}
else
{
@@ -301,7 +307,7 @@ namespace BLL
q.State = Const.CNCEC_State_1;
UpdateSYHSEData_SYHSE(q);
}
-
+
}
public static bool IsReportByDate(DateTime dateTime)
{
@@ -344,7 +350,13 @@ namespace BLL
public static SYHSEData StatisticalData()
{
- var base_Unit = BLL.UnitService.GetUnitByUnitId(BLL.Const.UnitId_SEDIN);
+ string thisUnitId = string.Empty;
+ var thisUnit = CommonService.GetIsThisUnit();
+ if (thisUnit != null)
+ {
+ thisUnitId = thisUnit.UnitId;
+ }
+ var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
var ProjectData = (from x in Funs.DB.Project_SYHSEData_SYHSE
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
select x).ToList();
@@ -352,7 +364,7 @@ namespace BLL
Model.SYHSEData_SYHSE table = new Model.SYHSEData_SYHSE
{
- UnitId = BLL.Const.UnitId_SEDIN,
+ UnitId = thisUnitId,
CollCropCode = base_Unit.CollCropCode,
UnitName = base_Unit.UnitName,
ReportDate = DateTime.Now.Date,
@@ -412,6 +424,7 @@ namespace BLL
}
public static void UpdateSYHSEData_SYHSE(Model.SYHSEData_SYHSE newtable)
{
+ Model.SGGLDB db = Funs.DB;
Model.SYHSEData_SYHSE table = db.SYHSEData_SYHSE.FirstOrDefault(x => x.Id == newtable.Id);
if (table != null)
{
diff --git a/SGGL/BLL/ZHGL/DataSync/ServerService.cs b/SGGL/BLL/ZHGL/DataSync/ServerService.cs
index f0609272..ec2caa03 100644
--- a/SGGL/BLL/ZHGL/DataSync/ServerService.cs
+++ b/SGGL/BLL/ZHGL/DataSync/ServerService.cs
@@ -4,25 +4,25 @@ using RestSharp;
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Net;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
- public static class ServerService
+ public static class ServerService
{
public static Model.TokenItem GetCNCECToken()
{
- System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
string CNCECPath = SysConstSetService.CNCECPath;
string baseurl = CNCECPath + "/api/Common/GetToken";
var client = new RestClient(baseurl);
client.Timeout = -1;
var request = new RestRequest(Method.POST);
- var thisUnitId = BLL.Const.UnitId_SEDIN;
- var thisUnit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
+ ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
+ var thisUnit = CommonService.GetIsThisUnit();
request.AddParameter("UnitName", thisUnit.UnitName);
request.AddParameter("CollCropCode", thisUnit.CollCropCode);
//request.AddJsonBody(JsonBody);
@@ -30,20 +30,19 @@ namespace BLL
Console.WriteLine(response.Content);
var responeData = JsonConvert.DeserializeObject(response.Content.ToString());
TokenItem tokenItem = new TokenItem();
- if (responeData.code==1&&string .IsNullOrEmpty(responeData.message) )
+ if (responeData.code == 1 && string.IsNullOrEmpty(responeData.message))
{
var token = JsonConvert.DeserializeObject(responeData.data.ToString());
- tokenItem.Token=token.Token.ToString();
- tokenItem.ExpiryTime= token.ExpiryTime.ToString();
+ tokenItem.Token = token.Token.ToString();
+ tokenItem.ExpiryTime = token.ExpiryTime.ToString();
SysConstSetService.SetToken(tokenItem.Token);
SysConstSetService.SetTokenExpirationTime(tokenItem.ExpiryTime);
}
return tokenItem;
-
+
}
- public static Model.ReturnData PushCNCEC(string JsonBody,string apiurl)
+ public static Model.ReturnData PushCNCEC(string JsonBody, string apiurl)
{
- System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
Model.ReturnData responeData = new Model.ReturnData();
string CNCECPath = SysConstSetService.CNCECPath;
if (string.IsNullOrEmpty(CNCECPath))
@@ -57,24 +56,24 @@ namespace BLL
var client = new RestClient(baseurl);
client.Timeout = -1;
var request = new RestRequest(Method.POST);
+ ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
var tokenItem = GetToken();
request.AddHeader("token", tokenItem.Token);
request.AddJsonBody(JsonBody);
IRestResponse response = client.Execute(request);
- Console.WriteLine(response.Content);
+ APICommonService.SaveSysHttpLog("api_Out", baseurl, response.Content);
var returnData = JsonConvert.DeserializeObject(response.Content.ToString());
if (returnData.code == 0)
{
responeData.code = 0;
responeData.message = returnData.message;
return responeData;
-
+
}
return responeData;
}
public static Model.TokenItem GetToken()
{
- System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
Model.TokenItem tokenItem = new Model.TokenItem();
tokenItem.Token = BLL.SysConstSetService.CNCECToken;
tokenItem.ExpiryTime = BLL.SysConstSetService.CNCECTTokenExTime;
@@ -82,7 +81,7 @@ namespace BLL
{
//DateTime.Parse(SysConstSetService.CNCECTTokenExTime).AddMinutes(-10) > DateTime.Now
tokenItem = GetCNCECToken();
- }
+ }
else if (DateTime.Parse(SysConstSetService.CNCECTTokenExTime).AddMinutes(-10) < DateTime.Now)
{
tokenItem = GetCNCECToken();
diff --git a/SGGL/BLL/ZHGL/Environmental/ChemicalReportItemService.cs b/SGGL/BLL/ZHGL/Environmental/ChemicalReportItemService.cs
index 3bca7f98..74db3a56 100644
--- a/SGGL/BLL/ZHGL/Environmental/ChemicalReportItemService.cs
+++ b/SGGL/BLL/ZHGL/Environmental/ChemicalReportItemService.cs
@@ -161,7 +161,50 @@ namespace BLL
Funs.DB.SubmitChanges();
}
}
+ public static decimal GetLatstTimeTotalEnergyConsumption()
+ {
+ var q1 = (from x in Funs.DB.Environmental_ChemicalReportItem where x.SortIndex == "01" select x);
+ decimal d1 = 0;
+ foreach (var item in q1)
+ {
+ d1 += Funs.GetNewDecimalOrZero(item.ThisYearValue);
+ }
+ var q2 = (from x in Funs.DB.Environmental_ArchitectureReportItem where x.SortIndex == "01" select x);
+ decimal d2 = 0;
+ foreach (var item in q2)
+ {
+ d2 += Funs.GetNewDecimalOrZero(item.ThisYearValue);
+ }
+ return d1 + d2;
+ }
+ public static decimal GetLatstTimeIncomeComprehensiveEnergyConsumption()
+ {
+ var q2 = (from x in Funs.DB.Environmental_ArchitectureReportItem where x.SortIndex == "15" select x);
+ decimal d2 = 0;
+ foreach (var item in q2)
+ {
+ d2 += Funs.GetNewDecimalOrZero(item.ThisYearValue);
+ }
+ return d2;
+ }
+ public static decimal GetLatstTimeNewWaterConsumption()
+ {
+ var q1 = (from x in Funs.DB.Environmental_ChemicalReportItem where x.SortIndex == "70" select x);
+ decimal d1 = 0;
+ foreach (var item in q1)
+ {
+ d1 += Funs.GetNewDecimalOrZero(item.ThisYearValue);
+ }
+ var q2 = (from x in Funs.DB.Environmental_ArchitectureReportItem where x.SortIndex == "38" select x);
+ decimal d2 = 0;
+ foreach (var item in q2)
+ {
+ d2 += Funs.GetNewDecimalOrZero(item.ThisYearValue);
+ }
+ return d1 + d2;
+
+ }
///
/// 获取指标名称集合
///
diff --git a/SGGL/FineUIPro.Web/AttachFile/OnlineEditing.aspx b/SGGL/FineUIPro.Web/AttachFile/OnlineEditing.aspx
index 94b12a5a..58e7f143 100644
--- a/SGGL/FineUIPro.Web/AttachFile/OnlineEditing.aspx
+++ b/SGGL/FineUIPro.Web/AttachFile/OnlineEditing.aspx
@@ -4,11 +4,11 @@
-
-
+
+
-
+ Spire.Office
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/SysManage/HttpLog.aspx.cs b/SGGL/FineUIPro.Web/SysManage/HttpLog.aspx.cs
new file mode 100644
index 00000000..0000509b
--- /dev/null
+++ b/SGGL/FineUIPro.Web/SysManage/HttpLog.aspx.cs
@@ -0,0 +1,167 @@
+using BLL;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using AspNet = System.Web.UI.WebControls;
+
+namespace FineUIPro.Web.SysManage
+{
+ public partial class HttpLog : PageBase
+ {
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
+ // 绑定表格
+ this.BindGrid();
+ }
+ }
+
+ #region 绑定数据
+ ///
+ /// 绑定数据
+ ///
+ private void BindGrid()
+ {
+ Model.Sys_HttpLog table = new Model.Sys_HttpLog();
+ table.LogTime=txtLogTime.SelectedDate;
+ table.UserName=txtUserName.Text.Trim();
+ table.HttpUrl=txtHttpUrl.Text.Trim();
+ table.LogTxt=txtLogTxt.Text.Trim();
+ table.MeThod=txtMeThod.Text.Trim();
+ var tb = BLL.SysHttplogService.getListData(table, Grid1);
+ Grid1.RecordCount = SysHttplogService.count;
+ //tb = GetFilteredTable(Grid1.FilteredData, tb);
+ Grid1.DataSource = tb;
+ Grid1.DataBind();
+ }
+ #endregion
+
+ #region GV 数据操作
+ ///
+ /// 过滤表头
+ ///
+ ///
+ ///
+ //protected void Grid1_FilterChange(object sender, EventArgs e)
+ //{
+ // this.BindGrid();
+ //}
+
+ ///
+ /// 分页
+ ///
+ ///
+ ///
+ protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
+ {
+ this.Grid1.PageIndex = e.NewPageIndex;
+ this.BindGrid();
+ }
+
+ ///
+ /// 排序
+ ///
+ ///
+ ///
+ protected void Grid1_Sort(object sender, GridSortEventArgs e)
+ {
+ this.Grid1.SortDirection = e.SortDirection;
+ this.Grid1.SortField = e.SortField;
+ this.BindGrid();
+ }
+
+ ///
+ /// 分页显示条数下拉框
+ ///
+ ///
+ ///
+ protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue);
+ this.BindGrid();
+ }
+ #endregion
+
+ #region 关闭弹出窗
+ ///
+ /// 关闭弹出窗
+ ///
+ ///
+ ///
+ protected void Window1_Close(object sender, WindowCloseEventArgs e)
+ {
+ BindGrid();
+ }
+ #endregion
+
+ #region 导出按钮
+ /// 导出按钮
+ ///
+ ///
+ ///
+ protected void btnOut_Click(object sender, EventArgs e)
+ {
+ Response.ClearContent();
+ string filename = Funs.GetNewFileName();
+ Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("HTTP请求日志表" + filename, System.Text.Encoding.UTF8) + ".xls");
+ Response.ContentType = "application/excel";
+ Response.ContentEncoding = System.Text.Encoding.UTF8;
+ this.Grid1.PageSize = 500;
+ this.BindGrid();
+ Response.Write(GetGridTableHtml(Grid1));
+ Response.End();
+ }
+
+ ///
+ /// 导出方法
+ ///
+ ///
+ ///
+ private string GetGridTableHtml(Grid grid)
+ {
+ StringBuilder sb = new StringBuilder();
+ sb.Append("");
+ sb.Append("");
+ sb.Append("");
+ foreach (GridColumn column in grid.Columns)
+ {
+ sb.AppendFormat("| {0} | ", column.HeaderText);
+ }
+ sb.Append("
");
+ foreach (GridRow row in grid.Rows)
+ {
+ sb.Append("");
+ foreach (GridColumn column in grid.Columns)
+ {
+ string html = row.Values[column.ColumnIndex].ToString();
+ if (column.ColumnID == "tfNumber")
+ {
+ html = (row.FindControl("lblNumber") as AspNet.Label).Text;
+ }
+ sb.AppendFormat("| {0} | ", html);
+ }
+
+ sb.Append("
");
+ }
+
+ sb.Append("
");
+
+ return sb.ToString();
+ }
+ #endregion
+
+ protected void btSearch_Click(object sender, EventArgs e)
+ {
+ BindGrid();
+ }
+ }
+}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/SysManage/HttpLog.aspx.designer.cs b/SGGL/FineUIPro.Web/SysManage/HttpLog.aspx.designer.cs
new file mode 100644
index 00000000..6ba66945
--- /dev/null
+++ b/SGGL/FineUIPro.Web/SysManage/HttpLog.aspx.designer.cs
@@ -0,0 +1,188 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace FineUIPro.Web.SysManage
+{
+
+
+ public partial class HttpLog
+ {
+
+ ///
+ /// 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;
+
+ ///
+ /// txtLogTime 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DatePicker txtLogTime;
+
+ ///
+ /// txtUserName 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtUserName;
+
+ ///
+ /// txtHttpUrl 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtHttpUrl;
+
+ ///
+ /// txtLogTxt 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtLogTxt;
+
+ ///
+ /// txtMeThod 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtMeThod;
+
+ ///
+ /// ToolbarFill1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarFill ToolbarFill1;
+
+ ///
+ /// btSearch 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btSearch;
+
+ ///
+ /// btnOut 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnOut;
+
+ ///
+ /// lblNumber 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.WebControls.Label lblNumber;
+
+ ///
+ /// ToolbarSeparator1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
+
+ ///
+ /// ToolbarText1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarText ToolbarText1;
+
+ ///
+ /// ddlPageSize 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList ddlPageSize;
+
+ ///
+ /// Window1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Window Window1;
+
+ ///
+ /// Menu1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Menu Menu1;
+ }
+}
diff --git a/SGGL/FineUIPro.Web/SysManage/RoleListEdit.aspx.cs b/SGGL/FineUIPro.Web/SysManage/RoleListEdit.aspx.cs
index 76706817..8ae8d6e4 100644
--- a/SGGL/FineUIPro.Web/SysManage/RoleListEdit.aspx.cs
+++ b/SGGL/FineUIPro.Web/SysManage/RoleListEdit.aspx.cs
@@ -83,6 +83,10 @@ namespace FineUIPro.Web.SysManage
///
protected void btnSave_Click(object sender, EventArgs e)
{
+ if (!CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.RoleMenuId, Const.BtnSave))
+ {
+ return;
+ }
if (BLL.RoleService.IsExistRoleName(this.RoleId, this.txtRoleName.Text.Trim()))
{
Alert.ShowInParent("角色名称已存在!", MessageBoxIcon.Warning);
diff --git a/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx b/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx
index 9259966e..171b4368 100644
--- a/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx
+++ b/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx
@@ -113,6 +113,11 @@
+
+
+
+
+
@@ -411,6 +416,41 @@
+
+
+
diff --git a/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.cs b/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.cs
index 33baaf3c..ff98d9b9 100644
--- a/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.cs
+++ b/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.cs
@@ -33,9 +33,11 @@ namespace FineUIPro.Web.SysManage
{
this.btnArrowRefresh.Hidden = false;
this.btnReport.Hidden = false;
+ this.TabHttpLog.Hidden = false;
}
///产值
this.LoadTab4Data();
+ LoadTabOnlineEditData();
}
}
@@ -132,6 +134,14 @@ namespace FineUIPro.Web.SysManage
{
txtSerVerUrl.Text = sysSet9.ConstValue;
}
+ var sysSet18 = BLL.ConstValue.drpConstItemList(BLL.ConstValue.Group_SafeReferer).Select(x => new { x.ConstText, x.ConstValue }).ToList();
+ var txtReferer = "";
+ foreach (var item in sysSet18)
+ {
+ string a = item.ConstText + "|" + item.ConstValue;
+ txtReferer += a + "&";
+ }
+ txtRefererWhitelist.Text = txtReferer;
}
///
@@ -333,6 +343,26 @@ namespace FineUIPro.Web.SysManage
Funs.DB.Sys_Const.InsertOnSubmit(newSysSet9);
Funs.DB.SubmitChanges();
}
+ ConstValue.DeleteConstValueBygroupId(BLL.ConstValue.Group_SafeReferer);
+ var q = txtRefererWhitelist.Text.Split('&');
+ foreach (var item in q)
+ {
+ var detail = item.Split('|');
+ if (detail.Length == 2)
+ {
+ Model.Sys_Const newSys_Const = new Model.Sys_Const()
+ {
+ ID = SQLHelper.GetNewID(typeof(Model.Sys_Const)),
+ ConstText = detail[0].ToString(),
+ ConstValue = detail[1].ToString(),
+ SortIndex = 1,
+ GroupId = ConstValue.Group_SafeReferer
+ };
+ Funs.DB.Sys_Const.InsertOnSubmit(newSys_Const);
+ Funs.DB.SubmitChanges();
+ }
+
+ }
ShowNotify("保存成功!", MessageBoxIcon.Success);
BLL.LogService.AddSys_Log(this.CurrUser, "修改系统环境设置!", string.Empty, BLL.Const.SysConstSetMenuId, BLL.Const.BtnModify);
}
@@ -766,6 +796,94 @@ namespace FineUIPro.Web.SysManage
}
#endregion
+ #region TabOnLine加载页面方法
+
+ private void LoadTabOnlineEditData()
+ {
+ var db = Funs.DB;
+ var sysSet1 = (from x in db.Sys_Const where x.ConstText == "OnlineEditAppid" select x).ToList().FirstOrDefault();
+ if (sysSet1 != null)
+ {
+ txtAppid.Text = sysSet1.ConstValue;
+ }
+ var sysSet2 = (from x in db.Sys_Const where x.ConstText == "OnlineEditAppkey" select x).ToList().FirstOrDefault();
+ if (sysSet2 != null)
+ {
+ txtAppkey.Text = sysSet2.ConstValue;
+ }
+ var sysSet3 = (from x in db.Sys_Const where x.ConstText == "OnlineEditCallBackurl" select x).ToList().FirstOrDefault();
+ if (sysSet3 != null)
+ {
+ txtCallBackapiurl.Text = sysSet3.ConstValue;
+ }
+ }
+ protected void OnlineMenuSetSave_OnClick(object sender, EventArgs e)
+ {
+ var db = Funs.DB;
+ Model.Sys_Const sysSey1 = db.Sys_Const.FirstOrDefault(x => x.ConstText == "OnlineEditAppid");
+ if (sysSey1 != null)
+ {
+ if (!string.IsNullOrEmpty(this.txtAppid.Text.Trim()))
+ {
+ sysSey1.ConstValue = this.txtAppid.Text.Trim();
+ }
+ db.SubmitChanges();
+ }
+ else
+ {
+ sysSey1 = new Model.Sys_Const();
+ if (!string.IsNullOrEmpty(this.txtAppid.Text.Trim()))
+ {
+ sysSey1.ConstValue = this.txtAppid.Text.Trim();
+ }
+ sysSey1.ConstText = "OnlineEditAppid";
+ Funs.DB.Sys_Const.InsertOnSubmit(sysSey1);
+ Funs.DB.SubmitChanges();
+ }
+ Model.Sys_Const sysSey2 = db.Sys_Const.FirstOrDefault(x => x.ConstText == "OnlineEditAppkey");
+ if (sysSey2 != null)
+ {
+ if (!string.IsNullOrEmpty(this.txtAppkey.Text.Trim()))
+ {
+ sysSey2.ConstValue = this.txtAppkey.Text.Trim();
+ }
+ db.SubmitChanges();
+ }
+ else
+ {
+ sysSey2 = new Model.Sys_Const();
+ if (!string.IsNullOrEmpty(this.txtAppkey.Text.Trim()))
+ {
+ sysSey2.ConstValue = this.txtAppkey.Text.Trim();
+ }
+ sysSey2.ConstText = "OnlineEditAppkey";
+ Funs.DB.Sys_Const.InsertOnSubmit(sysSey2);
+ Funs.DB.SubmitChanges();
+ }
+ Model.Sys_Const sysSet3 = db.Sys_Const.FirstOrDefault(x => x.ConstText == "OnlineEditCallBackurl");
+ if (sysSet3 != null)
+ {
+ if (!string.IsNullOrEmpty(this.txtCallBackapiurl.Text.Trim()))
+ {
+ sysSet3.ConstValue = this.txtCallBackapiurl.Text.Trim();
+ }
+ db.SubmitChanges();
+ }
+ else
+ {
+ sysSet3 = new Model.Sys_Const();
+ if (!string.IsNullOrEmpty(this.txtCallBackapiurl.Text.Trim()))
+ {
+ sysSet3.ConstValue = this.txtCallBackapiurl.Text.Trim();
+ }
+ sysSet3.ConstText = "OnlineEditCallBackurl";
+ Funs.DB.Sys_Const.InsertOnSubmit(sysSet3);
+ Funs.DB.SubmitChanges();
+ }
+ }
+ #endregion
+
+
#region LoadTab4Data
#region 产值页面数据显示
///
diff --git a/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.designer.cs b/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.designer.cs
index 7da83181..317e7691 100644
--- a/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.designer.cs
@@ -7,11 +7,13 @@
// 自动生成>
//------------------------------------------------------------------------------
-namespace FineUIPro.Web.SysManage {
-
-
- public partial class SysConstSet {
-
+namespace FineUIPro.Web.SysManage
+{
+
+
+ public partial class SysConstSet
+ {
+
///
/// form1 控件。
///
@@ -20,7 +22,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
-
+
///
/// PageManager1 控件。
///
@@ -29,7 +31,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.PageManager PageManager1;
-
+
///
/// Panel2 控件。
///
@@ -38,7 +40,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Panel Panel2;
-
+
///
/// TabStrip1 控件。
///
@@ -47,7 +49,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.TabStrip TabStrip1;
-
+
///
/// Tab1 控件。
///
@@ -56,7 +58,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Tab Tab1;
-
+
///
/// SimpleForm1 控件。
///
@@ -65,7 +67,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Form SimpleForm1;
-
+
///
/// txtNumberBox 控件。
///
@@ -74,7 +76,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtNumberBox;
-
+
///
/// Label9 控件。
///
@@ -83,7 +85,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label9;
-
+
///
/// ckIsMonthReportGetAVG 控件。
///
@@ -92,7 +94,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.CheckBox ckIsMonthReportGetAVG;
-
+
///
/// Label10 控件。
///
@@ -101,7 +103,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label10;
-
+
///
/// txtMonthReportFreezeDay 控件。
///
@@ -110,7 +112,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtMonthReportFreezeDay;
-
+
///
/// Label11 控件。
///
@@ -119,7 +121,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label11;
-
+
///
/// frFlowOperate 控件。
///
@@ -128,7 +130,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.FormRow frFlowOperate;
-
+
///
/// ckMenuFlowOperate 控件。
///
@@ -137,7 +139,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.CheckBox ckMenuFlowOperate;
-
+
///
/// Label12 控件。
///
@@ -146,7 +148,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label12;
-
+
///
/// txtMarch 控件。
///
@@ -155,7 +157,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtMarch;
-
+
///
/// Label1 控件。
///
@@ -164,7 +166,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label1;
-
+
///
/// txtMarchday 控件。
///
@@ -173,7 +175,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtMarchday;
-
+
///
/// Label2 控件。
///
@@ -182,7 +184,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label2;
-
+
///
/// txtJune 控件。
///
@@ -191,7 +193,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtJune;
-
+
///
/// Label3 控件。
///
@@ -200,7 +202,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label3;
-
+
///
/// txtJuneday 控件。
///
@@ -209,7 +211,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtJuneday;
-
+
///
/// Label4 控件。
///
@@ -218,7 +220,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label4;
-
+
///
/// txtSeptember 控件。
///
@@ -227,7 +229,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtSeptember;
-
+
///
/// Label5 控件。
///
@@ -236,7 +238,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label5;
-
+
///
/// txtSeptemberday 控件。
///
@@ -245,7 +247,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtSeptemberday;
-
+
///
/// Label6 控件。
///
@@ -254,7 +256,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label6;
-
+
///
/// txtDecember 控件。
///
@@ -263,7 +265,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtDecember;
-
+
///
/// Label7 控件。
///
@@ -272,7 +274,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label7;
-
+
///
/// txtDecemberday 控件。
///
@@ -281,7 +283,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtDecemberday;
-
+
///
/// Label13 控件。
///
@@ -290,7 +292,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label13;
-
+
///
/// txtSerVerUrl 控件。
///
@@ -299,7 +301,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.TextBox txtSerVerUrl;
-
+
///
/// btnApply 控件。
///
@@ -308,7 +310,16 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnApply;
-
+
+ ///
+ /// txtRefererWhitelist 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextArea txtRefererWhitelist;
+
///
/// Toolbar1 控件。
///
@@ -317,7 +328,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Toolbar Toolbar1;
-
+
///
/// btnSave 控件。
///
@@ -326,7 +337,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnSave;
-
+
///
/// btnArrowRefresh 控件。
///
@@ -335,7 +346,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnArrowRefresh;
-
+
///
/// Tab2 控件。
///
@@ -344,7 +355,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Tab Tab2;
-
+
///
/// Toolbar3 控件。
///
@@ -353,7 +364,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Toolbar Toolbar3;
-
+
///
/// rblMenuType 控件。
///
@@ -362,7 +373,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.RadioButtonList rblMenuType;
-
+
///
/// drpSuperMenu 控件。
///
@@ -371,7 +382,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.DropDownList drpSuperMenu;
-
+
///
/// drpMenu 控件。
///
@@ -380,7 +391,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.DropDownBox drpMenu;
-
+
///
/// treeMenu 控件。
///
@@ -389,7 +400,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Tree treeMenu;
-
+
///
/// ToolbarFill1 控件。
///
@@ -398,7 +409,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.ToolbarFill ToolbarFill1;
-
+
///
/// btnReport 控件。
///
@@ -407,7 +418,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnReport;
-
+
///
/// btnTab2Save 控件。
///
@@ -416,7 +427,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnTab2Save;
-
+
///
/// TabStrip2 控件。
///
@@ -425,7 +436,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.TabStrip TabStrip2;
-
+
///
/// TabCode 控件。
///
@@ -434,7 +445,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Tab TabCode;
-
+
///
/// SimpleForm2 控件。
///
@@ -443,7 +454,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Form SimpleForm2;
-
+
///
/// ckProjectCode 控件。
///
@@ -452,7 +463,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.CheckBox ckProjectCode;
-
+
///
/// txtPrefix 控件。
///
@@ -461,7 +472,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.TextBox txtPrefix;
-
+
///
/// Label8 控件。
///
@@ -470,7 +481,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label8;
-
+
///
/// ckUnitCode 控件。
///
@@ -479,7 +490,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.CheckBox ckUnitCode;
-
+
///
/// Label22 控件。
///
@@ -488,7 +499,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label22;
-
+
///
/// txtDigit 控件。
///
@@ -497,7 +508,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtDigit;
-
+
///
/// Label23 控件。
///
@@ -506,7 +517,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label23;
-
+
///
/// txtSymbol 控件。
///
@@ -515,7 +526,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.TextBox txtSymbol;
-
+
///
/// Label24 控件。
///
@@ -524,7 +535,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label24;
-
+
///
/// Tab4 控件。
///
@@ -533,7 +544,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Tab Tab4;
-
+
///
/// txtTemplate 控件。
///
@@ -542,7 +553,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.HtmlEditor txtTemplate;
-
+
///
/// Tab5 控件。
///
@@ -551,7 +562,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Tab Tab5;
-
+
///
/// Grid1 控件。
///
@@ -560,7 +571,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Grid Grid1;
-
+
///
/// Toolbar4 控件。
///
@@ -569,7 +580,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Toolbar Toolbar4;
-
+
///
/// btnFlowOperateNew 控件。
///
@@ -578,7 +589,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnFlowOperateNew;
-
+
///
/// btnFlowOperateDelete 控件。
///
@@ -587,7 +598,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnFlowOperateDelete;
-
+
///
/// Label27 控件。
///
@@ -596,7 +607,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::System.Web.UI.WebControls.Label Label27;
-
+
///
/// Tab3 控件。
///
@@ -605,7 +616,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Tab Tab3;
-
+
///
/// frTestSet 控件。
///
@@ -614,7 +625,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Form frTestSet;
-
+
///
/// lbTotalScore 控件。
///
@@ -623,7 +634,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label lbTotalScore;
-
+
///
/// lbTotalCount 控件。
///
@@ -632,7 +643,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label lbTotalCount;
-
+
///
/// txtDuration 控件。
///
@@ -641,7 +652,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtDuration;
-
+
///
/// Label14 控件。
///
@@ -650,7 +661,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label14;
-
+
///
/// txtPassingScore 控件。
///
@@ -659,7 +670,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtPassingScore;
-
+
///
/// Label21 控件。
///
@@ -668,7 +679,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label21;
-
+
///
/// txtSValue 控件。
///
@@ -677,7 +688,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtSValue;
-
+
///
/// Label15 控件。
///
@@ -686,7 +697,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label15;
-
+
///
/// txtMValue 控件。
///
@@ -695,7 +706,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtMValue;
-
+
///
/// Label16 控件。
///
@@ -704,7 +715,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label16;
-
+
///
/// txtJValue 控件。
///
@@ -713,7 +724,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtJValue;
-
+
///
/// Label17 控件。
///
@@ -722,7 +733,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label17;
-
+
///
/// txtSCount 控件。
///
@@ -731,7 +742,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtSCount;
-
+
///
/// Label18 控件。
///
@@ -740,7 +751,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label18;
-
+
///
/// txtMCount 控件。
///
@@ -749,7 +760,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtMCount;
-
+
///
/// Label19 控件。
///
@@ -758,7 +769,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label19;
-
+
///
/// txtJCount 控件。
///
@@ -767,7 +778,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtJCount;
-
+
///
/// Label20 控件。
///
@@ -776,7 +787,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label20;
-
+
///
/// Toolbar2 控件。
///
@@ -785,7 +796,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Toolbar Toolbar2;
-
+
///
/// btnTab3Save 控件。
///
@@ -794,7 +805,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnTab3Save;
-
+
///
/// Tab6 控件。
///
@@ -803,7 +814,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Tab Tab6;
-
+
///
/// Form2 控件。
///
@@ -812,7 +823,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Form Form2;
-
+
///
/// drpYear 控件。
///
@@ -821,7 +832,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.DropDownList drpYear;
-
+
///
/// txtYearPlanOutPutValue 控件。
///
@@ -830,7 +841,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtYearPlanOutPutValue;
-
+
///
/// txtYearActualOutPutValue 控件。
///
@@ -839,7 +850,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtYearActualOutPutValue;
-
+
///
/// btnYearOutPutValue 控件。
///
@@ -848,7 +859,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnYearOutPutValue;
-
+
///
/// GridOutPut 控件。
///
@@ -857,7 +868,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Grid GridOutPut;
-
+
///
/// Toolbar6 控件。
///
@@ -866,7 +877,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Toolbar Toolbar6;
-
+
///
/// drpMonth 控件。
///
@@ -875,7 +886,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.DropDownList drpMonth;
-
+
///
/// btnOutPutAdd 控件。
///
@@ -884,7 +895,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnOutPutAdd;
-
+
///
/// btnOutPutDel 控件。
///
@@ -893,7 +904,79 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnOutPutDel;
-
+
+ ///
+ /// TabOnlineMenuSet 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Tab TabOnlineMenuSet;
+
+ ///
+ /// Form3 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Form Form3;
+
+ ///
+ /// txtAppid 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtAppid;
+
+ ///
+ /// txtAppkey 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtAppkey;
+
+ ///
+ /// txtCallBackapiurl 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtCallBackapiurl;
+
+ ///
+ /// Toolbar5 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Toolbar Toolbar5;
+
+ ///
+ /// OnlineMenuSetSave 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button OnlineMenuSetSave;
+
+ ///
+ /// TabHttpLog 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Tab TabHttpLog;
+
///
/// Window1 控件。
///
@@ -902,7 +985,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Window Window1;
-
+
///
/// Window2 控件。
///
diff --git a/SGGL/FineUIPro.Web/TaskScheduling/InterFace/IFLogList.aspx b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/IFLogList.aspx
new file mode 100644
index 00000000..dae759f9
--- /dev/null
+++ b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/IFLogList.aspx
@@ -0,0 +1,105 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="IFLogList.aspx.cs" Inherits="FineUIPro.Web.InterFace.IFLogList" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/TaskScheduling/InterFace/IFLogList.aspx.cs b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/IFLogList.aspx.cs
new file mode 100644
index 00000000..2b1b64da
--- /dev/null
+++ b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/IFLogList.aspx.cs
@@ -0,0 +1,84 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using System.Data.SqlClient;
+using BLL;
+using System.Data;
+
+namespace FineUIPro.Web.InterFace
+{
+ public partial class IFLogList : PageBase
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ // BLL.ConstValue.InitConstValueDropDownList(this.drpDataType, "DataType", true);
+ BindGrid();
+ }
+ }
+
+ #region BindGrid
+
+ private void BindGrid()
+ {
+ Model.InterFaceLog interFaceLog=new Model.InterFaceLog();
+ interFaceLog.InterFaceName=txtUserName.Text;
+ var q= BLL.InterFaceLogService.GetInterFaceLogByModle(interFaceLog);
+ Grid1.RecordCount = InterFaceLogService.count;
+ Grid1.DataSource= InterFaceLogService.getListData(interFaceLog, Grid1);
+ Grid1.DataBind();
+
+ }
+
+ #endregion
+
+ protected string GetUnitName(object unitId)
+ {
+ string unitName = "";
+ if (unitId != null)
+ {
+ unitName = BLL.UnitService.GetUnitNameByUnitId(unitId.ToString());
+ }
+ return unitName;
+ }
+ ///
+ /// 分页下拉选择
+ ///
+ ///
+ ///
+ protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
+ BindGrid();
+ }
+
+ protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
+ {
+ Grid1.PageIndex = e.NewPageIndex;
+ BindGrid();
+ }
+
+
+ protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
+ {
+ Grid1.SortDirection = e.SortDirection;
+ Grid1.SortField = e.SortField;
+
+ BindGrid();
+ }
+
+ ///
+ /// 查询
+ ///
+ ///
+ ///
+ protected void TextBox_TextChanged(object sender, EventArgs e)
+ {
+ this.BindGrid();
+ }
+ }
+}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/TaskScheduling/InterFace/IFLogList.aspx.designer.cs b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/IFLogList.aspx.designer.cs
new file mode 100644
index 00000000..fb1941da
--- /dev/null
+++ b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/IFLogList.aspx.designer.cs
@@ -0,0 +1,134 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace FineUIPro.Web.InterFace
+{
+
+
+ public partial class IFLogList
+ {
+
+ ///
+ /// Head1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlHead Head1;
+
+ ///
+ /// form1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+ ///
+ /// PageManager1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.PageManager PageManager1;
+
+ ///
+ /// Panel1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Panel Panel1;
+
+ ///
+ /// panelCenterRegion 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Panel panelCenterRegion;
+
+ ///
+ /// Grid1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Grid Grid1;
+
+ ///
+ /// Toolbar2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Toolbar Toolbar2;
+
+ ///
+ /// txtUserName 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtUserName;
+
+ ///
+ /// Label1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.WebControls.Label Label1;
+
+ ///
+ /// Label4 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.WebControls.Label Label4;
+
+ ///
+ /// ToolbarSeparator1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
+
+ ///
+ /// ToolbarText1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarText ToolbarText1;
+
+ ///
+ /// ddlPageSize 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList ddlPageSize;
+ }
+}
diff --git a/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceEdit.aspx b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceEdit.aspx
new file mode 100644
index 00000000..d2699d59
--- /dev/null
+++ b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceEdit.aspx
@@ -0,0 +1,96 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InterFaceEdit.aspx.cs" Inherits="FineUIPro.Web.InterFace.InterFaceEdit" %>
+
+
+
+
+ 编辑接口设置
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceEdit.aspx.cs b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceEdit.aspx.cs
new file mode 100644
index 00000000..57514dfb
--- /dev/null
+++ b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceEdit.aspx.cs
@@ -0,0 +1,222 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.Security;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using BLL;
+
+namespace FineUIPro.Web.InterFace
+{
+ public partial class InterFaceEdit : PageBase
+ {
+ #region 定义项
+ ///
+ /// 接口配置主键
+ ///
+ public string InterFaceSetId
+ {
+ get
+ {
+ return (string)ViewState["InterFaceSetId"];
+ }
+ set
+ {
+ ViewState["InterFaceSetId"] = value;
+ }
+ }
+ #endregion
+
+ ///
+ /// 接口配置编辑页面
+ ///
+ ///
+ ///
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ LoadData();
+ ///权限
+ this.GetButtonPower();
+ this.InterFaceSetId = Request.Params["InterFaceSetId"];
+ BLL.ConstValue.InitConstValueDropDownList(this.drpIsOpen, ConstValue.Group_0001, false);
+ BLL.InterFaceSetService.InitReqMethodDropDownList(this.DrpUrlReqMethod, false);
+ BLL.InterFaceSetService.InitReqMethodDropDownList(this.DrpForUrlReqMethod, false);
+ BLL.InterFaceSetService.InitReqMethodDropDownList(this.DrpCallBackUrlReqMethod, false);
+ this.drpUnit.DataTextField = "UnitName";
+ this.drpUnit.DataValueField = "UnitId";
+ this.drpUnit.DataSource = BLL.UnitService.GetUnitDropDownList();
+ drpUnit.DataBind();
+ Funs.FineUIPleaseSelect(this.drpUnit);
+ if (!string.IsNullOrEmpty(this.InterFaceSetId))
+ {
+ this.drpUnit.SelectedValue = this.InterFaceSetId;
+ }
+ else
+ {
+ var unit = BLL.CommonService.GetIsThisUnit();
+ if (unit != null)
+ {
+ this.drpUnit.SelectedValue = unit.UnitId;
+ }
+ }
+
+ var list = (from x in Funs.DB.Base_Unit
+ orderby x.UnitName
+ select new { x.UnitName, x.UnitId }).ToList();
+ foreach (var item in list)
+ {
+ this.rbAuthUnits.Items.Add(item.UnitName, item.UnitId);
+ }
+
+ if (!string.IsNullOrEmpty(this.InterFaceSetId))
+ {
+ var FaceSet = BLL.InterFaceSetService.GetInterFaceSetById(this.InterFaceSetId);
+ if (FaceSet != null)
+ {
+
+
+ if (!string.IsNullOrEmpty(FaceSet.UnitId))
+ {
+ this.drpUnit.SelectedValue = FaceSet.UnitId;
+ }
+ this.txtFaceName.Text = FaceSet.InterFaceName;
+ this.txtFaceUrl.Text = FaceSet.InterFaceUrl;
+ this.txtFaceForUrl.Text = FaceSet.InterFaceForUrl;
+ this.txtCallBackUrl.Text=FaceSet.InterFaceCallBackUrl;
+ this.IsCallBack.Checked =(bool) FaceSet.IsCallBack;
+ if (!string.IsNullOrEmpty(FaceSet.AuthUnitIds))
+ {
+ this.drpAuthUnit.Values = FaceSet.AuthUnitIds.Split(',');
+ }
+
+ this.txtRemarks.Text = FaceSet.TxtRemarks;
+ if (FaceSet.IsOpen.HasValue)
+ {
+ this.drpIsOpen.SelectedValue = Convert.ToString(FaceSet.IsOpen);
+ }
+ if (!string.IsNullOrEmpty(FaceSet.UrlReqMethod))
+ {
+ this.DrpUrlReqMethod.SelectedValue = FaceSet.UrlReqMethod;
+ }
+ if (!string.IsNullOrEmpty(FaceSet.ForUrlReqMethod))
+ {
+ this.DrpForUrlReqMethod.SelectedValue = FaceSet.ForUrlReqMethod;
+ }
+ if (!string.IsNullOrEmpty(FaceSet.CallBackUrlReqMethod))
+ {
+ this.DrpCallBackUrlReqMethod.SelectedValue = FaceSet.CallBackUrlReqMethod;
+ }
+ }
+ }
+ }
+ }
+
+ ///
+ /// 加载页面
+ ///
+ private void LoadData()
+ {
+ btnClose.OnClientClick = ActiveWindow.GetHideReference();
+ }
+
+ ///
+ /// 保存按钮
+ ///
+ ///
+ ///
+ protected void btnSave_Click(object sender, EventArgs e)
+ {
+ //目标单位
+ string AuthUnitId = string.Empty;
+ string AuthUnitName = string.Empty;
+ string UnitId = string.Empty;
+ foreach (var item in this.drpAuthUnit.Values)
+ {
+ if (item != "")
+ {
+ AuthUnitId += item + ",";
+ }
+ }
+ foreach (var item in this.drpAuthUnit.Texts)
+ {
+ if (item != "")
+ {
+ AuthUnitName += item + ",";
+
+ }
+ }
+ AuthUnitId = AuthUnitId.Substring(0, AuthUnitId.LastIndexOf(","));
+ AuthUnitName = AuthUnitName.Substring(0, AuthUnitName.LastIndexOf(","));
+ if (this.drpUnit.SelectedValue != Const._Null)
+ {
+ UnitId = this.drpUnit.SelectedValue;
+ }
+ Model.InterFaceSet newSet = new Model.InterFaceSet
+ {
+ InterFaceName = this.txtFaceName.Text.Trim(),
+ InterFaceUrl = this.txtFaceUrl.Text.Trim(),
+ InterFaceForUrl = this.txtFaceForUrl.Text.Trim(),
+ IsOpen = Convert.ToBoolean(this.drpIsOpen.SelectedValue),
+ TxtRemarks = this.txtRemarks.Text.Trim(),
+ AuthUnitIds = AuthUnitId,
+ AuthUnitName = AuthUnitName,
+ UnitId = UnitId,
+ IsCallBack = IsCallBack.Checked,
+ InterFaceCallBackUrl = txtCallBackUrl.Text,
+ UrlReqMethod=DrpUrlReqMethod.SelectedValue.Trim(),
+ ForUrlReqMethod=DrpForUrlReqMethod.SelectedValue.Trim(),
+ CallBackUrlReqMethod=DrpCallBackUrlReqMethod.SelectedValue.Trim()
+
+ };
+ if (string.IsNullOrEmpty(this.InterFaceSetId))
+ {
+ newSet.InterFaceSetId = SQLHelper.GetNewID(typeof(Model.InterFaceSet));
+ BLL.InterFaceSetService.AddInterFaceSet(newSet);
+ BLL.LogService.AddLog(this.CurrUser.PersonId, "添加接口设置-" + this.txtFaceName.Text.Trim());
+ }
+ else
+ {
+ newSet.InterFaceSetId = this.InterFaceSetId;
+ BLL.InterFaceSetService.UpdateInterFaceSet(newSet);
+ BLL.LogService.AddLog(this.CurrUser.PersonId, "修改接口设置" + this.txtFaceName.Text.Trim());
+ }
+
+ PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
+ }
+
+ #region 获取按钮权限
+ ///
+ /// 获取按钮权限
+ ///
+ ///
+ ///
+ private void GetButtonPower()
+ {
+ var buttonList = BLL.CommonService.GetAllButtonList(null,this.CurrUser.PersonId, BLL.Const.InterFaceSetMenuId);
+ if (buttonList.Count() > 0)
+ {
+ if (buttonList.Contains(BLL.Const.BtnSave))
+ {
+ this.btnSave.Hidden = false;
+ }
+ }
+ }
+ #endregion
+
+ protected void IsCallBack_CheckedChanged(object sender, CheckedEventArgs e)
+ {
+ if (IsCallBack.Checked==true)
+ {
+ this.txtCallBackUrl.Hidden = false;
+ }
+ else
+ {
+ this.txtCallBackUrl.Hidden = true;
+ }
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceEdit.aspx.designer.cs
new file mode 100644
index 00000000..545c9116
--- /dev/null
+++ b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceEdit.aspx.designer.cs
@@ -0,0 +1,206 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace FineUIPro.Web.InterFace
+{
+
+
+ public partial class InterFaceEdit
+ {
+
+ ///
+ /// form1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+ ///
+ /// PageManager1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.PageManager PageManager1;
+
+ ///
+ /// SimpleForm1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Form SimpleForm1;
+
+ ///
+ /// txtFaceName 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtFaceName;
+
+ ///
+ /// drpUnit 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList drpUnit;
+
+ ///
+ /// txtFaceUrl 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtFaceUrl;
+
+ ///
+ /// DrpUrlReqMethod 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList DrpUrlReqMethod;
+
+ ///
+ /// drpAuthUnit 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownBox drpAuthUnit;
+
+ ///
+ /// SimpleForm2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.SimpleForm SimpleForm2;
+
+ ///
+ /// Label1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Label Label1;
+
+ ///
+ /// rbAuthUnits 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.CheckBoxList rbAuthUnits;
+
+ ///
+ /// txtFaceForUrl 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtFaceForUrl;
+
+ ///
+ /// DrpForUrlReqMethod 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList DrpForUrlReqMethod;
+
+ ///
+ /// IsCallBack 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.CheckBox IsCallBack;
+
+ ///
+ /// txtCallBackUrl 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtCallBackUrl;
+
+ ///
+ /// DrpCallBackUrlReqMethod 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList DrpCallBackUrlReqMethod;
+
+ ///
+ /// drpIsOpen 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList drpIsOpen;
+
+ ///
+ /// txtRemarks 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtRemarks;
+
+ ///
+ /// Toolbar1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Toolbar Toolbar1;
+
+ ///
+ /// btnSave 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnSave;
+
+ ///
+ /// btnClose 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnClose;
+ }
+}
diff --git a/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceSet.aspx b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceSet.aspx
new file mode 100644
index 00000000..429f3687
--- /dev/null
+++ b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceSet.aspx
@@ -0,0 +1,148 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InterFaceSet.aspx.cs" Inherits="FineUIPro.Web.InterFace.InterFaceSet" %>
+
+
+
+
+ 接口设置
+
+
+
+
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceSet.aspx.cs b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceSet.aspx.cs
new file mode 100644
index 00000000..fd930711
--- /dev/null
+++ b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceSet.aspx.cs
@@ -0,0 +1,325 @@
+namespace FineUIPro.Web.InterFace
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Data;
+ using System.Data.SqlClient;
+ using System.Linq;
+ using BLL;
+
+ public partial class InterFaceSet : PageBase
+ {
+ ///
+ /// 加载页面
+ ///
+ ///
+ ///
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ ////权限按钮方法
+ this.GetButtonPower();
+ btnNew.OnClientClick = Window1.GetShowReference("InterFaceEdit.aspx") + "return false;";
+ btnDelete.OnClientClick = Grid1.GetNoSelectionAlertReference("请至少选择一项!");
+ btnDelete.ConfirmText = String.Format("你确定要删除选中的 行数据吗?", Grid1.GetSelectedCountReference());
+
+ ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
+ // 绑定表格
+ BindGrid();
+ }
+ }
+
+ ///
+ /// 绑定数据
+ ///
+ private void BindGrid()
+ {
+ string strSql = "SELECT InterFaceSetId,InterFaceName,InterFaceForUrl,InterFaceUrl,Unit.UnitName as UnitId,AuthUnitName,IsOpen,ValidPeriod,TxtRemarks FROM InterFaceSet"
++ @" AS FaceSet LEFT JOIN Base_Unit AS Unit ON Unit.UnitId = FaceSet.UnitId where 1=1 ";
+
+ List listStr = new List();
+ if (!string.IsNullOrEmpty(this.txtUserName.Text.Trim()))
+ {
+ strSql += " AND InterFaceName LIKE @UserName";
+ listStr.Add(new SqlParameter("@UserName", "%" + this.txtUserName.Text.Trim() + "%"));
+ }
+ if (!string.IsNullOrEmpty(this.txtUnitName.Text.Trim()))
+ {
+ strSql += " AND UnitName LIKE @UnitName";
+ listStr.Add(new SqlParameter("@UnitName", "%" + this.txtUnitName.Text.Trim() + "%"));
+ }
+ if (this.cbRoleCategory.Items[0].Selected)
+ {
+ strSql += " AND IsOpen = @IsOpen";
+ listStr.Add(new SqlParameter("@IsOpen", this.cbRoleCategory.Items[0].Selected));
+ }
+
+ SqlParameter[] parameter = listStr.ToArray();
+ DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
+
+ // 2.获取当前分页数据
+ //var table = this.GetPagedDataTable(Grid1, tb1);
+ Grid1.RecordCount = tb.Rows.Count;
+ var table = this.GetPagedDataTable(Grid1, tb);
+ Grid1.DataSource = table;
+ Grid1.DataBind();
+ }
+
+ #region 获取按钮权限
+ ///
+ /// 获取按钮权限
+ ///
+ ///
+ ///
+ private void GetButtonPower()
+ {
+ if (this.CurrUser != null)
+ {
+ var buttonList = BLL.CommonService.GetAllButtonList(null,this.CurrUser.PersonId, BLL.Const.InterFaceSetMenuId);
+ if (buttonList.Count() > 0)
+ {
+ if (buttonList.Contains(BLL.Const.BtnAdd))
+ {
+ this.btnNew.Hidden = false;
+ }
+ if (buttonList.Contains(BLL.Const.BtnModify))
+ {
+ this.btnEdit.Hidden = false;
+ this.btnMenuEdit.Hidden = false;
+ }
+ if (buttonList.Contains(BLL.Const.BtnDelete))
+ {
+ this.btnDelete.Hidden = false;
+ this.btnMenuDelete.Hidden = false;
+ }
+ }
+ }
+ }
+ #endregion
+
+ #region 删除数据
+ ///
+ /// 批量删除数据
+ ///
+ ///
+ ///
+ protected void btnDelete_Click(object sender, EventArgs e)
+ {
+ this.DeleteData();
+ }
+ protected void btnStart_Click(object sender, EventArgs e)
+ {
+ Model.SGGLDB db = Funs.DB;
+ List FaceList = db.InterFaceSet.Where(p=>p.IsOpen==true).ToList();
+ foreach(var item in FaceList)
+ {
+ // if (!string.IsNullOrEmpty(item.InterFaceUrl))
+ // APIServiceTimer.GetApiData(item.InterFaceSetId, item.InterFaceUrl);
+ }
+ }
+
+ protected void btnFor_Click(object sender, EventArgs e)
+ {
+ Model.SGGLDB db = Funs.DB;
+ List FaceList = db.InterFaceSet.Where(p => p.IsOpen == true).ToList();
+ foreach (var item in FaceList)
+ {
+ // if (!string.IsNullOrEmpty(item.InterFaceForUrl))
+ // APIServiceTimer.UpApiData(item.InterFaceSetId, item.InterFaceForUrl, item.IsReqPost);
+ }
+ }
+ ///
+ /// 右键删除事件
+ ///
+ ///
+ ///
+ protected void btnMenuDelete_Click(object sender, EventArgs e)
+ {
+ this.DeleteData();
+ }
+
+ ///
+ /// 删除方法
+ ///
+ private void DeleteData()
+ {
+ if (Grid1.SelectedRowIndexArray.Length > 0)
+ {
+ foreach (int rowIndex in Grid1.SelectedRowIndexArray)
+ {
+ string rowID = Grid1.DataKeys[rowIndex][0].ToString();
+ if (judgementDelete(rowID, false))
+ {
+ BLL.InterFaceSetService.DeleteInterFaceSetById(rowID);
+ BLL.LogService.AddLog(this.CurrUser.PersonId, "删除接口信息");
+ }
+ }
+ BindGrid();
+ ShowNotify("删除数据成功!(表格数据已重新绑定)");
+ }
+ }
+ #endregion
+
+ #region 分页
+ ///
+ /// 分页
+ ///
+ ///
+ ///
+ protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
+ {
+ Grid1.PageIndex = e.NewPageIndex;
+ BindGrid();
+ }
+
+ ///
+ /// 分页显示条数下拉框
+ ///
+ ///
+ ///
+ protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
+ BindGrid();
+ }
+ #endregion
+
+ ///
+ /// 排序
+ ///
+ ///
+ ///
+ protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
+ {
+ Grid1.SortDirection = e.SortDirection;
+ Grid1.SortField = e.SortField;
+ BindGrid();
+ }
+
+ ///
+ /// 关闭窗口
+ ///
+ ///
+ ///
+ protected void Window1_Close(object sender, EventArgs e)
+ {
+ BindGrid();
+ }
+
+ ///
+ /// 选择行事件
+ ///
+ ///
+ ///
+ protected void btnSelectRows_Click(object sender, EventArgs e)
+ {
+
+ }
+
+ ///
+ /// 编辑
+ ///
+ ///
+ ///
+ protected void btnEdit_Click(object sender, EventArgs e)
+ {
+ this.EditData();
+ }
+
+ ///
+ /// Grid行双击事件
+ ///
+ ///
+ ///
+ protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
+ {
+ this.EditData();
+ }
+
+ ///
+ /// 右键编辑事件
+ ///
+ ///
+ ///
+ protected void btnMenuEdit_Click(object sender, EventArgs e)
+ {
+ this.EditData();
+ }
+
+ ///
+ /// 编辑数据方法
+ ///
+ private void EditData()
+ {
+ if (Grid1.SelectedRowIndexArray.Length == 0)
+ {
+ Alert.ShowInParent("请至少选择一条记录!", MessageBoxIcon.Warning);
+ return;
+ }
+ string Id = Grid1.SelectedRowID;
+ PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InterFaceEdit.aspx?InterFaceSetId={0}", Id, "编辑 - ")));
+ }
+
+ #region 判断是否可删除
+ ///
+ /// 判断是否可以删除
+ ///
+ ///
+ private bool judgementDelete(string id, bool isShow)
+ {
+ return false;
+ }
+ //private bool judgementDelete(string id, bool isShow)
+ //{
+ // string content = string.Empty;
+ // if (Funs.DB.Law_LawRegulationList.FirstOrDefault(x => x.CompileMan == id) != null)
+ // {
+ // content = "该用户已在【法律法规】中使用,不能删除!";
+ // }
+ // if (Funs.DB.Law_HSSEStandardsList.FirstOrDefault(x => x.CompileMan == id) != null)
+ // {
+ // content = "该用户已在【标准规范】中使用,不能删除!";
+ // }
+ // if (Funs.DB.Edu_Online_Examinee.FirstOrDefault(x => x.UserId == id) != null)
+ // {
+ // content = "该用户已在【考生信息】中使用,不能删除!";
+ // }
+ // if (string.IsNullOrEmpty(content))
+ // {
+ // return true;
+ // }
+ // else
+ // {
+ // if (isShow)
+ // {
+ // Alert.ShowInTop(content);
+ // }
+ // return false;
+ // }
+ //}
+ #endregion
+
+ #region 查询
+ ///
+ /// 用户类别选择
+ ///
+ ///
+ ///
+ protected void cbRoleCategory_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ this.BindGrid();
+ }
+
+ ///
+ /// 查询
+ ///
+ ///
+ ///
+ protected void TextBox_TextChanged(object sender, EventArgs e)
+ {
+ this.BindGrid();
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceSet.aspx.designer.cs b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceSet.aspx.designer.cs
new file mode 100644
index 00000000..96df2a77
--- /dev/null
+++ b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceSet.aspx.designer.cs
@@ -0,0 +1,242 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace FineUIPro.Web.InterFace
+{
+
+
+ public partial class InterFaceSet
+ {
+
+ ///
+ /// 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;
+
+ ///
+ /// Toolbar1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Toolbar Toolbar1;
+
+ ///
+ /// txtUserName 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtUserName;
+
+ ///
+ /// txtUnitName 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtUnitName;
+
+ ///
+ /// cbRoleCategory 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.CheckBoxList cbRoleCategory;
+
+ ///
+ /// ToolbarFill1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarFill ToolbarFill1;
+
+ ///
+ /// btnNew 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnNew;
+
+ ///
+ /// btnEdit 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnEdit;
+
+ ///
+ /// btnDelete 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnDelete;
+
+ ///
+ /// Button1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button Button1;
+
+ ///
+ /// Button2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button Button2;
+
+ ///
+ /// Label2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.WebControls.Label Label2;
+
+ ///
+ /// Label4 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.WebControls.Label Label4;
+
+ ///
+ /// Label1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.WebControls.Label Label1;
+
+ ///
+ /// lbContactInformation 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.WebControls.Label lbContactInformation;
+
+ ///
+ /// ToolbarSeparator1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
+
+ ///
+ /// ToolbarText1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarText ToolbarText1;
+
+ ///
+ /// ddlPageSize 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList ddlPageSize;
+
+ ///
+ /// Window1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Window Window1;
+
+ ///
+ /// Menu1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Menu Menu1;
+
+ ///
+ /// btnMenuEdit 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.MenuButton btnMenuEdit;
+
+ ///
+ /// btnMenuDelete 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.MenuButton btnMenuDelete;
+ }
+}
diff --git a/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceTask.aspx b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceTask.aspx
new file mode 100644
index 00000000..ff4b95d6
--- /dev/null
+++ b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceTask.aspx
@@ -0,0 +1,111 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InterFaceTask.aspx.cs" Inherits="FineUIPro.Web.InterFace.InterFaceTask" %>
+
+
+
+
+ 接口数据信息
+
+
+
+
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceTask.aspx.cs b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceTask.aspx.cs
new file mode 100644
index 00000000..1840cff5
--- /dev/null
+++ b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceTask.aspx.cs
@@ -0,0 +1,238 @@
+namespace FineUIPro.Web.InterFace
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Data;
+ using System.Data.SqlClient;
+ using System.Linq;
+ using BLL;
+
+ public partial class InterFaceTask : PageBase
+ {
+ ///
+ /// 加载页面
+ ///
+ ///
+ ///
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ btnNew.OnClientClick = Window1.GetShowReference("InterFaceTaskEdit.aspx", "接口任务新增") + "return false;";
+
+ ////权限按钮方法
+ this.GetButtonPower();
+ ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
+ // 绑定表格
+ BindGrid();
+ }
+ }
+
+ ///
+ /// 绑定数据
+ ///
+ private void BindGrid()
+ {
+ Model.InterFaceTask interFaceTask=new Model.InterFaceTask();
+ interFaceTask.InterFaceName = txtInterFaceName.Text;
+ var q= BLL.InterFaceTaskService.GetInterFaceTaskByModle(interFaceTask);
+ Grid1.DataSource = q;
+ Grid1.DataBind();
+ }
+
+ #region 获取按钮权限
+ ///
+ /// 获取按钮权限
+ ///
+ ///
+ ///
+ private void GetButtonPower()
+ {
+ if (this.CurrUser != null)
+ {
+ var buttonList = BLL.CommonService.GetAllButtonList(null,this.CurrUser.PersonId, BLL.Const.InterFaceTaskMenuId);
+ if (buttonList.Count() > 0)
+ {
+ if (buttonList.Contains(BLL.Const.BtnModify))
+ {
+ //this.btnEdit.Hidden = false;
+ //this.btnMenuEdit.Hidden = false;
+ }
+ }
+ }
+ }
+ #endregion
+
+
+
+ #region 分页
+ ///
+ /// 分页
+ ///
+ ///
+ ///
+ protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
+ {
+ Grid1.PageIndex = e.NewPageIndex;
+ BindGrid();
+ }
+
+ ///
+ /// 分页显示条数下拉框
+ ///
+ ///
+ ///
+ protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
+ BindGrid();
+ }
+ #endregion
+
+ ///
+ /// 排序
+ ///
+ ///
+ ///
+ protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
+ {
+ Grid1.SortDirection = e.SortDirection;
+ Grid1.SortField = e.SortField;
+ BindGrid();
+ }
+
+ ///
+ /// 关闭窗口
+ ///
+ ///
+ ///
+ protected void Window1_Close(object sender, EventArgs e)
+ {
+ BindGrid();
+ }
+
+ ///
+ /// 选择行事件
+ ///
+ ///
+ ///
+ protected void btnSelectRows_Click(object sender, EventArgs e)
+ {
+
+ }
+
+ ///
+ /// 编辑
+ ///
+ ///
+ ///
+ protected void btnEdit_Click(object sender, EventArgs e)
+ {
+ this.EditData();
+ }
+
+ ///
+ /// Grid行双击事件
+ ///
+ ///
+ ///
+ protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
+ {
+ this.EditData();
+ }
+
+ ///
+ /// 右键编辑事件
+ ///
+ ///
+ ///
+ protected void btnMenuEdit_Click(object sender, EventArgs e)
+ {
+ this.EditData();
+ }
+
+ ///
+ /// 编辑数据方法
+ ///
+ private void EditData()
+ {
+ if (Grid1.SelectedRowIndexArray.Length == 0)
+ {
+ Alert.ShowInParent("请至少选择一条记录!", MessageBoxIcon.Warning);
+ return;
+ }
+ string Id = Grid1.SelectedRowID;
+ PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InterFaceTaskEdit.aspx?InterFaceTaskId={0}", Id, "编辑 - ")));
+ }
+
+ #region 判断是否可删除
+ ///
+ /// 判断是否可以删除
+ ///
+ ///
+ private bool judgementDelete(string id, bool isShow)
+ {
+ return false;
+ }
+ //private bool judgementDelete(string id, bool isShow)
+ //{
+ // string content = string.Empty;
+ // if (Funs.DB.Law_LawRegulationList.FirstOrDefault(x => x.CompileMan == id) != null)
+ // {
+ // content = "该用户已在【法律法规】中使用,不能删除!";
+ // }
+ // if (Funs.DB.Law_HSSEStandardsList.FirstOrDefault(x => x.CompileMan == id) != null)
+ // {
+ // content = "该用户已在【标准规范】中使用,不能删除!";
+ // }
+ // if (Funs.DB.Edu_Online_Examinee.FirstOrDefault(x => x.UserId == id) != null)
+ // {
+ // content = "该用户已在【考生信息】中使用,不能删除!";
+ // }
+ // if (string.IsNullOrEmpty(content))
+ // {
+ // return true;
+ // }
+ // else
+ // {
+ // if (isShow)
+ // {
+ // Alert.ShowInTop(content);
+ // }
+ // return false;
+ // }
+ //}
+ #endregion
+ protected void btnStart_Click(object sender, EventArgs e)
+ {
+ if (Grid1.SelectedRowIndexArray.Length == 0)
+ {
+ Alert.ShowInParent("请至少选择一条记录!", MessageBoxIcon.Warning);
+ return;
+ }
+ var Id = Grid1.SelectedRowID;
+ BLL.InterFaceTaskService.ExecuteTasks(Id);
+ }
+ #region 查询
+ ///
+ /// 用户类别选择
+ ///
+ ///
+ ///
+ protected void cbRoleCategory_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ this.BindGrid();
+ }
+
+ ///
+ /// 查询
+ ///
+ ///
+ ///
+ protected void TextBox_TextChanged(object sender, EventArgs e)
+ {
+ this.BindGrid();
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceTask.aspx.designer.cs b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceTask.aspx.designer.cs
new file mode 100644
index 00000000..5e985529
--- /dev/null
+++ b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceTask.aspx.designer.cs
@@ -0,0 +1,161 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace FineUIPro.Web.InterFace
+{
+
+
+ public partial class InterFaceTask
+ {
+
+ ///
+ /// 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;
+
+ ///
+ /// Toolbar1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Toolbar Toolbar1;
+
+ ///
+ /// txtInterFaceName 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtInterFaceName;
+
+ ///
+ /// btnNew 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnNew;
+
+ ///
+ /// ToolbarFill1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarFill ToolbarFill1;
+
+ ///
+ /// btnEdit 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnEdit;
+
+ ///
+ /// Button1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button Button1;
+
+ ///
+ /// ToolbarSeparator1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
+
+ ///
+ /// ToolbarText1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarText ToolbarText1;
+
+ ///
+ /// ddlPageSize 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList ddlPageSize;
+
+ ///
+ /// Window1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Window Window1;
+
+ ///
+ /// Menu1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Menu Menu1;
+
+ ///
+ /// btnMenuEdit 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.MenuButton btnMenuEdit;
+ }
+}
diff --git a/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceTaskEdit.aspx b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceTaskEdit.aspx
new file mode 100644
index 00000000..c1a306e0
--- /dev/null
+++ b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceTaskEdit.aspx
@@ -0,0 +1,80 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InterFaceTaskEdit.aspx.cs" Inherits="FineUIPro.Web.InterFace.InterFaceTaskEdit" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceTaskEdit.aspx.cs b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceTaskEdit.aspx.cs
new file mode 100644
index 00000000..5b830360
--- /dev/null
+++ b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceTaskEdit.aspx.cs
@@ -0,0 +1,113 @@
+using BLL;
+using Model;
+using Newtonsoft.Json.Linq;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace FineUIPro.Web.InterFace
+{
+ public partial class InterFaceTaskEdit : PageBase
+ {
+ public string InterFaceTaskId
+ {
+ get
+ {
+ return (string)ViewState["InterFaceTaskId"];
+ }
+ set
+ {
+ ViewState["InterFaceTaskId"] = value;
+ }
+ }
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack) {
+ this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
+ InterFaceTaskId = Request.Params["InterFaceTaskId"];
+ InterFaceSetService.InitInterFaceDropDownList(DropInterFaceSet, false);
+ BindGrid();
+ #region Grid1
+ // 删除选中单元格的客户端脚本
+ string deleteScript = GetDeleteScript();
+ JObject defaultObj = new JObject();
+ defaultObj.Add("InterFaceSetId", "");
+
+
+ // 在第一行新增一条数据
+ btnNew.OnClientClick = Grid1.GetAddNewRecordReference(defaultObj, true);
+ // 删除选中行按钮
+ btnDelete.OnClientClick = Grid1.GetNoSelectionAlertReference("请选择一条记录!") + deleteScript;
+ #endregion
+
+
+ }
+
+ }
+ private void BindGrid()
+ {
+ if (!string.IsNullOrEmpty(InterFaceTaskId))
+ {
+ var model = BLL.InterFaceTaskService.GetInterFaceTaskById(InterFaceTaskId);
+ txtFrequency.Text= model.Frequency;
+ txtInterFaceName.Text= model.InterFaceName;
+ IsEnable.Checked = (bool)model.Enable;
+ var a = model.InterFaceSetLists.Split(',');
+ var q = (from x in a select new { id = Guid.NewGuid().ToString(), InterFaceSetId = x.ToString() }).ToList();
+ Grid1.DataSource= q;
+ Grid1.DataBind();
+ }
+
+
+ }
+ protected void btnSave_Click(object sender, EventArgs e)
+ {
+ List list = new List();
+ JArray EditorArr = Grid1.GetMergedData();
+ if (EditorArr.Count > 0)
+ {
+ for (int i = 0; i < EditorArr.Count; i++)
+ {
+ JObject objects = (JObject)EditorArr[i];
+
+ list.Add(objects["values"]["InterFaceSetId"].ToString());
+ }
+ }
+
+ if (!string.IsNullOrEmpty(InterFaceTaskId))
+ {
+ var model=BLL.InterFaceTaskService.GetInterFaceTaskById(InterFaceTaskId);
+ model.InterFaceName=txtInterFaceName.Text;
+ model.Frequency = txtFrequency.Text;
+ model.InterFaceSetLists=string .Join(",", list);
+ model.CreateTime = DateTime.Now;
+ model.Enable = IsEnable.Checked;
+ InterFaceTaskService.UpdateInterFaceTask(model);
+ }
+ else
+ {
+ Model.InterFaceTask model =new Model.InterFaceTask();
+ model.InterFaceTaskId = SQLHelper.GetNewID(typeof(Model.InterFaceTask));
+ InterFaceTaskId = model.InterFaceTaskId;
+ model.InterFaceName = txtInterFaceName.Text;
+ model.Frequency = txtFrequency.Text;
+ model.InterFaceSetLists = string.Join(",", list);
+ model.CreateTime = DateTime.Now;
+ model.Enable = IsEnable.Checked;
+ InterFaceTaskService.AddInterFaceTask(model);
+ }
+ QuartzServices.SyncISchedulerById(InterFaceTaskId);
+ ShowNotify("保存成功!", MessageBoxIcon.Success);
+ PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
+
+ }
+ private string GetDeleteScript()
+ {
+ return Confirm.GetShowReference("确定删除当前数据吗?", String.Empty, MessageBoxIcon.Question, Grid1.GetDeleteSelectedRowsReference(), String.Empty);
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceTaskEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceTaskEdit.aspx.designer.cs
new file mode 100644
index 00000000..e9981a78
--- /dev/null
+++ b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceTaskEdit.aspx.designer.cs
@@ -0,0 +1,152 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace FineUIPro.Web.InterFace
+{
+
+
+ public partial class InterFaceTaskEdit
+ {
+
+ ///
+ /// form1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+ ///
+ /// PageManager1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.PageManager PageManager1;
+
+ ///
+ /// SimpleForm1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Form SimpleForm1;
+
+ ///
+ /// txtInterFaceName 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtInterFaceName;
+
+ ///
+ /// txtFrequency 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.NumberBox txtFrequency;
+
+ ///
+ /// IsEnable 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.CheckBox IsEnable;
+
+ ///
+ /// Grid1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Grid Grid1;
+
+ ///
+ /// Toolbar2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Toolbar Toolbar2;
+
+ ///
+ /// ToolbarFill1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarFill ToolbarFill1;
+
+ ///
+ /// btnNew 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnNew;
+
+ ///
+ /// btnDelete 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnDelete;
+
+ ///
+ /// DropInterFaceSet 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList DropInterFaceSet;
+
+ ///
+ /// Toolbar1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Toolbar Toolbar1;
+
+ ///
+ /// btnSave 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnSave;
+
+ ///
+ /// btnClose 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnClose;
+ }
+}
diff --git a/SGGL/FineUIPro.Web/ZHGL/DataSync/CQMSData_CQMSEdit.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/DataSync/CQMSData_CQMSEdit.aspx.cs
index c3710bb5..9178e1bd 100644
--- a/SGGL/FineUIPro.Web/ZHGL/DataSync/CQMSData_CQMSEdit.aspx.cs
+++ b/SGGL/FineUIPro.Web/ZHGL/DataSync/CQMSData_CQMSEdit.aspx.cs
@@ -288,7 +288,7 @@ namespace FineUIPro.Web.ZHGL.DataSync
{
if (!string.IsNullOrEmpty(this.Id))
{
- var responedata= CQMSDataService.PushCNCEC(Id);
+ var responedata= CQMSDataService.PushCncec(Id);
if (responedata.code==1)
{
ShowNotify("上报成功!");
diff --git a/SGGL/FineUIPro.Web/ZHGL/DataSync/HJGLData_HJGLEdit.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/DataSync/HJGLData_HJGLEdit.aspx.cs
index 5f95017e..d31cb828 100644
--- a/SGGL/FineUIPro.Web/ZHGL/DataSync/HJGLData_HJGLEdit.aspx.cs
+++ b/SGGL/FineUIPro.Web/ZHGL/DataSync/HJGLData_HJGLEdit.aspx.cs
@@ -188,7 +188,7 @@ namespace FineUIPro.Web.ZHGL.DataSync
{
if (!string.IsNullOrEmpty(this.Id))
{
- var responedata = HJGLData_HJGLService.PushCNCEC(Id);
+ var responedata = HJGLData_HJGLService.PushCncec(Id);
if (responedata.code == 1)
{
ShowNotify("上报成功!");
diff --git a/SGGL/FineUIPro.Web/ZHGL/DataSync/HSSEData_HSSE.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/DataSync/HSSEData_HSSE.aspx.cs
index e63fc2dd..c8b43d8e 100644
--- a/SGGL/FineUIPro.Web/ZHGL/DataSync/HSSEData_HSSE.aspx.cs
+++ b/SGGL/FineUIPro.Web/ZHGL/DataSync/HSSEData_HSSE.aspx.cs
@@ -30,8 +30,8 @@ namespace FineUIPro.Web.ZHGL.DataSync
private void BindGrid()
{
Model.HSSEData_HSSE table = new Model.HSSEData_HSSE();
- var tb = BLL.HSSEData_HSSEService.getListData(table, Grid1);
- Grid1.RecordCount = HSSEData_HSSEService.count;
+ var tb = BLL.HSSEData_HSSEService.GetListData(table, Grid1);
+ Grid1.RecordCount = HSSEData_HSSEService.Count;
//tb = GetFilteredTable(Grid1.FilteredData, tb);
Grid1.DataSource = tb;
Grid1.DataBind();
diff --git a/SGGL/FineUIPro.Web/ZHGL/DataSync/HSSEData_HSSEEdit.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/DataSync/HSSEData_HSSEEdit.aspx.cs
index 2eb22a49..0f618230 100644
--- a/SGGL/FineUIPro.Web/ZHGL/DataSync/HSSEData_HSSEEdit.aspx.cs
+++ b/SGGL/FineUIPro.Web/ZHGL/DataSync/HSSEData_HSSEEdit.aspx.cs
@@ -513,7 +513,7 @@ namespace FineUIPro.Web.ZHGL.DataSync
{
if (!string.IsNullOrEmpty(this.Id))
{
- var responedata = HSSEData_HSSEService.PushCNCEC(Id);
+ var responedata = HSSEData_HSSEService.PushCncec(Id);
if (responedata.code == 1)
{
ShowNotify("上报成功!");
diff --git a/SGGL/FineUIPro.Web/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HSSE.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HSSE.aspx.cs
index 60e90981..89e7a5e6 100644
--- a/SGGL/FineUIPro.Web/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HSSE.aspx.cs
+++ b/SGGL/FineUIPro.Web/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HSSE.aspx.cs
@@ -31,8 +31,8 @@ namespace FineUIPro.Web.ZHGL.DataSync.ProjectDataSync
{
Model.Project_HSSEData_HSSE table = new Model.Project_HSSEData_HSSE();
table.ProjectId = this.CurrUser.LoginProjectId;
- var tb = BLL.Project_HSSEData_HSSEService.getListData(table, Grid1);
- Grid1.RecordCount = Project_HSSEData_HSSEService.count;
+ var tb = BLL.Project_HSSEData_HSSEService.GetListData(table, Grid1);
+ Grid1.RecordCount = Project_HSSEData_HSSEService.Count;
//tb = GetFilteredTable(Grid1.FilteredData, tb);
Grid1.DataSource = tb;
Grid1.DataBind();
diff --git a/SGGL/FineUIPro.Web/common/Menu_SJTB.xml b/SGGL/FineUIPro.Web/common/Menu_SJTB.xml
new file mode 100644
index 00000000..a8eb7de7
--- /dev/null
+++ b/SGGL/FineUIPro.Web/common/Menu_SJTB.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml b/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml
index 77b39238..9bc36592 100644
--- a/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml
+++ b/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml
@@ -1,8 +1,12 @@
-
-
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/common/PageBase.cs b/SGGL/FineUIPro.Web/common/PageBase.cs
index c9340e4d..11e8c6c8 100644
--- a/SGGL/FineUIPro.Web/common/PageBase.cs
+++ b/SGGL/FineUIPro.Web/common/PageBase.cs
@@ -50,6 +50,23 @@ namespace FineUIPro.Web
protected override void OnInit(EventArgs e)
{
+ string url = HttpContext.Current.Request.Path;
+
+ string a = Request.ServerVariables["HTTP_REFERER"];
+ string Referer = Request.Headers["Referer"];
+
+ if (a == null)
+ {
+ bool IsDataShowPage = ConstValue.drpConstItemList(ConstValue.Group_InterfacePopup).FirstOrDefault(x => url.Contains(x.ConstValue)) != null;
+ bool IsSafeReferer = ConstValue.drpConstItemList(ConstValue.Group_SafeReferer).FirstOrDefault(x => x.ConstValue == url) != null;
+ if (!IsDataShowPage && !IsSafeReferer)
+ {
+ if (this.Page.Request.AppRelativeCurrentExecutionFilePath != "~/Login.aspx")
+ Response.Redirect("~/Login.aspx");
+ return;
+ }
+
+ }
var pm = PageManager.Instance;
if (pm != null)
{
diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs
index 329fd14f..4fe4194c 100644
--- a/SGGL/Model/Model.cs
+++ b/SGGL/Model/Model.cs
@@ -821,6 +821,15 @@ namespace Model
partial void InsertInformationProject_WorkSummaryReport(InformationProject_WorkSummaryReport instance);
partial void UpdateInformationProject_WorkSummaryReport(InformationProject_WorkSummaryReport instance);
partial void DeleteInformationProject_WorkSummaryReport(InformationProject_WorkSummaryReport instance);
+ partial void InsertInterFaceLog(InterFaceLog instance);
+ partial void UpdateInterFaceLog(InterFaceLog instance);
+ partial void DeleteInterFaceLog(InterFaceLog instance);
+ partial void InsertInterFaceSet(InterFaceSet instance);
+ partial void UpdateInterFaceSet(InterFaceSet instance);
+ partial void DeleteInterFaceSet(InterFaceSet instance);
+ partial void InsertInterFaceTask(InterFaceTask instance);
+ partial void UpdateInterFaceTask(InterFaceTask instance);
+ partial void DeleteInterFaceTask(InterFaceTask instance);
partial void InsertLaw_HSSEStandardsList(Law_HSSEStandardsList instance);
partial void UpdateLaw_HSSEStandardsList(Law_HSSEStandardsList instance);
partial void DeleteLaw_HSSEStandardsList(Law_HSSEStandardsList instance);
@@ -3840,6 +3849,30 @@ namespace Model
}
}
+ public System.Data.Linq.Table InterFaceLog
+ {
+ get
+ {
+ return this.GetTable();
+ }
+ }
+
+ public System.Data.Linq.Table InterFaceSet
+ {
+ get
+ {
+ return this.GetTable();
+ }
+ }
+
+ public System.Data.Linq.Table InterFaceTask
+ {
+ get
+ {
+ return this.GetTable();
+ }
+ }
+
public System.Data.Linq.Table Law_HSSEStandardsList
{
get
@@ -130823,6 +130856,912 @@ namespace Model
}
}
+ [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.InterFaceLog")]
+ public partial class InterFaceLog : INotifyPropertyChanging, INotifyPropertyChanged
+ {
+
+ private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+
+ private string _InterFaceLogId;
+
+ private string _UserId;
+
+ private string _UnitId;
+
+ private string _InterFaceName;
+
+ private string _InterFaceUrl;
+
+ private string _InterFaceMehtod;
+
+ private string _InterFaceBody;
+
+ private string _InterFaceReturnData;
+
+ private System.Nullable _InterFaceLogDate;
+
+ private string _InterFaceType;
+
+ private System.Nullable _LogSate;
+
+ private string _IP;
+
+ #region 可扩展性方法定义
+ partial void OnLoaded();
+ partial void OnValidate(System.Data.Linq.ChangeAction action);
+ partial void OnCreated();
+ partial void OnInterFaceLogIdChanging(string value);
+ partial void OnInterFaceLogIdChanged();
+ partial void OnUserIdChanging(string value);
+ partial void OnUserIdChanged();
+ partial void OnUnitIdChanging(string value);
+ partial void OnUnitIdChanged();
+ partial void OnInterFaceNameChanging(string value);
+ partial void OnInterFaceNameChanged();
+ partial void OnInterFaceUrlChanging(string value);
+ partial void OnInterFaceUrlChanged();
+ partial void OnInterFaceMehtodChanging(string value);
+ partial void OnInterFaceMehtodChanged();
+ partial void OnInterFaceBodyChanging(string value);
+ partial void OnInterFaceBodyChanged();
+ partial void OnInterFaceReturnDataChanging(string value);
+ partial void OnInterFaceReturnDataChanged();
+ partial void OnInterFaceLogDateChanging(System.Nullable value);
+ partial void OnInterFaceLogDateChanged();
+ partial void OnInterFaceTypeChanging(string value);
+ partial void OnInterFaceTypeChanged();
+ partial void OnLogSateChanging(System.Nullable value);
+ partial void OnLogSateChanged();
+ partial void OnIPChanging(string value);
+ partial void OnIPChanged();
+ #endregion
+
+ public InterFaceLog()
+ {
+ OnCreated();
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InterFaceLogId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
+ public string InterFaceLogId
+ {
+ get
+ {
+ return this._InterFaceLogId;
+ }
+ set
+ {
+ if ((this._InterFaceLogId != value))
+ {
+ this.OnInterFaceLogIdChanging(value);
+ this.SendPropertyChanging();
+ this._InterFaceLogId = value;
+ this.SendPropertyChanged("InterFaceLogId");
+ this.OnInterFaceLogIdChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="NVarChar(50)")]
+ public string UserId
+ {
+ get
+ {
+ return this._UserId;
+ }
+ set
+ {
+ if ((this._UserId != value))
+ {
+ this.OnUserIdChanging(value);
+ this.SendPropertyChanging();
+ this._UserId = value;
+ this.SendPropertyChanged("UserId");
+ this.OnUserIdChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitId", DbType="NVarChar(50)")]
+ public string UnitId
+ {
+ get
+ {
+ return this._UnitId;
+ }
+ set
+ {
+ if ((this._UnitId != value))
+ {
+ this.OnUnitIdChanging(value);
+ this.SendPropertyChanging();
+ this._UnitId = value;
+ this.SendPropertyChanged("UnitId");
+ this.OnUnitIdChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InterFaceName", DbType="NChar(10)")]
+ public string InterFaceName
+ {
+ get
+ {
+ return this._InterFaceName;
+ }
+ set
+ {
+ if ((this._InterFaceName != value))
+ {
+ this.OnInterFaceNameChanging(value);
+ this.SendPropertyChanging();
+ this._InterFaceName = value;
+ this.SendPropertyChanged("InterFaceName");
+ this.OnInterFaceNameChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InterFaceUrl", DbType="VarChar(MAX)", UpdateCheck=UpdateCheck.Never)]
+ public string InterFaceUrl
+ {
+ get
+ {
+ return this._InterFaceUrl;
+ }
+ set
+ {
+ if ((this._InterFaceUrl != value))
+ {
+ this.OnInterFaceUrlChanging(value);
+ this.SendPropertyChanging();
+ this._InterFaceUrl = value;
+ this.SendPropertyChanged("InterFaceUrl");
+ this.OnInterFaceUrlChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InterFaceMehtod", DbType="NChar(10)")]
+ public string InterFaceMehtod
+ {
+ get
+ {
+ return this._InterFaceMehtod;
+ }
+ set
+ {
+ if ((this._InterFaceMehtod != value))
+ {
+ this.OnInterFaceMehtodChanging(value);
+ this.SendPropertyChanging();
+ this._InterFaceMehtod = value;
+ this.SendPropertyChanged("InterFaceMehtod");
+ this.OnInterFaceMehtodChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InterFaceBody", DbType="VarChar(MAX)", UpdateCheck=UpdateCheck.Never)]
+ public string InterFaceBody
+ {
+ get
+ {
+ return this._InterFaceBody;
+ }
+ set
+ {
+ if ((this._InterFaceBody != value))
+ {
+ this.OnInterFaceBodyChanging(value);
+ this.SendPropertyChanging();
+ this._InterFaceBody = value;
+ this.SendPropertyChanged("InterFaceBody");
+ this.OnInterFaceBodyChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InterFaceReturnData", DbType="VarChar(MAX)", UpdateCheck=UpdateCheck.Never)]
+ public string InterFaceReturnData
+ {
+ get
+ {
+ return this._InterFaceReturnData;
+ }
+ set
+ {
+ if ((this._InterFaceReturnData != value))
+ {
+ this.OnInterFaceReturnDataChanging(value);
+ this.SendPropertyChanging();
+ this._InterFaceReturnData = value;
+ this.SendPropertyChanged("InterFaceReturnData");
+ this.OnInterFaceReturnDataChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InterFaceLogDate", DbType="DateTime")]
+ public System.Nullable InterFaceLogDate
+ {
+ get
+ {
+ return this._InterFaceLogDate;
+ }
+ set
+ {
+ if ((this._InterFaceLogDate != value))
+ {
+ this.OnInterFaceLogDateChanging(value);
+ this.SendPropertyChanging();
+ this._InterFaceLogDate = value;
+ this.SendPropertyChanged("InterFaceLogDate");
+ this.OnInterFaceLogDateChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InterFaceType", DbType="NVarChar(50)")]
+ public string InterFaceType
+ {
+ get
+ {
+ return this._InterFaceType;
+ }
+ set
+ {
+ if ((this._InterFaceType != value))
+ {
+ this.OnInterFaceTypeChanging(value);
+ this.SendPropertyChanging();
+ this._InterFaceType = value;
+ this.SendPropertyChanged("InterFaceType");
+ this.OnInterFaceTypeChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LogSate", DbType="Bit")]
+ public System.Nullable LogSate
+ {
+ get
+ {
+ return this._LogSate;
+ }
+ set
+ {
+ if ((this._LogSate != value))
+ {
+ this.OnLogSateChanging(value);
+ this.SendPropertyChanging();
+ this._LogSate = value;
+ this.SendPropertyChanged("LogSate");
+ this.OnLogSateChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IP", DbType="NVarChar(50)")]
+ public string IP
+ {
+ get
+ {
+ return this._IP;
+ }
+ set
+ {
+ if ((this._IP != value))
+ {
+ this.OnIPChanging(value);
+ this.SendPropertyChanging();
+ this._IP = value;
+ this.SendPropertyChanged("IP");
+ this.OnIPChanged();
+ }
+ }
+ }
+
+ public event PropertyChangingEventHandler PropertyChanging;
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ protected virtual void SendPropertyChanging()
+ {
+ if ((this.PropertyChanging != null))
+ {
+ this.PropertyChanging(this, emptyChangingEventArgs);
+ }
+ }
+
+ protected virtual void SendPropertyChanged(String propertyName)
+ {
+ if ((this.PropertyChanged != null))
+ {
+ this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.InterFaceSet")]
+ public partial class InterFaceSet : INotifyPropertyChanging, INotifyPropertyChanged
+ {
+
+ private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+
+ private string _InterFaceSetId;
+
+ private string _InterFaceName;
+
+ private string _InterFaceUrl;
+
+ private string _UrlReqMethod;
+
+ private string _UnitId;
+
+ private string _AuthUnitIds;
+
+ private string _AuthUnitName;
+
+ private System.Nullable _IsOpen;
+
+ private string _ValidPeriod;
+
+ private string _TxtRemarks;
+
+ private string _InterFaceForUrl;
+
+ private string _ForUrlReqMethod;
+
+ private System.Nullable _IsCallBack;
+
+ private string _InterFaceCallBackUrl;
+
+ private string _CallBackUrlReqMethod;
+
+ #region 可扩展性方法定义
+ partial void OnLoaded();
+ partial void OnValidate(System.Data.Linq.ChangeAction action);
+ partial void OnCreated();
+ partial void OnInterFaceSetIdChanging(string value);
+ partial void OnInterFaceSetIdChanged();
+ partial void OnInterFaceNameChanging(string value);
+ partial void OnInterFaceNameChanged();
+ partial void OnInterFaceUrlChanging(string value);
+ partial void OnInterFaceUrlChanged();
+ partial void OnUrlReqMethodChanging(string value);
+ partial void OnUrlReqMethodChanged();
+ partial void OnUnitIdChanging(string value);
+ partial void OnUnitIdChanged();
+ partial void OnAuthUnitIdsChanging(string value);
+ partial void OnAuthUnitIdsChanged();
+ partial void OnAuthUnitNameChanging(string value);
+ partial void OnAuthUnitNameChanged();
+ partial void OnIsOpenChanging(System.Nullable value);
+ partial void OnIsOpenChanged();
+ partial void OnValidPeriodChanging(string value);
+ partial void OnValidPeriodChanged();
+ partial void OnTxtRemarksChanging(string value);
+ partial void OnTxtRemarksChanged();
+ partial void OnInterFaceForUrlChanging(string value);
+ partial void OnInterFaceForUrlChanged();
+ partial void OnForUrlReqMethodChanging(string value);
+ partial void OnForUrlReqMethodChanged();
+ partial void OnIsCallBackChanging(System.Nullable value);
+ partial void OnIsCallBackChanged();
+ partial void OnInterFaceCallBackUrlChanging(string value);
+ partial void OnInterFaceCallBackUrlChanged();
+ partial void OnCallBackUrlReqMethodChanging(string value);
+ partial void OnCallBackUrlReqMethodChanged();
+ #endregion
+
+ public InterFaceSet()
+ {
+ OnCreated();
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InterFaceSetId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
+ public string InterFaceSetId
+ {
+ get
+ {
+ return this._InterFaceSetId;
+ }
+ set
+ {
+ if ((this._InterFaceSetId != value))
+ {
+ this.OnInterFaceSetIdChanging(value);
+ this.SendPropertyChanging();
+ this._InterFaceSetId = value;
+ this.SendPropertyChanged("InterFaceSetId");
+ this.OnInterFaceSetIdChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InterFaceName", DbType="NVarChar(100)")]
+ public string InterFaceName
+ {
+ get
+ {
+ return this._InterFaceName;
+ }
+ set
+ {
+ if ((this._InterFaceName != value))
+ {
+ this.OnInterFaceNameChanging(value);
+ this.SendPropertyChanging();
+ this._InterFaceName = value;
+ this.SendPropertyChanged("InterFaceName");
+ this.OnInterFaceNameChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InterFaceUrl", DbType="NVarChar(500)")]
+ public string InterFaceUrl
+ {
+ get
+ {
+ return this._InterFaceUrl;
+ }
+ set
+ {
+ if ((this._InterFaceUrl != value))
+ {
+ this.OnInterFaceUrlChanging(value);
+ this.SendPropertyChanging();
+ this._InterFaceUrl = value;
+ this.SendPropertyChanged("InterFaceUrl");
+ this.OnInterFaceUrlChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UrlReqMethod", DbType="VarChar(50)")]
+ public string UrlReqMethod
+ {
+ get
+ {
+ return this._UrlReqMethod;
+ }
+ set
+ {
+ if ((this._UrlReqMethod != value))
+ {
+ this.OnUrlReqMethodChanging(value);
+ this.SendPropertyChanging();
+ this._UrlReqMethod = value;
+ this.SendPropertyChanged("UrlReqMethod");
+ this.OnUrlReqMethodChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitId", DbType="NVarChar(50)")]
+ public string UnitId
+ {
+ get
+ {
+ return this._UnitId;
+ }
+ set
+ {
+ if ((this._UnitId != value))
+ {
+ this.OnUnitIdChanging(value);
+ this.SendPropertyChanging();
+ this._UnitId = value;
+ this.SendPropertyChanged("UnitId");
+ this.OnUnitIdChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AuthUnitIds", DbType="NVarChar(1020)")]
+ public string AuthUnitIds
+ {
+ get
+ {
+ return this._AuthUnitIds;
+ }
+ set
+ {
+ if ((this._AuthUnitIds != value))
+ {
+ this.OnAuthUnitIdsChanging(value);
+ this.SendPropertyChanging();
+ this._AuthUnitIds = value;
+ this.SendPropertyChanged("AuthUnitIds");
+ this.OnAuthUnitIdsChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AuthUnitName", DbType="NVarChar(2000)")]
+ public string AuthUnitName
+ {
+ get
+ {
+ return this._AuthUnitName;
+ }
+ set
+ {
+ if ((this._AuthUnitName != value))
+ {
+ this.OnAuthUnitNameChanging(value);
+ this.SendPropertyChanging();
+ this._AuthUnitName = value;
+ this.SendPropertyChanged("AuthUnitName");
+ this.OnAuthUnitNameChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsOpen", DbType="Bit")]
+ public System.Nullable IsOpen
+ {
+ get
+ {
+ return this._IsOpen;
+ }
+ set
+ {
+ if ((this._IsOpen != value))
+ {
+ this.OnIsOpenChanging(value);
+ this.SendPropertyChanging();
+ this._IsOpen = value;
+ this.SendPropertyChanged("IsOpen");
+ this.OnIsOpenChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ValidPeriod", DbType="NVarChar(20)")]
+ public string ValidPeriod
+ {
+ get
+ {
+ return this._ValidPeriod;
+ }
+ set
+ {
+ if ((this._ValidPeriod != value))
+ {
+ this.OnValidPeriodChanging(value);
+ this.SendPropertyChanging();
+ this._ValidPeriod = value;
+ this.SendPropertyChanged("ValidPeriod");
+ this.OnValidPeriodChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TxtRemarks", DbType="NVarChar(2000)")]
+ public string TxtRemarks
+ {
+ get
+ {
+ return this._TxtRemarks;
+ }
+ set
+ {
+ if ((this._TxtRemarks != value))
+ {
+ this.OnTxtRemarksChanging(value);
+ this.SendPropertyChanging();
+ this._TxtRemarks = value;
+ this.SendPropertyChanged("TxtRemarks");
+ this.OnTxtRemarksChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InterFaceForUrl", DbType="NVarChar(500)")]
+ public string InterFaceForUrl
+ {
+ get
+ {
+ return this._InterFaceForUrl;
+ }
+ set
+ {
+ if ((this._InterFaceForUrl != value))
+ {
+ this.OnInterFaceForUrlChanging(value);
+ this.SendPropertyChanging();
+ this._InterFaceForUrl = value;
+ this.SendPropertyChanged("InterFaceForUrl");
+ this.OnInterFaceForUrlChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ForUrlReqMethod", DbType="VarChar(50)")]
+ public string ForUrlReqMethod
+ {
+ get
+ {
+ return this._ForUrlReqMethod;
+ }
+ set
+ {
+ if ((this._ForUrlReqMethod != value))
+ {
+ this.OnForUrlReqMethodChanging(value);
+ this.SendPropertyChanging();
+ this._ForUrlReqMethod = value;
+ this.SendPropertyChanged("ForUrlReqMethod");
+ this.OnForUrlReqMethodChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsCallBack", DbType="Bit")]
+ public System.Nullable IsCallBack
+ {
+ get
+ {
+ return this._IsCallBack;
+ }
+ set
+ {
+ if ((this._IsCallBack != value))
+ {
+ this.OnIsCallBackChanging(value);
+ this.SendPropertyChanging();
+ this._IsCallBack = value;
+ this.SendPropertyChanged("IsCallBack");
+ this.OnIsCallBackChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InterFaceCallBackUrl", DbType="NVarChar(500)")]
+ public string InterFaceCallBackUrl
+ {
+ get
+ {
+ return this._InterFaceCallBackUrl;
+ }
+ set
+ {
+ if ((this._InterFaceCallBackUrl != value))
+ {
+ this.OnInterFaceCallBackUrlChanging(value);
+ this.SendPropertyChanging();
+ this._InterFaceCallBackUrl = value;
+ this.SendPropertyChanged("InterFaceCallBackUrl");
+ this.OnInterFaceCallBackUrlChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CallBackUrlReqMethod", DbType="VarChar(50)")]
+ public string CallBackUrlReqMethod
+ {
+ get
+ {
+ return this._CallBackUrlReqMethod;
+ }
+ set
+ {
+ if ((this._CallBackUrlReqMethod != value))
+ {
+ this.OnCallBackUrlReqMethodChanging(value);
+ this.SendPropertyChanging();
+ this._CallBackUrlReqMethod = value;
+ this.SendPropertyChanged("CallBackUrlReqMethod");
+ this.OnCallBackUrlReqMethodChanged();
+ }
+ }
+ }
+
+ public event PropertyChangingEventHandler PropertyChanging;
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ protected virtual void SendPropertyChanging()
+ {
+ if ((this.PropertyChanging != null))
+ {
+ this.PropertyChanging(this, emptyChangingEventArgs);
+ }
+ }
+
+ protected virtual void SendPropertyChanged(String propertyName)
+ {
+ if ((this.PropertyChanged != null))
+ {
+ this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.InterFaceTask")]
+ public partial class InterFaceTask : INotifyPropertyChanging, INotifyPropertyChanged
+ {
+
+ private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+
+ private string _InterFaceTaskId;
+
+ private string _InterFaceName;
+
+ private string _InterFaceSetLists;
+
+ private string _Frequency;
+
+ private System.Nullable _CreateTime;
+
+ private System.Nullable _Enable;
+
+ #region 可扩展性方法定义
+ partial void OnLoaded();
+ partial void OnValidate(System.Data.Linq.ChangeAction action);
+ partial void OnCreated();
+ partial void OnInterFaceTaskIdChanging(string value);
+ partial void OnInterFaceTaskIdChanged();
+ partial void OnInterFaceNameChanging(string value);
+ partial void OnInterFaceNameChanged();
+ partial void OnInterFaceSetListsChanging(string value);
+ partial void OnInterFaceSetListsChanged();
+ partial void OnFrequencyChanging(string value);
+ partial void OnFrequencyChanged();
+ partial void OnCreateTimeChanging(System.Nullable value);
+ partial void OnCreateTimeChanged();
+ partial void OnEnableChanging(System.Nullable value);
+ partial void OnEnableChanged();
+ #endregion
+
+ public InterFaceTask()
+ {
+ OnCreated();
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InterFaceTaskId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
+ public string InterFaceTaskId
+ {
+ get
+ {
+ return this._InterFaceTaskId;
+ }
+ set
+ {
+ if ((this._InterFaceTaskId != value))
+ {
+ this.OnInterFaceTaskIdChanging(value);
+ this.SendPropertyChanging();
+ this._InterFaceTaskId = value;
+ this.SendPropertyChanged("InterFaceTaskId");
+ this.OnInterFaceTaskIdChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InterFaceName", DbType="NVarChar(100)")]
+ public string InterFaceName
+ {
+ get
+ {
+ return this._InterFaceName;
+ }
+ set
+ {
+ if ((this._InterFaceName != value))
+ {
+ this.OnInterFaceNameChanging(value);
+ this.SendPropertyChanging();
+ this._InterFaceName = value;
+ this.SendPropertyChanged("InterFaceName");
+ this.OnInterFaceNameChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InterFaceSetLists", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)]
+ public string InterFaceSetLists
+ {
+ get
+ {
+ return this._InterFaceSetLists;
+ }
+ set
+ {
+ if ((this._InterFaceSetLists != value))
+ {
+ this.OnInterFaceSetListsChanging(value);
+ this.SendPropertyChanging();
+ this._InterFaceSetLists = value;
+ this.SendPropertyChanged("InterFaceSetLists");
+ this.OnInterFaceSetListsChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Frequency", DbType="NChar(10)")]
+ public string Frequency
+ {
+ get
+ {
+ return this._Frequency;
+ }
+ set
+ {
+ if ((this._Frequency != value))
+ {
+ this.OnFrequencyChanging(value);
+ this.SendPropertyChanging();
+ this._Frequency = value;
+ this.SendPropertyChanged("Frequency");
+ this.OnFrequencyChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CreateTime", DbType="DateTime")]
+ public System.Nullable CreateTime
+ {
+ get
+ {
+ return this._CreateTime;
+ }
+ set
+ {
+ if ((this._CreateTime != value))
+ {
+ this.OnCreateTimeChanging(value);
+ this.SendPropertyChanging();
+ this._CreateTime = value;
+ this.SendPropertyChanged("CreateTime");
+ this.OnCreateTimeChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Enable", DbType="Bit")]
+ public System.Nullable Enable
+ {
+ get
+ {
+ return this._Enable;
+ }
+ set
+ {
+ if ((this._Enable != value))
+ {
+ this.OnEnableChanging(value);
+ this.SendPropertyChanging();
+ this._Enable = value;
+ this.SendPropertyChanged("Enable");
+ this.OnEnableChanged();
+ }
+ }
+ }
+
+ public event PropertyChangingEventHandler PropertyChanging;
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ protected virtual void SendPropertyChanging()
+ {
+ if ((this.PropertyChanging != null))
+ {
+ this.PropertyChanging(this, emptyChangingEventArgs);
+ }
+ }
+
+ protected virtual void SendPropertyChanged(String propertyName)
+ {
+ if ((this.PropertyChanged != null))
+ {
+ this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+ }
+
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Law_HSSEStandardsList")]
public partial class Law_HSSEStandardsList : INotifyPropertyChanging, INotifyPropertyChanged
{
@@ -233845,6 +234784,8 @@ namespace Model
private string _LogTxt;
+ private string _MeThod;
+
#region 可扩展性方法定义
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
@@ -233859,6 +234800,8 @@ namespace Model
partial void OnHttpUrlChanged();
partial void OnLogTxtChanging(string value);
partial void OnLogTxtChanged();
+ partial void OnMeThodChanging(string value);
+ partial void OnMeThodChanged();
#endregion
public Sys_HttpLog()
@@ -233966,6 +234909,26 @@ namespace Model
}
}
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MeThod", DbType="NVarChar(50)")]
+ public string MeThod
+ {
+ get
+ {
+ return this._MeThod;
+ }
+ set
+ {
+ if ((this._MeThod != value))
+ {
+ this.OnMeThodChanging(value);
+ this.SendPropertyChanging();
+ this._MeThod = value;
+ this.SendPropertyChanged("MeThod");
+ this.OnMeThodChanged();
+ }
+ }
+ }
+
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;
diff --git a/SGGL/WebAPI/Controllers/FileUploadController.cs b/SGGL/WebAPI/Controllers/FileUploadController.cs
index 57acff33..62b785bb 100644
--- a/SGGL/WebAPI/Controllers/FileUploadController.cs
+++ b/SGGL/WebAPI/Controllers/FileUploadController.cs
@@ -1,5 +1,6 @@
using BLL;
using System;
+using System.Collections.Generic;
using System.Configuration;
using System.Drawing;
using System.IO;
@@ -30,6 +31,9 @@ namespace WebAPI.Controllers
{
typeName = "WebApi";
}
+ // 定义允许上传的文件类型列表
+ List allowExtensions = BLL.DropListService.allowExtensions;
+
string reUrl = string.Empty;
if (files != null && files.Count > 0)
{
@@ -45,6 +49,10 @@ namespace WebAPI.Controllers
string fileName = string.Empty;
string extensionstr = string.Empty;
HttpPostedFile file = files[key];//file.ContentLength文件长度
+ if (!allowExtensions.Contains(Path.GetExtension(file.FileName)))
+ {
+ return BadRequest($"Invalid file extension: {file.FileName}");
+ }
if (!string.IsNullOrEmpty(file.FileName))
{
extensionstr = Path.GetExtension(file.FileName).ToLower();
@@ -139,6 +147,42 @@ namespace WebAPI.Controllers
return responeData;
}
#endregion
+
+ #region 附件上传
+ ///
+ /// 附件上传
+ ///
+ ///
+ public IHttpActionResult PostSmall()
+ {
+ HttpFileCollection files = HttpContext.Current.Request.Files;
+ string typeName = HttpContext.Current.Request["typeName"];
+ if (string.IsNullOrEmpty(typeName))
+ {
+ typeName = "WebApi";
+ }
+ string reUrl = string.Empty;
+ if (files != null && files.Count > 0)
+ {
+ string folderUrl = "FileUpLoad/" + typeName + "/" + DateTime.Now.ToString("yyyy-MM") + "/";
+ string localRoot = ConfigurationManager.AppSettings["localRoot"] + folderUrl; //物理路径
+ if (!Directory.Exists(localRoot))
+ {
+ Directory.CreateDirectory(localRoot);
+ }
+ foreach (string key in files.AllKeys)
+ {
+ HttpPostedFile file = files[key];//file.ContentLength文件长度
+ reUrl = UpLoadImageService.UpLoadImage(file, folderUrl, folderUrl + "Small/", 80, 30);
+ }
+ }
+
+ return Ok(reUrl);
+ }
+ #endregion
+
+ #region 在线编辑回调保存文件
+
///
/// 在线编辑回调保存文件
///
@@ -190,37 +234,7 @@ namespace WebAPI.Controllers
return responeData;
}
- #region 附件上传
- ///
- /// 附件上传
- ///
- ///
- public IHttpActionResult PostSmall()
- {
- HttpFileCollection files = HttpContext.Current.Request.Files;
- string typeName = HttpContext.Current.Request["typeName"];
- if (string.IsNullOrEmpty(typeName))
- {
- typeName = "WebApi";
- }
- string reUrl = string.Empty;
- if (files != null && files.Count > 0)
- {
- string folderUrl = "FileUpLoad/" + typeName + "/" + DateTime.Now.ToString("yyyy-MM") + "/";
- string localRoot = ConfigurationManager.AppSettings["localRoot"] + folderUrl; //物理路径
- if (!Directory.Exists(localRoot))
- {
- Directory.CreateDirectory(localRoot);
- }
- foreach (string key in files.AllKeys)
- {
- HttpPostedFile file = files[key];//file.ContentLength文件长度
- reUrl = UpLoadImageService.UpLoadImage(file, folderUrl, folderUrl + "Small/", 80, 30);
- }
- }
-
- return Ok(reUrl);
- }
#endregion
+
}
}
diff --git a/SGGL/WebAPI/Filter/TestPermissionAttribute.cs b/SGGL/WebAPI/Filter/TestPermissionAttribute.cs
index c9d21adb..a25b586d 100644
--- a/SGGL/WebAPI/Filter/TestPermissionAttribute.cs
+++ b/SGGL/WebAPI/Filter/TestPermissionAttribute.cs
@@ -3,6 +3,7 @@ using System.Linq;
using System.Net.Http;
using System.Web.Http.Controllers;
using System.Web.Http.Filters;
+using BLL;
namespace WebAPI.Filter
{
@@ -38,13 +39,33 @@ namespace WebAPI.Filter
}
// base.OnActionExecuting(actionContext);
if (isOk)
- {
+ { // 在调用 Action 方法之前执行的代码,可获取请求的接口名称和参数
+ IDictionary arguments = actionContext.ActionArguments; // 获取参数
+ foreach (KeyValuePair item in arguments)
+ {
+ if (item.Key == "projectid" || item.Key == "ProjectId" || item.Key == "projectId" || item.Key == "Projectid")
+ {
+ var ProjectItems = APIProjectService.geProjectsByUserId(token.FirstOrDefault());
+ List projects = new List();
+ if (ProjectItems.Count > 0)
+ {
+ projects = ProjectItems.Select(x => x.ProjectId).ToList();
+ }
+ if (item.Value != null && !projects.Contains(item.Value.ToString()))
+ {
+
+ actionContext.Response = actionContext.Request.CreateResponse(System.Net.HttpStatusCode.OK,
+ new { code = "0", message = "您没有该项目权限!" }, actionContext.ControllerContext.Configuration.Formatters.JsonFormatter);
+ return;
+ }
+ }
+ }
base.OnActionExecuting(actionContext);
}
else
{
actionContext.Response = actionContext.Request.CreateResponse(System.Net.HttpStatusCode.OK,
- new { code = "0", message = "您没有权限!" }, actionContext.ControllerContext.Configuration.Formatters.JsonFormatter);
+ new { code = "0", message = "您没有权限!" }, actionContext.ControllerContext.Configuration.Formatters.JsonFormatter);
}
}