From c6ff92e84b6cb2815cb98065ecb0ecf95d0689c3 Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期三, 15 一月 2020 09:42:29 +0800
Subject: [PATCH] 2020-01-15-1

---
 ZigbeeApp/Shared/Phone/Device/Logic/Send.cs |   73 +++++++++++++++++++++++++++---------
 1 files changed, 54 insertions(+), 19 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs b/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs
index 63cc505..85f556e 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs
@@ -479,6 +479,7 @@
                                         {
                                             ["Type"] = int.Parse(dictionary["Type"]),
                                             ["Account"] = dictionary["Account"],
+                                            ["AccountName"] = dictionary["AccountName"],
                                             ["UserId"] = dictionary["UserId"],
 
                                         };
@@ -510,6 +511,7 @@
                         { "Relationship",logic.Relationship} ,
                          { "LogicType",logic.LogicType} ,
                         { "LogicCustomPushText",logic.LogicCustomPushText} ,
+                        { "LogicIsCustomPushText",logic.LogicIsCustomPushText} ,
                         { "TimeAttribute", timeAttribute} ,
                         { "Conditions", conditions },
                         { "Actions", actions },
@@ -576,6 +578,7 @@
                 date.Add("LogicName", logic.LogicName);
                 date.Add("Relationship", logic.Relationship);
                 date.Add("LogicCustomPushText", logic.LogicCustomPushText);
+                date.Add("LogicIsCustomPushText", logic.LogicIsCustomPushText);
                 mainGateWay?.Send("Logic/ReviseAttribute", jObject.ToString());
                 //await System.Threading.Tasks.Task.Run(async () =>
                 //{
@@ -623,6 +626,8 @@
                         logic.LogicName = Logicifon["LogicName"].ToString();
                         logic.LogicType = int.Parse(Logicifon["LogicType"].ToString());
                         logic.Relationship = int.Parse(Logicifon["Relationship"].ToString());
+                        logic.LogicCustomPushText =Logicifon["LogicCustomPushText"].ToString();
+                        logic.LogicIsCustomPushText = int.Parse(Logicifon["LogicIsCustomPushText"].ToString());
                         logic.TimeAttribute = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.TimeAttributeObj>(Logicifon["TimeAttribute"].ToString());
                         logic.Conditions = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Dictionary<string, string>>>(Logicifon["Conditions"].ToString());
                         logic.Accounts = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Dictionary<string, string>>>(Logicifon["Accounts"].ToString());
@@ -719,7 +724,11 @@
             var room = new Common.Room();
             btnregionname.Text = room.GetRoomNameByDevice(device);
         }
-
+        /// <summary>
+        /// 鎵惧嚭妤煎眰鎵�鏈夋埧闂�
+        /// </summary>
+        /// <param name="floorId">妤煎眰ID</param>
+        /// <returns></returns>
         public static List<Common.Room> GetRoomList(string floorId)
         {
             return Common.Room.Lists.FindAll((obj) => obj.FloorId == floorId);
@@ -746,8 +755,6 @@
             /////杩斿洖鎴块棿鍒楄〃锛�
             //return list1;
         }
-
-
         /// <summary>
         /// 鑾峰彇鍦烘櫙淇℃伅鐨勬柟娉�
         /// </summary>
