触发培训记录 forEach 添加 异常处理 使 互补影响

This commit is contained in:
wyw 2026-05-12 11:13:07 +08:00
parent cfdff26719
commit 32248a6b6d

View File

@ -1939,53 +1939,63 @@ namespace APT.PP.WebApi.Controllers.Api.PP
var allSendUserNames = new List<string>();
var allSendTitles = new List<string>();
var allSendDataIds = new List<Guid>();
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;
};