From 666b28d77fc3c1b1dae61c9dfd878c8e683cef8c Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期五, 21 四月 2023 13:37:19 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/wjc' into Dev-Branch

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs |  104 +++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 90 insertions(+), 14 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
index 58b303f..7055171 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
@@ -409,22 +409,51 @@
                                     break;
                                 case SPK.VideoDoorLock:
                                     {
-                                        string value = this.GetValue(dicList);
-                                        inputView.btnState.Text = value;
+                                        string s = string.Empty;
+                                        string tag = string.Empty;
+                                        for (int b = 0; b < dicList.Count; b++)
+                                        {
+                                            var dic = dicList[b];
+                                            //var userId = dic["value"].ToString();
+                                            //var FaceItem = this.GetVideoDoorLockUserItem(userId, device);
+                                            //s += FaceItem.userName;
+                                            //s += ",";
+                                            //tag += FaceItem.userId;
+                                            //tag += "_";
+                                            var userName = dic["value"].ToString();
+                                            s += userName;
+                                            s += ",";
+                                        }
+                                        inputView.btnState.Text = s;
                                     }
                                     break;
                                 case SPK.doorgate:
                                     {
+                                        string s = string.Empty;
                                         if (inputCondition.identifier == "door_call_cloud_event")
                                         {
-                                            inputView.btnState.Text = Language.StringByID(StringId.shipintonghuahujiao);
+                                            s = Language.StringByID(StringId.shipintonghuahujiao);
                                         }
                                         else
                                         {
-                                            string userId = this.GetKeyValue("user_id",dicList);
-                                            var FaceItem = this.GetFaceItem(userId, device.deviceId);
-                                            inputView.btnState.Text = FaceItem.userName;
+                                            for (int b = 0; b < dicList.Count; b++)
+                                            {
+                                                var dic = dicList[b];
+                                                var key = dic["key"].ToString();
+                                                if (key != "user_id")
+                                                {
+                                                    continue;
+                                                }
+                                                var userId = dic["value"].ToString();
+                                                var FaceItem = this.GetFaceItem(userId, device.deviceId);
+                                                s += FaceItem.userName;
+                                                s += ",";
+
+
+                                            }
+                                           
                                         }
+                                        inputView.btnState.Text = s;
                                     }
                                     break;
                                 case SPK.IpCam_Imou:
@@ -1499,7 +1528,7 @@
                 //寮�鍏崇伅鍏�
                 case SPK.AirSwitch:
                 case SPK.LightSwitch:
-                    //鏈烘鎵�
+                //鏈烘鎵�
                 case SPK.MechanicalArm:
                     {
                         foreach (var dic in dicList)
@@ -2139,11 +2168,23 @@
                     break;
                 case SPK.VideoDoorLock:
                     {
-                        foreach (var dic in dicList)
+                        string s = string.Empty;
+                        string tag = string.Empty;
+                        for (int b = 0; b < dicList.Count; b++)
                         {
-                            string value = dic["value"];
-                            button1.Text = value;
+                            var dic = dicList[b];
+                            //var userId = dic["value"].ToString();
+                            //var FaceItem = this.GetVideoDoorLockUserItem(userId, device);
+                            //s += FaceItem.userName;
+                            //s += ",";
+                            //tag += FaceItem.userId;
+                            //tag += "_";
+                            var userName = dic["value"].ToString();
+                            s += userName;
+                            s += ",";
                         }
+                        button1.Text = s;
+                        button1.Tag = tag;
                     }
                     break;
                 case SPK.MusicStandard:
@@ -2164,11 +2205,28 @@
                     break;
                 case SPK.doorgate:
                     {
-                        string value = this.GetKeyValue("user_id", dicList);
-                        button2.Text = this.GetFaceItem(value, device.deviceId).userName;
+                        string s = string.Empty;
+                        string tag = string.Empty;
+                        for (int b = 0; b < dicList.Count; b++)
+                        {
+                            var dic = dicList[b];
+                            var key = dic["key"].ToString();
+                            if (key != "user_id")
+                            {
+                                continue;
+                            }
+                            var userId = dic["value"].ToString();
+                            var FaceItem = this.GetFaceItem(userId, device.deviceId);
+                            s += FaceItem.userName;
+                            s += ",";
+                            tag += FaceItem.userId;
+                            tag += "_";
+                        }
+                        button2.Text = s;
+                        button2.Tag = tag;
                     }
                     break;
-              
+
             }
         }
         /// <summary>
@@ -2635,7 +2693,7 @@
             }
         }
         /// <summary>
-        /// 鏌ユ壘鎸囧畾userId
+        /// 鏌ユ壘鎸囧畾鍙瀵硅userId
         /// </summary>
         /// <param name="userId"></param>
         /// <returns></returns> 
@@ -2652,6 +2710,24 @@
             }
             return face;
         }
+        /// <summary>
+        /// 鏌ユ壘鎸囧畾钀ょ煶瑙嗛闂ㄩ攣userId
+        /// </summary>
+        /// <param name="userId"></param>
+        /// <returns></returns> 
+        public Face GetVideoDoorLockUserItem(string userId, Function device)
+        {
+            if (Send.Current.VideoDoorLockUserListInfo.Count == 0)
+            {
+                Send.Current.GetVideoDoorLockUserListInfo(device);
+            }
+            var face = Send.Current.VideoDoorLockUserListInfo.Find((o) => { return o.userId == userId; });
+            if (face == null)
+            {
+                face = new Face();
+            }
+            return face;
+        }
 
     }
 }

--
Gitblit v1.8.0