陈嘉乐
2020-06-24 adb12dcdbb2ddaeac687c3aa9e57bb7ed459ab7e
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)
                        {
                            //只有是Bind/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;
                        }
                    }