From d16f7aaf9cb386bc33debc4e6bf91a8f94475fe1 Mon Sep 17 00:00:00 2001 From: douhandong Date: Mon, 21 Oct 2024 14:49:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=93=B6=E8=A1=8C=E6=B5=81?= =?UTF-8?q?=E6=B0=B4=E6=8E=A5=E5=8F=A3,=E8=BF=9B=E9=A1=B9=E5=8F=91?= =?UTF-8?q?=E7=A5=A8=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DS.WMS.Core/Fee/Entity/BankStatement.cs | 6 ++ .../{Invoice => Fee}/Entity/InInvoice.cs | 6 +- .../Entity/InInvoiceDetail.cs | 6 +- .../Invoice/Dtos/BankStatementDto.cs | 68 ++++++++++++++ .../DS.WMS.Core/Invoice/Dtos/InInvoiceDto.cs | 15 +++- .../Interface/IBankStatementService.cs | 34 +++++++ .../Invoice/Interface/IInInvoiceService.cs | 4 +- .../Invoice/Method/BankStatementService.cs | 83 +++++++++++++++++ .../Invoice/Method/InInvoiceService.cs | 88 ++++--------------- .../QuarztJobs/Method/BankStatementService.cs | 2 +- .../QuarztJobs/Method/InInvoiceService.cs | 2 +- .../Controllers/BankStatementController.cs | 48 ++++++++++ .../Controllers/InInvoicetController.cs | 13 ++- 13 files changed, 284 insertions(+), 91 deletions(-) rename ds-wms-service/DS.WMS.Core/{Invoice => Fee}/Entity/InInvoice.cs (99%) rename ds-wms-service/DS.WMS.Core/{Invoice => Fee}/Entity/InInvoiceDetail.cs (98%) create mode 100644 ds-wms-service/DS.WMS.Core/Invoice/Dtos/BankStatementDto.cs create mode 100644 ds-wms-service/DS.WMS.Core/Invoice/Interface/IBankStatementService.cs create mode 100644 ds-wms-service/DS.WMS.Core/Invoice/Method/BankStatementService.cs create mode 100644 ds-wms-service/DS.WMS.FeeApi/Controllers/BankStatementController.cs diff --git a/ds-wms-service/DS.WMS.Core/Fee/Entity/BankStatement.cs b/ds-wms-service/DS.WMS.Core/Fee/Entity/BankStatement.cs index b8fa094c..41649d81 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Entity/BankStatement.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Entity/BankStatement.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Microsoft.VisualBasic; namespace DS.WMS.Core.Fee.Entity { @@ -237,6 +238,11 @@ namespace DS.WMS.Core.Fee.Entity /// public DateTime DataCreateTime { get; set; } + /// + /// 交易时间 + /// + public DateTime PayDataTime { get; set; } + /// /// 机构Id /// diff --git a/ds-wms-service/DS.WMS.Core/Invoice/Entity/InInvoice.cs b/ds-wms-service/DS.WMS.Core/Fee/Entity/InInvoice.cs similarity index 99% rename from ds-wms-service/DS.WMS.Core/Invoice/Entity/InInvoice.cs rename to ds-wms-service/DS.WMS.Core/Fee/Entity/InInvoice.cs index 59d3b3f1..72fc2b68 100644 --- a/ds-wms-service/DS.WMS.Core/Invoice/Entity/InInvoice.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Entity/InInvoice.cs @@ -1,7 +1,7 @@ using DS.Module.Core.Data; using SqlSugar; -namespace DS.WMS.Core.Invoice.Entity +namespace DS.WMS.Core.Fee.Entity { /// /// 进项发票主表 @@ -9,7 +9,7 @@ namespace DS.WMS.Core.Invoice.Entity [SugarTable("invoice_in_info", TableDescription = "进项发票主表")] public class InInvoice : BaseModel { - + /// /// 开票日期 kprq /// @@ -299,7 +299,7 @@ namespace DS.WMS.Core.Invoice.Entity /// 机构Id /// public long OrgId { get; set; } - + } } diff --git a/ds-wms-service/DS.WMS.Core/Invoice/Entity/InInvoiceDetail.cs b/ds-wms-service/DS.WMS.Core/Fee/Entity/InInvoiceDetail.cs similarity index 98% rename from ds-wms-service/DS.WMS.Core/Invoice/Entity/InInvoiceDetail.cs rename to ds-wms-service/DS.WMS.Core/Fee/Entity/InInvoiceDetail.cs index 415f0a0d..8aa87867 100644 --- a/ds-wms-service/DS.WMS.Core/Invoice/Entity/InInvoiceDetail.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Entity/InInvoiceDetail.cs @@ -1,7 +1,7 @@ using DS.Module.Core.Data; using SqlSugar; -namespace DS.WMS.Core.Invoice.Entity +namespace DS.WMS.Core.Fee.Entity { /// /// 进项发票详情表 @@ -9,7 +9,7 @@ namespace DS.WMS.Core.Invoice.Entity [SugarTable("invoice_in_detail", TableDescription = "进项发票详情表")] public class InInvoiceDetail : BaseModel { - + /// /// 主表Id @@ -120,7 +120,7 @@ namespace DS.WMS.Core.Invoice.Entity /// 机构Id /// public long OrgId { get; set; } - + } } diff --git a/ds-wms-service/DS.WMS.Core/Invoice/Dtos/BankStatementDto.cs b/ds-wms-service/DS.WMS.Core/Invoice/Dtos/BankStatementDto.cs new file mode 100644 index 00000000..d0e201b7 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Invoice/Dtos/BankStatementDto.cs @@ -0,0 +1,68 @@ +using DS.WMS.Core.Fee.Entity; +using DS.WMS.Core.Invoice.Entity; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DS.WMS.Core.Invoice.Dtos +{ + + /// + /// 获取银行流水请求参数 + /// + public class GetBankStatementInput + { + /// + /// 银行账户id + /// + public string? AccountId { get; set; } + + /// + /// 交易类型,来账 往账 + /// + public string? BusinessType { get; set; } + /// + /// 银行账号 + /// + public string? PayerAccountNumber { get; set; } + + /// + /// 付款人名称 + /// + public string? PayerName { get; set; } + + /// + /// 交易日期起始 + /// + public DateTime? StartDate { get; set; } + /// + /// 交易期日截止 + /// + public DateTime? EndDate { get; set; } + } + + /// + /// 获取银行流水列表返回参数 + /// + public class GetBankStatementOutPut:BankStatement + { + } + + /// + /// 获取银行账户列表 + /// + public class GetBankAccountListInput + { + + } + + public class GetBankAccountListOutput + { + public string BankName { get; set; } + + public string AccountId { get; set; } + + } +} diff --git a/ds-wms-service/DS.WMS.Core/Invoice/Dtos/InInvoiceDto.cs b/ds-wms-service/DS.WMS.Core/Invoice/Dtos/InInvoiceDto.cs index 3fe25721..fa6c0444 100644 --- a/ds-wms-service/DS.WMS.Core/Invoice/Dtos/InInvoiceDto.cs +++ b/ds-wms-service/DS.WMS.Core/Invoice/Dtos/InInvoiceDto.cs @@ -1,4 +1,5 @@ -using System; +using DS.WMS.Core.Fee.Entity; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -10,7 +11,7 @@ namespace DS.WMS.Core.Invoice.Dtos /// /// 获取进项发票输出实体对象 /// - public class GetListOutPut + public class GetInInvoiceListOutPut { public long Id { get; set; } /// @@ -303,7 +304,7 @@ namespace DS.WMS.Core.Invoice.Dtos /// /// 获取进项发票查询条件 /// - public class GetListInput + public class GetInInvoicetInput { } @@ -312,4 +313,12 @@ namespace DS.WMS.Core.Invoice.Dtos { public long Id { get; set; } } + + public class GetDetailInfo:InInvoice + { + public List Data { get; set; } + + + + } } diff --git a/ds-wms-service/DS.WMS.Core/Invoice/Interface/IBankStatementService.cs b/ds-wms-service/DS.WMS.Core/Invoice/Interface/IBankStatementService.cs new file mode 100644 index 00000000..be965900 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Invoice/Interface/IBankStatementService.cs @@ -0,0 +1,34 @@ +using DS.Module.Core; +using DS.WMS.Core.Application.Entity; +using DS.WMS.Core.Invoice.Dtos; +using DS.WMS.Core.Invoice.Entity; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DS.WMS.Core.Invoice.Interface +{ + + + /// + /// 银行流水相关 + /// + public interface IBankStatementService + { + /// + /// 获取银行流水列表 + /// + /// + /// + Task>> GetBankStatementList(PageRequest request); + + /// + /// 获取银行账号列表 + /// + /// + /// + Task>> GetBankAccountList(); + } +} diff --git a/ds-wms-service/DS.WMS.Core/Invoice/Interface/IInInvoiceService.cs b/ds-wms-service/DS.WMS.Core/Invoice/Interface/IInInvoiceService.cs index 6acc53ff..3c3e8c6e 100644 --- a/ds-wms-service/DS.WMS.Core/Invoice/Interface/IInInvoiceService.cs +++ b/ds-wms-service/DS.WMS.Core/Invoice/Interface/IInInvoiceService.cs @@ -22,13 +22,13 @@ namespace DS.WMS.Core.Invoice.Interface /// /// /// - Task>> GetListAsync(PageRequest request); + Task>> GetInInvoicetList(PageRequest request); /// /// 获取进项发票详细信息 /// /// /// - Task>> GetDetailInfo(PageRequest request); + Task> GetInInvoicetDetailInfo(GetDetailInfoInput request); } } diff --git a/ds-wms-service/DS.WMS.Core/Invoice/Method/BankStatementService.cs b/ds-wms-service/DS.WMS.Core/Invoice/Method/BankStatementService.cs new file mode 100644 index 00000000..68ff2f53 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Invoice/Method/BankStatementService.cs @@ -0,0 +1,83 @@ +using DS.Module.Core; +using DS.Module.Core.Extensions; +using DS.Module.SqlSugar; +using DS.Module.UserModule; +using DS.WMS.Core.Fee.Entity; +using DS.WMS.Core.Invoice.Dtos; +using DS.WMS.Core.Invoice.Entity; +using DS.WMS.Core.Invoice.Interface; +using DS.WMS.Core.TaskPlat.Dtos; +using MathNet.Numerics.Distributions; +using Microsoft.Extensions.DependencyInjection; +using SqlSugar; + +namespace DS.WMS.Core.Invoice.Method +{ + /// + /// 银行流水相关 + /// + public class BankStatementService : IBankStatementService + { + private readonly IServiceProvider _serviceProvider; + private readonly ISaasDbService saasService; + private readonly IUser user; + private readonly ISqlSugarClient db; + /// + /// 初始化 + /// + /// + public BankStatementService(IServiceProvider serviceProvider) + { + _serviceProvider = serviceProvider; + saasService = _serviceProvider.GetRequiredService(); + db = _serviceProvider.GetRequiredService(); + user = _serviceProvider.GetRequiredService(); + } + + /// + /// 获取银行流水列表 + /// + /// + /// + /// + public async Task>> GetBankStatementList(PageRequest request) + { + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + var result = await tenantDb.Queryable() + .Where(t => t.OrgId == user.OrgId) + .WhereIF(!string.IsNullOrWhiteSpace(request.OtherQueryCondition.AccountId), t => t.AccountId == request.OtherQueryCondition.AccountId)//银行账户 + .WhereIF(!string.IsNullOrWhiteSpace(request.OtherQueryCondition.BusinessType), t => t.BusinessType.Contains(request.OtherQueryCondition.BusinessType))//交易类型 + .WhereIF(!string.IsNullOrWhiteSpace(request.OtherQueryCondition.PayerAccountNumber), t => t.BusinessType.Contains(request.OtherQueryCondition.PayerAccountNumber))//付款方银行账户 + .WhereIF(!string.IsNullOrWhiteSpace(request.OtherQueryCondition.PayerName), t => t.BusinessType.Contains(request.OtherQueryCondition.PayerName))//付款人名称 + .WhereIF(request.OtherQueryCondition.StartDate != null, t => t.PayDataTime >= request.OtherQueryCondition.StartDate) + .WhereIF(request.OtherQueryCondition.EndDate != null, t => t.PayDataTime >= request.OtherQueryCondition.EndDate) + .Select(t => new GetBankStatementOutPut + { + Id = t.Id, + },true) + .ToQueryPageAsync(request.PageCondition); + return result; + } + + /// + /// 获取银行账号列表 + /// + /// + /// + public async Task>> GetBankAccountList() + { + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + + var list = tenantDb.Queryable() + .Where(t => t.OrgId == user.OrgId) + .GroupBy(it => new { it.BankName, it.AccountId }) //可以多字段 + .Select(it => new GetBankAccountListOutput + { + BankName = it.BankName, + AccountId = it.AccountId + + }).ToList(); + return DataResult>.Success(list); + } + } +} diff --git a/ds-wms-service/DS.WMS.Core/Invoice/Method/InInvoiceService.cs b/ds-wms-service/DS.WMS.Core/Invoice/Method/InInvoiceService.cs index 8264aecf..0732c2bd 100644 --- a/ds-wms-service/DS.WMS.Core/Invoice/Method/InInvoiceService.cs +++ b/ds-wms-service/DS.WMS.Core/Invoice/Method/InInvoiceService.cs @@ -12,12 +12,12 @@ using DS.Module.SqlSugar; using Microsoft.Extensions.DependencyInjection; using DS.Module.UserModule; using DS.Module.Core.Enums; -using DS.WMS.Core.Invoice.Entity; using NPOI.SS.Formula.Functions; using DS.WMS.Core.Invoice.Dtos; using DS.WMS.Core.Invoice.Interface; using DS.WMS.ContainerManagement.Info.Dtos; using DS.WMS.ContainerManagement.Info.Entity; +using DS.WMS.Core.Fee.Dtos; namespace DS.WMS.Core.Invoice.Method { @@ -26,7 +26,6 @@ namespace DS.WMS.Core.Invoice.Method /// public class InInvoiceService : IInInvoiceService { - //public override TaskBaseTypeEnum AuditType => TaskBaseTypeEnum.APPLICATION_INVOICE_AUDIT; private readonly IServiceProvider _serviceProvider; private readonly ISaasDbService saasService; private readonly IUser user; @@ -50,75 +49,17 @@ namespace DS.WMS.Core.Invoice.Method /// /// /// - public async Task>> GetListAsync(PageRequest request) + public async Task>> GetInInvoicetList(PageRequest request) { var tenantDb = saasService.GetBizDbScopeById(user.TenantId); var result = await tenantDb.Queryable() .Where(t => t.OrgId == user.OrgId) - .Select(t => new GetListOutPut + .Select(t => new GetInInvoiceListOutPut { Id = t.Id, - InvoicingDate = t.InvoicingDate, - InvoiceTypeCode = t.InvoiceTypeCode, - 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 - - - }) + + },true) .ToQueryPageAsync(request.PageCondition); return result; @@ -130,15 +71,20 @@ namespace DS.WMS.Core.Invoice.Method /// /// /// - public async Task>> GetDetailInfo(PageRequest request) + public async Task> GetInInvoicetDetailInfo(GetDetailInfoInput request) { var tenantDb = saasService.GetBizDbScopeById(user.TenantId); - var result = await tenantDb.Queryable() - .Where(t => t.OrgId == user.OrgId&&t.PId== request.OtherQueryCondition.Id).ToQueryPageAsync(request.PageCondition); - return result; - + var Data = await tenantDb.Queryable() + .Where(t => t.OrgId == user.OrgId && t.Id == request.Id) + .Select(t => new GetDetailInfo() + { + Id = t.Id + }, true).FirstAsync(); + if (Data != null) + { + Data.Data = tenantDb.Queryable().Where(p => p.PId == Data.Id).ToList(); + } + return DataResult.Success(Data); } - } - } diff --git a/ds-wms-service/DS.WMS.Core/QuarztJobs/Method/BankStatementService.cs b/ds-wms-service/DS.WMS.Core/QuarztJobs/Method/BankStatementService.cs index c86846a5..6b7b72ac 100644 --- a/ds-wms-service/DS.WMS.Core/QuarztJobs/Method/BankStatementService.cs +++ b/ds-wms-service/DS.WMS.Core/QuarztJobs/Method/BankStatementService.cs @@ -128,7 +128,7 @@ namespace DS.WMS.Core.QuarztJobs.Method bs.NameOfNominalPayee = itemdata.NameOfNominalPayee; bs.FilePaths = itemdata.FilePaths; bs.DataCreateTime = itemdata.CreateTime; - + bs.PayDataTime = ( Convert.ToDateTime( $"{itemdata.TransactionDate} {itemdata.TransactionTime}")); //交易时间 bs.CreateTime = DateTime.Now; //await tenantDb.Insertable(bs).ExecuteCommandAsync(); datalist.Add(bs); diff --git a/ds-wms-service/DS.WMS.Core/QuarztJobs/Method/InInvoiceService.cs b/ds-wms-service/DS.WMS.Core/QuarztJobs/Method/InInvoiceService.cs index 5d27fe1f..00d3ee1b 100644 --- a/ds-wms-service/DS.WMS.Core/QuarztJobs/Method/InInvoiceService.cs +++ b/ds-wms-service/DS.WMS.Core/QuarztJobs/Method/InInvoiceService.cs @@ -1,4 +1,4 @@ -using DS.WMS.Core.Invoice.Entity; +using DS.WMS.Core.Fee.Entity; using DS.WMS.Core.QuarztJobs.Dtos; using DS.WMS.Core.QuarztJobs.Interface; using DS.WMS.Core.QuarztJobs.Other; diff --git a/ds-wms-service/DS.WMS.FeeApi/Controllers/BankStatementController.cs b/ds-wms-service/DS.WMS.FeeApi/Controllers/BankStatementController.cs new file mode 100644 index 00000000..53fa29b9 --- /dev/null +++ b/ds-wms-service/DS.WMS.FeeApi/Controllers/BankStatementController.cs @@ -0,0 +1,48 @@ +using DS.Module.Core; +using DS.WMS.Core.Invoice.Dtos; +using DS.WMS.Core.Invoice.Interface; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; + +namespace DS.WMS.FeeApi.Controllers +{ + /// + /// 银行流水相关 + /// + public class BankStatementController : ApiController + { + readonly IBankStatementService _BankStatement; + + /// + /// 初始化 + /// + /// + public BankStatementController(IBankStatementService bankStatement) + { + _BankStatement = bankStatement; + } + + /// + /// 获取银行流水列表 + /// + /// + /// + [HttpPost, Route("GetBankStatementList")] + public async Task>> GetBankStatementList(PageRequest model) + { + return await _BankStatement.GetBankStatementList(model); + } + + /// + /// 获取银行账号列表 + /// + /// + /// + [HttpPost, Route("GetBankAccountList")] + public async Task>> GetBankAccountList() + { + return await _BankStatement.GetBankAccountList(); + } + } +} + diff --git a/ds-wms-service/DS.WMS.FeeApi/Controllers/InInvoicetController.cs b/ds-wms-service/DS.WMS.FeeApi/Controllers/InInvoicetController.cs index de08d1e3..88c477b1 100644 --- a/ds-wms-service/DS.WMS.FeeApi/Controllers/InInvoicetController.cs +++ b/ds-wms-service/DS.WMS.FeeApi/Controllers/InInvoicetController.cs @@ -25,16 +25,15 @@ namespace DS.WMS.FeeApi.Controllers _ininvoice = InvoiceService; } - /// /// 获取进项发票列表 /// /// /// - [HttpPost, Route("GetList")] - public async Task>> GetList(PageRequest model) + [HttpPost, Route("GetInInvoicet")] + public async Task>> GetInInvoicetList(PageRequest model) { - return await _ininvoice.GetListAsync(model); + return await _ininvoice.GetInInvoicetList(model); } /// @@ -42,10 +41,10 @@ namespace DS.WMS.FeeApi.Controllers /// /// /// - [HttpPost, Route("GetDetailInfo")] - public async Task>> GetDetailInfo(PageRequest model) + [HttpPost, Route("GetInInvoicetDetail")] + public async Task> GetInInvoicetDetailInfo(GetDetailInfoInput model) { - return await _ininvoice.GetDetailInfo(model); + return await _ininvoice.GetInInvoicetDetailInfo(model); } } }