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;
|
notify1.NOTICE_STATUS = 4;
|
||||||
}
|
}
|
||||||
SendNotices = NotificationTaskService.InsertUserNoticeTaskModels(allSendTitles, allSendDataIds, orgId, allSendUserIds, allSendUserNames, DateTime.Now, DateTime.Now.AddDays(10), (int)FMNoticeTypeEnum.消息, "SE018");
|
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(() =>
|
UnifiedCommit(() =>
|
||||||
{
|
{
|
||||||
if (notifys.Any())
|
if (notifys.Any())
|
||||||
@ -1968,8 +1980,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
|
|||||||
BantchAddEntityNoCommit(joinUsers);
|
BantchAddEntityNoCommit(joinUsers);
|
||||||
if (files.Any())
|
if (files.Any())
|
||||||
BantchAddEntityNoCommit(files);
|
BantchAddEntityNoCommit(files);
|
||||||
if (finishNotifys1.Any())
|
if (task != null)
|
||||||
BantchUpdateEntity(finishNotifys1);
|
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.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)
|
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
|
#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(() =>
|
UnifiedCommit(() =>
|
||||||
{
|
{
|
||||||
if (finishNotice != null)
|
if (finishNotice != null)
|
||||||
@ -424,21 +453,27 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
|||||||
UpdateEntityNoCommit(modelTextNew);
|
UpdateEntityNoCommit(modelTextNew);
|
||||||
if (listPaperNew != null && listPaperNew.Count > 0)
|
if (listPaperNew != null && listPaperNew.Count > 0)
|
||||||
BantchSaveEntityNoCommit(listPaperNew);
|
BantchSaveEntityNoCommit(listPaperNew);
|
||||||
|
|
||||||
|
//培训记录完成待审阅
|
||||||
|
if (record != null)
|
||||||
|
UpdateEntityNoCommit(record);
|
||||||
|
if (sendNotices != null)
|
||||||
|
UpdateEntityNoCommit(sendNotices);
|
||||||
});
|
});
|
||||||
SavePapersResult result = new SavePapersResult();
|
SavePapersResult result = new SavePapersResult();
|
||||||
result.IsOperateSuccessful = true;
|
result.IsOperateSuccessful = true;
|
||||||
if (RecordUser.EXAMINATION_RESULTS == SEExaminationResultsEnum.合格)
|
if (RecordUser.EXAMINATION_RESULTS == SEExaminationResultsEnum.合格)
|
||||||
{
|
{
|
||||||
result.IsPass = true;
|
result.IsPass = true;
|
||||||
result.Msg = "此次考试成绩为【" + modelText.SCORE + "】,恭喜通过考试!";
|
result.Msg = "此次考试成绩为【" + modelText.SCORE + "】分,恭喜通过考试!";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result.IsPass = false;
|
result.IsPass = false;
|
||||||
if (reSendNotice != null)
|
if (reSendNotice != null)
|
||||||
result.Msg = "此次考试成绩为【" + modelText.SCORE + " 】,考试不合格,请重新考试!";
|
result.Msg = "此次考试成绩为【" + modelText.SCORE + " 】分,考试不合格,请重新考试!";
|
||||||
else
|
else
|
||||||
result.Msg = "此次考试成绩为【" + modelText.SCORE + " 】,考试不合格,请关注重考培训通知!";
|
result.Msg = "此次考试成绩为【" + modelText.SCORE + " 】分,考试不合格,请关注重考培训通知!";
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
});
|
});
|
||||||
@ -537,7 +572,7 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
|||||||
// 原版 重新获取试题
|
// 原版 重新获取试题
|
||||||
if (config == null)
|
if (config == null)
|
||||||
config = GetEntity<T_SE_SECONFIG>(t => true);
|
config = GetEntity<T_SE_SECONFIG>(t => true);
|
||||||
if (config.COUNT_RETRY > modelText.TEXT_TIMES)
|
if (config.COUNT_RETRY < modelText.TEXT_TIMES)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
modelTextNew = new T_SE_TRAIN_RECORD_TEXT();
|
modelTextNew = new T_SE_TRAIN_RECORD_TEXT();
|
||||||
@ -595,6 +630,10 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
|||||||
string title = NoticeTitle;
|
string title = NoticeTitle;
|
||||||
if (modelTextNew.TEXT_TIMES > 1)
|
if (modelTextNew.TEXT_TIMES > 1)
|
||||||
{
|
{
|
||||||
|
if (title.Contains(" 重考("))
|
||||||
|
{
|
||||||
|
title = title.Split(" 重考(")[0];
|
||||||
|
}
|
||||||
title += " 重考(" + modelTextNew.TEXT_TIMES + ")";
|
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");
|
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;
|
T_SE_TRAIN_RECORD_TEXT modelRecordText = null;
|
||||||
IEnumerable<T_SE_TRAIN_RECORD_PAPER> listCheckPaper = 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.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);
|
listCheckPaper = GetEntities<T_SE_TRAIN_RECORD_PAPER>(t => t.RECORD_ID == record.ID && t.USER_ID == userID, null, null);
|
||||||
if (isReSend)
|
if (isReSend)
|
||||||
@ -918,7 +957,11 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
|||||||
#endregion
|
#endregion
|
||||||
if (testidlist.Count == 0)
|
if (testidlist.Count == 0)
|
||||||
{
|
{
|
||||||
throw new Exception("当前题库数据不足,未能正常生成问卷");
|
throw new Exception("当前题库数据不足,未能正常生成问卷,请联系管理员完善题库信息");
|
||||||
|
}
|
||||||
|
else if (testidlist.Count < CCount + SCount + MCount)
|
||||||
|
{
|
||||||
|
throw new Exception("当前题库数据不足,未能正常生成问卷,请联系管理员完善题库信息");
|
||||||
}
|
}
|
||||||
|
|
||||||
testidlist.ForEach(testid =>
|
testidlist.ForEach(testid =>
|
||||||
@ -979,22 +1022,27 @@ 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, "", 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));
|
sendNotices.Add(NotificationTaskService.InsertUserNoticeTaskModel("培训效果评估调查-" + record.Nav_Notify.NAME, effect.ID, filter.GetOrgId(), (Guid)effect.USER_ID, login.NAME, DateTime.Now, 1, "SE022", FMTASKTYPE.Default));
|
||||||
}
|
}
|
||||||
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 (record.Nav_Notify != null && (record.Nav_Notify.CHECKTYPE != PlanCheckType.InOnLine || record.Nav_Notify.IN_OUT != TrainInOut.In))
|
||||||
//if (chargeUser == null)
|
{
|
||||||
//{
|
//不考试
|
||||||
// chargeUser = GetEntity<T_FM_USER>(t => t.Nav_ApproveRole.NAME == "安环部安全员");
|
var userCount = record.Nav_Users.Count(t => t.STATUS == SETrainRecordUserStatusEnum.参与 && t.OK == false);
|
||||||
//}
|
if (userCount == 0 && !isReSend)
|
||||||
if (chargeUser != null)
|
|
||||||
{
|
{
|
||||||
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"));
|
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)
|
||||||
|
//{
|
||||||
|
// chargeUser = GetEntity<T_FM_USER>(t => t.Nav_ApproveRole.NAME == "安环部安全员");
|
||||||
|
//}
|
||||||
|
if (chargeUser != null)
|
||||||
|
{
|
||||||
|
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(() =>
|
UnifiedCommit(() =>
|
||||||
{
|
{
|
||||||
UpdateEntityNoCommit(record, "STATUS");
|
UpdateEntityNoCommit(record, "STATUS");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user