From 95ebbf3dc96da6cfc7952ff7a26044dc6b2b8a36 Mon Sep 17 00:00:00 2001 From: 10191 <506754232@qq.com> Date: Sat, 20 Dec 2025 17:21:55 +0800 Subject: [PATCH 01/10] 11 --- DataBase/版本日志/SGGLDB_V2025-12-20.sql | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 DataBase/版本日志/SGGLDB_V2025-12-20.sql diff --git a/DataBase/版本日志/SGGLDB_V2025-12-20.sql b/DataBase/版本日志/SGGLDB_V2025-12-20.sql new file mode 100644 index 00000000..6d2428f9 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2025-12-20.sql @@ -0,0 +1,21 @@ + +CREATE TABLE [dbo].[Project_Devices]( + [DeviceId] [nvarchar](50) NOT NULL, + [DeviceName] [nvarchar](50) NULL, + [Address] [nvarchar](500) NULL, + [CreateDate] [date] NULL, + [ProjectId] [nvarchar](50) NULL, + [DeviceSerial] [nvarchar](50) NULL, + [isInOut] [nvarchar](50) NULL, + [ValidateCode] [nvarchar](50) NULL, + [YunMouDeviceId] [nvarchar](50) NULL, + [YunMouPermission] [nvarchar](50) NULL, + CONSTRAINT [PK_Project_Devices] PRIMARY KEY CLUSTERED +( + [DeviceId] 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 + + From 9127a6ebaee39b5135c407d897559e950dcf2c74 Mon Sep 17 00:00:00 2001 From: 10191 <506754232@qq.com> Date: Sat, 20 Dec 2025 17:51:14 +0800 Subject: [PATCH 02/10] 11 --- SGGL/BLL/BLL.csproj | 1 + SGGL/BLL/Common/YunMouHelper.cs | 574 ++++++++++++++++++++++++++++++++ 2 files changed, 575 insertions(+) create mode 100644 SGGL/BLL/Common/YunMouHelper.cs diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index 5e1398c9..daa650a0 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -288,6 +288,7 @@ + diff --git a/SGGL/BLL/Common/YunMouHelper.cs b/SGGL/BLL/Common/YunMouHelper.cs new file mode 100644 index 00000000..2825490b --- /dev/null +++ b/SGGL/BLL/Common/YunMouHelper.cs @@ -0,0 +1,574 @@ + +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); + LogService.AddLog(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); + LogService.AddLog(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); + LogService.AddLog(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); + LogService.AddLog(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); + LogService.AddLog(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); + LogService.AddLog(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); + LogService.AddLog(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); + LogService.AddLog(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); + LogService.AddLog(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); + LogService.AddLog(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); + LogService.AddLog(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(); + LogService.AddLog(res, "http请求返回"); + 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; + } + } + } + + +} From f0c35de27dd69b6bc90d1f8524e75612f010bbfc Mon Sep 17 00:00:00 2001 From: 10191 <506754232@qq.com> Date: Mon, 22 Dec 2025 21:14:34 +0800 Subject: [PATCH 03/10] 11 --- DataBase/版本日志/SGGLDB_V2025-12-20.sql | 15 + SGGL/BLL/Common/Const.cs | 5 + SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 16 + .../ProjectData/ProjectDevices.aspx | 134 +++++++ .../ProjectData/ProjectDevices.aspx.cs | 327 ++++++++++++++++++ .../ProjectDevices.aspx.designer.cs | 179 ++++++++++ .../ProjectData/ProjectDevicesEdit.aspx | 63 ++++ .../ProjectData/ProjectDevicesEdit.aspx.cs | 131 +++++++ .../ProjectDevicesEdit.aspx.designer.cs | 125 +++++++ .../ProjectData/ProjectSysSet.aspx | 24 ++ .../ProjectData/ProjectSysSet.aspx.cs | 43 +++ .../ProjectSysSet.aspx.designer.cs | 27 ++ SGGL/WebAPI/Controllers/PersonController.cs | 6 +- 13 files changed, 1094 insertions(+), 1 deletion(-) create mode 100644 SGGL/FineUIPro.Web/ProjectData/ProjectDevices.aspx create mode 100644 SGGL/FineUIPro.Web/ProjectData/ProjectDevices.aspx.cs create mode 100644 SGGL/FineUIPro.Web/ProjectData/ProjectDevices.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/ProjectData/ProjectDevicesEdit.aspx create mode 100644 SGGL/FineUIPro.Web/ProjectData/ProjectDevicesEdit.aspx.cs create mode 100644 SGGL/FineUIPro.Web/ProjectData/ProjectDevicesEdit.aspx.designer.cs diff --git a/DataBase/版本日志/SGGLDB_V2025-12-20.sql b/DataBase/版本日志/SGGLDB_V2025-12-20.sql index 6d2428f9..83d9a18f 100644 --- a/DataBase/版本日志/SGGLDB_V2025-12-20.sql +++ b/DataBase/版本日志/SGGLDB_V2025-12-20.sql @@ -1,3 +1,18 @@ +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'); + + + +Alter TABLE [dbo].[Base_Project] + add + [IsYunMou] [bit] NULL, + [YunMouGroupId] [nvarchar](50) NULL + +GO CREATE TABLE [dbo].[Project_Devices]( [DeviceId] [nvarchar](50) NOT NULL, diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index 153ce344..b9bbcc74 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -5131,6 +5131,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/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index fd310b8d..99c39687 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -3061,6 +3061,8 @@ + + @@ -14772,6 +14774,20 @@ MainItemView.aspx + + ProjectDevices.aspx + ASPXCodeBehind + + + ProjectDevices.aspx + + + ProjectDevicesEdit.aspx + ASPXCodeBehind + + + ProjectDevicesEdit.aspx + ProjectInformation.aspx ASPXCodeBehind 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..ade4bc6c --- /dev/null +++ b/SGGL/FineUIPro.Web/ProjectData/ProjectDevicesEdit.aspx.cs @@ -0,0 +1,131 @@ +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; +using FastReport.Cloud.OAuth; +using FineUIPro.Web.DataShow; +using Org.BouncyCastle.Crypto; + +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 192002cd..3d269000 100644 --- a/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx +++ b/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx @@ -14,6 +14,30 @@ + + + + + + + + + + + + + + + + + + + + + + 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/WebAPI/Controllers/PersonController.cs b/SGGL/WebAPI/Controllers/PersonController.cs index 86800b99..d115bc9b 100644 --- a/SGGL/WebAPI/Controllers/PersonController.cs +++ b/SGGL/WebAPI/Controllers/PersonController.cs @@ -762,11 +762,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, From a9f0cd7fba544a45d6707a1ee220e56d6eb2d898 Mon Sep 17 00:00:00 2001 From: 10191 <506754232@qq.com> Date: Tue, 23 Dec 2025 20:33:12 +0800 Subject: [PATCH 04/10] 11 --- DataBase/版本日志/SGGLDB_V2025-12-23-002.sql | 36 + DataBase/版本日志/SGGLDB_V2025-12-23.sql | 2 + SGGL/BLL/BLL.csproj | 2 + SGGL/BLL/Common/Const.cs | 4 + SGGL/BLL/OpenService/YunMouService.cs | 416 +++++++ SGGL/BLL/ProjectData/ProjectDeviceService.cs | 87 ++ SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 10 +- SGGL/FineUIPro.Web/Global.asax.cs | 1 + .../HSSE/SitePerson/DateManage.aspx | 107 ++ .../HSSE/SitePerson/DateManage.aspx.cs | 112 ++ .../SitePerson/DateManage.aspx.designer.cs | 188 +++ .../HSSE/SitePerson/PersonInfo.aspx | 3 + .../HSSE/SitePerson/PersonInfo.aspx.cs | 37 +- .../SitePerson/PersonInfo.aspx.designer.cs | 77 +- .../HSSE/SitePerson/PersonList.aspx | 7 +- .../HSSE/SitePerson/PersonList.aspx.cs | 29 + .../SitePerson/PersonList.aspx.designer.cs | 18 +- .../ProjectData/ProjectDevicesEdit.aspx.cs | 5 +- .../ProjectData/ProjectSysSet.aspx.cs | 3 +- SGGL/Microsoft.PowerShell_profile.ps1 | 0 SGGL/Model/Model.cs | 1106 ++++++++++++++--- 21 files changed, 2015 insertions(+), 235 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_V2025-12-23-002.sql create mode 100644 DataBase/版本日志/SGGLDB_V2025-12-23.sql create mode 100644 SGGL/BLL/OpenService/YunMouService.cs create mode 100644 SGGL/BLL/ProjectData/ProjectDeviceService.cs create mode 100644 SGGL/FineUIPro.Web/HSSE/SitePerson/DateManage.aspx create mode 100644 SGGL/FineUIPro.Web/HSSE/SitePerson/DateManage.aspx.cs create mode 100644 SGGL/FineUIPro.Web/HSSE/SitePerson/DateManage.aspx.designer.cs create mode 100644 SGGL/Microsoft.PowerShell_profile.ps1 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.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/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index 7f6a19fa..72a496c3 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -602,6 +602,7 @@ + @@ -672,6 +673,7 @@ + diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index 8a64bef8..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"; /// /// 人工时月报 /// diff --git a/SGGL/BLL/OpenService/YunMouService.cs b/SGGL/BLL/OpenService/YunMouService.cs new file mode 100644 index 00000000..98a1f3d9 --- /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); + + LogService.AddLog(token + ";" + consumerId, "调用消息队列参数"); + string content = YunMouHelper.consumerMessage(consumerId, token); + //调用消息队列第一次 + LogService.AddLog(content, "调用消息队列1"); + 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); + //调用消息队列第二次 + LogService.AddLog(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; + LogService.AddLog(ex.Message, "调用消息队列"); + } + } + + public static void DoSynchDataNew() + { + try + { + ////获取token + //token = YunMouHelper.getToken(); + ////创建消费者消费者如果5分钟未调用拉取消息接口将被删除。 + //consumerId = YunMouHelper.addConsumer(token); + + LogService.AddLog(token + ";" + consumerId, "调用消息队列参数"); + string content = YunMouHelper.consumerMessage(consumerId, token); + //调用消息队列第一次 + LogService.AddLog(content, "调用消息队列1"); + 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); + //调用消息队列第二次 + LogService.AddLog(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; + LogService.AddLog(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 83aff9e3..c68fe42c 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -1982,6 +1982,7 @@ + @@ -13577,6 +13578,13 @@ SafetyOrganizationEdit.aspx + + DateManage.aspx + ASPXCodeBehind + + + DateManage.aspx + DayReport.aspx ASPXCodeBehind @@ -16854,7 +16862,7 @@ - + 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/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..fdc92fb6 100644 --- a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx +++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx @@ -105,6 +105,9 @@ + + + @@ -140,11 +143,11 @@ 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 746eb531..5b4deed6 100644 --- a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.cs @@ -193,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 From 9e6f4e08103d5dddbca6716ccc3adab60726219c Mon Sep 17 00:00:00 2001 From: gaofei1985 <181547018@qq.com> Date: Wed, 24 Dec 2025 08:59:31 +0800 Subject: [PATCH 07/10] 1 --- SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 2 +- SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index c68fe42c..6524e870 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -16862,7 +16862,7 @@ - + diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx index 424a577a..3b30cd86 100644 --- a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx +++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx @@ -145,6 +145,7 @@ + <%-- From f2127a7500171eb41073e12865ac4513d3eed1e4 Mon Sep 17 00:00:00 2001 From: 10191 <506754232@qq.com> Date: Wed, 24 Dec 2025 10:28:49 +0800 Subject: [PATCH 08/10] 11 --- DataBase/版本日志/SGGLDB_V2025-12-24-001.sql | 6 ++++++ SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 DataBase/版本日志/SGGLDB_V2025-12-24-001.sql 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/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 6524e870..c68fe42c 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -16862,7 +16862,7 @@ - + From f68199396209ca09b83ad5cd5b76faff2fe90bb2 Mon Sep 17 00:00:00 2001 From: gaofei1985 <181547018@qq.com> Date: Wed, 24 Dec 2025 10:56:06 +0800 Subject: [PATCH 09/10] 1 --- DataBase/版本日志/SGGLDB_V2025-12-24-001.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 DataBase/版本日志/SGGLDB_V2025-12-24-001.sql diff --git a/DataBase/版本日志/SGGLDB_V2025-12-24-001.sql b/DataBase/版本日志/SGGLDB_V2025-12-24-001.sql new file mode 100644 index 00000000..6e472944 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2025-12-24-001.sql @@ -0,0 +1,8 @@ +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'); +GO +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'); +GO \ No newline at end of file From 1af8e1126a9e21a3bf7f44ecd33e1de12cb3292c Mon Sep 17 00:00:00 2001 From: 10191 <506754232@qq.com> Date: Wed, 24 Dec 2025 15:35:40 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E4=BA=91=E7=9C=B8=20=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SGGL/BLL/Common/YunMouHelper.cs | 33 ++++++++++++------- SGGL/BLL/OpenService/YunMouService.cs | 18 +++++----- .../HSSE/SitePerson/DayReport.aspx.cs | 2 -- 3 files changed, 30 insertions(+), 23 deletions(-) diff --git a/SGGL/BLL/Common/YunMouHelper.cs b/SGGL/BLL/Common/YunMouHelper.cs index 2825490b..10691aad 100644 --- a/SGGL/BLL/Common/YunMouHelper.cs +++ b/SGGL/BLL/Common/YunMouHelper.cs @@ -38,7 +38,9 @@ namespace BLL.Common } string data = "{\"groupName\":\"" + groupName + "\",\"groupNo\":\"" + groupNo + "\"}"; string result = Post(YunMouUrl + "api/v1/open/basic/groups/create", data, "application/json;charset=UTF-8", access_token); - LogService.AddLog(result, "添加设备组"); + + ErrLogInfo.WriteLog(result); + var j2 = JsonConvert.DeserializeObject(result); if (j2.code == "200") return j2.message; @@ -59,7 +61,8 @@ namespace BLL.Common { string result = Post(YunMouUrl + "api/v1/open/basic/groups/delete?groupNo=" + groupNo, "", "application/json;charset=UTF-8", access_token); - LogService.AddLog(result, "删除设备组"); + ErrLogInfo.WriteLog(result); + var j2 = JsonConvert.DeserializeObject(result); if (j2.code == "200") return j2.message; @@ -81,7 +84,8 @@ namespace BLL.Common { 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); - LogService.AddLog(result, "添加设备"); + ErrLogInfo.WriteLog(result); + var j2 = JsonConvert.DeserializeObject(result); if (j2.code == "200") return j2.data.groupId; @@ -101,7 +105,8 @@ namespace BLL.Common { string data = "{\"deviceSerial\":\"" + deviceSerial + "\",\"deviceName\":\"" + deviceName + "\"}"; string result = Post(YunMouUrl + "api/v1/open/basic/devices/update", data, "application/json;charset=UTF-8", access_token); - LogService.AddLog(result, "修改设备名称"); + ErrLogInfo.WriteLog(result); + var j2 = JsonConvert.DeserializeObject(result); if (j2.code == "200") return j2.message; @@ -120,7 +125,7 @@ namespace BLL.Common { string result = Post(YunMouUrl + "api/v1/open/basic/devices/delete?deviceSerial=" + deviceSerial, "", "application/json;charset=UTF-8", access_token); - LogService.AddLog(result, "删除设备"); + ErrLogInfo.WriteLog(result); var j2 = JsonConvert.DeserializeObject(result); if (j2.code == "200") return j2.message; @@ -150,7 +155,7 @@ namespace BLL.Common .Replace(")", ""); string data = "{\"groupName\":\"" + groupName + "\"}"; string result = Post(YunMouUrl + "api/v1/open/accessControl/permissionGroups/create", data, "application/json;charset=UTF-8", access_token); - LogService.AddLog(result, "添加权限组"); + ErrLogInfo.WriteLog(result); var j2 = JsonConvert.DeserializeObject(result); if (j2.code == "200") return j2.data.groupId; @@ -219,7 +224,7 @@ namespace BLL.Common //} 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); - LogService.AddLog(result, "填加员工到权限组"); + ErrLogInfo.WriteLog(result); var j2 = JsonConvert.DeserializeObject(result); if (j2.code == "200") return j2.data.statisticsId; @@ -239,7 +244,7 @@ namespace BLL.Common { 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); - LogService.AddLog(result, "从权限组移除员工"); + ErrLogInfo.WriteLog(result); var j2 = JsonConvert.DeserializeObject(result); if (j2.code == "200") return j2.data.statisticsId; @@ -259,7 +264,8 @@ namespace BLL.Common { 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); - LogService.AddLog(result, "添加设备到权限组"); + ErrLogInfo.WriteLog(result); + var j2 = JsonConvert.DeserializeObject(result); if (j2.code == "200") return j2.code; @@ -279,7 +285,8 @@ namespace BLL.Common { 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); - LogService.AddLog(result, "从权限组移除设备"); + ErrLogInfo.WriteLog(result); + var j2 = JsonConvert.DeserializeObject(result); if (j2.code == "200") return j2.message; @@ -311,7 +318,9 @@ namespace BLL.Common 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); - LogService.AddLog(personName + result, "添加人员"); + + ErrLogInfo.WriteLog(personName + result); + var j2 = JsonConvert.DeserializeObject(result); return j2.code; } @@ -449,7 +458,7 @@ namespace BLL.Common StreamReader reader = new StreamReader(s, Encoding.UTF8); string res = reader.ReadToEnd(); - LogService.AddLog(res, "http请求返回"); + ErrLogInfo.WriteLog(res); return res; } } diff --git a/SGGL/BLL/OpenService/YunMouService.cs b/SGGL/BLL/OpenService/YunMouService.cs index 98a1f3d9..9990fff4 100644 --- a/SGGL/BLL/OpenService/YunMouService.cs +++ b/SGGL/BLL/OpenService/YunMouService.cs @@ -80,11 +80,11 @@ namespace BLL //token = YunMouHelper.getToken(); ////创建消费者消费者如果5分钟未调用拉取消息接口将被删除。 //consumerId = YunMouHelper.addConsumer(token); - - LogService.AddLog(token + ";" + consumerId, "调用消息队列参数"); + ErrLogInfo.WriteLog(token + ";" + consumerId); + string content = YunMouHelper.consumerMessage(consumerId, token); //调用消息队列第一次 - LogService.AddLog(content, "调用消息队列1"); + ErrLogInfo.WriteLog(content); var j2 = JsonConvert.DeserializeObject(content); //消费者首次拉取消息时需要与消息通道建立连接,此次调用实际拉到消息列表为空, @@ -125,7 +125,7 @@ namespace BLL //如果为空再调一次 content = YunMouHelper.consumerMessage(consumerId, token); //调用消息队列第二次 - LogService.AddLog(content, "调用消息队列" + (y + 2).ToString()); + ErrLogInfo.WriteLog(content+"调用消息队列" + (y + 2).ToString()); j2 = JsonConvert.DeserializeObject(content); if (j2.data.Count > 0) { @@ -170,7 +170,7 @@ namespace BLL catch (Exception ex) { var erro = ex.Message; - LogService.AddLog(ex.Message, "调用消息队列"); + ErrLogInfo.WriteLog(ex.Message); } } @@ -183,10 +183,10 @@ namespace BLL ////创建消费者消费者如果5分钟未调用拉取消息接口将被删除。 //consumerId = YunMouHelper.addConsumer(token); - LogService.AddLog(token + ";" + consumerId, "调用消息队列参数"); + ErrLogInfo.WriteLog(token + ";" + consumerId+ "调用消息队列参数"); string content = YunMouHelper.consumerMessage(consumerId, token); //调用消息队列第一次 - LogService.AddLog(content, "调用消息队列1"); + ErrLogInfo.WriteLog(content ); var j2 = JsonConvert.DeserializeObject(content); //消费者首次拉取消息时需要与消息通道建立连接,此次调用实际拉到消息列表为空, @@ -227,7 +227,7 @@ namespace BLL //如果为空再调一次 content = YunMouHelper.consumerMessage(consumerId, token); //调用消息队列第二次 - LogService.AddLog(content, "调用消息队列" + (y + 2).ToString()); + ErrLogInfo.WriteLog(content+ "调用消息队列" + (y + 2).ToString()); j2 = JsonConvert.DeserializeObject(content); if (j2.data.Count > 0) { @@ -272,7 +272,7 @@ namespace BLL catch (Exception ex) { var erro = ex.Message; - LogService.AddLog(ex.Message, "调用消息队列"); + ErrLogInfo.WriteLog(ex.Message ); } } 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("");