From 0041a49139ebb21f228de022b38462b137c2d71e Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期五, 07 四月 2023 17:55:42 +0800
Subject: [PATCH] 语言包整理

---
 HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupControl.cs |   44 ++++++++++++++++++++++++++++++++------------
 1 files changed, 32 insertions(+), 12 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupControl.cs b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupControl.cs
index 1c25db0..4591f0b 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupControl.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupControl.cs
@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using HDL_ON.Common;
 using HDL_ON.DAL.Server;
+using HDL_ON.DriverLayer;
 using Shared;
 
 namespace HDL_ON.Entity
@@ -123,22 +124,41 @@
         {
             try
             {
-                var controlValues = new Dictionary<string, object>();
-                foreach(var p in pairs)
+               
+                if (DriverLayer.Control.Ins.GatewayOnline_Local)
                 {
-                    controlValues.Add("key", p.Key);
-                    controlValues.Add("value", p.Value);
-                }
-                var pack = ApiUtlis.Ins.HttpRequest.ControlGroupControl(userDeviceGroupControlId, controlValues);
-                if (pack != null)
-                {
-                    if (pack.Code == StateCode.SUCCESS)
+                    var controlValues = new Dictionary<string, string>();
+                    foreach (var p in pairs)
                     {
-                        //DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl.
+                        controlValues.Add("key", p.Key);
+                        controlValues.Add("value", p.Value.ToString());
                     }
-                    else
+                    var functionControlDataObj = GetGatewayAlinkControlData(controlValues);
+                    var functionControlDataJson = Newtonsoft.Json.JsonConvert.SerializeObject(functionControlDataObj);
+                    var sendBytes = DriverLayer.Control.Ins.ConvertSendBodyData(CommunicationTopic.ct.ControlFunctionTopic, functionControlDataJson);
+                    new Control_Udp().SendLocalHdlLinkData(sendBytes, functionControlDataObj.id, 3);
+                    MainPage.Log($"鏈湴閫氳 鍙戦�丠DL-Link鏁版嵁:{functionControlDataJson}");
+                }
+                else
+                {
+                    
+                    var controlValues = new Dictionary<string, object>();
+                    foreach (var p in pairs)
                     {
-                        MainPage.Log($"缇ゆ帶鎺у埗澶辫触,Code: {pack.Code}");
+                        controlValues.Add("key", p.Key);
+                        controlValues.Add("value", p.Value);
+                    }
+                    var pack = ApiUtlis.Ins.HttpRequest.ControlGroupControl(userDeviceGroupControlId, controlValues);
+                    if (pack != null)
+                    {
+                        if (pack.Code == StateCode.SUCCESS)
+                        {
+                            //DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl.
+                        }
+                        else
+                        {
+                            MainPage.Log($"缇ゆ帶鎺у埗澶辫触,Code: {pack.Code}");
+                        }
                     }
                 }
             }

--
Gitblit v1.8.0