|
|
@ -12,12 +12,12 @@ using DS.Module.SqlSugar;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using DS.Module.UserModule;
|
|
|
|
using DS.Module.UserModule;
|
|
|
|
using DS.Module.Core.Enums;
|
|
|
|
using DS.Module.Core.Enums;
|
|
|
|
using DS.WMS.Core.Invoice.Entity;
|
|
|
|
|
|
|
|
using NPOI.SS.Formula.Functions;
|
|
|
|
using NPOI.SS.Formula.Functions;
|
|
|
|
using DS.WMS.Core.Invoice.Dtos;
|
|
|
|
using DS.WMS.Core.Invoice.Dtos;
|
|
|
|
using DS.WMS.Core.Invoice.Interface;
|
|
|
|
using DS.WMS.Core.Invoice.Interface;
|
|
|
|
using DS.WMS.ContainerManagement.Info.Dtos;
|
|
|
|
using DS.WMS.ContainerManagement.Info.Dtos;
|
|
|
|
using DS.WMS.ContainerManagement.Info.Entity;
|
|
|
|
using DS.WMS.ContainerManagement.Info.Entity;
|
|
|
|
|
|
|
|
using DS.WMS.Core.Fee.Dtos;
|
|
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.Core.Invoice.Method
|
|
|
|
namespace DS.WMS.Core.Invoice.Method
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -26,7 +26,6 @@ namespace DS.WMS.Core.Invoice.Method
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public class InInvoiceService : IInInvoiceService
|
|
|
|
public class InInvoiceService : IInInvoiceService
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//public override TaskBaseTypeEnum AuditType => TaskBaseTypeEnum.APPLICATION_INVOICE_AUDIT;
|
|
|
|
|
|
|
|
private readonly IServiceProvider _serviceProvider;
|
|
|
|
private readonly IServiceProvider _serviceProvider;
|
|
|
|
private readonly ISaasDbService saasService;
|
|
|
|
private readonly ISaasDbService saasService;
|
|
|
|
private readonly IUser user;
|
|
|
|
private readonly IUser user;
|
|
|
@ -50,75 +49,17 @@ namespace DS.WMS.Core.Invoice.Method
|
|
|
|
/// <param name="request"></param>
|
|
|
|
/// <param name="request"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <exception cref="NotImplementedException"></exception>
|
|
|
|
/// <exception cref="NotImplementedException"></exception>
|
|
|
|
public async Task<DataResult<List<GetListOutPut>>> GetListAsync(PageRequest<GetListInput> request)
|
|
|
|
public async Task<DataResult<List<GetInInvoiceListOutPut>>> GetInInvoicetList(PageRequest<GetInInvoicetInput> request)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
var result = await tenantDb.Queryable<InInvoice>()
|
|
|
|
var result = await tenantDb.Queryable<InInvoice>()
|
|
|
|
.Where(t => t.OrgId == user.OrgId)
|
|
|
|
.Where(t => t.OrgId == user.OrgId)
|
|
|
|
.Select(t => new GetListOutPut
|
|
|
|
.Select(t => new GetInInvoiceListOutPut
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Id = t.Id,
|
|
|
|
Id = t.Id,
|
|
|
|
InvoicingDate = t.InvoicingDate,
|
|
|
|
|
|
|
|
InvoiceTypeCode = t.InvoiceTypeCode,
|
|
|
|
},true)
|
|
|
|
InvoiceNumber = t.InvoiceNumber,
|
|
|
|
|
|
|
|
TotalAmount = t.TotalAmount,
|
|
|
|
|
|
|
|
TotalTax = t.TotalTax,
|
|
|
|
|
|
|
|
TotalWithTax = t.TotalWithTax,
|
|
|
|
|
|
|
|
InvoiceStatus = t.InvoiceStatus,
|
|
|
|
|
|
|
|
Invoicer = t.Invoicer,
|
|
|
|
|
|
|
|
OriginalInvoiceNumber = t.OriginalInvoiceNumber,
|
|
|
|
|
|
|
|
BuyerInvoiceName = t.BuyerInvoiceName,
|
|
|
|
|
|
|
|
BuyerInvoiceTaxNumber = t.BuyerInvoiceTaxNumber,
|
|
|
|
|
|
|
|
SellerInvoiceName = t.SellerInvoiceName,
|
|
|
|
|
|
|
|
SellerInvoiceTaxNumber = t.SellerInvoiceTaxNumber,
|
|
|
|
|
|
|
|
IsDetailObtained = t.IsDetailObtained,
|
|
|
|
|
|
|
|
SellerIdentificationNumber = t.SellerIdentificationNumber,
|
|
|
|
|
|
|
|
FinalCheckCode = t.FinalCheckCode,
|
|
|
|
|
|
|
|
BuyerName = t.BuyerName,
|
|
|
|
|
|
|
|
CurrentTime = t.CurrentTime,
|
|
|
|
|
|
|
|
DeductionAmount = t.DeductionAmount,
|
|
|
|
|
|
|
|
VehicleInvoiceTypeCode = t.VehicleInvoiceTypeCode,
|
|
|
|
|
|
|
|
TaxControlCode = t.TaxControlCode,
|
|
|
|
|
|
|
|
BuyerTaxNumber = t.BuyerTaxNumber,
|
|
|
|
|
|
|
|
PaperInvoiceNumber = t.PaperInvoiceNumber,
|
|
|
|
|
|
|
|
Payee = t.Payee,
|
|
|
|
|
|
|
|
ItemFlag = t.ItemFlag,
|
|
|
|
|
|
|
|
InvoiceUnitCode = t.InvoiceUnitCode,
|
|
|
|
|
|
|
|
BuyerBankAccount = t.BuyerBankAccount,
|
|
|
|
|
|
|
|
Amount = t.Amount,
|
|
|
|
|
|
|
|
SellerName = t.SellerName,
|
|
|
|
|
|
|
|
SpecialElements = t.SpecialElements,
|
|
|
|
|
|
|
|
ReimbursementStatus = t.ReimbursementStatus,
|
|
|
|
|
|
|
|
BuyerBankAccountNumber = t.BuyerBankAccountNumber,
|
|
|
|
|
|
|
|
SpecialElementTypeCode = t.SpecialElementTypeCode,
|
|
|
|
|
|
|
|
OperatorCode = t.OperatorCode,
|
|
|
|
|
|
|
|
BuyerAddressPhone = t.BuyerAddressPhone,
|
|
|
|
|
|
|
|
IsPaperInvoice = t.IsPaperInvoice,
|
|
|
|
|
|
|
|
InvoiceRequestNumber = t.InvoiceRequestNumber,
|
|
|
|
|
|
|
|
TaxAmount = t.TaxAmount,
|
|
|
|
|
|
|
|
Remarks = t.Remarks,
|
|
|
|
|
|
|
|
BuyerIdentificationNumber = t.BuyerIdentificationNumber,
|
|
|
|
|
|
|
|
BuyerFullName = t.BuyerFullName,
|
|
|
|
|
|
|
|
SellerTaxNumber = t.SellerTaxNumber,
|
|
|
|
|
|
|
|
InvoiceCode = t.InvoiceCode,
|
|
|
|
|
|
|
|
SellerAddressPhone = t.SellerAddressPhone,
|
|
|
|
|
|
|
|
DetailList = t.DetailList,
|
|
|
|
|
|
|
|
SellerAddressPhoneExtra = t.SellerAddressPhoneExtra,
|
|
|
|
|
|
|
|
SellerBankAccountNumber = t.SellerBankAccountNumber,
|
|
|
|
|
|
|
|
Reviewer = t.Reviewer,
|
|
|
|
|
|
|
|
BuyerAddressPhoneExtra = t.BuyerAddressPhoneExtra,
|
|
|
|
|
|
|
|
SellerFullName = t.SellerFullName,
|
|
|
|
|
|
|
|
MachineCode = t.MachineCode,
|
|
|
|
|
|
|
|
ItemOrServiceName = t.ItemOrServiceName,
|
|
|
|
|
|
|
|
SellerBankAccount = t.SellerBankAccount,
|
|
|
|
|
|
|
|
PdfFilePath = t.PdfFilePath,
|
|
|
|
|
|
|
|
OfdFilePath = t.OfdFilePath,
|
|
|
|
|
|
|
|
XmlFilePath = t.XmlFilePath,
|
|
|
|
|
|
|
|
AllFileDownloadPath = t.AllFileDownloadPath
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.ToQueryPageAsync(request.PageCondition);
|
|
|
|
.ToQueryPageAsync(request.PageCondition);
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
@ -130,15 +71,20 @@ namespace DS.WMS.Core.Invoice.Method
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="request"></param>
|
|
|
|
/// <param name="request"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
public async Task<DataResult<List<InInvoiceDetail>>> GetDetailInfo(PageRequest<GetDetailInfoInput> request)
|
|
|
|
public async Task<DataResult<GetDetailInfo>> GetInInvoicetDetailInfo(GetDetailInfoInput request)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
var result = await tenantDb.Queryable<InInvoiceDetail>()
|
|
|
|
var Data = await tenantDb.Queryable<InInvoice>()
|
|
|
|
.Where(t => t.OrgId == user.OrgId&&t.PId== request.OtherQueryCondition.Id).ToQueryPageAsync(request.PageCondition);
|
|
|
|
.Where(t => t.OrgId == user.OrgId && t.Id == request.Id)
|
|
|
|
return result;
|
|
|
|
.Select(t => new GetDetailInfo()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Id = t.Id
|
|
|
|
|
|
|
|
}, true).FirstAsync();
|
|
|
|
|
|
|
|
if (Data != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Data.Data = tenantDb.Queryable<InInvoiceDetail>().Where(p => p.PId == Data.Id).ToList();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return DataResult<GetDetailInfo>.Success(Data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|