/// <summary> /// 获取最低级的tree /// </summary> /// <param name="car"></param> /// <returns></returns> public static JObject getLastJobjectCar(DC_CAR_Model car) { var model = T_SYS_DICTCls.getListModel(new T_SYS_DICTSW { DICTTYPEID = "33", DICTVALUE = car.CARTYPE }).FirstOrDefault(); var name = car.NAME + "【" + model.DICTNAME + "】"; //getPosition StringBuilder sb = new StringBuilder(); string carimage = "car_" + car.CARTYPE; //偏移量计算 // double[] arr = ClsPositionUtil.gcj_To_Gps84(double.Parse(car.WD), double.Parse(car.JD)); if (!string.IsNullOrEmpty(car.JD) || !string.IsNullOrEmpty(car.WD)) { double[] arr = ClsPositionTrans.GpsTransform(double.Parse(car.WD), double.Parse(car.JD), ConfigCls.getSDELonLatTransform()); if (arr.Length > 0) { car.JD = arr[1].ToString(); car.WD = arr[0].ToString(); } //string sb = "<a onClick="">" + name + "</a>"; sb.AppendFormat("<font onClick='movetocar(\"{0}\",\"{1}\",\"{2}\")'>{3}</font>", car.JD, car.WD, carimage, name); } else { sb.AppendFormat("<font onClick='alert(\"缺少经纬度无法定位。\")'>{0}</font>", name); } JObject root = new JObject { { "id", car.DC_CAR_ID }, { "text", sb.ToString() } }; return(root); }
/// <summary> /// 模板列表 /// </summary> /// <param name="sw"></param> /// <returns></returns> public static IEnumerable <YJ_DCSMS_TMP_Model> GetListModel(YJ_DCSMS_TMP_SW sw) { var result = new List <YJ_DCSMS_TMP_Model>(); DataTable dt = BaseDT.YJ_DCSMS_TMP.getDT(sw);//获取模板 DataTable dtFIRELEVEL = BaseDT.T_SYS_DICT.getDT(new T_SYS_DICTSW { DICTTYPEID = "24" }); //预案 for (int i = 0; i < dt.Rows.Count; i++) { YJ_DCSMS_TMP_Model m = new YJ_DCSMS_TMP_Model(); m.YJ_DCSMS_TMPID = dt.Rows[i]["YJ_DCSMS_TMPID"].ToString(); m.SMSGROUPNAME = dt.Rows[i]["SMSGROUPNAME"].ToString(); m.SMSGROUPTYPE = dt.Rows[i]["SMSGROUPTYPE"].ToString(); m.SMSSENDUSERLIST = dt.Rows[i]["SMSSENDUSERLIST"].ToString(); m.TMPCONTENT = dt.Rows[i]["TMPCONTENT"].ToString(); m.DANGERCLASS = dt.Rows[i]["DANGERCLASS"].ToString(); m.ORDERBY = dt.Rows[i]["ORDERBY"].ToString(); m.ISENABLE = dt.Rows[i]["ISENABLE"].ToString(); m.TID = dt.Rows[i]["TID"] == null ? "" : dt.Rows[i]["TID"].ToString(); m.ISENABLEName = (m.ISENABLE == "1") ? "启用" : "未启用"; if (m.SMSGROUPTYPE == "0") { m.SMSGROUPTYPEName = "通讯录"; } else if (m.SMSGROUPTYPE == "1") { m.SMSGROUPTYPEName = "值班员"; } else if (m.SMSGROUPTYPE == "2") { m.SMSGROUPTYPEName = "护林员"; } else { m.SMSGROUPTYPEName = "设置错误"; } m.FIRELEVELName = BaseDT.T_SYS_DICT.getName(dtFIRELEVEL, m.DANGERCLASS); m.dicModel = T_SYS_DICTCls.getModel(new T_SYS_DICTSW { DICTTYPEID = "24", DICTVALUE = m.DANGERCLASS }); result.Add(m); } dt.Clear(); dt.Dispose(); dtFIRELEVEL.Clear(); dtFIRELEVEL.Dispose(); return(result); }