using CommonHelper; using GasolineBlend.BLL; using SqlSugar; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Web.Mvc; using System.Web.Razor.Tokenizer.Symbols; namespace GasolineBlend.Controllers { public class ArticleDataController : BaseController { private ArticleDataBLL _acc = new ArticleDataBLL(); /// ///获取政策列表数据 /// /// /// /// /// /// [HttpPost] public ActionResult GetArticleDataList(string Platform,string ArticleType, string Scope, string Keyword,int PageNumber,int PageSize,int UserId) { try { var list = _acc.GetArticleDataList(Platform, ArticleType, Scope, Keyword, PageNumber, PageSize, UserId); var response = new { Data = list.Data, TotalCount = list.TotalCount, TotalPages = list.TotalPages }; if (!string.IsNullOrWhiteSpace(Keyword)) { if (UserId == 0) { UserId = -1; } QccSearchInfoBLL qccSearchInfoBll = new QccSearchInfoBLL(); qccSearchInfoBll.AddQccSearchInfo(UserId, Keyword, true,null, 9); } return SuccessNoShow(data: response); } catch (Exception e) { LogHelper.Write(Level.Error, "获取政策列表数据 GetArticleDataList", e, OperatorProvider.Instance.Current == null ? "GuestEx" : OperatorProvider.Instance.Current.LoginName); return Error(); } } /// ///获取收藏政策列表数据 /// /// /// /// /// /// /// /// [HttpPost] public ActionResult GetArticleCollectionList(string Platform, string ArticleType, string Keyword, int PageNumber, int PageSize, int UserId) { try { var list = _acc.GetArticleCollectionList(Platform, ArticleType, Keyword, PageNumber, PageSize, UserId); var response = new { Data = list.Data, TotalCount = list.TotalCount, TotalPages = list.TotalPages }; if (!string.IsNullOrWhiteSpace(Keyword)) { if (UserId == 0) { UserId = -1; } } return SuccessNoShow(data: response); } catch (Exception e) { LogHelper.Write(Level.Error, "获取收藏政策列表数据 GetArticleCollectionList", e, OperatorProvider.Instance.Current == null ? "GuestEx" : OperatorProvider.Instance.Current.LoginName); return Error(); } } /// ///获取市区列表数据 /// /// /// [HttpPost] public ActionResult GetDepartmentDataList(string UserId) { try { var list = _acc.GetDepartmentCollectionList(UserId); return SuccessNoShow(data: list); } catch (Exception e) { LogHelper.Write(Level.Error, "获取收藏部门列表数据 GetDepartmentCollectionList", e, OperatorProvider.Instance.Current == null ? "GuestEx" : OperatorProvider.Instance.Current.LoginName); return Error(); } } /// ///获取政策申报 /// /// /// /// /// /// [HttpPost] public ActionResult GetDeclarationtimeList(string Keyword, int Time, int PageNumber, int PageSize, string Region) { try { var list = _acc.GetDeclarationtimeList(Keyword, Time, PageNumber, PageSize, Region); var response = new { Data = list.Data, TotalCount = list.TotalCount, TotalPages = list.TotalPages }; return SuccessNoShow(data: response); } catch (Exception e) { LogHelper.Write(Level.Error, "获取政策列表数据 GetDeclarationtimeList", e, OperatorProvider.Instance.Current == null ? "GuestEx" : OperatorProvider.Instance.Current.LoginName); return Error(); } } } }