From 587c36e27131f2d028fcabc13b296a8de7470034 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期三, 08 一月 2020 08:59:19 +0800
Subject: [PATCH] 2019.1.8
---
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs | 66 ++++++++++++++++++++++----------
1 files changed, 45 insertions(+), 21 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs
index 6993d9f..76b7605 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs
@@ -93,6 +93,23 @@
});
return;
}
+ else if (topic == "/ZigbeeGateWayToClient/" + Common.Config.Instance.Guid + "/Push/Deleted"
+ || topic == "/ZigbeeGateWayToClient/" + Common.Config.Instance.Guid + "/Push/DeletedShareData")
+ {
+ if (UserCenterResourse.UserInfo.AuthorityNo == 3)
+ {
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ //鍒嗕韩鏁版嵁宸茬粡鍙樻洿,璇烽噸鏂扮櫥闄�
+ string msg = Language.StringByID(R.MyInternationalizationString.uShardDataIsChangedPleaseLoginAgain);
+ var contr = new ShowMsgControl(ShowMsgType.Tip, msg);
+ contr.Show();
+
+ UserCenterLogic.ReLoginAgain(UserCenterResourse.UserInfo.Account, false);
+ });
+ }
+ return;
+ }
try
{
if (HdlGatewayLogic.Current.IsGatewayExist(gatewayId) == false)
@@ -165,6 +182,11 @@
/// <param name="receiveData"></param>
private void DeviceAttributeReportPush(JObject receiveData)
{
+ if (this.dicDeviceEvent.Count == 0)
+ {
+ //娌℃湁娣诲姞鐩戝惉
+ return;
+ }
var deviceAddr = receiveData.Value<string>("DeviceAddr");
var deviceEpoint = receiveData.Value<int>("Epoint");
@@ -227,8 +249,13 @@
/// <param name="receiveData"></param>
private void DeviceOnlineChangePush (JObject receiveData)
{
+ if (this.dicDeviceEvent.Count == 0)
+ {
+ //娌℃湁娣诲姞鐩戝惉
+ return;
+ }
var tempDevice = new CommonDevice() { DeviceAddr = receiveData.Value<string>("DeviceAddr"), DeviceEpoint = receiveData.Value<int>("Epoint") };
- tempDevice.IsOnline = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(receiveData["Data"]["IsOnline"].ToString());
+ tempDevice.IsOnline = Convert.ToInt32(receiveData["Data"]["IsOnline"].ToString());
this.DeviceReportPush(tempDevice, ReceiveComandDiv.A璁惧鍦ㄧ嚎涓婃姤);
}
@@ -391,6 +418,8 @@
#endregion
+
+
#region 鈻� 娣诲姞璁惧浜嬩欢_______________________
/// <summary>
@@ -470,14 +499,13 @@
/// <param name="comand"></param>
private void DeviceReportPush(CommonDevice common, ReceiveComandDiv comand)
{
+ if (this.dicDeviceEvent.Count == 0)
+ {
+ //娌℃湁娣诲姞鐩戝惉
+ return;
+ }
lock (this.dicDeviceEvent)
{
- if (this.dicDeviceEvent.Count == 0)
- {
- //娌℃湁娣诲姞鐩戝惉
- return;
- }
-
var list = new List<Action<CommonDevice>>();
foreach (string keys in this.dicDeviceEvent.Keys)
{
@@ -490,23 +518,19 @@
list.Add(this.dicDeviceEvent[keys]);
}
//鏈夊彲鑳藉湪鍥炶皟鍑芥暟涓Щ闄や簡浜嬩欢锛屽鑷存姤閿欙紝鎵�浠ュ厛鏀堕泦锛屽啀璋冪敤
- Application.RunOnMainThread(() =>
+ foreach (var action in list)
{
- foreach (var action in list)
+ try
{
- try
- {
- action?.Invoke(common);
- }
- catch (Exception ex)
- {
- //Log鍑哄姏
- string msg = "褰撳墠婵�娲荤殑鐣岄潰[" + UserCenterResourse.NowActionFormID + "]";
- HdlLogLogic.Current.WriteLog(-1, msg);
- HdlLogLogic.Current.WriteLog(ex);
- }
+ action?.Invoke(common);
}
- });
+ catch (Exception ex)
+ {
+ //Log鍑哄姏
+ string msg = "鎺ㄩ�侀敊璇�! 褰撳墠婵�娲荤殑鐣岄潰[" + UserCenterResourse.NowActionFormID + "]";
+ HdlLogLogic.Current.WriteLog(ex, msg);
+ }
+ }
}
}
--
Gitblit v1.8.0