diff --git a/.gitignore b/.gitignore
index f0476bbe..2c9c729f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -34,3 +34,4 @@ SGGL/.svn
/SGGL/BLLTests
/SGGL/FineUIPro.Web/ErrLog.txt
/SGGL/CLAUDE.md
+/SGGL/.claude
diff --git a/DataBase/版本日志/SGGLDB_V2025-12-23-002.sql b/DataBase/版本日志/SGGLDB_V2025-12-23-002.sql
new file mode 100644
index 00000000..234f8b4b
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2025-12-23-002.sql
@@ -0,0 +1,36 @@
+INSERT INTO [dbo].[Sys_Menu] ([MenuId], [MenuName], [Icon], [Url], [SortIndex], [SuperMenu], [MenuType], [IsOffice], [IsEnd], [IsUsed]) VALUES (N'5B302FF3-A6E4-4305-A0C0-64CA7377777A', N'ʱ', NULL, N'HSSE/SitePerson/DateManage.aspx', '9', N'0', N'Menu_SMZGL', '0', '1', '1');
+INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) VALUES (N'1CFF6CE1-52F4-41F4-A40F-1DB4DB353974', N'5B302FF3-A6E4-4305-A0C0-64CA7377777A', N'', '1');
+INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) VALUES (N'46F5F687-D838-4D7E-A7D0-F0262BFC9F04', N'5B302FF3-A6E4-4305-A0C0-64CA7377777A', N'ɾ', '3');
+INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) VALUES (N'CEC8EAE8-A691-496A-BE4B-AFD9C8BD6FAD', N'5B302FF3-A6E4-4305-A0C0-64CA7377777A', N'', '4');
+INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) VALUES (N'DF01EF57-7D20-4E1D-AE6C-CC65798D5830', N'5B302FF3-A6E4-4305-A0C0-64CA7377777A', N'', '2');
+
+
+CREATE TABLE [dbo].[Kqgl_DateManage](
+ [Id] [nvarchar](50) NOT NULL,
+ [ProjectId] [nvarchar](50) NULL,
+ [AmStartTime1] [time](7) NULL,
+ [AmStartTime2] [time](7) NULL,
+ [AmEndTime1] [time](7) NULL,
+ [AmEndTime2] [time](7) NULL,
+ [PmStartTime1] [time](7) NULL,
+ [PmStartTime2] [time](7) NULL,
+ [PmEndTime1] [time](7) NULL,
+ [PmEndTime2] [time](7) NULL,
+ [LateTime] [int] NULL,
+ [LeaveTime] [int] NULL,
+ [EquipmentCode] [nvarchar](500) NULL,
+ CONSTRAINT [PK_Kqgl_DateManage] PRIMARY KEY CLUSTERED
+(
+ [Id] 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
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ٵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Kqgl_DateManage', @level2type=N'COLUMN',@level2name=N'LateTime'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Kqgl_DateManage', @level2type=N'COLUMN',@level2name=N'LeaveTime'
+GO
+
+
diff --git a/DataBase/版本日志/SGGLDB_V2025-12-23-003.sql b/DataBase/版本日志/SGGLDB_V2025-12-23-003.sql
new file mode 100644
index 00000000..d4c3e452
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2025-12-23-003.sql
@@ -0,0 +1,100 @@
+
+
+ALTER VIEW [dbo].[View_SitePerson_Person]
+AS
+/*ֳԱͼ*/
+SELECT SitePerson.ProjectId,
+ Project.ProjectCode,
+ Project.ProjectName,
+ SitePerson.SitePersonId,
+ persons.PersonId,
+ SitePerson.CardNo,
+ Persons.PersonName,
+ Persons.Sex,
+ (Case Persons.Sex WHEN '1' THEN '' WHEN '2' THEN 'Ů' ELSE '' END) AS SexName,
+ Persons.IdentityCard,
+ Persons.Address,
+ SitePerson.UnitId,
+ Persons.DepartId,
+ Persons.Birthday,
+ SitePerson.TeamGroupId,
+ SitePerson.WorkAreaId,
+ SitePerson.WorkPostId,
+ SitePerson.InTime,
+ SitePerson.OutTime,
+ SitePerson.OutResult,
+ Persons.Telephone,
+ Persons.PositionId,
+ Persons.PostTitleId,
+ Persons.PhotoUrl,
+ Unit.UnitCode,
+ Unit.UnitName,
+ TeamGroup.TeamGroupName,
+ Post.WorkPostName,
+ Position.PositionName,
+ Title.PostTitleName,
+ Depart.DepartName,
+ Post.PostType,
+ Post.IsHsse,
+ (SELECT COUNT(*) FROM EduTrain_TrainRecordDetail T
+ LEFT JOIN EduTrain_TrainRecord AS E ON T.TrainingId=E.TrainingId
+ WHERE T.PersonId=SitePerson.PersonId AND E.ProjectId=SitePerson.ProjectId AND T.CheckResult=1) AS TrainCount,
+ (SELECT COUNT(*) FROM Training_TestRecord R
+ WHERE R.TestManId=SitePerson.PersonId AND R.ProjectId=SitePerson.ProjectId and R.TestScores > ISNULL((SELECT TOP 1 PassingScore FROM Sys_TestRule),60)) AS TrainCount1,
+ SitePerson.AuditorId,
+ Persons.PersonName AS AuditorName,
+ SitePerson.AuditorDate,
+ Persons.IDCardUrl,
+ Persons.IsForeign,
+ case when Persons.IsForeign=1 then '' else '' end as IsForeignStr,
+ Persons.IdcardType,
+ BasicData1.dictName as IdcardTypeName,
+ Persons.IdcardStartDate,
+ Persons.IdcardEndDate,
+ Persons.IdcardForever,
+ case when Persons.IdcardForever='Y' then '' else '' end as IdcardForeverStr,
+ Persons.PoliticsStatus,
+ BasicData2.dictName as PoliticsStatusName,
+ Persons.IdcardAddress,
+ Persons.Nation,
+ BasicData3.dictName as NationName,
+ Persons.EduLevel,
+ BasicData4.dictName as EduLevelName,
+ Persons.MaritalStatus,
+ BasicData5.dictName as MaritalStatusName,
+ Persons.CountryCode,
+ Country.cname as CountryName,
+ Persons.ProvinceCode,
+ City.cname as ProvinceName,
+ Persons.PersonType,
+ (case when Persons.PersonType='2' then 'Ƹ' when Persons.PersonType='3' then '' else 'Ա' end) as IsOutsideStr,
+ --WorkArea.UnitWorkCode AS WorkAreaCode,
+ WorkAreaCode= STUFF((SELECT ',' + UnitWorkCode FROM dbo.WBS_UnitWork where PATINDEX('%,' + RTRIM(UnitWorkId) + ',%',',' +SitePerson.WorkAreaId + ',')>0 FOR XML PATH('')), 1, 1,''),
+ --WorkArea.UnitWorkName AS WorkAreaName
+ WorkAreaName= STUFF((SELECT ',' + UnitWorkName FROM dbo.WBS_UnitWork where PATINDEX('%,' + RTRIM(UnitWorkId) + ',%',',' +SitePerson.WorkAreaId + ',')>0 FOR XML PATH('')), 1, 1,''),
+ SitePerson.RealNameAddTime,
+ SitePerson.RealNameUpdateTime,
+ Persons.HeadImage,
+ SitePerson.States,
+ Persons.YunMouState
+FROM SitePerson_Person AS SitePerson
+LEFT JOIN Person_Persons AS Persons ON SitePerson.PersonId=Persons.PersonId
+LEFT JOIN Base_Project AS Project ON Project.ProjectId=SitePerson.ProjectId
+LEFT JOIN Base_Unit AS Unit ON Unit.UnitId = SitePerson.UnitId
+LEFT JOIN ProjectData_TeamGroup AS TeamGroup ON TeamGroup.TeamGroupId=SitePerson.TeamGroupId
+LEFT JOIN Base_WorkPost AS Post ON Post.WorkPostId = SitePerson.WorkPostId
+LEFT JOIN Base_Position AS Position ON Position.PositionId = Persons.PositionId
+Left JOIN Base_PostTitle AS Title ON Title.PostTitleId = Persons.PostTitleId
+Left JOIN Base_Depart AS Depart ON Depart.DepartId = Persons.DepartId
+Left JOIN RealName_BasicData AS BasicData1 ON BasicData1.dictCode = Persons.IdcardType
+Left JOIN RealName_BasicData AS BasicData2 ON BasicData2.dictCode = Persons.PoliticsStatus
+Left JOIN RealName_BasicData AS BasicData3 ON BasicData3.dictCode = Persons.Nation
+Left JOIN RealName_BasicData AS BasicData4 ON BasicData4.dictCode = Persons.EduLevel
+Left JOIN RealName_BasicData AS BasicData5 ON BasicData5.dictCode = Persons.MaritalStatus
+Left JOIN RealName_Country AS Country ON Country.CountryId = Persons.CountryCode
+Left JOIN RealName_City AS City ON City.provinceCode = Persons.ProvinceCode and City.CountryId = Persons.CountryCode
+
+
+GO
+
+
diff --git a/DataBase/版本日志/SGGLDB_V2025-12-23.sql b/DataBase/版本日志/SGGLDB_V2025-12-23.sql
new file mode 100644
index 00000000..3b602ae5
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2025-12-23.sql
@@ -0,0 +1,2 @@
+Alter TABLE [dbo].[Person_Persons]
+add [YunMouState] [nvarchar](50) NULL
\ No newline at end of file
diff --git a/DataBase/版本日志/SGGLDB_V2025-12-24-001.sql b/DataBase/版本日志/SGGLDB_V2025-12-24-001.sql
new file mode 100644
index 00000000..5b315d92
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2025-12-24-001.sql
@@ -0,0 +1,6 @@
+INSERT INTO [dbo].[Sys_Menu] ([MenuId], [MenuName], [Icon], [Url], [SortIndex], [SuperMenu], [MenuType], [IsOffice], [IsEnd], [IsUsed]) VALUES (N'E4DC0A35-C585-4C4F-8F79-10F528892314', N'Ŀ豸', NULL, N'ProjectData/ProjectDevices.aspx', '86', N'0', N'Menu_ProjectSet', '0', '1', '1');
+INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) VALUES (N'1E3A5ADC-BAA7-45BC-AAF9-012A024F4752', N'E4DC0A35-C585-4C4F-8F79-10F528892314', N'', '4');
+INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) VALUES (N'37E51622-FB4E-40F4-8D37-603EE626DB7F', N'E4DC0A35-C585-4C4F-8F79-10F528892314', N'', '1');
+INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) VALUES (N'6EBFA308-581A-4260-9ECA-7E30283EF9EA', N'E4DC0A35-C585-4C4F-8F79-10F528892314', N'ɾ', '3');
+INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) VALUES (N'939F4F2D-F03B-4DBD-963C-D55196535D8C', N'E4DC0A35-C585-4C4F-8F79-10F528892314', N'', '2');
+UPDATE TOP(1)[dbo].[Sys_Menu] SET [MenuId]=N'5B302FF3-A6E4-4305-A0C0-64CA7377777A', [MenuName]=N'ʱ', [Icon]=NULL, [Url]=N'HSSE/SitePerson/DateManage.aspx', [SortIndex]='9', [SuperMenu]=N'EE260447-028F-46AF-8864-9A5DC9DAA5BD', [MenuType]=N'Menu_HSSE', [IsOffice]='0', [IsEnd]='1', [IsUsed]='1' WHERE ([MenuId]=N'5B302FF3-A6E4-4305-A0C0-64CA7377777A');
\ No newline at end of file
diff --git a/SGGL/.claude/settings.local.json b/SGGL/.claude/settings.local.json
deleted file mode 100644
index 45798113..00000000
--- a/SGGL/.claude/settings.local.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "permissions": {
- "allow": [
- "Bash(dotnet build:*)",
- "Bash(dir:*)",
- "Read(//c/Users/lipengfei/Desktop/**)",
- "Bash(powershell:*)",
- "Bash(csc:*)",
- "Bash(IndependentExcelFiller.exe)",
- "Bash(python:*)",
- "Bash(cat:*)",
- "Bash(pip install:*)",
- "Bash(msbuild:*)",
- "Bash(\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\MSBuild\\Current\\Bin\\MSBuild.exe\":*)",
- "Bash(\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\MSBuild\\Current\\Bin\\MSBuild.exe\" \"D:\\数据\\诺必达\\赛鼎\\SGGL_SeDin_New\\SGGL\\FineUIPro.Web\\FineUIPro.Web.csproj\" /t:Build /p:Configuration=Release /nologo /v:minimal)"
- ],
- "deny": [],
- "ask": []
- }
-}
diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj
index acb76c41..72a496c3 100644
--- a/SGGL/BLL/BLL.csproj
+++ b/SGGL/BLL/BLL.csproj
@@ -303,6 +303,7 @@
+
@@ -601,6 +602,7 @@
+
@@ -671,6 +673,7 @@
+
diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs
index 6bd3cf7e..7ad3c8af 100644
--- a/SGGL/BLL/Common/Const.cs
+++ b/SGGL/BLL/Common/Const.cs
@@ -2048,6 +2048,10 @@ namespace BLL
///
public const string DayReportMenuId = "8F15D3BE-BE21-4A6F-AD5C-2BBECEE46149";
+ ///
+ /// 考勤时间管理
+ ///
+ public const string Menu_KqglDateManger = "5B302FF3-A6E4-4305-A0C0-64CA7377777A";
///
/// 人工时月报
///
@@ -5162,6 +5166,11 @@ namespace BLL
///
public const string SafetyProductionEvaluationMenuId = "C48087A8-4C9F-485D-B0A4-C85E112BA705";
+
+ ///
+ /// 项目设备
+ ///
+ public const string ProjectDevicesMenuId = "E4DC0A35-C585-4C4F-8F79-10F528892314";
///
/// 中央企业安全生产治本攻坚三年行动工作台账
///
diff --git a/SGGL/BLL/Common/YunMouHelper.cs b/SGGL/BLL/Common/YunMouHelper.cs
new file mode 100644
index 00000000..10691aad
--- /dev/null
+++ b/SGGL/BLL/Common/YunMouHelper.cs
@@ -0,0 +1,583 @@
+
+using Newtonsoft.Json;
+using System;
+using System.Configuration;
+using System.Drawing;
+using System.IO;
+using System.Net;
+using System.Text;
+
+namespace BLL.Common
+{
+ public class YunMouHelper
+ {
+ public static string YunMouUrl = ConfigurationManager.AppSettings["YunMouUrl"];
+ public static string ClientSecret = ConfigurationManager.AppSettings["ClientSecret"];
+ public static string ClientId = ConfigurationManager.AppSettings["ClientId"];
+
+ public static string getToken()
+ {
+ string data = "client_id=" + ClientId + "&client_secret=" + ClientSecret + "&grant_type=client_credentials&scope=app";
+ string result = Post(YunMouUrl + "oauth/token", data, "application/x-www-form-urlencoded", "");
+ var j2 = JsonConvert.DeserializeObject(result);
+ return j2.access_token;
+
+ }
+ ///
+ /// 添加设备组(一个项目一个)
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static string addDevicesGroups(string groupName, string groupNo, string access_token)
+ {
+ if (groupName.Length > 64)
+ {
+ groupName = groupName.Substring(0, 63);
+ }
+ string data = "{\"groupName\":\"" + groupName + "\",\"groupNo\":\"" + groupNo + "\"}";
+ string result = Post(YunMouUrl + "api/v1/open/basic/groups/create", data, "application/json;charset=UTF-8", access_token);
+
+ ErrLogInfo.WriteLog(result);
+
+ var j2 = JsonConvert.DeserializeObject(result);
+ if (j2.code == "200")
+ return j2.message;
+ else
+ {
+ return "";
+ }
+ }
+
+ ///
+ /// 删除设备分组
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static string deleteDevicesGroups(string groupNo, string access_token)
+ {
+
+ string result = Post(YunMouUrl + "api/v1/open/basic/groups/delete?groupNo=" + groupNo, "", "application/json;charset=UTF-8", access_token);
+ ErrLogInfo.WriteLog(result);
+
+ var j2 = JsonConvert.DeserializeObject(result);
+ if (j2.code == "200")
+ return j2.message;
+ else
+ {
+ return "";
+ }
+ }
+
+ ///
+ /// 添加设备
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static string addDevices(string deviceSerial, string groupNo, string validateCode, string access_token)
+ {
+ string data = "{\"deviceSerial\":\"" + deviceSerial + "\",\"groupNo\":\"" + groupNo + "\",\"validateCode\":\"" + validateCode + "\"}";
+ string result = Post(YunMouUrl + "api/v1/open/basic/devices/create", data, "application/json;charset=UTF-8", access_token);
+ ErrLogInfo.WriteLog(result);
+
+ var j2 = JsonConvert.DeserializeObject(result);
+ if (j2.code == "200")
+ return j2.data.groupId;
+ else
+ {
+ return "";
+ }
+ }
+ ///
+ /// 修改设备名称(按设备序列号)
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static string updateDevices(string deviceSerial, string deviceName, string access_token)
+ {
+ string data = "{\"deviceSerial\":\"" + deviceSerial + "\",\"deviceName\":\"" + deviceName + "\"}";
+ string result = Post(YunMouUrl + "api/v1/open/basic/devices/update", data, "application/json;charset=UTF-8", access_token);
+ ErrLogInfo.WriteLog(result);
+
+ var j2 = JsonConvert.DeserializeObject(result);
+ if (j2.code == "200")
+ return j2.message;
+ else
+ {
+ return "";
+ }
+ }
+ ///
+ /// 删除设备
+ ///
+ ///
+ ///
+ ///
+ public static string deleteDevices(string deviceSerial, string access_token)
+ {
+
+ string result = Post(YunMouUrl + "api/v1/open/basic/devices/delete?deviceSerial=" + deviceSerial, "", "application/json;charset=UTF-8", access_token);
+ ErrLogInfo.WriteLog(result);
+ var j2 = JsonConvert.DeserializeObject(result);
+ if (j2.code == "200")
+ return j2.message;
+ else
+ {
+ return "";
+ }
+ }
+ ///
+ /// 添加权限组,建议一个项目一个
+ ///
+ ///
+ ///
+ ///
+ public static string addPermissionGroups(string groupName, string access_token)
+ {
+
+ char[] TrimChar = { '、', ' ', '-', '\'', '\"', '\\', '.', '、', '-', '[', ']', '【', '】', '(', ')', '#', '@', '~', '<', '>' };
+ //groupname不能大于32位
+ if (groupName.Length > 32)
+ {
+ groupName = groupName.Substring(0, 31).Trim(TrimChar);
+ }
+ groupName = groupName.Replace("、", "").Replace("/", "").Replace(".", "").Replace("-", "").Replace("[", "").Replace("]", "").Replace("【", "").Replace("】", "").Replace("(", "")
+ .Replace(")", "").Replace("#", "").Replace("@", "").Replace("~", "").Replace("<", "").Replace(">", "")
+ .Replace("(", "")
+ .Replace(")", "");
+ string data = "{\"groupName\":\"" + groupName + "\"}";
+ string result = Post(YunMouUrl + "api/v1/open/accessControl/permissionGroups/create", data, "application/json;charset=UTF-8", access_token);
+ ErrLogInfo.WriteLog(result);
+ var j2 = JsonConvert.DeserializeObject(result);
+ if (j2.code == "200")
+ return j2.data.groupId;
+ else
+ {
+ return "";
+ }
+ }
+
+ ///
+ /// 根据权限组下发权限
+ ///
+ ///
+ ///
+ ///
+ public static string issuedByGroup(string groupId, string access_token)
+ {
+ string data = "{\"groupId\":\"" + groupId + "\"}";
+ string result = Post(YunMouUrl + "api/v1/open/accessControl/allots/actions/issuedByGroup", data, "application/json;charset=UTF-8", access_token);
+ var j2 = JsonConvert.DeserializeObject(result);
+ if (j2.code == "200")
+ return j2.code;
+ else
+ {
+ return "";
+ }
+ }
+
+
+
+ ///
+ /// 删除权限组(会同时移除权限组下人员和设备下发记录以及已下发到设备的权限)
+ ///
+ ///
+ ///
+ ///
+ public static string deletePermissionGroups(string groupId, string access_token)
+ {
+ string result = Post(YunMouUrl + "api/v1/open/accessControl/permissionGroups/delete?groupId=" + groupId, "", "application/json;charset=UTF-8", access_token);
+ var j2 = JsonConvert.DeserializeObject(result);
+ if (j2.code == "200")
+ {
+ return j2.data.groupId;
+ }
+ else
+ {
+ return "";
+ }
+ }
+
+ ///
+ /// 填加员工到权限组
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static string addPersonsToGroups(string groupId, string[] employeeNos, string access_token)
+ {
+
+ //string permissions = "";
+ //if (employeeNos.Length == 1)
+ //{
+ // permissions = "\"permissions\":[{\"employeeNo\": \"" + employeeNos[0] + "\",\"validBeginTime\": \"2020-01-11\"," +
+ // "\"validEndTime\": \"2050-12-30\"}]";
+ //}
+ string data = "{\"groupId\":\"" + groupId + "\",\"employeeNos\":[\"" + string.Join("\", \"", employeeNos) + "\"],\"autoIssue\":\"true\"}";
+ string result = Post(YunMouUrl + "api/v1/open/accessControl/permissionGroups/actions/addPersons", data, "application/json;charset=UTF-8", access_token);
+ ErrLogInfo.WriteLog(result);
+ var j2 = JsonConvert.DeserializeObject(result);
+ if (j2.code == "200")
+ return j2.data.statisticsId;
+ else
+ {
+ return "";
+ }
+ }
+ ///
+ /// 从权限组移除员工
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static string deletePersonsFromGroups(string groupId, string[] employeeNos, string access_token)
+ {
+ string data = "{\"groupId\":\"" + groupId + "\",\"employeeNos\":[\"" + string.Join("\", \"", employeeNos) + "\"]}";
+ string result = Post(YunMouUrl + "api/v1/open/accessControl/permissionGroups/actions/removePersons", data, "application/json;charset=UTF-8", access_token);
+ ErrLogInfo.WriteLog(result);
+ var j2 = JsonConvert.DeserializeObject(result);
+ if (j2.code == "200")
+ return j2.data.statisticsId;
+ else
+ {
+ return "";
+ }
+ }
+ ///
+ /// 添加设备到权限组
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static string addDevicesToGroups(string groupId, string[] devices, string access_token)
+ {
+ string data = "{\"groupId\":\"" + groupId + "\",\"deviceSerials\":[\"" + string.Join("\", \"", devices) + "\"],\"autoIssue\":true,\"checkCapability\":true}";
+ string result = Post(YunMouUrl + "api/v1/open/accessControl/permissionGroups/actions/addDevices", data, "application/json;charset=UTF-8", access_token);
+ ErrLogInfo.WriteLog(result);
+
+ var j2 = JsonConvert.DeserializeObject(result);
+ if (j2.code == "200")
+ return j2.code;
+ else
+ {
+ return "";
+ }
+ }
+ ///
+ /// 从权限组移除设备
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static string deleteDevicesFromGroups(string groupId, string[] devices, string access_token)
+ {
+ string data = "{\"groupId\":\"" + groupId + "\",\"deviceSerials\":[\"" + string.Join("\", \"", devices) + "\"],\"autoIssue\":true,\"checkCapability\":true}";
+ string result = Post(YunMouUrl + "api/v1/open/accessControl/permissionGroups/actions/removeDevices", data, "application/json;charset=UTF-8", access_token);
+ ErrLogInfo.WriteLog(result);
+
+ var j2 = JsonConvert.DeserializeObject(result);
+ if (j2.code == "200")
+ return j2.message;
+ else
+ {
+ return "";
+ }
+ }
+ ///
+ /// 添加人员
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+
+ public static string addPerson(string employeeNo, string personName, string personPhone, string pic, string access_token)
+ {
+ string rootUrl = ConfigurationManager.AppSettings["localRoot"];
+ string filename = rootUrl + pic;
+ FileInfo fi1 = new FileInfo(filename);
+ if (fi1.Length > 200 * 1024)//base64编码的人脸图片,图片大小需小于200kB,数据需去除base64前缀
+ {
+ filename = filename.Replace(".jpg", "_new.jpg").Replace(".jpeg", "_new.jpeg");
+ CropImage(fi1.FullName, filename, 200);
+ }
+ string faceImageBase64 = ImageToByte64String(filename, System.Drawing.Imaging.ImageFormat.Jpeg); // 图片的base64编码
+ string data = "{\"employeeNo\":\"" + employeeNo + "\",\"personName\":\"" + personName + "\",\"faceImageBase64\":\"" + faceImageBase64 + "\",\"verifyImage\":true}";
+ string result = Post(YunMouUrl + "api/v1/open/basic/persons/create", data, "application/json;charset=UTF-8", access_token);
+
+ ErrLogInfo.WriteLog(personName + result);
+
+ var j2 = JsonConvert.DeserializeObject(result);
+ return j2.code;
+ }
+ ///
+ /// 根据employeeNo更新人员信息
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static string updatePerson(string employeeNo, string personName, string personPhone, string pic, string access_token)
+ {
+ string rootUrl = ConfigurationManager.AppSettings["localRoot"];
+ string filename = rootUrl + pic;
+ FileInfo fi1 = new FileInfo(filename);
+ if (fi1.Length > 200 * 1024)//base64编码的人脸图片,图片大小需小于200kB,数据需去除base64前缀
+ {
+ filename = filename.Replace(".jpg", "_new.jpg").Replace(".jpeg", "_new.jpeg");
+ CropImage(fi1.FullName, filename, 200);
+ }
+ string faceImageBase64 = ImageToByte64String(filename, System.Drawing.Imaging.ImageFormat.Jpeg); // 图片的base64编码
+ string data = "{\"employeeNo\":\"" + employeeNo + "\",\"personName\":\"" + personName + "\",\"faceImageBase64\":\"" + faceImageBase64 + "\",\"verifyImage\":true}";
+ string result = Post(YunMouUrl + "api/v1/open/basic/persons/update", data, "application/json;charset=UTF-8", access_token);
+ var j2 = JsonConvert.DeserializeObject(result);
+ return j2.code;
+ }
+ ///
+ /// 获取人员
+ ///
+ ///
+ ///
+ ///
+ public static string getPerson(string employeeNo, string access_token)
+ {
+ string result = Get(YunMouUrl + "api/v1/open/basic/persons/get?employeeNo=" + employeeNo, "application/json;charset=UTF-8", access_token);
+ return result;
+ }
+
+
+
+ ///
+ /// 设备布防
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static string setDefence(string deviceSerial, string isDefence, string access_token)
+ {
+ string result = Post(YunMouUrl + "api/v1/ezviz/devices/actions/setDefence/deviceSerial?deviceSerial=" + deviceSerial + "&isDefence=" + isDefence, "", "application/json;charset=UTF-8", access_token);
+ var j2 = JsonConvert.DeserializeObject(result);
+ if (j2.code == "200")
+ return j2.message;
+ else
+ {
+ return "";
+ }
+ }
+
+ ///
+ /// 添加消息通道
+ ///
+ ///
+ ///
+ public static string addConsumer(string access_token)
+ {
+ string result = Post(YunMouUrl + "api/v1/mq/consumer/group1", "", "application/json;charset=UTF-8", access_token);
+ var j2 = JsonConvert.DeserializeObject(result);
+ if (j2.code == "200")
+ return j2.data.consumerId;
+ else
+ {
+ return "";
+ }
+ }
+ ///
+ /// 提交偏移量
+ ///
+ ///
+ ///
+ ///
+ public static string offsets(string consumerId, string access_token)
+ {
+ string data = "consumerId=" + consumerId;
+ string result = Post(YunMouUrl + "api/v1/mq/consumer/offsets", data, "application/x-www-form-urlencoded", access_token);
+ return result;
+ }
+
+ ///
+ /// 消费消息
+ ///
+ ///
+ ///
+ ///
+ public static string consumerMessage(string consumerId, string access_token)
+ {
+ string data = "consumerId=" + consumerId + "&autoCommit=true";
+ string result = Post(YunMouUrl + "api/v1/mq/consumer/messages", data, "application/x-www-form-urlencoded", access_token);
+ return result;
+ }
+
+ ///
+ /// POST请求
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static string Post(string url, string data, string ContentType, string token)
+ {
+ Encoding encoding = Encoding.Default;
+
+ ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12 | SecurityProtocolType.Ssl3;//设置这个安全协议必须在创建请求之前!
+ HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;//创建请求对象
+ request.Method = "POST";//请求方式
+ request.ContentType = ContentType;//链接类型
+ if (!string.IsNullOrEmpty(token))
+ {
+ request.Headers.Add("Authorization", "Bearer " + token);
+ }
+ try
+ {
+ byte[] buffer = Encoding.UTF8.GetBytes(data);
+ //RequestStream.Write(bytes, 0, bytes.Length);
+ // byte[] buffer = encoding.GetBytes(data);
+ request.ContentLength = buffer.Length;
+ request.GetRequestStream().Write(buffer, 0, buffer.Length);
+ HttpWebResponse webresponse = request.GetResponse() as HttpWebResponse;
+ using (Stream s = webresponse.GetResponseStream())
+ {
+ HttpWebResponse response = (HttpWebResponse)request.GetResponse();
+ StreamReader reader = new StreamReader(s, Encoding.UTF8);
+
+ string res = reader.ReadToEnd();
+ ErrLogInfo.WriteLog(res);
+ return res;
+ }
+ }
+ catch (Exception ex)
+ {
+ return "";
+ }
+ }
+ ///
+ /// GET请求
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static string Get(string url, string ContentType, string token)
+ {
+ Encoding encoding = Encoding.Default;
+
+ ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12 | SecurityProtocolType.Ssl3;//设置这个安全协议必须在创建请求之前!
+ HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;//创建请求对象
+ request.Method = "GET";//请求方式
+ request.ContentType = ContentType;//链接类型
+ if (!string.IsNullOrEmpty(token))
+ {
+ request.Headers.Add("Authorization", "Bearer " + token);
+ }
+ try
+ {
+ HttpWebResponse webresponse = request.GetResponse() as HttpWebResponse;
+ using (Stream s = webresponse.GetResponseStream())
+ {
+ HttpWebResponse response = (HttpWebResponse)request.GetResponse();
+ StreamReader reader = new StreamReader(s, Encoding.UTF8);
+ return reader.ReadToEnd();
+ }
+ }
+ catch (Exception ex)
+ {
+ return "";
+ }
+ }
+ public static string ImageToByte64String(string filePath, System.Drawing.Imaging.ImageFormat format)
+ {
+ Bitmap bitmap = new Bitmap(filePath);
+ MemoryStream memoryStream = new MemoryStream();
+ bitmap.Save(memoryStream, format);
+ byte[] array = new byte[memoryStream.Length];
+ memoryStream.Position = 0L;
+ memoryStream.Read(array, 0, (int)memoryStream.Length);
+ memoryStream.Close();
+ return Convert.ToBase64String(array);
+ }
+ public static void CropImage(string inputFilePath, string outputFilePath, int maxSizeInKB)
+ {
+ // 加载图片
+ using (Image image = Image.FromFile(inputFilePath))
+ {
+ // 计算最大字节大小
+ int maxSizeBytes = maxSizeInKB * 1024;
+
+ // 如果图片大小已经小于或等于最大限制,则不裁剪直接保存
+ if (GetImageSizeInBytes(image) <= maxSizeBytes)
+ {
+ image.Save(outputFilePath, image.RawFormat);
+ return;
+ }
+
+ // 裁剪图片
+ // 这里只是一个简单的示例,实际应用中可能需要根据需求来裁剪图片
+ using (Image croppedImage = CropImageToHalfSize(image))
+ {
+ // 保存裁剪后的图片
+ using (MemoryStream memoryStream = new MemoryStream())
+ {
+ croppedImage.Save(memoryStream, image.RawFormat);
+
+ // 如果裁剪后的图片大小仍然大于限制,则递归裁剪
+ if (memoryStream.Length > maxSizeBytes)
+ {
+ memoryStream.Position = 0;
+ string tempFile = outputFilePath.Replace(".jpg", "temp.jpg").Replace(".jpeg", "temp.jpg");
+ using (FileStream fileStream = new FileStream(tempFile, FileMode.Create))
+ {
+ memoryStream.CopyTo(fileStream);
+ }
+ CropImage(tempFile, outputFilePath, maxSizeInKB);
+ }
+ else
+ {
+ // 保存到文件
+ memoryStream.Position = 0;
+ using (FileStream fileStream = new FileStream(outputFilePath, FileMode.Create))
+ {
+ memoryStream.CopyTo(fileStream);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private static Image CropImageToHalfSize(Image image)
+ {
+ // 这里只是一个示例,实际情况可能需要根据需求来裁剪图片
+ int newWidth = image.Width / 2;
+ int newHeight = image.Height / 2;
+ return image.GetThumbnailImage(newWidth, newHeight, () => { return false; }, IntPtr.Zero);
+ }
+
+ private static long GetImageSizeInBytes(Image image)
+ {
+ using (MemoryStream memoryStream = new MemoryStream())
+ {
+ image.Save(memoryStream, image.RawFormat);
+ return memoryStream.Length;
+ }
+ }
+ }
+
+
+}
diff --git a/SGGL/BLL/OpenService/YunMouService.cs b/SGGL/BLL/OpenService/YunMouService.cs
new file mode 100644
index 00000000..9990fff4
--- /dev/null
+++ b/SGGL/BLL/OpenService/YunMouService.cs
@@ -0,0 +1,416 @@
+using BLL.Common;
+using Newtonsoft.Json;
+using System;
+using System.Linq;
+using System.Timers;
+
+namespace BLL
+{
+ public class YunMouService
+ {
+
+ #region 启动监视器 系统启动5分钟
+ ///
+ /// 监视组件
+ ///
+ private static Timer messageTimer;
+ private static string token;
+ private static string consumerId;
+ ///
+ /// 启动监视器,不一定能成功,根据系统设置决定对监视器执行的操作 系统启动5分钟
+ ///
+ public static void StartMonitor()
+ {
+ token = YunMouHelper.getToken();
+ consumerId = YunMouHelper.addConsumer(token);
+
+ if (messageTimer != null)
+ {
+ messageTimer.Stop();
+ messageTimer.Dispose();
+ messageTimer = null;
+ }
+
+ messageTimer = new Timer
+ {
+ AutoReset = true
+ };
+ messageTimer.Elapsed += new ElapsedEventHandler(InProcess);
+ messageTimer.Interval = 4000 * 60;// 10分钟
+ messageTimer.Start();
+ }
+
+ ///
+ /// 流程确认 定时执行 系统启动5分钟
+ ///
+ /// Timer组件
+ /// 事件参数
+ private static void InProcess(object sender, ElapsedEventArgs e)
+ {
+ //自动调用
+ DoSynchDataNew();
+ }
+ #endregion
+
+ ///
+ /// 手动调用
+ ///
+ public static void manualOperation(string tokenSd, string consumerIdSd)
+ {
+ DoSynchData(tokenSd, consumerIdSd);
+ }
+
+ ///
+ ///
+ ///
+ public static void DoSynchData(string tokenSd = "", string consumerIdSd = "")
+ {
+ try
+ {
+ if (string.IsNullOrEmpty(token))
+ {
+ token = tokenSd;
+ }
+
+ if (string.IsNullOrEmpty(consumerId))
+ {
+ consumerId = consumerIdSd;
+ }
+ ////获取token
+ //token = YunMouHelper.getToken();
+ ////创建消费者消费者如果5分钟未调用拉取消息接口将被删除。
+ //consumerId = YunMouHelper.addConsumer(token);
+ ErrLogInfo.WriteLog(token + ";" + consumerId);
+
+ string content = YunMouHelper.consumerMessage(consumerId, token);
+ //调用消息队列第一次
+ ErrLogInfo.WriteLog(content);
+ var j2 = JsonConvert.DeserializeObject(content);
+
+ //消费者首次拉取消息时需要与消息通道建立连接,此次调用实际拉到消息列表为空,
+ //再次调用即可拉取到消息,30秒内必须再次调用拉取消息接口,否则将断开与消息通道的连接。
+ //因此拉取间隔需要在30秒以内,否则每次拉到的消息是空的
+ if (j2.data.Count > 0)
+ {
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ for (int i = 0; i < j2.data.Count; i++)
+ {
+ var msg = JsonConvert.DeserializeObject(j2.data[i]["content"].ToString());
+ if (!string.IsNullOrEmpty(Convert.ToString(msg.employeeNo)))
+ {
+ string deviceSerial = Convert.ToString(msg.deviceSerial);
+ string employeeNo = Convert.ToString(msg.employeeNo);
+ DateTime dateTime = Convert.ToDateTime(Convert.ToString(msg.dateTime));
+ var devices = Funs.DB.Project_Devices.FirstOrDefault(x => x.DeviceSerial == deviceSerial);
+ Model.SitePerson_PersonInOut newInOut = new Model.SitePerson_PersonInOut
+ {
+ ProjectId = devices.ProjectId,
+ IdentityCard = employeeNo,
+ IsIn = true,
+ ChangeTime = dateTime,
+ InOutWay = Const.InOutWay_1,
+ };
+ InsertInOut(newInOut);
+ }
+
+ }
+ }
+ }
+ else
+ {
+ //修改 如果为空循环调用最多5次
+ for (int y = 0; y < 5; y++)
+ {
+ //如果为空再调一次
+ content = YunMouHelper.consumerMessage(consumerId, token);
+ //调用消息队列第二次
+ ErrLogInfo.WriteLog(content+"调用消息队列" + (y + 2).ToString());
+ j2 = JsonConvert.DeserializeObject(content);
+ if (j2.data.Count > 0)
+ {
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ for (int i = 0; i < j2.data.Count; i++)
+ {
+ var msg = JsonConvert.DeserializeObject(j2.data[i]["content"].ToString());
+ if (!string.IsNullOrEmpty(Convert.ToString(msg.employeeNo)))
+ {
+ string deviceSerial = Convert.ToString(msg.deviceSerial);
+ string employeeNo = Convert.ToString(msg.employeeNo);
+ DateTime dateTime = Convert.ToDateTime(Convert.ToString(msg.dateTime));
+
+ var devices = Funs.DB.Project_Devices.FirstOrDefault(x => x.DeviceSerial == deviceSerial);
+ //身份证号时
+ if (employeeNo.Length == 18)
+ {
+ Model.SitePerson_PersonInOut newInOut = new Model.SitePerson_PersonInOut
+ {
+ ProjectId = devices.ProjectId,
+ IdentityCard = employeeNo,
+ IsIn = true,
+ ChangeTime = dateTime,
+ InOutWay = Const.InOutWay_1,
+ };
+ InsertInOut(newInOut);
+
+ }
+ }
+
+ }
+ //提交偏移量
+ var msgOffset = YunMouHelper.offsets(consumerId, token);
+ }
+ //有值跳出循环
+ break;
+ }
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ var erro = ex.Message;
+ ErrLogInfo.WriteLog(ex.Message);
+ }
+ }
+
+ public static void DoSynchDataNew()
+ {
+ try
+ {
+ ////获取token
+ //token = YunMouHelper.getToken();
+ ////创建消费者消费者如果5分钟未调用拉取消息接口将被删除。
+ //consumerId = YunMouHelper.addConsumer(token);
+
+ ErrLogInfo.WriteLog(token + ";" + consumerId+ "调用消息队列参数");
+ string content = YunMouHelper.consumerMessage(consumerId, token);
+ //调用消息队列第一次
+ ErrLogInfo.WriteLog(content );
+ var j2 = JsonConvert.DeserializeObject(content);
+
+ //消费者首次拉取消息时需要与消息通道建立连接,此次调用实际拉到消息列表为空,
+ //再次调用即可拉取到消息,30秒内必须再次调用拉取消息接口,否则将断开与消息通道的连接。
+ //因此拉取间隔需要在30秒以内,否则每次拉到的消息是空的
+ if (j2.data.Count > 0)
+ {
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ for (int i = 0; i < j2.data.Count; i++)
+ {
+ var msg = JsonConvert.DeserializeObject(j2.data[i]["content"].ToString());
+ if (!string.IsNullOrEmpty(Convert.ToString(msg.employeeNo)))
+ {
+ string deviceSerial = Convert.ToString(msg.deviceSerial);
+ string employeeNo = Convert.ToString(msg.employeeNo);
+ DateTime dateTime = Convert.ToDateTime(Convert.ToString(msg.dateTime));
+ var devices = db.Project_Devices.FirstOrDefault(x => x.DeviceSerial == deviceSerial);
+ Model.SitePerson_PersonInOut newInOut = new Model.SitePerson_PersonInOut
+ {
+ ProjectId = devices.ProjectId,
+ IdentityCard = employeeNo,
+ IsIn = true,
+ ChangeTime = dateTime,
+ InOutWay = Const.InOutWay_1,
+ };
+ InsertInOut(newInOut);
+ }
+
+ }
+ }
+ }
+ else
+ {
+ //修改 如果为空循环调用最多5次
+ for (int y = 0; y < 5; y++)
+ {
+ //如果为空再调一次
+ content = YunMouHelper.consumerMessage(consumerId, token);
+ //调用消息队列第二次
+ ErrLogInfo.WriteLog(content+ "调用消息队列" + (y + 2).ToString());
+ j2 = JsonConvert.DeserializeObject(content);
+ if (j2.data.Count > 0)
+ {
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ for (int i = 0; i < j2.data.Count; i++)
+ {
+ var msg = JsonConvert.DeserializeObject(j2.data[i]["content"].ToString());
+ if (!string.IsNullOrEmpty(Convert.ToString(msg.employeeNo)))
+ {
+ string deviceSerial = Convert.ToString(msg.deviceSerial);
+ string employeeNo = Convert.ToString(msg.employeeNo);
+ DateTime dateTime = Convert.ToDateTime(Convert.ToString(msg.dateTime));
+
+ var devices = Funs.DB.Project_Devices.FirstOrDefault(x => x.DeviceSerial == deviceSerial);
+ //身份证号时
+ if (employeeNo.Length == 18)
+ {
+ Model.SitePerson_PersonInOut newInOut = new Model.SitePerson_PersonInOut
+ {
+ ProjectId = devices.ProjectId,
+ IdentityCard = employeeNo,
+ IsIn = true,
+ ChangeTime = dateTime,
+ InOutWay = Const.InOutWay_1,
+ };
+ InsertInOut(newInOut);
+
+ }
+ }
+
+ }
+ //提交偏移量
+ var msgOffset = YunMouHelper.offsets(consumerId, token);
+ }
+ //有值跳出循环
+ break;
+ }
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ var erro = ex.Message;
+ ErrLogInfo.WriteLog(ex.Message );
+ }
+ }
+
+ #region 根据考勤时间进入考勤
+ public static void InsertInOut(Model.SitePerson_PersonInOut model)
+ {
+ //考勤时间配置不为空的情况
+ var Kqgl_DateManageModel = Funs.DB.Kqgl_DateManage.FirstOrDefault(x => x.ProjectId == model.ProjectId);
+ if (Kqgl_DateManageModel != null)
+ {
+ var changeTime = Convert.ToDateTime(model.ChangeTime);
+ var nowTime = TimeSpan.Parse(changeTime.ToString("HH:mm:ss"));//当前时间的时分秒
+ #region 根据规则判断是进门还是出门
+ TimeSpan AmStartTime1 = TimeSpan.Parse(Kqgl_DateManageModel.AmStartTime1.ToString());
+ TimeSpan AmStartTime2 = TimeSpan.Parse(Kqgl_DateManageModel.AmStartTime2.ToString());
+
+ TimeSpan AmEndTime1 = TimeSpan.Parse(Kqgl_DateManageModel.AmEndTime1.ToString());
+ TimeSpan AmEndTime2 = TimeSpan.Parse(Kqgl_DateManageModel.AmEndTime2.ToString());
+
+ TimeSpan PmStartTime1 = TimeSpan.Parse(Kqgl_DateManageModel.PmStartTime1.ToString());
+ TimeSpan PmStartTime2 = TimeSpan.Parse(Kqgl_DateManageModel.PmStartTime2.ToString());
+
+ TimeSpan PmEndTime1 = TimeSpan.Parse(Kqgl_DateManageModel.PmEndTime1.ToString());
+ TimeSpan PmEndTime2 = TimeSpan.Parse(Kqgl_DateManageModel.PmEndTime2.ToString());
+
+ TimeSpan time1 = new TimeSpan(0, Convert.ToInt32(Kqgl_DateManageModel.LateTime), 0);
+ TimeSpan time2 = new TimeSpan(0, Convert.ToInt32(Kqgl_DateManageModel.LeaveTime), 0);
+ //允许迟到x分钟
+ AmStartTime2 = AmStartTime2.Add(time2);
+ PmStartTime2 = PmStartTime2.Add(time2);
+
+ //允许早退x分钟
+ AmEndTime1 = AmEndTime1.Add(-time1);
+ PmEndTime1 = PmEndTime1.Add(-time1);
+
+ var personModel = Funs.DB.SitePerson_Person.FirstOrDefault(x => x.IdentityCard == model.IdentityCard && x.ProjectId == model.ProjectId);
+ if (personModel != null)
+ {
+ //状态:0上午上班 1上午下班 2下午上班 3下午下班
+ var state = "";
+ //如果是在进场时间内
+ if (nowTime >= AmStartTime1 && nowTime <= AmStartTime2)
+ {
+ model.IsIn = true;
+ state = "0";
+ }
+ if (nowTime >= PmStartTime1 && nowTime <= PmStartTime2)
+ {
+ model.IsIn = true;
+ state = "2";
+ }
+ if (nowTime >= AmEndTime1 && nowTime <= AmEndTime2)
+ {
+ model.IsIn = false;
+ state = "1";
+ }
+ if (nowTime >= PmEndTime1 && nowTime <= PmEndTime2)
+ {
+ model.IsIn = false;
+ state = "3";
+ }
+ Model.SGGLDB db = Funs.DB;
+ #region 这个人该时间点内有数据的话,就删掉(上班打卡时间取最早不删除,下班取最晚,删除早的)
+ var objTime1 = Convert.ToDateTime(Convert.ToDateTime(changeTime).ToString("yyyy-MM-dd") + " " + AmStartTime1.ToString());
+ var objTime2 = Convert.ToDateTime(Convert.ToDateTime(changeTime).ToString("yyyy-MM-dd") + " " + AmStartTime2.ToString());
+
+ var objTime3 = Convert.ToDateTime(Convert.ToDateTime(changeTime).ToString("yyyy-MM-dd") + " " + AmEndTime1.ToString());
+ var objTime4 = Convert.ToDateTime(Convert.ToDateTime(changeTime).ToString("yyyy-MM-dd") + " " + AmEndTime2.ToString());
+
+ var objTime5 = Convert.ToDateTime(Convert.ToDateTime(changeTime).ToString("yyyy-MM-dd") + " " + PmStartTime1.ToString());
+ var objTime6 = Convert.ToDateTime(Convert.ToDateTime(changeTime).ToString("yyyy-MM-dd") + " " + PmStartTime2.ToString());
+
+ var objTime7 = Convert.ToDateTime(Convert.ToDateTime(changeTime).ToString("yyyy-MM-dd") + " " + PmEndTime1.ToString());
+ var objTime8 = Convert.ToDateTime(Convert.ToDateTime(changeTime).ToString("yyyy-MM-dd") + " " + PmEndTime2.ToString());
+
+ //1.上午上班
+ var result1 = db.SitePerson_PersonInOut.Where(x => x.ProjectId == model.ProjectId && x.IdentityCard == personModel.IdentityCard &&
+ x.ChangeTime >= objTime1 && x.ChangeTime <= objTime2
+ ).ToList();
+ //2.上午下班
+ var result2 = db.SitePerson_PersonInOut.Where(x => x.ProjectId == model.ProjectId && x.IdentityCard == personModel.IdentityCard &&
+ x.ChangeTime >= objTime3 && x.ChangeTime <= objTime4
+ ).ToList();
+ //3.下午上班
+ var result3 = db.SitePerson_PersonInOut.Where(x => x.ProjectId == model.ProjectId && x.IdentityCard == personModel.IdentityCard &&
+ x.ChangeTime >= objTime5 && x.ChangeTime <= objTime6
+ ).ToList();
+ //4.下午下班
+ var result4 = db.SitePerson_PersonInOut.Where(x => x.ProjectId == model.ProjectId && x.IdentityCard == personModel.IdentityCard &&
+ x.ChangeTime >= objTime7 && x.ChangeTime <= objTime8
+ ).ToList();
+
+ //上班打卡时间取最早,下班取最晚
+ if (result1.Count > 0 && state == "0")
+ {
+ //db.SitePerson_PersonInOut.DeleteAllOnSubmit(result1);
+ //db.SubmitChanges();
+ }
+ else if (result1.Count == 0 && state == "0")
+ {
+ PersonInOutService.AddPersonInOut(model);
+ }
+ if (result2.Count > 0 && state == "1")
+ {
+ db.SitePerson_PersonInOut.DeleteAllOnSubmit(result2);
+ db.SubmitChanges();
+ PersonInOutService.AddPersonInOut(model);
+ }
+ else if (result2.Count == 0 && state == "1")
+ {
+ PersonInOutService.AddPersonInOut(model);
+ }
+ if (result3.Count > 0 && state == "2")
+ {
+ //db.SitePerson_PersonInOut.DeleteAllOnSubmit(result3);
+ //db.SubmitChanges();
+ }
+ else if (result3.Count == 0 && state == "2")
+ {
+ PersonInOutService.AddPersonInOut(model);
+ }
+ if (result4.Count > 0 && state == "3")
+ {
+ db.SitePerson_PersonInOut.DeleteAllOnSubmit(result4);
+ db.SubmitChanges();
+ PersonInOutService.AddPersonInOut(model);
+ }
+ else if (result4.Count == 0 && state == "3")
+ {
+ PersonInOutService.AddPersonInOut(model);
+ }
+ #endregion
+ }
+
+ #endregion
+ }
+
+ }
+ #endregion
+ }
+}
diff --git a/SGGL/BLL/ProjectData/ProjectDeviceService.cs b/SGGL/BLL/ProjectData/ProjectDeviceService.cs
new file mode 100644
index 00000000..96cc1141
--- /dev/null
+++ b/SGGL/BLL/ProjectData/ProjectDeviceService.cs
@@ -0,0 +1,87 @@
+namespace BLL
+{
+ using System.Collections.Generic;
+ using System.Linq;
+ using Model;
+
+ public static class ProjectDeviceService
+ {
+ public static Model.SGGLDB db = Funs.DB;
+
+ ///
+ ///获取项目单位信息
+ ///
+ ///
+ public static Model.Project_Devices GetProjectDeviceById(string deviceId)
+ {
+ return Funs.DB.Project_Devices.FirstOrDefault(e => e.DeviceId == deviceId);
+ }
+
+
+ ///
+ /// 增加项目设备信息
+ ///
+ ///
+ public static void AddProjectDevice(Project_Devices projectDevices)
+ {
+ SGGLDB db = Funs.DB;
+ Project_Devices newProjectUnit = new Project_Devices
+ {
+ DeviceId = SQLHelper.GetNewID(typeof(Model.Project_Devices)),
+ ProjectId = projectDevices.ProjectId,
+ DeviceName = projectDevices.DeviceName,
+ DeviceSerial = projectDevices.DeviceSerial,
+ CreateDate = projectDevices.CreateDate,
+ Address = projectDevices.Address,
+ IsInOut = projectDevices.IsInOut,
+ ValidateCode = projectDevices.ValidateCode,
+ YunMouDeviceId = projectDevices.YunMouDeviceId,
+ YunMouPermission = projectDevices.YunMouPermission,
+ };
+ db.Project_Devices.InsertOnSubmit(newProjectUnit);
+ db.SubmitChanges();
+ }
+
+ ///
+ ///修改项目设备信息
+ ///
+ ///
+ public static void UpdateProjectDevice(Model.Project_Devices devices)
+ {
+ Model.SGGLDB db = Funs.DB;
+ Model.Project_Devices newDevices = db.Project_Devices.FirstOrDefault(e => e.DeviceId == devices.DeviceId);
+ if (newDevices != null)
+ {
+ newDevices.ProjectId = devices.ProjectId;
+ newDevices.DeviceName = devices.DeviceName;
+ newDevices.DeviceSerial = devices.DeviceSerial;
+ newDevices.CreateDate = devices.CreateDate;
+ newDevices.Address = devices.Address;
+ newDevices.IsInOut = devices.IsInOut;
+ newDevices.ValidateCode = devices.ValidateCode;
+ newDevices.YunMouPermission = devices.YunMouPermission;
+ newDevices.YunMouDeviceId = devices.YunMouDeviceId;
+ db.SubmitChanges();
+ }
+ }
+
+ ///
+ /// 根据项目单位Id删除一个项目单位信息
+ ///
+ ///
+ public static void DeleteProjectDeviceById(string deviceId)
+ {
+ Model.SGGLDB db = Funs.DB;
+ Model.Project_Devices devices = db.Project_Devices.FirstOrDefault(e => e.DeviceId == deviceId);
+ if (devices != null)
+ {
+ db.Project_Devices.DeleteOnSubmit(devices);
+ db.SubmitChanges();
+ }
+ }
+
+
+
+
+ }
+}
diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
index ba58f7e9..a36f6d86 100644
--- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
+++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
@@ -1982,6 +1982,7 @@
+
@@ -3104,6 +3105,8 @@
+
+
@@ -13575,6 +13578,13 @@
SafetyOrganizationEdit.aspx
+
+ DateManage.aspx
+ ASPXCodeBehind
+
+
+ DateManage.aspx
+
DayReport.aspx
ASPXCodeBehind
@@ -15080,6 +15090,20 @@
MainItemView.aspx
+
+ ProjectDevices.aspx
+ ASPXCodeBehind
+
+
+ ProjectDevices.aspx
+
+
+ ProjectDevicesEdit.aspx
+ ASPXCodeBehind
+
+
+ ProjectDevicesEdit.aspx
+
ProjectInformation.aspx
ASPXCodeBehind
diff --git a/SGGL/FineUIPro.Web/Global.asax.cs b/SGGL/FineUIPro.Web/Global.asax.cs
index dc8e23be..fcdc7c02 100644
--- a/SGGL/FineUIPro.Web/Global.asax.cs
+++ b/SGGL/FineUIPro.Web/Global.asax.cs
@@ -64,6 +64,7 @@
{
BLL.MonitorService.StartMonitor();
BLL.MonitorService.StartMonitorEve();
+ BLL.YunMouService.StartMonitor();
//BLL.MonitorService.StartPersonQuarterCheck();
QuartzServices.Init();
}
diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/DateManage.aspx b/SGGL/FineUIPro.Web/HSSE/SitePerson/DateManage.aspx
new file mode 100644
index 00000000..c4bea2b7
--- /dev/null
+++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/DateManage.aspx
@@ -0,0 +1,107 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DateManage.aspx.cs" Inherits="FineUIPro.Web.HSSE.SitePerson.DateManage" %>
+
+
+
+
+
+
+ 考勤时间管理
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/DateManage.aspx.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/DateManage.aspx.cs
new file mode 100644
index 00000000..cfbe063d
--- /dev/null
+++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/DateManage.aspx.cs
@@ -0,0 +1,112 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using BLL;
+
+namespace FineUIPro.Web.HSSE.SitePerson
+{
+ public partial class DateManage : PageBase
+ {
+ public string ProjectId
+ {
+ get
+ {
+ return (string)ViewState["ProjectId"];
+ }
+ set
+ {
+ ViewState["ProjectId"] = value;
+ }
+ }
+
+ public Model.SGGLDB db = Funs.DB;
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ ProjectId = CurrUser.LoginProjectId;
+ GetButtonPower();
+ var result = db.Kqgl_DateManage.FirstOrDefault(x => x.ProjectId == ProjectId);
+ if (result!=null)
+ {
+ txtAmStartTime1.Text = result.AmStartTime1.ToString();
+ txtAmStartTime2.Text = result.AmStartTime2.ToString();
+ txtAmEndTime1.Text = result.AmEndTime1.ToString();
+ txtAmEndTime2.Text = result.AmEndTime2.ToString();
+ txtPmStartTime1.Text = result.PmStartTime1.ToString();
+ txtPmStartTime2.Text = result.PmStartTime2.ToString();
+ txtPmEndTime1.Text = result.PmEndTime1.ToString();
+ txtPmEndTime2.Text = result.PmEndTime2.ToString();
+ txtLateTime.Text = result.LateTime.ToString();
+ txtLeaveTime.Text = result.LeaveTime.ToString();
+ txtEquipmentCode.Text = result.EquipmentCode;
+ }
+ }
+ }
+
+ void GetButtonPower()
+ {
+ if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.Menu_KqglDateManger, Const.BtnSave))
+ {
+ this.btnSave.Hidden = false;
+ }
+ }
+
+ protected void btnSave_Click(object sender, EventArgs e) {
+ var result = db.Kqgl_DateManage.FirstOrDefault(x => x.ProjectId == ProjectId);
+ if (result==null)
+ {
+ Model.Kqgl_DateManage model = new Model.Kqgl_DateManage()
+ {
+ ProjectId=ProjectId,
+ Id = Guid.NewGuid().ToString(),
+
+ AmStartTime2 = TimeSpan.Parse(txtAmStartTime2.Text),
+
+ AmEndTime1 = TimeSpan.Parse(txtAmEndTime1.Text),
+ AmEndTime2 = TimeSpan.Parse(txtAmEndTime2.Text),
+
+ PmStartTime1 = TimeSpan.Parse(txtPmStartTime1.Text),
+ PmStartTime2 = TimeSpan.Parse(txtPmStartTime2.Text),
+
+ PmEndTime1 = TimeSpan.Parse(txtPmEndTime1.Text),
+ PmEndTime2 = TimeSpan.Parse(txtPmEndTime2.Text),
+
+ LateTime = Convert.ToInt32(txtLateTime.Text),
+ LeaveTime = Convert.ToInt32(txtLeaveTime.Text),
+ EquipmentCode= txtEquipmentCode.Text.Trim()
+ };
+ model.AmStartTime1 = TimeSpan.Parse(txtAmStartTime1.Text);
+ db.Kqgl_DateManage.InsertOnSubmit(model);
+ db.SubmitChanges();
+ }
+ else
+ {
+ var model = db.Kqgl_DateManage.FirstOrDefault(x => x.Id == result.Id) ;
+
+
+ model.AmStartTime2 = TimeSpan.Parse(txtAmStartTime2.Text);
+
+ model.AmEndTime1 = TimeSpan.Parse(txtAmEndTime1.Text);
+ model.AmEndTime2 = TimeSpan.Parse(txtAmEndTime2.Text);
+
+ model.PmStartTime1 = TimeSpan.Parse(txtPmStartTime1.Text);
+ model.PmStartTime2 = TimeSpan.Parse(txtPmStartTime2.Text);
+
+ model.PmEndTime1 = TimeSpan.Parse(txtPmEndTime1.Text);
+ model.PmEndTime2 = TimeSpan.Parse(txtPmEndTime2.Text);
+
+ model.LateTime = Convert.ToInt32(txtLateTime.Text);
+ model.LeaveTime = Convert.ToInt32(txtLeaveTime.Text);
+
+ model.AmStartTime1 = TimeSpan.Parse(txtAmStartTime1.Text);
+ model.EquipmentCode = txtEquipmentCode.Text.Trim();
+ db.SubmitChanges();
+ }
+ Alert.ShowInTop("编辑成功!", MessageBoxIcon.Success);
+ }
+ }
+}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/DateManage.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/DateManage.aspx.designer.cs
new file mode 100644
index 00000000..3318e4a5
--- /dev/null
+++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/DateManage.aspx.designer.cs
@@ -0,0 +1,188 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace FineUIPro.Web.HSSE.SitePerson
+{
+
+
+ public partial class DateManage
+ {
+
+ ///
+ /// form1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+ ///
+ /// PageManager1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.PageManager PageManager1;
+
+ ///
+ /// RegionPanel1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.RegionPanel RegionPanel1;
+
+ ///
+ /// Region2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Region Region2;
+
+ ///
+ /// GroupPanel0 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.GroupPanel GroupPanel0;
+
+ ///
+ /// SimpleForm1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Form SimpleForm1;
+
+ ///
+ /// txtAmStartTime1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DatePicker txtAmStartTime1;
+
+ ///
+ /// txtAmStartTime2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DatePicker txtAmStartTime2;
+
+ ///
+ /// txtAmEndTime1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DatePicker txtAmEndTime1;
+
+ ///
+ /// txtAmEndTime2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DatePicker txtAmEndTime2;
+
+ ///
+ /// txtPmStartTime1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DatePicker txtPmStartTime1;
+
+ ///
+ /// txtPmStartTime2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DatePicker txtPmStartTime2;
+
+ ///
+ /// txtPmEndTime1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DatePicker txtPmEndTime1;
+
+ ///
+ /// txtPmEndTime2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DatePicker txtPmEndTime2;
+
+ ///
+ /// txtLateTime 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.NumberBox txtLateTime;
+
+ ///
+ /// txtLeaveTime 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.NumberBox txtLeaveTime;
+
+ ///
+ /// txtEquipmentCode 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextArea txtEquipmentCode;
+
+ ///
+ /// Toolbar1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Toolbar Toolbar1;
+
+ ///
+ /// btnSave 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnSave;
+ }
+}
diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/DayReport.aspx.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/DayReport.aspx.cs
index 58372af6..95a960b4 100644
--- a/SGGL/FineUIPro.Web/HSSE/SitePerson/DayReport.aspx.cs
+++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/DayReport.aspx.cs
@@ -198,14 +198,12 @@ namespace FineUIPro.Web.HSSE.SitePerson
Response.End();
}
-#pragma warning disable CS0108 // “DayReport.GetGridTableHtml(Grid)”隐藏继承的成员“PageBase.GetGridTableHtml(Grid)”。如果是有意隐藏,请使用关键字 new。
///
/// 导出方法
///
///
///
private string GetGridTableHtml(Grid grid)
-#pragma warning restore CS0108 // “DayReport.GetGridTableHtml(Grid)”隐藏继承的成员“PageBase.GetGridTableHtml(Grid)”。如果是有意隐藏,请使用关键字 new。
{
StringBuilder sb = new StringBuilder();
sb.Append("");
diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonInfo.aspx b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonInfo.aspx
index 0350b8ea..7a6418c2 100644
--- a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonInfo.aspx
+++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonInfo.aspx
@@ -36,6 +36,9 @@
+
+
diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonInfo.aspx.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonInfo.aspx.cs
index 5009dbfc..2cdfcfa0 100644
--- a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonInfo.aspx.cs
+++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonInfo.aspx.cs
@@ -1,5 +1,7 @@
-using BLL;
+using Apache.NMS.ActiveMQ.Commands;
+using BLL;
using System;
+using BLL.Common;
using System.Linq;
using System.Text;
using AspNet = System.Web.UI.WebControls;
@@ -8,6 +10,28 @@ namespace FineUIPro.Web.HSSE.SitePerson
{
public partial class PersonInfo : PageBase
{
+ public string consumerIdR
+ {
+ get
+ {
+ return (string)ViewState["consumerIdR"];
+ }
+ set
+ {
+ ViewState["consumerIdR"] = value;
+ }
+ }
+ public string tokenR
+ {
+ get
+ {
+ return (string)ViewState["tokenR"];
+ }
+ set
+ {
+ ViewState["tokenR"] = value;
+ }
+ }
#region 加载页面
///
/// 加载页面
@@ -18,6 +42,12 @@ namespace FineUIPro.Web.HSSE.SitePerson
{
if (!IsPostBack)
{
+ ////获取token
+ tokenR = YunMouHelper.getToken();
+ ////创建消费者消费者如果5分钟未调用拉取消息接口将被删除。
+ consumerIdR = YunMouHelper.addConsumer(tokenR);
+
+
////权限按钮方法
this.GetButtonPower();
btnNew.OnClientClick = Window1.GetShowReference("PersonInfoEdit.aspx") + "return false;";
@@ -369,6 +399,11 @@ namespace FineUIPro.Web.HSSE.SitePerson
}
Alert.ShowInTop("写入考勤" + count.ToString() + "条。", MessageBoxIcon.Success);
+ } //云眸同步
+ protected void btnYunMou_Click(object sender, EventArgs e)
+ {
+ YunMouService.manualOperation(tokenR, consumerIdR);
+ BindGrid();
}
}
}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonInfo.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonInfo.aspx.designer.cs
index 5adb8b0f..6b54b1eb 100644
--- a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonInfo.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonInfo.aspx.designer.cs
@@ -7,11 +7,13 @@
// 自动生成>
//------------------------------------------------------------------------------
-namespace FineUIPro.Web.HSSE.SitePerson {
-
-
- public partial class PersonInfo {
-
+namespace FineUIPro.Web.HSSE.SitePerson
+{
+
+
+ public partial class PersonInfo
+ {
+
///
/// form1 控件。
///
@@ -20,7 +22,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
-
+
///
/// PageManager1 控件。
///
@@ -29,7 +31,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.PageManager PageManager1;
-
+
///
/// Panel1 控件。
///
@@ -38,7 +40,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Panel Panel1;
-
+
///
/// Grid1 控件。
///
@@ -47,7 +49,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Grid Grid1;
-
+
///
/// Toolbar2 控件。
///
@@ -56,7 +58,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Toolbar Toolbar2;
-
+
///
/// rbInOutWay 控件。
///
@@ -65,7 +67,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.RadioButtonList rbInOutWay;
-
+
///
/// drpUnit 控件。
///
@@ -74,7 +76,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.DropDownList drpUnit;
-
+
///
/// txtStartDate 控件。
///
@@ -83,7 +85,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.DatePicker txtStartDate;
-
+
///
/// txtEndDate 控件。
///
@@ -92,7 +94,16 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.DatePicker txtEndDate;
-
+
+ ///
+ /// Button1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button Button1;
+
///
/// btnNew 控件。
///
@@ -101,7 +112,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnNew;
-
+
///
/// btnImport 控件。
///
@@ -110,7 +121,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnImport;
-
+
///
/// Toolbar1 控件。
///
@@ -119,7 +130,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Toolbar Toolbar1;
-
+
///
/// txtPersonName 控件。
///
@@ -128,7 +139,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.TextBox txtPersonName;
-
+
///
/// txtIdCard 控件。
///
@@ -137,7 +148,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.TextBox txtIdCard;
-
+
///
/// btSearch 控件。
///
@@ -146,7 +157,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btSearch;
-
+
///
/// btnOut 控件。
///
@@ -155,7 +166,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnOut;
-
+
///
/// btnInRealName 控件。
///
@@ -164,7 +175,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnInRealName;
-
+
///
/// btnPersonOut 控件。
///
@@ -173,7 +184,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnPersonOut;
-
+
///
/// labNumber 控件。
///
@@ -182,7 +193,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::System.Web.UI.WebControls.Label labNumber;
-
+
///
/// lblIdentityCard 控件。
///
@@ -191,7 +202,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::System.Web.UI.WebControls.Label lblIdentityCard;
-
+
///
/// lblIntoOut 控件。
///
@@ -200,7 +211,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::System.Web.UI.WebControls.Label lblIntoOut;
-
+
///
/// lblInOutWayName 控件。
///
@@ -209,7 +220,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::System.Web.UI.WebControls.Label lblInOutWayName;
-
+
///
/// ToolbarSeparator1 控件。
///
@@ -218,7 +229,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
-
+
///
/// ToolbarText1 控件。
///
@@ -227,7 +238,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.ToolbarText ToolbarText1;
-
+
///
/// ddlPageSize 控件。
///
@@ -236,7 +247,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.DropDownList ddlPageSize;
-
+
///
/// Window1 控件。
///
@@ -245,7 +256,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Window Window1;
-
+
///
/// Menu1 控件。
///
@@ -254,7 +265,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Menu Menu1;
-
+
///
/// btnMenuEdit 控件。
///
@@ -263,7 +274,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.MenuButton btnMenuEdit;
-
+
///
/// btnMenuDelete 控件。
///
diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx
index 433821fe..3b30cd86 100644
--- a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx
+++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx
@@ -105,6 +105,9 @@
+
+
+
@@ -140,11 +143,14 @@
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd HH:mm:ss" HeaderText="上报集团时间"
HeaderTextAlign="Center" TextAlign="Center">
-
+
+
+ <%--
-
+ --%>
diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.cs
index be2a08ef..5b4deed6 100644
--- a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.cs
+++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.cs
@@ -1,4 +1,5 @@
using BLL;
+using BLL.Common;
using System;
using System.Collections.Generic;
using System.Data;
@@ -192,7 +193,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
}
string strSql = @"SELECT ProjectId,SitePersonId,PersonId,PersonName,IdentityCard,CardNo,PersonName
-,WorkPostId,WorkPostName,UnitId,UnitName,TeamGroupId,TeamGroupName,InTime,RealNameAddTime,States, TrainCount,TrainCount1
+,WorkPostId,WorkPostName,UnitId,UnitName,TeamGroupId,TeamGroupName,InTime,RealNameAddTime,States, TrainCount,TrainCount1,YunMouState
FROM View_SitePerson_Person
Where ProjectId=@ProjectId ";
List listStr = new List
@@ -737,5 +738,33 @@ Where ProjectId=@ProjectId ";
int count = GetDataService.SendCarNo(this.ProjectId);
Alert.ShowInTop("刷新完成" + count.ToString() + "条。", MessageBoxIcon.Success);
}
+
+ protected void btnToYunMou_Click(object sender, EventArgs e)
+ {
+ if (Grid1.SelectedRowIndexArray.Length > 0)
+ {
+ foreach (int rowIndex in Grid1.SelectedRowIndexArray)
+ {
+ string rowID = Grid1.DataKeys[rowIndex][0].ToString();
+ var sitePerson = Funs.DB.SitePerson_Person.FirstOrDefault(x => x.SitePersonId == rowID);
+ var person = Funs.DB.Person_Persons.FirstOrDefault(x => x.IdentityCard == sitePerson.IdentityCard);
+ if (!string.IsNullOrEmpty(person.PhotoUrl))
+ {
+ var token = YunMouHelper.getToken();
+ var project = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId);
+
+ var res1 = YunMouHelper.addPerson(person.IdentityCard, person.PersonName, string.IsNullOrEmpty(person.Telephone) ? "" : person.Telephone, person.PhotoUrl, token);
+ var res2 = YunMouHelper.addPersonsToGroups(project.YunMouGroupId, new string[] { person.IdentityCard }, token);
+ person.YunMouState = "已经同步";
+ Funs.DB.SubmitChanges();
+ }
+ }
+ this.BindGrid();
+ }
+ else
+ {
+ ShowNotify("请选择用户", MessageBoxIcon.Warning);
+ }
+ }
}
}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.designer.cs
index fce5b39a..f668e6bb 100644
--- a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.designer.cs
@@ -230,6 +230,15 @@ namespace FineUIPro.Web.HSSE.SitePerson
///
protected global::FineUIPro.Button btnImport;
+ ///
+ /// Button1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button Button1;
+
///
/// btnOut 控件。
///
@@ -257,15 +266,6 @@ namespace FineUIPro.Web.HSSE.SitePerson
///
protected global::FineUIPro.Button btnRefresh;
- ///
- /// lbIsPost 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::System.Web.UI.WebControls.Label lbIsPost;
-
///
/// ToolbarSeparator1 控件。
///
diff --git a/SGGL/FineUIPro.Web/ProjectData/ProjectDevices.aspx b/SGGL/FineUIPro.Web/ProjectData/ProjectDevices.aspx
new file mode 100644
index 00000000..bf46519f
--- /dev/null
+++ b/SGGL/FineUIPro.Web/ProjectData/ProjectDevices.aspx
@@ -0,0 +1,134 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProjectDevices.aspx.cs" Inherits="FineUIPro.Web.ProjectData.ProjectDevices" %>
+
+
+
+
+
+ 项目设备
+
+
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/ProjectData/ProjectDevices.aspx.cs b/SGGL/FineUIPro.Web/ProjectData/ProjectDevices.aspx.cs
new file mode 100644
index 00000000..f85822d3
--- /dev/null
+++ b/SGGL/FineUIPro.Web/ProjectData/ProjectDevices.aspx.cs
@@ -0,0 +1,327 @@
+using BLL;
+using BLL.Common;
+using FineUIPro.Web.DataShow;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Web.Services.Description;
+using WIA;
+using AspNet = System.Web.UI.WebControls;
+
+namespace FineUIPro.Web.ProjectData
+{
+ public partial class ProjectDevices : PageBase
+ {
+ #region 加载
+ ///
+ /// 加载页面
+ ///
+ ///
+ ///
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ Funs.DropDownPageSize(this.ddlPageSize);
+
+ this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
+
+ // 绑定表格
+ this.BindGrid();
+ ////权限按钮方法
+ this.GetButtonPower();
+ }
+ }
+ #endregion
+
+ ///
+ /// 绑定数据
+ ///
+ private void BindGrid()
+ {
+
+ string strSql = @" Select * ,case when [isInOut] =1 then '进' else '出' end [IsInOutValue] ,case when [YunMouDeviceId] is not null and [YunMouDeviceId] <> '' then '是' else '' end [DeviceToYunMou] from Project_Devices WHERE ";
+ List listStr = new List();
+ strSql += " ProjectId = @ProjectId";
+ listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
+ if (!string.IsNullOrEmpty(this.txtDeviceName.Text.Trim()))
+ {
+ strSql += " AND DeviceName LIKE @DeviceName";
+ listStr.Add(new SqlParameter("@DeviceName", "%" + this.txtDeviceName.Text.Trim() + "%"));
+ }
+ SqlParameter[] parameter = listStr.ToArray();
+ DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
+
+ Grid1.RecordCount = tb.Rows.Count;
+ tb = GetFilteredTable(Grid1.FilteredData, tb);
+ var table = this.GetPagedDataTable(Grid1, tb);
+ Grid1.DataSource = table;
+ Grid1.DataBind();
+ }
+
+ #region 操作 Events
+ ///
+ /// 右键删除事件
+ ///
+ ///
+ ///
+ protected void btnMenuDelete_Click(object sender, EventArgs e)
+ {
+ if (Grid1.SelectedRowIndexArray.Length > 0)
+ {
+ string unitName = string.Empty;
+ foreach (int rowIndex in Grid1.SelectedRowIndexArray)
+ {
+ string deviceId = Grid1.DataKeys[rowIndex][0].ToString();
+ Model.Project_Devices devices = Funs.DB.Project_Devices.FirstOrDefault(x => x.DeviceId == deviceId);
+ var token = YunMouHelper.getToken();
+ YunMouHelper.deleteDevices(devices.DeviceSerial, token);
+ Funs.DB.Project_Devices.DeleteOnSubmit(devices);
+ Funs.DB.SubmitChanges();
+ }
+
+ BindGrid();
+ if (string.IsNullOrEmpty(unitName))
+ {
+ ShowNotify("删除数据成功!", MessageBoxIcon.Success);
+ }
+ }
+ }
+ #endregion
+
+ #region 排序 分页
+ ///
+ ///
+ ///
+ ///
+ ///
+ protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
+ {
+ BindGrid();
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
+ BindGrid();
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
+ {
+ BindGrid();
+ }
+ #endregion
+
+ ///
+ /// 增加按钮事件
+ ///
+ ///
+ ///
+ protected void btnAdd_Click(object sender, EventArgs e)
+ {
+
+ PageContext.RegisterStartupScript(Window1.GetShowReference("ProjectDevicesEdit.aspx", "添加设备", 800, 300));
+
+ }
+
+ ///
+ /// 双击事件
+ ///
+ ///
+ ///
+ protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
+ {
+ this.EditData();
+ }
+
+ ///
+ /// 右键编辑事件
+ ///
+ ///
+ ///
+ protected void btnMenuEdit_Click(object sender, EventArgs e)
+ {
+ this.EditData();
+ }
+ protected void btnMenuDeviceToYunMou_Click(object sender, EventArgs e)
+ {
+ if (Grid1.SelectedRowIndexArray.Length == 0)
+ {
+ Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
+ return;
+ }
+
+ var device = Funs.DB.Project_Devices.FirstOrDefault(x=>x.DeviceId== Grid1.SelectedRowID) ;
+ if (device != null)
+ {
+ var project = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId);
+ var token = YunMouHelper.getToken();
+ string data;
+ data = Regex.Replace(project.ProjectCode, "[^0-9A-Fa-f]", "", RegexOptions.IgnoreCase);
+ var YunMouDeviceId = YunMouHelper.addDevices(device.DeviceSerial, data, device.ValidateCode, token);//添加设备
+ if (!string.IsNullOrEmpty(YunMouDeviceId))
+ {
+ device.YunMouDeviceId = YunMouDeviceId;
+ Funs.DB.SubmitChanges();
+ ShowNotify("同步成功", MessageBoxIcon.Success);
+ BindGrid();
+ }
+ else
+ {
+ Alert.ShowInTop("同步设备出错!", MessageBoxIcon.Warning);
+
+ }
+ }
+ }
+ protected void btnMenuSyncPermission_Click(object sender, EventArgs e)
+ {
+ if (Grid1.SelectedRowIndexArray.Length == 0)
+ {
+ Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
+ return;
+ }
+
+ var device = Funs.DB.Project_Devices.FirstOrDefault(x => x.DeviceId == Grid1.SelectedRowID);
+ if (device != null)
+ {
+ var project = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId);
+ var token = YunMouHelper.getToken();
+ var res = YunMouHelper.addDevicesToGroups(project.YunMouGroupId, new string[] { device.DeviceSerial }, token);//添加到权限组
+ YunMouHelper.setDefence(device.DeviceSerial,"1",token);
+ if (string.IsNullOrEmpty(res))
+ {
+ Alert.ShowInTop("关联权限出错!", MessageBoxIcon.Warning);
+
+ }
+ else {
+ device.YunMouPermission = "是";
+ Funs.DB.SubmitChanges();
+ ShowNotify("关联成功", MessageBoxIcon.Success);
+ BindGrid();
+ }
+ }
+ }
+
+ protected void btnMenuDeletePermission_Click(object sender, EventArgs e)
+ {
+ if (Grid1.SelectedRowIndexArray.Length == 0)
+ {
+ Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
+ return;
+ }
+
+ var device = Funs.DB.Project_Devices.FirstOrDefault(x => x.DeviceId == Grid1.SelectedRowID);
+ if (device != null)
+ {
+ var project = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId);
+ var token = YunMouHelper.getToken();
+ var res = YunMouHelper.deleteDevicesFromGroups(project.YunMouGroupId, new string[] { device.DeviceSerial }, token);//从权限组移除设备
+ if (string.IsNullOrEmpty(res))
+ {
+ Alert.ShowInTop("关联权限出错!", MessageBoxIcon.Warning);
+
+ }
+ else
+ {
+ device.YunMouPermission = null;
+ Funs.DB.SubmitChanges();
+ BindGrid();
+ }
+
+ }
+ }
+ ///
+ /// 编辑数据方法
+ ///
+ private void EditData()
+ {
+ if (Grid1.SelectedRowIndexArray.Length == 0)
+ {
+ Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
+ return;
+ }
+
+ PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectDevicesEdit.aspx?DeviceId={0}", Grid1.SelectedRowID), "编辑项目单位", 800, 300));
+
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ protected void Window1_Close(object sender, EventArgs e)
+ {
+ BindGrid();
+ }
+
+ #region 获取按钮权限
+ ///
+ /// 获取按钮权限
+ ///
+ ///
+ ///
+ private void GetButtonPower()
+ {
+ if (Request.Params["value"] == "0")
+ {
+ return;
+ }
+ string menuId = BLL.Const.ProjectDevicesMenuId;
+
+ var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, menuId);
+ if (buttonList.Count() > 0)
+ {
+ if (buttonList.Contains(BLL.Const.BtnAdd))
+ {
+ this.btnAdd.Hidden = false;
+
+ }
+ if (buttonList.Contains(BLL.Const.BtnModify))
+ {
+ this.btnMenuDeletePermission.Hidden= false;
+ this.btnAdd.Hidden = false;
+ this.btnMenuEdit.Hidden = false;
+ this.btnMenuDeviceToYunMou.Hidden = false;
+ this.btnMenuSyncPermission.Hidden = false;
+ }
+ if (buttonList.Contains(BLL.Const.BtnDelete))
+ {
+ this.btnMenuDelete.Hidden = false;
+ }
+ }
+
+
+ }
+ #endregion
+
+ #region 查询
+ ///
+ /// 查询
+ ///
+ ///
+ ///
+ protected void TextBox_TextChanged(object sender, EventArgs e)
+ {
+ this.BindGrid();
+ this.GetButtonPower();
+ }
+ #endregion
+
+
+ }
+}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/ProjectData/ProjectDevices.aspx.designer.cs b/SGGL/FineUIPro.Web/ProjectData/ProjectDevices.aspx.designer.cs
new file mode 100644
index 00000000..62f2bf25
--- /dev/null
+++ b/SGGL/FineUIPro.Web/ProjectData/ProjectDevices.aspx.designer.cs
@@ -0,0 +1,179 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace FineUIPro.Web.ProjectData
+{
+
+
+ public partial class ProjectDevices
+ {
+
+ ///
+ /// 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;
+
+ ///
+ /// txtDeviceName 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtDeviceName;
+
+ ///
+ /// btnAdd 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnAdd;
+
+ ///
+ /// 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;
+
+ ///
+ /// btnMenuEdit 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.MenuButton btnMenuEdit;
+
+ ///
+ /// btnMenuDeviceToYunMou 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.MenuButton btnMenuDeviceToYunMou;
+
+ ///
+ /// btnMenuSyncPermission 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.MenuButton btnMenuSyncPermission;
+
+ ///
+ /// btnMenuDeletePermission 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.MenuButton btnMenuDeletePermission;
+
+ ///
+ /// btnMenuDelete 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.MenuButton btnMenuDelete;
+ }
+}
diff --git a/SGGL/FineUIPro.Web/ProjectData/ProjectDevicesEdit.aspx b/SGGL/FineUIPro.Web/ProjectData/ProjectDevicesEdit.aspx
new file mode 100644
index 00000000..15651b88
--- /dev/null
+++ b/SGGL/FineUIPro.Web/ProjectData/ProjectDevicesEdit.aspx
@@ -0,0 +1,63 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProjectDevicesEdit.aspx.cs"
+ Inherits="FineUIPro.Web.ProjectData.ProjectDevicesEdit" %>
+
+
+
+
+ 编辑班组信息
+
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/ProjectData/ProjectDevicesEdit.aspx.cs b/SGGL/FineUIPro.Web/ProjectData/ProjectDevicesEdit.aspx.cs
new file mode 100644
index 00000000..d2471ca8
--- /dev/null
+++ b/SGGL/FineUIPro.Web/ProjectData/ProjectDevicesEdit.aspx.cs
@@ -0,0 +1,128 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.RegularExpressions;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using BLL;
+using BLL.Common;
+
+namespace FineUIPro.Web.ProjectData
+{
+ public partial class ProjectDevicesEdit : PageBase
+ {
+ #region 定义项
+ ///
+ /// 主键
+ ///
+ public string DeviceId
+ {
+ get
+ {
+ return (string)ViewState["DeviceId"];
+ }
+ set
+ {
+ ViewState["DeviceId"] = value;
+ }
+ }
+ #endregion
+
+ #region 加载
+ ///
+ /// 加载页面
+ ///
+ ///
+ ///
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ btnClose.OnClientClick = ActiveWindow.GetHideReference();
+ this.DeviceId = Request.Params["DeviceId"];
+ if (!string.IsNullOrEmpty(this.DeviceId))
+ {
+ Model.Project_Devices device = Funs.DB.Project_Devices.FirstOrDefault(x=>x.DeviceId==this.DeviceId);
+ if (device != null)
+ {
+ this.txtDeviceName.Text = device.DeviceName;
+ this.txtDeviceSerial.Text = device.DeviceSerial;
+ this.txtAddress.Text = device.Address;
+ this.txtValidateCode.Text = device.ValidateCode;
+ if (!string.IsNullOrEmpty(device.IsInOut))
+ {
+ this.drpInOut.SelectedValue = device.IsInOut;
+ }
+ //this.txtThirdTeamCode.Text = teamGroup.ThirdTeamCode;
+ if (device.CreateDate != null)
+ {
+ this.dpCreateDate.Text = string.Format("{0:yyyy-MM-dd}", device.CreateDate);
+ }
+
+ }
+ }
+ }
+ }
+ #endregion
+
+ #region 保存
+ ///
+ /// 保存按钮
+ ///
+ ///
+ ///
+ protected void btnSave_Click(object sender, EventArgs e)
+ {
+
+
+ Model.Project_Devices device = new Model.Project_Devices
+ {
+ ProjectId = this.CurrUser.LoginProjectId,
+ DeviceName = this.txtDeviceName.Text.Trim(),
+ DeviceSerial = this.txtDeviceSerial.Text.Trim(),
+ Address = txtAddress.Text.Trim(),
+ ValidateCode=txtValidateCode.Text.Trim(),
+ CreateDate = Funs.GetNewDateTime(this.dpCreateDate.Text.Trim())
+ };
+ if (this.drpInOut.SelectedValue != BLL.Const._Null)
+ {
+ device.IsInOut = this.drpInOut.SelectedValue;
+ }
+
+ if (!string.IsNullOrEmpty(this.DeviceId))
+ {
+ device.DeviceId = this.DeviceId;
+ BLL.ProjectDeviceService.UpdateProjectDevice(device);
+ var token = YunMouHelper.getToken();
+ YunMouHelper.updateDevices(device.DeviceSerial, device.DeviceName, token);
+ BLL.LogService.AddSys_Log(this.CurrUser, device.DeviceName, device.DeviceId, BLL.Const.ProjectDevicesMenuId, BLL.Const.BtnModify);
+ }
+ else
+ {
+ this.DeviceId = SQLHelper.GetNewID(typeof(Model.Project_Devices));
+ device.DeviceId = this.DeviceId;
+ var project = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId);
+ var token = YunMouHelper.getToken();
+ string data;
+ data = Regex.Replace(project.ProjectCode, "[^0-9A-Fa-f]", "", RegexOptions.IgnoreCase);
+ device.YunMouDeviceId = YunMouHelper.addDevices(device.DeviceSerial, data, device.ValidateCode, token);//添加设备之后,将权限添加到权限组
+ var res = YunMouHelper.addDevicesToGroups(project.YunMouGroupId, new string[] { device.DeviceSerial }, token);//添加到权限组
+ if (!string.IsNullOrEmpty(res))
+ {
+ device.YunMouPermission = "已关联";
+ }
+ BLL.ProjectDeviceService.AddProjectDevice(device);
+ BLL.LogService.AddSys_Log(this.CurrUser, device.DeviceName, device.DeviceId, BLL.Const.ProjectDevicesMenuId, BLL.Const.BtnAdd);
+ }
+ ShowNotify("保存数据成功!", MessageBoxIcon.Success);
+ PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
+ }
+ #endregion
+
+
+
+
+
+ }
+}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/ProjectData/ProjectDevicesEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/ProjectData/ProjectDevicesEdit.aspx.designer.cs
new file mode 100644
index 00000000..f88bb1f4
--- /dev/null
+++ b/SGGL/FineUIPro.Web/ProjectData/ProjectDevicesEdit.aspx.designer.cs
@@ -0,0 +1,125 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace FineUIPro.Web.ProjectData
+{
+
+
+ public partial class ProjectDevicesEdit
+ {
+
+ ///
+ /// form1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+ ///
+ /// PageManager1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.PageManager PageManager1;
+
+ ///
+ /// SimpleForm1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Form SimpleForm1;
+
+ ///
+ /// txtDeviceName 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtDeviceName;
+
+ ///
+ /// txtDeviceSerial 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtDeviceSerial;
+
+ ///
+ /// dpCreateDate 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DatePicker dpCreateDate;
+
+ ///
+ /// drpInOut 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList drpInOut;
+
+ ///
+ /// txtValidateCode 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtValidateCode;
+
+ ///
+ /// txtAddress 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtAddress;
+
+ ///
+ /// Toolbar1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Toolbar Toolbar1;
+
+ ///
+ /// btnSave 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnSave;
+
+ ///
+ /// btnClose 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnClose;
+ }
+}
diff --git a/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx b/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx
index 78c9b1f4..fca5e0d5 100644
--- a/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx
+++ b/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx
@@ -14,7 +14,31 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx.cs b/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx.cs
index 657b9e40..de5019cc 100644
--- a/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx.cs
+++ b/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx.cs
@@ -1,8 +1,10 @@
using BLL;
+using BLL.Common;
using System;
using System.Linq;
using System.Collections.Generic;
using FineUIPro;
+using System.Text.RegularExpressions;
namespace FineUIPro.Web.common.ProjectSet
{
@@ -36,7 +38,6 @@ namespace FineUIPro.Web.common.ProjectSet
}
#endregion
- #region 提交按钮
///
/// 提交按钮
///
@@ -50,36 +51,107 @@ namespace FineUIPro.Web.common.ProjectSet
ShowNotify("请选择项目!", MessageBoxIcon.Warning);
return;
}
-
- SaveWeldingSettings(projectId);
- SaveColorModelSettings(projectId);
- SaveQualitySettings(projectId);
-
- // 刷新界面
- this.Show(projectId);
-
- //BLL.Sys_LogService.AddLog(BLL.Const.System_1, this.CurrUser.LoginProjectId, this.CurrUser.PersonId, "提交项目环境设置");
- Alert.ShowInTop("提交成功!", MessageBoxIcon.Success);
+ #region 焊接
+ // 焊接
+ Model.Project_Sys_Set dayReport = BLL.Project_SysSetService.GetSysSetBySetId("1", projectId);
+ Model.Project_Sys_Set point = BLL.Project_SysSetService.GetSysSetBySetId("2", projectId);
+ Model.Project_Sys_Set trust = BLL.Project_SysSetService.GetSysSetBySetId("3", projectId);
+ Model.Project_Sys_Set pdms = BLL.Project_SysSetService.GetSysSetBySetId("4", projectId);
+ Model.Project_Sys_Set batch = BLL.Project_SysSetService.GetSysSetBySetId("5", projectId);
+ Model.Project_Sys_Set jointB = BLL.Project_SysSetService.GetSysSetBySetId("6", projectId);
+ Model.Project_Sys_Set thickness = BLL.Project_SysSetService.GetSysSetBySetId("7", projectId);
+ Model.Project_Sys_Set pressUnit = BLL.Project_SysSetService.GetSysSetBySetId("8", projectId);
+ Model.Project_Sys_Set AvevaNetUrl = BLL.Project_SysSetService.GetSysSetBySetId("9", projectId);
+ if (jointB != null)
+ {
+ if (this.ckbJointB.Checked)
+ {
+ jointB.IsAuto = true;
+ }
+ else
+ {
+ jointB.IsAuto = false;
+ }
+ BLL.Project_SysSetService.UpdateSet(jointB);
+ }
+ else
+ {
+ Model.Project_Sys_Set newJointB = new Model.Project_Sys_Set();
+ newJointB.SetId = "6";
+ newJointB.ProjectId = projectId;
+ if (this.ckbJointB.Checked)
+ {
+ newJointB.IsAuto = true;
+ }
+ else
+ {
+ newJointB.IsAuto = false;
+ }
+ BLL.Project_SysSetService.AddSet(newJointB);
+ }
+ if (pressUnit != null)
+ {
+ pressUnit.SetValue = this.rblPressUnit.SelectedValue;
+ BLL.Project_SysSetService.UpdateSet(pressUnit);
+ }
+ else
+ {
+ Model.Project_Sys_Set newPressUnit = new Model.Project_Sys_Set();
+ newPressUnit.SetId = "8";
+ newPressUnit.SetValue = this.rblPressUnit.SelectedValue;
+ newPressUnit.ProjectId = projectId;
+ BLL.Project_SysSetService.AddSet(newPressUnit);
+ }
+ if (AvevaNetUrl != null)
+ {
+ AvevaNetUrl.SetValue = this.AvevaNetUrl.Text.Trim();
+ BLL.Project_SysSetService.UpdateSet(AvevaNetUrl);
+ }
+ else
+ {
+ Model.Project_Sys_Set newAvevaNetUrl = new Model.Project_Sys_Set();
+ newAvevaNetUrl.SetId = "9";
+ newAvevaNetUrl.SetName = "AVEVA NET 地址";
+ newAvevaNetUrl.SetValue = this.AvevaNetUrl.Text.Trim();
+ newAvevaNetUrl.ProjectId = projectId;
+ BLL.Project_SysSetService.AddSet(newAvevaNetUrl);
+ }
+ if (thickness != null)
+ {
+ if (this.ckbThickness.Checked)
+ {
+ thickness.IsAuto = true;
+ }
+ else
+ {
+ thickness.IsAuto = false;
+ }
+ BLL.Project_SysSetService.UpdateSet(thickness);
+ }
+ else
+ {
+ Model.Project_Sys_Set newThickness = new Model.Project_Sys_Set();
+ newThickness.SetId = "7";
+ newThickness.ProjectId = projectId;
+ if (this.ckbThickness.Checked)
+ {
+ newThickness.IsAuto = true;
+ }
+ else
+ {
+ newThickness.IsAuto = false;
+ }
+ BLL.Project_SysSetService.AddSet(newThickness);
+ }
+ if (this.ckbPdms.Checked)
+ {
+ pdms.IsAuto = true;
+ }
+ else
+ {
+ pdms.IsAuto = false;
+ }
}
-
- private void SaveWeldingSettings(string projectId)
- {
- // Booleans stored in IsAuto
- UpsertIsAutoById("1", projectId, this.ckbDayReport.Checked);
- UpsertIsAutoById("2", projectId, this.ckbPoint.Checked);
- // trust (id 3) uses special mapping: 1->IsAuto=true, 2->IsAuto=false, otherwise IsAuto=null and SetValue holds value
- UpsertTrustSetting("3", projectId, this.robStandard.SelectedValue);
- UpsertIsAutoById("4", projectId, this.ckbPdms.Checked);
- // batch (id 5) is a list of checked items
- UpsertBatchSetting("5", projectId);
- UpsertIsAutoById("6", projectId, this.ckbJointB.Checked);
- UpsertIsAutoById("7", projectId, this.ckbThickness.Checked);
- UpsertValueById("8", projectId, this.rblPressUnit.SelectedValue);
- UpsertValueById("9", projectId, this.AvevaNetUrl.Text.Trim(), setName: "AVEVA NET 地址");
- UpsertIsAutoById("10", projectId, this.ckPressMustCheckBItem.Checked);
- UpsertValueById("11", projectId, this.rbMaterialColorAttribute.SelectedValue);
- }
-
private void SaveColorModelSettings(string projectId)
{
UpsertByName("管线未完成", projectId, this.txtPipelineNOComplete.Text.Trim());
diff --git a/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx.designer.cs b/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx.designer.cs
index 4be47d9a..7fc98aa3 100644
--- a/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx.designer.cs
@@ -50,6 +50,33 @@ namespace FineUIPro.Web.common.ProjectSet
///
protected global::FineUIPro.Region Region2;
+ ///
+ /// GroupPanel0 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.GroupPanel GroupPanel0;
+
+ ///
+ /// Form4 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Form Form4;
+
+ ///
+ /// ckbIsYunMou 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.CheckBox ckbIsYunMou;
+
///
/// GroupPanel2 控件。
///
diff --git a/SGGL/Microsoft.PowerShell_profile.ps1 b/SGGL/Microsoft.PowerShell_profile.ps1
new file mode 100644
index 00000000..e69de29b
diff --git a/SGGL/WebAPI/Controllers/PersonController.cs b/SGGL/WebAPI/Controllers/PersonController.cs
index 0313f87e..af0377ad 100644
--- a/SGGL/WebAPI/Controllers/PersonController.cs
+++ b/SGGL/WebAPI/Controllers/PersonController.cs
@@ -808,11 +808,15 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
+ var trainingIds = Funs.DB.EduTrain_TrainRecord.Where(x => projectId == projectId).Select(x => x.TrainingId).ToList();
+ var personIds = Funs.DB.EduTrain_TrainRecordDetail.Where(x => trainingIds.Contains(x.TrainingId)).Select(x=>x.PersonId).ToList(); ;
+
responeData.data = (from x in Funs.DB.SitePerson_Person
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
- join persons in Funs.DB.Person_Persons on x.IdentityCard equals persons.IdentityCard
+ join persons in Funs.DB.Person_Persons on x.IdentityCard equals persons.IdentityCard
where x.ProjectId == projectId && !x.ExchangeTime.HasValue
&& x.States == Const.ProjectPersonStates_1 && x.CardNo.Length > 5 && persons.PhotoUrl != null
+ where personIds.Contains(x.PersonId)
select new
{
x.PersonId,