From f812a1b0fbb787db1f7e5c67ea31dc361b524049 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Fri, 1 Apr 2022 17:24:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=A0=E9=99=A4=E9=99=90?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Common/FrontAuditConfigService.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/IRaCIS.Core.Application/Service/Common/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Common/FrontAuditConfigService.cs index bbc58468e..9621748fe 100644 --- a/IRaCIS.Core.Application/Service/Common/FrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Common/FrontAuditConfigService.cs @@ -126,6 +126,10 @@ namespace IRaCIS.Core.Application.Service [HttpDelete("{frontAuditConfigId:guid}")] public async Task DeleteFrontAuditConfig(Guid frontAuditConfigId) { + if (await _frontAuditConfigRepository.AnyAsync(x => x.ParentId == frontAuditConfigId)) + { + return ResponseOutput.NotOk("存在子类 无法删除"); + } var success = await _repository.DeleteFromQueryAsync(t => t.Id == frontAuditConfigId); return ResponseOutput.Result(success); }