PriPrizeInTableService.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using Attribute;
  2. using Model;
  3. using Model.Base;
  4. using Repository;
  5. using Service;
  6. using Microsoft.AspNetCore.Mvc;
  7. using Vo.Admin;
  8. namespace Services
  9. {
  10. /// <summary>
  11. /// 奖励入库表Service业务层处理
  12. /// </summary>
  13. [AppService(ServiceType = typeof(IPriPrizeInTableService), ServiceLifetime = LifeTime.Transient)]
  14. public class PriPrizeInTableService : BaseService<PriPrizeInTable>, IPriPrizeInTableService
  15. {
  16. /// <summary>
  17. /// 奖励入库表-列表
  18. /// </summary>
  19. /// <param name="param">参数请求体</param>
  20. /// <param name="page">分页参数</param>
  21. /// <returns>列表</returns>
  22. public PagedInfo<GetPriPrizeInTableListVo> getPriPrizeInTableList([FromQuery] PagerInfo page, [FromQuery] PriPrizeInTable param)
  23. {
  24. //拼装查询条件
  25. var predicate = Expressionable.Create<PriPrizeInTable>();
  26. predicate = predicate.AndIF(param.listId > 0, m => m.listId == param.listId);
  27. predicate = predicate.AndIF(!string.IsNullOrEmpty(param.tableEnName), m => m.tableEnName.Contains(param.tableEnName));
  28. predicate = predicate.AndIF(!string.IsNullOrEmpty(param.excuteKind), m => m.excuteKind.Contains(param.excuteKind));
  29. var response = Queryable()
  30. .Where(predicate.ToExpression())
  31. .OrderByDescending(m => m.id)
  32. .ToPage<PriPrizeInTable, GetPriPrizeInTableListVo>(page);
  33. return response;
  34. }
  35. /// <summary>
  36. /// 奖励入库表-下拉框数据
  37. /// </summary>
  38. /// <param name="page">分页参数</param>
  39. /// <returns>下拉框数据</returns>
  40. public PagedInfo<GetPriPrizeInTableDicVo> getPriPrizeInTableDic([FromQuery] PagerInfo page)
  41. {
  42. //拼装查询条件
  43. var predicate = Expressionable.Create<PriPrizeInTable>();
  44. var response = Queryable()
  45. .Where(predicate.ToExpression())
  46. .OrderByDescending(m => m.id)
  47. .ToPage<PriPrizeInTable, GetPriPrizeInTableDicVo>(page);
  48. return response;
  49. }
  50. }
  51. }