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
{
///
/// 支付订单接口实现类
///
[AppService(ServiceType = typeof(IPaymentService), ServiceLifetime = LifeTime.Transient)]
public class PaymentServiceImpl : BaseService, IPaymentService
{
private readonly PaymentRepository _PaymentRepository;
public PaymentServiceImpl(PaymentRepository PaymentRepository)
{
this._PaymentRepository = PaymentRepository;
}
#region 业务逻辑代码
///
/// 查询支付订单列表
///
///
///
public Task> GetPaymentList(PaymentQueryDto parm)
{
//开始拼装查询条件d
var predicate = Expressionable.Create();
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
}
}