This commit is contained in:
何美荣 2026-05-06 17:52:57 +08:00
parent 6af1ba5d25
commit cbc96f56e2
2 changed files with 25 additions and 1 deletions

View File

@ -263,6 +263,18 @@ namespace APT.FO.WebApi.Controllers
var sendNotices = new List<T_FM_NOTIFICATION_TASK>();
if (entity.PUBLISH != null && entity.PUBLISH.Equals("SaveAndNotify"))
{
if (!userList.Any())
{
throw new Exception("值班领导不能为空");
}
if (!afterUserList.Any())
{
throw new Exception("接班人不能为空");
}
if (!details.Any())
{
throw new Exception("明细行至少填写一行,且现场责任人不能为空");
}
var allUsers = this.GetEntities<T_FM_USER>(t => t.ENABLE_STATUS == 0 && !t.CODE.Contains("admin"), new BaseFilter(entity.ORG_ID));
var sendUserIds = userList.Where(t => t.USER_ID != loginUserId && t.USER_ID != null).Select(m => (Guid)m.USER_ID).Distinct().ToList();
if (sendUserIds != null && sendUserIds.Any())
@ -292,6 +304,10 @@ namespace APT.FO.WebApi.Controllers
sendNotices = NotificationTaskService.InsertUserNoticeTaskModels("领导带班下井记录-接班人签字确认", entity.ID, entity.ORG_ID, sendAfterUserIds, sendUserNames, DateTime.Now, entity.JOB_END_DATE.Value, 1, "FO041_SHOWPRINT");
entity.STATUS = FOStatusEnum.SignAccept;
}
else
{
entity.STATUS = FOStatusEnum.Archived;
}
}
}

View File

@ -5428,7 +5428,7 @@ namespace APT.PP.WebApi.Controllers.Api
DateTime minTime = dt.AddMinutes(0);
DateTime maxTime = dt.AddMinutes(60);
var shiftClassAll = this.GetEntities<T_FM_DEPARTMENT_SCHEDULING>(s => s.DATE_TIME.Date == dt.Date && s.Nav_Team.ENABLE_STATUS == 0 && s.TEAM_ID != null, new BaseFilter(filter.OrgId), "Nav_DepartmentSchedulingDetail.Nav_Person").ToList();
var shiftClassList = shiftClassAll.Where(s => s.START_TIME >= minTime && s.START_TIME <= maxTime && s.START_TIME != s.END_TIME).ToList();
var shiftClassList = shiftClassAll.Where(s => s.START_TIME >= minTime && s.START_TIME <= maxTime).ToList();
var teamIds = shiftClassList.Select(t => t.TEAM_ID).Distinct().ToList();
var teamInfos = this.GetEntities<T_FM_TEAM>(t =>t.ENABLE_STATUS == 0 , new BaseFilter(filter.OrgId));
var teamDepartIds = teamInfos.Where(t=>teamIds.Contains(t.ID)).Select(m => m.DEPARTMENT_ID).Distinct().ToList();
@ -5601,6 +5601,14 @@ namespace APT.PP.WebApi.Controllers.Api
{
send = false;
}
else
{
var startTime = scheTemp.START_TIME.AddHours(-1.5);
if (scheTemp.START_TIME.Date != scheTemp.END_TIME.Date || (scheTemp.START_TIME.Date == scheTemp.END_TIME.Date && scheTemp.START_TIME == scheTemp.START_TIME.Date))//跨天
{
exist = noticeExsiss.FirstOrDefault(t => t.APPLY_DEPARTMENT_ID == userInfo.DEPARTMENT_ID && t.DEPARTMENT_TYPE == item.DepartType && t.CHECK_TYPE_ID == item.CheckTypeId && t.PLANCHECKFREQUENCY == item.Cycle && t.CREATE_TIME >= startTime && (t.CREATE_TIME.Value.Date == scheTemp.START_TIME.Date || t.CREATE_TIME.Value.Date == scheTemp.START_TIME.Date.AddDays(-1)));
}
}
}
}
if ((!send && exist == null && item.CheckPost == "班组负责人" && dt.Hour == 8) || (send && exist == null && item.CheckPost == "班组负责人") || (send && exist == null && item.CheckPost != "班组负责人" && setTime != null && dt.Hour == setTime.CHECKTIME.Value.Hour))