cjy 1 month ago
commit 0fa1d1dabd

@ -705,6 +705,9 @@ public static class MultiLanguageConst
[Description("税率不一致,禁止提交")]
public const string InconsistentTaxRates= "Inconsistent_Tax_Rates";
[Description("发票或其明细已进入结算流程,请先取消结算后再删除")]
public const string InvoiceIsSettled = "Invoice_Is_Settled";
#endregion
#region 预订舱API

@ -51,6 +51,11 @@ namespace DS.WMS.Core.Application.Dtos
/// </summary>
public long CustomerId { get; set; }
/// <summary>
/// 费用对象名称
/// </summary>
public string? CustomerName { get; set; }
/// <summary>
/// 汇率信息
/// </summary>

@ -1,8 +1,7 @@
using DS.WMS.Core.Application.Dtos;
using System.Linq.Expressions;
using DS.WMS.Core.Application.Dtos;
using DS.WMS.Core.Application.Entity;
using DS.WMS.Core.Code.Entity;
using DS.WMS.Core.Fee.Entity;
using System.Linq.Expressions;
using DS.WMS.Core.Fee.Method;
using DS.WMS.Core.Op.Entity;
using SqlSugar;
@ -35,8 +34,7 @@ namespace DS.WMS.Core.Application.Method
.InnerJoin<FeeRecord>((d, f) => d.RecordId == f.Id)
.LeftJoin<SeaExport>((d, f, s) => f.BusinessId == s.Id && f.BusinessType == BusinessType.OceanShippingExport)
.WhereIF(expr1 != null, expr1)
.LeftJoin<CodeSource>((d, f, s, cs) => s.SourceId == cs.Id)
.Select((d, f, s, cs) => new ApplicationDetailDto
.Select((d, f, s) => new ApplicationDetailDto
{
//---------------明细表--------------
Id = d.Id,
@ -45,7 +43,6 @@ namespace DS.WMS.Core.Application.Method
RefId = d.RefId,
RecordId = d.RecordId,
FeeType = d.FeeType,
CustomerName = d.CustomerName,
FeeId = d.FeeId,
FeeName = d.FeeName,
Currency = d.Currency,
@ -60,30 +57,30 @@ namespace DS.WMS.Core.Application.Method
Amount = f.Amount,
AccTaxRate = f.AccTaxRate,
CustomerId = f.CustomerId,//费用对象ID
CustomerName = f.CustomerName,
OrderAmount = f.OrderAmount,
InvoiceAmount = f.InvoiceAmount,
SettlementAmount = f.SettlementAmount,
OrderSettlementAmount = f.OrderSettlementAmount,
OrderInvSettlementAmount = f.OrderInvSettlementAmount,
BusinessId = f.BusinessId,
BusinessType = f.BusinessType,
//---------------业务表--------------
BusinessId = s.Id,
BusinessType = BusinessType.OceanShippingExport,
AccountDate = s.AccountDate,
CntrTotal = s.CntrTotal,
CustomerNo = s.CustomerNo,
ClientName = s.CustomerName, //委托单位
//DischargePort = s.DischargePort,
ETD = s.ETD,
HBLNO = s.HBLNO,
LoadPort = s.LoadPort,
//DischargePort = s.DischargePort,
MBLNO = s.MBLNO,
SaleDeptId = s.SaleDeptId,
SaleName = s.Sale,//揽货人
Vessel = s.Vessel,//船名
Voyage = s.Voyno,//航次
BookingNo = s.BookingNo,
//---------------附加表--------------
SourceName = cs.SourceName
SourceName = s.SourceName
});
//海运进口

@ -0,0 +1,555 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.HangfireJob.Dtos
{
public class InInvoiceModel
{
}
/// <summary>
/// 请求获取进项发票接口参数
/// </summary>
public class InInvoicePost
{
/// <summary>
/// 开票时间查询起始时间(查询条件 格式yyyy-MM-dd HH:mm:ss)
/// </summary>
public string kprqks { get; set; }
/// <summary>
/// 开票时间查询结束时间(查询条件 格式yyyy-MM-dd HH:mm:ss)
/// </summary>
public string kprqjs { get; set; }
}
/// <summary>
/// 请求获取发票详情接口请求参数
/// </summary>
public class GetInInvoiceDataInfo
{
/// <summary>
/// 发票号码
/// </summary>
public string fphm { get; set; }
}
public class InInvoicePostOutput
{
public int code { get; set; }
public bool success { get; set; }
public string msg { get; set; }
public object msgDev { get; set; }
public InInvoicePostOutputList Data { get; set; }
}
public class InInvoicePostOutputList
{
public List<Datum> data { get; set; }
public int dataCount { get; set; }
public int pageIndex { get; set; }
public int pageCount { get; set; }
public int pageSize { get; set; }
}
public class Datum
{
/// <summary>
/// 开票日期
/// </summary>
public string kprq { get; set; }
/// <summary>
/// 发票类型代码
/// </summary>
public string fplxdm { get; set; }
/// <summary>
/// 发票号码
/// </summary>
public string fphm { get; set; }
/// <summary>
/// 合计金额
/// </summary>
public string hjje { get; set; }
/// <summary>
/// 合计税额
/// </summary>
public string hjse { get; set; }
/// <summary>
/// 价税合计
/// </summary>
public string jshj { get; set; }
/// <summary>
/// 发票状态
/// </summary>
public string fpzt { get; set; }
/// <summary>
/// 开票人
/// </summary>
public string kpr { get; set; }
/// <summary>
/// 原发票号码
/// </summary>
public string yfphm { get; set; }
/// <summary>
/// 购方开票名称
/// </summary>
public string gfkpmc { get; set; }
/// <summary>
/// 购方开票税号
/// </summary>
public string gfkpsh { get; set; }
/// <summary>
/// 销方开票名称
/// </summary>
public string xfkpmc { get; set; }
/// <summary>
/// 销方开票税号
/// </summary>
public string xfkpsh { get; set; }
/// <summary>
/// 是否已获取详情
/// </summary>
public bool IsGetDtl { get; set; }
/// <summary>
/// 销方识别号
/// </summary>
public string xfsbh { get; set; }
/// <summary>
/// 最终校验码
/// </summary>
public string final_jym { get; set; }
/// <summary>
/// 购方名称
/// </summary>
public string gfmc { get; set; }
/// <summary>
/// 当前时间,销项是入库时间,进项是开票时间
/// </summary>
public string dqsj { get; set; }
/// <summary>
/// 扣除额
/// </summary>
public float kce { get; set; }
/// <summary>
/// 机动车发票类型代码
/// </summary>
public string jdfplxdm { get; set; }
/// <summary>
/// 税控码
/// </summary>
public string skm { get; set; }
/// <summary>
/// 购方税号
/// </summary>
public string ghdwdm { get; set; }
/// <summary>
/// 纸质发票号码
/// </summary>
public string zzfphm { get; set; }
/// <summary>
/// 收款人
/// </summary>
public string skr { get; set; }
/// <summary>
/// 清单标志
/// </summary>
public string qdbz { get; set; }
/// <summary>
/// 开票单位代码
/// </summary>
public string kpdwdm { get; set; }
/// <summary>
/// 购方银行账户
/// </summary>
public string ghdwyhzh { get; set; }
/// <summary>
/// 金额
/// </summary>
public float je { get; set; }
/// <summary>
/// 销方名称
/// </summary>
public string xfmc { get; set; }
/// <summary>
/// 特定要素,目前是货物运输和旅客运输
/// </summary>
public string tdys { get; set; }
/// <summary>
/// 报销状态
/// </summary>
public string bxzt { get; set; }
/// <summary>
/// 购方银行账号
/// </summary>
public string gfyhzh { get; set; }
/// <summary>
/// 特定要素类型代码
/// </summary>
public string tdyslxDm { get; set; }
/// <summary>
/// 操作员代码
/// </summary>
public string czydm { get; set; }
/// <summary>
/// 购方地址电话
/// </summary>
public string ghdwdzdh { get; set; }
/// <summary>
/// 是否为纸质发票1 是0 否
/// </summary>
public string sfwzzfp { get; set; }
/// <summary>
/// 发票请求流水号
/// </summary>
public string fpqqlsh { get; set; }
/// <summary>
/// 税额
/// </summary>
public string se { get; set; }
/// <summary>
/// 备注
/// </summary>
public string bz { get; set; }
/// <summary>
/// 购方识别号
/// </summary>
public string gfsbh { get; set; }
/// <summary>
/// 购方名称
/// </summary>
public string ghdwmc { get; set; }
/// <summary>
/// 销方税号
/// </summary>
public string xhdwdm { get; set; }
/// <summary>
/// 发票代码
/// </summary>
public string fpdm { get; set; }
/// <summary>
/// 销方地址电话
/// </summary>
public string xhdwdzdh { get; set; }
/// <summary>
/// 明细列表
/// </summary>
public string zbmx { get; set; }
/// <summary>
/// 销方地址电话
/// </summary>
public string xddzdh { get; set; }
/// <summary>
/// 销方银行账号
/// </summary>
public string xfyhzh { get; set; }
/// <summary>
/// 复核人
/// </summary>
public string fhr { get; set; }
/// <summary>
/// 购方地址电话
/// </summary>
public string gfdzdh { get; set; }
/// <summary>
/// 销方名称
/// </summary>
public string xhdwmc { get; set; }
/// <summary>
/// 机器编号
/// </summary>
public string jqbh { get; set; }
/// <summary>
/// 商品或服务名称
/// </summary>
public string zyspmc { get; set; }
/// <summary>
/// 销方银行账户
/// </summary>
public string xhdwyhzh { get; set; }
public string PDFfile { get; set; }
public string OFDfile { get; set; }
public string XMLfile { get; set; }
public string Allfile { get; set; }
/// <summary>
/// 状态1未使用,2正在报销,3已报销
/// </summary>
public int State { get; set; }
/// <summary>
/// 钉钉报销审批单编号
/// </summary>
public string BusinessId { get; set; }
//钉钉审批实例Id
public string ProcessInstanceId { get; set; }
public List<ininvoiceoutputList> List { get; set; }
}
public class ininvoiceoutputList
{
/// <summary>
/// 明细 id
/// </summary>
public string mxid { get; set; }
/// <summary>
/// 发票代码
/// </summary>
public string fpdm { get; set; }
/// <summary>
/// 发票号码
/// </summary>
public string fphm { get; set; }
/// <summary>
/// 发票明细行序号
/// </summary>
public string fpmxxh { get; set; }
/// <summary>
/// 发票行性质
/// </summary>
public string fphxz { get; set; }
/// <summary>
/// 金额
/// </summary>
public string je { get; set; }
/// <summary>
/// 税率
/// </summary>
public string sl { get; set; }
/// <summary>
/// 税额
/// </summary>
public string se { get; set; }
/// <summary>
/// 商品名称
/// </summary>
public string spmc { get; set; }
/// <summary>
/// 规格型号
/// </summary>
public string ggxh { get; set; }
/// <summary>
/// 单位
/// </summary>
public string dw { get; set; }
/// <summary>
/// 商品数量
/// </summary>
public float spsl { get; set; }
/// <summary>
/// 商品单价
/// </summary>
public float spdj { get; set; }
/// <summary>
/// 商品编码
/// </summary>
public string spbm { get; set; }
/// <summary>
/// 版本
/// </summary>
public string bb { get; set; }
/// <summary>
/// 优惠政策标识
/// </summary>
public string yhzcbs { get; set; }
/// <summary>
/// 开票日期
/// </summary>
public string kprq { get; set; }
/// <summary>
/// 开票单位代码
/// </summary>
public string kpdwdm { get; set; }
/// <summary>
/// 名称
/// </summary>
public string mc { get; set; }
/// <summary>
/// 序号
/// </summary>
public string xh { get; set; }
}
public class InInvoiceDataInfoOutput
{
public int code { get; set; }
public bool success { get; set; }
public string msg { get; set; }
public object msgDev { get; set; }
public InvoiceData data { get; set; }
}
public class InvoiceData
{
public List<InInviceDtl> List { get; set; }
public string kprq { get; set; }
public string fplxdm { get; set; }
public string fphm { get; set; }
public string hjje { get; set; }
public string hjse { get; set; }
public string jshj { get; set; }
public string fpzt { get; set; }
public string kpr { get; set; }
public string yfphm { get; set; }
public string gfkpmc { get; set; }
public string gfkpsh { get; set; }
public string xfkpmc { get; set; }
public string xfkpsh { get; set; }
public bool IsGetDtl { get; set; }
public string xfsbh { get; set; }
public string final_jym { get; set; }
public string gfmc { get; set; }
public string dqsj { get; set; }
public float kce { get; set; }
public string jdfplxdm { get; set; }
public string skm { get; set; }
public string ghdwdm { get; set; }
public string zzfphm { get; set; }
public string skr { get; set; }
public string qdbz { get; set; }
public string kpdwdm { get; set; }
public string ghdwyhzh { get; set; }
public float je { get; set; }
public string xfmc { get; set; }
public string tdys { get; set; }
public string bxzt { get; set; }
public string gfyhzh { get; set; }
public string tdyslxDm { get; set; }
public string czydm { get; set; }
public string ghdwdzdh { get; set; }
public string sfwzzfp { get; set; }
public string fpqqlsh { get; set; }
public string se { get; set; }
public string bz { get; set; }
public string gfsbh { get; set; }
public string ghdwmc { get; set; }
public string xhdwdm { get; set; }
public string fpdm { get; set; }
public string xhdwdzdh { get; set; }
public string zbmx { get; set; }
public string xddzdh { get; set; }
public string xfyhzh { get; set; }
public string fhr { get; set; }
public string gfdzdh { get; set; }
public string xhdwmc { get; set; }
public string jqbh { get; set; }
public string zyspmc { get; set; }
public string xhdwyhzh { get; set; }
public string PDFfile { get; set; }
public string OFDfile { get; set; }
public string XMLfile { get; set; }
public string Allfile { get; set; }
}
public class InInviceDtl
{
public string mxid { get; set; }
public string fpdm { get; set; }
public string fphm { get; set; }
public string fpmxxh { get; set; }
public string fphxz { get; set; }
public string je { get; set; }
public string sl { get; set; }
public string se { get; set; }
public string spmc { get; set; }
public string ggxh { get; set; }
public string dw { get; set; }
public float spsl { get; set; }
public float spdj { get; set; }
public string spbm { get; set; }
public string bb { get; set; }
public string yhzcbs { get; set; }
public string kprq { get; set; }
public string kpdwdm { get; set; }
public string mc { get; set; }
public string xh { get; set; }
public long TenantId { get; set; }
public string TenantName { get; set; }
public bool IsDeleted { get; set; }
public object CreateId { get; set; }
public object CreateBy { get; set; }
public string CreateTime { get; set; }
public object ModifyId { get; set; }
public object ModifyBy { get; set; }
public object ModifyTime { get; set; }
public long Id { get; set; }
}
}

@ -0,0 +1,27 @@
using DS.WMS.Core.HangfireJob.Dtos;
using Hangfire;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.HangfireJob.Interface
{
public interface IInInvoiceJobService
{
/// <summary>
/// 定时获取进项发票数据
/// </summary>
/// <param name="Id"></param>
/// <param name="tenantDb"></param>
/// <returns></returns>
[Queue("ininvice")]
Task GetInInvoiceData();
}
}

@ -0,0 +1,239 @@
using DS.Module.Core.Enums;
using DS.WMS.Core.HangfireJob.Dtos;
using DS.WMS.Core.HangfireJob.Interface;
using DS.WMS.Core.Invoice.Entity;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Sys.Entity;
using DS.WMS.Core.TaskPlat.Dtos;
using Google.Api.Gax.ResourceNames;
using LanguageExt.Common;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
using NPOI.SS.Formula.Functions;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.HangfireJob.Method
{
/// <summary>
/// 进项发票相关
/// </summary>
public class InInvoiceService : IInInvoiceJobService
{
private static readonly HttpClient _httpClient = new HttpClient { Timeout = TimeSpan.FromSeconds(60) };
ISqlSugarClient? db;
public InInvoiceService(IServiceProvider serviceProvider)
{
db = serviceProvider.GetRequiredService<ISqlSugarClient>();
}
/// <summary>
/// 定时获取进项发票数据
/// </summary>
/// <returns></returns>
public async Task GetInInvoiceData()
{
//获取组织机构请求授权列表
if (db==null)
{
return;
}
var orgauthlist= db.Queryable<SysOrgAuth>().ClearFilter().Where(t => t.Deleted == false&&t.Type=="ininvice").ToList();
//遍历授权数据集
foreach (var item in orgauthlist)
{
//组织请求远程接口api数据
Dictionary<string, string> header = new Dictionary<string, string>();
header.Add("USER_KEY", item.Key);
header.Add("USER_SECRET", item.Secret);
InInvoicePost model = new InInvoicePost();
model.kprqks = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd HH:mm:ss"); //往前查24小时的进项发票数据
model.kprqjs = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
//model.kprqks = "2024-09-01 00:00:00";// DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd HH:mm:ss"); //往前查24小时的进项发票数据
//model.kprqjs = "2024-09-07 00:00:00"; //DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
var result = await PostAsync("http://47.105.115.105:26650/api/XSD/GetInInvoiceDataList", JsonConvert.SerializeObject(model), header);
//处理返回结果
var info= JsonConvert.DeserializeObject<InInvoicePostOutput>(result);
if (info!=null&&info.Data.data!=null)
{
var dbLink = await db.Queryable<Module.SqlSugar.SysTenantLink>().ClearFilter().Where(t => t.TenantId == item.TenantId).FirstAsync();
SqlSugarClient? tenantDb = null;
foreach (var itemdata in info.Data.data)
{
//查询租户数据库中是否有当前数据
tenantDb = new SqlSugarClient(new ConnectionConfig
{
ConfigId = dbLink.Id,
ConnectionString = dbLink.Connection,
DbType = dbLink.DbType,
IsAutoCloseConnection = true
});
var ininviceinfo = await tenantDb.Queryable<InInvoice>().Where(x => x.InvoiceNumber == itemdata.fphm).FirstAsync();
//数据库中发票数据为空,获取发票详情数据
if (ininviceinfo==null)
{
GetInInvoiceDataInfo gidi = new GetInInvoiceDataInfo();
gidi.fphm = itemdata.fphm;
var resultinfo = await PostAsync("http://47.105.115.105:26650/api/XSD/GetInInvoiceDataInfo", JsonConvert.SerializeObject(gidi), header);
var Iinfo = JsonConvert.DeserializeObject<InInvoiceDataInfoOutput>(resultinfo);
if (Iinfo.code == 0) //调整
{
//添加发票数据
InInvoice inInvoice = new InInvoice();
inInvoice.InvoicingDate = Iinfo.data.kprq;
inInvoice.InvoiceTypeCode = Iinfo.data.fplxdm;
inInvoice.InvoiceNumber = Iinfo.data.fphm;
inInvoice.TotalAmount = Iinfo.data.hjje;
inInvoice.TotalTax = Iinfo.data.hjse;
inInvoice.TotalWithTax = Iinfo.data.jshj;
inInvoice.InvoiceStatus = Iinfo.data.fpzt;
inInvoice.Invoicer = Iinfo.data.kpr;
inInvoice.OriginalInvoiceNumber = Iinfo.data.yfphm;
inInvoice.BuyerInvoiceName = Iinfo.data.gfkpmc;
inInvoice.BuyerInvoiceTaxNumber = Iinfo.data.gfkpsh;
inInvoice.SellerInvoiceName = Iinfo.data.xfkpmc;
inInvoice.SellerInvoiceTaxNumber = Iinfo.data.xfkpsh;
inInvoice.IsDetailObtained = Iinfo.data.IsGetDtl;
inInvoice.SellerIdentificationNumber = Iinfo.data.xfsbh;
inInvoice.FinalCheckCode = Iinfo.data.final_jym;
inInvoice.BuyerName = Iinfo.data.gfmc;
inInvoice.CurrentTime = Iinfo.data.dqsj;
inInvoice.DeductionAmount = Iinfo.data.kce;
inInvoice.VehicleInvoiceTypeCode = Iinfo.data.jdfplxdm;
inInvoice.TaxControlCode = Iinfo.data.skm;
inInvoice.BuyerTaxNumber = Iinfo.data.ghdwdm;
inInvoice.PaperInvoiceNumber = Iinfo.data.zzfphm;
inInvoice.Payee = Iinfo.data.skr;
inInvoice.ItemFlag = Iinfo.data.qdbz;
inInvoice.InvoiceUnitCode = Iinfo.data.kpdwdm;
inInvoice.BuyerBankAccount = Iinfo.data.ghdwyhzh;
inInvoice.Amount = Iinfo.data.je;
inInvoice.SellerName = Iinfo.data.xfmc;
inInvoice.SpecialElements = Iinfo.data.tdys;
inInvoice.ReimbursementStatus = Iinfo.data.bxzt;
inInvoice.BuyerBankAccountNumber = Iinfo.data.gfyhzh;
inInvoice.SpecialElementTypeCode = Iinfo.data.tdyslxDm;
inInvoice.OperatorCode = Iinfo.data.czydm;
inInvoice.BuyerAddressPhone = Iinfo.data.ghdwdzdh;
inInvoice.IsPaperInvoice = Iinfo.data.sfwzzfp;
inInvoice.InvoiceRequestNumber = Iinfo.data.fpqqlsh;
inInvoice.TaxAmount = Iinfo.data.se;
inInvoice.Remarks = Iinfo.data.bz;
inInvoice.BuyerIdentificationNumber = Iinfo.data.gfsbh;
inInvoice.BuyerFullName = Iinfo.data.ghdwmc;
inInvoice.SellerTaxNumber = Iinfo.data.xhdwdm;
inInvoice.InvoiceCode = Iinfo.data.fpdm;
inInvoice.SellerAddressPhone = Iinfo.data.xhdwdzdh;
inInvoice.DetailList = Iinfo.data.zbmx;
inInvoice.SellerAddressPhoneExtra = Iinfo.data.xddzdh;
inInvoice.SellerBankAccountNumber = Iinfo.data.xfyhzh;
inInvoice.Reviewer = Iinfo.data.fhr;
inInvoice.BuyerAddressPhoneExtra = Iinfo.data.gfdzdh;
inInvoice.SellerFullName = Iinfo.data.xhdwmc;
inInvoice.MachineCode = Iinfo.data.jqbh;
inInvoice.ItemOrServiceName = Iinfo.data.zyspmc;
inInvoice.SellerBankAccount = Iinfo.data.xhdwyhzh;
inInvoice.PdfFilePath = Iinfo.data.PDFfile;
inInvoice.OfdFilePath = Iinfo.data.OFDfile;
inInvoice.XmlFilePath = Iinfo.data.XMLfile;
inInvoice.AllFileDownloadPath = Iinfo.data.Allfile;
inInvoice.OrgId = item.OrgId;
inInvoice.CreateTime = DateTime.Now;
var datainv = await tenantDb.Insertable(inInvoice).ExecuteReturnEntityAsync();
foreach (var dtl in Iinfo.data.List)
{
//添加发票详情数据
InInvoiceDetail inInvoicedtl = new InInvoiceDetail();
inInvoicedtl.Id= SnowFlakeSingle.Instance.NextId();
inInvoicedtl.PId = datainv.Id;
inInvoicedtl.DetailId = dtl.mxid;
inInvoicedtl.InvoiceCode = dtl.fpdm;
inInvoicedtl.InvoiceNumber = dtl.fphm;
inInvoicedtl.InvoiceDetailLineNumber = dtl.fpmxxh;
inInvoicedtl.InvoiceLineNature = dtl.fphxz;
inInvoicedtl.Amount = dtl.je;
inInvoicedtl.TaxRate = dtl.sl;
inInvoicedtl.TaxAmount = dtl.se;
inInvoicedtl.ProductName = dtl.spmc;
inInvoicedtl.Specification = dtl.ggxh;
inInvoicedtl.Unit = dtl.dw;
inInvoicedtl.Quantity = dtl.spsl;
inInvoicedtl.UnitPrice = dtl.spdj;
inInvoicedtl.ProductCode = dtl.spbm;
inInvoicedtl.Version = dtl.bb;
inInvoicedtl.PreferentialPolicyFlag = dtl.yhzcbs;
inInvoicedtl.InvoicingDate = dtl.kprq;
inInvoicedtl.InvoicingUnitCode = dtl.kpdwdm;
inInvoicedtl.Name = dtl.mc;
inInvoicedtl.SerialNumber = dtl.xh;
inInvoicedtl.OrgId = item.OrgId;
inInvoicedtl.CreateTime = DateTime.Now;
await tenantDb.Insertable(inInvoicedtl).ExecuteCommandAsync();
}
}
}
}
}
}
}
/// <summary>
/// post请求
/// </summary>
/// <param name="serviceAddress">请求地址</param>
/// <param name="requestJson">请求参数</param>
/// <param name="headers">请求头</param>
/// <returns></returns>
public static async Task<string> PostAsync(string serviceAddress, string requestJson = null, Dictionary<string, string> headers = null)
{
try
{
string result = string.Empty;
Uri postUrl = new Uri(serviceAddress);
using (HttpContent httpContent = new StringContent(requestJson))
{
httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
if (headers != null)
{
foreach (var header in headers)
{
httpContent.Headers.Add(header.Key, header.Value);
}
}
var response = await _httpClient.PostAsync(serviceAddress, httpContent);
result = await response.Content.ReadAsStringAsync();
}
return result;
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
return null;
}
}
}

@ -201,7 +201,7 @@ namespace DS.WMS.Core.Invoice.Dtos
/// <summary>
/// 税额 se
/// </summary>
public float TaxAmount { get; set; }
public string TaxAmount { get; set; }
/// <summary>
/// 备注 bz

@ -1,4 +1,5 @@
using SqlSugar;
using DS.Module.Core.Data;
using SqlSugar;
namespace DS.WMS.Core.Invoice.Entity
{
@ -6,13 +7,9 @@ namespace DS.WMS.Core.Invoice.Entity
/// 进项发票主表
/// </summary>
[SugarTable("invoice_in_info", TableDescription = "进项发票主表")]
public class InInvoice
public class InInvoice : BaseModel<long>
{
/// <summary>
/// 主键
/// </summary>
public long Id { get; set; }
/// <summary>
/// 开票日期 kprq
/// </summary>
@ -201,7 +198,7 @@ namespace DS.WMS.Core.Invoice.Entity
/// <summary>
/// 税额 se
/// </summary>
public float TaxAmount { get; set; }
public string TaxAmount { get; set; }
/// <summary>
/// 备注 bz
@ -302,50 +299,7 @@ namespace DS.WMS.Core.Invoice.Entity
/// 机构Id
/// </summary>
public long OrgId { get; set; }
/// <summary>
/// 备注
/// </summary>
public string? Note { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 创建人
/// </summary>
public string? CreateBy { get; set; }
/// <summary>
/// 修改人
/// </summary>
public string? UpdateBy { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public string? UpdateTime { get; set; }
/// <summary>
/// 是否删除
/// </summary>
public bool Deleted { get; set; }
/// <summary>
/// 删除时间
/// </summary>
public string? DeleteTime { get; set; }
/// <summary>
/// 删除人
/// </summary>
public string? DeleteBy { get; set; }
/// <summary>
/// 创建人姓名
/// </summary>
public string? CreateUserName { get; set; }
/// <summary>
/// 修改人姓名
/// </summary>
public string? UpdateUserName { get; set; }
/// <summary>
/// 删除人姓名
/// </summary>
public string? DeleteUserName { get; set; }
}
}

@ -1,4 +1,5 @@
using SqlSugar;
using DS.Module.Core.Data;
using SqlSugar;
namespace DS.WMS.Core.Invoice.Entity
{
@ -6,12 +7,9 @@ namespace DS.WMS.Core.Invoice.Entity
/// 进项发票详情表
/// </summary>
[SugarTable("invoice_in_detail", TableDescription = "进项发票详情表")]
public class InInvoiceDetail
public class InInvoiceDetail : BaseModel<long>
{
/// <summary>
/// 主键
/// </summary>
public long Id { get; set; }
/// <summary>
/// 主表Id
@ -122,50 +120,7 @@ namespace DS.WMS.Core.Invoice.Entity
/// 机构Id
/// </summary>
public long OrgId { get; set; }
/// <summary>
/// 备注
/// </summary>
public string? Note { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 创建人
/// </summary>
public string? CreateBy { get; set; }
/// <summary>
/// 修改人
/// </summary>
public string? UpdateBy { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public string? UpdateTime { get; set; }
/// <summary>
/// 是否删除
/// </summary>
public bool Deleted { get; set; }
/// <summary>
/// 删除时间
/// </summary>
public string? DeleteTime { get; set; }
/// <summary>
/// 删除人
/// </summary>
public string? DeleteBy { get; set; }
/// <summary>
/// 创建人姓名
/// </summary>
public string? CreateUserName { get; set; }
/// <summary>
/// 修改人姓名
/// </summary>
public string? UpdateUserName { get; set; }
/// <summary>
/// 删除人姓名
/// </summary>
public string? DeleteUserName { get; set; }
}
}

@ -105,12 +105,15 @@ namespace DS.WMS.Core.Invoice.Method
OriginalCurrency = x.OriginalCurrency, //原始币别
ExchangeRate = x.ExchangeRate, //折算汇率
OriginalAmount = x.OriginalAmount, //原始金额
SaleName = x.SaleName,
CustomerNo = x.CustomerNo,
MBLNO = x.MBLNO,
HBLNO = x.HBLNO,
SaleName = x.SaleName,
ClientName = x.ClientName,
ETD = x.ETD,
SourceName = x.SourceName,
AuditTime = y.AuditTime
}).ToListAsync();
@ -146,7 +149,7 @@ namespace DS.WMS.Core.Invoice.Method
protected override Task PostSaveAsync(Entity.Invoice invoice)
{
return Task.Factory.StartNew(UpdateInvoiceApplications, new List<Entity.Invoice> { invoice });
return RefreshApplicationStatus([invoice], null);
}
protected override async Task OnDeleteDetailAsync(List<Entity.Invoice> invoices, DeleteOption deleteOption)
@ -205,42 +208,59 @@ namespace DS.WMS.Core.Invoice.Method
protected override Task PostDeleteAsync(List<Entity.Invoice> invoices, DeleteOption deleteOption)
{
return Task.Factory.StartNew(UpdateInvoiceApplications, invoices);
////获取关联的发票申请的ID
//var ids = invoices.SelectMany(x => x.Details).Where(x => x.RefId.HasValue).Select(x => x.RefId.GetValueOrDefault()).Distinct();
//if (deleteOption == DeleteOption.Entire)
//{
// return TenantDb.Updateable<InvoiceApplication>()
// .SetColumns(x => x.Status == InvoiceApplicationStatus.AuditPassed)
// .Where(x => ids.Contains(x.Id))
// .ExecuteCommandAsync();
//}
//else if (deleteOption == DeleteOption.DetailOnly)
//{
// //获取关联的发票申请的明细ID
// var ids2 = invoices.SelectMany(x => x.Details).Where(x => x.DetailId.HasValue).Select(x => x.DetailId.GetValueOrDefault()).Distinct();
//}
//return Task.CompletedTask;
return RefreshApplicationStatus(invoices, deleteOption);
}
//更新发票申请的状态
void UpdateInvoiceApplications(object? state)
private async Task RefreshApplicationStatus(List<Entity.Invoice> invoices, DeleteOption? deleteOption)
{
var list = state as IEnumerable<Entity.Invoice>;
if (list == null || !list.Any())
if (invoices == null || !invoices.Any())
return;
var ids = list.SelectMany(x => x.Details).Where(x => x.RefId.HasValue).Select(x => x.RefId.GetValueOrDefault()).Distinct().ToList();
var appDetails = TenantDb.Queryable<ApplicationDetail>().Where(d => ids.Contains(d.ApplicationId))
//获取关联的发票申请的ID
var ids = invoices.SelectMany(x => x.Details).Where(x => x.RefId.HasValue).Select(x => x.RefId.GetValueOrDefault()).Distinct().ToList();
var appDetails = await TenantDb.Queryable<ApplicationDetail>().Where(d => ids.Contains(d.ApplicationId))
.Select(d => new ApplicationDetail
{
Id = d.Id,
Category = d.Category,
ApplicationId = d.ApplicationId,
OriginalAmount = d.OriginalAmount,
OriginalProcessedAmount = d.OriginalProcessedAmount
}).ToList();
}).ToListAsync();
List<InvoiceApplication> list2 = new(ids.Count);
foreach (var id in ids)
{
var entity = new InvoiceApplication { Id = id };
var inv = list.FirstOrDefault(x => x.Details.Any(y => y.RefId == id));
entity.AcutalInvoiceNO = inv?.InvoiceNO;
var details = appDetails.FindAll(x => x.ApplicationId == id);
if (details.All(x => x.OriginalAmount == x.OriginalAmount - x.OriginalProcessedAmount))
{
entity.Status = InvoiceApplicationStatus.Invoiced;
entity.Status = deleteOption.HasValue ? InvoiceApplicationStatus.AuditPassed : InvoiceApplicationStatus.Invoiced;
list2.Add(entity);
}
else if (details.All(x => x.OriginalAmount - x.OriginalProcessedAmount == 0))
{
entity.Status = InvoiceApplicationStatus.AuditPassed;
entity.Status = deleteOption == null ? InvoiceApplicationStatus.Invoiced : InvoiceApplicationStatus.AuditPassed;
list2.Add(entity);
}
else if (details.Exists(x => x.OriginalAmount != x.OriginalAmount - x.OriginalProcessedAmount))
@ -250,7 +270,8 @@ namespace DS.WMS.Core.Invoice.Method
}
}
TenantDb.Updateable(list2).UpdateColumns(x => new { x.Status, x.AcutalInvoiceNO }).ExecuteCommand();
await TenantDb.Updateable(list2).UpdateColumns(x => new { x.Status }).ExecuteCommandAsync();
}
}
}

@ -9,13 +9,11 @@ using DS.WMS.Core.Fee.Entity;
using DS.WMS.Core.Info.Entity;
using DS.WMS.Core.Invoice.Dtos;
using DS.WMS.Core.Invoice.Interface;
using DS.WMS.Core.Settlement.Entity;
using DS.WMS.Core.Sys.Entity;
using DS.WMS.Core.Sys.Interface;
using LanguageExt.Pretty;
using Mapster;
using Masuit.Tools.Models;
using Microsoft.Extensions.DependencyInjection;
using Org.BouncyCastle.Asn1.Cmp;
using SqlSugar;
namespace DS.WMS.Core.Invoice.Method
@ -227,7 +225,8 @@ namespace DS.WMS.Core.Invoice.Method
if (invoice.PushModeValues.Length > 0)
invoice.PushMode = string.Join(",", invoice.PushModeValues.Select(x => (int)x));
if (request.Invoice.Mode == InvoiceMode.Applcation && request.Applications != null && request.Applications.Count > 0) //按发票申请开出
//按申请开票
if (request.Invoice.Mode == InvoiceMode.Applcation && request.Applications?.Count > 0)
{
var ids = request.Applications.Select(x => x.ApplicationId);
var details = await TenantDb.Queryable<ApplicationDetail>()
@ -339,21 +338,36 @@ namespace DS.WMS.Core.Invoice.Method
invoice.Details.Add(detail);
}
DataResult result2;
//执行开票金额分配
foreach (var app in request.Applications)
{
var details2 = invoice.Details.Where(x => x.RefId == app.ApplicationId).OrderBy(x => x.ApplyAmount).ToList();
if (app.AmountRMB.HasValue)
{
result2 = AssignAmount(details2.FindAll(x => x.OriginalCurrency == FeeCurrency.RMB_CODE), app.AmountRMB.Value);
if (!result2.Succeeded)
return DataResult<TEntity>.Failed(result2.Message, result2.MultiCode);
}
if (app.AmountUSD.HasValue)
{
result2 = AssignAmount(details2.FindAll(x => x.OriginalCurrency == FeeCurrency.USD_CODE), app.AmountUSD.Value);
if (!result2.Succeeded)
return DataResult<TEntity>.Failed(result2.Message, result2.MultiCode);
}
////执行开票金额分配
//foreach (var app in request.Applications)
//{
// var details2 = invoice.Details.Where(x => x.RefId == app.ApplicationId).OrderBy(x => x.ApplyAmount).ToList();
// if (app.AmountRMB.HasValue)
// {
// var result2 = AssignAmount(details2.FindAll(x => x.OriginalCurrency == FeeCurrency.RMB_CODE), app.AmountRMB.Value);
// if (!result2.Succeeded)
// return DataResult<TEntity>.Failed(result2.Message, result2.MultiCode);
// }
if (app.AmountOther.HasValue)
{
result2 = AssignAmount(details2.FindAll(x => x.OriginalCurrency != FeeCurrency.RMB_CODE && x.OriginalCurrency != FeeCurrency.USD_CODE), app.AmountOther.Value);
if (!result2.Succeeded)
return DataResult<TEntity>.Failed(result2.Message, result2.MultiCode);
}
//}
}
}
else if (request.Invoice.Mode == InvoiceMode.Free) //自由开票
//自由开票
else if (request.Invoice.Mode == InvoiceMode.Free)
{
if (request.BizList?.Count > 0)
{
@ -409,32 +423,32 @@ namespace DS.WMS.Core.Invoice.Method
OriginalAmount = x.OriginalAmount,
OriginalCurrency = x.OriginalCurrency ?? (invoice.Currency.IsNullOrEmpty() ? x.Currency : invoice.Currency),
}).ToList();
//补充购方信息
invoice.CustomerTaxID = await TenantDb.Queryable<InfoClient>().Where(x => x.Id == invoice.CustomerId).Select(x => x.TaxNo).FirstAsync();
var header = await TenantDb.Queryable<InvoiceHeader>().Where(x => x.RelativeId == invoice.CustomerId)
.OrderByDescending(x => x.Id).FirstAsync();
if (header != null)
{
invoice.InvoiceHeader = header.Header;
invoice.CustomerAddressTel = header.AddressTel;
}
var clientBank = await TenantDb.Queryable<InfoClientBank>().Where(x => x.ClientId == invoice.CustomerId && x.Currency == invoice.Currency)
.OrderByDescending(x => x.IsInvoiceDefault).Select(x => new
{
x.Account,
x.BankName
}).FirstAsync();
if (clientBank != null)
{
invoice.CustomerAccount = clientBank.Account;
invoice.CustomerBankName = clientBank.BankName;
}
}
}
if (invoice.Id == 0)
{
//补充购方信息
invoice.CustomerTaxID = await TenantDb.Queryable<InfoClient>().Where(x => x.Id == invoice.CustomerId).Select(x => x.TaxNo).FirstAsync();
var header = await TenantDb.Queryable<InvoiceHeader>().Where(x => x.RelativeId == invoice.CustomerId)
.OrderByDescending(x => x.Id).FirstAsync();
if (header != null)
{
invoice.InvoiceHeader = header.Header;
invoice.CustomerAddressTel = header.AddressTel;
}
var clientBank = await TenantDb.Queryable<InfoClientBank>().Where(x => x.ClientId == invoice.CustomerId && x.Currency == invoice.Currency)
.OrderByDescending(x => x.IsInvoiceDefault).Select(x => new
{
x.Account,
x.BankName
}).FirstAsync();
if (clientBank != null)
{
invoice.CustomerAccount = clientBank.Account;
invoice.CustomerBankName = clientBank.BankName;
}
//补充销方信息
var org = await Db.Queryable<SysOrg>().Where(x => x.Id == User.OrgId).Select(x => new { x.OrgFullName, x.LicenseCode }).FirstAsync();
if (org != null)
@ -877,6 +891,10 @@ namespace DS.WMS.Core.Invoice.Method
if (invoices.Any(x => !string.IsNullOrEmpty(x.ApiCode)))
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.InvoiceIsIssued));
var ids = invoices.Select(x => x.Id);
if (TenantDb.Queryable<ApplicationDetail>().Any(x => ids.Contains(x.RefId.Value) && x.Category == DetailCategory.InvoiceSettlement))
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.InvoiceIsSettled));
return DataResult.Success;
}
@ -888,12 +906,12 @@ namespace DS.WMS.Core.Invoice.Method
/// <returns></returns>
protected virtual async Task OnDeleteDetailAsync(List<TEntity> invoices, DeleteOption deleteOption)
{
var appIds = invoices.Select(x => x.Id);
var ids = invoices.Select(x => x.Id);
if (deleteOption == DeleteOption.DetailOnly)
{
var excludeIds = invoices.SelectMany(x => x.Details).Select(x => x.Id);
var details = await TenantDb.Queryable<ApplicationDetail>().Where(x => appIds.Contains(x.ApplicationId) && !excludeIds.Contains(x.Id))
var details = await TenantDb.Queryable<ApplicationDetail>().Where(x => ids.Contains(x.ApplicationId) && !excludeIds.Contains(x.Id))
.Select(x => new ApplicationDetail
{
Id = x.Id,
@ -919,7 +937,7 @@ namespace DS.WMS.Core.Invoice.Method
else if (deleteOption == DeleteOption.Entire)
{
//删除发票主表则同时删除对应发票明细
await TenantDb.Deleteable<InvoiceDetail>().Where(x => appIds.Contains(x.ApplicationId)).ExecuteCommandAsync();
await TenantDb.Deleteable<InvoiceDetail>().Where(x => ids.Contains(x.ApplicationId)).ExecuteCommandAsync();
}
foreach (var item in invoices)

@ -89,9 +89,9 @@ namespace DS.WMS.Core.Settlement.Dtos
public string BillTypeText => BillType.GetDescription();
/// <summary>
/// 结算银行账户
/// 机构银行ID
/// </summary>
public string? Account { get; set; }
public long? OrgBankId { get; set; }
/// <summary>
/// 结算业务类别

@ -6,7 +6,7 @@ namespace DS.WMS.Core.Settlement.Entity
/// <summary>
/// 结算表
/// </summary>
[SugarTable("application_payment_settlement", TableDescription = "结算表")]
[SugarTable("application_settlement", TableDescription = "结算表")]
public class ApplicationSettlement : SettlementBase
{
/// <summary>

@ -53,10 +53,10 @@ namespace DS.WMS.Core.Settlement.Entity
public decimal Amount { get; set; }
/// <summary>
/// 结算银行账户
/// 机构银行账户ID
/// </summary>
[SugarColumn(ColumnDescription = "结算银行账户", Length = 50, IsNullable = true)]
public string? Account { get; set; }
[SugarColumn(ColumnDescription = "机构银行账户ID", IsNullable = true)]
public long? OrgBankId { get; set; }
/// <summary>
/// 结算业务类别

@ -44,6 +44,6 @@ namespace DS.WMS.Core.Settlement.Interface
/// </summary>
/// <param name="items">业务ID与业务类型</param>
/// <returns></returns>
Task<DataResult<List<FeeClient>>> GetCurrenciesAsync(params FeeClient[] items);
Task<DataResult<List<FeeClient>>> GetCurrenciesAsync(List<FeeClient> items);
}
}

@ -187,7 +187,7 @@ namespace DS.WMS.Core.Settlement.Method
/// </summary>
/// <param name="items">业务ID与业务类型</param>
/// <returns></returns>
public async Task<DataResult<List<FeeClient>>> GetCurrenciesAsync(params FeeClient[] items)
public async Task<DataResult<List<FeeClient>>> GetCurrenciesAsync(List<FeeClient> items)
{
var bizIds = items.Select(x => x.Id).Distinct();
var types = items.Select(x => x.BusinessType).Distinct();
@ -205,19 +205,17 @@ namespace DS.WMS.Core.Settlement.Method
f.ExchangeRate
}).ToListAsync();
var currencies = list.GroupBy(x => new { x.BusinessId, x.BusinessType, x.CustomerId }).Select(x => new FeeClient
foreach (var item in items)
{
Id = x.Key.BusinessId,
BusinessType = x.Key.BusinessType,
CustomerId = x.Key.CustomerId,
ExchangeRates = x.GroupBy(y => y.Currency).Select(y => new CurrencyExchangeRate
{
Currency = y.Key,
ExchangeRate = x.Where(z => z.Currency == y.Key).Select(z => z.ExchangeRate).FirstOrDefault()
}).ToList()
}).ToList();
item.ExchangeRates = list.Where(x => x.BusinessId == item.Id && x.BusinessType == item.BusinessType && x.CustomerId == item.CustomerId)
.GroupBy(x => x.Currency).Select(x => new CurrencyExchangeRate
{
Currency = x.Key,
ExchangeRate = x.First().ExchangeRate
}).ToList();
}
return DataResult<List<FeeClient>>.Success(currencies);
return DataResult<List<FeeClient>>.Success(items);
}
/// <summary>
@ -229,46 +227,10 @@ namespace DS.WMS.Core.Settlement.Method
{
var model = await TenantDb.Queryable<ApplicationSettlement>().Select(x => new ApplicationSettlementDto
{
Id = x.Id,
ApplicationNO = x.ApplicationNO, //申请编号
SettlementNO = x.SettlementNO, //结算单号
CustomerId = x.CustomerId, //结算单位
CustomerName = x.CustomerName,
Mode = x.Mode, //结算类型
SettlementDate = x.SettlementDate, //结算日期
SettlementTypeId = x.SettlementTypeId, //结算方式
CustomerBankId = x.CustomerBankId, //客户银行
Account = x.Account, //客户账户
Currency = x.Currency, //币别
Amount = x.Amount, //金额
ExchangeRate = x.ExchangeRate, //汇率
IsLocked = x.IsLocked, //锁定状态
SaleDeptId = x.SaleDeptId, //所属分部
BillType = x.BillType, //单据类型
Category = x.Category, //业务类别
LedgerVoucherNO = x.LedgerVoucherNO, //总账凭证号
RelativeNO = x.RelativeNO, //相关号码
InvoiceAmount = x.InvoiceAmount,
InvoiceDate = x.InvoiceDate,
InvoiceNO = x.InvoiceNO,
Note = x.Note, //备注
AccountAmount = x.AccountAmount, //记账资料
AccountCurrency = x.AccountCurrency,
AccountRate = x.AccountRate,
PrePayAmount = x.PrePayAmount, //预付支资料
PrePayCurrency = x.PrePayCurrency,
PrePayRate = x.PrePayRate,
AHSRAmount = x.AHSRAmount, //实收支资料
AHSRCurrency = x.AHSRCurrency,
AHSRRate = x.AHSRRate,
FinancialAmount = x.FinancialAmount,//财务费用
FinancialCurrency = x.FinancialCurrency,
FinancialRate = x.FinancialRate,
AdvanceAmount = x.AdvanceAmount, //预收支资料
AdvanceCurrency = x.AdvanceCurrency,
AdvanceRate = x.AdvanceRate,
}).FirstAsync(x => x.Id == id && x.Mode == SettlementMode.FreeSettlement);
SettlementTypeName = x.SettlementType.StlName, //结算方式
CustomerBankName = x.CustomerBank.BankName,
CustomerAccount = x.CustomerBank.Account
}, true).FirstAsync(x => x.Id == id && x.Mode == SettlementMode.FreeSettlement);
var templist = await TenantDb.Queryable<ApplicationDetail>().Where(x => x.ApplicationId == id).ToListAsync();

