123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using Attribute;
- using Model;
- using Model.Base;
- using Repository;
- using Service;
- using Microsoft.AspNetCore.Mvc;
- using Vo.Admin;
- namespace Services
- {
- /// <summary>
- /// 奖励项目Service业务层处理
- /// </summary>
- [AppService(ServiceType = typeof(IPriProjectService), ServiceLifetime = LifeTime.Transient)]
- public class PriProjectService : BaseService<PriProject>, IPriProjectService
- {
- /// <summary>
- /// 奖励项目-列表
- /// </summary>
- /// <param name="param">参数请求体</param>
- /// <param name="page">分页参数</param>
- /// <returns>列表</returns>
- public PagedInfo<GetPriProjectListVo> getPriProjectList([FromQuery] PagerInfo page, [FromQuery] PriProject param)
- {
- //拼装查询条件
- var predicate = Expressionable.Create<PriProject>();
- predicate = predicate.AndIF(!string.IsNullOrEmpty(param.projectName), m => m.projectName.Contains(param.projectName));
- predicate = predicate.AndIF(!string.IsNullOrEmpty(param.requestMode), m => m.requestMode.Contains(param.requestMode));
- var response = Queryable()
- .Where(predicate.ToExpression())
- .OrderByDescending(m => m.id)
- .ToPage<PriProject, GetPriProjectListVo>(page);
- return response;
- }
- /// <summary>
- /// 奖励项目-下拉框数据
- /// </summary>
- /// <param name="page">分页参数</param>
- /// <returns>下拉框数据</returns>
- public PagedInfo<GetPriProjectDicVo> getPriProjectDic([FromQuery] PagerInfo page)
- {
- //拼装查询条件
- var predicate = Expressionable.Create<PriProject>();
- var response = Queryable()
- .Where(predicate.ToExpression())
- .OrderByDescending(m => m.id)
- .ToPage<PriProject, GetPriProjectDicVo>(page);
- return response;
- }
- }
- }
|