云眸 日志

This commit is contained in:
2025-12-24 15:35:40 +08:00
parent f2127a7500
commit 1af8e1126a
3 changed files with 30 additions and 23 deletions
+21 -12
View File
@@ -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<dynamic>(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<dynamic>(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<dynamic>(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<dynamic>(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<dynamic>(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<dynamic>(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<dynamic>(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<dynamic>(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<dynamic>(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<dynamic>(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<dynamic>(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;
}
}
+9 -9
View File
@@ -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<dynamic>(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<dynamic>(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<dynamic>(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<dynamic>(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 );
}
}
@@ -198,14 +198,12 @@ namespace FineUIPro.Web.HSSE.SitePerson
Response.End();
}
#pragma warning disable CS0108 // “DayReport.GetGridTableHtml(Grid)”隐藏继承的成员“PageBase.GetGridTableHtml(Grid)”。如果是有意隐藏,请使用关键字 new。
/// <summary>
/// 导出方法
/// </summary>
/// <param name="grid"></param>
/// <returns></returns>
private string GetGridTableHtml(Grid grid)
#pragma warning restore CS0108 // “DayReport.GetGridTableHtml(Grid)”隐藏继承的成员“PageBase.GetGridTableHtml(Grid)”。如果是有意隐藏,请使用关键字 new。
{
StringBuilder sb = new StringBuilder();
sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");