HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2019-12-30 3dcbd186c42c598c0c08d1cd37034cf2baa09e54
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)
@@ -238,7 +255,7 @@
                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设备在线上报);
        }
@@ -401,6 +418,8 @@
        #endregion
        #region ■ 添加设备事件_______________________
        /// <summary>
@@ -501,19 +520,16 @@
                //有可能在回调函数中移除了事件,导致报错,所以先收集,再调用
                foreach (var action in list)
                {
                    Application.RunOnMainThread(() =>
                    try
                    {
                        try
                        {
                            action?.Invoke(common);
                        }
                        catch (Exception ex)
                        {
                            //Log出力
                            string msg = "推送错误! 当前激活的界面[" + UserCenterResourse.NowActionFormID + "]";
                            HdlLogLogic.Current.WriteLog(ex, msg);
                        }
                    });
                        action?.Invoke(common);
                    }
                    catch (Exception ex)
                    {
                        //Log出力
                        string msg = "推送错误! 当前激活的界面[" + UserCenterResourse.NowActionFormID + "]";
                        HdlLogLogic.Current.WriteLog(ex, msg);
                    }
                }
            }
        }