diff --git a/APT.MicroApi/APT.SC.WebApi/Controllers/Api/SEController/5SETTrainNotifyController.cs b/APT.MicroApi/APT.SC.WebApi/Controllers/Api/SEController/5SETTrainNotifyController.cs index ce31212..d0c335a 100644 --- a/APT.MicroApi/APT.SC.WebApi/Controllers/Api/SEController/5SETTrainNotifyController.cs +++ b/APT.MicroApi/APT.SC.WebApi/Controllers/Api/SEController/5SETTrainNotifyController.cs @@ -70,7 +70,7 @@ namespace APT.SC.WebApi.Controllers.Api.SE //{ // throw new Exception("签到开始时间不能大于培训结束时间!"); //} - if (entity.DT_START_SIGN.HasValue && entity.TRAIN_START_TIME.HasValue && entity.DT_START_SIGN.Value >= entity.TRAIN_START_TIME.Value) + if (entity.DT_START_SIGN.HasValue && entity.TRAIN_START_TIME.HasValue && entity.DT_START_SIGN.Value > entity.TRAIN_START_TIME.Value) { throw new Exception("签到开始时间不能大于培训开始时间!"); } @@ -251,7 +251,7 @@ namespace APT.SC.WebApi.Controllers.Api.SE { listUserIDDo.Add(entity.RECORD_USER_ID.Value); } - if (listUserIDDo.Count>0) + if (listUserIDDo.Count > 0) { foreach (var item in Nav_TrainUserList) { @@ -263,17 +263,17 @@ namespace APT.SC.WebApi.Controllers.Api.SE } #endregion + var sendUserAll = Nav_TrainUserList.Where(t => t.IS_DELETED == false).Select(t => t.USER_ID).ToList(); + BaseFilter userFilter = new BaseFilter(entity.ORG_ID); + userFilter.Include = new string[] { "Nav_Person.Nav_Post", "Nav_Department" }; + IEnumerable userNames = GetEntities(t => sendUserAll.Contains(t.ID), userFilter); + T_FM_USER userCheck = null; if (entity.ISSENDNOTICE) { entity.STATUS = SETrainNotifyStatus.通知中; //触发培训通知给所有培训人员 var allSendUserNames = new List(); var sendUsers = Nav_TrainUserList.Where(t => t.IS_DELETED == false && t.USER_ID != entity.LAUNCH_USER_ID).Select(t => t.USER_ID).ToList(); - var sendUserAll = Nav_TrainUserList.Where(t => t.IS_DELETED == false).Select(t => t.USER_ID).ToList(); - - BaseFilter userFilter = new BaseFilter(entity.ORG_ID); - userFilter.Include = new string[] { "Nav_Person.Nav_Post", "Nav_Department" }; - IEnumerable userNames = GetEntities(t => sendUserAll.Contains(t.ID), userFilter); //List listAuto = new List(); //if (entity.RECORD_USER_ID.HasValue && sendUsers.Contains(entity.RECORD_USER_ID.Value)) @@ -285,7 +285,6 @@ namespace APT.SC.WebApi.Controllers.Api.SE // listAuto.Add(entity.USER_ID_TEACHER.Value); //} - T_FM_USER userCheck = null; foreach (var user in Nav_TrainUserList) { if (user.IS_DELETED) @@ -353,6 +352,20 @@ namespace APT.SC.WebApi.Controllers.Api.SE } else { + foreach (var item in Nav_TrainUserList) + { + if (item.IS_DELETED) + continue; + userCheck = userNames.FirstOrDefault(t => t.ID == item.USER_ID); + + item.IS_LEAVE = SETrainYesNoEnum.参加; + if (userCheck != null) + { + item.DEPARTMENT_NAME = userCheck?.Nav_Department?.NAME; + item.POST_NAME = userCheck.Nav_Person?.Nav_Post?.NAME; + } + } + //没有触发培训通知 if (entity.CREATE_NOTIFY_RECORD) {