@@ -919,6 +926,7 @@
         {
             var list = new List<User>();
             var s = await ReadUserList(doorlockMac);
+            //var s = await Data("璇诲彇浜戠闂ㄩ攣鏁版嵁", "/DoorLock/GetDoorLockPager", "POST", doorlockMac);
             var jObject = JObject.Parse(s);
             if (jObject == null || jObject["StateCode"].ToString() != "Success")
             {
@@ -1009,16 +1017,7 @@
             lockifon.doorlockmac = residential.doorlockmac;
             return await WebClientAsync(2, lockifon.Url, lockifon);
         }
-
-              //鎵撳嵃NameValueCollection()鏄剧ず绱㈠紩, 閿�,鍊�    
-        public static void PrintKeysAndValues2(NameValueCollection myCol)
-        {
-            for (int i = 0; i < myCol.Count; i++)
-            {
-                //鎵撳嵃鏄剧ず绱㈠紩, 閿�,鍊�  
-                Console.WriteLine("[{0}]{1,-10} {2}", i, myCol.GetKey(i), myCol.Get(i));
-            }
-        }
+        #region 瀹氫箟瑙f瀽闂ㄩ攣鐨勫璞�
         public class Residential
         {
             /// <summary>
@@ -1112,7 +1111,6 @@
             public bool IsFreezeUser;
 
         }
-
         /// <summary>
         /// 闂ㄩ攣鍒楄〃
         /// </summary>
@@ -1126,7 +1124,32 @@
         /// </summary>
         public static UserCenter.MemberInfoRes UserMemberInfoRes = null;
         #endregion
+        #endregion
 
+        /// <summary>
+        ///  鑷繁鐢�
+        /// </summary>
+        public static void Zj(bool tag, Common.Logic logic)
+        {
+            new System.Threading.Thread(() =>
+            {
+                if (logic.LogicId != 0)
+                {
+                    if (tag)
+                    {
+                        Data("娣诲姞/鏇存柊", "/App/HomeLogicConfig", "POST");
+                    }
+                    else
+                    {
+                        Data("鍒犻櫎", "/App/DelHomeLogicConfig", "POST");
+                    }
+                    ///鍙敼鎺ㄩ�佸唴瀹癸紱
+                    LogicControlSwitch(logic);
+                }
+
+            })
+            { IsBackground = true }.Start();
+        }
         #region  璇锋眰鏈嶅姟鍣ㄦ柟娉�---
         /// <summary>
         /// 璇锋眰鏁版嵁鐨勫皝瑁呮柟娉�
@@ -1136,39 +1159,51 @@
         /// <param name="method">璇锋眰鏂瑰紡涓篜OST/GET</param>
         /// <param name="obj">瀛樺偍鍙戦�佹暟鎹殑瀵硅薄</param>
         /// <returns></returns>
-        public static async System.Threading.Tasks.Task<string>Data(string command, string url, string method, object obj = null)
+        public static async System.Threading.Tasks.Task<string> Data(string command, string url, string method, object obj = null)
         {
-            var getUrl = CommonPage.RequestHttpsHost + url;//璇锋眰鍦板潃锛�
+            var getUrl = "";
             var jObject = new JObject();
             if (UserCenter.UserCenterResourse.UserInfo.AuthorityNo == 1)
             {
+                getUrl = CommonPage.RequestHttpsHost + url;//璇锋眰鍦板潃锛�
                 jObject.Add("IsOtherAccountCtrl", false);
+                jObject.Add("LoginAccessToken", Config.Instance.Token);
             }
             else
             {
+                getUrl = Config.Instance.AdminRequestBaseUrl + url;//璇锋眰鍦板潃锛�
                 jObject.Add("IsOtherAccountCtrl", true);
+                jObject.Add("LoginAccessToken", Config.Instance.AdminRequestToken);
             }
             switch (command)
             {
                 case "娣诲姞/鏇存柊":
                     {
                         jObject.Add("RequestVersion", CommonPage.RequestVersion);
-                        jObject.Add("LoginAccessToken", Config.Instance.Token);
+                        //jObject.Add("LoginAccessToken", Config.Instance.Token);
                         jObject.Add("HomeId", Config.Instance.HomeId);
                         jObject.Add("LogicID", Common.Logic.CurrentLogic.LogicId);
                         jObject.Add("PushUserIds", new JArray { Config.Instance.Guid });
                         jObject.Add("PushContent", Common.Logic.CurrentLogic.LogicCustomPushText);
-
                     }
                     break;
                 case "鍒犻櫎":
                     {
                         jObject.Add("RequestVersion", CommonPage.RequestVersion);
-                        jObject.Add("LoginAccessToken", Config.Instance.Token);
+                        //jObject.Add("LoginAccessToken", Config.Instance.Token);
                         jObject.Add("HomeId", Config.Instance.HomeId);
                         jObject.Add("LogicID", Common.Logic.CurrentLogic.LogicId);
                     }
                     break;
+                case "璇诲彇浜戠闂ㄩ攣鏁版嵁":
+                    {
+                        jObject.Add("RequestVersion", CommonPage.RequestVersion);
+                        jObject.Add("HomeId", Config.Instance.HomeId);
+                        jObject.Add("DoorLockId", obj.ToString());//闂ㄩ攣Mac+绔彛
+                        jObject.Add("PageSetting.PageSize", Int32.MaxValue.ToString());
+                    }
+                    break;
+
             }
             return await HttpWebRequest(getUrl, jObject.ToString(), method);
         }

--
Gitblit v1.8.0