/// <summary> /// 根据条件查看物价条数 /// </summary> /// <param name="category">物品分类</param> /// <param name="foodname">物品名称</param> /// <param name="site">监控点</param> /// <returns></returns> public string GetFoodMonitorCount(string category, string foodname, string site) { try { FoodMonitor entity = new FoodMonitor { Category = category, FoodName = foodname, SiteName = site }; var count = _priceQueryService.QueryMonitorsCountBy(entity); return(new ResultFormat(1, count).ToString()); } catch (Exception ex) { LogHelper.GetInstance().Error(ex.ToString()); return(new ResultFormat(0, ex.Message).ToString()); } }
/// <summary> /// 违章记录查询 /// </summary> /// <param name="no">车牌号</param> /// <param name="frameNo">车架号 后6位</param> /// <param name="type">车类型</param> /// <param name="vcode">验证码</param> /// <returns></returns> public string GetTrafficRecode(string no, string frameNo, string type, string vcode) { try { var result = new TrafficVioQuery().Query(no, frameNo, vcode, type); if (result == null) { return(new ResultFormat(0, "远程服务无响应,请至'公安交管信息网'查询").ToString()); } return(new ResultFormat(1, result).ToString()); } catch (Exception ex) { LogHelper.GetInstance().Error(ex.ToString()); return(new ResultFormat(0, ex.ToString()).ToString()); } }
/// <summary> /// 通过地址匹配获取社区名字 /// </summary> /// <param name="address">地址</param> /// <returns></returns> public string GetCommunityName(string address) { try { string name = _dzkLogic.LocateCommunityName(address); if (!string.IsNullOrEmpty(name)) { return(new ResultFormat(1, name).ToString()); } return(new ResultFormat(0, string.Empty).ToString()); } catch (Exception ex) { LogHelper.GetInstance().Error(ex.ToString()); return(new ResultFormat(0, ex.Message).ToString()); } }
/// <summary> /// 获取配置类型 /// </summary> /// <param name="categoryId"></param> /// <returns></returns> public string FindTypeConfigByCategory(int categoryId) { try { var result = _globalTypeConfigLogic.FindTypeByCategory(categoryId).ToList(); var simple = from it in result select new { Id = it.type_id, Name = it.type_name }; return(new ResultFormat(1, simple).ToString()); } catch (Exception ex) { LogHelper.GetInstance().Error(ex.ToString()); return(new ResultFormat(0, ex.Message).ToString()); } }
/// <summary> /// 分页获取社区风采(标题) /// </summary> /// <param name="community">社区名称</param> /// <param name="pageNo">页号(大于0)</param> /// <param name="pageSize">每页条数(小于20)</param> /// <returns></returns> public string GetCommunityFCTitles(string community, int pageNo, int pageSize) { try { var fcs = _noticeLogic.LoadFC(community, pageNo, pageSize); var result = (from it in fcs select new { Id = it.UUID, Title = it.TITLE, ReleaseTime = it.RELEASE_TIME }).ToList(); return(new ResultFormat(1, result).ToString()); } catch (Exception ex) { LogHelper.GetInstance().Error(ex.ToString()); return(new ResultFormat(0, ex.Message).ToString()); } }
/// <summary> /// 分页获取公交线路列表 /// </summary> /// <param name="pageNo">页号(大于0)</param> /// <param name="pageSize"></param> /// <returns></returns> public string GetBusRouteList(int pageNo, int pageSize) { try { var result = _busRouteLogic.LoadBusRouteList(pageNo, pageSize); var routes = (from it in result select new { Name = it.NAME, Line = it.LINE, }).ToList(); return(new ResultFormat(1, routes).ToString()); } catch (Exception ex) { LogHelper.GetInstance().Error(ex.ToString()); return(new ResultFormat(0, ex.Message).ToString()); } }
/// <summary> /// 汽车年检点列表 /// </summary> /// <param name="pageNo">页号(大于0)</param> /// <param name="pageSize">每页大小(小于20)</param> /// <returns></returns> public string GetCarAnnualCheck(int pageNo, int pageSize) { try { var result = _carLogic.LoadCarAnnualCheck(pageNo, pageSize); var routes = (from it in result select new { Name = it.NAME, Address = it.ADDRESS, Tel = it.TEL }).ToList(); return(new ResultFormat(1, routes).ToString()); } catch (Exception ex) { LogHelper.GetInstance().Error(ex.ToString()); return(new ResultFormat(0, ex.Message).ToString()); } }
/// <summary> /// 按页获取社区通告(标题和内容) /// </summary> /// <param name="community">社区名称</param> /// <param name="pageNo">页号(大于0)</param> /// <param name="pageSize">每页大小(小于20)</param> /// <returns></returns> public string GetCommunityNoticeByPage(string community, int pageNo, int pageSize) { try { var result = _noticeLogic.LoadNotices(community, pageNo, pageSize); var notice = (from it in result select new { Id = it.UUID, Title = it.TITLE, Content = it.CONTENT, ReleaseTime = it.RELEASE_TIME }).ToList(); return(new ResultFormat(1, notice).ToString()); } catch (Exception ex) { LogHelper.GetInstance().Error(ex.ToString()); return(new ResultFormat(0, ex.Message).ToString()); } }
/// <summary> /// 获取停电通知 /// </summary> /// <param name="pageNo">页号(大于0)</param> /// <param name="pageSize">每页大小(小于20)</param> /// <returns></returns> public string GetElectricNotice(int pageNo, int pageSize) { try { var result = _noticeLogic.LoadElectricNotice(pageNo, pageSize); var notice = (from it in result select new { Blackout_time = it.BLACKOUT, Range = it.RANGE1, Line = it.LINE, ReleaseTime = it.RELEASE_TIME }).ToList(); return(new ResultFormat(1, result).ToString()); } catch (Exception ex) { LogHelper.GetInstance().Error(ex.ToString()); return(new ResultFormat(0, ex.Message).ToString()); } }
/// <summary> /// 航班信息 /// </summary> /// <param name="import">进港/出港</param> /// <param name="pageNo">页号(大于0)</param> /// <param name="pageSize">每页大小(小于20)</param> /// <returns></returns> public string GetFlights(bool import, int pageNo, int pageSize) { try { var result = _flightLogic.FindFlightsImport(pageNo, pageSize, import); var flights = (from it in result select new { Address = it.ADDRESS, Flight = it.FLIGHT, DateLimit = it.LIMIT1, Approach = it.PAUSE_ADD, CheckTime = it.CHECK_TIME }).ToList(); return(new ResultFormat(1, flights).ToString()); } catch (Exception ex) { LogHelper.GetInstance().Error(ex.ToString()); return(new ResultFormat(0, ex.Message).ToString()); } }
/// <summary> /// 养老院列表 /// </summary> /// <param name="pageNo">页号(大于0)</param> /// <param name="pageSize">每页大小(小于20)</param> /// <returns></returns> public string GetRetirementHome(int pageNo, int pageSize) { try { var result = _retirementLogic.LoadRetirementHome(pageNo, pageSize); var routes = (from it in result select new { Name = it.NAME, Address = it.ADDRESS, Fanwei = it.FANWEI, Tel = it.TEL, TelR = it.TELR, }).ToList(); return(new ResultFormat(1, routes).ToString()); } catch (Exception ex) { LogHelper.GetInstance().Error(ex.ToString()); return(new ResultFormat(0, ex.Message).ToString()); } }
/// <summary> /// 学前教育 幼儿园列表 /// </summary> /// <param name="pageNo">页号(大于0)</param> /// <param name="pageSize">每页大小(小于20)</param> /// <returns></returns> public string GetChildSchool(int pageNo, int pageSize) { try { var result = _educationLogic.LoadChildSchool(pageNo, pageSize); var routes = (from it in result select new { Name = it.NAME, Address = it.ADDRESS, Tel = it.TEL, Level = it.LEVEL, Url = it.URL }).ToList(); return(new ResultFormat(1, routes).ToString()); } catch (Exception ex) { LogHelper.GetInstance().Error(ex.ToString()); return(new ResultFormat(0, ex.Message).ToString()); } }
/// <summary> /// 汽车维修店列表 /// </summary> /// <param name="pageNo">页号(大于0)</param> /// <param name="pageSize">每页大小(小于20)</param> /// <returns></returns> public string GetCarRepairLocation(int pageNo, int pageSize) { try { var result = _carLogic.LoadCarRepairLocation(pageNo, pageSize); var routes = (from it in result select new { Name = it.NAME, Tel = it.TEL, Type = it.TYPE1, Address = it.ADDRESS, Manager = it.MANAGER }).ToList(); return(new ResultFormat(1, routes).ToString()); } catch (Exception ex) { LogHelper.GetInstance().Error(ex.ToString()); return(new ResultFormat(0, ex.Message).ToString()); } }
/// <summary> /// 获取社区通告标题(最近10条) /// </summary> /// <param name="community">社区名称</param> /// <returns></returns> public string GetCommunityNoticeTitles(string community) { try { var notices = _noticeLogic.LoadNotices(community); if (notices != null) { var result = (from it in notices select new { Id = it.UUID, Title = it.TITLE, ReleaseTime = it.RELEASE_TIME }).ToList(); return(new ResultFormat(1, result).ToString()); } return(new ResultFormat(0, string.Empty).ToString()); } catch (Exception ex) { LogHelper.GetInstance().Error(ex.Message); return(new ResultFormat(0, ex.Message).ToString()); } }
/// <summary> /// 花级酒店 /// </summary> /// <param name="pageNo">页号(大于0)</param> /// <param name="pageSize">每页大小(小于20)</param> /// <returns></returns> public string GetFlowerHotels(int pageNo, int pageSize) { try { var result = _hotelLogic.LoadFlowerHotelList(pageNo, pageSize); var routes = (from it in result select new { Name = it.NAME, Address = it.ADDRESS, Tel = it.TEL, Level = it.LEVEL, BusLine = it.LINE, Content = it.CONTENT }).ToList(); return(new ResultFormat(1, routes).ToString()); } catch (Exception ex) { LogHelper.GetInstance().Error(ex.ToString()); return(new ResultFormat(0, ex.Message).ToString()); } }
/// <summary> /// 按页获取自行车分布记录 /// </summary> /// <param name="pageNo">页号(大于0)</param> /// <param name="pageSize">每页大小(小于20)</param> /// <returns></returns> public string GetBikeLocation(int pageNo, int pageSize) { try { var result = _bikeLocationLogic.LoadBikeLocation(pageNo, pageSize); var bikes = (from it in result select new { Code = it.CODE, Name = it.NAME, Address = it.ADDRESS, Content = it.CONTENT, ReleaseTime = DateTime.Parse(it.RELEASE_TIME).ToString("yyyy-MM-dd"), CheckTime = it.CHECK_TIME }).ToList(); return(new ResultFormat(1, bikes).ToString()); } catch (Exception ex) { LogHelper.GetInstance().Error(ex.ToString()); return(new ResultFormat(0, ex.Message).ToString()); } }
/// <summary> /// 停水通知 /// </summary> /// <param name="pageNo">页号(大于0)</param> /// <param name="pageSize">每页大小(小于20)</param> /// <returns></returns> public string GetWaterNotice(int pageNo, int pageSize) { try { var result = _noticeLogic.LoadWaterNotice(pageNo, pageSize); var notice = (from it in result select new { StartTime = it.START_TIME, EndTime = it.END_TIME, Range = it.RANGE1, Reason = it.REASON, ReleaseTime = it.RELEASE_TIME }).ToList(); return(new ResultFormat(1, notice).ToString()); } catch (Exception ex) { LogHelper.GetInstance().Error(ex.ToString()); return(new ResultFormat(0, ex.Message).ToString()); } }
/// <summary> /// 获取指定id的社区风采内容 /// </summary> /// <param name="fcId">风采Id</param> /// <returns></returns> public string GetCommunityFC(string fcId) { try { var notices = _noticeLogic.LoadSpecificFC(fcId); if (notices != null) { var result = new { Id = notices.UUID, Title = notices.TITLE, Content = notices.CONTENT, ReleaseTime = notices.RELEASE_TIME }; return(new ResultFormat(1, result).ToString()); } return(new ResultFormat(0, string.Empty).ToString()); } catch (Exception ex) { LogHelper.GetInstance().Error(ex.ToString()); return(new ResultFormat(0, ex.Message).ToString()); } }
/// <summary> /// 社区简介 /// </summary> /// <param name="community">社区名称</param> /// <returns></returns> public string GetCommunityIntroduction(string community) { try { var result = _noticeLogic.LoadCommunityIntroduction(community); if (result != null) { // 处理 TelBook var telReset = new List <string>(); foreach (var tel in result.TEL_BOOK.Split('\n')) { string real = tel.Trim(); if (string.IsNullOrWhiteSpace(real)) { continue; } char first = real.ToCharArray().FirstOrDefault(); if (first >= 0x4e00 && first <= 0x9fbb) { // 汉字 telReset.Add(tel); } else { int index = Math.Max(0, telReset.Count - 1); bool isNumber = false; if (!string.IsNullOrWhiteSpace(telReset[index])) { string orignal = telReset[index].TrimEnd(); int length = orignal.Length; isNumber = Char.IsNumber(orignal.ToCharArray().ElementAt(length - 1)); } if (isNumber) { telReset[index] = string.Format("{0}、{1}", telReset[index], real); } else { telReset[index] = telReset + real; } } } result.TEL_BOOK = string.Join("\n", telReset); var introduction = new { Street = result.STREET_NAME, Community = result.COMMUNITY_NAME, Introduction = result.INTRODUCTION, TelBook = result.TEL_BOOK, Address = result.ADDRESS, ZipCode = result.ZIP_CODE }; return(new ResultFormat(1, introduction).ToString()); } return(new ResultFormat(0, "无此社区简介").ToString()); } catch (Exception ex) { LogHelper.GetInstance().Error(ex.ToString()); return(new ResultFormat(0, ex.Message).ToString()); } }