1、培训记录 跑批 如果有设置参数 跑后参数清空
2、培训记录完成待审阅 如果有考试的,考完再触发 (签到多加判断 不直接触发 培训记录完成待审阅) 3、内部线上考核才进入 考试 4、按培训内容 题目不够 判断完善
This commit is contained in:
parent
1abe6eef18
commit
c1dfe00a50
@ -1956,6 +1956,18 @@ namespace APT.PP.WebApi.Controllers.Api.PP
|
||||
notify1.NOTICE_STATUS = 4;
|
||||
}
|
||||
SendNotices = NotificationTaskService.InsertUserNoticeTaskModels(allSendTitles, allSendDataIds, orgId, allSendUserIds, allSendUserNames, DateTime.Now, DateTime.Now.AddDays(10), (int)FMNoticeTypeEnum.消息, "SE018");
|
||||
|
||||
T_FM_SYNC_TASK task = null;
|
||||
if (!string.IsNullOrEmpty(filter.Parameter1))
|
||||
{
|
||||
task = GetEntity<T_FM_SYNC_TASK>(filter.Keyword);
|
||||
if (task != null)
|
||||
{
|
||||
task.UPDATE_SUCCES_TIME = DateTime.Now;//上次同步结束时间
|
||||
task.SYNC_PARAM = "";//清空参数
|
||||
}
|
||||
}
|
||||
|
||||
UnifiedCommit(() =>
|
||||
{
|
||||
if (notifys.Any())
|
||||
@ -1968,8 +1980,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
|
||||
BantchAddEntityNoCommit(joinUsers);
|
||||
if (files.Any())
|
||||
BantchAddEntityNoCommit(files);
|
||||
if (finishNotifys1.Any())
|
||||
BantchUpdateEntity(finishNotifys1);
|
||||
if (task != null)
|
||||
UpdateEntityNoCommit(task);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
||||
}
|
||||
|
||||
//if (data.Nav_Notify != null && data.Nav_Notify.Nav_TrainCheckType != null && data.Nav_Notify.Nav_TrainCheckType.NAME == "笔试")
|
||||
if (data.Nav_Notify != null && data.Nav_Notify.CHECKTYPE == PlanCheckType.InOnLine)
|
||||
if (data.Nav_Notify != null && data.Nav_Notify.CHECKTYPE == PlanCheckType.InOnLine && data.Nav_Notify.IN_OUT == TrainInOut.In)
|
||||
{
|
||||
if (data.Nav_Notify.Nav_ListCour != null && data.Nav_Notify.Nav_ListCour.Count() > 0)
|
||||
{
|
||||
@ -409,6 +409,35 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
||||
|
||||
#endregion
|
||||
|
||||
#region 如果考试合格并且是最后一个考试 培训记录完成待审阅
|
||||
|
||||
T_SE_TRAIN_RECORD record = null;
|
||||
T_FM_NOTIFICATION_TASK sendNotices = null;
|
||||
if (RecordUser.EXAMINATION_RESULTS == SEExaminationResultsEnum.合格)
|
||||
{
|
||||
var check = GetEntity<T_SE_TRAIN_RECORD_USER>(e => e.RECORD_ID == modelText.RECORD_ID && e.STATUS == SETrainRecordUserStatusEnum.参与 && e.OK == false && e.USER_ID != APT.Infrastructure.Api.AppContext.CurrentSession.UserID);
|
||||
if (check == null || check.ID == Guid.Empty)
|
||||
{
|
||||
record = GetEntity<T_SE_TRAIN_RECORD>(e => e.ID == modelText.RECORD_ID, "Nav_Notify");
|
||||
record.STATUS = SETrainRecordStatus.审阅中;
|
||||
T_FM_USER chargeUser = UserService.GetSafeApproveUser(modelText.ORG_ID.Value, 10);
|
||||
|
||||
//var chargeUser = GetEntity<T_FM_USER>(t => t.Nav_ApproveRole.NAME == "安环部负责人");
|
||||
//if (chargeUser == null)
|
||||
//{
|
||||
// chargeUser = GetEntity<T_FM_USER>(t => t.Nav_ApproveRole.NAME == "安环部安全员");
|
||||
//}
|
||||
if (chargeUser != null)
|
||||
{
|
||||
sendNotices = NotificationTaskService.InsertUserNoticeTaskModel("培训记录完成待审阅-" + record.Nav_Notify.NAME, record.ID, record.ORG_ID, chargeUser.ID, chargeUser.NAME, DateTime.Now, DateTime.Now.AddDays(2), 1, "SE017_SHOWPRINT");
|
||||
}
|
||||
record.Nav_Notify = null;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
UnifiedCommit(() =>
|
||||
{
|
||||
if (finishNotice != null)
|
||||
@ -424,21 +453,27 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
||||
UpdateEntityNoCommit(modelTextNew);
|
||||
if (listPaperNew != null && listPaperNew.Count > 0)
|
||||
BantchSaveEntityNoCommit(listPaperNew);
|
||||
|
||||
//培训记录完成待审阅
|
||||
if (record != null)
|
||||
UpdateEntityNoCommit(record);
|
||||
if (sendNotices != null)
|
||||
UpdateEntityNoCommit(sendNotices);
|
||||
});
|
||||
SavePapersResult result = new SavePapersResult();
|
||||
result.IsOperateSuccessful = true;
|
||||
if (RecordUser.EXAMINATION_RESULTS == SEExaminationResultsEnum.合格)
|
||||
{
|
||||
result.IsPass = true;
|
||||
result.Msg = "此次考试成绩为【" + modelText.SCORE + "】,恭喜通过考试!";
|
||||
result.Msg = "此次考试成绩为【" + modelText.SCORE + "】分,恭喜通过考试!";
|
||||
}
|
||||
else
|
||||
{
|
||||
result.IsPass = false;
|
||||
if (reSendNotice != null)
|
||||
result.Msg = "此次考试成绩为【" + modelText.SCORE + " 】,考试不合格,请重新考试!";
|
||||
result.Msg = "此次考试成绩为【" + modelText.SCORE + " 】分,考试不合格,请重新考试!";
|
||||
else
|
||||
result.Msg = "此次考试成绩为【" + modelText.SCORE + " 】,考试不合格,请关注重考培训通知!";
|
||||
result.Msg = "此次考试成绩为【" + modelText.SCORE + " 】分,考试不合格,请关注重考培训通知!";
|
||||
}
|
||||
return result;
|
||||
});
|
||||
@ -537,7 +572,7 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
||||
// 原版 重新获取试题
|
||||
if (config == null)
|
||||
config = GetEntity<T_SE_SECONFIG>(t => true);
|
||||
if (config.COUNT_RETRY > modelText.TEXT_TIMES)
|
||||
if (config.COUNT_RETRY < modelText.TEXT_TIMES)
|
||||
return;
|
||||
|
||||
modelTextNew = new T_SE_TRAIN_RECORD_TEXT();
|
||||
@ -595,6 +630,10 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
||||
string title = NoticeTitle;
|
||||
if (modelTextNew.TEXT_TIMES > 1)
|
||||
{
|
||||
if (title.Contains(" 重考("))
|
||||
{
|
||||
title = title.Split(" 重考(")[0];
|
||||
}
|
||||
title += " 重考(" + modelTextNew.TEXT_TIMES + ")";
|
||||
}
|
||||
sendNotice = NotificationTaskService.InsertUserNoticeTaskModel(title, modelTextNew.ID, modelTextNew.ORG_ID, login.ID, login.NAME, DateTime.Now, DateTime.Now.AddDays(2), 1, "SE018_PAPERPAGE");
|
||||
@ -779,7 +818,7 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
||||
T_SE_TRAIN_RECORD_TEXT modelRecordText = null;
|
||||
IEnumerable<T_SE_TRAIN_RECORD_PAPER> listCheckPaper = null;
|
||||
//if (record.Nav_Notify != null && record.Nav_Notify.Nav_TrainCheckType != null && record.Nav_Notify.Nav_TrainCheckType.NAME == "笔试")
|
||||
if (record.Nav_Notify != null && record.Nav_Notify.CHECKTYPE == PlanCheckType.InOnLine)
|
||||
if (record.Nav_Notify != null && record.Nav_Notify.CHECKTYPE == PlanCheckType.InOnLine && record.Nav_Notify.IN_OUT == TrainInOut.In)
|
||||
{
|
||||
listCheckPaper = GetEntities<T_SE_TRAIN_RECORD_PAPER>(t => t.RECORD_ID == record.ID && t.USER_ID == userID, null, null);
|
||||
if (isReSend)
|
||||
@ -918,7 +957,11 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
||||
#endregion
|
||||
if (testidlist.Count == 0)
|
||||
{
|
||||
throw new Exception("当前题库数据不足,未能正常生成问卷");
|
||||
throw new Exception("当前题库数据不足,未能正常生成问卷,请联系管理员完善题库信息");
|
||||
}
|
||||
else if (testidlist.Count < CCount + SCount + MCount)
|
||||
{
|
||||
throw new Exception("当前题库数据不足,未能正常生成问卷,请联系管理员完善题库信息");
|
||||
}
|
||||
|
||||
testidlist.ForEach(testid =>
|
||||
@ -979,12 +1022,15 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
||||
//sendNotices.Add(NotificationTaskService.InsertUserNoticeTaskModel("培训效果评估调查-" + record.Nav_Notify.NAME, effect.ID, filter.GetOrgId(), (Guid)effect.USER_ID, "", DateTime.Now, DateTime.Now.AddDays(2), 1, "SE022"));
|
||||
sendNotices.Add(NotificationTaskService.InsertUserNoticeTaskModel("培训效果评估调查-" + record.Nav_Notify.NAME, effect.ID, filter.GetOrgId(), (Guid)effect.USER_ID, login.NAME, DateTime.Now, 1, "SE022", FMTASKTYPE.Default));
|
||||
}
|
||||
|
||||
if (record.Nav_Notify != null && (record.Nav_Notify.CHECKTYPE != PlanCheckType.InOnLine || record.Nav_Notify.IN_OUT != TrainInOut.In))
|
||||
{
|
||||
//不考试
|
||||
var userCount = record.Nav_Users.Count(t => t.STATUS == SETrainRecordUserStatusEnum.参与 && t.OK == false);
|
||||
if (userCount == 0 && !isReSend)
|
||||
{
|
||||
record.STATUS = SETrainRecordStatus.审阅中;
|
||||
T_FM_USER chargeUser = UserService.GetSafeApproveUser(record.ORG_ID.Value, 10);
|
||||
|
||||
//var chargeUser = GetEntity<T_FM_USER>(t => t.Nav_ApproveRole.NAME == "安环部负责人");
|
||||
//if (chargeUser == null)
|
||||
//{
|
||||
@ -995,6 +1041,8 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
||||
sendNotices.Add(NotificationTaskService.InsertUserNoticeTaskModel("培训记录完成待审阅-" + record.Nav_Notify.NAME, Guid.Parse(filter.Keyword), filter.GetOrgId(), chargeUser.ID, chargeUser.NAME, DateTime.Now, DateTime.Now.AddDays(2), 1, "SE017_SHOWPRINT"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UnifiedCommit(() =>
|
||||
{
|
||||
UpdateEntityNoCommit(record, "STATUS");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user