From 3017a03979723442dc99185aa50bd45ffc1007fc Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期四, 14 九月 2023 10:36:40 +0800
Subject: [PATCH] 2023年09月14日10:36:32

---
 HDL_ON/DAL/Server/HttpUtil.cs                                     |    4 +-
 HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs    |   46 ++++++++++++++--------
 HDL-ON_Android/Resources/Resource.designer.cs                     |    2 
 HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs |   15 ++++---
 4 files changed, 41 insertions(+), 26 deletions(-)

diff --git a/HDL-ON_Android/Resources/Resource.designer.cs b/HDL-ON_Android/Resources/Resource.designer.cs
index eab1586..6536465 100644
--- a/HDL-ON_Android/Resources/Resource.designer.cs
+++ b/HDL-ON_Android/Resources/Resource.designer.cs
@@ -15,7 +15,7 @@
 {
 	
 	
-	[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "13.2.1.111")]
+	[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "13.2.0.99")]
 	public partial class Resource
 	{
 		
diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs
index 5235064..b659327 100644
--- a/HDL_ON/DAL/Server/HttpUtil.cs
+++ b/HDL_ON/DAL/Server/HttpUtil.cs
@@ -18,8 +18,8 @@
         /// 鍥哄畾鍩熷悕,姝e紡鐜
         /// 鍏叡鍩熷悕灏辫繎瑙f瀽
         /// </summary>
-        public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
-        //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";
+        //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
+        public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";
         const string APP_KEY = "HDL-HOME-APP-TEST";
         const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss";
 
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
index ce4e545..606c5b1 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
@@ -3,6 +3,7 @@
 using System.Collections.Generic;
 using HDL_ON.Entity;
 using HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock;
+using Com.Alibaba.Fastjson;
 
 namespace HDL_ON.UI.UI2.Intelligence.Automation
 {
@@ -1304,8 +1305,10 @@
                             if (indexeList.Count > 0)
                             {
                                 dicSateteList.Clear();
-                                string s = string.Empty;
+                                string seleTxet = string.Empty;
                                 string tag = string.Empty;
+                                string[] array = new string[indexeList.Count];
+
                                 for (int i = 0; i < indexeList.Count; i++)
                                 {
                                     if (i > faceIdList.Count)
@@ -1314,15 +1317,15 @@
                                     }
                                     var indexe = indexeList[i];
                                     var face = faceIdList[indexe];
-                                    //鏁版嵁灏佽<楂樿儨璇磋悿鐭抽偅杈规槸鎺ㄩ�佺敤鎴峰悕>
-                                    AddDictionary("open_user", face.userName, "string");
-                                    s += face.userName;
-                                    s += ",";
                                     tag += face.userId;
                                     tag += "_";
+                                    array[i] = face.userName;
                                 }
+                                seleTxet= JSON.ToJSONString(array);
+                                //鏁版嵁灏佽<楂樿儨璇磋悿鐭抽偅杈规槸鎺ㄩ�佺敤鎴峰悕>
+                                AddDictionary("open_user",seleTxet, "string", "[]"); 
                                 //鐣岄潰鏄剧ず閫変腑鍊�
-                                btnState.Text = s;
+                                btnState.Text = InpOrOutLogicMethod.Current.RemoveLastStr(seleTxet);
                                 btnState.Tag = tag;
                             }
 
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
index 803d84e..c0a2216 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
@@ -48,7 +48,7 @@
                 {
                     case "1":
                         {
-                           
+
                             inputView.btnIcon.UnSelectedImagePath = "LogicIcon/time.png";
                             foreach (var dic in dicList)
                             {
@@ -130,7 +130,7 @@
                     case "2":
                         {
                             inputView.btnIcon.UnSelectedImagePath = "LogicIcon/time.png";
-                            string value= this.GetKeyValue("timesection", dicList);
+                            string value = this.GetKeyValue("timesection", dicList);
                             inputView.btnText.Text = Language.StringByID(StringId.timeHorizon) + ": " + value;
                         }
                         break;
@@ -418,7 +418,7 @@
                                     break;
                                 case SPK.VideoDoorLock:
                                     {
-                                        string s = string.Empty;
+                                        string userName = string.Empty;
                                         string tag = string.Empty;
                                         for (int b = 0; b < dicList.Count; b++)
                                         {
@@ -429,11 +429,9 @@
                                             //s += ",";
                                             //tag += FaceItem.userId;
                                             //tag += "_";
-                                            var userName = dic["value"].ToString();
-                                            s += userName;
-                                            s += ",";
+                                            userName = dic["value"].ToString();
                                         }
-                                        inputView.btnState.Text = s;
+                                        inputView.btnState.Text = RemoveLastStr(userName);
                                     }
                                     break;
                                 case SPK.doorgate:
@@ -495,7 +493,7 @@
                                             break;
 
                                         }
-                  
+
                                         inputView.btnState.Text = Language.StringByID(StringId.wuren);
                                         if (value == "true")
                                         {
@@ -841,7 +839,7 @@
                                 else if (device.spk == SPK.SensorTemperature)
                                 {
 
-                                   this.SensorView(thisView, device, "temperature", indexVulae);
+                                    this.SensorView(thisView, device, "temperature", indexVulae);
 
                                 }
                                 else if (device.spk == SPK.SensorHumidity)
@@ -1502,7 +1500,8 @@
                                         if (stateStr.StartsWith(";"))
                                         {
                                             stateStr = stateStr.Substring(1, stateStr.Length - 1);
-                                        } else if (stateStr.EndsWith(Language.StringByID(StringId.volumeMusic)))
+                                        }
+                                        else if (stateStr.EndsWith(Language.StringByID(StringId.volumeMusic)))
                                         {
                                             stateStr = stateStr.Substring(0, stateStr.Length - 3);
                                         }
@@ -2460,7 +2459,7 @@
                     break;
                 case SPK.VideoDoorLock:
                     {
-                        string s = string.Empty;
+                        string userName = string.Empty;
                         string tag = string.Empty;
                         for (int b = 0; b < dicList.Count; b++)
                         {
@@ -2471,11 +2470,10 @@
                             //s += ",";
                             //tag += FaceItem.userId;
                             //tag += "_";
-                            var userName = dic["value"].ToString();
-                            s += userName;
-                            s += ",";
+                            userName = dic["value"].ToString();
+
                         }
-                        button1.Text = s;
+                        button1.Text = RemoveLastStr(userName);
                         button1.Tag = tag;
                     }
                     break;
@@ -2542,7 +2540,7 @@
                                         }
                                     }
                                     break;
-                                   
+
                                 case "set_volume":
                                     {
                                         if (button2 == null)
@@ -3005,7 +3003,7 @@
             Input inputedit = Logic.currlogic.input[indexVulae];
             ///鐘舵�佸��
             string stateValue = "";
-            for (int i=0;i<inputedit.condition.Count;i++)
+            for (int i = 0; i < inputedit.condition.Count; i++)
             {
                 var dic = inputedit.condition[i];
                 string comparator = dic["comparator"];
@@ -3106,6 +3104,20 @@
             return face;
         }
 
+        /// <summary>
+        /// 鍒犻櫎鏈�鍚庝竴涓� ","
+        /// </summary>
+        /// <param name="s">瀛楃涓�</param>
+        /// <returns></returns>
+        public string RemoveLastStr(string s)
+        {
+            if (string.IsNullOrEmpty(s))
+            {
+                return string.Empty;
+            }
+            return s.Replace("[","").Replace("]","").Replace("\"","").TrimEnd(',');
+        }
+
     }
 }
 

--
Gitblit v1.8.0