cjy 1 month ago
commit 5519249f58

@ -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
/// </summary>
public DateTime DataCreateTime { get; set; }
/// <summary>
/// 交易时间
/// </summary>
public DateTime PayDataTime { get; set; }
/// <summary>
/// 机构Id
/// </summary>

@ -1,7 +1,7 @@
using DS.Module.Core.Data;
using SqlSugar;
namespace DS.WMS.Core.Invoice.Entity
namespace DS.WMS.Core.Fee.Entity
{
/// <summary>
/// 进项发票主表
@ -9,7 +9,7 @@ namespace DS.WMS.Core.Invoice.Entity
[SugarTable("invoice_in_info", TableDescription = "进项发票主表")]
public class InInvoice : BaseModel<long>
{
/// <summary>
/// 开票日期 kprq
/// </summary>
@ -299,7 +299,7 @@ namespace DS.WMS.Core.Invoice.Entity
/// 机构Id
/// </summary>
public long OrgId { get; set; }
}
}

@ -1,7 +1,7 @@
using DS.Module.Core.Data;
using SqlSugar;
namespace DS.WMS.Core.Invoice.Entity
namespace DS.WMS.Core.Fee.Entity
{
/// <summary>
/// 进项发票详情表
@ -9,7 +9,7 @@ namespace DS.WMS.Core.Invoice.Entity
[SugarTable("invoice_in_detail", TableDescription = "进项发票详情表")]
public class InInvoiceDetail : BaseModel<long>
{
/// <summary>
/// 主表Id
@ -120,7 +120,7 @@ namespace DS.WMS.Core.Invoice.Entity
/// 机构Id
/// </summary>
public long OrgId { get; set; }
}
}

@ -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
{
/// <summary>
/// 获取银行流水请求参数
/// </summary>
public class GetBankStatementInput
{
/// <summary>
/// 银行账户id
/// </summary>
public string? AccountId { get; set; }
/// <summary>
/// 交易类型,来账 往账
/// </summary>
public string? BusinessType { get; set; }
/// <summary>
/// 银行账号
/// </summary>
public string? PayerAccountNumber { get; set; }
/// <summary>
/// 付款人名称
/// </summary>
public string? PayerName { get; set; }
/// <summary>
/// 交易日期起始
/// </summary>
public DateTime? StartDate { get; set; }
/// <summary>
/// 交易期日截止
/// </summary>
public DateTime? EndDate { get; set; }
}
/// <summary>
/// 获取银行流水列表返回参数
/// </summary>
public class GetBankStatementOutPut:BankStatement
{
}
/// <summary>
/// 获取银行账户列表
/// </summary>
public class GetBankAccountListInput
{
}
public class GetBankAccountListOutput
{
public string BankName { get; set; }
public string AccountId { get; set; }
}
}

@ -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
/// <summary>
/// 获取进项发票输出实体对象
/// </summary>
public class GetListOutPut
public class GetInInvoiceListOutPut
{
public long Id { get; set; }
/// <summary>
@ -303,7 +304,7 @@ namespace DS.WMS.Core.Invoice.Dtos
/// <summary>
/// 获取进项发票查询条件
/// </summary>
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<InInvoiceDetail> Data { get; set; }
}
}

@ -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
{
/// <summary>
/// 银行流水相关
/// </summary>
public interface IBankStatementService
{
/// <summary>
/// 获取银行流水列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Task<DataResult<List<GetBankStatementOutPut>>> GetBankStatementList(PageRequest<GetBankStatementInput> request);
/// <summary>
/// 获取银行账号列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Task<DataResult<List<GetBankAccountListOutput>>> GetBankAccountList();
}
}

@ -22,13 +22,13 @@ namespace DS.WMS.Core.Invoice.Interface
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Task<DataResult<List<GetListOutPut>>> GetListAsync(PageRequest<GetListInput> request);
Task<DataResult<List<GetInInvoiceListOutPut>>> GetInInvoicetList(PageRequest<GetInInvoicetInput> request);
/// <summary>
/// 获取进项发票详细信息
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Task<DataResult<List<InInvoiceDetail>>> GetDetailInfo(PageRequest<GetDetailInfoInput> request);
Task<DataResult<GetDetailInfo>> GetInInvoicetDetailInfo(GetDetailInfoInput request);
}
}

