|
|
|
@ -1,6 +1,7 @@ |
|
|
|
using Microsoft.AspNetCore.Authorization; |
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
using Shentun.Peis.ChargeAsbitems; |
|
|
|
using Shentun.Peis.ChargePays; |
|
|
|
using Shentun.Peis.Models; |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
@ -22,12 +23,15 @@ namespace Shentun.Peis.ChargeBackPays |
|
|
|
public class ChargeBackPayAppService : ApplicationService |
|
|
|
{ |
|
|
|
private readonly IRepository<ChargeBackPay> _chargeBackPayRepository; |
|
|
|
private readonly IRepository<CardBill, Guid> _cardBillRepository; |
|
|
|
|
|
|
|
public ChargeBackPayAppService( |
|
|
|
IRepository<ChargeBackPay> chargeBackPayRepository |
|
|
|
IRepository<ChargeBackPay> chargeBackPayRepository, |
|
|
|
IRepository<CardBill, Guid> cardBillRepository |
|
|
|
) |
|
|
|
{ |
|
|
|
this._chargeBackPayRepository = chargeBackPayRepository; |
|
|
|
this._cardBillRepository = cardBillRepository; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -38,18 +42,33 @@ namespace Shentun.Peis.ChargeBackPays |
|
|
|
[HttpGet("api/app/chargebackpay/getchargebackpayinchargebackid")] |
|
|
|
public async Task<List<ChargeBackPayDto>> GetChargeBackPayInChargeBackIdAsync(Guid ChargeBackId) |
|
|
|
{ |
|
|
|
var chargeBackPayList = await _chargeBackPayRepository.GetListAsync(m => m.ChargeBackId == ChargeBackId); |
|
|
|
Guid? guidNull = null; |
|
|
|
|
|
|
|
var chargeBackPayList = from a in (await _chargeBackPayRepository.GetQueryableAsync()) |
|
|
|
join b in (await _cardBillRepository.GetQueryableAsync()) on a.CardBillId equals b.Id into bb |
|
|
|
from ab in bb.DefaultIfEmpty() |
|
|
|
where a.ChargeBackId == ChargeBackId |
|
|
|
select new |
|
|
|
{ |
|
|
|
ChargeBackId = a.ChargeBackId, |
|
|
|
CardBillId = a.CardBillId, |
|
|
|
BackMoeny = a.BackMoeny, |
|
|
|
PayModeId = a.PayModeId, |
|
|
|
CardRegisterId = ab != null ? ab.CardRegisterId : guidNull, |
|
|
|
}; |
|
|
|
|
|
|
|
var entlistdto = chargeBackPayList.Select(s => new ChargeBackPayDto |
|
|
|
{ |
|
|
|
BackMoeny = s.BackMoeny, |
|
|
|
ChargeBackId = s.ChargeBackId, |
|
|
|
CardBillId = s.CardBillId, |
|
|
|
PayModeId = s.PayModeId |
|
|
|
PayModeId = s.PayModeId, |
|
|
|
CardRegisterId = s.CardRegisterId |
|
|
|
}).ToList(); |
|
|
|
|
|
|
|
return entlistdto; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |