财务相关基本表

master
ZR20090193-陈敬勇 7 months ago
parent 94cb7e9cb7
commit 91724738c6

@ -17,6 +17,9 @@
<DocumentationFile>D:\Code\PublishCopy\ds8-mainapi\Data.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Folder Include="Fee\Dtos\" />
<Folder Include="Fee\Interface\" />
<Folder Include="Fee\Method\" />
<Folder Include="Template\Dtos\" />
<Folder Include="Template\Entity\" />
<Folder Include="Template\Interface\" />

@ -0,0 +1,128 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using SqlSugar;
namespace DS.WMS.Core.Code.Entity;
/// <summary>
/// 费用代码设置
/// </summary>
[SqlSugar.SugarTable("fee_code", "费用代码设置")]
public class FeeCode : BaseModel<long>
{
/// <summary>
/// 费用代码 录入费用是作为检索
/// </summary>
[SugarColumn(ColumnDescription = "费用代码", Length = 20)]
public string Code { get; set; }
/// <summary>
/// 费用名称
/// </summary>
[SugarColumn(ColumnDescription = "费用名称", Length = 50)]
public string Name { get; set; }
/// <summary>
/// 费用英文名称
/// </summary>
[SugarColumn(ColumnDescription = "费用英文名称", Length = 50)]
public string EnName { get; set; }
/// <summary>
/// 币别Id
/// </summary>
[SugarColumn(ColumnDescription = "币别Id")]
public long CurrencyId { get; set; }
/// <summary>
/// 默认计费标准
/// </summary>
[SugarColumn(ColumnDescription = "默认计费标准", DefaultValue = "0")]
public int DefaultUnit { get; set; }
/// <summary>
/// 默认收费客户类型
/// </summary>
[SugarColumn(ColumnDescription = "默认收费客户类型", DefaultValue = "0")]
public int DefaultDebit { get; set; }
/// <summary>
/// 默认付费客户类型
/// </summary>
[SugarColumn(ColumnDescription = "默认付费客户类型", DefaultValue = "0")]
public int DefaultCredit { get; set; }
/// <summary>
/// 海运 海运相关模块使用
/// </summary>
[SugarColumn(ColumnDescription = "海运", DefaultValue = "0")]
public bool? IsSea { get; set; } = false;
/// <summary>
/// 空运 空运相关模块使用
/// </summary>
[SugarColumn(ColumnDescription = "空运", DefaultValue = "0")]
public bool? IsAir { get; set; } = false;
/// <summary>
/// 陆运 陆运相关模块使用
/// </summary>
[SugarColumn(ColumnDescription = "陆运", DefaultValue = "0")]
public bool? IsTrucking { get; set; } = false;
/// <summary>
/// 是否陆运固定费用
/// </summary>
[SugarColumn(ColumnDescription = "是否陆运固定费用", DefaultValue = "0")]
public bool? IsTruckingFixed { get; set; } = false;
/// <summary>
/// 仓储 仓储相关模块使用
/// </summary>
[SugarColumn(ColumnDescription = "仓储", DefaultValue = "0")]
public bool? IsWms { get; set; } = false;
/// <summary>
/// 是否垫付费用
/// </summary>
[SugarColumn(ColumnDescription = "是否垫付费用", DefaultValue = "0")]
public bool? IsAdvancedPay { get; set; } = false;
/// <summary>
/// 默认是否机密
/// </summary>
[SugarColumn(ColumnDescription = "默认是否机密", DefaultValue = "0")]
public bool? IsOpen { get; set; } = false;
/// <summary>
/// 默认是否开票
/// </summary>
[SugarColumn(ColumnDescription = "默认是否开票", DefaultValue = "0")]
public bool? IsInvoice { get; set; } = false;
/// <summary>
/// 费用默认税率
/// </summary>
[SugarColumn(ColumnDescription = "费用默认税率", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")]
public decimal? TaxRate { get; set; }
/// <summary>
/// 费用分组 枚举可维护
/// </summary>
[SugarColumn(ColumnDescription = "费用分组", IsNullable = true, Length = 30)]
public string FeeGroup { get; set; }
/// <summary>
/// 费用默认FRT 枚举可维护
/// </summary>
[SugarColumn(ColumnDescription = "费用默认FRT", IsNullable = true, Length = 20)]
public string FeeFrt { get; set; }
/// <summary>
/// 默认发票费用名称 发票费用名称模块可维护
/// </summary>
[SugarColumn(ColumnDescription = "默认发票费用名称", IsNullable = true, Length = 30)]
public string GoodName { get; set; }
/// <summary>
/// 对帐类型 枚举可维护
/// </summary>
[SugarColumn(ColumnDescription = "对帐类型", IsNullable = true, Length = 30)]
public string CheckingType { get; set; }
/// <summary>
/// 默认币别
/// </summary>
[SugarColumn(ColumnDescription = "默认币别", Length = 20)]
public string DefaultCurrency { get; set; }
/// <summary>
/// 状态 0启用 1禁用
/// </summary>
[SugarColumn(ColumnDescription = "状态", DefaultValue = "0")]
public StatusEnum? Status { get; set; } = StatusEnum.Enable;
}

@ -0,0 +1,46 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using SqlSugar;
namespace DS.WMS.Core.Code.Entity;
/// <summary>
/// 币别信息表
/// </summary>
[SqlSugar.SugarTable("fee_currency","币别信息表")]
public class FeeCurrency: BaseModel<long>
{
/// <summary>
/// 币别代码
/// </summary>
[SugarColumn(ColumnDescription = "币别代码", Length = 10)]
public string CodeName { get; set; }
/// <summary>
/// 币别名称
/// </summary>
[SugarColumn(ColumnDescription = "币别名称", Length = 20)]
public string Name { get; set; }
/// <summary>
/// 描述
/// </summary>
[SugarColumn(ColumnDescription = "描述", Length = 200,IsNullable = true)]
public string Description { get; set; }
/// <summary>
/// 财务软件代码
/// </summary>
[SugarColumn(ColumnDescription = "财务软件代码", Length = 30, IsNullable = true)]
public string FinanceSoftCode { get; set; }
/// <summary>
/// 默认对人民币汇率
/// </summary>
[SugarColumn(ColumnDescription = "默认对人民币汇率", IsNullable = true, Length = 18, DecimalDigits = 5, DefaultValue = "0")]
public decimal? DefaultRate { get; set; }
/// <summary>
/// 状态 0启用 1禁用
/// </summary>
[SugarColumn(ColumnDescription = "状态",DefaultValue = "0")]
public StatusEnum? Status { get; set; } = StatusEnum.Enable;
}

@ -0,0 +1,64 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using SqlSugar;
namespace DS.WMS.Core.Code.Entity;
/// <summary>
/// 汇率设置表
/// </summary>
[SqlSugar.SugarTable("fee_currency_exchange", "汇率设置表")]
public class FeeCurrencyExchange: BaseModel<long>
{
/// <summary>
/// 币别Id
/// </summary>
[SugarColumn(ColumnDescription = "币别Id")]
public long CurrencyId { get; set; }
/// <summary>
/// 币别代码
/// </summary>
[SugarColumn(ColumnDescription = "币别代码", Length = 10)]
public string CurrencyCode { get; set; }
/// <summary>
/// 应收汇率
/// </summary>
[SugarColumn(ColumnDescription = "应收汇率", IsNullable = true, Length = 18, DecimalDigits = 5, DefaultValue = "0")]
public decimal? DRValue { get; set; }
/// <summary>
/// 应付汇率
/// </summary>
[SugarColumn(ColumnDescription = "应付汇率", IsNullable = true, Length = 18, DecimalDigits = 5, DefaultValue = "0")]
public decimal? CRValue { get; set; }
/// <summary>
/// 海关汇率
/// </summary>
[SugarColumn(ColumnDescription = "海关汇率", IsNullable = true, Length = 18, DecimalDigits = 6, DefaultValue = "0")]
public decimal? CustomValue { get; set; }
/// <summary>
/// 开始日期
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "开始日期", IsNullable = false)]
public DateTime StartDate { get; set; }
/// <summary>
/// 结束日期
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "结束日期", IsNullable = false)]
public DateTime EndDate { get; set; }
/// <summary>
/// 本位币
/// </summary>
[SugarColumn(ColumnDescription = "本位币", Length = 10)]
public string LocalCurrency { get; set; }
/// <summary>
/// 状态 0启用 1禁用
/// </summary>
[SugarColumn(ColumnDescription = "状态",DefaultValue = "0")]
public StatusEnum? Status { get; set; } = StatusEnum.Enable;
}