@ -0,0 +1,33 @@
using DS.Module.Core.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Sys.Entity
{
/// <summary>
/// 组织机构授权表
/// </summary>
[SqlSugar.SugarTable("sys_org_auth")]
public class SysOrgAuth : BaseTenantModel<long>
{
/// <summary>
/// 组织机构Id
/// </summary>
public long OrgId { get; set; }
/// <summary>
/// 类型
/// </summary>
public string Type { get; set; }
/// <summary>
/// 请求key
/// </summary>
public string Key { get; set; }
/// <summary>
/// 密钥
/// </summary>
public string Secret { get; set; }
}
}

@ -88,7 +88,7 @@ namespace DS.WMS.FeeApi.Controllers
/// <param name="items">业务ID与业务类型</param>
/// <returns></returns>
[HttpPost, Route("GetCurrencies")]
public async Task<DataResult<List<FeeClient>>> GetCurrenciesAsync([FromBody] FeeClient[] items)
public async Task<DataResult<List<FeeClient>>> GetCurrenciesAsync([FromBody] List<FeeClient> items)
{
return await _service.GetCurrenciesAsync(items);
}

@ -47,7 +47,7 @@ builder.Services.AddMultiLanguageInstall();//
builder.Services.AddDjyModuleInstall();//Djy·þÎñ
builder.Services.AddRuleEngineModuleInstall();//Djy¹æÔòÒýÇæУÑé·þÎñ
builder.Services.AddHangfireFeeInstall();//Hangfire·þÎñ
builder.Services.AddHangfireFeeInstall();//Hangfire服务
// builder.Services.AddEndpointsApiExplorer();
// builder.Services.AddSwaggerGen();
@ -59,5 +59,8 @@ app.UsePublicMiddlewares();
app.UseHangfireServer();
app.UseJobMiddlewares();
JobMiddleware.RegisterJob<IFeeCustTemplateJobService>(j => j.GenerateFeesAsync(), Cron.Daily(23, 30));
//定时获取进项发票数据 每分钟触发一次
//JobMiddleware.RegisterJob<IInInvoiceJobService>(j => j.GetInInvoiceData(), Cron.Minutely());
app.Run();
Loading…
Cancel
Save