From 3db5c3218f405795dc9a2d0f6afdde8ab8ac9e73 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期二, 23 十一月 2021 09:11:30 +0800
Subject: [PATCH] Merge branch 'WJC' of http://172.16.1.23:6688/r/~wxr/HDL_APP_Project into WJC

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs |   61 +++++++++++++++++++++++++++---
 1 files changed, 54 insertions(+), 7 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
index b896462..0461a5c 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
@@ -842,11 +842,12 @@
         /// <summary>
         /// 鑷姩鍖栧湴鐞嗗洿鏍忕姸鎬佷笂鎶ヤ簯绔�
         /// </summary>
-        /// <param name="out_lng">APP缁忓害</param>
-        /// <param name="out_lat">APP绾害</param>
+        /// <param name="out_lng">APP GPS缁忓害</param>
+        /// <param name="out_lat">APP GPS绾害</param>
         private void AutomatedGeofenceStatusReporting(double out_lng, double out_lat)
         {
             List<LogicData> logicDataList = new List<LogicData>();
+            logicDataList.Clear();
             //鑾峰彇閫昏緫ID鍒楄〃
             var idStr = Send.GetLogicIdList();
             if (idStr.Code == "0" && idStr.Data != null && idStr.Data.ToString() != "")
@@ -863,24 +864,70 @@
                     ///鑷姩鍖栨病鏈夐厤缃湴鐞嗗洿鏍忎笉澶勭悊
                     if (string.IsNullOrEmpty(logicDate.geo_fence.latitude) || string.IsNullOrEmpty(logicDate.geo_fence.longitude))
                     {
-                        //缁忕含搴︿负绌猴紝涓嶅鐞�
+                        //缁忕含搴︿负绌�,璁や负鑷姩鍖栨病鏈夐厤缃湴鐞嗗洿鏍忥紝涓嶅鐞�;
                         continue;
                     }
-                    //鑷姩鍖栫含搴�
+                    //鑷姩鍖栭厤缃緭鍏ユ潯浠剁含搴�
                     double lat = Convert.ToDouble(logicDate.geo_fence.latitude);
-                    //鑷姩鍖栫粡搴�
+                    //鑷姩鍖栭厤缃緭鍏ユ潯浠剁粡搴�
                     double lon = Convert.ToDouble(logicDate.geo_fence.longitude);
-                    //鑷姩鍖栧崐寰�<鍗曚綅绫�>
+                    //鑷姩鍖栭厤缃緭鍏ユ潯浠�<鍦扮悊鍥存爮鍗婂緞><鍗曚綅锛屽叕閲屻�佸崈绫�.绫�>
                     int radius = int.Parse(logicDate.geo_fence.radius);
                     //璁$畻2涓粡绾害涔嬮棿鐨勮窛绂�
                     int r =Infrastructure.Service.Helper.CalculatedDistance.Distance(out_lat, out_lng, lat, lon);
+                    //瀹氫箟涓�涓眬閮ㄥ彉閲�
+                    string direction = string.Empty;
+                    //涓ょ偣璺濈灏忎簬閰嶇疆璺濈<鏃㈣嚜鍔ㄥ寲閰嶇疆杈撳叆鏉′欢鍦扮悊鍥存爮鍗婂緞>,璇存槑杩涘叆鍖哄煙
+                    if (r<radius) {
+                        //鍒拌揪鏌愬湴
+                        direction = "arrive";
+                    } else {
+                        //绂诲紑
+                        direction = "leave";
+                    }
+                    //鎺ㄩ�佺粰浜戠鏄惁鎴愬姛
+                    bool f= Send.GeoFenceStateReport(logicDate.userLogicId,logicDate.sid, direction);
                     //if () { }
-
+                    //Common.FileUtlis.Files.WriteFileByBytes(savePath, ssd);
                 }
 
             }
 
         }
 
+
+       
+    }
+    public class DD {
+
+        /// <summary>
+        /// 浜戠鍞竴id
+        /// </summary>
+        public string userLogicId = "";
+        /// <summary>
+        /// 缃戝叧id
+        /// </summary>
+        public string gatewayId = "";
+        /// <summary>
+        /// 閫昏緫鍞竴鏍囪瘑
+        /// </summary>
+        public string sid = "";
+        /// <summary>
+        /// 浣忓畢id
+        /// </summary>
+        public string homeId = "";
+        /// <summary>
+        /// 鏄惁鎺ㄩ�佽繃锛坱rue锛氬凡缁忔帹閫侊紝false锛氭病鏈変笉鎺ㄩ�侊級
+        /// </summary>
+        public bool IsPush;
+        /// <summary>
+        /// 鍒拌揪鏌愬湴
+        /// </summary>
+        public string arrive = "";
+        /// <summary>
+        /// 绂诲紑
+        /// </summary>
+        public string leave = "";
+
     }
 }

--
Gitblit v1.8.0