From 4e67753474d0a30f9b619f99f6507ac6c08d2f12 Mon Sep 17 00:00:00 2001 From: wyw <571921741@qq.com> Date: Tue, 26 May 2026 13:51:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=B9=E8=AE=AD=E9=80=9A=E7=9F=A5=E5=8F=91?= =?UTF-8?q?=E9=80=81=20=E5=B7=B2=E5=88=A0=E9=99=A4=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E3=80=81=E9=83=A8=E9=97=A8=E3=80=81=E5=B2=97=E4=BD=8D=20?= =?UTF-8?q?=E5=81=9A=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SEController/5SETTrainNotifyController.cs | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 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 70f142f..b3908b2 100644 --- a/APT.MicroApi/APT.SC.WebApi/Controllers/Api/SEController/5SETTrainNotifyController.cs +++ b/APT.MicroApi/APT.SC.WebApi/Controllers/Api/SEController/5SETTrainNotifyController.cs @@ -225,14 +225,11 @@ namespace APT.SC.WebApi.Controllers.Api.SE errorMsg = "题库中题目数量不足!\n" + errorMsg; throw new Exception(errorMsg); } - #endregion - } #endregion - if (entity.ISSENDNOTICE) { entity.STATUS = SETrainNotifyStatus.通知中; @@ -245,13 +242,39 @@ namespace APT.SC.WebApi.Controllers.Api.SE userFilter.Include = new string[] { "Nav_Person.Nav_Post", "Nav_Department" }; IEnumerable userNames = GetEntities(t => sendUserAll.Contains(t.ID), userFilter); + T_FM_USER userCheck = null; foreach (var user in Nav_TrainUserList) { if (user.IS_DELETED) continue; + userCheck = userNames.FirstOrDefault(t => t.ID == user.USER_ID); + if (userCheck == null) + { + var modelDel = GetEntity(user.USER_ID); + if (modelDel != null && modelDel.IS_DELETED) + { + throw new Exception("人员【" + modelDel.NAME + " " + (String.IsNullOrEmpty(user.POST_NAME) ? "" : user.POST_NAME) + "】已删除,不能进行培训,请移除此人后再发布通知!"); + } + else + { + throw new Exception("查找人员失败【ID:" + user.USER_ID + " " + (String.IsNullOrEmpty(user.POST_NAME) ? "" : user.POST_NAME) + "】失败,如果已删除活禁用,请移除此人!"); + } + } + if (userCheck.Nav_Department == null) + { + throw new Exception("人员组织异常【" + userCheck.NAME + "】,请先处理对应组织后再提交!"); + } + if (userCheck.Nav_Person == null) + { + throw new Exception("人员信息异常【" + userCheck.NAME + "】,请联系管理员处理对应信息!"); + } + if (userCheck.Nav_Person.Nav_Post == null) + { + throw new Exception("人员岗位信息异常【" + userCheck.NAME + "】,请联系管理员处理对应信息!"); + } - user.DEPARTMENT_NAME = userNames.FirstOrDefault(t => t.ID == user.USER_ID)?.Nav_Department?.NAME; - user.POST_NAME = userNames.FirstOrDefault(t => t.ID == user.USER_ID).Nav_Person?.Nav_Post?.NAME; + user.DEPARTMENT_NAME = userCheck.Nav_Department?.NAME; + user.POST_NAME = userCheck.Nav_Person?.Nav_Post?.NAME; } foreach (var user in sendUsers) {