diff --git a/ds-wms-service/DS.WMS.Core/Fee/Dtos/FeeApplicationDto.cs b/ds-wms-service/DS.WMS.Core/Fee/Dtos/FeeApplicationDto.cs new file mode 100644 index 00000000..877f29f5 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Fee/Dtos/FeeApplicationDto.cs @@ -0,0 +1,165 @@ +using System.ComponentModel; +using DS.WMS.Core.Fee.Entity; +using SqlSugar; + +namespace DS.WMS.Core.Fee.Dtos +{ + public class FeeApplicationDto + { + /// + /// 申请单编号 + /// + [SugarColumn(ColumnDescription = "申请单编号", IsNullable = false, Length = 20)] + public string ApplicationNO { get; set; } + + /// + /// 申请单状态 + /// + public ApplicationStatus Status { get; set; } + + /// + /// 人民币申请金额 + /// + public decimal? AmountRMB { get; set; } + + /// + /// 美元申请金额 + /// + public decimal? AmountUSD { get; set; } + + /// + /// 申请币别 + /// + public string Currency { get; set; } + + /// + /// 折算汇率 + /// + public decimal ExchangeRate { get; set; } + + /// + /// 审核人 + /// + public long? AuditerId { get; set; } + + /// + /// 审核人名称 + /// + [SugarColumn(ColumnDescription = "审核人名称")] + public string? AuditerName { get; set; } + + /// + /// 审核时间 + /// + public DateTime? AuditTime { get; set; } + + /// + /// 审核备注 + /// + public string? AuditRemark { get; set; } + + /// + /// 是否已打印 + /// + public bool IsPrinted { get; set; } + + /// + /// 打印次数 + /// + public int PrintTimes { get; set; } + + /// + /// 打印人 + /// + public long? PrinterId { get; set; } + + /// + /// 打印人名称 + /// + public string? PrinterName { get; set; } + + /// + /// 打印时间 + /// + public DateTime? PrintTime { get; set; } + + /// + /// 驳回原因 + /// + public string? Reason { get; set; } + + /// + /// 客户名称 + /// + public string? CustomerName { get; set; } + + /// + /// 结算方式 + /// + public int Type { get; set; } + + /// + /// 结算人 + /// + public long? SettlerId { get; set; } + + /// + /// 结算人名称 + /// + public string? SettlerName { get; set; } + + /// + /// 结算时间 + /// + public DateTime? SettlementTime { get; set; } + + /// + /// 支票备注 + /// + public string? ChequeRemarks { get; set; } + + /// + /// 发票号 + /// + public string? InvoiceNO { get; set; } + + /// + /// 发票日期 + /// + public DateTime? InvoiceDate { get; set; } + + /// + /// 开票金额 + /// + public decimal? InvoiceAmount { get; set; } + + /// + /// 客户银行账号 + /// + public string? CustomerBAN { get; set; } + + /// + /// 所属分部 + /// + public long? SaleDeptId { get; set; } + + public string? SaleDeptName { get; set; } + + /// + /// 备注 + /// + public string? Note { get; set; } + + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + + /// + /// 创建人 + /// + public long CreateBy { get; set; } + + public string CreateByName { get; set; } + } +} diff --git a/ds-wms-service/DS.WMS.Core/Fee/Entity/ApplicationBase.cs b/ds-wms-service/DS.WMS.Core/Fee/Entity/ApplicationBase.cs new file mode 100644 index 00000000..04901bbb --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Fee/Entity/ApplicationBase.cs @@ -0,0 +1,145 @@ +using System.ComponentModel; +using DS.Module.Core.Data; +using SqlSugar; + +namespace DS.WMS.Core.Fee.Entity +{ + /// + /// 申请单基类 + /// + public abstract class ApplicationBase : BaseModelV2 + { + /// + /// 申请单编号 + /// + [SugarColumn(ColumnDescription = "申请单编号", IsNullable = false, Length = 20)] + public string ApplicationNO { get; set; } + + /// + /// 申请单状态 + /// + [SugarColumn(ColumnDescription = "申请状态")] + public ApplicationStatus Status { get; set; } + + /// + /// 人民币申请金额 + /// + [SugarColumn(ColumnDescription = "人民币申请金额")] + public decimal? AmountRMB { get; set; } + + /// + /// 美元申请金额 + /// + [SugarColumn(ColumnDescription = "美元申请金额")] + public decimal? AmountUSD { get; set; } + + /// + /// 申请币别 + /// + [SugarColumn(ColumnDescription = "申请币别", IsNullable = false, Length = 3)] + public string Currency { get; set; } + + /// + /// 折算汇率 + /// + [SugarColumn(ColumnDescription = "折算汇率")] + public decimal ExchangeRate { get; set; } + + /// + /// 审核人 + /// + [SugarColumn(ColumnDescription = "审核人")] + public long? AuditerId { get; set; } + + /// + /// 审核人名称 + /// + [SugarColumn(ColumnDescription = "审核人名称")] + public string? AuditerName { get; set; } + + /// + /// 审核时间 + /// + [SugarColumn(ColumnDescription = "审核时间")] + public DateTime? AuditTime { get; set; } + + /// + /// 审核备注 + /// + [SugarColumn(ColumnDescription = "审核备注", Length = 200)] + public string? AuditRemark { get; set; } + + /// + /// 是否已打印 + /// + [SugarColumn(ColumnDescription = "是否已打印", DefaultValue = "0")] + public bool IsPrinted { get; set; } + + /// + /// 打印次数 + /// + [SugarColumn(ColumnDescription = "打印次数", DefaultValue = "0")] + public int PrintTimes { get; set; } + + /// + /// 打印人 + /// + [SugarColumn(ColumnDescription = "打印人")] + public long? PrinterId { get; set; } + + /// + /// 打印人名称 + /// + [SugarColumn(ColumnDescription = "打印人名称")] + public string? PrinterName { get; set; } + + /// + /// 打印时间 + /// + [SugarColumn(ColumnDescription = "打印时间")] + public DateTime? PrintTime { get; set; } + + /// + /// 驳回原因 + /// + [SugarColumn(ColumnDescription = "驳回原因", Length = 200)] + public string? Reason { get; set; } + + /// + /// 费用明细 + /// + [Navigate(NavigateType.OneToMany, nameof(FeeApplicationDetail.ApplicationId))] + public List Details { get; set; } + + } + + /// + /// 申请单状态 + /// + public enum ApplicationStatus + { + /// + /// 未提交 + /// + [Description("未提交")] + Pending = 0, + + /// + /// 提交审核 + /// + [Description("提交审核")] + AuditSubmittd = 1, + + /// + /// 审核通过 + /// + [Description("审核通过")] + AuditPassed = 2, + + /// + /// 审核驳回 + /// + [Description("审核驳回")] + AuditRejected = 3 + } +} diff --git a/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeApplication.cs b/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeApplication.cs new file mode 100644 index 00000000..5f2fe299 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeApplication.cs @@ -0,0 +1,79 @@ +using SqlSugar; + +namespace DS.WMS.Core.Fee.Entity +{ + /// + /// 付费申请 + /// + [SugarTable("fee_application", TableDescription = "付费申请")] + public class FeeApplication : ApplicationBase + { + /// + /// 客户名称 + /// + [SugarColumn(ColumnDescription = "客户名称", Length = 200)] + public string? CustomerName { get; set; } + + /// + /// 结算方式 + /// + [SugarColumn(ColumnDescription = "结算方式")] + public int Type { get; set; } + + /// + /// 结算人 + /// + [SugarColumn(ColumnDescription = "结算人")] + public long? SettlerId { get; set; } + + /// + /// 结算人名称 + /// + [SugarColumn(ColumnDescription = "结算人名称")] + public string? SettlerName { get; set; } + + /// + /// 结算时间 + /// + [SugarColumn(ColumnDescription = "结算时间")] + public DateTime? SettlementTime { get; set; } + + /// + /// 支票备注 + /// + [SugarColumn(ColumnDescription = "支票备注")] + public string? ChequeRemarks { get; set; } + + /// + /// 发票号 + /// + [SugarColumn(ColumnDescription = "发票号")] + public string? InvoiceNO { get; set; } + + /// + /// 发票日期 + /// + [SugarColumn(ColumnDescription = "发票日期")] + public DateTime? InvoiceDate { get; set; } + + /// + /// 开票金额 + /// + [SugarColumn(ColumnDescription = "开票金额")] + public decimal? InvoiceAmount { get; set; } + + /// + /// 客户银行账号 + /// + [SugarColumn(ColumnDescription = "客户银行账号", Length = 50)] + public string? CustomerBAN { get; set; } + + /// + /// 所属分部 + /// + [SugarColumn(ColumnDescription = "所属分部")] + public long? SaleDeptId { get; set; } + + } + +} diff --git a/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeApplicationDetail.cs b/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeApplicationDetail.cs new file mode 100644 index 00000000..b71116de --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeApplicationDetail.cs @@ -0,0 +1,167 @@ +using DS.Module.Core.Data; +using DS.WMS.Core.Op.Entity; +using SqlSugar; +using System.ComponentModel; + +namespace DS.WMS.Core.Fee.Entity +{ + /// + /// 费用申请明细 + /// + [SugarTable("fee_application_detail", TableDescription = "费用申请明细")] + public class FeeApplicationDetail : BaseModelV2 + { + /// + /// 申请单ID + /// + [SugarColumn(ColumnDescription = "申请单ID")] + public long ApplicationId { get; set; } + + /// + /// 业务ID + /// + [SugarColumn(ColumnDescription = "业务ID")] + public long BusinessId { get; set; } + + /// + /// 业务类型 + /// + [SugarColumn(ColumnDescription = "业务类型")] + public BusinessType BusinessType { get; set; } + + /// + /// 结算对象名称 + /// + [SugarColumn(ColumnDescription = "结算对象名称", Length = 200)] + public string? CustomerName { get; set; } + + /// + /// 收付类型(收、付) 1应收 2 应付 + /// + [SugarColumn(ColumnDescription = "收付类型(收、付)", DefaultValue = "1")] + public int FeeType { get; set; } + + /// + /// 费用Id + /// + [SugarColumn(ColumnDescription = "费用Id")] + public long FeeId { get; set; } + + /// + /// 费用名称 + /// + [SugarColumn(ColumnDescription = "费用名称", Length = 100, IsNullable = true)] + public string? FeeName { get; set; } + + /// + /// 类别 + /// + [SugarColumn(ColumnDescription = "类别")] + public FeeCategory Category { get; set; } + + /// + /// 金额 + /// + [SugarColumn(ColumnDescription = "金额")] + public decimal Amount { get; set; } + + /// + /// 已处理金额 + /// + [SugarColumn(ColumnDescription = "已处理金额")] + public decimal ProcessedAmount { get; set; } + + /// + /// 币别 + /// + [SugarColumn(ColumnDescription = "币别", IsNullable = false, Length = 3)] + public string Currency { get; set; } + + /// + /// 折算汇率 + /// + [SugarColumn(ColumnDescription = "折算汇率")] + public decimal ExchangeRate { get; set; } + + /// + /// 原始币别 + /// + [SugarColumn(ColumnDescription = "原始币别", IsNullable = false, Length = 3)] + public string OriginalCurrency { get; set; } + + /// + /// 金额 + /// + [SugarColumn(ColumnDescription = "金额")] + public decimal? OriginalAmount { get; set; } + + /// + /// 原始已处理金额 + /// + [SugarColumn(ColumnDescription = "原始已处理金额")] + public decimal? OriginalProcessedAmount { get; set; } + + } + + /// + /// 费用明细类别 + /// + public enum FeeCategory + { + //1-付费申请结算 2-收费自由结算 3-发票结算 4-收费申请 5-付费申请 6-发票申请 7-发票开出 8-付费自由结算 9-收费申请结算 + + /// + /// 付费申请结算 + /// + [Description("付费申请结算")] + PaidApplicationSettlement = 1, + + /// + /// 收费自由结算 + /// + [Description("收费自由结算")] + ChargeFreeSettlement = 2, + + /// + /// 发票结算 + /// + [Description("发票结算")] + InvoiceSettlement = 3, + + /// + /// 收费申请 + /// + [Description("收费申请")] + ChargeApplication = 4, + + /// + /// 付费申请 + /// + [Description("付费申请")] + PaidApplication = 5, + + /// + /// 发票申请 + /// + [Description("发票申请")] + InvoiceApplication = 6, + + /// + /// 发票开出 + /// + [Description("发票开出")] + InvoiceIssuance = 7, + + /// + /// 付费自由结算 + /// + [Description("付费自由结算")] + PaidFreeSettlement = 8, + + /// + /// 收费申请结算 + /// + [Description("收费申请结算")] + ChargeApplicationSettlement = 9 + } +} diff --git a/ds-wms-service/DS.WMS.Core/Fee/Interface/IFeeApplication.cs b/ds-wms-service/DS.WMS.Core/Fee/Interface/IFeeApplication.cs new file mode 100644 index 00000000..0b006c57 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Fee/Interface/IFeeApplication.cs @@ -0,0 +1,58 @@ +using DS.Module.Core; +using DS.WMS.Core.Fee.Dtos; +using DS.WMS.Core.Fee.Entity; + +namespace DS.WMS.Core.Fee.Interface +{ + /// + /// 付费申请 + /// + public interface IFeeApplication + { + /// + /// 获取分页列表 + /// + /// + /// + Task>> GetListAsync(PageRequest request); + + /// + /// 提交申请单 + /// + /// 申请单 + /// + Task SaveAsync(FeeApplication application); + + /// + /// 删除申请单 + /// + /// 申请单ID + /// + Task DeleteAsync(params long[] ids); + + /// + /// 发起审批工作流 + /// + /// 审批备注 + /// 申请单ID + /// + Task SubmitForApprovalAsync(string remark, params long[] idArray); + + /// + /// 撤销审批 + /// + /// 申请单ID + /// + Task WithdrawAsync(params long[] ids); + + /// + /// 申请单审核 + /// + /// + /// + /// 申请单ID + /// + //Task AuditAsync(int status, string reason, params long[] ids); + + } +} diff --git a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeApplicationService.cs b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeApplicationService.cs new file mode 100644 index 00000000..0a9ea14a --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeApplicationService.cs @@ -0,0 +1,83 @@ +using DS.Module.Core; +using DS.Module.SqlSugar; +using DS.Module.UserModule; +using DS.WMS.Core.Fee.Dtos; +using DS.WMS.Core.Fee.Entity; +using DS.WMS.Core.Fee.Interface; +using DS.WMS.Core.Flow.Interface; +using Microsoft.Extensions.DependencyInjection; +using SqlSugar; +using DS.Module.Core.Extensions; +using DS.WMS.Core.Sys.Entity; + +namespace DS.WMS.Core.Fee.Method +{ + /// + /// 付费申请实现 + /// + public class FeeApplicationService : IFeeApplication + { + const string DefaultCurrency = "CNY";//默认本币 + + readonly ISqlSugarClient db; + readonly IUser user; + readonly ISaasDbService saasService; + readonly IClientFlowInstanceService flowService; + + public FeeApplicationService(IServiceProvider serviceProvider) + { + db = serviceProvider.GetRequiredService(); + user = serviceProvider.GetRequiredService(); + saasService = serviceProvider.GetRequiredService(); + flowService = serviceProvider.GetRequiredService(); + } + + /// + /// 获取分页列表 + /// + /// + /// + public async Task>> GetListAsync(PageRequest request) + { + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition); + var data = await tenantDb.Queryable() + .Where(whereList) + .Select() + .ToQueryPageAsync(request.PageCondition); + + //关联用户名称 + var userIds = data.Data.Select(x => x.CreateBy).Distinct(); //.Union(data.Data.Select(x => x.CreateBy)) + var users = await db.Queryable().Where(x => userIds.Contains(x.Id)).Select(x => new { x.Id, x.UserName }).ToListAsync(); + + foreach (var item in data.Data) + { + item.CreateByName = users.Find(x => x.Id == item.CreateBy)?.UserName; + + } + + return data; + } + + public async Task SaveAsync(FeeApplication application) + { + throw new NotImplementedException(); + } + + public async Task DeleteAsync(params long[] ids) + { + throw new NotImplementedException(); + } + + + public async Task SubmitForApprovalAsync(string remark, params long[] idArray) + { + throw new NotImplementedException(); + } + + public async Task WithdrawAsync(params long[] ids) + { + throw new NotImplementedException(); + } + } +} diff --git a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeRecordService.cs b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeRecordService.cs index 5bf4f892..f1eaadf9 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeRecordService.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeRecordService.cs @@ -26,7 +26,7 @@ namespace DS.WMS.Core.Fee.Method public class FeeRecordService : IFeeRecordService { const long PERMISSION_ID = 1793490768447541248; - readonly string DefaultCurrency = "CNY";//默认本币 + const string DefaultCurrency = "CNY";//默认本币 private readonly IServiceProvider _serviceProvider; private readonly ISqlSugarClient db; diff --git a/ds-wms-service/DS.WMS.FeeApi/Properties/PublishProfiles/FolderProfile1.pubxml.user b/ds-wms-service/DS.WMS.FeeApi/Properties/PublishProfiles/FolderProfile1.pubxml.user index 08a8ed7d..4cf4d2b4 100644 --- a/ds-wms-service/DS.WMS.FeeApi/Properties/PublishProfiles/FolderProfile1.pubxml.user +++ b/ds-wms-service/DS.WMS.FeeApi/Properties/PublishProfiles/FolderProfile1.pubxml.user @@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. <_PublishTargetUrl>D:\Publish\DS8\FeeApi - True|2024-06-06T02:57:27.8273617Z||;True|2024-06-04T14:23:21.3742450+08:00||;True|2024-05-31T17:01:42.4717460+08:00||;True|2024-05-31T13:56:03.0734064+08:00||;True|2024-05-31T08:45:52.3549394+08:00||;True|2024-05-30T17:16:32.8907958+08:00||;True|2024-05-30T16:18:06.9957657+08:00||;True|2024-05-29T15:44:18.4051203+08:00||;True|2024-05-29T15:11:03.1518632+08:00||;True|2024-05-29T14:52:26.0823495+08:00||;True|2024-05-29T11:17:20.2245101+08:00||;True|2024-05-29T08:36:28.9569161+08:00||;True|2024-05-28T08:44:31.4427261+08:00||;False|2024-05-28T08:44:02.5254826+08:00||;True|2024-05-27T15:16:32.9413631+08:00||;True|2024-05-27T15:03:42.9803879+08:00||;True|2024-05-27T08:49:54.3933663+08:00||;True|2024-05-27T08:46:13.5862236+08:00||;True|2024-05-23T17:19:32.8154451+08:00||;True|2024-05-23T17:19:01.4587615+08:00||;True|2024-05-22T16:52:42.2166228+08:00||;True|2024-05-22T15:19:49.1773202+08:00||;True|2024-05-22T15:13:31.9485525+08:00||;True|2024-05-22T13:29:02.1355808+08:00||;True|2024-05-22T09:48:40.8753914+08:00||;True|2024-05-22T09:25:06.2068137+08:00||;True|2024-05-22T09:18:53.0759815+08:00||;True|2024-05-21T17:13:36.4091775+08:00||;True|2024-05-21T14:41:18.8486299+08:00||;True|2024-05-21T11:04:27.3649637+08:00||; + True|2024-06-06T09:41:51.1810315Z||;True|2024-06-06T10:57:27.8273617+08:00||;True|2024-06-04T14:23:21.3742450+08:00||;True|2024-05-31T17:01:42.4717460+08:00||;True|2024-05-31T13:56:03.0734064+08:00||;True|2024-05-31T08:45:52.3549394+08:00||;True|2024-05-30T17:16:32.8907958+08:00||;True|2024-05-30T16:18:06.9957657+08:00||;True|2024-05-29T15:44:18.4051203+08:00||;True|2024-05-29T15:11:03.1518632+08:00||;True|2024-05-29T14:52:26.0823495+08:00||;True|2024-05-29T11:17:20.2245101+08:00||;True|2024-05-29T08:36:28.9569161+08:00||;True|2024-05-28T08:44:31.4427261+08:00||;False|2024-05-28T08:44:02.5254826+08:00||;True|2024-05-27T15:16:32.9413631+08:00||;True|2024-05-27T15:03:42.9803879+08:00||;True|2024-05-27T08:49:54.3933663+08:00||;True|2024-05-27T08:46:13.5862236+08:00||;True|2024-05-23T17:19:32.8154451+08:00||;True|2024-05-23T17:19:01.4587615+08:00||;True|2024-05-22T16:52:42.2166228+08:00||;True|2024-05-22T15:19:49.1773202+08:00||;True|2024-05-22T15:13:31.9485525+08:00||;True|2024-05-22T13:29:02.1355808+08:00||;True|2024-05-22T09:48:40.8753914+08:00||;True|2024-05-22T09:25:06.2068137+08:00||;True|2024-05-22T09:18:53.0759815+08:00||;True|2024-05-21T17:13:36.4091775+08:00||;True|2024-05-21T14:41:18.8486299+08:00||;True|2024-05-21T11:04:27.3649637+08:00||; \ No newline at end of file