From 9c5467b43d20166f6a5961c50049a103b5df534d Mon Sep 17 00:00:00 2001 From: wyw <571921741@qq.com> Date: Tue, 2 Dec 2025 13:14:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=89=E7=BA=A7=E5=AE=89=E5=85=A8=E6=95=99?= =?UTF-8?q?=E8=82=B2=20=E7=8F=AD=E7=BB=84=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Api/SEController/SENewUsers.cs | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/APT.MicroApi/APT.SC.WebApi/Controllers/Api/SEController/SENewUsers.cs b/APT.MicroApi/APT.SC.WebApi/Controllers/Api/SEController/SENewUsers.cs index af8abeb..4363e82 100644 --- a/APT.MicroApi/APT.SC.WebApi/Controllers/Api/SEController/SENewUsers.cs +++ b/APT.MicroApi/APT.SC.WebApi/Controllers/Api/SEController/SENewUsers.cs @@ -31,9 +31,11 @@ namespace APT.SC.WebApi.Controllers.Api.SE public class SENewUsersController : AuthorizeApiController { IFMNotificationTaskService NotificationTaskService { get; set; } - public SENewUsersController(IFMNotificationTaskService notificationTaskService) + IFMUserService UserService { get; set; } + public SENewUsersController(IFMNotificationTaskService notificationTaskService, IFMUserService userService) { NotificationTaskService = notificationTaskService; + UserService = userService; } /// /// 更新 @@ -81,8 +83,9 @@ namespace APT.SC.WebApi.Controllers.Api.SE foreach (var item in Nav_NewUserDetail) { index++; - if (!item.NEXT_DEPARTMENT_ID.HasValue) + if (!item.NEXT_DEPARTMENT_ID.HasValue || entity.TRAIN_STATUS == SEThreeLevelSafeTrainType.班组级) { + // 下个部门没填 就是最后一级了 或者 班组级培训 if (string.IsNullOrEmpty(item.CODE)) { throw new Exception("请填写行:" + index + "的工号!"); @@ -726,7 +729,20 @@ namespace APT.SC.WebApi.Controllers.Api.SE } else if (eduCard.TRAIN_STATUS == SEThreeLevelSafeTrainType.部门级) { + //找班组级培训 的 + + //找对应班组 sendUser = GetEntity(t => t.DEPARTMENT_ID == currDetailT.NEXT_DEPARTMENT_ID && t.Nav_ApproveRole.NAME == "班组负责人" && t.IS_DELETED == false && t.ENABLE_STATUS == 0); + if (sendUser == null) + { + //班组级培训 可能也是部门或者车间 + sendUser = GetEntity(t => t.DEPARTMENT_ID == currDetailT.NEXT_DEPARTMENT_ID && t.Nav_ApproveRole.NAME.Contains("安全员") && t.IS_DELETED == false && t.ENABLE_STATUS == 0); + } + if (sendUser == null) + { + //找不到人 找安环人 省得单据没了 + sendUser = UserService.GetSafeApproveUser(eduCard.ORG_ID.Value); + } if (sendUser != null) { currSattus = SEThreeLevelSafeTrainType.班组级; @@ -765,7 +781,7 @@ namespace APT.SC.WebApi.Controllers.Api.SE #region NEXT_DEPARTMENT_ID - if (user.USER_DEPARTMENT_ID.HasValue) + if (user.USER_DEPARTMENT_ID.HasValue && currSattus != SEThreeLevelSafeTrainType.班组级) { //userDetail.NEXT_DEPARTMENT_ID= modelDep = listDeps.FirstOrDefault(e => e.ID == user.USER_DEPARTMENT_ID.Value);