diff --git a/ds-wms-service/DS.WMS.Core/DS.WMS.Core.csproj b/ds-wms-service/DS.WMS.Core/DS.WMS.Core.csproj index a802aba9..937a06bf 100644 --- a/ds-wms-service/DS.WMS.Core/DS.WMS.Core.csproj +++ b/ds-wms-service/DS.WMS.Core/DS.WMS.Core.csproj @@ -17,6 +17,9 @@ D:\Code\PublishCopy\ds8-mainapi\Data.xml + + + diff --git a/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeCode.cs b/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeCode.cs new file mode 100644 index 00000000..07b3130c --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeCode.cs @@ -0,0 +1,128 @@ +using DS.Module.Core; +using DS.Module.Core.Data; +using SqlSugar; + +namespace DS.WMS.Core.Code.Entity; +/// +/// 费用代码设置 +/// +[SqlSugar.SugarTable("fee_code", "费用代码设置")] +public class FeeCode : BaseModel +{ + /// + /// 费用代码 录入费用是作为检索 + /// + [SugarColumn(ColumnDescription = "费用代码", Length = 20)] + public string Code { get; set; } + /// + /// 费用名称 + /// + [SugarColumn(ColumnDescription = "费用名称", Length = 50)] + public string Name { get; set; } + + /// + /// 费用英文名称 + /// + [SugarColumn(ColumnDescription = "费用英文名称", Length = 50)] + public string EnName { get; set; } + /// + /// 币别Id + /// + [SugarColumn(ColumnDescription = "币别Id")] + public long CurrencyId { get; set; } + + /// + /// 默认计费标准 + /// + [SugarColumn(ColumnDescription = "默认计费标准", DefaultValue = "0")] + public int DefaultUnit { get; set; } + /// + /// 默认收费客户类型 + /// + [SugarColumn(ColumnDescription = "默认收费客户类型", DefaultValue = "0")] + public int DefaultDebit { get; set; } + /// + /// 默认付费客户类型 + /// + [SugarColumn(ColumnDescription = "默认付费客户类型", DefaultValue = "0")] + public int DefaultCredit { get; set; } + /// + /// 海运 海运相关模块使用 + /// + [SugarColumn(ColumnDescription = "海运", DefaultValue = "0")] + public bool? IsSea { get; set; } = false; + /// + /// 空运 空运相关模块使用 + /// + [SugarColumn(ColumnDescription = "空运", DefaultValue = "0")] + public bool? IsAir { get; set; } = false; + + /// + /// 陆运 陆运相关模块使用 + /// + [SugarColumn(ColumnDescription = "陆运", DefaultValue = "0")] + public bool? IsTrucking { get; set; } = false; + /// + /// 是否陆运固定费用 + /// + [SugarColumn(ColumnDescription = "是否陆运固定费用", DefaultValue = "0")] + public bool? IsTruckingFixed { get; set; } = false; + /// + /// 仓储 仓储相关模块使用 + /// + [SugarColumn(ColumnDescription = "仓储", DefaultValue = "0")] + public bool? IsWms { get; set; } = false; + /// + /// 是否垫付费用 + /// + [SugarColumn(ColumnDescription = "是否垫付费用", DefaultValue = "0")] + public bool? IsAdvancedPay { get; set; } = false; + /// + /// 默认是否机密 + /// + [SugarColumn(ColumnDescription = "默认是否机密", DefaultValue = "0")] + public bool? IsOpen { get; set; } = false; + /// + /// 默认是否开票 + /// + [SugarColumn(ColumnDescription = "默认是否开票", DefaultValue = "0")] + public bool? IsInvoice { get; set; } = false; + /// + /// 费用默认税率 + /// + [SugarColumn(ColumnDescription = "费用默认税率", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")] + public decimal? TaxRate { get; set; } + /// + /// 费用分组 枚举可维护 + /// + [SugarColumn(ColumnDescription = "费用分组", IsNullable = true, Length = 30)] + public string FeeGroup { get; set; } + /// + /// 费用默认FRT 枚举可维护 + /// + [SugarColumn(ColumnDescription = "费用默认FRT", IsNullable = true, Length = 20)] + public string FeeFrt { get; set; } + + /// + /// 默认发票费用名称 发票费用名称模块可维护 + /// + [SugarColumn(ColumnDescription = "默认发票费用名称", IsNullable = true, Length = 30)] + public string GoodName { get; set; } + + /// + /// 对帐类型 枚举可维护 + /// + [SugarColumn(ColumnDescription = "对帐类型", IsNullable = true, Length = 30)] + public string CheckingType { get; set; } + /// + /// 默认币别 + /// + [SugarColumn(ColumnDescription = "默认币别", Length = 20)] + public string DefaultCurrency { get; set; } + + /// + /// 状态 0启用 1禁用 + /// + [SugarColumn(ColumnDescription = "状态", DefaultValue = "0")] + public StatusEnum? Status { get; set; } = StatusEnum.Enable; +} \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeCurrency.cs b/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeCurrency.cs new file mode 100644 index 00000000..e13a8849 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeCurrency.cs @@ -0,0 +1,46 @@ +using DS.Module.Core; +using DS.Module.Core.Data; +using SqlSugar; + +namespace DS.WMS.Core.Code.Entity; +/// +/// 币别信息表 +/// +[SqlSugar.SugarTable("fee_currency","币别信息表")] +public class FeeCurrency: BaseModel +{ + /// + /// 币别代码 + /// + [SugarColumn(ColumnDescription = "币别代码", Length = 10)] + public string CodeName { get; set; } + + /// + /// 币别名称 + /// + [SugarColumn(ColumnDescription = "币别名称", Length = 20)] + public string Name { get; set; } + + /// + /// 描述 + /// + [SugarColumn(ColumnDescription = "描述", Length = 200,IsNullable = true)] + public string Description { get; set; } + /// + /// 财务软件代码 + /// + [SugarColumn(ColumnDescription = "财务软件代码", Length = 30, IsNullable = true)] + public string FinanceSoftCode { get; set; } + + + /// + /// 默认对人民币汇率 + /// + [SugarColumn(ColumnDescription = "默认对人民币汇率", IsNullable = true, Length = 18, DecimalDigits = 5, DefaultValue = "0")] + public decimal? DefaultRate { get; set; } + /// + /// 状态 0启用 1禁用 + /// + [SugarColumn(ColumnDescription = "状态",DefaultValue = "0")] + public StatusEnum? Status { get; set; } = StatusEnum.Enable; +} \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeCurrencyExchange.cs b/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeCurrencyExchange.cs new file mode 100644 index 00000000..56b51237 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeCurrencyExchange.cs @@ -0,0 +1,64 @@ +using DS.Module.Core; +using DS.Module.Core.Data; +using SqlSugar; + +namespace DS.WMS.Core.Code.Entity; +/// +/// 汇率设置表 +/// +[SqlSugar.SugarTable("fee_currency_exchange", "汇率设置表")] +public class FeeCurrencyExchange: BaseModel +{ + /// + /// 币别Id + /// + [SugarColumn(ColumnDescription = "币别Id")] + public long CurrencyId { get; set; } + /// + /// 币别代码 + /// + [SugarColumn(ColumnDescription = "币别代码", Length = 10)] + public string CurrencyCode { get; set; } + + /// + /// 应收汇率 + /// + [SugarColumn(ColumnDescription = "应收汇率", IsNullable = true, Length = 18, DecimalDigits = 5, DefaultValue = "0")] + public decimal? DRValue { get; set; } + + /// + /// 应付汇率 + /// + [SugarColumn(ColumnDescription = "应付汇率", IsNullable = true, Length = 18, DecimalDigits = 5, DefaultValue = "0")] + public decimal? CRValue { get; set; } + + /// + /// 海关汇率 + /// + [SugarColumn(ColumnDescription = "海关汇率", IsNullable = true, Length = 18, DecimalDigits = 6, DefaultValue = "0")] + public decimal? CustomValue { get; set; } + /// + /// 开始日期 + /// + [SqlSugar.SugarColumn(ColumnDescription = "开始日期", IsNullable = false)] + public DateTime StartDate { get; set; } + + + /// + /// 结束日期 + /// + [SqlSugar.SugarColumn(ColumnDescription = "结束日期", IsNullable = false)] + public DateTime EndDate { get; set; } + + /// + /// 本位币 + /// + [SugarColumn(ColumnDescription = "本位币", Length = 10)] + public string LocalCurrency { get; set; } + + /// + /// 状态 0启用 1禁用 + /// + [SugarColumn(ColumnDescription = "状态",DefaultValue = "0")] + public StatusEnum? Status { get; set; } = StatusEnum.Enable; +} \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeCustTemplateDetail.cs b/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeCustTemplateDetail.cs new file mode 100644 index 00000000..741e4407 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeCustTemplateDetail.cs @@ -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 +{ + /// + /// 往来单位固定费用 + /// + [SqlSugar.SugarTable("fee_cust_template_detail", "往来单位固定费用")] + public class FeeCustTemplateDetail : BaseModel + { + /// + /// 费用Id + /// + [SugarColumn(ColumnDescription = "费用Id")] + public long FeeId { get; set; } + /// + /// 费用代码 录入费用是作为检索 + /// + [SugarColumn(ColumnDescription = "费用代码", Length = 50, IsNullable = true)] + public string FeeCode { get; set; } + /// + /// 费用名称 + /// + [SugarColumn(ColumnDescription = "费用名称", Length = 100, IsNullable = true)] + public string FeeName { get; set; } + /// + /// 结算对象 + /// + [SugarColumn(ColumnDescription = "结算对象", Length = 100, IsNullable = true)] + public string CustomerName { get; set; } + /// + /// 结算对象类型 + /// + [SugarColumn(ColumnDescription = "结算对象类型", IsNullable = false, DefaultValue = "1")] + public int CustomerType { get; set; } + /// + /// 收付类型(收、付) + /// + [SugarColumn(ColumnDescription = "收付类型(收、付)", IsNullable = false, DefaultValue = "1")] + public int FeeType { get; set; } + /// + /// 客户Id + /// + [SugarColumn(ColumnDescription = "客户Id")] + public long ClientId { get; set; } + /// + /// 费用标准 + /// + [SugarColumn(ColumnDescription = "费用标准", Length = 20, IsNullable = true)] + public string Unit { get; set; } + + /// + /// 是否箱型 + /// + [SugarColumn(ColumnDescription = "是否箱型", DefaultValue = "0")] + public bool? IsCtn { get; set; } = false; + /// + /// 币别 + /// + [SugarColumn(ColumnDescription = "币别", Length = 100, IsNullable = true)] + public string Currency { get; set; } + /// + /// 单价 + /// + [SugarColumn(ColumnDescription = "单价", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")] + public decimal? UnitPrice { get; set; } + /// + /// 排序 + /// + [SugarColumn(ColumnDescription = "排序")] + public int? OrderNo { get; set; } = 100; + + /// + /// 汇率 + /// + [SugarColumn(ColumnDescription = "汇率", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")] + public decimal? ExchangeRate { get; set; } + /// + /// 费用默认税率 + /// + [SugarColumn(ColumnDescription = "费用默认税率", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")] + public decimal? TaxRate { get; set; } + /// + /// 财务税率 + /// + [SugarColumn(ColumnDescription = "财务税率", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")] + public decimal? AccTaxRate { get; set; } + /// + /// 税额 + /// + [SugarColumn(ColumnDescription = "税额", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")] + public decimal? Tax { get; set; } + /// + /// 含税单价 + /// + [SugarColumn(ColumnDescription = "含税单价", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")] + public decimal? TaxUnitPrice { get; set; } + /// + /// 是否开票 + /// + [SugarColumn(ColumnDescription = "是否开票", DefaultValue = "0")] + public bool? IsInvoice { get; set; } = false; + + /// + /// 是否垫付费用 + /// + [SugarColumn(ColumnDescription = "是否垫付费用", DefaultValue = "0")] + public bool? IsAdvancedPay { get; set; } = false; + + + } +} diff --git a/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeRecord.cs b/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeRecord.cs new file mode 100644 index 00000000..041e3d3d --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeRecord.cs @@ -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 +{ + /// + /// 费用记录 + /// + [SugarTable("fee_record", TableDescription = "费用记录")] + public class FeeRecord : BaseModel + { + /// + /// 业务Id + /// + [SugarColumn(ColumnDescription = "业务Id")] + public long BusinessId { get; set; } + /// + /// 收付类型(收、付) 1应收 2 应付 + /// + [SugarColumn(ColumnDescription = "收付类型(收、付)", IsNullable = false, DefaultValue = "1")] + public int FeeType { get; set; } + + /// + /// 费用Id + /// + [SugarColumn(ColumnDescription = "费用Id")] + public long FeeId { get; set; } + /// + /// 费用代码 录入费用是作为检索 + /// + [SugarColumn(ColumnDescription = "费用代码", Length = 50, IsNullable = true)] + public string FeeCode { get; set; } + /// + /// 费用名称 + /// + [SugarColumn(ColumnDescription = "费用名称", Length = 100, IsNullable = true)] + public string FeeName { get; set; } + /// + /// 费用对象 + /// + [SugarColumn(ColumnDescription = "费用对象", Length = 100, IsNullable = true)] + public string CustomerName { get; set; } + /// + /// 费用对象编码 + /// + [SugarColumn(ColumnDescription = "费用对象编码", Length = 100, IsNullable = true)] + public string CustomerCode { get; set; } + /// + /// 费用对象类型 + /// + [SugarColumn(ColumnDescription = "费用对象类型", IsNullable = false, DefaultValue = "1")] + public int CustomerType { get; set; } + + /// + /// 费用标准 + /// + [SugarColumn(ColumnDescription = "费用标准", Length = 20, IsNullable = true)] + public string Unit { get; set; } + /// + /// 单价 + /// + [SugarColumn(ColumnDescription = "单价", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")] + public decimal? UnitPrice { get; set; } + /// + /// 数量 + /// + [SugarColumn(ColumnDescription = "数量", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")] + public decimal? Quantity { get; set; } + /// + /// 金额 + /// + [SugarColumn(ColumnDescription = "金额", IsNullable = true, Length = 18, DecimalDigits = 2, DefaultValue = "0")] + public decimal? Amount { get; set; } + + /// + /// 币别 + /// + [SugarColumn(ColumnDescription = "币别", Length = 20)] + public string Currency { get; set; } + + /// + /// 汇率 + /// + [SugarColumn(ColumnDescription = "汇率", IsNullable = true, Length = 18, DecimalDigits = 5, DefaultValue = "0")] + public decimal? ExchangeRate { get; set; } + + /// + /// 驳回原因 + /// + [SugarColumn(ColumnDescription = "驳回原因", Length = 100, IsNullable = true)] + public string Reason { get; set; } + + /// + /// 备注 + /// + [SugarColumn(ColumnDescription = "备注", Length = 1000, IsNullable = true)] + public string Remark { get; set; } + + + /// + /// Desc:佣金比率 + /// + [SugarColumn(ColumnDescription = "佣金比率", Length = 18, DecimalDigits = 3, DefaultValue = "0")] + public decimal? CommissionRate { get; set; } = 0; + + /// + /// Desc:结算金额 + /// + [SugarColumn(ColumnDescription = "结算金额", Length = 18, DecimalDigits = 2, DefaultValue = "0")] + public decimal? SettlementAmount { get; set; } = 0; + /// + /// Desc:开票金额 + /// + [SugarColumn(ColumnDescription = "开票金额", Length = 18, DecimalDigits = 2, DefaultValue = "0")] + public decimal? InvoiceAmount { get; set; } = 0; + /// + /// Desc:申请金额 + /// + [SugarColumn(ColumnDescription = "申请金额", Length = 18, DecimalDigits = 2, DefaultValue = "0")] + public decimal? OrderAmount { get; set; } = 0; + /// + /// Desc:申请开票金额 + /// + [SugarColumn(ColumnDescription = "申请开票金额", Length = 18, DecimalDigits = 2, DefaultValue = "0")] + public decimal? OrderInvoiceAmount { get; set; } = 0; + /// + /// 提交日期 + /// + [SugarColumn(ColumnDescription = "提交日期")] + public DateTime? SubmitDate { get; set; } + + + /// + /// 审核人Id + /// + [SugarColumn(ColumnDescription = "审核人Id")] + public long AuditBy { get; set; } + + /// + /// 审核人 + /// + [SugarColumn(ColumnDescription = "审核人",IsNullable = true, Length = 50)] + public string AuditOperator { get; set; } + /// + /// 审核日期 + /// + [SugarColumn(ColumnDescription = "审核日期")] + public DateTime AuditDate { get; set; } + + /// + /// 是否机密费用 + /// + [SugarColumn(ColumnDescription = "是否机密费用", DefaultValue = "0")] + public bool? IsOpen { get; set; } = false; + /// + /// 对帐编号 + /// + [SugarColumn(ColumnDescription = "对帐编号", IsNullable = true, Length = 50)] + public string DebitNo { get; set; } + /// + /// 是否对帐 + /// + [SugarColumn(ColumnDescription = "IsDebit", DefaultValue = "0")] + public bool IsDebit { get; set; } = false; + /// + /// 是否垫付费用 + /// + [SugarColumn(ColumnDescription = "是否垫付费用", DefaultValue = "0")] + public bool? IsAdvancedPay { get; set; } = false; + /// + /// 是否禁开发票 + /// + [SugarColumn(ColumnDescription = "是否禁开发票", DefaultValue = "0")] + public bool? IsInvoice { get; set; } = false; + /// + /// 是否销售订舱 + /// + [SugarColumn(ColumnDescription = "是否销售订舱", DefaultValue = "0")] + public bool? IsCrmOrderFee { get; set; } = false; + /// + /// 排序 + /// + [SugarColumn(ColumnDescription = "排序")] + public int? OrderNo { get; set; } = 100; + + /// + /// 费用状态 + /// + [SugarColumn(ColumnDescription = "费用状态", DefaultValue = "0")] + public int FeeStatus { get; set; } + + /// + /// 发票号 + /// + [SugarColumn(ColumnDescription = "发票号", IsNullable = true, Length = 200)] + public string InvoiceNum { get; set; } + /// + /// 支票号 + /// + [SugarColumn(ColumnDescription = "支票号", IsNullable = true, Length = 200)] + [Description("支票号")] + public string ChequeNum { get; set; } + + /// + /// 仓储编号 + /// + [SugarColumn(ColumnDescription = "仓储编号", IsNullable = true, Length = 100)] + public string WmsOutBSNO { get; set; } + + /// + /// 行号 + /// + [SugarColumn(ColumnDescription = "行号")] + public int LineNum { get; set; } + + /// + /// 税率 + /// + [SugarColumn(ColumnDescription = "税率", Length = 18, DecimalDigits = 4, DefaultValue = "0")] + public decimal TaxRate { get; set; } + + /// + /// 不含税金额 + /// + [SugarColumn(ColumnDescription = "不含税金额", Length = 18, DecimalDigits = 2, DefaultValue = "0")] + public decimal NoTaxAmount { get; set; } + + /// + /// 财务税率 + /// + [SugarColumn(ColumnDescription = "财务税率", Length = 18, DecimalDigits = 4, DefaultValue = "0")] + public decimal AccTaxRate { get; set; } + + /// + /// 是否生成凭证 + /// + [SugarColumn(ColumnDescription = "是否生成凭证", IsNullable = true, DefaultValue = "0")] + public bool IsVou { get; set; } + + /// + /// 报销编号 + /// + [SugarColumn(ColumnDescription = "报销编号", IsNullable = true, Length = 50)] + public string BxId { get; set; } + + /// + /// 税额 + /// + [SugarColumn(ColumnDescription = "税额", Length = 18, DecimalDigits = 2, DefaultValue = "0")] + public decimal Tax { get; set; } + + /// + /// 申请结算金额 + /// + [SugarColumn(ColumnDescription = "申请结算金额", Length = 18, DecimalDigits = 2, DefaultValue = "0")] + public decimal OrderSettlementAmount { get; set; } + + /// + /// 含税单价 + /// + [SugarColumn(ColumnDescription = "含税单价", Length = 18, DecimalDigits = 4, DefaultValue = "0")] + public decimal TaxUnitPrice { get; set; } + + /// + /// 申请发票开票金额 + /// + [SugarColumn(ColumnDescription = "申请发票开票金额", Length = 18, DecimalDigits = 3, DefaultValue = "0")] + public decimal OrderInvSettlementAmount { get; set; } + + /// + /// 凭证号 + /// + [SugarColumn(ColumnDescription = "凭证号", IsNullable = true, Length = 50)] + public string VoucherNo { get; set; } + + /// + /// + /// + [SugarColumn(ColumnDescription = "SalesNo", IsNullable = true, Length = 50)] + public string SalesNo { get; set; } + + /// + /// 借款编号 + /// + [SugarColumn(ColumnDescription = "借款编号", IsNullable = true, Length = 50)] + public string JkId { get; set; } + + /// + /// + /// + [SugarColumn(ColumnDescription = "DeliveryNo", IsNullable = true, Length = 50)] + public string DeliveryNo { get; set; } + + /// + /// 本位币 + /// + [SugarColumn(ColumnDescription = "本位币", IsNullable = true, Length = 30)] + public string LocalCurrency { get; set; } + + /// + /// 责任人 + /// + [SugarColumn(ColumnDescription = "责任人", IsNullable = true, Length = 50)] + public string Manager { get; set; } + + /// + /// 是否财务费用 + /// + [SugarColumn(ColumnDescription = "是否财务费用", IsNullable = true, DefaultValue ="0")] + public bool IsAcc { get; set; } + + /// + /// + /// + [SugarColumn(ColumnDescription = "PaymentId", IsNullable = true, Length = 50)] + public string PaymentId { get; set; } + + /// + /// + /// + [SugarColumn(ColumnDescription = "StatementNo",IsNullable = true, Length = 50)] + public string StatementNo{ get; set; } + + /// + /// 核算单位 + /// + [SugarColumn(ColumnDescription = "核算单位", IsNullable = true, Length = 50)] + public string SaleOrg { get; set; } + + /// + /// 核算单位Id + /// + [SugarColumn(ColumnDescription = "核算单位Id")] + public long SaleOrgId { get; set; } + /// + /// 发票自助连接 + /// + [SugarColumn(ColumnDescription = "发票自助连接", IsNullable = true, Length = 50)] + public string InvLinkId { get; set; } + + /// + /// 提交人 + /// + [SugarColumn(ColumnDescription = "提交人", IsNullable = true, Length = 50)] + public string SubmitBy { get; set; } + + } +} diff --git a/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeTemplate.cs b/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeTemplate.cs new file mode 100644 index 00000000..ef40fb89 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeTemplate.cs @@ -0,0 +1,43 @@ +using DS.Module.Core; +using DS.Module.Core.Data; +using SqlSugar; + +namespace DS.WMS.Core.Code.Entity; +/// +/// 费用模板主表 +/// +[SqlSugar.SugarTable("fee_template", "费用模板主表")] +public class FeeTemplate: BaseOrgModel +{ + /// + /// 模板名称 + /// + [SugarColumn(ColumnDescription = "模板名称", IsNullable = false, Length = 50)] + public string TemplateName { get; set; } + /// + /// 业务类型(海运出口、海运进口、空运出口、空运进口) + /// + [SugarColumn(ColumnDescription = "业务类型 海运出口、海运进口、空运出口、空运进口", IsNullable = false, DefaultValue = "0")] + public int OpType { get; set; } + /// + /// 收付类型(收、付) + /// + [SugarColumn(ColumnDescription = "收付类型(收、付)", IsNullable = false, DefaultValue = "1")] + public int FeeType { get; set; } + /// + /// 是否公共标识 + /// + [SugarColumn(ColumnDescription = "是否公共标识", IsNullable = false, DefaultValue = "0")] + public bool IsPublic { get; set; } = false; + + /// + /// 描述 + /// + [SugarColumn(ColumnDescription = "描述", Length = 200, IsNullable = true)] + public string Description { get; set; } + /// + /// 状态 0启用 1禁用 + /// + [SugarColumn(ColumnDescription = "状态",DefaultValue = "0")] + public StatusEnum? Status { get; set; } = StatusEnum.Enable; +} \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeTemplateDetail.cs b/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeTemplateDetail.cs new file mode 100644 index 00000000..097b8ef6 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeTemplateDetail.cs @@ -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 +{ + /// + /// 费用模板明细表 + /// + [SqlSugar.SugarTable("fee_template_detail", "费用模板明细表")] + public class FeeTemplateDetail : BaseModel + { + /// + /// 模板Id + /// + [SugarColumn(ColumnDescription = "模板Id")] + public long TemplateId { get; set; } + /// + /// 费用Id + /// + [SugarColumn(ColumnDescription = "费用Id")] + public long FeeId { get; set; } + /// + /// 费用代码 录入费用是作为检索 + /// + [SugarColumn(ColumnDescription = "费用代码", Length = 50, IsNullable = true)] + public string FeeCode { get; set; } + /// + /// 费用名称 + /// + [SugarColumn(ColumnDescription = "费用名称", Length = 100, IsNullable = true)] + public string FeeName { get; set; } + /// + /// 费用英文名称 + /// + [SugarColumn(ColumnDescription = "费用英文名称", Length = 100, IsNullable = true)] + public string FeeEnName { get; set; } + /// + /// 结算对象 + /// + [SugarColumn(ColumnDescription = "结算对象", Length = 100, IsNullable = true)] + public string CustomerName { get; set; } + /// + /// 结算对象类型 + /// + [SugarColumn(ColumnDescription = "结算对象类型", Length = 50, IsNullable = false, DefaultValue = "1")] + public int CustomerType { get; set; } + /// + /// 收付类型(收、付) + /// + [SugarColumn(ColumnDescription = "收付类型(收、付)", IsNullable = false, DefaultValue = "1")] + public int FeeType { get; set; } + /// + /// 客户Id + /// + [SugarColumn(ColumnDescription = "客户Id")] + public long ClientId { get; set; } + /// + /// 费用标准 + /// + [SugarColumn(ColumnDescription = "费用标准", Length = 20, IsNullable = true)] + public string Unit { get; set; } + + /// + /// 是否箱型 + /// + [SugarColumn(ColumnDescription = "是否箱型", DefaultValue = "0")] + public bool? IsCtn { get; set; } = false; + /// + /// 币别 + /// + [SugarColumn(ColumnDescription = "币别", Length = 100, IsNullable = true)] + public string Currency { get; set; } + /// + /// 单价 + /// + [SugarColumn(ColumnDescription = "单价", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")] + public decimal? UnitPrice { get; set; } + /// + /// 排序 + /// + [SugarColumn(ColumnDescription = "排序")] + public int? OrderNo { get; set; } = 100; + + /// + /// 汇率 + /// + [SugarColumn(ColumnDescription = "汇率", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")] + public decimal? ExchangeRate { get; set; } + /// + /// 费用默认税率 + /// + [SugarColumn(ColumnDescription = "费用默认税率", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")] + public decimal? TaxRate { get; set; } + /// + /// 财务税率 + /// + [SugarColumn(ColumnDescription = "财务税率", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")] + public decimal? AccTaxRate { get; set; } + /// + /// 税额 + /// + [SugarColumn(ColumnDescription = "税额", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")] + public decimal? Tax { get; set; } + /// + /// 含税单价 + /// + [SugarColumn(ColumnDescription = "含税单价", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")] + public decimal? TaxUnitPrice { get; set; } + /// + /// 是否开票 + /// + [SugarColumn(ColumnDescription = "是否开票", DefaultValue = "0")] + public bool? IsInvoice { get; set; } = false; + + /// + /// 是否垫付费用 + /// + [SugarColumn(ColumnDescription = "是否垫付费用", DefaultValue = "0")] + public bool? IsAdvancedPay { get; set; } = false; + + /// + /// 费用分组 枚举可维护 + /// + [SugarColumn(ColumnDescription = "费用分组", IsNullable = true, Length = 30)] + public string FeeGroup { get; set; } + /// + /// 费用默认FRT 枚举可维护 + /// + [SugarColumn(ColumnDescription = "费用默认FRT", IsNullable = true, Length = 20)] + public string FeeFrt { get; set; } + + /// + /// 核算单位Id + /// + [SugarColumn(ColumnDescription = "核算单位Id")] + public long SaleOrgId { get; set; } + + } +} diff --git a/ds-wms-service/DS.WMS.FeeApi/Controllers/ApiController.cs b/ds-wms-service/DS.WMS.FeeApi/Controllers/ApiController.cs new file mode 100644 index 00000000..52afe92b --- /dev/null +++ b/ds-wms-service/DS.WMS.FeeApi/Controllers/ApiController.cs @@ -0,0 +1,18 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; + +namespace DS.WMS.FeeApi.Controllers; + +/// +/// WebApi控制器基类 +/// +[Authorize] +[ApiController] +[Route("feeApi/[controller]")] +public abstract class ApiController : Controller +{ + // /// + // /// 获取用户信息 + // /// + // public UserInfo UserDetails => Request.GetUserInfo(); +} \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.FeeApi/DS.WMS.FeeApi.csproj b/ds-wms-service/DS.WMS.FeeApi/DS.WMS.FeeApi.csproj index 8823928d..0813f662 100644 --- a/ds-wms-service/DS.WMS.FeeApi/DS.WMS.FeeApi.csproj +++ b/ds-wms-service/DS.WMS.FeeApi/DS.WMS.FeeApi.csproj @@ -5,6 +5,21 @@ enable enable true + True + bin\Debug\net8.0\Api.xml + + + + + + + + + + + + + diff --git a/ds-wms-service/DS.WMS.FeeApi/Logs/internal-nlog.txt b/ds-wms-service/DS.WMS.FeeApi/Logs/internal-nlog.txt new file mode 100644 index 00000000..7769f950 --- /dev/null +++ b/ds-wms-service/DS.WMS.FeeApi/Logs/internal-nlog.txt @@ -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. diff --git a/ds-wms-service/DS.WMS.FeeApi/Program.cs b/ds-wms-service/DS.WMS.FeeApi/Program.cs index 732d1b5f..59b58a9c 100644 --- a/ds-wms-service/DS.WMS.FeeApi/Program.cs +++ b/ds-wms-service/DS.WMS.FeeApi/Program.cs @@ -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(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(); +// //־м +// app.UseMiddleware(); + +// ȿ֤ +app.UseAuthentication(); +// ȻȨм +app.UseAuthorization(); +app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); + +app.Run(); \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.FeeApi/Properties/launchSettings.json b/ds-wms-service/DS.WMS.FeeApi/Properties/launchSettings.json index 923839a9..13f12c2e 100644 --- a/ds-wms-service/DS.WMS.FeeApi/Properties/launchSettings.json +++ b/ds-wms-service/DS.WMS.FeeApi/Properties/launchSettings.json @@ -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" + } + } } - } } diff --git a/ds-wms-service/DS.WMS.FeeApi/appsettings.json b/ds-wms-service/DS.WMS.FeeApi/appsettings.json index 64504991..5cc503d3 100644 --- a/ds-wms-service/DS.WMS.FeeApi/appsettings.json +++ b/ds-wms-service/DS.WMS.FeeApi/appsettings.json @@ -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": { diff --git a/ds-wms-service/DS.WMS.OpApi/Controllers/ApiController.cs b/ds-wms-service/DS.WMS.OpApi/Controllers/ApiController.cs new file mode 100644 index 00000000..b4bfef24 --- /dev/null +++ b/ds-wms-service/DS.WMS.OpApi/Controllers/ApiController.cs @@ -0,0 +1,18 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; + +namespace DS.WMS.OpApi.Controllers; + +/// +/// WebApi控制器基类 +/// +[Authorize] +[ApiController] +[Route("opApi/[controller]")] +public abstract class ApiController : Controller +{ + // /// + // /// 获取用户信息 + // /// + // public UserInfo UserDetails => Request.GetUserInfo(); +} \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.MainApi/Controllers/LetterChangeController.cs b/ds-wms-service/DS.WMS.OpApi/Controllers/LetterChangeController.cs similarity index 97% rename from ds-wms-service/DS.WMS.MainApi/Controllers/LetterChangeController.cs rename to ds-wms-service/DS.WMS.OpApi/Controllers/LetterChangeController.cs index a3929040..fdcf33ac 100644 --- a/ds-wms-service/DS.WMS.MainApi/Controllers/LetterChangeController.cs +++ b/ds-wms-service/DS.WMS.OpApi/Controllers/LetterChangeController.cs @@ -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; /// /// 函电信息更改通知服务 diff --git a/ds-wms-service/DS.WMS.MainApi/Controllers/LetterSurController.cs b/ds-wms-service/DS.WMS.OpApi/Controllers/LetterSurController.cs similarity index 97% rename from ds-wms-service/DS.WMS.MainApi/Controllers/LetterSurController.cs rename to ds-wms-service/DS.WMS.OpApi/Controllers/LetterSurController.cs index fce75fd9..5107ea14 100644 --- a/ds-wms-service/DS.WMS.MainApi/Controllers/LetterSurController.cs +++ b/ds-wms-service/DS.WMS.OpApi/Controllers/LetterSurController.cs @@ -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; /// /// 函电信息电放保函服务 diff --git a/ds-wms-service/DS.WMS.MainApi/Controllers/LetterTruckController.cs b/ds-wms-service/DS.WMS.OpApi/Controllers/LetterTruckController.cs similarity index 97% rename from ds-wms-service/DS.WMS.MainApi/Controllers/LetterTruckController.cs rename to ds-wms-service/DS.WMS.OpApi/Controllers/LetterTruckController.cs index 2ea1f13f..5363b31b 100644 --- a/ds-wms-service/DS.WMS.MainApi/Controllers/LetterTruckController.cs +++ b/ds-wms-service/DS.WMS.OpApi/Controllers/LetterTruckController.cs @@ -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; /// /// 函电信息派车通知服务 diff --git a/ds-wms-service/DS.WMS.MainApi/Controllers/LetterYardController.cs b/ds-wms-service/DS.WMS.OpApi/Controllers/LetterYardController.cs similarity index 97% rename from ds-wms-service/DS.WMS.MainApi/Controllers/LetterYardController.cs rename to ds-wms-service/DS.WMS.OpApi/Controllers/LetterYardController.cs index 4455a932..8b714412 100644 --- a/ds-wms-service/DS.WMS.MainApi/Controllers/LetterYardController.cs +++ b/ds-wms-service/DS.WMS.OpApi/Controllers/LetterYardController.cs @@ -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; /// /// 函电信息入货通知服务 diff --git a/ds-wms-service/DS.WMS.MainApi/Controllers/OpCtnController.cs b/ds-wms-service/DS.WMS.OpApi/Controllers/OpCtnController.cs similarity index 97% rename from ds-wms-service/DS.WMS.MainApi/Controllers/OpCtnController.cs rename to ds-wms-service/DS.WMS.OpApi/Controllers/OpCtnController.cs index 60ef58fb..1483a570 100644 --- a/ds-wms-service/DS.WMS.MainApi/Controllers/OpCtnController.cs +++ b/ds-wms-service/DS.WMS.OpApi/Controllers/OpCtnController.cs @@ -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; /// /// 集装箱信息服务 diff --git a/ds-wms-service/DS.WMS.MainApi/Controllers/SeaExportBillManageController.cs b/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportBillManageController.cs similarity index 97% rename from ds-wms-service/DS.WMS.MainApi/Controllers/SeaExportBillManageController.cs rename to ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportBillManageController.cs index 637d3fc1..cec3f2b0 100644 --- a/ds-wms-service/DS.WMS.MainApi/Controllers/SeaExportBillManageController.cs +++ b/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportBillManageController.cs @@ -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; /// /// 海运出口提单信息服务 diff --git a/ds-wms-service/DS.WMS.MainApi/Controllers/SeaExportController.cs b/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportController.cs similarity index 97% rename from ds-wms-service/DS.WMS.MainApi/Controllers/SeaExportController.cs rename to ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportController.cs index 7933c92b..104f3f01 100644 --- a/ds-wms-service/DS.WMS.MainApi/Controllers/SeaExportController.cs +++ b/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportController.cs @@ -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; /// /// 海运出口信息-模块 diff --git a/ds-wms-service/DS.WMS.OpApi/DS.WMS.OpApi.csproj b/ds-wms-service/DS.WMS.OpApi/DS.WMS.OpApi.csproj index 8823928d..0813f662 100644 --- a/ds-wms-service/DS.WMS.OpApi/DS.WMS.OpApi.csproj +++ b/ds-wms-service/DS.WMS.OpApi/DS.WMS.OpApi.csproj @@ -5,6 +5,21 @@ enable enable true + True + bin\Debug\net8.0\Api.xml + + + + + + + + + + + + + diff --git a/ds-wms-service/DS.WMS.OpApi/Logs/internal-nlog.txt b/ds-wms-service/DS.WMS.OpApi/Logs/internal-nlog.txt new file mode 100644 index 00000000..5f6df8b4 --- /dev/null +++ b/ds-wms-service/DS.WMS.OpApi/Logs/internal-nlog.txt @@ -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. diff --git a/ds-wms-service/DS.WMS.OpApi/Program.cs b/ds-wms-service/DS.WMS.OpApi/Program.cs index 732d1b5f..59b58a9c 100644 --- a/ds-wms-service/DS.WMS.OpApi/Program.cs +++ b/ds-wms-service/DS.WMS.OpApi/Program.cs @@ -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(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(); +// //־м +// app.UseMiddleware(); + +// ȿ֤ +app.UseAuthentication(); +// ȻȨм +app.UseAuthorization(); +app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); + +app.Run(); \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.OpApi/Properties/launchSettings.json b/ds-wms-service/DS.WMS.OpApi/Properties/launchSettings.json index b7821272..dc57bbd8 100644 --- a/ds-wms-service/DS.WMS.OpApi/Properties/launchSettings.json +++ b/ds-wms-service/DS.WMS.OpApi/Properties/launchSettings.json @@ -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" + } } } }