diff --git a/APT.MicroApi/APT.PP.WebApi/Controllers/Api/SEController.cs b/APT.MicroApi/APT.PP.WebApi/Controllers/Api/SEController.cs index 0062e9d..142eb21 100644 --- a/APT.MicroApi/APT.PP.WebApi/Controllers/Api/SEController.cs +++ b/APT.MicroApi/APT.PP.WebApi/Controllers/Api/SEController.cs @@ -1939,53 +1939,63 @@ namespace APT.PP.WebApi.Controllers.Api.PP var allSendUserNames = new List(); var allSendTitles = new List(); var allSendDataIds = new List(); + SETrainNotifyStatus STATUS = SETrainNotifyStatus.草稿; + foreach (var notify in notifys) { - notify.STATUS = SETrainNotifyStatus.归档; - var record = new T_SE_TRAIN_RECORD + STATUS = notify.STATUS; + try { - ID = Guid.NewGuid(), - ORG_ID = orgId, - NOTIFY_ID = notify.ID, - STATUS = SETrainRecordStatus.草稿, - }; - foreach (var user in notify.Nav_TrainUserList) - { - var joinUser = new T_SE_TRAIN_RECORD_USER + notify.STATUS = SETrainNotifyStatus.归档; + var record = new T_SE_TRAIN_RECORD { ID = Guid.NewGuid(), ORG_ID = orgId, - RECORD_ID = record.ID, - USER_ID = user.USER_ID, - DEPARTMENT_NAME = user.Nav_User.Nav_Department.NAME, - POST_NAME = user.Nav_User.Nav_Person.Nav_Post.NAME + NOTIFY_ID = notify.ID, + STATUS = SETrainRecordStatus.草稿, }; - if (user.IS_LEAVE == SETrainYesNoEnum.请假) + foreach (var user in notify.Nav_TrainUserList) { - joinUser.STATUS = SETrainRecordUserStatusEnum.请假; + var joinUser = new T_SE_TRAIN_RECORD_USER + { + ID = Guid.NewGuid(), + ORG_ID = orgId, + RECORD_ID = record.ID, + USER_ID = user.USER_ID, + DEPARTMENT_NAME = user.Nav_User.Nav_Department.NAME, + POST_NAME = user.Nav_User.Nav_Person.Nav_Post.NAME + }; + if (user.IS_LEAVE == SETrainYesNoEnum.请假) + { + joinUser.STATUS = SETrainRecordUserStatusEnum.请假; + } + else + { + joinUser.STATUS = SETrainRecordUserStatusEnum.参与; + } + joinUsers.Add(joinUser); } - else + foreach (var file in notify.Nav_Files) { - joinUser.STATUS = SETrainRecordUserStatusEnum.参与; + var recordFile = new T_SE_TRAIN_RECORD_FILE + { + ID = Guid.NewGuid(), + ORG_ID = orgId, + RECORD_ID = record.ID, + IMG_FILE_ID = file.IMG_FILE_ID + }; + files.Add(recordFile); } - joinUsers.Add(joinUser); + TrainRecords.Add(record); + allSendTitles.Add("培训记录-" + notify.NAME); + allSendDataIds.Add(record.ID); + allSendUserIds.Add((Guid)notify.RECORD_USER_ID); + allSendUserNames.Add(notify.Nav_RecordUser.NAME); } - foreach (var file in notify.Nav_Files) + catch { - var recordFile = new T_SE_TRAIN_RECORD_FILE - { - ID = Guid.NewGuid(), - ORG_ID = orgId, - RECORD_ID = record.ID, - IMG_FILE_ID = file.IMG_FILE_ID - }; - files.Add(recordFile); + notify.STATUS = STATUS; } - TrainRecords.Add(record); - allSendTitles.Add("培训记录-" + notify.NAME); - allSendDataIds.Add(record.ID); - allSendUserIds.Add((Guid)notify.RECORD_USER_ID); - allSendUserNames.Add(notify.Nav_RecordUser.NAME); notify.Nav_LaunchUser = null; notify.Nav_RecordUser = null; }; diff --git a/APT.MicroApi/APT.SC.WebApi/Controllers/Api/SEController/SETrainPlanController.cs b/APT.MicroApi/APT.SC.WebApi/Controllers/Api/SEController/SETrainPlanController.cs index 8dae805..70134f3 100644 --- a/APT.MicroApi/APT.SC.WebApi/Controllers/Api/SEController/SETrainPlanController.cs +++ b/APT.MicroApi/APT.SC.WebApi/Controllers/Api/SEController/SETrainPlanController.cs @@ -131,7 +131,7 @@ namespace APT.SC.WebApi.Controllers.Api.SE } } } - + entity.STATUS = PFStandardStatus.Approving; MFlowPermitService.InsertApprove(null, "SE071", ((int)entity.TYPE).ToString(), entity.ID, "SE071_SHOWPRINT", entity.TaskID, true, () => { UpdateEntityNoCommit(entity);