This commit is contained in:
ccy 2025-11-29 23:40:32 +08:00
commit 211114b332
5 changed files with 60 additions and 12 deletions

View File

@ -103,5 +103,13 @@ namespace APT.BaseData.Domain.IServices.FM
/// <param name="IsOnly">只返回一个人</param> /// <param name="IsOnly">只返回一个人</param>
/// <returns></returns> /// <returns></returns>
List<T_FM_USER> GetDepPostUser(ref string Msg, Guid DEPARTMENT_ID, Guid POST_ID, bool IsOnly); 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="ORG_ID">1</param>
/// <returns></returns>
T_FM_USER GetSafeApproveUser(Guid ORG_ID, int UserType = 1);
} }
} }

View File

@ -992,5 +992,34 @@ namespace APT.BaseData.Services.Services.FM
} }
return GetEntities(expression).ToList(); return GetEntities(expression).ToList();
} }
#region
/// <summary>
/// 找安环部人员
/// </summary>
/// <param name="UserType">1 NUM 从小到大 找第一个 10 NUM 找老大</param>
/// <param name="ORG_ID">1</param>
/// <returns></returns>
public T_FM_USER GetSafeApproveUser(Guid ORG_ID, int UserType = 1)
{
T_FM_USER model = null;
Expression<Func<T_FM_USER, bool>> expression = e => e.ENABLE_STATUS == 0 && !e.IS_DELETED && e.DEPARTMENT_ID.HasValue && e.Nav_Department.ENABLE_STATUS == 0 && e.APPROVE_ROLE_ID.HasValue && e.Nav_Department.DEPARTMENT_STATUS == (int)FMDepartmentStatus.;
BaseFilter fiter = new BaseFilter(ORG_ID);
fiter.Sort = "NUM";
if (UserType == 10)
{
fiter.Order = DbOrder.ASC; //找老大
}
else
{
fiter.Order = DbOrder.DESC; //找老小
}
model = GetEntity<T_FM_USER>(expression, fiter, null);
return model;
}
#endregion
} }
} }

View File

@ -1867,6 +1867,4 @@ namespace APT.BS.WebApi.Controllers.Api
} }
#endregion #endregion
} }
} }

View File

@ -73,8 +73,10 @@ namespace APT.FO.WebApi.Controllers
{ {
var loginUserId = APT.Infrastructure.Api.AppContext.CurrentSession.UserID; var loginUserId = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
var departmentId = APT.Infrastructure.Api.AppContext.CurrentSession.DepartmentID; var departmentId = APT.Infrastructure.Api.AppContext.CurrentSession.DepartmentID;
entity.APPLY_USER_ID = loginUserId; if(entity.APPLY_USER_ID == null)
entity.APPLY_DEPARTMENT_ID = departmentId; entity.APPLY_USER_ID = loginUserId;
if(entity.APPLY_DEPARTMENT_ID == null)
entity.APPLY_DEPARTMENT_ID = departmentId;
if (entity.COMPANY_ID == null) if (entity.COMPANY_ID == null)
{ {
entity.COMPANY_ID = this.GetEntity<T_FM_DEPARTMENT>(t => t.PARENT_ID == null)?.ID; entity.COMPANY_ID = this.GetEntity<T_FM_DEPARTMENT>(t => t.PARENT_ID == null)?.ID;
@ -285,6 +287,7 @@ namespace APT.FO.WebApi.Controllers
monitorFileList.Add(item); monitorFileList.Add(item);
} }
} }
T_FM_NOTIFICATION_TASK task = null;
List<T_FM_NOTIFICATION_TASK> notices = new List<T_FM_NOTIFICATION_TASK>(); List<T_FM_NOTIFICATION_TASK> notices = new List<T_FM_NOTIFICATION_TASK>();
if (entity.PUBLISH != null && entity.PUBLISH.Equals("SaveAndNotify")) if (entity.PUBLISH != null && entity.PUBLISH.Equals("SaveAndNotify"))
{ {
@ -421,12 +424,12 @@ namespace APT.FO.WebApi.Controllers
}, null, null, null, null, null, "FO043_SHOWPRINT", null,null, FMTASKTYPE.JobSite); }, null, null, null, null, null, "FO043_SHOWPRINT", null,null, FMTASKTYPE.JobSite);
return true; return true;
} }
}
T_FM_NOTIFICATION_TASK task = null; if (entity.TaskID != Guid.Empty)
if (entity.TaskID != Guid.Empty) {
{ task = NotificationTaskService.GetTaskFinishModel(entity.TaskID);
task = NotificationTaskService.GetTaskFinishModel(entity.TaskID); task.SOURCE_FORMCODE = "FO043_SHOWPRINT";
task.SOURCE_FORMCODE = "FO043_SHOWPRINT"; }
} }
this.UnifiedCommit(() => this.UnifiedCommit(() =>
{ {

View File

@ -31,9 +31,11 @@ namespace APT.SC.WebApi.Controllers.Api.SE
public class SERenewalTrainController : AuthorizeApiController<T_SE_RENEWAL_TRAIN> public class SERenewalTrainController : AuthorizeApiController<T_SE_RENEWAL_TRAIN>
{ {
IFMNotificationTaskService NotificationTaskService { get; set; } IFMNotificationTaskService NotificationTaskService { get; set; }
public SERenewalTrainController(IFMNotificationTaskService notificationTaskService) IFMUserService UserService { get; set; }
public SERenewalTrainController(IFMNotificationTaskService notificationTaskService, IFMUserService userService)
{ {
NotificationTaskService = notificationTaskService; NotificationTaskService = notificationTaskService;
UserService = userService;
} }
/// <summary> /// <summary>
/// 更新 /// 更新
@ -45,6 +47,14 @@ namespace APT.SC.WebApi.Controllers.Api.SE
{ {
return SafeExecute<bool>(() => return SafeExecute<bool>(() =>
{ {
if (entity.EXPIRY_START_DATE == DateTime.MinValue)
{
throw new Exception("请选择证书的有效期限!");
}
if (entity.EXPIRY_DATE.Year <= 1990)
{
throw new Exception(" 请选择证书合适的有效期限!");
}
//人员 证书名称 复审日期 //人员 证书名称 复审日期
var modelCheck = GetEntity<T_SE_RENEWAL_TRAIN>(e => e.USER_ID == entity.USER_ID && e.CERTIFICATE_NAME == entity.CERTIFICATE_NAME && e.REVIEW_DATE == entity.REVIEW_DATE && e.ID != entity.ID); var modelCheck = GetEntity<T_SE_RENEWAL_TRAIN>(e => e.USER_ID == entity.USER_ID && e.CERTIFICATE_NAME == entity.CERTIFICATE_NAME && e.REVIEW_DATE == entity.REVIEW_DATE && e.ID != entity.ID);
if (modelCheck != null) if (modelCheck != null)