From dce6c3481a37216292724013ff9d2b75ceb82f86 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期三, 10 六月 2020 15:47:28 +0800 Subject: [PATCH] 添加小度的代码 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceBindLogic.cs | 36 ++++++++++++++++++++++++++++++++++-- 1 files changed, 34 insertions(+), 2 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceBindLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceBindLogic.cs index 97a36c8..24b9780 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceBindLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceBindLogic.cs @@ -533,7 +533,7 @@ return reResult; } //缃戝叧ID - string gatewayID = HdlGatewayLogic.Current.GetGatewayId(device.Gateway); + string gatewayID = device.Gateway.GwId; //閿欒涓婚 string errorTopic = gatewayID + "/" + "Error_Respon"; //妫�娴嬪璞$殑涓婚 @@ -543,6 +543,9 @@ } bool canbreak = false; + BindObj.DelDeviceBindResponseData delDeviceBindData = null; + BindObj.RemoveBindResultResponseData removeBindResult = null; + Action<string, string> receiptAction = (topic, message) => { var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); @@ -571,9 +574,38 @@ return; } reResult.listReceiptData[i] = jobject["Data"].ToString(); + if (i == 0) { - //鍙湁鏄疊ind/RemoveBind_Respon涓婚,鎵嶈兘涓柇 + //"Bind/RemoveBind_Respon"涓婚 + delDeviceBindData = Newtonsoft.Json.JsonConvert.DeserializeObject<BindObj.DelDeviceBindResponseData>(reResult.listReceiptData[i]); + } + else if (i == 1) + { + //"Bind/RemoveBindResult"涓婚 + removeBindResult = Newtonsoft.Json.JsonConvert.DeserializeObject<BindObj.RemoveBindResultResponseData>(reResult.listReceiptData[i]); + } + + if (0 < delDeviceBindData.RemoveBindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 1).Count) + { + canbreak = true; + } + else if (0 < delDeviceBindData.RemoveBindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 3).Count) + { + if (removeBindResult != null) + { + canbreak = true; + } + } + else if (0 < delDeviceBindData.RemoveBindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 2).Count) + { + if (removeBindResult != null) + { + canbreak = true; + } + } + else + { canbreak = true; } } -- Gitblit v1.8.0