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