using AutoMapper;
using OASystem.Domain;
using OASystem.Domain.Entities.Groups;
using OASystem.Domain.ViewModels.Financial;
using OASystem.Domain.ViewModels.Groups;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OASystem.Infrastructure.Repositories.Financial
{
///
/// 财务 - 付款信息类
/// 雷怡 2023.08.16 16:19
///
public class CreditCardPaymentRepository : BaseRepository
{
private readonly IMapper _mapper;
public CreditCardPaymentRepository(SqlSugarClient sqlSugar, IMapper mapper)
: base(sqlSugar)
{
_mapper = mapper;
}
///
/// 根据diid查询团组付款信息
///
///
/// false 未支付 true 已支付
///
public async Task GetGroupPaymentInfoByDiid(int diid,bool isPay)
{
Result result = new() { Code = -2 };
int _isPay = 0;
if (isPay) { _isPay = 1; }
string sql = string.Format(@"Select * From Grp_CreditCardPayment Where IsDel=0 And Diid={0} And IsPay={1}", diid, _isPay);
var groupReceivablesList = await _sqlSugar.SqlQueryable(sql).ToListAsync();
result.Code = 0;
result.Msg = "查询成功!";
result.Data = groupReceivablesList;
return result;
}
///
/// 团组 其他款项/退款
///
/// 团组Id
///
///
public async Task GetGroupRefundByDiid(int diid, bool isPay)
{
Result result = new() { Code = -2 };
int _isPay = 0;
if (isPay) { _isPay = 1; }
string sql = string.Format(@"Select * From Grp_CreditCardPayment Where IsDel=0 And Diid={0} And IsPay={1}", diid, _isPay);
var groupReceivablesList = await _sqlSugar.SqlQueryable(sql).ToListAsync();
result.Code = 0;
result.Msg = "查询成功!";
result.Data = groupReceivablesList;
return result;
}
}
}