diff --git a/.vs/SGGL_CWCEC/v17/.wsuo b/.vs/SGGL_CWCEC/v17/.wsuo
index 56372547..7a9829f7 100644
Binary files a/.vs/SGGL_CWCEC/v17/.wsuo and b/.vs/SGGL_CWCEC/v17/.wsuo differ
diff --git a/DataBase/版本日志/SGGLDB_WH_2023-08-10.sql b/DataBase/版本日志/SGGLDB_WH_2023-08-10.sql
new file mode 100644
index 00000000..165baecc
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_WH_2023-08-10.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/API/APIPersonService.cs b/SGGL/BLL/API/APIPersonService.cs
index c0139719..7000b083 100644
--- a/SGGL/BLL/API/APIPersonService.cs
+++ b/SGGL/BLL/API/APIPersonService.cs
@@ -1430,11 +1430,11 @@ namespace BLL
IdentityCard = x.IdentityCard,
ProjectId = x.ProjectId,
UnitId = x.UnitId,
- UnitName = db.Base_Unit.First(z => z.UnitId == x.UnitId).UnitName,
+ UnitName = db.Base_Unit.First(m => m.UnitId == x.UnitId).UnitName,
CertificateId = y.CertificateId,
- CertificateName = db.Base_Certificate.First(z => z.CertificateId == y.CertificateId).CertificateName,
+ CertificateName = db.Base_Certificate.First(m => m.CertificateId == y.CertificateId).CertificateName,
WorkPostId = x.WorkPostId,
- WorkPostName = db.Base_WorkPost.First(z => z.WorkPostId == x.WorkPostId).WorkPostName,
+ WorkPostName = db.Base_WorkPost.First(m => m.WorkPostId == x.WorkPostId).WorkPostName,
CertificateNo = y.CertificateNo,
Grade = y.Grade,
SendUnit = y.SendUnit,
@@ -1442,13 +1442,13 @@ namespace BLL
LimitDate = string.Format("{0:yyyy-MM-dd}", y.LimitDate),
LimitDateD = y.LimitDate,
LateCheckDate = string.Format("{0:yyyy-MM-dd}", y.LateCheckDate),
- ApprovalPerson = db.Sys_User.First(z => z.UserId == x.AuditorId).UserName,
+ ApprovalPerson = db.Sys_User.First(m => m.UserId == x.AuditorId).UserName,
Remark = y.Remark,
CompileMan = y.CompileMan,
- CompileManName = db.Sys_User.First(z => z.UserId == y.CompileMan).UserName,
+ CompileManName = db.Sys_User.First(m => m.UserId == y.CompileMan).UserName,
CompileDate = string.Format("{0:yyyy-MM-dd}", y.CompileDate),
AuditDate = string.Format("{0:yyyy-MM-dd}", y.AuditDate),
- AuditorName = db.Sys_User.First(z => z.UserId == x.AuditorId).UserName,
+ AuditorName = db.Sys_User.First(m => m.UserId == x.AuditorId).UserName,
AttachUrl = APIUpLoadFileService.getFileUrl(y.PersonQualityId, null),
}).ToList();
if (ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(projectId, unitId))
diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj
index 1772261c..64d358b1 100644
--- a/SGGL/BLL/BLL.csproj
+++ b/SGGL/BLL/BLL.csproj
@@ -59,6 +59,9 @@
..\packages\SharpZipLib.1.3.2\lib\net45\ICSharpCode.SharpZipLib.dll
+
+ ..\packages\Microsoft.Extensions.Logging.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll
+
False
@@ -81,18 +84,54 @@
..\packages\NPOI.2.5.5\lib\net45\NPOI.OpenXmlFormats.dll
+
+ ..\packages\Quartz.3.5.0\lib\netstandard2.0\Quartz.dll
+
..\packages\RestSharp.106.15.0\lib\net452\RestSharp.dll
+
+ ..\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
+
+
+ ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll
+
+
+
+
+ ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll
+
+
+ ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\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
+
+
+
@@ -103,6 +142,7 @@
..\FineUIPro\Reference BLL\ThoughtWorks.QRCode.dll
+
@@ -719,12 +759,20 @@
+
+
+
+
+
+
+
+
diff --git a/SGGL/BLL/Common/CommonService.cs b/SGGL/BLL/Common/CommonService.cs
index 8dc7f996..ddc01eb5 100644
--- a/SGGL/BLL/Common/CommonService.cs
+++ b/SGGL/BLL/Common/CommonService.cs
@@ -616,5 +616,13 @@ namespace BLL
return unitId;
}
+ ///
+ /// 得到本单位信息
+ ///
+ ///
+ public static Model.Base_Unit GetIsThisUnit()
+ {
+ return (Funs.DB.Base_Unit.FirstOrDefault(e => e.UnitId == Const.UnitId_CWCEC)); //本单位
+ }
}
}
diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs
index 7d9f5c13..91bcdee0 100644
--- a/SGGL/BLL/Common/Const.cs
+++ b/SGGL/BLL/Common/Const.cs
@@ -7,6 +7,10 @@ namespace BLL
{
public static class Const
{
+ ///
+ /// 时间书签(用于筛选数据范围)
+ ///
+ public static DateTime DtmarkTime = DateTime.Parse("2023-01-01");
#region 查询字段:系统设置
///
/// 系统管理员ID
@@ -5486,6 +5490,9 @@ namespace BLL
/// 实业数据
///
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 95efb213..919ee531 100644
--- a/SGGL/BLL/Common/ConstValue.cs
+++ b/SGGL/BLL/Common/ConstValue.cs
@@ -403,6 +403,25 @@ namespace BLL
/// 项目细分状态
///
public const string GroupId_ProjectState = "ProjectState";
+ ///
+ /// 子公司弹窗界面
+ ///
+ public const string Group_InterfacePopup = "InterfacePopup";
+ ///
+ /// 穿透界面Referer白名单
+ ///
+ public const string Group_SafeReferer = "SafeReferer";
#endregion
+
+ 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();
+ }
+ }
+
}
}
\ No newline at end of file
diff --git a/SGGL/BLL/Common/Funs.cs b/SGGL/BLL/Common/Funs.cs
index 14b81b18..4b232951 100644
--- a/SGGL/BLL/Common/Funs.cs
+++ b/SGGL/BLL/Common/Funs.cs
@@ -1,11 +1,14 @@
namespace BLL
{
using Model;
+ using Quartz;
+ using RestSharp;
using System;
using System.Collections.Generic;
using System.Data;
using System.Globalization;
using System.Linq;
+ using System.Net;
using System.Reflection;
using System.Text;
@@ -30,7 +33,11 @@ namespace BLL
return dataBaseLinkList;
}
}
-
+ public static IScheduler ScheduledTasks
+ {
+ get;
+ set;
+ }
///
/// ݿַ
@@ -1239,7 +1246,36 @@ namespace BLL
return date;
//return TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)).AddSeconds(timestamp);
- }
+ }
+
+ 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 35f1d9b8..b395bbec 100644
--- a/SGGL/BLL/DropListService.cs
+++ b/SGGL/BLL/DropListService.cs
@@ -232,5 +232,16 @@
list[11] = new ListItem("12月", "12");
return list;
}
+
+ // 定义允许上传的文件类型列表
+ 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 8427412c..2f034fa1 100644
--- a/SGGL/BLL/SysManage/LogService.cs
+++ b/SGGL/BLL/SysManage/LogService.cs
@@ -74,6 +74,38 @@ 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();
+ }
+
///
/// ĿIdɾ־Ϣ
///
diff --git a/SGGL/BLL/SysManage/SysHttplogService.cs b/SGGL/BLL/SysManage/SysHttplogService.cs
new file mode 100644
index 00000000..bec05059
--- /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..e9405578
--- /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.SGGLDB db = new Model.SGGLDB(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 83a3e17c..6a49cea8 100644
--- a/SGGL/BLL/ZHGL/DataSync/CQMSDataService.cs
+++ b/SGGL/BLL/ZHGL/DataSync/CQMSDataService.cs
@@ -1,468 +1,478 @@
-using FineUIPro;
-using Model;
-using Newtonsoft.Json;
-using NPOI.POIFS.Crypt.Dsig;
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace BLL
-{
- public static class CQMSDataService
- {
- public static Model.SGGLDB db = Funs.DB;
-
- ///
- /// 集团接口地址
- ///
- public static string CNCECServerUrl
- {
- get;
- set;
- }
-
- #region 获取列表
-
- ///
- /// 记录数
- ///
- public static int count
- {
- get;
- set;
- }
-
- public static List GetCQMSData_CQMSByModle(Model.CQMSData_CQMS table)
- {
- Model.SGGLDB 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))
- orderby x.ReportDate descending
- select x
- ;
-
- return q.ToList();
- }
-
- /// 获取分页列表
- ///
- /// 页码
- /// 每页数量
- ///
- public static IEnumerable getListData(Model.CQMSData_CQMS table, Grid Grid1)
- {
- var q = GetCQMSData_CQMSByModle(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.Id,
- x.UnitId,
- x.CollCropCode,
- x.UnitName,
- x.ReportDate,
- x.TrainPersonNum,
- x.TechnicalDisclosePersonNum,
- x.UseNum,
- x.OKNum,
- x.CompanyPersonNum,
- x.BranchPersonNum,
- x.ProjectPersonNum,
- x.ProblemNum,
- x.ProblemCompletedNum,
- x.ProblemNotCompletedNum,
- x.SNum,
- x.ANum,
- x.BNum,
- x.CNum,
- x.KeyProcessNum,
- x.KeyProcessOKNum,
- x.SpecialProcessNum,
- x.SpecialProcessOKNum,
- x.ConcealedWorksNum,
- x.ConcealedWorksOKNum,
- x.UnitProjectOnesNum,
- x.UnitProjectOnesOKNum,
- x.MaterialInRecheckNum,
- x.MaterialInRecheckOKNum,
- x.SingleProjectNum,
- x.UnitProjectNum,
- x.SubProjectNum,
- x.SubdivisionalWorksNum,
- x.InspectionLotNum,
- x.State,
- x.CreateDate,
- x.CreateMan,
- };
- }
-
- #endregion 获取列表
-
- public static void AddCQMSData_CQMS(Model.CQMSData_CQMS newtable)
- {
- Model.SGGLDB db = Funs.DB;
- Model.CQMSData_CQMS table = new Model.CQMSData_CQMS
- {
- Id = newtable.Id,
- UnitId = newtable.UnitId,
- CollCropCode = newtable.CollCropCode,
- UnitName = newtable.UnitName,
- ReportDate = newtable.ReportDate,
- TrainPersonNum = newtable.TrainPersonNum,
- TechnicalDisclosePersonNum = newtable.TechnicalDisclosePersonNum,
- UseNum = newtable.UseNum,
- OKNum = newtable.OKNum,
- CompanyPersonNum = newtable.CompanyPersonNum,
- BranchPersonNum = newtable.BranchPersonNum,
- ProjectPersonNum = newtable.ProjectPersonNum,
- ProblemNum = newtable.ProblemNum,
- ProblemCompletedNum = newtable.ProblemCompletedNum,
- ProblemNotCompletedNum = newtable.ProblemNotCompletedNum,
- SNum = newtable.SNum,
- ANum = newtable.ANum,
- BNum = newtable.BNum,
- CNum = newtable.CNum,
- KeyProcessNum = newtable.KeyProcessNum,
- KeyProcessOKNum = newtable.KeyProcessOKNum,
- SpecialProcessNum = newtable.SpecialProcessNum,
- SpecialProcessOKNum = newtable.SpecialProcessOKNum,
- ConcealedWorksNum = newtable.ConcealedWorksNum,
- ConcealedWorksOKNum = newtable.ConcealedWorksOKNum,
- UnitProjectOnesNum = newtable.UnitProjectOnesNum,
- UnitProjectOnesOKNum = newtable.UnitProjectOnesOKNum,
- MaterialInRecheckNum = newtable.MaterialInRecheckNum,
- MaterialInRecheckOKNum = newtable.MaterialInRecheckOKNum,
- SingleProjectNum = newtable.SingleProjectNum,
- UnitProjectNum = newtable.UnitProjectNum,
- SubProjectNum = newtable.SubProjectNum,
- SubdivisionalWorksNum = newtable.SubdivisionalWorksNum,
- InspectionLotNum = newtable.InspectionLotNum,
- State = newtable.State,
- CreateDate = newtable.CreateDate,
- CreateMan = newtable.CreateMan,
- };
- db.CQMSData_CQMS.InsertOnSubmit(table);
- db.SubmitChanges();
- }
-
- public static void DeleteCQMSData_CQMSById(string Id)
- {
- Model.SGGLDB db = Funs.DB;
- Model.CQMSData_CQMS table = db.CQMSData_CQMS.FirstOrDefault(x => x.Id == Id);
- if (table != null)
- {
- db.CQMSData_CQMS.DeleteOnSubmit(table);
- db.SubmitChanges();
- }
- }
-
- public static Model.CQMSData_CQMS GetCQMSData_CQMSById(string Id)
- {
- Model.SGGLDB db = Funs.DB;
- return db.CQMSData_CQMS.FirstOrDefault(x => x.Id == Id);
- }
-
- public static Model.CQMSData GetItemById(string Id)
- {
- var model = GetCQMSData_CQMSById(Id);
- CQMSData data = new CQMSData();
- CqmsDataItem item = new CqmsDataItem();
- if (model != null)
- {
- item.Id = model.Id;
- item.ReportDate = model.ReportDate.Value.ToShortDateString();
- item.UnitId = model.UnitId;
- item.CollCropCode = model.CollCropCode;
- item.TrainPersonNum = model.TrainPersonNum;
- item.TechnicalDisclosePersonNum = model.TechnicalDisclosePersonNum;
- item.UseNum = model.UseNum;
- item.OKNum = model.OKNum;
- item.CompanyPersonNum = model.CompanyPersonNum;
- item.BranchPersonNum = model.BranchPersonNum;
- item.ProjectPersonNum = model.ProjectPersonNum;
- item.ProblemNum = model.ProblemNum;
- item.ProblemCompletedNum = model.ProblemCompletedNum;
- item.ProblemNotCompletedNum = model.ProblemNotCompletedNum;
- item.ProblemRate = "";
- item.SNum = model.SNum;
- item.ANum = model.ANum;
- item.BNum = model.BNum;
- item.CNum = model.CNum;
- item.KeyProcessNum = model.KeyProcessNum;
- item.KeyProcessOKNum = model.KeyProcessOKNum;
- item.KeyProcessRate = "";
- item.SpecialProcessNum = model.SpecialProcessNum;
- item.SpecialProcessOKNum = model.SpecialProcessOKNum;
- item.SpecialProcessRate = "";
- item.ConcealedWorksNum = model.ConcealedWorksNum;
- item.ConcealedWorksOKNum = model.ConcealedWorksOKNum;
- item.ConcealedWorksRate = "";
- item.UnitProjectOnesNum = model.UnitProjectOnesNum;
- item.UnitProjectOnesOKNum = model.UnitProjectOnesOKNum;
- item.UnitProjectOnesRate = "";
- item.MaterialInRecheckNum = model.MaterialInRecheckNum;
- item.MaterialInRecheckOKNum = model.MaterialInRecheckOKNum;
- item.MaterialInRecheckRate = "";
- item.SingleProjectNum = model.SingleProjectNum;
- item.UnitProjectNum = model.UnitProjectNum;
- item.SubProjectNum = model.SubProjectNum;
- item.SubdivisionalWorksNum = model.SubdivisionalWorksNum;
- item.InspectionLotNum = model.InspectionLotNum;
- }
- List cqmsDataItems = new List();
- cqmsDataItems.Add(item);
- data.CQMSDataItems = cqmsDataItems;
- return data;
- }
-
- public static Model.CQMSData GetTodayCQMSData_CQMS()
- {
-
- var q = GetTodayData();
- CQMSData data = new CQMSData();
- if (q != null && q.State == Const.CNCEC_State_S)
- {
- data = GetDataByCQMSData_CQMS(q);
- }
- else
- {
- data = StatisticalData();
- }
- return data;
- }
-
- public static Model.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()
- {
- var q = GetTodayData();
- 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)
- 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.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;
- }
- return result;
- }
-
- public static Model.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);
- return responeData;
- }
-
- public static CQMSData StatisticalData()
- {
- string thisUnitId = string.Empty;
- var thisUnit = Const.UnitId_CWCEC;
- if (thisUnit != null)
- {
- thisUnitId = thisUnit;
- }
- var base_Unit = BLL.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
- {
- UnitId = thisUnitId,
- CollCropCode = base_Unit.CollCropCode,
- UnitName = base_Unit.UnitName,
- ReportDate = DateTime.Now.Date,
- TrainPersonNum = ProjectData.Sum(x => x.TrainPersonNum),
- TechnicalDisclosePersonNum = ProjectData.Sum(x => x.TechnicalDisclosePersonNum),
- UseNum = ProjectData.Sum(x => x.UseNum),
- OKNum = ProjectData.Sum(x => x.OKNum),
- CompanyPersonNum = GetCompanyPersonNum(),
- BranchPersonNum = GetBranchPersonNum(),
- ProjectPersonNum = ProjectData.Sum(x => x.ProjectPersonNum),
- ProblemNum = ProjectData.Sum(x => x.ProblemNum),
- ProblemCompletedNum = ProjectData.Sum(x => x.ProblemCompletedNum),
- ProblemNotCompletedNum = ProjectData.Sum(x => x.ProblemNotCompletedNum),
- SNum = ProjectData.Sum(x => x.SNum),
- ANum = ProjectData.Sum(x => x.ANum),
- BNum = ProjectData.Sum(x => x.BNum),
- CNum = ProjectData.Sum(x => x.CNum),
- KeyProcessNum = ProjectData.Sum(x => x.KeyProcessNum),
- KeyProcessOKNum = ProjectData.Sum(x => x.KeyProcessOKNum),
- SpecialProcessNum = ProjectData.Sum(x => x.SpecialProcessNum),
- SpecialProcessOKNum = ProjectData.Sum(x => x.SpecialProcessOKNum),
- ConcealedWorksNum = ProjectData.Sum(x => x.ConcealedWorksNum),
- ConcealedWorksOKNum = ProjectData.Sum(x => x.ConcealedWorksOKNum),
- UnitProjectOnesNum = ProjectData.Sum(x => x.UnitProjectOnesNum),
- UnitProjectOnesOKNum = ProjectData.Sum(x => x.UnitProjectOnesOKNum),
- MaterialInRecheckNum = ProjectData.Sum(x => x.MaterialInRecheckNum),
- MaterialInRecheckOKNum = ProjectData.Sum(x => x.MaterialInRecheckOKNum),
- SingleProjectNum = ProjectData.Sum(x => x.SingleProjectNum),
- UnitProjectNum = ProjectData.Sum(x => x.UnitProjectNum),
- SubProjectNum = ProjectData.Sum(x => x.SubProjectNum),
- SubdivisionalWorksNum = ProjectData.Sum(x => x.SubdivisionalWorksNum),
- InspectionLotNum = ProjectData.Sum(x => x.InspectionLotNum),
- CreateMan = Const.sysglyId,
- CreateDate = DateTime.Now,
- };
- if (IsReportByToday())
- {
- table.Id = GetTodayData().Id;
- table.State = Const.CNCEC_State_1;
- UpdateCQMSData_CQMS(table);
- }
- else
- {
- table.Id = SQLHelper.GetNewID();
- table.State = Const.CNCEC_State_0;
- AddCQMSData_CQMS(table);
- }
- CQMSData data = new CQMSData();
- data = GetDataByCQMSData_CQMS(table);
- return data;
- }
- public static CQMSData GetDataByCQMSData_CQMS(Model.CQMSData_CQMS table)
- {
- CQMSData data = new CQMSData();
- CqmsDataItem item = new CqmsDataItem();
- item.Id = table.Id;
- item.ReportDate = table.ReportDate.Value.ToShortDateString();
- item.UnitId = table.UnitId;
- item.CollCropCode = table.CollCropCode;
- item.TrainPersonNum = table.TrainPersonNum;
- item.TechnicalDisclosePersonNum = table.TechnicalDisclosePersonNum;
- item.UseNum = table.UseNum;
- item.OKNum = table.OKNum;
- item.CompanyPersonNum = table.CompanyPersonNum;
- item.BranchPersonNum = table.BranchPersonNum;
- item.ProjectPersonNum = table.ProjectPersonNum;
- item.ProblemNum = table.ProblemNum;
- item.ProblemCompletedNum = table.ProblemCompletedNum;
- item.ProblemNotCompletedNum = table.ProblemNotCompletedNum;
- item.ProblemRate = "";
- item.SNum = table.SNum;
- item.ANum = table.ANum;
- item.BNum = table.BNum;
- item.CNum = table.CNum;
- item.KeyProcessNum = table.KeyProcessNum;
- item.KeyProcessOKNum = table.KeyProcessOKNum;
- item.KeyProcessRate = "";
- item.SpecialProcessNum = table.SpecialProcessNum;
- item.SpecialProcessOKNum = table.SpecialProcessOKNum;
- item.SpecialProcessRate = "";
- item.ConcealedWorksNum = table.ConcealedWorksNum;
- item.ConcealedWorksOKNum = table.ConcealedWorksOKNum;
- item.ConcealedWorksRate = "";
- item.UnitProjectOnesNum = table.UnitProjectOnesNum;
- item.UnitProjectOnesOKNum = table.UnitProjectOnesOKNum;
- item.UnitProjectOnesRate = "";
- item.MaterialInRecheckNum = table.MaterialInRecheckNum;
- item.MaterialInRecheckOKNum = table.MaterialInRecheckOKNum;
- item.MaterialInRecheckRate = "";
- item.SingleProjectNum = table.SingleProjectNum;
- item.UnitProjectNum = table.UnitProjectNum;
- item.SubProjectNum = table.SubProjectNum;
- item.SubdivisionalWorksNum = table.SubdivisionalWorksNum;
- item.InspectionLotNum = table.InspectionLotNum;
- List cqmsDataItems = new List();
- cqmsDataItems.Add(item);
- data.CQMSDataItems = cqmsDataItems;
- return data;
- }
- public static void UpdateCQMSData_CQMS(Model.CQMSData_CQMS newtable)
- {
- Model.SGGLDB db = Funs.DB;
- Model.CQMSData_CQMS table = db.CQMSData_CQMS.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.TrainPersonNum = newtable.TrainPersonNum;
- table.TechnicalDisclosePersonNum = newtable.TechnicalDisclosePersonNum;
- table.UseNum = newtable.UseNum;
- table.OKNum = newtable.OKNum;
- table.CompanyPersonNum = newtable.CompanyPersonNum;
- table.BranchPersonNum = newtable.BranchPersonNum;
- table.ProjectPersonNum = newtable.ProjectPersonNum;
- table.ProblemNum = newtable.ProblemNum;
- table.ProblemCompletedNum = newtable.ProblemCompletedNum;
- table.ProblemNotCompletedNum = newtable.ProblemNotCompletedNum;
- table.SNum = newtable.SNum;
- table.ANum = newtable.ANum;
- table.BNum = newtable.BNum;
- table.CNum = newtable.CNum;
- table.KeyProcessNum = newtable.KeyProcessNum;
- table.KeyProcessOKNum = newtable.KeyProcessOKNum;
- table.SpecialProcessNum = newtable.SpecialProcessNum;
- table.SpecialProcessOKNum = newtable.SpecialProcessOKNum;
- table.ConcealedWorksNum = newtable.ConcealedWorksNum;
- table.ConcealedWorksOKNum = newtable.ConcealedWorksOKNum;
- table.UnitProjectOnesNum = newtable.UnitProjectOnesNum;
- table.UnitProjectOnesOKNum = newtable.UnitProjectOnesOKNum;
- table.MaterialInRecheckNum = newtable.MaterialInRecheckNum;
- table.MaterialInRecheckOKNum = newtable.MaterialInRecheckOKNum;
- table.SingleProjectNum = newtable.SingleProjectNum;
- table.UnitProjectNum = newtable.UnitProjectNum;
- table.SubProjectNum = newtable.SubProjectNum;
- table.SubdivisionalWorksNum = newtable.SubdivisionalWorksNum;
- table.InspectionLotNum = newtable.InspectionLotNum;
- table.State = newtable.State;
- table.CreateMan = newtable.CreateMan;
- table.CreateDate = newtable.CreateDate;
- db.SubmitChanges();
- }
- }
-
- ///
/// 获取企业总部人数
///
///
public static int GetCompanyPersonNum()
{
string unitId = BLL.Const.UnitId_CWCEC;
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.IsCQMS == true && x.UnitId == unitId
select x).Count();
return result;
}
-
- ///
/// 获取分支机构人数
///
///
public static int GetBranchPersonNum()
{
string unitId = BLL.Const.UnitId_CWCEC;
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.IsCQMS == true && x.UnitId != unitId
select x).Count();
return result;
}
- }
+using FineUIPro;
+using Model;
+using Newtonsoft.Json;
+using NPOI.POIFS.Crypt.Dsig;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace BLL
+{
+ public static class CQMSDataService
+ {
+ public static SGGLDB db = Funs.DB;
+
+ #region 获取列表
+
+ ///
+ /// 记录数
+ ///
+ public static int count { get; set; }
+
+ 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))
+ orderby x.ReportDate descending
+ select x
+ ;
+
+ return q.ToList();
+ }
+
+ /// 获取分页列表
+ ///
+ /// 页码
+ /// 每页数量
+ ///
+ public static IEnumerable getListData(CQMSData_CQMS table, Grid Grid1)
+ {
+ var q = GetCQMSData_CQMSByModle(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.Id,
+ x.UnitId,
+ x.CollCropCode,
+ x.UnitName,
+ x.ReportDate,
+ x.TrainPersonNum,
+ x.TechnicalDisclosePersonNum,
+ x.UseNum,
+ x.OKNum,
+ x.CompanyPersonNum,
+ x.BranchPersonNum,
+ x.ProjectPersonNum,
+ x.ProblemNum,
+ x.ProblemCompletedNum,
+ x.ProblemNotCompletedNum,
+ x.SNum,
+ x.ANum,
+ x.BNum,
+ x.CNum,
+ x.KeyProcessNum,
+ x.KeyProcessOKNum,
+ x.SpecialProcessNum,
+ x.SpecialProcessOKNum,
+ x.ConcealedWorksNum,
+ x.ConcealedWorksOKNum,
+ x.UnitProjectOnesNum,
+ x.UnitProjectOnesOKNum,
+ x.MaterialInRecheckNum,
+ x.MaterialInRecheckOKNum,
+ x.SingleProjectNum,
+ x.UnitProjectNum,
+ x.SubProjectNum,
+ x.SubdivisionalWorksNum,
+ x.InspectionLotNum,
+ x.State,
+ x.CreateDate,
+ x.CreateMan
+ };
+ }
+
+ #endregion 获取列表
+
+ public static void AddCQMSData_CQMS(CQMSData_CQMS newtable)
+ {
+ var db = Funs.DB;
+ var table = new CQMSData_CQMS
+ {
+ Id = newtable.Id,
+ UnitId = newtable.UnitId,
+ CollCropCode = newtable.CollCropCode,
+ UnitName = newtable.UnitName,
+ ReportDate = newtable.ReportDate,
+ TrainPersonNum = newtable.TrainPersonNum,
+ TechnicalDisclosePersonNum = newtable.TechnicalDisclosePersonNum,
+ UseNum = newtable.UseNum,
+ OKNum = newtable.OKNum,
+ CompanyPersonNum = newtable.CompanyPersonNum,
+ BranchPersonNum = newtable.BranchPersonNum,
+ ProjectPersonNum = newtable.ProjectPersonNum,
+ ProblemNum = newtable.ProblemNum,
+ ProblemCompletedNum = newtable.ProblemCompletedNum,
+ ProblemNotCompletedNum = newtable.ProblemNotCompletedNum,
+ SNum = newtable.SNum,
+ ANum = newtable.ANum,
+ BNum = newtable.BNum,
+ CNum = newtable.CNum,
+ KeyProcessNum = newtable.KeyProcessNum,
+ KeyProcessOKNum = newtable.KeyProcessOKNum,
+ SpecialProcessNum = newtable.SpecialProcessNum,
+ SpecialProcessOKNum = newtable.SpecialProcessOKNum,
+ ConcealedWorksNum = newtable.ConcealedWorksNum,
+ ConcealedWorksOKNum = newtable.ConcealedWorksOKNum,
+ UnitProjectOnesNum = newtable.UnitProjectOnesNum,
+ UnitProjectOnesOKNum = newtable.UnitProjectOnesOKNum,
+ MaterialInRecheckNum = newtable.MaterialInRecheckNum,
+ MaterialInRecheckOKNum = newtable.MaterialInRecheckOKNum,
+ SingleProjectNum = newtable.SingleProjectNum,
+ UnitProjectNum = newtable.UnitProjectNum,
+ SubProjectNum = newtable.SubProjectNum,
+ SubdivisionalWorksNum = newtable.SubdivisionalWorksNum,
+ InspectionLotNum = newtable.InspectionLotNum,
+ State = newtable.State,
+ CreateDate = newtable.CreateDate,
+ CreateMan = newtable.CreateMan
+ };
+ db.CQMSData_CQMS.InsertOnSubmit(table);
+ db.SubmitChanges();
+ }
+
+ public static void DeleteCQMSData_CQMSById(string id)
+ {
+ var db = Funs.DB;
+ var table = db.CQMSData_CQMS.FirstOrDefault(x => x.Id == id);
+ if (table != null)
+ {
+ db.CQMSData_CQMS.DeleteOnSubmit(table);
+ db.SubmitChanges();
+ }
+ }
+
+ public static CQMSData_CQMS GetCQMSData_CQMSById(string id)
+ {
+ var db = Funs.DB;
+ return db.CQMSData_CQMS.FirstOrDefault(x => x.Id == id);
+ }
+
+ public static CQMSData GetItemById(string id)
+ {
+ var model = GetCQMSData_CQMSById(id);
+ var data = new CQMSData();
+ var item = new CqmsDataItem();
+ if (model != null)
+ {
+ item.Id = model.Id;
+ item.ReportDate = model.ReportDate.Value.ToShortDateString();
+ item.UnitId = model.UnitId;
+ item.CollCropCode = model.CollCropCode;
+ item.TrainPersonNum = model.TrainPersonNum;
+ item.TechnicalDisclosePersonNum = model.TechnicalDisclosePersonNum;
+ item.UseNum = model.UseNum;
+ item.OKNum = model.OKNum;
+ item.CompanyPersonNum = model.CompanyPersonNum;
+ item.BranchPersonNum = model.BranchPersonNum;
+ item.ProjectPersonNum = model.ProjectPersonNum;
+ item.ProblemNum = model.ProblemNum;
+ item.ProblemCompletedNum = model.ProblemCompletedNum;
+ item.ProblemNotCompletedNum = model.ProblemNotCompletedNum;
+ item.ProblemRate = "";
+ item.SNum = model.SNum;
+ item.ANum = model.ANum;
+ item.BNum = model.BNum;
+ item.CNum = model.CNum;
+ item.KeyProcessNum = model.KeyProcessNum;
+ item.KeyProcessOKNum = model.KeyProcessOKNum;
+ item.KeyProcessRate = "";
+ item.SpecialProcessNum = model.SpecialProcessNum;
+ item.SpecialProcessOKNum = model.SpecialProcessOKNum;
+ item.SpecialProcessRate = "";
+ item.ConcealedWorksNum = model.ConcealedWorksNum;
+ item.ConcealedWorksOKNum = model.ConcealedWorksOKNum;
+ item.ConcealedWorksRate = "";
+ item.UnitProjectOnesNum = model.UnitProjectOnesNum;
+ item.UnitProjectOnesOKNum = model.UnitProjectOnesOKNum;
+ item.UnitProjectOnesRate = "";
+ item.MaterialInRecheckNum = model.MaterialInRecheckNum;
+ item.MaterialInRecheckOKNum = model.MaterialInRecheckOKNum;
+ item.MaterialInRecheckRate = "";
+ item.SingleProjectNum = model.SingleProjectNum;
+ item.UnitProjectNum = model.UnitProjectNum;
+ item.SubProjectNum = model.SubProjectNum;
+ item.SubdivisionalWorksNum = model.SubdivisionalWorksNum;
+ item.InspectionLotNum = model.InspectionLotNum;
+ }
+
+ var cqmsDataItems = new List();
+ cqmsDataItems.Add(item);
+ data.CQMSDataItems = cqmsDataItems;
+ return data;
+ }
+
+ public static CQMSData GetTodayCQMSData_CQMS()
+ {
+ // var q = GetTodayData();
+ var data = new CQMSData();
+ data = StatisticalData();
+
+ //if (q != null && q.State == Const.CNCEC_State_S)
+ //{
+ // // data = GetDataByCQMSData_CQMS(q);
+ // data = StatisticalData();
+ //}
+ //else
+ //{
+ // data = StatisticalData();
+ //}
+ return data;
+ }
+
+ 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()
+ {
+ var q = GetTodayData();
+ 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
+ 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.CQMSData_CQMS
+ 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/CQMSData/SaveCQMSData";
+ var item = GetItemById(id);
+ var str = JsonConvert.SerializeObject(item);
+ var responeData = ServerService.PushCNCEC(str, baseurl);
+ return responeData;
+ }
+
+ public static CQMSData StatisticalData()
+ {
+ 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();
+ var table = new CQMSData_CQMS
+ {
+ UnitId = thisUnitId,
+ CollCropCode = base_Unit.CollCropCode,
+ UnitName = base_Unit.UnitName,
+ ReportDate = DateTime.Now.Date,
+ TrainPersonNum = ProjectData.Sum(x => x.TrainPersonNum),
+ TechnicalDisclosePersonNum = ProjectData.Sum(x => x.TechnicalDisclosePersonNum),
+ UseNum = ProjectData.Sum(x => x.UseNum),
+ OKNum = ProjectData.Sum(x => x.OKNum),
+ CompanyPersonNum = GetCompanyPersonNum(),
+ BranchPersonNum = GetBranchPersonNum(),
+ ProjectPersonNum = ProjectData.Sum(x => x.ProjectPersonNum),
+ ProblemNum = ProjectData.Sum(x => x.ProblemNum),
+ ProblemCompletedNum = ProjectData.Sum(x => x.ProblemCompletedNum),
+ ProblemNotCompletedNum = ProjectData.Sum(x => x.ProblemNotCompletedNum),
+ SNum = ProjectData.Sum(x => x.SNum),
+ ANum = ProjectData.Sum(x => x.ANum),
+ BNum = ProjectData.Sum(x => x.BNum),
+ CNum = ProjectData.Sum(x => x.CNum),
+ KeyProcessNum = ProjectData.Sum(x => x.KeyProcessNum),
+ KeyProcessOKNum = ProjectData.Sum(x => x.KeyProcessOKNum),
+ SpecialProcessNum = ProjectData.Sum(x => x.SpecialProcessNum),
+ SpecialProcessOKNum = ProjectData.Sum(x => x.SpecialProcessOKNum),
+ ConcealedWorksNum = ProjectData.Sum(x => x.ConcealedWorksNum),
+ ConcealedWorksOKNum = ProjectData.Sum(x => x.ConcealedWorksOKNum),
+ UnitProjectOnesNum = ProjectData.Sum(x => x.UnitProjectOnesNum),
+ UnitProjectOnesOKNum = ProjectData.Sum(x => x.UnitProjectOnesOKNum),
+ MaterialInRecheckNum = ProjectData.Sum(x => x.MaterialInRecheckNum),
+ MaterialInRecheckOKNum = ProjectData.Sum(x => x.MaterialInRecheckOKNum),
+ SingleProjectNum = ProjectData.Sum(x => x.SingleProjectNum),
+ UnitProjectNum = ProjectData.Sum(x => x.UnitProjectNum),
+ SubProjectNum = ProjectData.Sum(x => x.SubProjectNum),
+ SubdivisionalWorksNum = ProjectData.Sum(x => x.SubdivisionalWorksNum),
+ InspectionLotNum = ProjectData.Sum(x => x.InspectionLotNum),
+ CreateMan = Const.sysglyId,
+ CreateDate = DateTime.Now
+ };
+ if (IsReportByToday())
+ {
+ table.Id = GetTodayData().Id;
+ table.State = Const.CNCEC_State_1;
+ UpdateCQMSData_CQMS(table);
+ }
+ else
+ {
+ table.Id = SQLHelper.GetNewID();
+ table.State = Const.CNCEC_State_0;
+ AddCQMSData_CQMS(table);
+ }
+
+ var data = new CQMSData();
+ data = GetDataByCQMSData_CQMS(table);
+ return data;
+ }
+
+ public static CQMSData GetDataByCQMSData_CQMS(CQMSData_CQMS table)
+ {
+ var data = new CQMSData();
+ var item = new CqmsDataItem();
+ item.Id = table.Id;
+ item.ReportDate = table.ReportDate.Value.ToShortDateString();
+ item.UnitId = table.UnitId;
+ item.CollCropCode = table.CollCropCode;
+ item.TrainPersonNum = table.TrainPersonNum;
+ item.TechnicalDisclosePersonNum = table.TechnicalDisclosePersonNum;
+ item.UseNum = table.UseNum;
+ item.OKNum = table.OKNum;
+ item.CompanyPersonNum = table.CompanyPersonNum;
+ item.BranchPersonNum = table.BranchPersonNum;
+ item.ProjectPersonNum = table.ProjectPersonNum;
+ item.ProblemNum = table.ProblemNum;
+ item.ProblemCompletedNum = table.ProblemCompletedNum;
+ item.ProblemNotCompletedNum = table.ProblemNotCompletedNum;
+ item.ProblemRate = "";
+ item.SNum = table.SNum;
+ item.ANum = table.ANum;
+ item.BNum = table.BNum;
+ item.CNum = table.CNum;
+ item.KeyProcessNum = table.KeyProcessNum;
+ item.KeyProcessOKNum = table.KeyProcessOKNum;
+ item.KeyProcessRate = "";
+ item.SpecialProcessNum = table.SpecialProcessNum;
+ item.SpecialProcessOKNum = table.SpecialProcessOKNum;
+ item.SpecialProcessRate = "";
+ item.ConcealedWorksNum = table.ConcealedWorksNum;
+ item.ConcealedWorksOKNum = table.ConcealedWorksOKNum;
+ item.ConcealedWorksRate = "";
+ item.UnitProjectOnesNum = table.UnitProjectOnesNum;
+ item.UnitProjectOnesOKNum = table.UnitProjectOnesOKNum;
+ item.UnitProjectOnesRate = "";
+ item.MaterialInRecheckNum = table.MaterialInRecheckNum;
+ item.MaterialInRecheckOKNum = table.MaterialInRecheckOKNum;
+ item.MaterialInRecheckRate = "";
+ item.SingleProjectNum = table.SingleProjectNum;
+ item.UnitProjectNum = table.UnitProjectNum;
+ item.SubProjectNum = table.SubProjectNum;
+ item.SubdivisionalWorksNum = table.SubdivisionalWorksNum;
+ item.InspectionLotNum = table.InspectionLotNum;
+ var cqmsDataItems = new List();
+ cqmsDataItems.Add(item);
+ data.CQMSDataItems = cqmsDataItems;
+ return data;
+ }
+
+ public static void UpdateCQMSData_CQMS(CQMSData_CQMS newtable)
+ {
+ var db = Funs.DB;
+ var table = db.CQMSData_CQMS.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.TrainPersonNum = newtable.TrainPersonNum;
+ table.TechnicalDisclosePersonNum = newtable.TechnicalDisclosePersonNum;
+ table.UseNum = newtable.UseNum;
+ table.OKNum = newtable.OKNum;
+ table.CompanyPersonNum = newtable.CompanyPersonNum;
+ table.BranchPersonNum = newtable.BranchPersonNum;
+ table.ProjectPersonNum = newtable.ProjectPersonNum;
+ table.ProblemNum = newtable.ProblemNum;
+ table.ProblemCompletedNum = newtable.ProblemCompletedNum;
+ table.ProblemNotCompletedNum = newtable.ProblemNotCompletedNum;
+ table.SNum = newtable.SNum;
+ table.ANum = newtable.ANum;
+ table.BNum = newtable.BNum;
+ table.CNum = newtable.CNum;
+ table.KeyProcessNum = newtable.KeyProcessNum;
+ table.KeyProcessOKNum = newtable.KeyProcessOKNum;
+ table.SpecialProcessNum = newtable.SpecialProcessNum;
+ table.SpecialProcessOKNum = newtable.SpecialProcessOKNum;
+ table.ConcealedWorksNum = newtable.ConcealedWorksNum;
+ table.ConcealedWorksOKNum = newtable.ConcealedWorksOKNum;
+ table.UnitProjectOnesNum = newtable.UnitProjectOnesNum;
+ table.UnitProjectOnesOKNum = newtable.UnitProjectOnesOKNum;
+ table.MaterialInRecheckNum = newtable.MaterialInRecheckNum;
+ table.MaterialInRecheckOKNum = newtable.MaterialInRecheckOKNum;
+ table.SingleProjectNum = newtable.SingleProjectNum;
+ table.UnitProjectNum = newtable.UnitProjectNum;
+ table.SubProjectNum = newtable.SubProjectNum;
+ table.SubdivisionalWorksNum = newtable.SubdivisionalWorksNum;
+ table.InspectionLotNum = newtable.InspectionLotNum;
+ table.State = newtable.State;
+ table.CreateMan = newtable.CreateMan;
+ table.CreateDate = newtable.CreateDate;
+ 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_CompanyBranchPerson
+ join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
+ where x.IsOnJob == true && y.IsCQMS == true && x.UnitId == unitId
+ select x).Count();
+ return result;
+ }
+
+ ///
+ /// 获取分支机构人数
+ ///
+ ///
+ 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_CompanyBranchPerson
+ join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
+ where x.IsOnJob == true && y.IsCQMS == true && x.UnitId != unitId
+ select x).Count();
+ return result;
+ }
+ }
}
\ No newline at end of file
diff --git a/SGGL/BLL/ZHGL/DataSync/HJGLData_HJGLService.cs b/SGGL/BLL/ZHGL/DataSync/HJGLData_HJGLService.cs
index 1e116b23..ffd34465 100644
--- a/SGGL/BLL/ZHGL/DataSync/HJGLData_HJGLService.cs
+++ b/SGGL/BLL/ZHGL/DataSync/HJGLData_HJGLService.cs
@@ -5,36 +5,33 @@ 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)
{
- Model.SGGLDB db = Funs.DB;
+ 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();
}
@@ -44,40 +41,37 @@ 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
- {
- x.Id,
- x.UnitId,
- x.CollCropCode,
- x.UnitName,
- x.ReportDate,
- x.WelderNum,
- x.TotalDineNum,
- x.CompleteDineNum,
- x.TotalFilmNum,
- x.OKFilmNum,
- x.State,
- x.CreateDate,
- x.CreateMan,
- };
+ select new
+ {
+ x.Id,
+ x.UnitId,
+ x.CollCropCode,
+ x.UnitName,
+ x.ReportDate,
+ x.WelderNum,
+ x.TotalDineNum,
+ x.CompleteDineNum,
+ x.TotalFilmNum,
+ x.OKFilmNum,
+ x.State,
+ x.CreateDate,
+ x.CreateMan
+ };
}
#endregion 获取列表
- public static void AddHJGLData_HJGL(Model.HJGLData_HJGL newtable)
+ public static void AddHJGLData_HJGL(HJGLData_HJGL newtable)
{
- Model.SGGLDB db = Funs.DB;
- Model.HJGLData_HJGL table = new Model.HJGLData_HJGL
+ var db = Funs.DB;
+ var table = new HJGLData_HJGL
{
Id = newtable.Id,
UnitId = newtable.UnitId,
@@ -91,7 +85,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();
@@ -99,8 +93,8 @@ namespace BLL
public static void DeleteHJGLData_HJGLById(string Id)
{
- Model.SGGLDB db = Funs.DB;
- 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);
@@ -108,20 +102,20 @@ namespace BLL
}
}
- public static Model.HJGLData_HJGL GetHJGLData_HJGLById(string Id)
+ public static HJGLData_HJGL GetHJGLData_HJGLById(string Id)
{
- Model.SGGLDB db = Funs.DB;
+ 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;
@@ -137,76 +131,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();
+ 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)
- select x).ToList();
- if (q != null && q.Count > 0)
- {
- result = true;
- }
+ 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;
}
@@ -218,44 +218,39 @@ namespace BLL
{
var result = false;
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;
- }
+ 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 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 = string.Empty;
- var thisUnit = Const.UnitId_CWCEC;
- if (thisUnit != null)
- {
- thisUnitId = thisUnit;
- }
- 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();
+ 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),
@@ -263,7 +258,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())
{
@@ -278,7 +273,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;
@@ -289,20 +285,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.SGGLDB db = Funs.DB;
- 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 cc52c491..ec66dd73 100644
--- a/SGGL/BLL/ZHGL/DataSync/HSSEData_HSSEService.cs
+++ b/SGGL/BLL/ZHGL/DataSync/HSSEData_HSSEService.cs
@@ -1,625 +1,493 @@
-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;
- #region 获取列表
-
- ///
- /// 记录数
- ///
- public static int count
+ public static void AddHSSEData_HSSE(HSSEData_HSSE newtable)
{
- get;
- set;
- }
-
- public static List GetHSSEData_HSSEByModle(Model.HSSEData_HSSE table)
- {
- Model.SGGLDB 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))
- orderby x.ReportDate descending
- select x
- ;
-
- return q.ToList();
- }
-
- /// 获取分页列表
- ///
- /// 页码
- /// 每页数量
- ///
- public static IEnumerable getListData(Model.HSSEData_HSSE table, Grid Grid1)
- {
- var q = GetHSSEData_HSSEByModle(table);
- count = q.Count();
- if (count == 0)
+ using (var db = new SGGLDB(Funs.ConnString))
{
- return null;
- }
- // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
- return from x in q
- select new
- {
- x.Id,
- x.UnitId,
- x.CollCropCode,
- x.UnitName,
- x.ReportDate,
- x.BeUnderConstructionNum,
- x.ShutdownNum,
- x.JoinConstructionPersonNum,
- x.MajorProjectsUnderConstructionNum,
- x.TotalWorkingHour,
- x.LostWorkingHour,
- x.SafeWorkingHour,
- x.SafeTrainNum,
- x.SpecialTrainNum,
- x.SpecialOperationTrainNum,
- x.TotalEnergyConsumption,
- x.IncomeComprehensiveEnergyConsumption,
- x.NewWaterConsumption,
- x.HeadOfficeInspectorGeneralNum,
- x.HeadOfficeFullTimeNum,
- x.BranchInspectorGeneralNum,
- x.BranchFullTimeNum,
- x.ProjectInspectorGeneralNum,
- x.ProjectFullTimeNum,
- x.ProjectSafetyMonitorNum,
- x.SafetyInjectionEngineer,
- x.CertificateANum,
- x.CertificateBNum,
- x.CertificateCNum,
- x.SafetyCommitteeMeetingNum,
- x.EnterpriseTopicsMeetingNum,
- x.ProjectSafetyLeadingGroupMeetingNum,
- x.ProjectSafetyMeetingNum,
- x.CompanyLeadShiftCheckNum,
- x.CompanyComprehensiveCheckNum,
- x.CompanySpecialCheckNum,
- x.ProjectLeadShiftCheckNum,
- x.ProjectSpecialCheckNum,
- x.ProjectMajorCheckNum,
- x.NearMissNum,
- x.RecordableEventNum,
- x.GeneralAccidentNum,
- x.MajorAccidentNum,
- x.SeriousAccidentNum,
- x.SpecialSeriousAccidentNum,
- x.CompanyComprehensivePlanNum,
- x.CompanySpecialPlanNum,
- x.CompanyOnSiteDisposalPlan,
- x.CompanyDrillNum,
- x.ProjectComprehensivePlanNum,
- x.ProjectSpecialPlanNum,
- x.ProjectOnSiteDisposalPlan,
- x.ProjectDrillNum,
- x.CostExtract,
- x.CostUse,
- x.UseEquipmentNum,
- x.SpecialEquipmentNum,
- x.LicensesNum,
- x.LicensesCloseNum,
- x.GeneralClosedNum,
- x.GeneralNotClosedNum,
- x.MajorClosedNum,
- x.MajorNotClosedNum,
- x.GeneralRiskNum,
- x.LowRiskNum,
- x.MediumRiskNum,
- x.HighRiskNum,
- x.CompletedNum,
- x.TrainPersonNum,
- x.ConstructionNum,
- x.FinishedNum,
- x.SuperCompletedNum,
- x.SuperTrainPersonNum,
- x.SuperConstructionNum,
- x.SuperFinishedNum,
- x.State,
- x.CreateDate,
- x.CreateMan,
- };
- }
-
- #endregion 获取列表
-
- public static void AddHSSEData_HSSE(Model.HSSEData_HSSE newtable)
- {
- Model.SGGLDB db = Funs.DB;
- 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.SGGLDB db = Funs.DB;
- Model.HSSEData_HSSE table = db.HSSEData_HSSE.FirstOrDefault(x => x.Id == Id);
- if (table != null)
- {
- db.HSSEData_HSSE.DeleteOnSubmit(table);
+ 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 Model.HSSEData_HSSE GetHSSEData_HSSEById(string Id)
+ public static void DeleteHSSEData_HSSEById(string id)
{
- Model.SGGLDB db = Funs.DB;
- 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)
+ using (var db = new SGGLDB(Funs.ConnString))
{
- 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 table = db.HSSEData_HSSE.FirstOrDefault(x => x.Id == id);
+ if (table != null)
{
- var list = new List();
- foreach (var detail in hSSEData_Hiddens)
- {
- HSSEDataHiddenDangerDetailItem hSSEDataHiddenDangerDetailItem = new HSSEDataHiddenDangerDetailItem();
+ 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();
- 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);
+
+ var hsseDataItems = new List { 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);
- }
+ 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;
}
}
- List hsseDataItems = new List();
- hsseDataItems.Add(item);
+
+ var hsseDataItems = new List { item };
data.HSSEDataItems = hsseDataItems;
return data;
}
- public static Model.HSSEData GetTodayHSSEData_HSSE()
+
+ 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();
- HSSEData data = new HSSEData();
+ 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()); ;
- }
- else
- {
+ // data = GetItemByHSSEData_HSSE(q, Project_HSSEData_HiddenDangerDetailService.GetTodayModel()); ;
+ data = StatisticalData();
+ else
data = StatisticalData();
- }
return data;
}
- public static Model.HSSEData_HSSE GetTodayData()
+
+ 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();
+ 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;
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;
- }
+ 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 != null && q.Count > 0)
- {
- result = true;
- }
+ 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 Model.ReturnData PushCNCEC(string Id)
+ public static 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);
+ 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()
{
- HSSEData data = new HSSEData();
- string thisUnitId = string.Empty;
- var thisUnit = Const.UnitId_CWCEC;
- if (thisUnit != null)
- {
- thisUnitId = thisUnit;
- }
- var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
+ 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();
- decimal TotalEnergyConsumption = GetLatstTimeTotalEnergyConsumption();
- decimal IncomeComprehensiveEnergyConsumption = GetLatstTimeIncomeComprehensiveEnergyConsumption();
- decimal NewWaterConsumption = GetLatstTimeNewWaterConsumption();
+ 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();
- Model.HSSEData_HSSE table = new Model.HSSEData_HSSE
+ var table = new HSSEData_HSSE
{
UnitId = thisUnitId,
- CollCropCode = base_Unit.CollCropCode,
- UnitName = base_Unit.UnitName,
+ 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 = 0,
- IncomeComprehensiveEnergyConsumption = 0,
- NewWaterConsumption = 0,
+ 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),
+ 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),
+ 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),
+ 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),
+ 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,
+ CreateDate = DateTime.Now
};
if (IsReportByToday())
{
@@ -633,304 +501,390 @@ namespace BLL
table.State = Const.CNCEC_State_0;
AddHSSEData_HSSE(table);
}
- data = GetItemByHSSEData_HSSE(table, Project_HSSEData_HiddenDangerDetailService.GetTodayModel());
+
+ var data = GetItemByHSSEData_HSSE(table, Project_HSSEData_HiddenDangerDetailService.GetTodayModel());
return data;
}
- public static void UpdateHSSEData_HSSE(Model.HSSEData_HSSE newtable)
+
+ public static void UpdateHSSEData_HSSE(HSSEData_HSSE newtable)
{
- Model.SGGLDB db = Funs.DB;
- Model.HSSEData_HSSE table = db.HSSEData_HSSE.FirstOrDefault(x => x.Id == newtable.Id);
- if (table != null)
+ using (var db = new SGGLDB(Funs.ConnString))
{
- 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();
+ 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()
{
- string unitId = string.Empty;
- var thisUnit = Const.UnitId_CWCEC;
- if (thisUnit != null)
- {
- unitId = thisUnit;
- }
- 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();
+ var unitId = string.Empty;
+ var thisUnit = CommonService.GetIsThisUnit();
+ if (thisUnit != null) unitId = thisUnit.UnitId;
+ var result = (from x in Funs.DB.Person_CompanyBranchPerson
+ where x.IsOnJob == true && x.WorkPostId == Const.WorkPost_HSSEDirector && x.UnitId == unitId
+ select x).Count();
return result;
}
+
///
- /// 获取企业总部专职人数
+ /// 获取企业总部专职人数
///
///
public static int GetHeadOfficeFullTimeNum()
{
- string unitId = string.Empty;
- var thisUnit = Const.UnitId_CWCEC;
- if (thisUnit != null)
- {
- unitId = thisUnit;
- }
- 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();
+ var unitId = string.Empty;
+ var thisUnit = CommonService.GetIsThisUnit();
+ if (thisUnit != null) unitId = thisUnit.UnitId;
+ var 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 result;
}
+
///
- /// 获取分支机构总监人数
+ /// 获取分支机构总监人数
///
///
public static int GetBranchInspectorGeneralNum()
{
- string unitId = string.Empty;
- var thisUnit = Const.UnitId_CWCEC;
- if (thisUnit != null)
- {
- unitId = thisUnit;
- }
- 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();
+ var unitId = string.Empty;
+ var thisUnit = CommonService.GetIsThisUnit();
+ if (thisUnit != null) unitId = thisUnit.UnitId;
+ var result = (from x in Funs.DB.Person_CompanyBranchPerson
+ where x.IsOnJob == true && x.WorkPostId == Const.WorkPost_HSSEDirector && x.UnitId != unitId
+ select x).Count();
return result;
}
+
///
- /// 获取分支机构专职人数
+ /// 获取分支机构专职人数
///
///
public static int GetBranchFullTimeNum()
{
- string unitId = string.Empty;
- var thisUnit = Const.UnitId_CWCEC;
- if (thisUnit != null)
- {
- unitId = thisUnit;
- }
- 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();
+ var unitId = string.Empty;
+ var thisUnit = CommonService.GetIsThisUnit();
+ if (thisUnit != null) unitId = thisUnit.UnitId;
+ var 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 result;
}
///
- /// 获取企业安委会会议数
+ /// 获取企业安委会会议数
///
///
public static int GetSafetyCommitteeMeetingNum()
{
- int result = (from x in Funs.DB.Meeting_CompanySafetyMeeting select x).Count();
+ var result =
+ (from x in Funs.DB.Meeting_CompanySafetyMeeting where x.CompileDate > Const.DtmarkTime select x)
+ .Count();
return result;
}
+
///
- /// 获取企业专题会议数
+ /// 获取企业专题会议数
///
///
public static int GetEnterpriseTopicsMeetingNum()
{
- int result = (from x in Funs.DB.Meeting_CompanySpecialMeeting select x).Count();
+ var result = (from x in Funs.DB.Meeting_CompanySpecialMeeting
+ where x.CompileDate > Const.DtmarkTime
+ select x).Count();
return result;
}
///
- /// 获取企业负责人带班检查次数
+ /// 获取企业负责人带班检查次数
///
///
public static int GetCompanyLeadShiftCheckNum()
{
- int result = (from x in Funs.DB.Supervise_SuperviseCheckReport where x.CheckType == "1" select x).Count();
+ 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()
{
- int result = (from x in Funs.DB.Supervise_SuperviseCheckReport where x.CheckType == "2" select x).Count();
+ 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()
{
- int result = (from x in Funs.DB.Supervise_SuperviseCheckReport where x.CheckType == "3" select x).Count();
+ 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()
{
- int 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("综合")
- select x).Count();
+ 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()
{
- int 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("专项")
- select x).Count();
+ 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()
{
- int 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("现场处置")
- select x).Count();
+ 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()
{
- int result = (from x in Funs.DB.Emergency_DrillRecordList_Unit
- select x).Count();
+ var result = (from x in Funs.DB.Emergency_DrillRecordList_Unit
+ where x.CompileDate > Const.DtmarkTime
+ select x).Count();
return result;
}
- public static decimal GetLatstTimeTotalEnergyConsumption()
- {
- var q1 = (from x in 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 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 db.Environmental_ArchitectureReportItem where x.SortIndex == "15" select x);
- decimal d2 = 0;
- foreach (var item in q2)
- {
- d2 += Funs.GetNewDecimalOrZero(item.ThisYearValue);
- }
- return d2;
+ #region 获取列表
- }
- public static decimal GetLatstTimeNewWaterConsumption()
- {
- var q1 = (from x in 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 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;
+ ///
+ /// 记录数
+ ///
+ public static int Count { get; set; }
+ 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))
+ orderby x.ReportDate descending
+ select x
+ ;
+
+ return q.ToList();
}
+
+ // ReSharper disable once InvalidXmlDocComment
+ ///
+ ///
+ public static IEnumerable GetListData(HSSEData_HSSE table, Grid Grid1)
+ {
+ var q = GetHSSEData_HSSEByModle(table);
+ 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
+ {
+ x.Id,
+ x.UnitId,
+ x.CollCropCode,
+ x.UnitName,
+ x.ReportDate,
+ x.BeUnderConstructionNum,
+ x.ShutdownNum,
+ x.JoinConstructionPersonNum,
+ x.MajorProjectsUnderConstructionNum,
+ x.TotalWorkingHour,
+ x.LostWorkingHour,
+ x.SafeWorkingHour,
+ x.SafeTrainNum,
+ x.SpecialTrainNum,
+ x.SpecialOperationTrainNum,
+ x.TotalEnergyConsumption,
+ x.IncomeComprehensiveEnergyConsumption,
+ x.NewWaterConsumption,
+ x.HeadOfficeInspectorGeneralNum,
+ x.HeadOfficeFullTimeNum,
+ x.BranchInspectorGeneralNum,
+ x.BranchFullTimeNum,
+ x.ProjectInspectorGeneralNum,
+ x.ProjectFullTimeNum,
+ x.ProjectSafetyMonitorNum,
+ x.SafetyInjectionEngineer,
+ x.CertificateANum,
+ x.CertificateBNum,
+ x.CertificateCNum,
+ x.SafetyCommitteeMeetingNum,
+ x.EnterpriseTopicsMeetingNum,
+ x.ProjectSafetyLeadingGroupMeetingNum,
+ x.ProjectSafetyMeetingNum,
+ x.CompanyLeadShiftCheckNum,
+ x.CompanyComprehensiveCheckNum,
+ x.CompanySpecialCheckNum,
+ x.ProjectLeadShiftCheckNum,
+ x.ProjectSpecialCheckNum,
+ x.ProjectMajorCheckNum,
+ x.NearMissNum,
+ x.RecordableEventNum,
+ x.GeneralAccidentNum,
+ x.MajorAccidentNum,
+ x.SeriousAccidentNum,
+ x.SpecialSeriousAccidentNum,
+ x.CompanyComprehensivePlanNum,
+ x.CompanySpecialPlanNum,
+ x.CompanyOnSiteDisposalPlan,
+ x.CompanyDrillNum,
+ x.ProjectComprehensivePlanNum,
+ x.ProjectSpecialPlanNum,
+ x.ProjectOnSiteDisposalPlan,
+ x.ProjectDrillNum,
+ x.CostExtract,
+ x.CostUse,
+ x.UseEquipmentNum,
+ x.SpecialEquipmentNum,
+ x.LicensesNum,
+ x.LicensesCloseNum,
+ x.GeneralClosedNum,
+ x.GeneralNotClosedNum,
+ x.MajorClosedNum,
+ x.MajorNotClosedNum,
+ x.GeneralRiskNum,
+ x.LowRiskNum,
+ x.MediumRiskNum,
+ x.HighRiskNum,
+ x.CompletedNum,
+ x.TrainPersonNum,
+ x.ConstructionNum,
+ x.FinishedNum,
+ x.SuperCompletedNum,
+ x.SuperTrainPersonNum,
+ x.SuperConstructionNum,
+ x.SuperFinishedNum,
+ x.State,
+ x.CreateDate,
+ x.CreateMan
+ };
+ }
+
+ #endregion 获取列表
}
}
\ No newline at end of file
diff --git a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_CQMSDataService.cs b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_CQMSDataService.cs
index 187ba224..ead03467 100644
--- a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_CQMSDataService.cs
+++ b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_CQMSDataService.cs
@@ -323,12 +323,12 @@ namespace BLL
public static void StatisticalData(string projectid, CQMSDateType cQMSDateType)
{
string thisUnitId = string.Empty;
- var thisUnit = Const.UnitId_CWCEC;
+ var thisUnit = CommonService.GetIsThisUnit();
if (thisUnit != null)
{
- thisUnitId = thisUnit;
+ thisUnitId = thisUnit.UnitId;
}
- var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
+ var baseUnit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
Model.Project_CQMSData_CQMS table = new Model.Project_CQMSData_CQMS();
if (IsReportByToday(projectid))
@@ -340,8 +340,8 @@ namespace BLL
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)
@@ -352,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)
{
@@ -376,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);
@@ -411,8 +411,8 @@ namespace BLL
///
public static int GetTrainPersonNum(string projectid)
{
- int result = (from x in Funs.DB.Comprehensive_InspectionPerson
- where x.ProjectId == projectid && x.IsTrain == true
+ 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;
}
@@ -422,8 +422,8 @@ namespace BLL
///
public static int GetTechnicalDisclosePersonNum(string projectid)
{
- var result = (from x in Funs.DB.Comprehensive_DesignDetails
- where x.ProjectId == projectid
+ 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;
@@ -436,6 +436,7 @@ namespace BLL
{
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;
}
@@ -443,10 +444,11 @@ namespace BLL
/// 获取校准合格数
///
///
- 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
+ && x.CompileDate > Const.DtmarkTime
select x).Count();
return result;
}
@@ -474,9 +476,9 @@ 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
+ 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.IsUsed == true
select x).Count();
return result;
}
@@ -486,8 +488,8 @@ 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
+ int result = (from x in Funs.DB.Check_CheckControl
+ where x.ProjectId == projectid && x.CheckDate > Const.DtmarkTime
select x).Count();
return result;
}
@@ -498,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;
}
@@ -509,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;
}
@@ -520,7 +522,7 @@ 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") && x.IsSelected == true
+ where x.ProjectId == projectid && x.Class.Contains("S") && x.IsSelected == true && x.CompileDate > Const.DtmarkTime
select x).Count();
return result;
}
@@ -531,7 +533,7 @@ 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") && x.IsSelected == true
+ where x.ProjectId == projectid && x.Class.Contains("A") && x.IsSelected == true && x.CompileDate > Const.DtmarkTime
select x).Count();
return result;
}
@@ -542,7 +544,7 @@ 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") && x.IsSelected == true
+ where x.ProjectId == projectid && x.Class.Contains("B") && x.IsSelected == true && x.CompileDate > Const.DtmarkTime
select x).Count();
return result;
}
@@ -553,7 +555,7 @@ 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") && x.IsSelected == true
+ where x.ProjectId == projectid && x.Class.Contains("C") && x.IsSelected == true && x.CompileDate > Const.DtmarkTime
select x).Count();
return result;
}
@@ -565,7 +567,7 @@ namespace BLL
{
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"
+ where y.ProjectId == projectid && y.CheckAcceptType == "1" && x.CreateDate> Const.DtmarkTime
select x).Count();
return result;
}
@@ -573,12 +575,12 @@ namespace BLL
/// 获取关键工序验收合格数
///
///
- 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
+ where y.ProjectId == projectid && y.CheckAcceptType == "1" && z.IsOnceQualified == true && x.CreateDate>Const.DtmarkTime
select x).Count();
return result;
}
@@ -590,7 +592,7 @@ namespace BLL
{
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"
+ where y.ProjectId == projectid && y.CheckAcceptType == "2" && x.CreateDate > Const.DtmarkTime
select x).Count();
return result;
}
@@ -598,12 +600,12 @@ namespace BLL
/// 获取特殊过程验收合格数
///
///
- public static int GetSpecialProcessOKNum(string projectid)
+ public static int GetSpecialProcessOkNum(string projectid)
{
- int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
+ 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
+ where y.ProjectId == projectid && y.CheckAcceptType == "2" && z.IsOnceQualified == true && x.CreateDate > Const.DtmarkTime
select x).Count();
return result;
}
@@ -615,7 +617,7 @@ namespace BLL
{
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"
+ where y.ProjectId == projectid && y.CheckAcceptType == "3" && x.CreateDate > Const.DtmarkTime
select x).Count();
return result;
}
@@ -623,12 +625,12 @@ namespace BLL
/// 获取隐蔽工程验收合格数
///
///
- 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
+ where y.ProjectId == projectid && y.CheckAcceptType == "3" && z.IsOnceQualified == true && x.CreateDate > Const.DtmarkTime
select x).Count();
return result;
}
@@ -640,7 +642,7 @@ namespace BLL
{
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"
+ where y.ProjectId == projectid && y.CheckAcceptType == "4" && x.CreateDate > Const.DtmarkTime
select x).Count();
return result;
}
@@ -653,7 +655,7 @@ namespace BLL
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
+ where y.ProjectId == projectid && y.CheckAcceptType == "4" && z.IsOnceQualified == true && x.CreateDate > Const.DtmarkTime
select x).Count();
return result;
}
@@ -665,7 +667,7 @@ namespace BLL
{
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"
+ where y.ProjectId == projectid && y.CheckAcceptType == "5" && x.CreateDate > Const.DtmarkTime
select x).Count();
return result;
}
@@ -678,7 +680,7 @@ namespace BLL
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
+ where y.ProjectId == projectid && y.CheckAcceptType == "5" && z.IsOnceQualified == true && x.CreateDate > Const.DtmarkTime
select x).Count();
return result;
}
@@ -689,7 +691,7 @@ namespace BLL
public static int GetSingleProjectNum(string projectid)
{
int result = (from x in Funs.DB.Project_Installation
- where x.ProjectId == projectid && x.SuperInstallationId == "0"
+ where x.ProjectId == projectid && x.SuperInstallationId == "0"
select x).Count();
return result;
}
@@ -733,7 +735,7 @@ namespace BLL
public static int GetInspectionLotNum(string projectid)
{
int result = (from x in Funs.DB.WBS_BreakdownProject
- where x.ProjectId == projectid && x.IsSelected == true
+ where x.ProjectId == projectid && x.IsSelected == true
select x).Count();
return result;
}
diff --git a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_DefectService.cs b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_DefectService.cs
index fc8fd156..83f584cc 100644
--- a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_DefectService.cs
+++ b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_DefectService.cs
@@ -1,38 +1,39 @@
using FineUIPro;
+using Microsoft.SqlServer.Dts.Runtime;
+using NPOI.SS.Formula.Functions;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using Model;
+
namespace BLL
{
-
public static class Project_HJGLData_DefectService
{
- public static Model.SGGLDB db = Funs.DB;
+ public static SGGLDB db = Funs.DB;
#region 获取列表
+
///
/// 记录数
///
- public static int count
- {
- get;
- set;
- }
- public static List GetProject_HJGLData_DefectByModle(Model.Project_HJGLData_Defect table)
+ public static int count { get; set; }
+
+ public static List GetProject_HJGLData_DefectByModle(Project_HJGLData_Defect table)
{
var q = from x in db.Project_HJGLData_Defect
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.DefectName) || x.DefectName.Contains(table.DefectName))
+ (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.DefectName) || x.DefectName.Contains(table.DefectName))
select x
- ;
+ ;
return q.ToList();
}
@@ -42,53 +43,51 @@ namespace BLL
/// 页码
/// 每页数量
///
- public static IEnumerable getListData(Model.Project_HJGLData_Defect table, Grid Grid1)
+ public static IEnumerable getListData(Project_HJGLData_Defect table, Grid Grid1)
{
var q = GetProject_HJGLData_DefectByModle(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
- {
- x.Id,
- x.ProjectId,
- x.UnitId,
- x.CollCropCode,
- x.UnitName,
- x.ReportDate,
- x.DefectName,
- x.DefectNum,
-
- };
+ select new
+ {
+ x.Id,
+ x.ProjectId,
+ x.UnitId,
+ x.CollCropCode,
+ x.UnitName,
+ x.ReportDate,
+ x.DefectName,
+ x.DefectNum
+ };
}
+
#endregion
- public static Model.Project_HJGLData_Defect GetProject_HJGLData_DefectById(string Id)
+ public static Project_HJGLData_Defect GetProject_HJGLData_DefectById(string Id)
{
return db.Project_HJGLData_Defect.FirstOrDefault(x => x.Id == Id);
}
+
///
/// 获取项目该日期的缺陷分析数据
///
///
///
///
- public static List GetProject_HJGLData_DefectByDate(DateTime? reportDate, string projectid)
+ public static List GetProject_HJGLData_DefectByDate(DateTime? reportDate,
+ string projectid)
{
var q = from x in db.Project_HJGLData_Defect
- where x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0 && x.ProjectId == projectid
- select x;
+ where x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0 && x.ProjectId == projectid
+ select x;
return q.ToList();
}
- public static void AddProject_HJGLData_Defect(Model.Project_HJGLData_Defect newtable)
+ public static void AddProject_HJGLData_Defect(Project_HJGLData_Defect newtable)
{
-
- Model.Project_HJGLData_Defect table = new Model.Project_HJGLData_Defect
+ var table = new Project_HJGLData_Defect
{
Id = newtable.Id,
ProjectId = newtable.ProjectId,
@@ -97,16 +96,21 @@ namespace BLL
UnitName = newtable.UnitName,
ReportDate = newtable.ReportDate,
DefectName = newtable.DefectName,
- DefectNum = newtable.DefectNum,
+ DefectNum = newtable.DefectNum
};
db.Project_HJGLData_Defect.InsertOnSubmit(table);
db.SubmitChanges();
}
- public static void UpdateProject_HJGLData_Defect(Model.Project_HJGLData_Defect newtable)
+ public static void AddBulkProject_HJGLData_Defect(List newtables)
{
+ db.Project_HJGLData_Defect.InsertAllOnSubmit(newtables);
+ db.SubmitChanges();
+ }
- Model.Project_HJGLData_Defect table = db.Project_HJGLData_Defect.FirstOrDefault(x => x.Id == newtable.Id);
+ public static void UpdateProject_HJGLData_Defect(Project_HJGLData_Defect newtable)
+ {
+ var table = db.Project_HJGLData_Defect.FirstOrDefault(x => x.Id == newtable.Id);
if (table != null)
{
table.Id = newtable.Id;
@@ -119,31 +123,40 @@ namespace BLL
table.DefectNum = newtable.DefectNum;
db.SubmitChanges();
}
-
}
public static void DeleteProject_HJGLData_DefectById(string Id)
{
-
- Model.Project_HJGLData_Defect table = db.Project_HJGLData_Defect.FirstOrDefault(x => x.Id == Id);
+ var table = db.Project_HJGLData_Defect.FirstOrDefault(x => x.Id == Id);
if (table != null)
{
db.Project_HJGLData_Defect.DeleteOnSubmit(table);
db.SubmitChanges();
}
-
}
- public static void DeleteProject_HJGLData_DefectByDate(DateTime? reportDate, string projectid)
- {
- var table = db.Project_HJGLData_Defect.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0 && x.ProjectId == projectid);
+ public static void DeleteProject_HJGLData_DefectByDate(DateTime? reportDate)
+ {
+ var table = db.Project_HJGLData_Defect.Where(x =>
+ x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0);
if (table != null)
{
db.Project_HJGLData_Defect.DeleteAllOnSubmit(table);
db.SubmitChanges();
}
-
}
+
+ public static void DeleteProject_HJGLData_DefectByDate(DateTime? reportDate, string projectid)
+ {
+ var table = db.Project_HJGLData_Defect.Where(x =>
+ x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0 && x.ProjectId == projectid);
+ if (table != null)
+ {
+ db.Project_HJGLData_Defect.DeleteAllOnSubmit(table);
+ db.SubmitChanges();
+ }
+ }
+
///
/// 判断当天是否已统计数据
///
@@ -152,73 +165,110 @@ namespace BLL
{
var result = false;
var q = (from x in Funs.DB.Project_HJGLData_Defect
- where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date && x.ProjectId == projectid && x.DefectName == type
- select x).ToList();
- if (q != null && q.Count > 0)
- {
- result = true;
- }
+ where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date &&
+ x.ProjectId == projectid && x.DefectName == type
+ select x).ToList();
+ if (q != null && q.Count > 0) result = true;
return result;
}
+
///
/// 根据projectid,获取当天的统计后的数据
///
///
///
- public static Model.Project_HJGLData_Defect getTodayProject_HJGLData_Defect(string projectid, string type)
+ public static Project_HJGLData_Defect getTodayProject_HJGLData_Defect(string projectid, string type)
{
var q = (from x in Funs.DB.Project_HJGLData_Defect
- where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date && x.ProjectId == projectid && x.DefectName == type
- select x).FirstOrDefault();
+ where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date &&
+ x.ProjectId == projectid && x.DefectName == type
+ select x).FirstOrDefault();
return q;
}
- public static List getTodayProject_HJGLData_Defect()
+
+ public static List getTodayProject_HJGLData_Defect()
{
var q = (from x in Funs.DB.Project_HJGLData_Defect
- where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
- group x by x.DefectName into g
- select new Model.HJGLDataDefectItems
- {
- Id = SQLHelper.GetNewID(),
- DefectName = g.Key,
- DefectNum=g.Sum (p=>p.DefectNum)
- }).ToList();
+ where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
+ group x by x.DefectName
+ into g
+ select new HJGLDataDefectItems
+ {
+ Id = SQLHelper.GetNewID(),
+ DefectName = g.Key,
+ DefectNum = g.Sum(p => p.DefectNum)
+ }).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) thisUnitId = thisUnit.UnitId;
+ var baseUnit = UnitService.GetUnitByUnitId(thisUnitId);
+ var data = (from x in db.CH_CheckItem
+ join y in db.CH_Check on x.CHT_CheckID equals y.CHT_CheckID
+ where projectids.Contains(y.ProjectId)
+ group x by new { x.Defects_Definition, y.ProjectId }
+ into g
+ select new
+ {
+ UnitId = thisUnitId,
+ CollCropCode = baseUnit.CollCropCode,
+ UnitName = baseUnit.UnitName,
+ ProjectId = g.Key.ProjectId,
+ ReportDate = DateTime.Now.Date,
+ DefectName = g.Key.Defects_Definition,
+ DefectNum = g.Count(x => x.Defects_Definition == g.Key.Defects_Definition)
+ }).ToList();
+ DeleteProject_HJGLData_DefectByDate(DateTime.Now.Date); //删除当前所有
+ var projectHjglDataDefect = new List();
+ foreach (var item in data
+ )
{
- StatisticalData(item.ProjectId);
+ var table = new Project_HJGLData_Defect
+ {
+ Id = SQLHelper.GetNewID(),
+ UnitId = item.UnitId,
+ CollCropCode = item.CollCropCode,
+ UnitName = item.UnitName,
+ ProjectId = item.ProjectId,
+ ReportDate = item.ReportDate,
+ DefectName = item.DefectName,
+ DefectNum = item.DefectNum
+ };
+ projectHjglDataDefect.Add(table);
}
+
+ AddBulkProject_HJGLData_Defect(projectHjglDataDefect); //批量增加
}
+
///
/// 统计数据
///
///
public static void StatisticalData(string projectid)
{
- string thisUnitId = string.Empty;
- var thisUnit = Const.UnitId_CWCEC;
- if (thisUnit != null)
- {
- thisUnitId = thisUnit;
- }
- var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
+ var thisUnitId = string.Empty;
+ var thisUnit = CommonService.GetIsThisUnit();
+ if (thisUnit != null) thisUnitId = thisUnit.UnitId;
+ var base_Unit = UnitService.GetUnitByUnitId(thisUnitId);
var list = from x in db.CH_CheckItem
- join y in db.CH_Check on x.CHT_CheckID equals y.CHT_CheckID
- where y.ProjectId == projectid
- select x;
+ join y in db.CH_Check on x.CHT_CheckID equals y.CHT_CheckID
+ where y.ProjectId == projectid
+ select x;
var types = (from x in list select x.Defects_Definition).Distinct().ToList();
foreach (var t in types)
- {
if (!string.IsNullOrEmpty(t))
{
- Model.Project_HJGLData_Defect table = new Model.Project_HJGLData_Defect
+ var table = new Project_HJGLData_Defect
{
UnitId = thisUnitId,
CollCropCode = base_Unit.CollCropCode,
@@ -226,7 +276,7 @@ namespace BLL
ProjectId = projectid,
ReportDate = DateTime.Now.Date,
DefectName = t,
- DefectNum = list.Count(x => x.Defects_Definition == t),
+ DefectNum = list.Count(x => x.Defects_Definition == t)
};
if (IsReportByToday(projectid, t))
{
@@ -239,27 +289,26 @@ namespace BLL
AddProject_HJGLData_Defect(table);
}
}
- }
}
+
///
/// 获取缺陷名称
///
///
public static string GetDefectName(string projectid)
{
- string result = "";
+ var result = "";
return result;
}
+
///
/// 获取缺陷数量
///
///
public static int GetDefectNum(string projectid)
{
- int result = 0;
+ var result = 0;
return result;
}
-
-
}
}
\ No newline at end of file
diff --git a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_HJGLService.cs b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_HJGLService.cs
index 11129c27..f8c5dd65 100644
--- a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_HJGLService.cs
+++ b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_HJGLService.cs
@@ -229,10 +229,10 @@ namespace BLL
public static void StatisticalData(string projectid,HJGLDateType hJGLDateType)
{
string thisUnitId = string.Empty;
- var thisUnit = Const.UnitId_CWCEC;
+ var thisUnit = CommonService.GetIsThisUnit();
if (thisUnit != null)
{
- thisUnitId = thisUnit;
+ thisUnitId = thisUnit.UnitId;
}
var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
Model.Project_HJGLData_HJGL table = new Model.Project_HJGLData_HJGL();
@@ -270,7 +270,7 @@ namespace BLL
}
if (hJGLDateType == HJGLDateType.DefectAnalysis || hJGLDateType == HJGLDateType.All)
{
- Project_HJGLData_DefectService.StatisticalData(projectid);
+ // Project_HJGLData_DefectService.StatisticalData(projectid);
}
if (IsReportByToday(projectid))
@@ -367,31 +367,10 @@ namespace BLL
///
public static int GetTotalFilmNum(string projectid)
{
- int result = 0;
- if (projectid != null)
- {
- var getD1 = from x in Funs.DB.HJGL_FL_NdtList
- where x.ProjectId == projectid.ToString()
- select x;
- if (getD1.Count() > 0)
- {
- foreach (var item in getD1)
- {
- result += Funs.GetNewIntOrZero(item.OneTimeFilmAmount.Split('.')[0]);
- }
- }
- else
- {
- var getD2 = (from x in Funs.DB.HJGL_FL_Data
- where x.ProjectId == projectid.ToString()
- orderby x.CompileDate descending
- select x).FirstOrDefault();
- if (getD2 != null)
- {
- result = Funs.GetNewIntOrZero(getD2.OneTimeFilmAmount.Split('.')[0]);
- }
- }
- }
+ int result = Convert.ToInt32((from x in Funs.DB.CH_CheckItem
+ join y in Funs.DB.CH_Check on x.CHT_CheckID equals y.CHT_CheckID
+ where y.ProjectId == projectid
+ select x.CHT_TotalFilm ).ToList().Sum());
return result;
}
///
@@ -400,31 +379,10 @@ namespace BLL
///
public static int GetOKFilmNum(string projectid)
{
- int result = 0;
- if (projectid != null)
- {
- var getD1 = from x in Funs.DB.HJGL_FL_NdtList
- where x.ProjectId == projectid.ToString()
- select x;
- if (getD1.Count() > 0)
- {
- foreach (var item in getD1)
- {
- result += Funs.GetNewIntOrZero(item.OneTimeFilmQualifiedAmount.Split('.')[0]);
- }
- }
- else
- {
- var getD2 = (from x in Funs.DB.HJGL_FL_Data
- where x.ProjectId == projectid.ToString()
- orderby x.CompileDate descending
- select x).FirstOrDefault();
- if (getD2 != null)
- {
- result = Funs.GetNewIntOrZero(getD2.OneTimeFilmQualifiedAmount.Split('.')[0]);
- }
- }
- }
+ int result = Convert.ToInt32((from x in Funs.DB.CH_CheckItem
+ join y in Funs.DB.CH_Check on x.CHT_CheckID equals y.CHT_CheckID
+ where y.ProjectId == projectid
+ select x.CHT_PassFilm).ToList().Sum());
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 87398153..99dba82a 100644
--- a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HSSEService.cs
+++ b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HSSEService.cs
@@ -1,224 +1,116 @@
-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 SGGLDB db = Funs.DB;
+
///
- /// 记录数
- ///
- public static int count
- {
- get;
- set;
- }
- public static List GetProject_HSSEData_HSSEByModle(Model.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))
- select x
- ;
-
- return q.ToList();
- }
-
- /// 获取分页列表
- ///
- /// 页码
- /// 每页数量
- ///
- public static IEnumerable getListData(Model.Project_HSSEData_HSSE table, Grid Grid1)
- {
- var q = GetProject_HSSEData_HSSEByModle(table);
- 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
- {
- x.Id,
- x.ProjectId,
- x.UnitId,
- x.CollCropCode,
- x.UnitName,
- x.ReportDate,
- x.BeUnderConstructionNum,
- x.ShutdownNum,
- x.JoinConstructionPersonNum,
- x.MajorProjectsUnderConstructionNum,
- x.TotalWorkingHour,
- x.LostWorkingHour,
- x.SafeWorkingHour,
- x.SafeTrainNum,
- x.SpecialTrainNum,
- x.SpecialOperationTrainNum,
- x.TotalEnergyConsumption,
- x.IncomeComprehensiveEnergyConsumption,
- x.NewWaterConsumption,
- x.HeadOfficeInspectorGeneralNum,
- x.HeadOfficeFullTimeNum,
- x.BranchInspectorGeneralNum,
- x.BranchFullTimeNum,
- x.ProjectInspectorGeneralNum,
- x.ProjectFullTimeNum,
- x.ProjectSafetyMonitorNum,
- x.SafetyInjectionEngineer,
- x.CertificateANum,
- x.CertificateBNum,
- x.CertificateCNum,
- x.SafetyCommitteeMeetingNum,
- x.EnterpriseTopicsMeetingNum,
- x.ProjectSafetyLeadingGroupMeetingNum,
- x.ProjectSafetyMeetingNum,
- x.CompanyLeadShiftCheckNum,
- x.CompanyComprehensiveCheckNum,
- x.CompanySpecialCheckNum,
- x.ProjectLeadShiftCheckNum,
- x.ProjectSpecialCheckNum,
- x.ProjectMajorCheckNum,
- x.NearMissNum,
- x.RecordableEventNum,
- x.GeneralAccidentNum,
- x.MajorAccidentNum,
- x.SeriousAccidentNum,
- x.SpecialSeriousAccidentNum,
- x.CompanyComprehensivePlanNum,
- x.CompanySpecialPlanNum,
- x.CompanyOnSiteDisposalPlan,
- x.CompanyDrillNum,
- x.ProjectComprehensivePlanNum,
- x.ProjectSpecialPlanNum,
- x.ProjectOnSiteDisposalPlan,
- x.ProjectDrillNum,
- x.CostExtract,
- x.CostUse,
- x.UseEquipmentNum,
- x.SpecialEquipmentNum,
- x.LicensesNum,
- x.LicensesCloseNum,
- x.GeneralClosedNum,
- x.GeneralNotClosedNum,
- x.MajorClosedNum,
- x.MajorNotClosedNum,
- x.GeneralRiskNum,
- x.LowRiskNum,
- x.MediumRiskNum,
- x.HighRiskNum,
- x.CompletedNum,
- x.TrainPersonNum,
- x.ConstructionNum,
- x.FinishedNum,
- x.SuperCompletedNum,
- x.SuperTrainPersonNum,
- x.SuperConstructionNum,
- x.SuperFinishedNum,
-
- };
- }
- #endregion
- ///
- /// 新增实体
+ /// 新增实体
///
///
- public static void AddProject_HSSEData_HSSE(Model.Project_HSSEData_HSSE newtable)
+ public static void AddProject_HSSEData_HSSE(Project_HSSEData_HSSE newtable)
{
- using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ using (var db = new SGGLDB(Funs.ConnString))
{
- Model.Project_HSSEData_HSSE table = new Model.Project_HSSEData_HSSE
+ var table = new Project_HSSEData_HSSE
{
Id = newtable.Id,
ProjectId = newtable.ProjectId,
@@ -295,21 +187,22 @@ namespace BLL
SuperCompletedNum = newtable.SuperCompletedNum,
SuperTrainPersonNum = newtable.SuperTrainPersonNum,
SuperConstructionNum = newtable.SuperConstructionNum,
- SuperFinishedNum = newtable.SuperFinishedNum,
+ SuperFinishedNum = newtable.SuperFinishedNum
};
db.Project_HSSEData_HSSE.InsertOnSubmit(table);
db.SubmitChanges();
}
}
+
///
- /// 删除实体
+ /// 删除实体
///
///
public static void DeleteProject_HSSEData_HSSEById(string Id)
{
- using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ using (var db = new SGGLDB(Funs.ConnString))
{
- Model.Project_HSSEData_HSSE table = db.Project_HSSEData_HSSE.FirstOrDefault(x => x.Id == Id);
+ var table = db.Project_HSSEData_HSSE.FirstOrDefault(x => x.Id == Id);
if (table != null)
{
db.Project_HSSEData_HSSE.DeleteOnSubmit(table);
@@ -317,30 +210,33 @@ namespace BLL
}
}
}
+
///
- /// 根据id获取实体
+ /// 根据id获取实体
///
///
///
- public static Model.Project_HSSEData_HSSE GetProject_HSSEData_HSSEById(string 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)
+
+ public static List GetProject_HSSEData_HSSEByProjectid(string Projectid)
{
- using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ using (var db = new SGGLDB(Funs.ConnString))
{
var q = (from x in db.Project_HSSEData_HSSE
- where x.ProjectId == Projectid
- select x).ToList();
+ where x.ProjectId == Projectid
+ select x).ToList();
return q;
}
}
- public static void UpdateProject_HSSEData_HSSE(Model.Project_HSSEData_HSSE newtable)
+
+ public static void UpdateProject_HSSEData_HSSE(Project_HSSEData_HSSE newtable)
{
- using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ using (var db = new SGGLDB(Funs.ConnString))
{
- Model.Project_HSSEData_HSSE table = db.Project_HSSEData_HSSE.FirstOrDefault(x => x.Id == newtable.Id);
+ var table = db.Project_HSSEData_HSSE.FirstOrDefault(x => x.Id == newtable.Id);
if (table != null)
{
table.Id = newtable.Id;
@@ -423,8 +319,9 @@ namespace BLL
}
}
}
+
///
- /// 判断该项目的该日期是否统计数据
+ /// 判断该项目的该日期是否统计数据
///
///
///
@@ -433,108 +330,102 @@ namespace BLL
{
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;
- }
+ 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;
- }
+ 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,获取该项目当天的统计数据
+ /// 根据projectid,获取该项目当天的统计数据
///
///
///
- public static Model.Project_HSSEData_HSSE getProject_HSSEData_HSSEByDate(string 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();
+ 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);
- }
+ foreach (var item in projectlist) StatisticalData(item.ProjectId, HSSEDateType.All);
}
+
///
- /// 统计数据
+ /// 统计数据
///
///
- public static void StatisticalData(string projectid, HSSEDateType hSSEDateType)
+ ///
+ public static void StatisticalData(string projectid, HSSEDateType hSseDateType)
{
- string thisUnitId = string.Empty;
- var thisUnit = Const.UnitId_CWCEC;
- if (thisUnit != null)
- {
- thisUnitId = thisUnit;
- }
- var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
- Model.Project_HSSEData_HSSE table = new Model.Project_HSSEData_HSSE();
+ 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 = 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 (hSSEDateType == HSSEDateType.ProjectInformation || hSSEDateType == HSSEDateType.All)
+ 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)
+
+ 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)
+
+ 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)
+
+ 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)
+
+ if (hSseDateType == HSSEDateType.OfSafetySupervisors || hSseDateType == HSSEDateType.All)
{
table.HeadOfficeInspectorGeneralNum = GetHeadOfficeInspectorGeneralNum(projectid);
table.HeadOfficeFullTimeNum = GetHeadOfficeFullTimeNum(projectid);
@@ -548,14 +439,16 @@ namespace BLL
table.CertificateBNum = GetCertificateBNum(projectid);
table.CertificateCNum = GetCertificateCNum(projectid);
}
- if (hSSEDateType == HSSEDateType.SafetyMeeting || hSSEDateType == HSSEDateType.All)
+
+ 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)
+
+ if (hSseDateType == HSSEDateType.SupervisionAndInspection || hSseDateType == HSSEDateType.All)
{
table.CompanyLeadShiftCheckNum = GetCompanyLeadShiftCheckNum(projectid);
table.CompanyComprehensiveCheckNum = GetCompanyComprehensiveCheckNum(projectid);
@@ -563,9 +456,9 @@ namespace BLL
table.ProjectLeadShiftCheckNum = GetProjectLeadShiftCheckNum(projectid);
table.ProjectSpecialCheckNum = GetProjectSpecialCheckNum(projectid);
table.ProjectMajorCheckNum = GetProjectMajorCheckNum(projectid);
-
}
- if (hSSEDateType == HSSEDateType.AccidentEvent || hSSEDateType == HSSEDateType.All)
+
+ if (hSseDateType == HSSEDateType.AccidentEvent || hSseDateType == HSSEDateType.All)
{
table.NearMissNum = GetNearMissNum(projectid);
table.RecordableEventNum = GetRecordableEventNum(projectid);
@@ -574,7 +467,8 @@ namespace BLL
table.SeriousAccidentNum = GetSeriousAccidentNum(projectid);
table.SpecialSeriousAccidentNum = GetSpecialSeriousAccidentNum(projectid);
}
- if (hSSEDateType == HSSEDateType.EmergencyManagement || hSSEDateType == HSSEDateType.All)
+
+ if (hSseDateType == HSSEDateType.EmergencyManagement || hSseDateType == HSSEDateType.All)
{
table.CompanyComprehensivePlanNum = GetCompanyComprehensivePlanNum(projectid);
table.CompanySpecialPlanNum = GetCompanySpecialPlanNum(projectid);
@@ -585,40 +479,84 @@ namespace BLL
table.ProjectOnSiteDisposalPlan = GetProjectOnSiteDisposalPlan(projectid);
table.ProjectDrillNum = GetProjectDrillNum(projectid);
}
- if (hSSEDateType == HSSEDateType.SecurityCost || hSSEDateType == HSSEDateType.All)
+
+ if (hSseDateType == HSSEDateType.SecurityCost || hSseDateType == HSSEDateType.All)
{
table.CostExtract = GetCostExtract(projectid);
table.CostUse = GetCostUse(projectid);
}
- if (hSSEDateType == HSSEDateType.ConstructionEquipment || hSSEDateType == HSSEDateType.All)
+
+ if (hSseDateType == HSSEDateType.ConstructionEquipment || hSseDateType == HSSEDateType.All)
{
table.UseEquipmentNum = GetUseEquipmentNum(projectid);
table.SpecialEquipmentNum = GetSpecialEquipmentNum(projectid);
}
- if (hSSEDateType == HSSEDateType.WorkPermit || hSSEDateType == HSSEDateType.All)
+
+ if (hSseDateType == HSSEDateType.WorkPermit || hSseDateType == HSSEDateType.All)
{
table.LicensesNum = GetLicensesNum(projectid);
table.LicensesCloseNum = GetLicensesCloseNum(projectid);
}
- if (hSSEDateType == HSSEDateType.HiddenDangerTroubleshooting || hSSEDateType == HSSEDateType.All)
+
+ 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)
+
+ 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)
+
+ if (hSseDateType == HSSEDateType.HiddenDangerCategory || hSseDateType == HSSEDateType.All)
{
- Project_HSSEData_HiddenDangerDetailService.StatisticalData(projectid);
+ 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)
+
+ if (hSseDateType == HSSEDateType.DangerousProject || hSseDateType == HSSEDateType.All)
{
table.CompletedNum = GetCompletedNum(projectid);
table.TrainPersonNum = GetTrainPersonNum(projectid);
@@ -629,766 +567,1003 @@ namespace BLL
table.SuperConstructionNum = GetSuperConstructionNum(projectid);
table.SuperFinishedNum = GetSuperFinishedNum(projectid);
}
- if (IsReportByToday(projectid))
- {
- UpdateProject_HSSEData_HSSE(table);
- }
- else
- {
- AddProject_HSSEData_HSSE(table);
- }
- HSSEData_HSSEService.UpdateTodyData_State();
+ 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();
+ 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)
{
- int result = (from x in Funs.DB.Base_Project where x.ProjectState == "2" && x.ProjectId == projectid select x).Count();
+ 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)
{
- int result = (from x in Funs.DB.SitePerson_Person where x.ProjectId == projectid && x.IsUsed == true select x).Count();
+ var result = (from x in Funs.DB.SitePerson_Person
+ where x.ProjectId == projectid && x.IsUsed == true
+ 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();
+ 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
- select x.PersonWorkTime).ToList().Sum(x => x.Value);
- var q = Funs.GetNewIntOrZero(result.ToString());
+ 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 select x.WorkHoursLoss).ToList().Sum(x => x.Value)
- + (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid select x.WorkingHoursLoss).ToList().Sum(x => x.Value);
- var q = Funs.GetNewIntOrZero(result.ToString());
+ 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
- select x.PersonWorkTime).ToList().Sum(x => x.Value);
- var result2 = (from x in Funs.DB.Accident_AccidentHandle where x.ProjectId == projectid select x.WorkHoursLoss).ToList().Sum(x => x.Value)
- + (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid select x.WorkingHoursLoss).ToList().Sum(x => x.Value);
+ 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());
+ var q = Funs.GetNewIntOrZero(result.ToString().Split('.')[0]);
return q;
}
+
///
- /// 获取三级安全教育培训数
+ /// 获取三级安全教育培训数
///
///
public static int GetSafeTrainNum(string projectid)
{
- 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 && y.TrainType == "1"
- select x).Count();
+ 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)
{
- 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 && y.TrainType == "2"
- select x).Count();
+ 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)
{
- 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 && y.TrainType == "3"
- select x).Count();
+ 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)
{
- int result = 0;
+ var result = 0;
return result;
}
+
///
- /// 获取万元营业收入综合能耗
+ /// 获取万元营业收入综合能耗
///
///
public static int GetIncomeComprehensiveEnergyConsumption(string projectid)
{
- int result = 0;
+ var result = 0;
return result;
}
+
///
- /// 获取用新水量
+ /// 获取二氧化碳
///
///
public static int GetNewWaterConsumption(string projectid)
{
- int result = 0;
+ var result = 0;
return result;
}
+
///
- /// 获取企业总部总监人数
+ /// 获取企业总部总监人数
///
///
public static int GetHeadOfficeInspectorGeneralNum(string projectid)
{
- int result = 0;
+ var result = 0;
return result;
}
+
///
- /// 获取企业总部专职人数
+ /// 获取企业总部专职人数
///
///
public static int GetHeadOfficeFullTimeNum(string projectid)
{
- int result = 0;
+ var result = 0;
return result;
}
+
///
- /// 获取分支机构总监人数
+ /// 获取分支机构总监人数
///
///
public static int GetBranchInspectorGeneralNum(string projectid)
{
- int result = 0;
+ var result = 0;
return result;
}
+
///
- /// 获取分支机构专职人数
+ /// 获取分支机构专职人数
///
///
public static int GetBranchFullTimeNum(string projectid)
{
- int result = 0;
+ var 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();
+ var result = (from x in Funs.DB.SitePerson_Person
+ where x.ProjectId == projectid && x.WorkPostId == Const.WorkPost_ProjectHSSEDirector && x.IsUsed == true
+ select x).Count();
return result;
}
+
///
- /// 获取项目专职人数
+ /// 获取项目专职人数
///
///
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.IsUsed == true
- select x).Count();
+ 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.IsUsed == true
+ 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();
+ var result = (from x in Funs.DB.SitePerson_Person
+ where x.ProjectId == projectid && x.IsSafetyMonitoring == true && x.IsUsed == true
+ select x).Count();
return result;
}
+
///
- /// 获取在岗执业注安师
+ /// 获取在岗执业注安师
///
///
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();
+ 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.IsUsed == true
+ select x).Count();
return result;
}
+
///
- /// 获取A证人员
+ /// 获取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();
+ 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.IsUsed == true
+ select x).Count();
return result;
}
+
///
- /// 获取B证人员
+ /// 获取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();
+ 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.IsUsed == true
+ select x).Count();
return result;
}
+
///
- /// 获取C证人员
+ /// 获取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();
+ 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.IsUsed == true
+ select x).Count();
return result;
}
+
///
- /// 获取企业安委会会议数
+ /// 获取企业安委会会议数
///
///
public static int GetSafetyCommitteeMeetingNum(string projectid)
{
- int result = 0;
+ var result = 0;
return result;
}
+
///
- /// 获取企业专题会议数
+ /// 获取企业专题会议数
///
///
public static int GetEnterpriseTopicsMeetingNum(string projectid)
{
- int result = 0;
+ var result = 0;
return result;
}
+
///
- /// 获取项目安全领导小组会议数
+ /// 获取项目安全领导小组会议数
///
///
public static int GetProjectSafetyLeadingGroupMeetingNum(string projectid)
{
- int result = (from x in Funs.DB.Meeting_SafetyLeaderGroupMeeting where x.ProjectId == projectid select x).Count();
+ 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)
{
- int result = (from x in Funs.DB.Meeting_WeekMeeting where x.ProjectId == projectid select x).Count()
- + (from x in Funs.DB.Meeting_MonthMeeting where x.ProjectId == projectid select x).Count();
+ 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)
{
- int result = 0;
+ var result = 0;
return result;
}
+
///
- /// 获取企业综合检查次数
- ///
+ /// 获取企业综合检查次数
+ ///
///
public static int GetCompanyComprehensiveCheckNum(string projectid)
{
- int result = 0;
+ var result = 0;
return result;
}
+
///
- /// 获取企业专项检查次数
+ /// 获取企业专项检查次数
///
///
public static int GetCompanySpecialCheckNum(string projectid)
{
- int result = 0;
+ var result = 0;
return result;
}
+
///
- /// 获取项目负责人带班检查次数
+ /// 获取项目负责人带班检查次数
///
///
public static int GetProjectLeadShiftCheckNum(string projectid)
{
- int result = (from x in Funs.DB.Check_ProjectLeaderCheck where x.ProjectId == projectid select x).Count();
+ 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)
{
- int result = (from x in Funs.DB.Check_CheckSpecial where x.ProjectId == projectid select x).Count();
+ 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)
{
- int result = (from x in Funs.DB.HSSE_Hazard_HazardRegister where x.ProjectId == projectid select x).Count();
+ 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)
{
- 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.IsAttempt == "1"
- select x).Count();
+ 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)
{
- 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
- select x).Count();
+ 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)
{
- int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDegree == "1" select x).Count();
+ 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)
{
- int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDegree == "2" select x).Count();
+ 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)
{
- int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDegree == "3" select x).Count();
+ 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)
{
- int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDegree == "4" select x).Count();
+ 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)
{
- int result = 0;
+ var result = 0;
return result;
}
+
///
- /// 获取企业级专项预案数
+ /// 获取企业级专项预案数
///
///
public static int GetCompanySpecialPlanNum(string projectid)
{
- int result = 0;
+ var result = 0;
return result;
}
+
///
- /// 获取企业级现场处置预案
+ /// 获取企业级现场处置预案
///
///
public static int GetCompanyOnSiteDisposalPlan(string projectid)
{
- int result = 0;
+ var result = 0;
return result;
}
+
///
- /// 获取企业级演练次数
+ /// 获取企业级演练次数
///
///
public static int GetCompanyDrillNum(string projectid)
{
- int result = 0;
+ var result = 0;
return result;
}
+
///
- /// 获取项目级综合预案
+ /// 获取项目级综合预案
///
///
public static int GetProjectComprehensivePlanNum(string projectid)
{
- 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 && y.EmergencyTypeName.Contains("综合")
- select x).Count();
+ 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)
{
- 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 && y.EmergencyTypeName.Contains("专项")
- select x).Count();
+ 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)
{
- 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 && y.EmergencyTypeName.Contains("现场处置")
- select x).Count();
+ 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)
{
- int result = (from x in Funs.DB.Emergency_DrillRecordList
- where x.ProjectId == projectid
- select x).Count();
+ 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)
{
- int result = 0;
+ var result = 0;
return result;
}
+
///
- /// 获取费用使用(万元)
+ /// 获取费用使用(万元)
///
///
public static int GetCostUse(string projectid)
{
- int result = 0;
+ 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
- select x.CostMoney ?? 0).ToList().Sum();
+ 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)
{
- 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();
+ 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 result;
}
+
///
- /// 获取施工机具特种设备数
+ /// 获取施工机具特种设备数
///
///
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();
+ 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 result;
}
+
///
- /// 获取作业许可项数
+ /// 获取作业许可项数
///
///
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();
+ var result = (from x in Funs.DB.License_LicenseManager
+ where x.ProjectId == projectid && x.IsHighRisk == true && x.CompileDate > Const.DtmarkTime
+ select x).Count();
return result;
}
+
///
- /// 获取作业许可关闭项数
+ /// 获取作业许可关闭项数
///
///
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();
+ 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 result;
}
+
///
- /// 获取一般隐患整改闭环项
+ /// 获取一般隐患整改闭环项
///
///
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();
+ 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 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();
+ 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 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();
+ 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 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();
+ 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 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();
+ 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)
{
- 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();
+ 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)
{
- 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();
+ 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)
{
- 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();
+ 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)
{
- int result = (from x in Funs.DB.Solution_LargerHazard
- where x.ProjectId == projectid && x.States == "1" && x.IsSuperLargerHazard == false
- select x).Count();
+ 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)
{
- int result = (from x in Funs.DB.Solution_LargerHazard
- where x.ProjectId == projectid && x.IsSuperLargerHazard == false
- select x.TrainPersonNum).ToList().Sum(x => x.Value);
+ 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)
{
- int result = (from x in Funs.DB.Solution_LargerHazard
- where x.ProjectId == projectid && x.States == "2" && x.IsSuperLargerHazard == false
- select x).Count();
+ 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)
{
- int result = (from x in Funs.DB.Solution_LargerHazard
- where x.ProjectId == projectid && x.States == "3" && x.IsSuperLargerHazard == false
- select x).Count();
+ 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)
{
- int result = (from x in Funs.DB.Solution_LargerHazard
- where x.ProjectId == projectid && x.States == "1" && x.IsSuperLargerHazard == true
- select x).Count();
+ 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)
{
- int result = (from x in Funs.DB.Solution_LargerHazard where x.ProjectId == projectid && x.IsSuperLargerHazard == true select x.TrainPersonNum).ToList().Sum(x => x.Value);
+ 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)
{
- int result = (from x in Funs.DB.Solution_LargerHazard
- where x.ProjectId == projectid && x.States == "2" && x.IsSuperLargerHazard == true
- select x).Count();
+ 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)
{
- int result = (from x in Funs.DB.Solution_LargerHazard
- where x.ProjectId == projectid && x.States == "3" && x.IsSuperLargerHazard == true
- select x).Count();
+ 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))
+ select x
+ ;
+
+ return q.ToList();
+ }
+
+ /// 获取分页列表
+ ///
+ ///
+ ///
+ public static IEnumerable GetListData(Project_HSSEData_HSSE table, Grid grid1)
+ {
+ var q = GetProject_HSSEData_HSSEByModle(table);
+ 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
+ {
+ x.Id,
+ x.ProjectId,
+ x.UnitId,
+ x.CollCropCode,
+ x.UnitName,
+ x.ReportDate,
+ x.BeUnderConstructionNum,
+ x.ShutdownNum,
+ x.JoinConstructionPersonNum,
+ x.MajorProjectsUnderConstructionNum,
+ x.TotalWorkingHour,
+ x.LostWorkingHour,
+ x.SafeWorkingHour,
+ x.SafeTrainNum,
+ x.SpecialTrainNum,
+ x.SpecialOperationTrainNum,
+ x.TotalEnergyConsumption,
+ x.IncomeComprehensiveEnergyConsumption,
+ x.NewWaterConsumption,
+ x.HeadOfficeInspectorGeneralNum,
+ x.HeadOfficeFullTimeNum,
+ x.BranchInspectorGeneralNum,
+ x.BranchFullTimeNum,
+ x.ProjectInspectorGeneralNum,
+ x.ProjectFullTimeNum,
+ x.ProjectSafetyMonitorNum,
+ x.SafetyInjectionEngineer,
+ x.CertificateANum,
+ x.CertificateBNum,
+ x.CertificateCNum,
+ x.SafetyCommitteeMeetingNum,
+ x.EnterpriseTopicsMeetingNum,
+ x.ProjectSafetyLeadingGroupMeetingNum,
+ x.ProjectSafetyMeetingNum,
+ x.CompanyLeadShiftCheckNum,
+ x.CompanyComprehensiveCheckNum,
+ x.CompanySpecialCheckNum,
+ x.ProjectLeadShiftCheckNum,
+ x.ProjectSpecialCheckNum,
+ x.ProjectMajorCheckNum,
+ x.NearMissNum,
+ x.RecordableEventNum,
+ x.GeneralAccidentNum,
+ x.MajorAccidentNum,
+ x.SeriousAccidentNum,
+ x.SpecialSeriousAccidentNum,
+ x.CompanyComprehensivePlanNum,
+ x.CompanySpecialPlanNum,
+ x.CompanyOnSiteDisposalPlan,
+ x.CompanyDrillNum,
+ x.ProjectComprehensivePlanNum,
+ x.ProjectSpecialPlanNum,
+ x.ProjectOnSiteDisposalPlan,
+ x.ProjectDrillNum,
+ x.CostExtract,
+ x.CostUse,
+ x.UseEquipmentNum,
+ x.SpecialEquipmentNum,
+ x.LicensesNum,
+ x.LicensesCloseNum,
+ x.GeneralClosedNum,
+ x.GeneralNotClosedNum,
+ x.MajorClosedNum,
+ x.MajorNotClosedNum,
+ x.GeneralRiskNum,
+ x.LowRiskNum,
+ x.MediumRiskNum,
+ x.HighRiskNum,
+ x.CompletedNum,
+ x.TrainPersonNum,
+ x.ConstructionNum,
+ x.FinishedNum,
+ x.SuperCompletedNum,
+ x.SuperTrainPersonNum,
+ x.SuperConstructionNum,
+ x.SuperFinishedNum
+ };
+ }
+
+ #endregion
}
}
\ 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 38b7f292..7df3c5e8 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判断当天项目是否已统计数据
@@ -198,59 +223,57 @@ namespace BLL
}
public static void StatisticalAllProjectData()
{
- var projectlist = ProjectService.GetProjectWorkList();
- foreach (var item in projectlist)
- {
- StatisticalData(item.ProjectId);
- }
- }
- ///
- /// 统计数据
- ///
- ///
- public static void StatisticalData(string projectid)
- {
- string thisUnitId = string.Empty;
- var thisUnit = Const.UnitId_CWCEC;
+ var db = Funs.DB;
+
+ var projectids = ProjectService.GetProjectWorkList().Select(x => x.ProjectId).ToList();
+ var thisUnitId = string.Empty;
+ var thisUnit = CommonService.GetIsThisUnit();
if (thisUnit != null)
{
- thisUnitId = thisUnit;
+ thisUnitId = thisUnit.UnitId;
}
- var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
- 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
+ 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 = base_Unit.CollCropCode,
- UnitName = base_Unit.UnitName,
- ProjectId = projectid,
+ CollCropCode = baseUnit.CollCropCode,
+ UnitName = baseUnit.UnitName,
+ ProjectId= g.Key.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)),
+ 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,
+
};
- 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);
- }
+ projectHsseDataHiddenDangerDetails.Add(table);
}
+ AddBulkProject_HSSEData_HiddenDangerDetails(projectHsseDataHiddenDangerDetails);
+
}
+
///
/// 获取类别名称
///
diff --git a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_SYHSEData_SYHSEService.cs b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_SYHSEData_SYHSEService.cs
index b966a73e..189d7baa 100644
--- a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_SYHSEData_SYHSEService.cs
+++ b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_SYHSEData_SYHSEService.cs
@@ -298,10 +298,10 @@ namespace BLL
public static void StatisticalData(string projectid,SYHSESDateType sYHSESDateType)
{
string thisUnitId = string.Empty;
- var thisUnit = Const.UnitId_CWCEC;
+ var thisUnit = CommonService.GetIsThisUnit();
if (thisUnit != null)
{
- thisUnitId = thisUnit;
+ thisUnitId = thisUnit.UnitId;
}
var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
Model.Project_SYHSEData_SYHSE table = new Model.Project_SYHSEData_SYHSE();
diff --git a/SGGL/BLL/ZHGL/DataSync/SYHSEData_DataService.cs b/SGGL/BLL/ZHGL/DataSync/SYHSEData_DataService.cs
index a9282e0d..ad280ff4 100644
--- a/SGGL/BLL/ZHGL/DataSync/SYHSEData_DataService.cs
+++ b/SGGL/BLL/ZHGL/DataSync/SYHSEData_DataService.cs
@@ -143,7 +143,7 @@ namespace BLL
};
APIDataList_Risk.Add(q);
}
- var thisUnit = UnitService.GetUnitByUnitId(Const.UnitId_CWCEC);
+ var thisUnit = CommonService.GetIsThisUnit();
NewSYHSEDataItem Item = new NewSYHSEDataItem();
Item.Id = data.Id;
diff --git a/SGGL/BLL/ZHGL/DataSync/SYHSEData_SYHSEService.cs b/SGGL/BLL/ZHGL/DataSync/SYHSEData_SYHSEService.cs
index 92b91047..31f91a76 100644
--- a/SGGL/BLL/ZHGL/DataSync/SYHSEData_SYHSEService.cs
+++ b/SGGL/BLL/ZHGL/DataSync/SYHSEData_SYHSEService.cs
@@ -283,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
{
@@ -350,10 +351,10 @@ namespace BLL
public static SYHSEData StatisticalData()
{
string thisUnitId = string.Empty;
- var thisUnit = Const.UnitId_CWCEC;
+ var thisUnit = CommonService.GetIsThisUnit();
if (thisUnit != null)
{
- thisUnitId = thisUnit;
+ thisUnitId = thisUnit.UnitId;
}
var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
var ProjectData = (from x in Funs.DB.Project_SYHSEData_SYHSE
diff --git a/SGGL/BLL/ZHGL/DataSync/ServerService.cs b/SGGL/BLL/ZHGL/DataSync/ServerService.cs
index 14ee45b7..77ad9f81 100644
--- a/SGGL/BLL/ZHGL/DataSync/ServerService.cs
+++ b/SGGL/BLL/ZHGL/DataSync/ServerService.cs
@@ -22,7 +22,7 @@ namespace BLL
client.Timeout = -1;
var request = new RestRequest(Method.POST);
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
- var thisUnit = UnitService.GetUnitByUnitId(Const.UnitId_CWCEC);
+ var thisUnit = CommonService.GetIsThisUnit();
request.AddParameter("UnitName", thisUnit.UnitName);
request.AddParameter("CollCropCode", thisUnit.CollCropCode);
//request.AddJsonBody(JsonBody);
diff --git a/SGGL/BLL/ZHGL/Environmental/ChemicalReportItemService.cs b/SGGL/BLL/ZHGL/Environmental/ChemicalReportItemService.cs
index 3bca7f98..227be4ef 100644
--- a/SGGL/BLL/ZHGL/Environmental/ChemicalReportItemService.cs
+++ b/SGGL/BLL/ZHGL/Environmental/ChemicalReportItemService.cs
@@ -379,5 +379,50 @@ namespace BLL
list[98] = new ListItem("万元", "99");
return list;
}
+
+ 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
new file mode 100644
index 00000000..e412d33b
--- /dev/null
+++ b/SGGL/FineUIPro.Web/AttachFile/OnlineEditing.aspx
@@ -0,0 +1,298 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OnlineEditing.aspx.cs" Inherits="FineUIPro.Web.AttachFile.OnlineEditing" %>
+
+
+
+
+
+
+
+
+
+ Spire.Office
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/AttachFile/OnlineEditing.aspx.cs b/SGGL/FineUIPro.Web/AttachFile/OnlineEditing.aspx.cs
new file mode 100644
index 00000000..9632e4c5
--- /dev/null
+++ b/SGGL/FineUIPro.Web/AttachFile/OnlineEditing.aspx.cs
@@ -0,0 +1,96 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using BLL;
+
+namespace FineUIPro.Web.AttachFile
+{
+ public partial class OnlineEditing :PageBase
+ {
+ #region 定义参数
+ public string Appid
+ {
+ get
+ {
+ var sysSet = (from x in Funs.DB.Sys_Set where x.SetName == "OnlineEditAppid" select x).ToList().FirstOrDefault();
+ if (sysSet != null)
+ {
+ return sysSet.SetValue;
+ }
+ else
+ {
+ return "";
+ }
+ }
+ }
+ public string Appkey
+ {
+ get
+ {
+ var sysSet = (from x in Funs.DB.Sys_Set where x.SetName == "OnlineEditAppkey" select x).ToList().FirstOrDefault();
+ if (sysSet != null)
+ {
+ return sysSet.SetValue;
+ }
+ else
+ {
+ return "";
+ }
+ }
+ }
+ public string CallBackUrl
+ {
+ get
+ {
+ var sysSet = (from x in Funs.DB.Sys_Set where x.SetName == "OnlineEditCallBackurl" select x).ToList().FirstOrDefault();
+ if (sysSet != null)
+ {
+ return sysSet.SetValue;
+ }
+ else
+ {
+ return "";
+ }
+ }
+ }
+ public string ReadOnly
+ {
+ get
+ {
+ return (string)ViewState["ReadOnly"];
+ }
+ set
+ {
+ ViewState["ReadOnly"] = value;
+ }
+ }
+ public string PCUrl
+ {
+ get
+ {
+ return (string)ViewState["PCUrl"];
+ }
+ set
+ {
+ ViewState["PCUrl"] = value;
+ }
+ }
+ #endregion
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ /*UserId = Request.Params["UserId"];
+ AttachFileId = Request.Params["AttachFileId"];
+ ReadOnly = Request.Params["ReadOnly"];*/
+ PCUrl = Request.Params["fileUrl"];
+
+
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/AttachFile/OnlineEditing.aspx.designer.cs b/SGGL/FineUIPro.Web/AttachFile/OnlineEditing.aspx.designer.cs
new file mode 100644
index 00000000..ec9d1dd5
--- /dev/null
+++ b/SGGL/FineUIPro.Web/AttachFile/OnlineEditing.aspx.designer.cs
@@ -0,0 +1,17 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace FineUIPro.Web.AttachFile
+{
+
+
+ public partial class OnlineEditing
+ {
+ }
+}
diff --git a/SGGL/FineUIPro.Web/AttachFile/fileupload.ashx.cs b/SGGL/FineUIPro.Web/AttachFile/fileupload.ashx.cs
index 49a1af5f..9e4acd0c 100644
--- a/SGGL/FineUIPro.Web/AttachFile/fileupload.ashx.cs
+++ b/SGGL/FineUIPro.Web/AttachFile/fileupload.ashx.cs
@@ -26,7 +26,7 @@ namespace FineUIPro.Web.AttachFile
string owner = context.Request.Form["owner"];
string sessionName = owner.Split('|')[0];
string attachPath = owner.Split('|')[1] + "/" + DateTime.Now.ToString("yyyy-MM");
- string initFullPath = BLL.Funs.RootPath + attachPath ;
+ string initFullPath = BLL.Funs.RootPath + attachPath;
if (!Directory.Exists(initFullPath))
{
Directory.CreateDirectory(initFullPath);
@@ -42,16 +42,27 @@ namespace FineUIPro.Web.AttachFile
ResponseError(context);
return;
}
+ // 定义允许上传的文件类型列表
+ List allowExtensions = BLL.DropListService.allowExtensions;
HttpPostedFile postedFile = context.Request.Files[0];
// 文件名完整路径
string fileName = postedFile.FileName;
// 文件名保存的服务器路径
string savedFileName = GetSavedFileName(fileName);
- postedFile.SaveAs(context.Server.MapPath("~/" + attachPath+ "/" + savedFileName));
+ postedFile.SaveAs(context.Server.MapPath("~/" + attachPath + "/" + savedFileName));
string shortFileName = GetFileName(fileName);
string fileType = GetFileType(fileName);
+ if (!allowExtensions.Contains("." + fileType))
+ {
+ // 出错了
+ context.Response.StatusCode = 415;
+ context.Response.Write("不支持的文件类型");
+ // ResponseError(context);
+
+ return;
+ }
int fileSize = postedFile.ContentLength;
JObject fileObj = new JObject();
diff --git a/SGGL/FineUIPro.Web/AttachFile/webuploader.aspx b/SGGL/FineUIPro.Web/AttachFile/webuploader.aspx
index 10baea49..29df6dc4 100644
--- a/SGGL/FineUIPro.Web/AttachFile/webuploader.aspx
+++ b/SGGL/FineUIPro.Web/AttachFile/webuploader.aspx
@@ -29,7 +29,9 @@
+ ToolTip="扫描文件" OnClick="btnImageMagnify_Click">
+
+
diff --git a/SGGL/FineUIPro.Web/AttachFile/webuploader.aspx.cs b/SGGL/FineUIPro.Web/AttachFile/webuploader.aspx.cs
index 1dd1facb..f0c61e08 100644
--- a/SGGL/FineUIPro.Web/AttachFile/webuploader.aspx.cs
+++ b/SGGL/FineUIPro.Web/AttachFile/webuploader.aspx.cs
@@ -725,5 +725,58 @@ namespace FineUIPro.Web.AttachFile
{
}
+
+ protected void btnOnlineEdit_OnClick(object sender, EventArgs e)
+ {
+ JArray source = GetSourceData();
+ for (int i = 0, count = source.Count; i < count; i++)
+ {
+ JObject item = source[i] as JObject;
+ if (item.Value("id") == Grid1.SelectedRowID)
+ {
+ try
+ {
+ string savedName = item.Value("savedName");
+ string folder = item.Value("folder");
+ string xnUrl = AttachPath + "\\" + savedName;
+ if (!string.IsNullOrEmpty(folder))
+ {
+ xnUrl = folder + savedName;
+ }
+
+ string url = Funs.RootPath + xnUrl;
+ if (savedName.Contains("FileUpLoad"))
+ {
+ url = Funs.RootPath + savedName.Replace('/', '\\');
+ }
+ FileInfo info = new FileInfo(url);
+ if (!info.Exists || string.IsNullOrEmpty(savedName))
+ {
+ url = Funs.RootPath + "Images//Null.jpg";
+ info = new FileInfo(url);
+ }
+ var FiletExtension = Path.GetExtension(savedName);
+ bool isSupportType = FiletExtension.Equals(".docx");
+ if (isSupportType)
+ {
+ url = url.Replace(Funs.RootPath, "");
+ PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../AttachFile/OnlineEditing.aspx?fileUrl={0}", url, "编辑 -")));
+ }
+ else
+ {
+ ShowNotify("不支持在线编辑", MessageBoxIcon.Warning);
+
+ }
+
+ }
+ catch (Exception)
+ {
+
+ }
+
+ }
+ }
+ }
+
}
}
diff --git a/SGGL/FineUIPro.Web/AttachFile/webuploader.aspx.designer.cs b/SGGL/FineUIPro.Web/AttachFile/webuploader.aspx.designer.cs
index 68623e08..4c8d312e 100644
--- a/SGGL/FineUIPro.Web/AttachFile/webuploader.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/AttachFile/webuploader.aspx.designer.cs
@@ -7,11 +7,13 @@
// 自动生成>
//------------------------------------------------------------------------------
-namespace FineUIPro.Web.AttachFile {
-
-
- public partial class webuploader {
-
+namespace FineUIPro.Web.AttachFile
+{
+
+
+ public partial class webuploader
+ {
+
///
/// form1 控件。
///
@@ -20,7 +22,7 @@ namespace FineUIPro.Web.AttachFile {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
-
+
///
/// PageManager1 控件。
///
@@ -29,7 +31,7 @@ namespace FineUIPro.Web.AttachFile {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.PageManager PageManager1;
-
+
///
/// Grid1 控件。
///
@@ -38,7 +40,7 @@ namespace FineUIPro.Web.AttachFile {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Grid Grid1;
-
+
///
/// toolBar 控件。
///
@@ -47,7 +49,7 @@ namespace FineUIPro.Web.AttachFile {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Toolbar toolBar;
-
+
///
/// btnImageMagnify 控件。
///
@@ -56,7 +58,16 @@ namespace FineUIPro.Web.AttachFile {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnImageMagnify;
-
+
+ ///
+ /// btnOnlineEdit 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnOnlineEdit;
+
///
/// btnSelectFiles 控件。
///
@@ -65,7 +76,7 @@ namespace FineUIPro.Web.AttachFile {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnSelectFiles;
-
+
///
/// btnDelete 控件。
///
@@ -74,7 +85,7 @@ namespace FineUIPro.Web.AttachFile {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnDelete;
-
+
///
/// ToolbarSeparator2 控件。
///
@@ -83,7 +94,7 @@ namespace FineUIPro.Web.AttachFile {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator2;
-
+
///
/// btnSave 控件。
///
@@ -92,7 +103,7 @@ namespace FineUIPro.Web.AttachFile {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnSave;
-
+
///
/// Window1 控件。
///
diff --git a/SGGL/FineUIPro.Web/CQMS/Solution/EditConstructSolution.aspx b/SGGL/FineUIPro.Web/CQMS/Solution/EditConstructSolution.aspx
index f7e53c37..0096beab 100644
--- a/SGGL/FineUIPro.Web/CQMS/Solution/EditConstructSolution.aspx
+++ b/SGGL/FineUIPro.Web/CQMS/Solution/EditConstructSolution.aspx
@@ -132,6 +132,8 @@
+
+
diff --git a/SGGL/FineUIPro.Web/CQMS/Solution/EditConstructSolution.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Solution/EditConstructSolution.aspx.designer.cs
index 8b75334c..58408f8b 100644
--- a/SGGL/FineUIPro.Web/CQMS/Solution/EditConstructSolution.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/CQMS/Solution/EditConstructSolution.aspx.designer.cs
@@ -7,11 +7,13 @@
// 自动生成>
//------------------------------------------------------------------------------
-namespace FineUIPro.Web.CQMS.Solution {
-
-
- public partial class EditConstructSolution {
-
+namespace FineUIPro.Web.CQMS.Solution
+{
+
+
+ public partial class EditConstructSolution
+ {
+
///
/// form1 控件。
///
@@ -20,7 +22,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
-
+
///
/// PageManager1 控件。
///
@@ -29,7 +31,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.PageManager PageManager1;
-
+
///
/// SimpleForm1 控件。
///
@@ -38,7 +40,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Form SimpleForm1;
-
+
///
/// ContentPanel2 控件。
///
@@ -47,7 +49,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.ContentPanel ContentPanel2;
-
+
///
/// Form2 控件。
///
@@ -56,7 +58,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Form Form2;
-
+
///
/// txtProjectName 控件。
///
@@ -65,7 +67,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.TextBox txtProjectName;
-
+
///
/// txtCode 控件。
///
@@ -74,7 +76,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.TextBox txtCode;
-
+
///
/// drpUnit 控件。
///
@@ -83,7 +85,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.DropDownList drpUnit;
-
+
///
/// txtSolutionName 控件。
///
@@ -92,7 +94,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.TextBox txtSolutionName;
-
+
///
/// drpModelType 控件。
///
@@ -101,7 +103,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.DropDownList drpModelType;
-
+
///
/// drpSpecialType 控件。
///
@@ -110,7 +112,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.DropDownList drpSpecialType;
-
+
///
/// txtCompileDate 控件。
///
@@ -119,7 +121,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.DatePicker txtCompileDate;
-
+
///
/// txtEdition 控件。
///
@@ -128,7 +130,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtEdition;
-
+
///
/// txtCNProfessional 控件。
///
@@ -137,7 +139,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.DropDownBox txtCNProfessional;
-
+
///
/// gvCNPro 控件。
///
@@ -146,7 +148,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Grid gvCNPro;
-
+
///
/// txtUnitWork 控件。
///
@@ -155,7 +157,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.DropDownBox txtUnitWork;
-
+
///
/// gvUnitWork 控件。
///
@@ -164,7 +166,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Grid gvUnitWork;
-
+
///
/// imgBtnFile 控件。
///
@@ -173,7 +175,16 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button imgBtnFile;
-
+
+ ///
+ /// btnEditWord 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnEditWord;
+
///
/// Panel2 控件。
///
@@ -182,7 +193,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Panel Panel2;
-
+
///
/// Panel1 控件。
///
@@ -191,7 +202,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Panel Panel1;
-
+
///
/// trOne 控件。
///
@@ -200,7 +211,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Tree trOne;
-
+
///
/// Panel3 控件。
///
@@ -209,7 +220,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Panel Panel3;
-
+
///
/// trTwo 控件。
///
@@ -218,7 +229,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Tree trTwo;
-
+
///
/// Panel4 控件。
///
@@ -227,7 +238,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Panel Panel4;
-
+
///
/// trThree 控件。
///
@@ -236,7 +247,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Tree trThree;
-
+
///
/// Panel5 控件。
///
@@ -245,7 +256,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Panel Panel5;
-
+
///
/// trFour 控件。
///
@@ -254,7 +265,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Tree trFour;
-
+
///
/// Panel6 控件。
///
@@ -263,7 +274,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Panel Panel6;
-
+
///
/// trFive 控件。
///
@@ -272,7 +283,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Tree trFive;
-
+
///
/// Panel7 控件。
///
@@ -281,7 +292,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Panel Panel7;
-
+
///
/// trSixe 控件。
///
@@ -290,7 +301,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Tree trSixe;
-
+
///
/// agree 控件。
///
@@ -299,7 +310,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.FormRow agree;
-
+
///
/// rblIsAgree 控件。
///
@@ -308,7 +319,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.RadioButtonList rblIsAgree;
-
+
///
/// options 控件。
///
@@ -317,7 +328,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.FormRow options;
-
+
///
/// txtOptions 控件。
///
@@ -326,7 +337,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.TextArea txtOptions;
-
+
///
/// optio 控件。
///
@@ -335,7 +346,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.FormRow optio;
-
+
///
/// btnapprove 控件。
///
@@ -344,7 +355,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnapprove;
-
+
///
/// plApprove2 控件。
///
@@ -353,7 +364,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.FormRow plApprove2;
-
+
///
/// gvApprove 控件。
///
@@ -362,7 +373,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Grid gvApprove;
-
+
///
/// Label1 控件。
///
@@ -371,7 +382,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::System.Web.UI.WebControls.Label Label1;
-
+
///
/// Label3 控件。
///
@@ -380,7 +391,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::System.Web.UI.WebControls.Label Label3;
-
+
///
/// Label2 控件。
///
@@ -389,7 +400,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::System.Web.UI.WebControls.Label Label2;
-
+
///
/// Toolbar1 控件。
///
@@ -398,7 +409,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Toolbar Toolbar1;
-
+
///
/// ToolbarFill1 控件。
///
@@ -407,7 +418,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.ToolbarFill ToolbarFill1;
-
+
///
/// HFConstructSolutionId 控件。
///
@@ -416,7 +427,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.HiddenField HFConstructSolutionId;
-
+
///
/// btnSave 控件。
///
@@ -425,7 +436,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnSave;
-
+
///
/// btnSubmit 控件。
///
@@ -434,7 +445,7 @@ namespace FineUIPro.Web.CQMS.Solution {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnSubmit;
-
+
///
/// WindowAtt 控件。
///
diff --git a/SGGL/FineUIPro.Web/ErrLog.txt b/SGGL/FineUIPro.Web/ErrLog.txt
index e69de29b..5bb8612c 100644
--- a/SGGL/FineUIPro.Web/ErrLog.txt
+++ b/SGGL/FineUIPro.Web/ErrLog.txt
@@ -0,0 +1,22 @@
+
+错误信息开始=====>
+错误类型:HttpParseException
+错误信息:类型“FineUIPro.ToolbarFill”不具有名为“Button”的公共属性。
+错误堆栈:
+ 在 System.Web.UI.TemplateParser.ProcessException(Exception ex)
+ 在 System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)
+ 在 System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)
+----错误类型:HttpException
+----错误信息:
+----类型“FineUIPro.ToolbarFill”不具有名为“Button”的公共属性。
+----错误堆栈:
+ 在 System.Web.UI.ControlBuilder.GetChildPropertyBuilder(String tagName, IDictionary attribs, Type& childType, TemplateParser templateParser, Boolean defaultProperty)
+ 在 System.Web.UI.ControlBuilder.CreateChildBuilder(String filter, String tagName, IDictionary attribs, TemplateParser parser, ControlBuilder parentBuilder, String id, Int32 line, VirtualPath virtualPath, Type& childType, Boolean defaultProperty)
+ 在 System.Web.UI.TemplateParser.ProcessBeginTag(Match match, String inputText)
+ 在 System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)
+出错时间:08/10/2023 11:35:38
+出错文件:http://localhost:8579/AttachFile/webuploader.aspx?toKeyId=1a526c77-f270-465d-8818-39a68e1fbda8&path=FileUpload/DocManage&menuId=609F0D64-ABB8-4F5C-9646-FC1DFC8BAB85&type=-1
+IP地址:::1
+
+出错时间:08/10/2023 11:35:38
+
diff --git a/SGGL/FineUIPro.Web/FileUpload/DocManage/2023-08/638272642451976796_相关接口.docx b/SGGL/FineUIPro.Web/FileUpload/DocManage/2023-08/638272642451976796_相关接口.docx
new file mode 100644
index 00000000..8000482e
Binary files /dev/null and b/SGGL/FineUIPro.Web/FileUpload/DocManage/2023-08/638272642451976796_相关接口.docx differ
diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
index 3066779f..0a7bd80b 100644
--- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
+++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
@@ -196,6 +196,7 @@
+
@@ -1483,6 +1484,7 @@
+
@@ -1590,7 +1592,13 @@
+
+
+
+
+
+
@@ -5978,6 +5986,13 @@
Look.aspx
+
+ OnlineEditing.aspx
+ ASPXCodeBehind
+
+
+ OnlineEditing.aspx
+
player.aspx
ASPXCodeBehind
@@ -14633,6 +14648,13 @@
Depart.aspx
+
+ HttpLog.aspx
+ ASPXCodeBehind
+
+
+ HttpLog.aspx
+
MenuFlowOperateEdit.aspx
ASPXCodeBehind
@@ -14787,6 +14809,41 @@
TestRecord.aspx
+
+ IFLogList.aspx
+ ASPXCodeBehind
+
+
+ IFLogList.aspx
+
+
+ InterFaceEdit.aspx
+ ASPXCodeBehind
+
+
+ InterFaceEdit.aspx
+
+
+ InterFaceSet.aspx
+ ASPXCodeBehind
+
+
+ InterFaceSet.aspx
+
+
+ InterFaceTask.aspx
+ ASPXCodeBehind
+
+
+ InterFaceTask.aspx
+
+
+ InterFaceTaskEdit.aspx
+ ASPXCodeBehind
+
+
+ InterFaceTaskEdit.aspx
+
BeforeTestRun.aspx
ASPXCodeBehind
diff --git a/SGGL/FineUIPro.Web/Global.asax.cs b/SGGL/FineUIPro.Web/Global.asax.cs
index fbf46ecb..59fb1858 100644
--- a/SGGL/FineUIPro.Web/Global.asax.cs
+++ b/SGGL/FineUIPro.Web/Global.asax.cs
@@ -86,6 +86,7 @@
////通用定时器
try
{
+ QuartzServices.Init();
BLL.MonitorService.StartMonitor();
BLL.MonitorService.StartMonitorEve();
// BLL.MonitorService.StartPersonQuarterCheck();
diff --git a/SGGL/FineUIPro.Web/SysManage/HttpLog.aspx b/SGGL/FineUIPro.Web/SysManage/HttpLog.aspx
new file mode 100644
index 00000000..d12bd83f
--- /dev/null
+++ b/SGGL/FineUIPro.Web/SysManage/HttpLog.aspx
@@ -0,0 +1,123 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HttpLog.aspx.cs" Inherits="FineUIPro.Web.SysManage.HttpLog" %>
+
+
+
+
+
+
+ HTTP请求日志表
+
+
+
+
+
+
+
+
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 839f44c1..ad427b0b 100644
--- a/SGGL/FineUIPro.Web/SysManage/RoleListEdit.aspx.cs
+++ b/SGGL/FineUIPro.Web/SysManage/RoleListEdit.aspx.cs
@@ -93,6 +93,10 @@ namespace FineUIPro.Web.SysManage
///
protected void btnSave_Click(object sender, EventArgs e)
{
+ if (!CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, 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 afdf4817..eb814d19 100644
--- a/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx
+++ b/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx
@@ -116,6 +116,11 @@
+
+
+
+
+
@@ -342,6 +347,41 @@
+
+
+
diff --git a/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.cs b/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.cs
index 0ae23761..c647eabf 100644
--- a/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.cs
+++ b/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.cs
@@ -27,6 +27,11 @@ namespace FineUIPro.Web.SysManage
//{
// this.btnArrowRefresh.Hidden = false;
//}
+ if (this.CurrUser.UserId == Const.hfnbdId)
+ {
+ this.TabHttpLog.Hidden = false;
+ this.TabOnlineMenuSet.Hidden = false;
+ }
/// TAB1加载页面方法
this.LoadTab1Data();
ConstValue.InitConstValueDropDownList(this.drpSuperMenu, this.rblMenuType.SelectedValue, true);
@@ -34,6 +39,7 @@ namespace FineUIPro.Web.SysManage
this.LoadTab2Data();
/// TAB2加载页面方法
this.LoadTab3Data();
+ LoadTabOnlineEditData();
}
}
#region 多附件转换
@@ -367,6 +373,14 @@ namespace FineUIPro.Web.SysManage
{
txtSerVerUrl.Text = sysSet9.SetValue;
}
+ 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;
}
///
@@ -567,6 +581,26 @@ namespace FineUIPro.Web.SysManage
Funs.DB.Sys_Set.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);
}
@@ -942,6 +976,93 @@ 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
+
///
/// 选择菜单类型
///
diff --git a/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.designer.cs b/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.designer.cs
index fc8a3523..818dcc63 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;
-
+
///
/// btnArrowRefresh 控件。
///
@@ -326,7 +337,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnArrowRefresh;
-
+
///
/// btnSave 控件。
///
@@ -335,7 +346,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnSave;
-
+
///
/// 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;
-
+
///
/// btnTab2Save 控件。
///
@@ -407,7 +418,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnTab2Save;
-
+
///
/// TabStrip2 控件。
///
@@ -416,7 +427,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.TabStrip TabStrip2;
-
+
///
/// TabCode 控件。
///
@@ -425,7 +436,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Tab TabCode;
-
+
///
/// SimpleForm2 控件。
///
@@ -434,7 +445,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Form SimpleForm2;
-
+
///
/// ckProjectCode 控件。
///
@@ -443,7 +454,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.CheckBox ckProjectCode;
-
+
///
/// txtPrefix 控件。
///
@@ -452,7 +463,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.TextBox txtPrefix;
-
+
///
/// Label8 控件。
///
@@ -461,7 +472,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label8;
-
+
///
/// ckUnitCode 控件。
///
@@ -470,7 +481,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.CheckBox ckUnitCode;
-
+
///
/// Label22 控件。
///
@@ -479,7 +490,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label22;
-
+
///
/// txtDigit 控件。
///
@@ -488,7 +499,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtDigit;
-
+
///
/// Label23 控件。
///
@@ -497,7 +508,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label23;
-
+
///
/// txtSymbol 控件。
///
@@ -506,7 +517,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.TextBox txtSymbol;
-
+
///
/// Label24 控件。
///
@@ -515,7 +526,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label24;
-
+
///
/// Tab4 控件。
///
@@ -524,7 +535,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Tab Tab4;
-
+
///
/// txtTemplate 控件。
///
@@ -533,7 +544,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.HtmlEditor txtTemplate;
-
+
///
/// Tab5 控件。
///
@@ -542,7 +553,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Tab Tab5;
-
+
///
/// Grid1 控件。
///
@@ -551,7 +562,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Grid Grid1;
-
+
///
/// Toolbar4 控件。
///
@@ -560,7 +571,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Toolbar Toolbar4;
-
+
///
/// btnFlowOperateNew 控件。
///
@@ -569,7 +580,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnFlowOperateNew;
-
+
///
/// btnFlowOperateDelete 控件。
///
@@ -578,7 +589,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnFlowOperateDelete;
-
+
///
/// Label27 控件。
///
@@ -587,7 +598,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::System.Web.UI.WebControls.Label Label27;
-
+
///
/// Tab3 控件。
///
@@ -596,7 +607,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Tab Tab3;
-
+
///
/// frTestSet 控件。
///
@@ -605,7 +616,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Form frTestSet;
-
+
///
/// lbTotalScore 控件。
///
@@ -614,7 +625,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label lbTotalScore;
-
+
///
/// lbTotalCount 控件。
///
@@ -623,7 +634,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label lbTotalCount;
-
+
///
/// txtDuration 控件。
///
@@ -632,7 +643,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtDuration;
-
+
///
/// Label14 控件。
///
@@ -641,7 +652,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label14;
-
+
///
/// txtPassingScore 控件。
///
@@ -650,7 +661,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtPassingScore;
-
+
///
/// Label21 控件。
///
@@ -659,7 +670,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label21;
-
+
///
/// txtSValue 控件。
///
@@ -668,7 +679,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtSValue;
-
+
///
/// Label15 控件。
///
@@ -677,7 +688,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label15;
-
+
///
/// txtMValue 控件。
///
@@ -686,7 +697,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtMValue;
-
+
///
/// Label16 控件。
///
@@ -695,7 +706,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label16;
-
+
///
/// txtJValue 控件。
///
@@ -704,7 +715,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtJValue;
-
+
///
/// Label17 控件。
///
@@ -713,7 +724,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label17;
-
+
///
/// txtSCount 控件。
///
@@ -722,7 +733,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtSCount;
-
+
///
/// Label18 控件。
///
@@ -731,7 +742,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label18;
-
+
///
/// txtMCount 控件。
///
@@ -740,7 +751,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtMCount;
-
+
///
/// Label19 控件。
///
@@ -749,7 +760,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label19;
-
+
///
/// txtJCount 控件。
///
@@ -758,7 +769,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.NumberBox txtJCount;
-
+
///
/// Label20 控件。
///
@@ -767,7 +778,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Label Label20;
-
+
///
/// Toolbar2 控件。
///
@@ -776,7 +787,7 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Toolbar Toolbar2;
-
+
///
/// btnTab3Save 控件。
///
@@ -785,7 +796,79 @@ namespace FineUIPro.Web.SysManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnTab3Save;
-
+
+ ///
+ /// 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 控件。
///
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..0ee18a24
--- /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.UserId, "添加接口设置-" + this.txtFaceName.Text.Trim());
+ }
+ else
+ {
+ newSet.InterFaceSetId = this.InterFaceSetId;
+ BLL.InterFaceSetService.UpdateInterFaceSet(newSet);
+ BLL.LogService.AddLog(this.CurrUser.UserId, "修改接口设置" + this.txtFaceName.Text.Trim());
+ }
+
+ PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
+ }
+
+ #region 获取按钮权限
+ ///
+ /// 获取按钮权限
+ ///
+ ///
+ ///
+ private void GetButtonPower()
+ {
+ var buttonList = BLL.CommonService.GetAllButtonList(null,this.CurrUser.UserId, 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..4ed01138
--- /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.UserId, 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.UserId, "删除接口信息");
+ }
+ }
+ 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..09f0a0d2
--- /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.UserId, 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 c2f210c0..575d4f51 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 61ae5561..871e261e 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 2fb03788..af38c236 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 9ee554fd..38a3ba15 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 51081620..a2fdadeb 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_TestRun.xml b/SGGL/FineUIPro.Web/common/Menu_TestRun.xml
index f4b1443c..bd64e89c 100644
--- a/SGGL/FineUIPro.Web/common/Menu_TestRun.xml
+++ b/SGGL/FineUIPro.Web/common/Menu_TestRun.xml
@@ -38,6 +38,9 @@
+
+
+
diff --git a/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml b/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml
index df2ee5d2..17668997 100644
--- a/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml
+++ b/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml
@@ -6,6 +6,10 @@
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/common/PageBase.cs b/SGGL/FineUIPro.Web/common/PageBase.cs
index 630a3ef3..5d708de9 100644
--- a/SGGL/FineUIPro.Web/common/PageBase.cs
+++ b/SGGL/FineUIPro.Web/common/PageBase.cs
@@ -104,6 +104,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/FineUIPro.Web/common/mainMenu_HJGL2.aspx b/SGGL/FineUIPro.Web/common/mainMenu_HJGL2.aspx
index ca4138cc..32b20776 100644
--- a/SGGL/FineUIPro.Web/common/mainMenu_HJGL2.aspx
+++ b/SGGL/FineUIPro.Web/common/mainMenu_HJGL2.aspx
@@ -4,742 +4,983 @@
-
+
质量焊接数据看板
-
-
-
+
+
+
+
-