xm
2021-11-25 47fbfe1cd58bb82b45dfc0a5398799bd856b1fb0
2021-11-25=01
3个文件已修改
97 ■■■■■ 已修改文件
HDL_ON/UI/UI2/3-Intelligence/Automation/AddInputType.cs 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/AddInputType.cs
@@ -158,9 +158,8 @@
        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
      });
    }
    /// <summary>
    /// 地理围栏View
    /// 添加地理围栏
    /// </summary>
    /// <param name="flMain">Fl main.</param>
    /// <param name="edit">If set to <c>true</c> edit.</param>
@@ -170,9 +169,8 @@
      ///通过调试宝给的经纬度<标准GPS>
      double latitude = Entity.DB_ResidenceData.Instance.CurrentRegion.latitude;//纬度
      double longitude = Entity.DB_ResidenceData.Instance.CurrentRegion.longitude;//经度
                                                                                  //WGS84坐标转高德坐标
      LogicMethod.CurrLogicMethod.WGS84_to_GCJ02(Entity.DB_ResidenceData.Instance.CurrentRegion.longitude, Entity.DB_ResidenceData.Instance.CurrentRegion.latitude, out longitude, out latitude);
      int r = 500;//半径
      int r = 500;//默认半径
      if (edit)
      {
        for (var i = 0; i < Logic.currlogic.input.Count; i++)
@@ -193,17 +191,17 @@
            strname = Language.StringByID(StringId.likai);
          }
          //再一次编辑地理围栏<控件暂时不支持显示记录上一次的状态>
          //if (!string.IsNullOrEmpty(input.geo_fence.latitude) && !string.IsNullOrEmpty(input.geo_fence.longitude))
          //{
          if (!string.IsNullOrEmpty(input.geo_fence.latitude) && !string.IsNullOrEmpty(input.geo_fence.longitude))
          {
          //    //纬度
          //    var latitude1 = Convert.ToDouble(input.geo_fence.latitude);
          //    //经度
          //    var longitude1 = Convert.ToDouble(input.geo_fence.longitude);
          //    //半径
          //    r = int.Parse(input.geo_fence.radius);
          //    //WGS84坐标转高德坐标
            //半径
            r = int.Parse(input.geo_fence.radius);
            //WGS84坐标转高德坐标
          //    LogicMethod.CurrLogicMethod.WGS84_to_GCJ02(longitude1, latitude1, out longitude, out latitude);
          //}
          }
        }
      }
      PublicInterface publicInterface = new PublicInterface();
@@ -237,7 +235,36 @@
                       ((BaseActivity)Application.Activity).SetPermission((result3) =>
                       {
                         if (result3 == false) { return; }
                         //调用方法,跳转页面
                         Location(valueStr, strname, latitude, longitude, r);
                       }, "android.permission.READ_PHONE_STATE");
                  }, "android.permission.WRITE_EXTERNAL_STORAGE");
                  });
#endif
#if __IOS__
               //调用方法,跳转页面
                  Location(valueStr, strname, latitude, longitude, r);
#endif
       });
    }
    /// <summary>
    /// 地理围栏View
    /// </summary>
    /// <param name="valueStr">进入(arrive)或者离开(leave)</param>
    /// <param name="strname"></param>
    /// <param name="latitude">纬度</param>
    /// <param name="longitude">经度</param>
    /// <param name="r">半径(默认500米)</param>
    private void Location(string valueStr, string strname, double latitude, double longitude, int r)
    {
      if (r == 0)
      {
        //按道理说不会出现
        r = 500;
      }
                         //调用方法,跳转页面
                         GDMapKit.Show((mLatitude, mLongitude, mRadius, name) =>
                          {
@@ -267,48 +294,7 @@
                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                          }, strname, Language.StringByID(StringId.save), true, latitude, longitude, r);
                       }, "android.permission.READ_PHONE_STATE");
                  }, "android.permission.WRITE_EXTERNAL_STORAGE");
                  });
#endif
#if __IOS__
               //调用方法,跳转页面
               GDMapKit.Show((mLatitude, mLongitude, mRadius, name) =>
               {
                  //高德坐标转WGS84坐标(高德地图设置GPS)
                  double out_lng, out_lat;
            LogicMethod.CurrLogicMethod.GCJ02_to_WGS84(mLongitude, mLatitude, out out_lng, out out_lat);
            Input input = new Input();
            input.sid = LogicMethod.CurrLogicMethod.NewSid();
            input.condition_type = "8";
            Dictionary<string, string> dic = new Dictionary<string, string>();
            LogicMethod.CurrLogicMethod.dictionary(dic, "key", "direction");
            LogicMethod.CurrLogicMethod.dictionary(dic, "comparator", "=");
            LogicMethod.CurrLogicMethod.dictionary(dic, "data_type", "string");
            LogicMethod.CurrLogicMethod.dictionary(dic, "value", "arrive");
            input.condition.Add(dic);
                  //纬度
                  input.geo_fence.latitude = out_lat.ToString();
                  //经度
                  input.geo_fence.longitude = out_lng.ToString();
                  //半径<单位米>
                  input.geo_fence.radius = mRadius.ToString();
            AddCondition(input);
            LogicMethod.CurrLogicMethod.RemoveAllView();
            AddLogic addLogic = new AddLogic();
            MainPage.BasePageView.AddChidren(addLogic);
            addLogic.Show();
            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
          }, strname, Language.StringByID(StringId.save), true, latitude, longitude, r);
#endif
       });
    }
    /// <summary>
    /// 添加条件
    /// </summary>
HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
@@ -864,7 +864,7 @@
      {
        try
        {
          //获取逻辑ID列表<备注:如果只针对当前手机的话,可以直接拿缓存数据自动化列表遍历>
          //获取逻辑ID列表,目前针对所有<备注:如果只针对当前手机的话,可以直接拿缓存数据自动化列表遍历>
          var idStr = Send.GetLogicIdList();
          if (idStr.Code == "0" && idStr.Data != null && idStr.Data.ToString() != "")
          {
@@ -905,6 +905,7 @@
                //离开
                direction = "leave";
              }
              ///遍历缓存列表<不为空说明数据已经推送过,不再推送>
              var isPush = pushList.Find((o) => o.homeId == HomeId && o.userId == UserInfo.Current.ID && o.userLogicId == logicDate.userLogicId && o.arriveOnLeave == direction);
              if (isPush == null)
              {
HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs
@@ -30,7 +30,6 @@
            }
            return new List<ResidenceMemberInfo>();
        }
        /// <summary>
        /// 获取逻辑ID列表
        /// </summary>
@@ -106,7 +105,8 @@
                        conditionArray.Add(conditionJOb);
                    }
                    inputTypeJOb.Add("condition",conditionArray);
                    if (dictionary.condition_type=="8") {
          if (dictionary.condition_type == "8")
          {
                        ///地理围栏
                        var geo_fencejob = new JObject();
                        geo_fencejob.Add("longitude", dictionary.geo_fence.longitude);
@@ -351,8 +351,6 @@
            }
            return responsePackNew;
        }
        /// <summary> 
        /// 自动化地理围栏状态上报
        /// </summary>