/// <summary> /// 根据城市名称 and 多个楼盘Ids获取案例Id+楼盘名 /// </summary> /// <param name="cityId"></param> /// <param name="fxtCaseIds"></param> /// <returns></returns> public static Dictionary <int, string> GetCaseIdJoinProjectNameByCityNameAndCaseIds(string cityName, int[] fxtCaseIds, FxtAPIClientExtend _fxtApi = null) { Dictionary <int, string> dic = new Dictionary <int, string>(); FxtAPIClientExtend fxtApi = new FxtAPIClientExtend(_fxtApi); try { string name = "GetCityByCityName"; var para = new { cityName = cityName }; string jsonStr = Convert.ToString(EntranceApi.Entrance(name, para.ToJSONjss(), _fxtApi: fxtApi)); if (string.IsNullOrEmpty(jsonStr)) { fxtApi.Abort(); return(dic); } FxtApi_SYSCity city = FxtApi_SYSCity.ConvertToObj(jsonStr); if (city == null) { fxtApi.Abort(); return(dic); } int cityId = city.CityId; dic = GetCaseIdJoinProjectNameByFxtCityIdAndCaseIds(cityId, fxtCaseIds, _fxtApi: fxtApi); fxtApi.Abort(); } catch (Exception ex) { fxtApi.Abort(); log.Error(string.Format("GetCaseIdJoinProjectNameByCityNameAndCaseIds(string cityName:{0}, int[] fxtCaseIds)", cityName == null ? "null" : ""), ex); } return(dic); }
/// <summary> /// 根据城市名称获取城市信息 /// </summary> /// <param name="cityName"></param> /// <returns></returns> public static FxtApi_SYSCity GetCityByCityName(string cityName, FxtAPIClientExtend _fxtApi = null) { FxtApi_SYSCity city = null; FxtAPIClientExtend fxtApi = new FxtAPIClientExtend(_fxtApi); try { string name = "GetCityByCityName"; var para = new { cityName = cityName }; string jsonStr = Convert.ToString(EntranceApi.Entrance(name, para.ToJSONjss(), _fxtApi: fxtApi)); if (string.IsNullOrEmpty(jsonStr)) { fxtApi.Abort(); return(null); } city = FxtApi_SYSCity.ConvertToObj(jsonStr); fxtApi.Abort(); } catch (Exception ex) { fxtApi.Abort(); log.Error(string.Format("GetCityByCityName(string cityName:{0})", cityName == null ? "null" : ""), ex); } return(city); }