emoticon_api/ARW.Service/Business/BusinessService/Payments/PaymentService.cs
2023-06-02 21:15:33 +08:00

68 lines
2.1 KiB
C#

using Infrastructure.Attribute;
using Microsoft.AspNetCore.Http;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ARW.Model;
using ARW.Repository;
using ARW.Repository.Business.Payments;
using ARW.Service.Business.IBusinessService.Payments;
using ARW.Model.Dto.Business.Payments;
using ARW.Model.Models.Business.Payments;
using ARW.Model.Vo.Business.Payments;
namespace ARW.Service.Business.BusinessService.Payments
{
/// <summary>
/// 支付订单接口实现类
/// </summary>
[AppService(ServiceType = typeof(IPaymentService), ServiceLifetime = LifeTime.Transient)]
public class PaymentServiceImpl : BaseService<Payment>, IPaymentService
{
private readonly PaymentRepository _PaymentRepository;
public PaymentServiceImpl(PaymentRepository PaymentRepository)
{
this._PaymentRepository = PaymentRepository;
}
#region
/// <summary>
/// 查询支付订单列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
public Task<PagedInfo<PaymentVo>> GetPaymentList(PaymentQueryDto parm)
{
//开始拼装查询条件d
var predicate = Expressionable.Create<Payment>();
predicate = predicate.AndIF(parm.PaymentStatus != null, it => it.PaymentStatus == parm.PaymentStatus);
var query = _PaymentRepository
.Queryable()
.Where(predicate.ToExpression())
.Select(s => new PaymentVo
{
PaymentId = s.PaymentId,
PaymentGuid = s.PaymentGuid,
PaymentStatus = s.PaymentStatus,
PaymentMoney = s.PaymentMoney,
PaymentNumber = s.PaymentNumber,
CustomerGuid = s.CustomerGuid,
PaymentBusinessGuid = s.PaymentBusinessGuid,
PaymentBuytype = s.PaymentBuytype,
});
return query.ToPageAsync(parm);
}
#endregion
}
}