ConsumerOrdersService.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using Attribute;
  2. using Dto;
  3. using Vo;
  4. using Model;
  5. using Model.Base;
  6. using Repository;
  7. using Service;
  8. using Microsoft.AspNetCore.Mvc;
  9. namespace Services
  10. {
  11. /// <summary>
  12. /// 消费记录表Service业务层处理
  13. /// </summary>
  14. [AppService(ServiceType = typeof(IConsumerOrdersService), ServiceLifetime = LifeTime.Transient)]
  15. public class ConsumerOrdersService : BaseService<ConsumerOrders>, IConsumerOrdersService
  16. {
  17. /// <summary>
  18. /// 商户板块-经营数据-获取经营数据详情列表
  19. /// </summary>
  20. /// <param name="parm">请求参数</param>
  21. /// <returns>商户板块经营数据-获取经营数据详情列表</returns>
  22. public PagedInfo<MerchantBussinessModuleGetBussinessInfoDetailListVo> GetBussinessInfoDetailList([FromQuery] PagerInfo page, [FromQuery] MerchantBussinessModuleGetBussinessInfoDetailListDto parm)
  23. {
  24. //开始拼装查询条件
  25. var predicate = Expressionable.Create<ConsumerOrders>();
  26. predicate = predicate.AndIF(parm.MerchantId != null, m => m.MerchantId == parm.MerchantId);
  27. predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.TradeDate), m => m.TradeDate.Contains(parm.TradeDate));
  28. var response = Queryable()
  29. .Where(predicate.ToExpression())
  30. .ToPage<ConsumerOrders, MerchantBussinessModuleGetBussinessInfoDetailListVo>(page);
  31. return response;
  32. }
  33. /// <summary>
  34. /// 消费者板块-我的-订单列表
  35. /// </summary>
  36. /// <param name="parm">请求参数</param>
  37. /// <returns>消费者板块我的-订单列表</returns>
  38. public PagedInfo<ConsumerMySelfModuleGetConsumerOrdersListVo> GetConsumerOrdersList([FromQuery] PagerInfo page, [FromQuery] ConsumerMySelfModuleGetConsumerOrdersListDto parm)
  39. {
  40. //开始拼装查询条件
  41. var predicate = Expressionable.Create<ConsumerOrders>();
  42. predicate = predicate.AndIF(parm.PayMode != null, m => m.PayMode == parm.PayMode);
  43. var response = Queryable()
  44. .Where(predicate.ToExpression())
  45. .ToPage<ConsumerOrders, ConsumerMySelfModuleGetConsumerOrdersListVo>(page);
  46. return response;
  47. }
  48. }
  49. }