三级安全教育 班组级

This commit is contained in:
wyw 2025-12-02 13:14:17 +08:00
parent 6e6ecae387
commit 9c5467b43d

View File

@ -31,9 +31,11 @@ namespace APT.SC.WebApi.Controllers.Api.SE
public class SENewUsersController : AuthorizeApiController<T_SE_NEW_USERS> public class SENewUsersController : AuthorizeApiController<T_SE_NEW_USERS>
{ {
IFMNotificationTaskService NotificationTaskService { get; set; } IFMNotificationTaskService NotificationTaskService { get; set; }
public SENewUsersController(IFMNotificationTaskService notificationTaskService) IFMUserService UserService { get; set; }
public SENewUsersController(IFMNotificationTaskService notificationTaskService, IFMUserService userService)
{ {
NotificationTaskService = notificationTaskService; NotificationTaskService = notificationTaskService;
UserService = userService;
} }
/// <summary> /// <summary>
/// 更新 /// 更新
@ -81,8 +83,9 @@ namespace APT.SC.WebApi.Controllers.Api.SE
foreach (var item in Nav_NewUserDetail) foreach (var item in Nav_NewUserDetail)
{ {
index++; index++;
if (!item.NEXT_DEPARTMENT_ID.HasValue) if (!item.NEXT_DEPARTMENT_ID.HasValue || entity.TRAIN_STATUS == SEThreeLevelSafeTrainType.)
{ {
// 下个部门没填 就是最后一级了 或者 班组级培训
if (string.IsNullOrEmpty(item.CODE)) if (string.IsNullOrEmpty(item.CODE))
{ {
throw new Exception("请填写行:" + index + "的工号!"); throw new Exception("请填写行:" + index + "的工号!");
@ -726,7 +729,20 @@ namespace APT.SC.WebApi.Controllers.Api.SE
} }
else if (eduCard.TRAIN_STATUS == SEThreeLevelSafeTrainType.) else if (eduCard.TRAIN_STATUS == SEThreeLevelSafeTrainType.)
{ {
//找班组级培训 的
//找对应班组
sendUser = GetEntity<T_FM_USER>(t => t.DEPARTMENT_ID == currDetailT.NEXT_DEPARTMENT_ID && t.Nav_ApproveRole.NAME == "班组负责人" && t.IS_DELETED == false && t.ENABLE_STATUS == 0); sendUser = GetEntity<T_FM_USER>(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_FM_USER>(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) if (sendUser != null)
{ {
currSattus = SEThreeLevelSafeTrainType.; currSattus = SEThreeLevelSafeTrainType.;
@ -765,7 +781,7 @@ namespace APT.SC.WebApi.Controllers.Api.SE
#region NEXT_DEPARTMENT_ID #region NEXT_DEPARTMENT_ID
if (user.USER_DEPARTMENT_ID.HasValue) if (user.USER_DEPARTMENT_ID.HasValue && currSattus != SEThreeLevelSafeTrainType.)
{ {
//userDetail.NEXT_DEPARTMENT_ID= //userDetail.NEXT_DEPARTMENT_ID=
modelDep = listDeps.FirstOrDefault(e => e.ID == user.USER_DEPARTMENT_ID.Value); modelDep = listDeps.FirstOrDefault(e => e.ID == user.USER_DEPARTMENT_ID.Value);