From 1e3af9a89d3b1eadd5692c050f67fe69de2d796f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E7=BE=8E=E8=8D=A3?= <10755671+mei-rong-he@user.noreply.gitee.com> Date: Mon, 27 Apr 2026 10:46:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E6=9F=A5=E9=80=9A=E7=9F=A5=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Api/SecurityInspectionNoticeController.cs | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/APT.MicroApi/APT.SK.WebApi/Controllers/Api/SecurityInspectionNoticeController.cs b/APT.MicroApi/APT.SK.WebApi/Controllers/Api/SecurityInspectionNoticeController.cs index 5b62fa9..fe013fc 100644 --- a/APT.MicroApi/APT.SK.WebApi/Controllers/Api/SecurityInspectionNoticeController.cs +++ b/APT.MicroApi/APT.SK.WebApi/Controllers/Api/SecurityInspectionNoticeController.cs @@ -3094,6 +3094,44 @@ namespace APT.SK.WebApi.Controllers.Api result.Add(refRecordLog); } #endregion + } + /// + /// 根据主键删除数据 + /// + /// 主键ID + /// + [HttpGet, Route("FullDelete")] + public JsonActionResult FullDelete(string id) + { + return SafeExecute(() => + { + if (string.IsNullOrEmpty(id)) + this.ThrowError("060010"); + var approves = new List(); + var tasks = new List(); + var notices = new List(); + var notice = this.GetEntity(id); + if (notice != null) + { + notice.IS_DELETED = true; + notices.Add(notice); + approves = this.GetEntities(t => t.DATA_ID != null && t.DATA_ID == notice.ID, new BaseFilter(notice.ORG_ID)).ToList(); + approves.ForEach(t => t.IS_DELETED = true); + var approveIds = approves.Select(t => t.ID).ToList(); + tasks = this.GetEntities(t => t.SOURCE_DATA_ID != null && (t.SOURCE_DATA_ID == notice.ID || approveIds.Contains((Guid)t.SOURCE_DATA_ID)), new BaseFilter(notice.ORG_ID)).ToList(); + tasks.ForEach(t => t.IS_DELETED = true); + } + UnifiedCommit(() => + { + if (notices != null && notices.Any()) + this.BantchUpdateEntity_noneBase(notices); + if (approves != null && approves.Any()) + this.BantchUpdateEntity_noneBase(approves); + if (tasks != null && tasks.Any()) + this.BantchUpdateEntity_noneBase(tasks); + }); + return true; + }); } } }