From 00e68b0148a8a23bb22e6e34613e2d2d6d0c2f02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B5=87=E6=96=87=E9=BE=99?= Date: Tue, 3 Sep 2024 17:46:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=B9=E7=94=A8=E6=A8=A1=E6=9D=BF=E7=BB=93?= =?UTF-8?q?=E7=AE=97=E5=AF=B9=E8=B1=A1=E7=B1=BB=E5=9E=8B=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E4=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Method/ApplicationService`1.cs | 34 +++++++++++++++---- .../Method/InvoiceApplicationService.cs | 2 ++ .../Method/PaymentApplicationService.cs | 2 ++ .../DS.WMS.Core/Fee/Entity/FeeCustTemplate.cs | 2 +- .../Fee/Entity/FeeCustTemplateDetail.cs | 2 +- 5 files changed, 34 insertions(+), 8 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationService`1.cs b/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationService`1.cs index 8bffe2a2..d65914b7 100644 --- a/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationService`1.cs +++ b/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationService`1.cs @@ -22,9 +22,14 @@ namespace DS.WMS.Core.Application.Method /// 申请单基础实现 /// /// 实体的类型声明 - public class ApplicationService : FeeServiceBase, IApplicationService + public abstract class ApplicationService : FeeServiceBase, IApplicationService where TEntity : ApplicationForm, new() { + /// + /// 适用于当前申请单的审核类型 + /// + public abstract TaskBaseTypeEnum AuditType { get; } + readonly IClientFlowInstanceService flowService; readonly Lazy commonService; readonly ITaskService taskService; @@ -515,15 +520,32 @@ namespace DS.WMS.Core.Application.Method return DataResult.FailedWithDesc(nameof(MultiLanguageConst.NotInAudit)); DataResult result; + bool hasAuthorized = await taskService.HasAuthorizedAsync(); try { - result = await flowService.WithdrawAsync(ids); - if (!result.Succeeded) - return result; + if (hasAuthorized) + { + foreach (var item in list) + { + result = await taskService.WithdrawAsync(new TaskRequest + { + BusinessId = item.Id, + TaskTypeName = AuditType.ToString() + }, false); - foreach (var item in list) + OnWithdraw(item); + } + } + else { - OnWithdraw(item); + result = await flowService.WithdrawAsync(ids); + if (!result.Succeeded) + return result; + + foreach (var item in list) + { + OnWithdraw(item); + } } await TenantDb.Updateable(list).UpdateColumns(x => new { x.Status }).ExecuteCommandAsync(); diff --git a/ds-wms-service/DS.WMS.Core/Application/Method/InvoiceApplicationService.cs b/ds-wms-service/DS.WMS.Core/Application/Method/InvoiceApplicationService.cs index 2a19dd94..07adac31 100644 --- a/ds-wms-service/DS.WMS.Core/Application/Method/InvoiceApplicationService.cs +++ b/ds-wms-service/DS.WMS.Core/Application/Method/InvoiceApplicationService.cs @@ -19,6 +19,8 @@ namespace DS.WMS.Core.Application.Method /// public class InvoiceApplicationService : ApplicationService, IInvoiceApplicationService { + public override TaskBaseTypeEnum AuditType => TaskBaseTypeEnum.APPLICATION_INVOICE_AUDIT; + /// /// 初始化 /// diff --git a/ds-wms-service/DS.WMS.Core/Application/Method/PaymentApplicationService.cs b/ds-wms-service/DS.WMS.Core/Application/Method/PaymentApplicationService.cs index abd34114..741b9073 100644 --- a/ds-wms-service/DS.WMS.Core/Application/Method/PaymentApplicationService.cs +++ b/ds-wms-service/DS.WMS.Core/Application/Method/PaymentApplicationService.cs @@ -19,6 +19,8 @@ namespace DS.WMS.Core.Application.Method /// public class PaymentApplicationService : ApplicationService, IPaymentApplicationService { + public override TaskBaseTypeEnum AuditType => TaskBaseTypeEnum.APPLICATION_PAYMENT_AUDIT; + /// /// 初始化 /// diff --git a/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeCustTemplate.cs b/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeCustTemplate.cs index 6cc6e134..2e028c5a 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeCustTemplate.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeCustTemplate.cs @@ -40,7 +40,7 @@ namespace DS.WMS.Core.Fee.Entity /// 结算对象类型 /// [SugarColumn(ColumnDescription = "结算对象类型", IsNullable = true)] - public CustomerTypeEnum? CustomerType { get; set; } + public string? CustomerType { get; set; } /// /// 名称 diff --git a/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeCustTemplateDetail.cs b/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeCustTemplateDetail.cs index bc02adf0..4925fd66 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeCustTemplateDetail.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeCustTemplateDetail.cs @@ -41,7 +41,7 @@ namespace DS.WMS.Core.Fee.Entity /// 结算对象类型 /// [SugarColumn(ColumnDescription = "结算对象类型", IsNullable = true)] - public CustomerTypeEnum? CustomerType { get; set; } + public string? CustomerType { get; set; } /// /// 费用Id