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] =?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("");