@ -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
{
/// <summary>
/// 银行流水相关
/// </summary>
public class BankStatementService : IBankStatementService
{
private readonly IServiceProvider _serviceProvider;
private readonly ISaasDbService saasService;
private readonly IUser user;
private readonly ISqlSugarClient db;
/// <summary>
/// 初始化
/// </summary>
/// <param name="serviceProvider"></param>
public BankStatementService(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
db = _serviceProvider.GetRequiredService<ISqlSugarClient>();
user = _serviceProvider.GetRequiredService<IUser>();
}
/// <summary>
/// 获取银行流水列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
public async Task<DataResult<List<GetBankStatementOutPut>>> GetBankStatementList(PageRequest<GetBankStatementInput> request)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var result = await tenantDb.Queryable<BankStatement>()
.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;
}
/// <summary>
/// 获取银行账号列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public async Task<DataResult<List<GetBankAccountListOutput>>> GetBankAccountList()
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var list = tenantDb.Queryable<BankStatement>()
.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<List<GetBankAccountListOutput>>.Success(list);
}
}
}

@ -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
/// </summary>
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
/// <param name="request"></param>
/// <returns></returns>
/// <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 result = await tenantDb.Queryable<InInvoice>()
.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
/// </summary>
/// <param name="request"></param>
/// <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 result = await tenantDb.Queryable<InInvoiceDetail>()
.Where(t => t.OrgId == user.OrgId&&t.PId== request.OtherQueryCondition.Id).ToQueryPageAsync(request.PageCondition);
return result;
var Data = await tenantDb.Queryable<InInvoice>()
.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<InInvoiceDetail>().Where(p => p.PId == Data.Id).ToList();
}
return DataResult<GetDetailInfo>.Success(Data);
}
}
}

@ -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);

@ -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;

@ -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
{
/// <summary>
/// 银行流水相关
/// </summary>
public class BankStatementController : ApiController
{
readonly IBankStatementService _BankStatement;
/// <summary>
/// 初始化
/// </summary>
/// <param name="auditService"></param>
public BankStatementController(IBankStatementService bankStatement)
{
_BankStatement = bankStatement;
}
/// <summary>
/// 获取银行流水列表
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost, Route("GetBankStatementList")]
public async Task<DataResult<List<GetBankStatementOutPut>>> GetBankStatementList(PageRequest<GetBankStatementInput> model)
{
return await _BankStatement.GetBankStatementList(model);
}
/// <summary>
/// 获取银行账号列表
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost, Route("GetBankAccountList")]
public async Task<DataResult<List<GetBankAccountListOutput>>> GetBankAccountList()
{
return await _BankStatement.GetBankAccountList();
}
}
}

@ -25,16 +25,15 @@ namespace DS.WMS.FeeApi.Controllers
_ininvoice = InvoiceService;
}
/// <summary>
/// 获取进项发票列表
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost, Route("GetList")]
public async Task<DataResult<List<GetListOutPut>>> GetList(PageRequest<GetListInput> model)
[HttpPost, Route("GetInInvoicet")]
public async Task<DataResult<List<GetInInvoiceListOutPut>>> GetInInvoicetList(PageRequest<GetInInvoicetInput> model)
{
return await _ininvoice.GetListAsync(model);
return await _ininvoice.GetInInvoicetList(model);
}
/// <summary>
@ -42,10 +41,10 @@ namespace DS.WMS.FeeApi.Controllers
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost, Route("GetDetailInfo")]
public async Task<DataResult<List<InInvoiceDetail>>> GetDetailInfo(PageRequest<GetDetailInfoInput> model)
[HttpPost, Route("GetInInvoicetDetail")]
public async Task<DataResult<GetDetailInfo>> GetInInvoicetDetailInfo(GetDetailInfoInput model)
{
return await _ininvoice.GetDetailInfo(model);
return await _ininvoice.GetInInvoicetDetailInfo(model);
}
}
}

Loading…
Cancel
Save