PriLoopSetService.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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(IPriLoopSetService), ServiceLifetime = LifeTime.Transient)]
  14. public class PriLoopSetService : BaseService<PriLoopSet>, IPriLoopSetService
  15. {
  16. /// <summary>
  17. /// 递归配置-列表
  18. /// </summary>
  19. /// <param name="listId">配置ID</param>
  20. /// <param name="page">分页参数</param>
  21. /// <returns>列表</returns>
  22. public PagedInfo<GetPriLoopSetListVo> getPriLoopSetList([FromQuery] PagerInfo page, [FromQuery] PriLoopSet param)
  23. {
  24. //拼装查询条件
  25. var predicate = Expressionable.Create<PriLoopSet>();
  26. predicate = predicate.AndIF(param.listId > 0, m => m.listId == param.listId);
  27. var response = Queryable()
  28. .Where(predicate.ToExpression())
  29. .OrderByDescending(m => m.id)
  30. .ToPage<PriLoopSet, GetPriLoopSetListVo>(page);
  31. return response;
  32. }
  33. /// <summary>
  34. /// 递归配置-下拉框数据
  35. /// </summary>
  36. /// <param name="page">分页参数</param>
  37. /// <returns>下拉框数据</returns>
  38. public PagedInfo<GetPriLoopSetDicVo> getPriLoopSetDic([FromQuery] PagerInfo page)
  39. {
  40. //拼装查询条件
  41. var predicate = Expressionable.Create<PriLoopSet>();
  42. var response = Queryable()
  43. .Where(predicate.ToExpression())
  44. .OrderByDescending(m => m.id)
  45. .ToPage<PriLoopSet, GetPriLoopSetDicVo>(page);
  46. return response;
  47. }
  48. }
  49. }