old mode 100755
new mode 100644
File was renamed from ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs |
| | |
| | | using Newtonsoft.Json.Linq;
|
| | | using ZigBee.Device;
|
| | |
|
| | | namespace Shared.Phone.UserCenter
|
| | | namespace Shared.Phone |
| | | {
|
| | | /// <summary>
|
| | | /// 全局接收网关推送的的逻辑(为了执行速度,尽可能的别加耗时的操作)
|
| | |
| | | {
|
| | | //登录密匙已经过期,请重新登录
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uTokenIsOldAndLoginAgain);
|
| | | var contr = new ShowMsgControl(ShowMsgType.Tip, msg);
|
| | | contr.Show();
|
| | | HdlMessageLogic.Current.ShowMassage(ShowMsgType.Tip, msg); |
| | |
|
| | | UserCenterLogic.ReLoginAgain(UserCenterResourse.UserInfo.Account, false);
|
| | | HdlAccountLogic.Current.ReLoginAgain(HdlUserCenterResourse.UserInfo.Account, false); |
| | | });
|
| | | return;
|
| | | }
|
| | |
| | | {
|
| | | //此帐号已在别处登录,您被迫下线
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uHadBeenLoginAndOffLine);
|
| | | var contr = new ShowMsgControl(ShowMsgType.Tip, msg);
|
| | | contr.Show();
|
| | | HdlMessageLogic.Current.ShowMassage(ShowMsgType.Tip, msg); |
| | |
|
| | | UserCenterLogic.ReLoginAgain(UserCenterResourse.UserInfo.Account, false);
|
| | | HdlAccountLogic.Current.ReLoginAgain(HdlUserCenterResourse.UserInfo.Account, false); |
| | | });
|
| | | return;
|
| | | }
|
| | |
| | | {
|
| | | //您当前的IP及端口在云端不存在,请重新登录!
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uYouIpAndPortNoRecord);
|
| | | var contr = new ShowMsgControl(ShowMsgType.Tip, msg);
|
| | | contr.Show();
|
| | | HdlMessageLogic.Current.ShowMassage(ShowMsgType.Tip, msg); |
| | |
|
| | | UserCenterLogic.ReLoginAgain(UserCenterResourse.UserInfo.Account, false);
|
| | | HdlAccountLogic.Current.ReLoginAgain(HdlUserCenterResourse.UserInfo.Account, false); |
| | | });
|
| | | return;
|
| | | }
|
| | |
| | | {
|
| | | //分享住宅已更改,请联系管理员!
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uShardResidenceHadDeletePleaseTakeToAdmin);
|
| | | var contr = new ShowMsgControl(ShowMsgType.Tip, msg);
|
| | | contr.Show();
|
| | | HdlMessageLogic.Current.ShowMassage(ShowMsgType.Tip, msg); |
| | |
|
| | | UserCenterLogic.ReLoginAgain(UserCenterResourse.UserInfo.Account, false);
|
| | | HdlAccountLogic.Current.ReLoginAgain(HdlUserCenterResourse.UserInfo.Account, false); |
| | | });
|
| | | return;
|
| | | }
|
| | |
| | | {
|
| | | //您的权限已经变更,请重新登陆
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uYouAccessHadChangedPleaseTakeToAdmin);
|
| | | var contr = new ShowMsgControl(ShowMsgType.Tip, msg);
|
| | | contr.Show();
|
| | | HdlMessageLogic.Current.ShowMassage(ShowMsgType.Tip, msg); |
| | |
|
| | | UserCenterLogic.ReLoginAgain(UserCenterResourse.UserInfo.Account, false);
|
| | | HdlAccountLogic.Current.ReLoginAgain(HdlUserCenterResourse.UserInfo.Account, false); |
| | | });
|
| | | return;
|
| | | }
|
| | | else if (UserCenterResourse.UserInfo.AuthorityNo == 3)
|
| | | else if (HdlUserCenterResourse.ResidenceOption.AuthorityNo == 3) |
| | | {
|
| | | if (topic == "ZigbeeGateWayToClient/" + Common.Config.Instance.Guid + "/Push/Deleted"
|
| | | || topic == "ZigbeeGateWayToClient/" + Common.Config.Instance.Guid + "/Push/DeletedShareData")
|
| | |
| | | {
|
| | | //分享数据已经变更,请重新登陆
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uShardDataIsChangedPleaseLoginAgain);
|
| | | var contr = new ShowMsgControl(ShowMsgType.Tip, msg);
|
| | | contr.Show();
|
| | | HdlMessageLogic.Current.ShowMassage(ShowMsgType.Tip, msg); |
| | |
|
| | | UserCenterLogic.ReLoginAgain(UserCenterResourse.UserInfo.Account, false);
|
| | | HdlAccountLogic.Current.ReLoginAgain(HdlUserCenterResourse.UserInfo.Account, false); |
| | | });
|
| | | return;
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | //处理网关上报的数据,然后变更本地缓存
|
| | | var locadevice = Common.LocalDevice.Current.GetDevice(deviceAddr, deviceEpoint);
|
| | | var locadevice = HdlDeviceCommonLogic.Current.GetDevice(deviceAddr, deviceEpoint); |
| | | if (locadevice != null)
|
| | | {
|
| | | //有反馈,这个设备肯定是在线的
|
| | |
| | | else if (report.DeviceStatusReport.CluterID == 1282)
|
| | | {
|
| | | //mini夜灯
|
| | | if (Common.LocalDevice.Current.IsMiniLight(locadevice) == true)
|
| | | if (HdlDeviceCommonLogic.Current.IsMiniLight(locadevice) == true) |
| | | {
|
| | | foreach (var attData in report.DeviceStatusReport.AttriBute)
|
| | | {
|
| | |
| | | foreach (var attData in report.DeviceStatusReport.AttriBute)
|
| | | {
|
| | | //区分是空调还是新风
|
| | | var device = Shared.Common.LocalDevice.Current.GetDevice(report.DeviceAddr, report.DeviceEpoint);
|
| | | var device = HdlDeviceCommonLogic.Current.GetDevice(report.DeviceAddr, report.DeviceEpoint); |
| | |
|
| | | if (device.Type == DeviceType.FreshAir)
|
| | | {
|
| | |
| | |
|
| | | else if (report.DeviceStatusReport.CluterID == 0)
|
| | | {
|
| | | var listLocalDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceAddr, false);
|
| | | var listLocalDevice = HdlDeviceCommonLogic.Current.GetDevicesByMac(deviceAddr, false); |
| | | //属性都是一样的
|
| | | foreach (var myDevice in listLocalDevice)
|
| | | {
|
| | |
| | | {
|
| | | if (data.AttriButeDataHex.Length > 2)
|
| | | {
|
| | | var value = UserCenterLogic.TranslateHexadecimalIntoText(data.AttriButeDataHex.Substring(2));
|
| | | var value = HdlCommonLogic.Current.TranslateHexadecimalIntoText(data.AttriButeDataHex.Substring(2)); |
| | | if (myDevice.ManufacturerName != value)
|
| | | {
|
| | | //属性变更了
|
| | |
| | | {
|
| | | if (data.AttriButeDataHex.Length > 2)
|
| | | {
|
| | | var value = UserCenterLogic.TranslateHexadecimalIntoText(data.AttriButeDataHex.Substring(2));
|
| | | var value = HdlCommonLogic.Current.TranslateHexadecimalIntoText(data.AttriButeDataHex.Substring(2)); |
| | | if (myDevice.ModelIdentifier != value)
|
| | | {
|
| | | //属性变更了
|
| | |
| | | {
|
| | | if (data.AttriButeDataHex.Length > 2)
|
| | | {
|
| | | var value = UserCenterLogic.TranslateHexadecimalIntoText(data.AttriButeDataHex.Substring(2));
|
| | | var value = HdlCommonLogic.Current.TranslateHexadecimalIntoText(data.AttriButeDataHex.Substring(2)); |
| | | if (myDevice.ProductionDate != value)
|
| | | {
|
| | | //属性变更了
|
| | |
| | | if (data.AttriButeDataHex.Length > 2)
|
| | | {
|
| | | string value;
|
| | | if (Common.LocalDevice.Current.IsHdlDevice(myDevice) == false)
|
| | | if (HdlDeviceCommonLogic.Current.IsHdlDevice(myDevice) == false) |
| | | {
|
| | | //第三方设备
|
| | | value = data.AttriButeDataHex.Substring(2);
|
| | |
| | | else
|
| | | {
|
| | | //河东设备
|
| | | value = UserCenterLogic.TranslateHexadecimalIntoText(data.AttriButeDataHex.Substring(2));
|
| | | value = HdlCommonLogic.Current.TranslateHexadecimalIntoText(data.AttriButeDataHex.Substring(2)); |
| | | }
|
| | | if (myDevice.SerialNumber != value)
|
| | | {
|
| | |
| | | }
|
| | | else if (deviceEpoint == 200)
|
| | | {
|
| | | var localOta = Common.LocalDevice.Current.GetOTADevice(deviceAddr);
|
| | | var localOta = HdlDeviceCommonLogic.Current.GetOTADevice(deviceAddr); |
| | | if (localOta != null)
|
| | | {
|
| | | #region ■ 固件版本
|
| | |
| | | }
|
| | |
|
| | | //处理网关上报的数据,然后变更本地缓存
|
| | | var locadevice = Common.LocalDevice.Current.GetDevice(ias.DeviceAddr, ias.DeviceEpoint);
|
| | | var locadevice = HdlDeviceCommonLogic.Current.GetDevice(ias.DeviceAddr, ias.DeviceEpoint); |
| | | if (locadevice != null)
|
| | | {
|
| | | ((IASZone)locadevice).iASInfo = ias.iASInfo;
|
| | |
| | | /// <param name="receiveData"></param>
|
| | | private void DoorLockDeviceReportPush(JObject receiveData)
|
| | | {
|
| | | if (UserCenterResourse.UserInfo.AuthorityNo == 1)
|
| | | if (HdlUserCenterResourse.ResidenceOption.AuthorityNo == 1) |
| | | {
|
| | | var device = Common.LocalDevice.Current.GetDevice(receiveData.Value<string>("DeviceAddr"), receiveData.Value<int>("Epoint"));
|
| | | var device = HdlDeviceCommonLogic.Current.GetDevice(receiveData.Value<string>("DeviceAddr"), receiveData.Value<int>("Epoint")); |
| | | if (device.Type != DeviceType.DoorLock)
|
| | | {
|
| | | //它不是门锁
|
| | |
| | | tempDevice.IsOnline = Convert.ToInt32(receiveData["Data"]["IsOnline"].ToString());
|
| | |
|
| | | //处理网关上报的数据,然后变更本地缓存
|
| | | var locadevice = Common.LocalDevice.Current.GetDevicesByMac(tempDevice.DeviceAddr);
|
| | | var locadevice = HdlDeviceCommonLogic.Current.GetDevicesByMac(tempDevice.DeviceAddr); |
| | | for (int i = 0; i < locadevice.Count; i++)
|
| | | {
|
| | | bool onlineChanged = locadevice[i].IsOnline != tempDevice.IsOnline;
|
| | |
| | |
|
| | | //保存报警信息然后推送到界面上
|
| | | HdlAlarmsLogic.Current.SaveSafeguardAlarmInfo(garrison);
|
| | | if (UserCenterResourse.DicActionForm.ContainsKey("SafetyManagementMainForm") == true)
|
| | | {
|
| | | |
| | | //推送
|
| | | var form = (Safety.SafetyManagementMainForm)UserCenterResourse.DicActionForm["SafetyManagementMainForm"];
|
| | | var form = HdlFormLogic.Current.GetFormByName("SafetyManagementMainForm") as UserCenter.Safety.SafetyManagementMainForm; |
| | | form?.GarrisonModePush(garrison);
|
| | | }
|
| | | |
| | | //显示有新消息的特效
|
| | | this.ShowHadNewMessageAppeal();
|
| | | }
|
| | |
| | | {
|
| | | //保存报警信息然后推送到界面上
|
| | | HdlAlarmsLogic.Current.SaveSafeguardAlarmInfo(GarrisonMode.RemoveGarrison);
|
| | | if (UserCenterResourse.DicActionForm.ContainsKey("SafetyManagementMainForm") == true)
|
| | | {
|
| | | |
| | | //推送
|
| | | var form = (Safety.SafetyManagementMainForm)UserCenterResourse.DicActionForm["SafetyManagementMainForm"];
|
| | | var form = HdlFormLogic.Current.GetFormByName("SafetyManagementMainForm") as UserCenter.Safety.SafetyManagementMainForm; |
| | | form?.GarrisonModePush(GarrisonMode.RemoveGarrison);
|
| | | }
|
| | | |
| | | //显示有新消息的特效
|
| | | this.ShowHadNewMessageAppeal();
|
| | | }
|
| | |
| | |
|
| | | //保存报警信息然后推送到界面上
|
| | | HdlAlarmsLogic.Current.SaveSafeguardAlarmInfo(garrison, appendText);
|
| | | if (UserCenterResourse.DicActionForm.ContainsKey("SafetyManagementMainForm") == true)
|
| | | {
|
| | | |
| | | //推送
|
| | | var form = (Safety.SafetyManagementMainForm)UserCenterResourse.DicActionForm["SafetyManagementMainForm"];
|
| | | var form = HdlFormLogic.Current.GetFormByName("SafetyManagementMainForm") as UserCenter.Safety.SafetyManagementMainForm; |
| | | form?.GarrisonModePush(garrison);
|
| | | }
|
| | | |
| | | //显示有新消息的特效
|
| | | this.ShowHadNewMessageAppeal();
|
| | | }
|
| | |
| | | this.ShowHadNewMessageAppeal();
|
| | |
|
| | | // 逻辑执行常开模式失效的情况
|
| | | if (UserCenterResourse.UserInfo.AuthorityNo == 1)
|
| | | if (HdlUserCenterResourse.ResidenceOption.AuthorityNo == 1) |
| | | {
|
| | | //自动化执行 常开关闭
|
| | | var data = Newtonsoft.Json.JsonConvert.DeserializeObject<LogicPushResult>(receiveData["Data"].ToString());
|
| | |
| | | if (data.ActionData.Actiontype == 8 && data.ActionData.PassDataString == "055704010113")
|
| | | {
|
| | | var deviceAddr = data.ActionData.MacStr;
|
| | | var device = Common.LocalDevice.Current.GetDevicesByMac(deviceAddr, false);
|
| | | var device = HdlDeviceCommonLogic.Current.GetDevicesByMac(deviceAddr, false); |
| | | if (device.Count > 0 && device[0].Type != DeviceType.DoorLock)
|
| | | {
|
| | | return;
|
| | |
| | | catch (Exception ex)
|
| | | {
|
| | | //Log出力
|
| | | string msg = "推送错误! 当前激活的界面[" + UserCenterResourse.NowActionFormID + "]";
|
| | | string msg = "推送错误! 当前激活的界面[" + HdlFormLogic.Current.NowActionFormID + "]"; |
| | | HdlLogLogic.Current.WriteLog(ex, msg);
|
| | | }
|
| | | }
|
| | |
| | | private void ShowHadNewMessageAppeal()
|
| | | {
|
| | | //有新消息(特效还在时,不需要再处理)
|
| | | if (ControlCommonResourse.HadNewMessage == false)
|
| | | if (HdlControlResourse.HadNewMessage == false) |
| | | {
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | for (int i = 0; i < ControlCommonResourse.listMessageManaContr.Count; i++)
|
| | | for (int i = 0; i < HdlControlResourse.listMessageManaContr.Count; i++) |
| | | {
|
| | | //显示角标特效
|
| | | ControlCommonResourse.listMessageManaContr[i].IsSelected = true;
|
| | | HdlControlResourse.listMessageManaContr[i].IsSelected = true; |
| | | }
|
| | | ControlCommonResourse.HadNewMessage = true;
|
| | | HdlControlResourse.HadNewMessage = true; |
| | | });
|
| | | }
|
| | | }
|