@ -0,0 +1,118 @@
using DS.Module.Core.Data;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Fee.Entity
{
/// <summary>
/// 往来单位固定费用
/// </summary>
[SqlSugar.SugarTable("fee_cust_template_detail", "往来单位固定费用")]
public class FeeCustTemplateDetail : BaseModel<long>
{
/// <summary>
/// 费用Id
/// </summary>
[SugarColumn(ColumnDescription = "费用Id")]
public long FeeId { get; set; }
/// <summary>
/// 费用代码 录入费用是作为检索
/// </summary>
[SugarColumn(ColumnDescription = "费用代码", Length = 50, IsNullable = true)]
public string FeeCode { get; set; }
/// <summary>
/// 费用名称
/// </summary>
[SugarColumn(ColumnDescription = "费用名称", Length = 100, IsNullable = true)]
public string FeeName { get; set; }
/// <summary>
/// 结算对象
/// </summary>
[SugarColumn(ColumnDescription = "结算对象", Length = 100, IsNullable = true)]
public string CustomerName { get; set; }
/// <summary>
/// 结算对象类型
/// </summary>
[SugarColumn(ColumnDescription = "结算对象类型", IsNullable = false, DefaultValue = "1")]
public int CustomerType { get; set; }
/// <summary>
/// 收付类型(收、付)
/// </summary>
[SugarColumn(ColumnDescription = "收付类型(收、付)", IsNullable = false, DefaultValue = "1")]
public int FeeType { get; set; }
/// <summary>
/// 客户Id
/// </summary>
[SugarColumn(ColumnDescription = "客户Id")]
public long ClientId { get; set; }
/// <summary>
/// 费用标准
/// </summary>
[SugarColumn(ColumnDescription = "费用标准", Length = 20, IsNullable = true)]
public string Unit { get; set; }
/// <summary>
/// 是否箱型
/// </summary>
[SugarColumn(ColumnDescription = "是否箱型", DefaultValue = "0")]
public bool? IsCtn { get; set; } = false;
/// <summary>
/// 币别
/// </summary>
[SugarColumn(ColumnDescription = "币别", Length = 100, IsNullable = true)]
public string Currency { get; set; }
/// <summary>
/// 单价
/// </summary>
[SugarColumn(ColumnDescription = "单价", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")]
public decimal? UnitPrice { get; set; }
/// <summary>
/// 排序
/// </summary>
[SugarColumn(ColumnDescription = "排序")]
public int? OrderNo { get; set; } = 100;
/// <summary>
/// 汇率
/// </summary>
[SugarColumn(ColumnDescription = "汇率", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")]
public decimal? ExchangeRate { get; set; }
/// <summary>
/// 费用默认税率
/// </summary>
[SugarColumn(ColumnDescription = "费用默认税率", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")]
public decimal? TaxRate { get; set; }
/// <summary>
/// 财务税率
/// </summary>
[SugarColumn(ColumnDescription = "财务税率", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")]
public decimal? AccTaxRate { get; set; }
/// <summary>
/// 税额
/// </summary>
[SugarColumn(ColumnDescription = "税额", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")]
public decimal? Tax { get; set; }
/// <summary>
/// 含税单价
/// </summary>
[SugarColumn(ColumnDescription = "含税单价", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")]
public decimal? TaxUnitPrice { get; set; }
/// <summary>
/// 是否开票
/// </summary>
[SugarColumn(ColumnDescription = "是否开票", DefaultValue = "0")]
public bool? IsInvoice { get; set; } = false;
/// <summary>
/// 是否垫付费用
/// </summary>
[SugarColumn(ColumnDescription = "是否垫付费用", DefaultValue = "0")]
public bool? IsAdvancedPay { get; set; } = false;
}
}

@ -0,0 +1,354 @@
using DS.Module.Core.Data;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Fee.Entity
{
/// <summary>
/// 费用记录
/// </summary>
[SugarTable("fee_record", TableDescription = "费用记录")]
public class FeeRecord : BaseModel<long>
{
/// <summary>
/// 业务Id
/// </summary>
[SugarColumn(ColumnDescription = "业务Id")]
public long BusinessId { get; set; }
/// <summary>
/// 收付类型(收、付) 1应收 2 应付
/// </summary>
[SugarColumn(ColumnDescription = "收付类型(收、付)", IsNullable = false, DefaultValue = "1")]
public int FeeType { get; set; }
/// <summary>
/// 费用Id
/// </summary>
[SugarColumn(ColumnDescription = "费用Id")]
public long FeeId { get; set; }
/// <summary>
/// 费用代码 录入费用是作为检索
/// </summary>
[SugarColumn(ColumnDescription = "费用代码", Length = 50, IsNullable = true)]
public string FeeCode { get; set; }
/// <summary>
/// 费用名称
/// </summary>
[SugarColumn(ColumnDescription = "费用名称", Length = 100, IsNullable = true)]
public string FeeName { get; set; }
/// <summary>
/// 费用对象
/// </summary>
[SugarColumn(ColumnDescription = "费用对象", Length = 100, IsNullable = true)]
public string CustomerName { get; set; }
/// <summary>
/// 费用对象编码
/// </summary>
[SugarColumn(ColumnDescription = "费用对象编码", Length = 100, IsNullable = true)]
public string CustomerCode { get; set; }
/// <summary>
/// 费用对象类型
/// </summary>
[SugarColumn(ColumnDescription = "费用对象类型", IsNullable = false, DefaultValue = "1")]
public int CustomerType { get; set; }
/// <summary>
/// 费用标准
/// </summary>
[SugarColumn(ColumnDescription = "费用标准", Length = 20, IsNullable = true)]
public string Unit { get; set; }
/// <summary>
/// 单价
/// </summary>
[SugarColumn(ColumnDescription = "单价", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")]
public decimal? UnitPrice { get; set; }
/// <summary>
/// 数量
/// </summary>
[SugarColumn(ColumnDescription = "数量", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")]
public decimal? Quantity { get; set; }
/// <summary>
/// 金额
/// </summary>
[SugarColumn(ColumnDescription = "金额", IsNullable = true, Length = 18, DecimalDigits = 2, DefaultValue = "0")]
public decimal? Amount { get; set; }
/// <summary>
/// 币别
/// </summary>
[SugarColumn(ColumnDescription = "币别", Length = 20)]
public string Currency { get; set; }
/// <summary>
/// 汇率
/// </summary>
[SugarColumn(ColumnDescription = "汇率", IsNullable = true, Length = 18, DecimalDigits = 5, DefaultValue = "0")]
public decimal? ExchangeRate { get; set; }
/// <summary>
/// 驳回原因
/// </summary>
[SugarColumn(ColumnDescription = "驳回原因", Length = 100, IsNullable = true)]
public string Reason { get; set; }
/// <summary>
/// 备注
/// </summary>
[SugarColumn(ColumnDescription = "备注", Length = 1000, IsNullable = true)]
public string Remark { get; set; }
/// <summary>
/// Desc:佣金比率
/// </summary>
[SugarColumn(ColumnDescription = "佣金比率", Length = 18, DecimalDigits = 3, DefaultValue = "0")]
public decimal? CommissionRate { get; set; } = 0;
/// <summary>
/// Desc:结算金额
/// </summary>
[SugarColumn(ColumnDescription = "结算金额", Length = 18, DecimalDigits = 2, DefaultValue = "0")]
public decimal? SettlementAmount { get; set; } = 0;
/// <summary>
/// Desc:开票金额
/// </summary>
[SugarColumn(ColumnDescription = "开票金额", Length = 18, DecimalDigits = 2, DefaultValue = "0")]
public decimal? InvoiceAmount { get; set; } = 0;
/// <summary>
/// Desc:申请金额
/// </summary>
[SugarColumn(ColumnDescription = "申请金额", Length = 18, DecimalDigits = 2, DefaultValue = "0")]
public decimal? OrderAmount { get; set; } = 0;
/// <summary>
/// Desc:申请开票金额
/// </summary>
[SugarColumn(ColumnDescription = "申请开票金额", Length = 18, DecimalDigits = 2, DefaultValue = "0")]
public decimal? OrderInvoiceAmount { get; set; } = 0;
/// <summary>
/// 提交日期
/// </summary>
[SugarColumn(ColumnDescription = "提交日期")]
public DateTime? SubmitDate { get; set; }
/// <summary>
/// 审核人Id
/// </summary>
[SugarColumn(ColumnDescription = "审核人Id")]
public long AuditBy { get; set; }
/// <summary>
/// 审核人
/// </summary>
[SugarColumn(ColumnDescription = "审核人",IsNullable = true, Length = 50)]
public string AuditOperator { get; set; }
/// <summary>
/// 审核日期
/// </summary>
[SugarColumn(ColumnDescription = "审核日期")]
public DateTime AuditDate { get; set; }
/// <summary>
/// 是否机密费用
/// </summary>
[SugarColumn(ColumnDescription = "是否机密费用", DefaultValue = "0")]
public bool? IsOpen { get; set; } = false;
/// <summary>
/// 对帐编号
/// </summary>
[SugarColumn(ColumnDescription = "对帐编号", IsNullable = true, Length = 50)]
public string DebitNo { get; set; }
/// <summary>
/// 是否对帐
/// </summary>
[SugarColumn(ColumnDescription = "IsDebit", DefaultValue = "0")]
public bool IsDebit { get; set; } = false;
/// <summary>
/// 是否垫付费用
/// </summary>
[SugarColumn(ColumnDescription = "是否垫付费用", DefaultValue = "0")]
public bool? IsAdvancedPay { get; set; } = false;
/// <summary>
/// 是否禁开发票
/// </summary>
[SugarColumn(ColumnDescription = "是否禁开发票", DefaultValue = "0")]
public bool? IsInvoice { get; set; } = false;
/// <summary>
/// 是否销售订舱
/// </summary>
[SugarColumn(ColumnDescription = "是否销售订舱", DefaultValue = "0")]
public bool? IsCrmOrderFee { get; set; } = false;
/// <summary>
/// 排序
/// </summary>
[SugarColumn(ColumnDescription = "排序")]
public int? OrderNo { get; set; } = 100;
/// <summary>
/// 费用状态
/// </summary>
[SugarColumn(ColumnDescription = "费用状态", DefaultValue = "0")]
public int FeeStatus { get; set; }
/// <summary>
/// 发票号
/// </summary>
[SugarColumn(ColumnDescription = "发票号", IsNullable = true, Length = 200)]
public string InvoiceNum { get; set; }
/// <summary>
/// 支票号
/// </summary>
[SugarColumn(ColumnDescription = "支票号", IsNullable = true, Length = 200)]
[Description("支票号")]
public string ChequeNum { get; set; }
/// <summary>
/// 仓储编号
/// </summary>
[SugarColumn(ColumnDescription = "仓储编号", IsNullable = true, Length = 100)]
public string WmsOutBSNO { get; set; }
/// <summary>
/// 行号
/// </summary>
[SugarColumn(ColumnDescription = "行号")]
public int LineNum { get; set; }
/// <summary>
/// 税率
/// </summary>
[SugarColumn(ColumnDescription = "税率", Length = 18, DecimalDigits = 4, DefaultValue = "0")]
public decimal TaxRate { get; set; }
/// <summary>
/// 不含税金额
/// </summary>
[SugarColumn(ColumnDescription = "不含税金额", Length = 18, DecimalDigits = 2, DefaultValue = "0")]
public decimal NoTaxAmount { get; set; }
/// <summary>
/// 财务税率
/// </summary>
[SugarColumn(ColumnDescription = "财务税率", Length = 18, DecimalDigits = 4, DefaultValue = "0")]
public decimal AccTaxRate { get; set; }
/// <summary>
/// 是否生成凭证
/// </summary>
[SugarColumn(ColumnDescription = "是否生成凭证", IsNullable = true, DefaultValue = "0")]
public bool IsVou { get; set; }
/// <summary>
/// 报销编号
/// </summary>
[SugarColumn(ColumnDescription = "报销编号", IsNullable = true, Length = 50)]
public string BxId { get; set; }
/// <summary>
/// 税额
/// </summary>
[SugarColumn(ColumnDescription = "税额", Length = 18, DecimalDigits = 2, DefaultValue = "0")]
public decimal Tax { get; set; }
/// <summary>
/// 申请结算金额
/// </summary>
[SugarColumn(ColumnDescription = "申请结算金额", Length = 18, DecimalDigits = 2, DefaultValue = "0")]
public decimal OrderSettlementAmount { get; set; }
/// <summary>
/// 含税单价
/// </summary>
[SugarColumn(ColumnDescription = "含税单价", Length = 18, DecimalDigits = 4, DefaultValue = "0")]
public decimal TaxUnitPrice { get; set; }
/// <summary>
/// 申请发票开票金额
/// </summary>
[SugarColumn(ColumnDescription = "申请发票开票金额", Length = 18, DecimalDigits = 3, DefaultValue = "0")]
public decimal OrderInvSettlementAmount { get; set; }
/// <summary>
/// 凭证号
/// </summary>
[SugarColumn(ColumnDescription = "凭证号", IsNullable = true, Length = 50)]
public string VoucherNo { get; set; }
/// <summary>
///
/// </summary>
[SugarColumn(ColumnDescription = "SalesNo", IsNullable = true, Length = 50)]
public string SalesNo { get; set; }
/// <summary>
/// 借款编号
/// </summary>
[SugarColumn(ColumnDescription = "借款编号", IsNullable = true, Length = 50)]
public string JkId { get; set; }
/// <summary>
///
/// </summary>
[SugarColumn(ColumnDescription = "DeliveryNo", IsNullable = true, Length = 50)]
public string DeliveryNo { get; set; }
/// <summary>
/// 本位币
/// </summary>
[SugarColumn(ColumnDescription = "本位币", IsNullable = true, Length = 30)]
public string LocalCurrency { get; set; }
/// <summary>
/// 责任人
/// </summary>
[SugarColumn(ColumnDescription = "责任人", IsNullable = true, Length = 50)]
public string Manager { get; set; }
/// <summary>
/// 是否财务费用
/// </summary>
[SugarColumn(ColumnDescription = "是否财务费用", IsNullable = true, DefaultValue ="0")]
public bool IsAcc { get; set; }
/// <summary>
///
/// </summary>
[SugarColumn(ColumnDescription = "PaymentId", IsNullable = true, Length = 50)]
public string PaymentId { get; set; }
/// <summary>
///
/// </summary>
[SugarColumn(ColumnDescription = "StatementNo",IsNullable = true, Length = 50)]
public string StatementNo{ get; set; }
/// <summary>
/// 核算单位
/// </summary>
[SugarColumn(ColumnDescription = "核算单位", IsNullable = true, Length = 50)]
public string SaleOrg { get; set; }
/// <summary>
/// 核算单位Id
/// </summary>
[SugarColumn(ColumnDescription = "核算单位Id")]
public long SaleOrgId { get; set; }
/// <summary>
/// 发票自助连接
/// </summary>
[SugarColumn(ColumnDescription = "发票自助连接", IsNullable = true, Length = 50)]
public string InvLinkId { get; set; }
/// <summary>
/// 提交人
/// </summary>
[SugarColumn(ColumnDescription = "提交人", IsNullable = true, Length = 50)]
public string SubmitBy { get; set; }
}
}

@ -0,0 +1,43 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using SqlSugar;
namespace DS.WMS.Core.Code.Entity;
/// <summary>
/// 费用模板主表
/// </summary>
[SqlSugar.SugarTable("fee_template", "费用模板主表")]
public class FeeTemplate: BaseOrgModel<long>
{
/// <summary>
/// 模板名称
/// </summary>
[SugarColumn(ColumnDescription = "模板名称", IsNullable = false, Length = 50)]
public string TemplateName { get; set; }
/// <summary>
/// 业务类型(海运出口、海运进口、空运出口、空运进口)
/// </summary>
[SugarColumn(ColumnDescription = "业务类型 海运出口、海运进口、空运出口、空运进口", IsNullable = false, DefaultValue = "0")]
public int OpType { get; set; }
/// <summary>
/// 收付类型(收、付)
/// </summary>
[SugarColumn(ColumnDescription = "收付类型(收、付)", IsNullable = false, DefaultValue = "1")]
public int FeeType { get; set; }
/// <summary>
/// 是否公共标识
/// </summary>
[SugarColumn(ColumnDescription = "是否公共标识", IsNullable = false, DefaultValue = "0")]
public bool IsPublic { get; set; } = false;
/// <summary>
/// 描述
/// </summary>
[SugarColumn(ColumnDescription = "描述", Length = 200, IsNullable = true)]
public string Description { get; set; }
/// <summary>
/// 状态 0启用 1禁用
/// </summary>
[SugarColumn(ColumnDescription = "状态",DefaultValue = "0")]
public StatusEnum? Status { get; set; } = StatusEnum.Enable;
}

@ -0,0 +1,144 @@
using DS.Module.Core.Data;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Fee.Entity
{
/// <summary>
/// 费用模板明细表
/// </summary>
[SqlSugar.SugarTable("fee_template_detail", "费用模板明细表")]
public class FeeTemplateDetail : BaseModel<long>
{
/// <summary>
/// 模板Id
/// </summary>
[SugarColumn(ColumnDescription = "模板Id")]
public long TemplateId { get; set; }
/// <summary>
/// 费用Id
/// </summary>
[SugarColumn(ColumnDescription = "费用Id")]
public long FeeId { get; set; }
/// <summary>
/// 费用代码 录入费用是作为检索
/// </summary>
[SugarColumn(ColumnDescription = "费用代码", Length = 50, IsNullable = true)]
public string FeeCode { get; set; }
/// <summary>
/// 费用名称
/// </summary>
[SugarColumn(ColumnDescription = "费用名称", Length = 100, IsNullable = true)]
public string FeeName { get; set; }
/// <summary>
/// 费用英文名称
/// </summary>
[SugarColumn(ColumnDescription = "费用英文名称", Length = 100, IsNullable = true)]
public string FeeEnName { get; set; }
/// <summary>
/// 结算对象
/// </summary>
[SugarColumn(ColumnDescription = "结算对象", Length = 100, IsNullable = true)]
public string CustomerName { get; set; }
/// <summary>
/// 结算对象类型
/// </summary>
[SugarColumn(ColumnDescription = "结算对象类型", Length = 50, IsNullable = false, DefaultValue = "1")]
public int CustomerType { get; set; }
/// <summary>
/// 收付类型(收、付)
/// </summary>
[SugarColumn(ColumnDescription = "收付类型(收、付)", IsNullable = false, DefaultValue = "1")]
public int FeeType { get; set; }
/// <summary>
/// 客户Id
/// </summary>
[SugarColumn(ColumnDescription = "客户Id")]
public long ClientId { get; set; }
/// <summary>
/// 费用标准
/// </summary>
[SugarColumn(ColumnDescription = "费用标准", Length = 20, IsNullable = true)]
public string Unit { get; set; }
/// <summary>
/// 是否箱型
/// </summary>
[SugarColumn(ColumnDescription = "是否箱型", DefaultValue = "0")]
public bool? IsCtn { get; set; } = false;
/// <summary>
/// 币别
/// </summary>
[SugarColumn(ColumnDescription = "币别", Length = 100, IsNullable = true)]
public string Currency { get; set; }
/// <summary>
/// 单价
/// </summary>
[SugarColumn(ColumnDescription = "单价", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")]
public decimal? UnitPrice { get; set; }
/// <summary>
/// 排序
/// </summary>
[SugarColumn(ColumnDescription = "排序")]
public int? OrderNo { get; set; } = 100;
/// <summary>
/// 汇率
/// </summary>
[SugarColumn(ColumnDescription = "汇率", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")]
public decimal? ExchangeRate { get; set; }
/// <summary>
/// 费用默认税率
/// </summary>
[SugarColumn(ColumnDescription = "费用默认税率", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")]
public decimal? TaxRate { get; set; }
/// <summary>
/// 财务税率
/// </summary>
[SugarColumn(ColumnDescription = "财务税率", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")]
public decimal? AccTaxRate { get; set; }
/// <summary>
/// 税额
/// </summary>
[SugarColumn(ColumnDescription = "税额", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")]
public decimal? Tax { get; set; }
/// <summary>
/// 含税单价
/// </summary>
[SugarColumn(ColumnDescription = "含税单价", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")]
public decimal? TaxUnitPrice { get; set; }
/// <summary>
/// 是否开票
/// </summary>
[SugarColumn(ColumnDescription = "是否开票", DefaultValue = "0")]
public bool? IsInvoice { get; set; } = false;
/// <summary>
/// 是否垫付费用
/// </summary>
[SugarColumn(ColumnDescription = "是否垫付费用", DefaultValue = "0")]
public bool? IsAdvancedPay { get; set; } = false;
/// <summary>
/// 费用分组 枚举可维护
/// </summary>
[SugarColumn(ColumnDescription = "费用分组", IsNullable = true, Length = 30)]
public string FeeGroup { get; set; }
/// <summary>
/// 费用默认FRT 枚举可维护
/// </summary>
[SugarColumn(ColumnDescription = "费用默认FRT", IsNullable = true, Length = 20)]
public string FeeFrt { get; set; }
/// <summary>
/// 核算单位Id
/// </summary>
[SugarColumn(ColumnDescription = "核算单位Id")]
public long SaleOrgId { get; set; }
}
}

@ -0,0 +1,18 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.FeeApi.Controllers;
/// <summary>
/// WebApi控制器基类
/// </summary>
[Authorize]
[ApiController]
[Route("feeApi/[controller]")]
public abstract class ApiController : Controller
{
// /// <summary>
// /// 获取用户信息
// /// </summary>
// public UserInfo UserDetails => Request.GetUserInfo();
}

@ -5,6 +5,21 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<InvariantGlobalization>true</InvariantGlobalization>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<DocumentationFile>bin\Debug\net8.0\Api.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\DS.Module.AutofacModule\DS.Module.AutofacModule.csproj" />
<ProjectReference Include="..\DS.Module.Core\DS.Module.Core.csproj" />
<ProjectReference Include="..\DS.Module.ExcelModule\DS.Module.ExcelModule.csproj" />
<ProjectReference Include="..\DS.Module.Jwt\DS.Module.Jwt.csproj" />
<ProjectReference Include="..\DS.Module.MultiLanguage\DS.Module.MultiLanguage.csproj" />
<ProjectReference Include="..\DS.Module.Nuget\DS.Module.Nuget.csproj" />
<ProjectReference Include="..\DS.Module.SqlSugar\DS.Module.SqlSugar.csproj" />
<ProjectReference Include="..\DS.Module.Swagger\DS.Module.Swagger.csproj" />
<ProjectReference Include="..\DS.Module.UserModule\DS.Module.UserModule.csproj" />
<ProjectReference Include="..\DS.WMS.Core\DS.WMS.Core.csproj" />
</ItemGroup>
</Project>

@ -0,0 +1,28 @@
2024-04-15 15:20:27.0864 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-15 15:20:27.1451 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-15 15:20:27.1626 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-15 15:20:27.2029 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-04-15 15:20:27.2252 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-04-15 15:20:27.2252 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-15 15:20:27.2547 Info Configuration initialized.
2024-04-15 15:27:54.5732 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-15 15:27:54.6179 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-15 15:27:54.6315 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-15 15:27:54.6628 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-04-15 15:27:54.6782 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-04-15 15:27:54.6782 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-15 15:27:54.7133 Info Configuration initialized.
2024-04-15 15:32:22.0445 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-15 15:32:22.0812 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-15 15:32:22.0981 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-15 15:32:22.1278 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-04-15 15:32:22.1484 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-04-15 15:32:22.1484 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-15 15:32:22.1833 Info Configuration initialized.
2024-04-15 15:33:00.9777 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-15 15:33:01.0292 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-15 15:33:01.0446 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-15 15:33:01.0809 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-04-15 15:33:01.1083 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-04-15 15:33:01.1306 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-15 15:33:01.1626 Info Configuration initialized.

@ -1,32 +1,85 @@
var builder = WebApplication.CreateBuilder(args);
using Autofac;
using Autofac.Extensions.DependencyInjection;
using DS.Module.AutofacModule;
using DS.Module.Core;
using DS.Module.Core.Extensions;
using DS.Module.Core.ServiceExtensions;
using DS.Module.ExcelModule;
using DS.Module.Jwt;
using DS.Module.MultiLanguage;
using DS.Module.SqlSugar;
using DS.Module.Swagger;
using DS.Module.UserModule;
using NLog.Web;
using Swashbuckle.AspNetCore.SwaggerUI;
var builder = WebApplication.CreateBuilder(args);
var environment = builder.Environment.EnvironmentName;
Console.WriteLine("当前开发环境:" + environment);
//注册配置
builder.Configuration
// .SetBasePath(builder.Environment.ContentRootPath)
.AddJsonFile(path: "appsettings.json", optional: false, reloadOnChange: true)
// .AddJsonFile(path: $"appsettings.{environment}.json", optional: true, reloadOnChange: true)
.Build();
builder.Configuration.AddEnvironmentVariables();
builder.Logging.AddNLog("nlog.config");
// Add services to the container.
//Autofac注入
builder.Host
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
.ConfigureContainer<ContainerBuilder>(builder => { builder.RegisterModule(new AutofacModuleRegister()); });
builder.Services.AddAppWebInstal();
builder.Services.AddCorsInstall();
builder.Services.AddUserModuleInstall(); //用户服务
builder.Services.AddSqlSugarInstall();
builder.Services.AddSwaggerInstall();
builder.Services.AddJwtInstall();
builder.Services.AddSaasDbInstall();//分库服务
builder.Services.AddMultiLanguageInstall();//多语言服务
// builder.Services.AddEndpointsApiExplorer();
// builder.Services.AddSwaggerGen();
var app = builder.Build();
// Configure the HTTP request pipeline.
var summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
app.MapGet("/weatherforecast", () =>
// if (app.Environment.IsDevelopment())
// {
// app.UseSwagger();
// app.UseSwaggerUI();
// }
//swagger
// app.UseSwagger();
var documentName = AppSetting.app(new string[] { "SwaggerDoc", "ContactName" });
app
.UseSwagger(c => { c.RouteTemplate = "{documentName}/swagger.json"; })
.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/" + documentName + "/swagger.json",
AppSetting.app(new string[] { "SwaggerDoc", "ContactName" }));
c.DocExpansion(DocExpansion.None);//DocExpansion设置为None可折叠所有方法
c.DefaultModelExpandDepth(-1);//-1 可不显示Models
});
//跨域
var policyName = AppSetting.app(new string[] { "Cors", "PolicyName" });
if (!policyName.IsNullOrEmpty())
{
var forecast = Enumerable.Range(1, 5).Select(index =>
new WeatherForecast
(
DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
Random.Shared.Next(-20, 55),
summaries[Random.Shared.Next(summaries.Length)]
))
.ToArray();
return forecast;
});
app.Run();
internal record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary)
{
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
app.UseCors(policyName); //添加跨域中间件
}
app.UseRouting();
app.UseStaticFiles();
//多语言中间件
app.UseMiddleware<MultiLanguageMiddleware>();
// //操作日志中间件
// app.UseMiddleware<OperationLogMiddleware>();
// 先开启认证
app.UseAuthentication();
// 然后是授权中间件
app.UseAuthorization();
app.UseEndpoints(endpoints => { endpoints.MapControllers(); });
app.Run();

@ -1,31 +1,31 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:27655",
"sslPort": 0
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "weatherforecast",
"applicationUrl": "http://localhost:5295",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:27655",
"sslPort": 0
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "weatherforecast",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "http://localhost:5295",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
}

@ -31,12 +31,12 @@
]
},
"SwaggerDoc": {
"ContactName": "WmsOpAPI",
"ContactName": "WmsFeeAPI",
"ContactEmail": "Wms API.Core@xxx.com",
"ContactUrl": "https://www.xxx.com",
"Version": "1.0",
"Title": "Wms Op API",
"Description": "Wms Op API"
"Title": "Wms Fee API",
"Description": "Wms Fee API"
},
"Middleware": {
"RecordAccessLogs": {

@ -0,0 +1,18 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.OpApi.Controllers;
/// <summary>
/// WebApi控制器基类
/// </summary>
[Authorize]
[ApiController]
[Route("opApi/[controller]")]
public abstract class ApiController : Controller
{
// /// <summary>
// /// 获取用户信息
// /// </summary>
// public UserInfo UserDetails => Request.GetUserInfo();
}

@ -6,7 +6,7 @@ using DS.WMS.Core.Sea.Dtos;
using DS.WMS.Core.Sea.Interface;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.MainApi.Controllers;
namespace DS.WMS.OpApi.Controllers;
/// <summary>
/// 函电信息更改通知服务

@ -6,7 +6,7 @@ using DS.WMS.Core.Sea.Dtos;
using DS.WMS.Core.Sea.Interface;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.MainApi.Controllers;
namespace DS.WMS.OpApi.Controllers;
/// <summary>
/// 函电信息电放保函服务

@ -6,7 +6,7 @@ using DS.WMS.Core.Sea.Dtos;
using DS.WMS.Core.Sea.Interface;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.MainApi.Controllers;
namespace DS.WMS.OpApi.Controllers;
/// <summary>
/// 函电信息派车通知服务

@ -6,7 +6,7 @@ using DS.WMS.Core.Sea.Dtos;
using DS.WMS.Core.Sea.Interface;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.MainApi.Controllers;
namespace DS.WMS.OpApi.Controllers;
/// <summary>
/// 函电信息入货通知服务

@ -6,7 +6,7 @@ using DS.WMS.Core.Sea.Dtos;
using DS.WMS.Core.Sea.Interface;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.MainApi.Controllers;
namespace DS.WMS.OpApi.Controllers;
/// <summary>
/// 集装箱信息服务

@ -6,7 +6,7 @@ using DS.WMS.Core.Sea.Dtos;
using DS.WMS.Core.Sea.Interface;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.MainApi.Controllers;
namespace DS.WMS.OpApi.Controllers;
/// <summary>
/// 海运出口提单信息服务

@ -7,7 +7,7 @@ using DS.WMS.Core.System.Dtos;
using DS.WMS.Core.System.Interface;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.MainApi.Controllers;
namespace DS.WMS.OpApi.Controllers;
/// <summary>
/// 海运出口信息-模块

@ -5,6 +5,21 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<InvariantGlobalization>true</InvariantGlobalization>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<DocumentationFile>bin\Debug\net8.0\Api.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\DS.Module.AutofacModule\DS.Module.AutofacModule.csproj" />
<ProjectReference Include="..\DS.Module.Core\DS.Module.Core.csproj" />
<ProjectReference Include="..\DS.Module.ExcelModule\DS.Module.ExcelModule.csproj" />
<ProjectReference Include="..\DS.Module.Jwt\DS.Module.Jwt.csproj" />
<ProjectReference Include="..\DS.Module.MultiLanguage\DS.Module.MultiLanguage.csproj" />
<ProjectReference Include="..\DS.Module.Nuget\DS.Module.Nuget.csproj" />
<ProjectReference Include="..\DS.Module.SqlSugar\DS.Module.SqlSugar.csproj" />
<ProjectReference Include="..\DS.Module.Swagger\DS.Module.Swagger.csproj" />
<ProjectReference Include="..\DS.Module.UserModule\DS.Module.UserModule.csproj" />
<ProjectReference Include="..\DS.WMS.Core\DS.WMS.Core.csproj" />
</ItemGroup>
</Project>

@ -0,0 +1,28 @@
2024-04-15 15:00:48.5171 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-15 15:00:48.5427 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-15 15:00:48.5427 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-15 15:00:48.5807 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-04-15 15:00:48.6000 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config
2024-04-15 15:00:48.6000 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-15 15:00:48.6381 Info Configuration initialized.
2024-04-15 15:03:35.2260 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-15 15:03:35.3087 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-15 15:03:35.3264 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-15 15:03:35.3876 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-04-15 15:03:35.4222 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config
2024-04-15 15:03:35.4429 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-15 15:03:35.4753 Info Configuration initialized.
2024-04-15 15:09:02.9155 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-15 15:09:03.0128 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-15 15:09:03.0305 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-15 15:09:03.0709 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-04-15 15:09:03.1008 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.OpApi\bin\Release\net8.0\nlog.config
2024-04-15 15:09:03.1008 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-15 15:09:03.1384 Info Configuration initialized.
2024-04-15 15:09:48.7695 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-15 15:09:48.8119 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-15 15:09:48.8274 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-15 15:09:48.8717 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-04-15 15:09:48.9040 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config
2024-04-15 15:09:48.9178 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-15 15:09:48.9450 Info Configuration initialized.

@ -1,32 +1,85 @@
var builder = WebApplication.CreateBuilder(args);
using Autofac;
using Autofac.Extensions.DependencyInjection;
using DS.Module.AutofacModule;
using DS.Module.Core;
using DS.Module.Core.Extensions;
using DS.Module.Core.ServiceExtensions;
using DS.Module.ExcelModule;
using DS.Module.Jwt;
using DS.Module.MultiLanguage;
using DS.Module.SqlSugar;
using DS.Module.Swagger;
using DS.Module.UserModule;
using NLog.Web;
using Swashbuckle.AspNetCore.SwaggerUI;
var builder = WebApplication.CreateBuilder(args);
var environment = builder.Environment.EnvironmentName;
Console.WriteLine("当前开发环境:" + environment);
//注册配置
builder.Configuration
// .SetBasePath(builder.Environment.ContentRootPath)
.AddJsonFile(path: "appsettings.json", optional: false, reloadOnChange: true)
// .AddJsonFile(path: $"appsettings.{environment}.json", optional: true, reloadOnChange: true)
.Build();
builder.Configuration.AddEnvironmentVariables();
builder.Logging.AddNLog("nlog.config");
// Add services to the container.
//Autofac注入
builder.Host
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
.ConfigureContainer<ContainerBuilder>(builder => { builder.RegisterModule(new AutofacModuleRegister()); });
builder.Services.AddAppWebInstal();
builder.Services.AddCorsInstall();
builder.Services.AddUserModuleInstall(); //用户服务
builder.Services.AddSqlSugarInstall();
builder.Services.AddSwaggerInstall();
builder.Services.AddJwtInstall();
builder.Services.AddSaasDbInstall();//分库服务
builder.Services.AddMultiLanguageInstall();//多语言服务
// builder.Services.AddEndpointsApiExplorer();
// builder.Services.AddSwaggerGen();
var app = builder.Build();
// Configure the HTTP request pipeline.
var summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
app.MapGet("/weatherforecast", () =>
// if (app.Environment.IsDevelopment())
// {
// app.UseSwagger();
// app.UseSwaggerUI();
// }
//swagger
// app.UseSwagger();
var documentName = AppSetting.app(new string[] { "SwaggerDoc", "ContactName" });
app
.UseSwagger(c => { c.RouteTemplate = "{documentName}/swagger.json"; })
.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/" + documentName + "/swagger.json",
AppSetting.app(new string[] { "SwaggerDoc", "ContactName" }));
c.DocExpansion(DocExpansion.None);//DocExpansion设置为None可折叠所有方法
c.DefaultModelExpandDepth(-1);//-1 可不显示Models
});
//跨域
var policyName = AppSetting.app(new string[] { "Cors", "PolicyName" });
if (!policyName.IsNullOrEmpty())
{
var forecast = Enumerable.Range(1, 5).Select(index =>
new WeatherForecast
(
DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
Random.Shared.Next(-20, 55),
summaries[Random.Shared.Next(summaries.Length)]
))
.ToArray();
return forecast;
});
app.Run();
internal record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary)
{
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
app.UseCors(policyName); //添加跨域中间件
}
app.UseRouting();
app.UseStaticFiles();
//多语言中间件
app.UseMiddleware<MultiLanguageMiddleware>();
// //操作日志中间件
// app.UseMiddleware<OperationLogMiddleware>();
// 先开启认证
app.UseAuthentication();
// 然后是授权中间件
app.UseAuthorization();
app.UseEndpoints(endpoints => { endpoints.MapControllers(); });
app.Run();

@ -10,22 +10,22 @@
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "weatherforecast",
"applicationUrl": "http://localhost:5030",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "http://localhost:5030",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "weatherforecast",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

Loading…
Cancel
Save