From 59f9cf439c9a5e16d649472ab5f68715c267d6a4 Mon Sep 17 00:00:00 2001 From: wyw <571921741@qq.com> Date: Mon, 27 Jul 2026 15:49:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=92=E5=BA=8F=E5=BC=80=E5=A7=8B=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E7=AD=89=E4=BA=8E=20=E7=AD=BE=E5=88=B0=E5=BC=80?= =?UTF-8?q?=E5=A7=8B=E6=97=B6=E9=97=B4=20=E4=B8=8D=E9=99=90=E5=88=B6=20?= =?UTF-8?q?=E4=B8=8D=E8=A7=A6=E5=8F=91=E5=9F=B9=E8=AE=AD=E5=8F=8D=E9=A6=88?= =?UTF-8?q?=20=E4=BA=BA=E5=91=98=E6=89=80=E5=9C=A8=E5=B2=97=E4=BD=8D?= =?UTF-8?q?=E3=80=81=E7=BB=84=E7=BB=87=20=E7=BC=93=E5=AD=98=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SEController/5SETTrainNotifyController.cs | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/APT.MicroApi/APT.SC.WebApi/Controllers/Api/SEController/5SETTrainNotifyController.cs b/APT.MicroApi/APT.SC.WebApi/Controllers/Api/SEController/5SETTrainNotifyController.cs index ce31212..d0c335a 100644 --- a/APT.MicroApi/APT.SC.WebApi/Controllers/Api/SEController/5SETTrainNotifyController.cs +++ b/APT.MicroApi/APT.SC.WebApi/Controllers/Api/SEController/5SETTrainNotifyController.cs @@ -70,7 +70,7 @@ namespace APT.SC.WebApi.Controllers.Api.SE //{ // throw new Exception("签到开始时间不能大于培训结束时间!"); //} - if (entity.DT_START_SIGN.HasValue && entity.TRAIN_START_TIME.HasValue && entity.DT_START_SIGN.Value >= entity.TRAIN_START_TIME.Value) + if (entity.DT_START_SIGN.HasValue && entity.TRAIN_START_TIME.HasValue && entity.DT_START_SIGN.Value > entity.TRAIN_START_TIME.Value) { throw new Exception("签到开始时间不能大于培训开始时间!"); } @@ -251,7 +251,7 @@ namespace APT.SC.WebApi.Controllers.Api.SE { listUserIDDo.Add(entity.RECORD_USER_ID.Value); } - if (listUserIDDo.Count>0) + if (listUserIDDo.Count > 0) { foreach (var item in Nav_TrainUserList) { @@ -263,17 +263,17 @@ namespace APT.SC.WebApi.Controllers.Api.SE } #endregion + var sendUserAll = Nav_TrainUserList.Where(t => t.IS_DELETED == false).Select(t => t.USER_ID).ToList(); + BaseFilter userFilter = new BaseFilter(entity.ORG_ID); + userFilter.Include = new string[] { "Nav_Person.Nav_Post", "Nav_Department" }; + IEnumerable userNames = GetEntities(t => sendUserAll.Contains(t.ID), userFilter); + T_FM_USER userCheck = null; if (entity.ISSENDNOTICE) { entity.STATUS = SETrainNotifyStatus.通知中; //触发培训通知给所有培训人员 var allSendUserNames = new List(); var sendUsers = Nav_TrainUserList.Where(t => t.IS_DELETED == false && t.USER_ID != entity.LAUNCH_USER_ID).Select(t => t.USER_ID).ToList(); - var sendUserAll = Nav_TrainUserList.Where(t => t.IS_DELETED == false).Select(t => t.USER_ID).ToList(); - - BaseFilter userFilter = new BaseFilter(entity.ORG_ID); - userFilter.Include = new string[] { "Nav_Person.Nav_Post", "Nav_Department" }; - IEnumerable userNames = GetEntities(t => sendUserAll.Contains(t.ID), userFilter); //List listAuto = new List(); //if (entity.RECORD_USER_ID.HasValue && sendUsers.Contains(entity.RECORD_USER_ID.Value)) @@ -285,7 +285,6 @@ namespace APT.SC.WebApi.Controllers.Api.SE // listAuto.Add(entity.USER_ID_TEACHER.Value); //} - T_FM_USER userCheck = null; foreach (var user in Nav_TrainUserList) { if (user.IS_DELETED) @@ -353,6 +352,20 @@ namespace APT.SC.WebApi.Controllers.Api.SE } else { + foreach (var item in Nav_TrainUserList) + { + if (item.IS_DELETED) + continue; + userCheck = userNames.FirstOrDefault(t => t.ID == item.USER_ID); + + item.IS_LEAVE = SETrainYesNoEnum.参加; + if (userCheck != null) + { + item.DEPARTMENT_NAME = userCheck?.Nav_Department?.NAME; + item.POST_NAME = userCheck.Nav_Person?.Nav_Post?.NAME; + } + } + //没有触发培训通知 if (entity.CREATE_NOTIFY_RECORD) {