From 6b7a07bcbe147be7ed64994c40bcc5b0a2042aae Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期一, 05 七月 2021 11:23:35 +0800
Subject: [PATCH] 代码合并-温居城

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs |   42 +++++++++++++-----------------------------
 1 files changed, 13 insertions(+), 29 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs
index acc205b..d95ea34 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs
@@ -4,40 +4,18 @@
 using HDL_ON.DAL.Server;
 using Newtonsoft.Json.Linq;
 using System.Collections.Generic;
-using HDL_ON.Entity;
 
 namespace HDL_ON.UI.UI2.Intelligence.Automation
 {
     public  class Send
     {
-
-        /// <summary>
-        /// 璋冪敤鑾峰彇浣忓畢瀛愯处鍙峰垪琛�
-        /// </summary>
-        public static List<ResidenceMemberInfo> GetResidenceMemberAccount()
-        {
-
-            var responePack = new HttpServerRequest().GetResidenceMemberAccount();
-            if (responePack.Code == StateCode.SUCCESS)
-            {
-                return Newtonsoft.Json.JsonConvert.DeserializeObject<List<ResidenceMemberInfo>>(responePack.Data.ToString());
-            }
-            //澶辫触
-            else
-            {
-                //鎻愮ず
-                IMessageCommon.Current.ShowErrorInfoAlter(responePack.Code);
-            }
-            return new List<ResidenceMemberInfo>();
-        }
-
         /// <summary>
         /// 鑾峰彇閫昏緫ID鍒楄〃
         /// </summary>
         /// <returns></returns>
         public static ResponsePackNew GetLogicIdList() 
         {
-            var jObject = new JObject { { "homeId", LogicMethod.HomeId } };
+            var jObject = new JObject { { "homeId", LogicMethod.CurrLogicMethod.HomeId } };
             var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_List);
             //濡傛灉鏄痶oken杩囨湡鍒欏埛鏂皌oken
             if (responsePackNew.Code == StateCode.TOKEN_EXPIRED)
@@ -114,6 +92,7 @@
                 {
                     var outputTypeJOb = new JObject { };
                     outputTypeJOb.Add("sid", dictionary.sid);
+                    outputTypeJOb.Add("delay", dictionary.delay);
                     outputTypeJOb.Add("target_type", dictionary.target_type);
                     var statusArray = new JArray { };
                     foreach (var dic in dictionary.status)
@@ -153,7 +132,7 @@
                 var logicjArray = new JArray { };
                 var logicIfon = new JObject { };
                 logicIfon.Add("sid", logic.sid);
-                logicIfon.Add("gatewayId", LogicMethod.GatewayId);
+                logicIfon.Add("gatewayId", LogicMethod.CurrLogicMethod.GatewayId);
                 logicIfon.Add("name", logic.name);
                 logicIfon.Add("relation", logic.relation);
                 logicIfon.Add("enable", logic.enable);
@@ -163,7 +142,7 @@
                 logicIfon.Add("noticeConfig", noticeConfigJObject);
                 logicIfon.Add("pushConfigs", pushConfigsArray);
                 logicjArray.Add(logicIfon);
-                var jObject = new JObject { { "homeId", LogicMethod.HomeId }, { "logics", logicjArray } };
+                var jObject = new JObject { { "homeId", LogicMethod.CurrLogicMethod.HomeId }, { "logics", logicjArray } };
                 responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_Add,5);
                 //濡傛灉鏄痶oken杩囨湡鍒欏埛鏂皌oken
                 if (responsePackNew.Code == StateCode.TOKEN_EXPIRED)
@@ -209,7 +188,10 @@
                     {
                         var conditionJOb = new JObject { };
                         conditionJOb.Add("key", dic["key"]);
-                        conditionJOb.Add("comparator", dic["comparator"]);
+                        var c1 = "";
+                        dic.TryGetValue("comparator", out c1);
+                        c1 = string.IsNullOrEmpty(c1) ? "" : c1;
+                        conditionJOb.TryAdd("comparator", c1);
                         conditionJOb.Add("data_type", dic["data_type"]);
                         conditionJOb.Add("value", dic["value"]);
                         conditionArray.Add(conditionJOb);
@@ -223,6 +205,7 @@
                 {
                     var outputTypeJOb = new JObject { };
                     outputTypeJOb.Add("sid", dictionary.sid);
+                    outputTypeJOb.Add("delay", dictionary.delay);
                     outputTypeJOb.Add("target_type", dictionary.target_type);
                     var statusArray = new JArray { };
                     foreach (var dic in dictionary.status)
@@ -242,7 +225,8 @@
 
                 var pushConfigsArray = new JArray { };
                 if (logic.pushConfigs.Count > 0)
-                {   //聽鎺ㄩ�佹枃鏈�
+                {
+                    //聽鎺ㄩ�佹枃鏈�
                     foreach (var pushConfig in logic.pushConfigs)
                     {
 
@@ -262,7 +246,7 @@
                 var logicIfon = new JObject { };
                 logicIfon.Add("userLogicId", logic.userLogicId);
                 logicIfon.Add("sid", logic.sid);
-                logicIfon.Add("gatewayId", LogicMethod.GatewayId);
+                logicIfon.Add("gatewayId", LogicMethod.CurrLogicMethod.GatewayId);
                 logicIfon.Add("name", logic.name);
                 logicIfon.Add("relation", logic.relation);
                 logicIfon.Add("enable", logic.enable);
@@ -273,7 +257,7 @@
                 logicIfon.Add("pushConfigs", pushConfigsArray);
 
                 logicjArray.Add(logicIfon);
-                var jObject = new JObject { { "homeId", LogicMethod.HomeId }, { "logics", logicjArray } };
+                var jObject = new JObject { { "homeId", LogicMethod.CurrLogicMethod.HomeId }, { "logics", logicjArray } };
                 responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_Update,5);
                 //濡傛灉鏄痶oken杩囨湡鍒欏埛鏂皌oken
                 if (responsePackNew.Code == StateCode.TOKEN_EXPIRED)

--
Gitblit v1.8.0