|
|
|
@ -5,6 +5,7 @@ using DS.Module.Core.Extensions;
|
|
|
|
|
using DS.WMS.Core.Application.Dtos;
|
|
|
|
|
using DS.WMS.Core.Application.Entity;
|
|
|
|
|
using DS.WMS.Core.Application.Interface;
|
|
|
|
|
using DS.WMS.Core.Code.Entity;
|
|
|
|
|
using DS.WMS.Core.Fee.Dtos;
|
|
|
|
|
using DS.WMS.Core.Fee.Entity;
|
|
|
|
|
using DS.WMS.Core.Info.Entity;
|
|
|
|
@ -292,33 +293,21 @@ namespace DS.WMS.Core.Application.Method
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public async Task<DataResult<PaymentApplicationDto>> GetAsync(long id)
|
|
|
|
|
{
|
|
|
|
|
var dto = await TenantDb.Queryable<PaymentApplication>().LeftJoin<InfoClientBank>((a, b) => a.CustomerBankId == b.Id)
|
|
|
|
|
.Where((a, b) => a.Id == id).Select((a, b) => new PaymentApplicationDto
|
|
|
|
|
var dto = await TenantDb.Queryable<PaymentApplication>()
|
|
|
|
|
.LeftJoin<InfoClientBank>((a, b) => a.CustomerBankId == b.Id)
|
|
|
|
|
.LeftJoin<CodeStlMode>((a, b, c) => a.SettlementTypeId == c.Id)
|
|
|
|
|
.Where((a, b, c) => a.Id == id).Select((a, b, c) => new PaymentApplicationDto
|
|
|
|
|
{
|
|
|
|
|
Id = a.Id,
|
|
|
|
|
ApplicationNO = a.ApplicationNO,
|
|
|
|
|
Currency = a.Currency,
|
|
|
|
|
CustomerId = a.CustomerId,
|
|
|
|
|
CustomerName = a.CustomerName,
|
|
|
|
|
CustomerBankId = a.CustomerBankId,
|
|
|
|
|
CustomerBankName = b.BankAccountNo,
|
|
|
|
|
Status = a.Status,
|
|
|
|
|
CreateTime = a.CreateTime,
|
|
|
|
|
CreateBy = a.CreateBy,
|
|
|
|
|
AmountRMB = a.AmountRMB,
|
|
|
|
|
AmountUSD = a.AmountUSD,
|
|
|
|
|
AmountOther = a.AmountOther,
|
|
|
|
|
SettlementTypeId = a.SettlementTypeId,
|
|
|
|
|
PaymentDate = a.PaymentDate,
|
|
|
|
|
ChequeRemarks = a.ChequeRemarks,
|
|
|
|
|
InvoiceDate = a.InvoiceDate,
|
|
|
|
|
InvoiceAmount = a.InvoiceAmount,
|
|
|
|
|
SaleDeptId = a.SaleDeptId,
|
|
|
|
|
Note = a.Note
|
|
|
|
|
}).FirstAsync();
|
|
|
|
|
CustomerBankName = b.BankName + " " + b.Account,
|
|
|
|
|
SettlementTypeName = c.StlName,
|
|
|
|
|
}, true).FirstAsync();
|
|
|
|
|
|
|
|
|
|
if (dto != null)
|
|
|
|
|
{
|
|
|
|
|
if (dto.SaleDeptId.HasValue)
|
|
|
|
|
dto.SaleDeptName = await Db.Queryable<SysOrg>().Where(x => x.Id == dto.SaleDeptId)
|
|
|
|
|
.Select(x => x.OrgName).FirstAsync();
|
|
|
|
|
|
|
|
|
|
dto.Details = await TenantDb.Queryable<ApplicationDetail>().Where(d => d.ApplicationId == id)
|
|
|
|
|
.InnerJoin<FeeRecord>((d, f) => d.RecordId == f.Id)
|
|
|
|
|
.InnerJoin<BusinessFeeStatus>((d, f, b) => f.BusinessId == b.BusinessId && f.BusinessType == b.BusinessType)
|
|
|
|
|