From 4019f8ca89c31d40d0b2d4559868aa607fc04f30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B5=87=E6=96=87=E9=BE=99?= Date: Thu, 31 Oct 2024 11:35:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E5=8D=95=E5=AE=A1=E6=A0=B8=E8=B4=B9?= =?UTF-8?q?=E7=94=A8=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DS.Module.Core/Enums/FeeStatus.cs | 36 +++++++++---- ds-wms-service/DS.WMS.Core/DS.WMS.Core.csproj | 2 - .../DS.WMS.Core/Fee/Method/FeeAuditService.cs | 54 +++++++++---------- .../Fee/Method/FeeRecordService.cs | 18 +++---- .../DS.WMS.Core/Op/Dtos/SeaExportRes.cs | 2 +- .../Op/Entity/BusinessFeeStatus.cs | 9 ++-- .../Interface/IFeeBillTaskService.cs | 10 ++++ .../Method/FeeBillTaskService.cs | 20 +++++++ 8 files changed, 98 insertions(+), 53 deletions(-) create mode 100644 ds-wms-service/DS.WMS.Core/TaskInteraction/Interface/IFeeBillTaskService.cs create mode 100644 ds-wms-service/DS.WMS.Core/TaskInteraction/Method/FeeBillTaskService.cs diff --git a/ds-wms-service/DS.Module.Core/Enums/FeeStatus.cs b/ds-wms-service/DS.Module.Core/Enums/FeeStatus.cs index 14408f4d..c238114b 100644 --- a/ds-wms-service/DS.Module.Core/Enums/FeeStatus.cs +++ b/ds-wms-service/DS.Module.Core/Enums/FeeStatus.cs @@ -170,22 +170,40 @@ namespace DS.Module.Core Pending = 0, /// - /// 提交审核 + /// 应收待确认 /// - [Description("提交审核")] - AuditSubmitted = 1, + [Description("应收待确认")] + RecvSubmitted = 1, /// - /// 审核通过 + /// 应收审核通过 /// - [Description("审核通过")] - AuditPassed = 2, + [Description("应收审核通过")] + RecvPassed = 2, /// - /// 驳回提交 + /// 应收审核驳回 /// - [Description("驳回提交")] - Rejected = 3 + [Description("应收审核驳回")] + RecvRejected = -1, + + /// + /// 应付待确认 + /// + [Description("应付待确认")] + PaySubmitted = 3, + + /// + /// 应付审核通过 + /// + [Description("应付审核通过")] + PayPassed = 4, + + /// + /// 应付审核驳回 + /// + [Description("应付审核驳回")] + PayRejected = -2, } /// 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 cd8adcdf..53ef0798 100644 --- a/ds-wms-service/DS.WMS.Core/DS.WMS.Core.csproj +++ b/ds-wms-service/DS.WMS.Core/DS.WMS.Core.csproj @@ -42,8 +42,6 @@ - - diff --git a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeAuditService.cs b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeAuditService.cs index 529a94fd..96f052aa 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeAuditService.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeAuditService.cs @@ -707,7 +707,7 @@ namespace DS.WMS.Core.Fee.Method if (bizList.Count == 0) return DataResult.FailedWithDesc(nameof(MultiLanguageConst.EmptyData)); - if (bizList.Any(x => x.BillAuditStatus != BillAuditStatus.AuditSubmitted)) + if (bizList.Any(x => x.BillAuditStatus != BillAuditStatus.RecvSubmitted && x.BillAuditStatus != BillAuditStatus.PaySubmitted)) return DataResult.FailedWithDesc(nameof(MultiLanguageConst.BusinessAuditStatusError)); if (hasAuthorized) @@ -904,32 +904,32 @@ namespace DS.WMS.Core.Fee.Method } break; - case TaskBaseTypeEnum.FEE_BUSINESS_AUDIT: - FeeStatus status = FeeStatus.RejectSubmission; - if (callback.FlowStatus == FlowStatusEnum.Approve) - { - biz.BillAuditStatus = BillAuditStatus.AuditPassed; - status = FeeStatus.AuditPassed; - } - else if (callback.FlowStatus == FlowStatusEnum.Reject) - { - biz.BillAuditStatus = BillAuditStatus.Rejected; - } - - await TenantDb.Updateable(biz).UpdateColumns(x => new - { - x.BillAuditStatus - }).ExecuteCommandAsync(); - - await TenantDb.Updateable() - .SetColumns(x => x.FeeStatus == status) - .SetColumns(x => x.AuditBy == UserId) - .SetColumns(x => x.AuditOperator == User.UserName) - .SetColumns(x => x.AuditDate == dtNow) - .Where(x => x.BusinessId == biz.BusinessId && x.BusinessType == biz.BusinessType && - x.FeeStatus != FeeStatus.PartialSettlement && x.FeeStatus != FeeStatus.SettlementCompleted).ExecuteCommandAsync(); - - break; + //case TaskBaseTypeEnum.FEE_BUSINESS_AUDIT: + // FeeStatus status = FeeStatus.RejectSubmission; + // if (callback.FlowStatus == FlowStatusEnum.Approve) + // { + // biz.BillAuditStatus = BillAuditStatus.AuditPassed; + // status = FeeStatus.AuditPassed; + // } + // else if (callback.FlowStatus == FlowStatusEnum.Reject) + // { + // biz.BillAuditStatus = BillAuditStatus.Rejected; + // } + + // await TenantDb.Updateable(biz).UpdateColumns(x => new + // { + // x.BillAuditStatus + // }).ExecuteCommandAsync(); + + // await TenantDb.Updateable() + // .SetColumns(x => x.FeeStatus == status) + // .SetColumns(x => x.AuditBy == UserId) + // .SetColumns(x => x.AuditOperator == User.UserName) + // .SetColumns(x => x.AuditDate == dtNow) + // .Where(x => x.BusinessId == biz.BusinessId && x.BusinessType == biz.BusinessType && + // x.FeeStatus != FeeStatus.PartialSettlement && x.FeeStatus != FeeStatus.SettlementCompleted).ExecuteCommandAsync(); + + // break; } ////驳回申请则逻辑删除关联工作流 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 ab6d1f32..a9ab5862 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeRecordService.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeRecordService.cs @@ -29,7 +29,7 @@ namespace DS.WMS.Core.Fee.Method readonly IClientFlowInstanceService flowService; readonly IFeeTaskService feeTaskService; - readonly ISeaExportTaskService taskService; + readonly IFeeBillTaskService billService; /// /// 初始化 @@ -39,7 +39,7 @@ namespace DS.WMS.Core.Fee.Method { flowService = serviceProvider.GetRequiredService(); feeTaskService = serviceProvider.GetRequiredService(); - taskService = serviceProvider.GetRequiredService(); + billService = serviceProvider.GetRequiredService(); } /// @@ -893,7 +893,7 @@ namespace DS.WMS.Core.Fee.Method return DataResult.FailedWithDesc(nameof(MultiLanguageConst.BusinessNotFound)); if (entity.IsFeeLocking.GetValueOrDefault()) return DataResult.FailedWithDesc(nameof(MultiLanguageConst.FeeLocked)); - if (entity.BillAuditStatus == BillAuditStatus.AuditSubmitted || entity.BillAuditStatus == BillAuditStatus.AuditPassed) + if (entity.BillAuditStatus == BillAuditStatus.PayPassed || entity.BillAuditStatus == BillAuditStatus.PaySubmitted || entity.BillAuditStatus == BillAuditStatus.RecvSubmitted) return DataResult.Failed(string.Format(MultiLanguageConst.BusinessStatusError, entity.BillAuditStatus.GetDescription())); if (await flowService.IsRunning(BIZ_TASK_TYPE, type, bid)) @@ -903,7 +903,7 @@ namespace DS.WMS.Core.Fee.Method await TenantDb.Ado.BeginTranAsync(); try { - if (await taskService.HasAuthorizedAsync()) + if (await billService.HasAuthorizedAsync()) { string? bizNo = null; switch (type) @@ -917,7 +917,7 @@ namespace DS.WMS.Core.Fee.Method break; } - result = await taskService.CreateTaskAsync(new TaskCreationRequest + result = await billService.CreateTaskAsync(new TaskCreationRequest { BusinessId = bid, BusinessType = type, @@ -946,7 +946,7 @@ namespace DS.WMS.Core.Fee.Method return result; //变更状态为提交审核 - entity.BillAuditStatus = BillAuditStatus.AuditSubmitted; + entity.BillAuditStatus = BillAuditStatus.RecvSubmitted; entity.BillFeeStatusTime = DateTime.Now; await TenantDb.Updateable(entity).UpdateColumns(x => new @@ -992,13 +992,13 @@ namespace DS.WMS.Core.Fee.Method return DataResult.FailedWithDesc(nameof(MultiLanguageConst.BusinessNotFound)); if (entity.IsFeeLocking.GetValueOrDefault()) return DataResult.FailedWithDesc(nameof(MultiLanguageConst.FeeLocked)); - if (entity.BillAuditStatus != BillAuditStatus.AuditSubmitted) + if (entity.BillAuditStatus != BillAuditStatus.RecvSubmitted && entity.BillAuditStatus != BillAuditStatus.PaySubmitted) return DataResult.Failed(string.Format(MultiLanguageConst.BusinessStatusError, entity.BillAuditStatus.GetDescription())); DataResult result = DataResult.Success; - if (await taskService.HasAuthorizedAsync()) + if (await billService.HasAuthorizedAsync()) { - await taskService.WithdrawAsync(new TaskRequest + await billService.WithdrawAsync(new TaskRequest { BusinessId = bid, BusinessType = type, diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs index 4a35a320..84752906 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs @@ -1531,7 +1531,7 @@ public class SeaExportRes /// /// 整票审核状态 /// - public BillAuditStatus AuditStatus { get; set; } + public BillAuditStatus? AuditStatus { get; set; } /// /// 货好时间-(只要年月日) diff --git a/ds-wms-service/DS.WMS.Core/Op/Entity/BusinessFeeStatus.cs b/ds-wms-service/DS.WMS.Core/Op/Entity/BusinessFeeStatus.cs index da104871..e3b7aaa4 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Entity/BusinessFeeStatus.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Entity/BusinessFeeStatus.cs @@ -71,14 +71,14 @@ namespace DS.WMS.Core.Op.Entity /// /// 整单费用审核状态 /// - [SqlSugar.SugarColumn(ColumnDescription = "整单费用审核状态", IsNullable = true, DefaultValue = "0")] - public BillAuditStatus BillAuditStatus { get; set; } = 0; + [SugarColumn(ColumnDescription = "整单费用审核状态", IsNullable = true, DefaultValue = "0")] + public BillAuditStatus? BillAuditStatus { get; set; } /// /// 整单费用状态时间 /// - [SqlSugar.SugarColumn(ColumnDescription = "整单费用状态时间", IsNullable = true)] - public DateTime BillFeeStatusTime { get; set; } + [SugarColumn(ColumnDescription = "整单费用状态时间", IsNullable = true)] + public DateTime? BillFeeStatusTime { get; set; } //[SugarColumn(ColumnDescription = "当前审批工作流ID", IsNullable = true)] //public long? FlowId { get; set; } @@ -167,7 +167,6 @@ namespace DS.WMS.Core.Op.Entity ARCheckStatus = BillCheckStatusEnum.NotChecked, IsBusinessLocking = false, IsFeeLocking = false, - BillAuditStatus = BillAuditStatus.Pending, //BillFeeStatusTime = null, }; } diff --git a/ds-wms-service/DS.WMS.Core/TaskInteraction/Interface/IFeeBillTaskService.cs b/ds-wms-service/DS.WMS.Core/TaskInteraction/Interface/IFeeBillTaskService.cs new file mode 100644 index 00000000..61d31c6a --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/TaskInteraction/Interface/IFeeBillTaskService.cs @@ -0,0 +1,10 @@ +namespace DS.WMS.Core.TaskInteraction.Interface +{ + /// + /// 费用整票审核任务 + /// + public interface IFeeBillTaskService : IAuditTaskService + { + + } +} diff --git a/ds-wms-service/DS.WMS.Core/TaskInteraction/Method/FeeBillTaskService.cs b/ds-wms-service/DS.WMS.Core/TaskInteraction/Method/FeeBillTaskService.cs new file mode 100644 index 00000000..5d22fb35 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/TaskInteraction/Method/FeeBillTaskService.cs @@ -0,0 +1,20 @@ +using DS.WMS.Core.TaskInteraction.Interface; + +namespace DS.WMS.Core.TaskInteraction.Method +{ + /// + /// 费用整票审核任务 + /// + public class FeeBillTaskService : TaskService, IFeeBillTaskService + { + /// + /// 初始化 + /// + /// + public FeeBillTaskService(IServiceProvider provider) : base(provider) + { + } + + + } +}