This commit is contained in:
何美荣 2025-11-30 21:16:19 +08:00
commit a48e80fdd9
3 changed files with 15 additions and 8 deletions

View File

@ -105,9 +105,9 @@ namespace APT.BaseData.Domain.IServices.FM
List<T_FM_USER> GetDepPostUser(ref string Msg, Guid DEPARTMENT_ID, Guid POST_ID, bool IsOnly);
/// <summary>
/// 找安环部人员
/// 找安环部人员 默认 安环安全员
/// </summary>
/// <param name="UserType">1 NUM 从小到大 找第一个 2 NUM 找老大</param>
/// <param name="UserType">1 NUM 从小到大 找第一个 10 NUM 找老大</param>
/// <param name="ORG_ID">1</param>
/// <returns></returns>
T_FM_USER GetSafeApproveUser(Guid ORG_ID, int UserType = 1);

View File

@ -997,7 +997,7 @@ namespace APT.BaseData.Services.Services.FM
#region
/// <summary>
/// 找安环部人员
/// 找安环部人员 默认 安环安全员
/// </summary>
/// <param name="UserType">1 NUM 从小到大 找第一个 10 NUM 找老大</param>
/// <param name="ORG_ID">1</param>

View File

@ -25,9 +25,11 @@ namespace APT.SC.WebApi.Controllers.Api.SE
public class SETrainRecordController : AuthorizeApiController<T_SE_TRAIN_RECORD>
{
IFMNotificationTaskService NotificationTaskService { get; set; }
public SETrainRecordController(IFMNotificationTaskService notificationTaskService)
IFMUserService UserService { get; set; }
public SETrainRecordController(IFMNotificationTaskService notificationTaskService, IFMUserService userService)
{
NotificationTaskService = notificationTaskService;
UserService = userService;
}
/// <summary>
/// 保存
@ -517,12 +519,17 @@ namespace APT.SC.WebApi.Controllers.Api.SE
if (userCount == 0 && !isReSend)
{
record.STATUS = SETrainRecordStatus.;
var chargeUser = GetEntity<T_FM_USER>(t => t.Nav_ApproveRole.NAME == "安环部负责人");
if (chargeUser == null)
T_FM_USER chargeUser = UserService.GetSafeApproveUser(record.ORG_ID.Value, 10);
//var chargeUser = GetEntity<T_FM_USER>(t => t.Nav_ApproveRole.NAME == "安环部负责人");
//if (chargeUser == null)
//{
// chargeUser = GetEntity<T_FM_USER>(t => t.Nav_ApproveRole.NAME == "安环部安全员");
//}
if (chargeUser != null)
{
chargeUser = GetEntity<T_FM_USER>(t => t.Nav_ApproveRole.NAME == "安环部安全员");
sendNotices.Add(NotificationTaskService.InsertUserNoticeTaskModel("培训记录完成待审阅-" + record.Nav_Notify.NAME, Guid.Parse(filter.Keyword), filter.GetOrgId(), chargeUser.ID, chargeUser.NAME, DateTime.Now, DateTime.Now.AddDays(2), 1, "SE017_SHOWPRINT"));
}
sendNotices.Add(NotificationTaskService.InsertUserNoticeTaskModel("培训记录完成待审阅-" + record.Nav_Notify.NAME, Guid.Parse(filter.Keyword), filter.GetOrgId(), chargeUser.ID, chargeUser.NAME, DateTime.Now, DateTime.Now.AddDays(2), 1, "SE017_SHOWPRINT"));
}
UnifiedCommit(() =>
{