From 4addd1dc37f167e2000c31c7b623ba45b01d77ec Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期五, 19 十一月 2021 17:11:20 +0800 Subject: [PATCH] 1 --- HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs | 22 +++++++++++++++++----- 1 files changed, 17 insertions(+), 5 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..7b289d7 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,19 +864,30 @@ ///鑷姩鍖栨病鏈夐厤缃湴鐞嗗洿鏍忎笉澶勭悊 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); } } -- Gitblit v1.8.0