付费申请相关类文件

usertest
嵇文龙 6 months ago
parent fbb0e28103
commit 91623a0a05

@ -0,0 +1,165 @@
using System.ComponentModel;
using DS.WMS.Core.Fee.Entity;
using SqlSugar;
namespace DS.WMS.Core.Fee.Dtos
{
public class FeeApplicationDto
{
/// <summary>
/// 申请单编号
/// </summary>
[SugarColumn(ColumnDescription = "申请单编号", IsNullable = false, Length = 20)]
public string ApplicationNO { get; set; }
/// <summary>
/// 申请单状态
/// </summary>
public ApplicationStatus Status { get; set; }
/// <summary>
/// 人民币申请金额
/// </summary>
public decimal? AmountRMB { get; set; }
/// <summary>
/// 美元申请金额
/// </summary>
public decimal? AmountUSD { get; set; }
/// <summary>
/// 申请币别
/// </summary>
public string Currency { get; set; }
/// <summary>
/// 折算汇率
/// </summary>
public decimal ExchangeRate { get; set; }
/// <summary>
/// 审核人
/// </summary>
public long? AuditerId { get; set; }
/// <summary>
/// 审核人名称
/// </summary>
[SugarColumn(ColumnDescription = "审核人名称")]
public string? AuditerName { get; set; }
/// <summary>
/// 审核时间
/// </summary>
public DateTime? AuditTime { get; set; }
/// <summary>
/// 审核备注
/// </summary>
public string? AuditRemark { get; set; }
/// <summary>
/// 是否已打印
/// </summary>
public bool IsPrinted { get; set; }
/// <summary>
/// 打印次数
/// </summary>
public int PrintTimes { get; set; }
/// <summary>
/// 打印人
/// </summary>
public long? PrinterId { get; set; }
/// <summary>
/// 打印人名称
/// </summary>
public string? PrinterName { get; set; }
/// <summary>
/// 打印时间
/// </summary>
public DateTime? PrintTime { get; set; }
/// <summary>
/// 驳回原因
/// </summary>
public string? Reason { get; set; }
/// <summary>
/// 客户名称
/// </summary>
public string? CustomerName { get; set; }
/// <summary>
/// 结算方式
/// </summary>
public int Type { get; set; }
/// <summary>
/// 结算人
/// </summary>
public long? SettlerId { get; set; }
/// <summary>
/// 结算人名称
/// </summary>
public string? SettlerName { get; set; }
/// <summary>
/// 结算时间
/// </summary>
public DateTime? SettlementTime { get; set; }
/// <summary>
/// 支票备注
/// </summary>
public string? ChequeRemarks { get; set; }
/// <summary>
/// 发票号
/// </summary>
public string? InvoiceNO { get; set; }
/// <summary>
/// 发票日期
/// </summary>
public DateTime? InvoiceDate { get; set; }
/// <summary>
/// 开票金额
/// </summary>
public decimal? InvoiceAmount { get; set; }
/// <summary>
/// 客户银行账号
/// </summary>
public string? CustomerBAN { get; set; }
/// <summary>
/// 所属分部
/// </summary>
public long? SaleDeptId { get; set; }
public string? SaleDeptName { get; set; }
/// <summary>
/// 备注
/// </summary>
public string? Note { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 创建人
/// </summary>
public long CreateBy { get; set; }
public string CreateByName { get; set; }
}
}

@ -0,0 +1,145 @@
using System.ComponentModel;
using DS.Module.Core.Data;
using SqlSugar;
namespace DS.WMS.Core.Fee.Entity
{
/// <summary>
/// 申请单基类
/// </summary>
public abstract class ApplicationBase : BaseModelV2<long>
{
/// <summary>
/// 申请单编号
/// </summary>
[SugarColumn(ColumnDescription = "申请单编号", IsNullable = false, Length = 20)]
public string ApplicationNO { get; set; }
/// <summary>
/// 申请单状态
/// </summary>
[SugarColumn(ColumnDescription = "申请状态")]
public ApplicationStatus Status { get; set; }
/// <summary>
/// 人民币申请金额
/// </summary>
[SugarColumn(ColumnDescription = "人民币申请金额")]
public decimal? AmountRMB { get; set; }
/// <summary>
/// 美元申请金额
/// </summary>
[SugarColumn(ColumnDescription = "美元申请金额")]
public decimal? AmountUSD { get; set; }
/// <summary>
/// 申请币别
/// </summary>
[SugarColumn(ColumnDescription = "申请币别", IsNullable = false, Length = 3)]
public string Currency { get; set; }
/// <summary>
/// 折算汇率
/// </summary>
[SugarColumn(ColumnDescription = "折算汇率")]
public decimal ExchangeRate { get; set; }
/// <summary>
/// 审核人
/// </summary>
[SugarColumn(ColumnDescription = "审核人")]
public long? AuditerId { get; set; }
/// <summary>
/// 审核人名称
/// </summary>
[SugarColumn(ColumnDescription = "审核人名称")]
public string? AuditerName { get; set; }
/// <summary>
/// 审核时间
/// </summary>
[SugarColumn(ColumnDescription = "审核时间")]
public DateTime? AuditTime { get; set; }
/// <summary>
/// 审核备注
/// </summary>
[SugarColumn(ColumnDescription = "审核备注", Length = 200)]
public string? AuditRemark { get; set; }
/// <summary>
/// 是否已打印
/// </summary>
[SugarColumn(ColumnDescription = "是否已打印", DefaultValue = "0")]
public bool IsPrinted { get; set; }
/// <summary>
/// 打印次数
/// </summary>
[SugarColumn(ColumnDescription = "打印次数", DefaultValue = "0")]
public int PrintTimes { get; set; }
/// <summary>
/// 打印人
/// </summary>
[SugarColumn(ColumnDescription = "打印人")]
public long? PrinterId { get; set; }
/// <summary>
/// 打印人名称
/// </summary>
[SugarColumn(ColumnDescription = "打印人名称")]
public string? PrinterName { get; set; }
/// <summary>
/// 打印时间
/// </summary>
[SugarColumn(ColumnDescription = "打印时间")]
public DateTime? PrintTime { get; set; }
/// <summary>
/// 驳回原因
/// </summary>
[SugarColumn(ColumnDescription = "驳回原因", Length = 200)]
public string? Reason { get; set; }
/// <summary>
/// 费用明细
/// </summary>
[Navigate(NavigateType.OneToMany, nameof(FeeApplicationDetail.ApplicationId))]
public List<FeeApplicationDetail> Details { get; set; }
}
/// <summary>
/// 申请单状态
/// </summary>
public enum ApplicationStatus
{
/// <summary>
/// 未提交
/// </summary>
[Description("未提交")]
Pending = 0,
/// <summary>
/// 提交审核
/// </summary>
[Description("提交审核")]
AuditSubmittd = 1,
/// <summary>
/// 审核通过
/// </summary>
[Description("审核通过")]
AuditPassed = 2,
/// <summary>
/// 审核驳回
/// </summary>
[Description("审核驳回")]
AuditRejected = 3
}
}

@ -0,0 +1,79 @@
using SqlSugar;
namespace DS.WMS.Core.Fee.Entity
{
/// <summary>
/// 付费申请
/// </summary>
[SugarTable("fee_application", TableDescription = "付费申请")]
public class FeeApplication : ApplicationBase
{
/// <summary>
/// 客户名称
/// </summary>
[SugarColumn(ColumnDescription = "客户名称", Length = 200)]
public string? CustomerName { get; set; }
/// <summary>
/// 结算方式
/// </summary>
[SugarColumn(ColumnDescription = "结算方式")]
public int Type { get; set; }
/// <summary>
/// 结算人
/// </summary>
[SugarColumn(ColumnDescription = "结算人")]
public long? SettlerId { get; set; }
/// <summary>
/// 结算人名称
/// </summary>
[SugarColumn(ColumnDescription = "结算人名称")]
public string? SettlerName { get; set; }
/// <summary>
/// 结算时间
/// </summary>
[SugarColumn(ColumnDescription = "结算时间")]
public DateTime? SettlementTime { get; set; }
/// <summary>
/// 支票备注
/// </summary>
[SugarColumn(ColumnDescription = "支票备注")]
public string? ChequeRemarks { get; set; }
/// <summary>
/// 发票号
/// </summary>
[SugarColumn(ColumnDescription = "发票号")]
public string? InvoiceNO { get; set; }
/// <summary>
/// 发票日期
/// </summary>
[SugarColumn(ColumnDescription = "发票日期")]
public DateTime? InvoiceDate { get; set; }
/// <summary>
/// 开票金额
/// </summary>
[SugarColumn(ColumnDescription = "开票金额")]
public decimal? InvoiceAmount { get; set; }
/// <summary>
/// 客户银行账号
/// </summary>
[SugarColumn(ColumnDescription = "客户银行账号", Length = 50)]
public string? CustomerBAN { get; set; }
/// <summary>
/// 所属分部
/// </summary>
[SugarColumn(ColumnDescription = "所属分部")]
public long? SaleDeptId { get; set; }
}
}

@ -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
{
/// <summary>
/// 费用申请明细
/// </summary>
[SugarTable("fee_application_detail", TableDescription = "费用申请明细")]
public class FeeApplicationDetail : BaseModelV2<long>
{
/// <summary>
/// 申请单ID
/// </summary>
[SugarColumn(ColumnDescription = "申请单ID")]
public long ApplicationId { get; set; }
/// <summary>
/// 业务ID
/// </summary>
[SugarColumn(ColumnDescription = "业务ID")]
public long BusinessId { get; set; }
/// <summary>
/// 业务类型
/// </summary>
[SugarColumn(ColumnDescription = "业务类型")]
public BusinessType BusinessType { get; set; }
/// <summary>
/// 结算对象名称
/// </summary>
[SugarColumn(ColumnDescription = "结算对象名称", Length = 200)]
public string? CustomerName { get; set; }
/// <summary>
/// 收付类型(收、付) 1应收 2 应付
/// </summary>
[SugarColumn(ColumnDescription = "收付类型(收、付)", DefaultValue = "1")]
public int FeeType { get; set; }
/// <summary>
/// 费用Id
/// </summary>
[SugarColumn(ColumnDescription = "费用Id")]
public long FeeId { get; set; }
/// <summary>
/// 费用名称
/// </summary>
[SugarColumn(ColumnDescription = "费用名称", Length = 100, IsNullable = true)]
public string? FeeName { get; set; }
/// <summary>
/// 类别
/// </summary>
[SugarColumn(ColumnDescription = "类别")]
public FeeCategory Category { get; set; }
/// <summary>
/// 金额
/// </summary>
[SugarColumn(ColumnDescription = "金额")]
public decimal Amount { get; set; }
/// <summary>
/// 已处理金额
/// </summary>
[SugarColumn(ColumnDescription = "已处理金额")]
public decimal ProcessedAmount { get; set; }
/// <summary>
/// 币别
/// </summary>
[SugarColumn(ColumnDescription = "币别", IsNullable = false, Length = 3)]
public string Currency { get; set; }
/// <summary>
/// 折算汇率
/// </summary>
[SugarColumn(ColumnDescription = "折算汇率")]
public decimal ExchangeRate { get; set; }
/// <summary>
/// 原始币别
/// </summary>
[SugarColumn(ColumnDescription = "原始币别", IsNullable = false, Length = 3)]
public string OriginalCurrency { get; set; }
/// <summary>
/// 金额
/// </summary>
[SugarColumn(ColumnDescription = "金额")]
public decimal? OriginalAmount { get; set; }
/// <summary>
/// 原始已处理金额
/// </summary>
[SugarColumn(ColumnDescription = "原始已处理金额")]
public decimal? OriginalProcessedAmount { get; set; }
}
/// <summary>
/// 费用明细类别
/// </summary>
public enum FeeCategory
{
//1-付费申请结算 2-收费自由结算 3-发票结算 4-收费申请 5-付费申请 6-发票申请 7-发票开出 8-付费自由结算 9-收费申请结算
/// <summary>
/// 付费申请结算
/// </summary>
[Description("付费申请结算")]
PaidApplicationSettlement = 1,
/// <summary>
/// 收费自由结算
/// </summary>
[Description("收费自由结算")]
ChargeFreeSettlement = 2,
/// <summary>
/// 发票结算
/// </summary>
[Description("发票结算")]
InvoiceSettlement = 3,
/// <summary>
/// 收费申请
/// </summary>
[Description("收费申请")]
ChargeApplication = 4,
/// <summary>
/// 付费申请
/// </summary>
[Description("付费申请")]
PaidApplication = 5,
/// <summary>
/// 发票申请
/// </summary>
[Description("发票申请")]
InvoiceApplication = 6,
/// <summary>
/// 发票开出
/// </summary>
[Description("发票开出")]
InvoiceIssuance = 7,
/// <summary>
/// 付费自由结算
/// </summary>
[Description("付费自由结算")]
PaidFreeSettlement = 8,
/// <summary>
/// 收费申请结算
/// </summary>
[Description("收费申请结算")]
ChargeApplicationSettlement = 9
}
}

@ -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
{
/// <summary>
/// 付费申请
/// </summary>
public interface IFeeApplication
{
/// <summary>
/// 获取分页列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Task<DataResult<List<FeeApplicationDto>>> GetListAsync(PageRequest request);
/// <summary>
/// 提交申请单
/// </summary>
/// <param name="application">申请单</param>
/// <returns></returns>
Task<DataResult> SaveAsync(FeeApplication application);
/// <summary>
/// 删除申请单
/// </summary>
/// <param name="ids">申请单ID</param>
/// <returns></returns>
Task<DataResult> DeleteAsync(params long[] ids);
/// <summary>
/// 发起审批工作流
/// </summary>
/// <param name="remark">审批备注</param>
/// <param name="idArray">申请单ID</param>
/// <returns></returns>
Task<DataResult> SubmitForApprovalAsync(string remark, params long[] idArray);
/// <summary>
/// 撤销审批
/// </summary>
/// <param name="ids">申请单ID</param>
/// <returns></returns>
Task<DataResult> WithdrawAsync(params long[] ids);
/// <summary>
/// 申请单审核
/// </summary>
/// <param name="status"></param>
/// <param name="reason"></param>
/// <param name="ids">申请单ID</param>
/// <returns></returns>
//Task<DataResult> AuditAsync(int status, string reason, params long[] ids);
}
}

@ -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
{
/// <summary>
/// 付费申请实现
/// </summary>
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<ISqlSugarClient>();
user = serviceProvider.GetRequiredService<IUser>();
saasService = serviceProvider.GetRequiredService<ISaasDbService>();
flowService = serviceProvider.GetRequiredService<IClientFlowInstanceService>();
}
/// <summary>
/// 获取分页列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public async Task<DataResult<List<FeeApplicationDto>>> GetListAsync(PageRequest request)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
var data = await tenantDb.Queryable<FeeApplication>()
.Where(whereList)
.Select<FeeApplicationDto>()
.ToQueryPageAsync(request.PageCondition);
//关联用户名称
var userIds = data.Data.Select(x => x.CreateBy).Distinct(); //.Union(data.Data.Select(x => x.CreateBy))
var users = await db.Queryable<SysUser>().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<DataResult> SaveAsync(FeeApplication application)
{
throw new NotImplementedException();
}
public async Task<DataResult> DeleteAsync(params long[] ids)
{
throw new NotImplementedException();
}
public async Task<DataResult> SubmitForApprovalAsync(string remark, params long[] idArray)
{
throw new NotImplementedException();
}
public async Task<DataResult> WithdrawAsync(params long[] ids)
{
throw new NotImplementedException();
}
}
}

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

@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project>
<PropertyGroup>
<_PublishTargetUrl>D:\Publish\DS8\FeeApi</_PublishTargetUrl>
<History>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||;</History>
<History>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||;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>
Loading…
Cancel
Save