From 0097618f5f1f0f9a849af7e5835eabfd5bd1baa1 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: Wed, 17 Dec 2025 10:43:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=96=B0=E6=8E=92=E7=8F=AD=E6=97=B6?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A7=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../APT.PP.WebApi/Controllers/Api/RunController.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/APT.MicroApi/APT.PP.WebApi/Controllers/Api/RunController.cs b/APT.MicroApi/APT.PP.WebApi/Controllers/Api/RunController.cs index ffc077a..7adeaea 100644 --- a/APT.MicroApi/APT.PP.WebApi/Controllers/Api/RunController.cs +++ b/APT.MicroApi/APT.PP.WebApi/Controllers/Api/RunController.cs @@ -225,9 +225,18 @@ namespace APT.PP.WebApi.Controllers } } + //判断开始时间=当前时间的,为重新排班,删除该班组已有的排班 + var deleteConfigs = configData.Where(t => t.START_TIME.Date == t.CURR_TIME.Date && t.CURR_TIME.Date == DateTime.Now.Date).ToList(); + var deleteTeamIds = deleteConfigs.SelectMany(i => i.Nav_DepartmentCalendarConfigTeam).Select(i => i.TEAM_ID).ToArray(); + var deleteShiftDataIds = this.GetEntities(s => s.DATE_TIME.Date >= DateTime.Now.Date && deleteTeamIds.Contains(s.TEAM_ID), new BaseFilter(filter.OrgId)).Select(m=>m.ID).ToList(); + var deleteShiftPersonIds = this.GetEntities(s => deleteShiftDataIds.Contains(s.DEPARTMENT_SCHEDULING_ID), new BaseFilter(filter.OrgId)).Select(m => m.ID).ToList(); //统一提交数据 this.UnifiedCommit(() => - { + { + if (deleteShiftPersonIds != null && deleteShiftPersonIds.Any()) + this.BantchDeleteEntityNoCommit(deleteShiftPersonIds); + if (deleteShiftDataIds != null && deleteShiftDataIds.Any()) + this.BantchDeleteEntityNoCommit(deleteShiftDataIds); if (shiftList.Any()) this.BantchAddEntityNoCommit(shiftList); if (shiftDetailList.Any())