123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- 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(IPriListService), ServiceLifetime = LifeTime.Transient)]
- public class PriListService : BaseService<PriList>, IPriListService
- {
- /// <summary>
- /// 奖励配置-列表
- /// </summary>
- /// <param name="param">参数请求体</param>
- /// <param name="page">分页参数</param>
- /// <returns>列表</returns>
- public PagedInfo<GetPriListListVo> getPriListList([FromQuery] PagerInfo page, [FromQuery] PriList param)
- {
- //拼装查询条件
- var predicate = Expressionable.Create<PriList>();
- predicate = predicate.AndIF(param.projectId > 0, m => m.projectId == param.projectId);
- predicate = predicate.AndIF(!string.IsNullOrEmpty(param.prizeName), m => m.prizeName.Contains(param.prizeName));
- predicate = predicate.AndIF(!string.IsNullOrEmpty(param.conditionMode), m => m.conditionMode.Contains(param.conditionMode));
- predicate = predicate.AndIF(!string.IsNullOrEmpty(param.prizeContent), m => m.prizeContent.Contains(param.prizeContent));
- var response = Queryable()
- .Where(predicate.ToExpression())
- .OrderBy(m => m.kind)
- .OrderByDescending(m => m.id)
- .ToPage<PriList, GetPriListListVo>(page);
- return response;
- }
- /// <summary>
- /// 奖励配置-下拉框数据
- /// </summary>
- /// <param name="page">分页参数</param>
- /// <returns>下拉框数据</returns>
- public PagedInfo<GetPriListDicVo> getPriListDic([FromQuery] PagerInfo page)
- {
- //拼装查询条件
- var predicate = Expressionable.Create<PriList>();
- var response = Queryable()
- .Where(predicate.ToExpression())
- .OrderByDescending(m => m.id)
- .ToPage<PriList, GetPriListDicVo>(page);
- return response;
- }
- }
- }
|