培训通知 非线上考试处理
班前会 确认时 判断上一单是否超期
This commit is contained in:
parent
564cf0dfc6
commit
d97b0e22aa
@ -61,7 +61,7 @@ namespace APT.FO.WebApi.Controllers.Api.FO
|
||||
var details = entity.Nav_Details;
|
||||
entity.Nav_Details = null;
|
||||
List<T_FO_PRE_SHIFT_MEETING_RECORD_DETAIL_POST> postList = new List<T_FO_PRE_SHIFT_MEETING_RECORD_DETAIL_POST>();
|
||||
var oldUserIds = GetEntities<T_FO_PRE_SHIFT_MEETING_RECORD_USER>(t => t.PRE_SHIFT_MEETING_RECORD_ID == entity.ID,new BaseFilter(entity.ORG_ID)).Select(m => m.ID).ToList();
|
||||
var oldUserIds = GetEntities<T_FO_PRE_SHIFT_MEETING_RECORD_USER>(t => t.PRE_SHIFT_MEETING_RECORD_ID == entity.ID, new BaseFilter(entity.ORG_ID)).Select(m => m.ID).ToList();
|
||||
var userID = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
|
||||
if (entity.TaskID != null && entity.TaskID != Guid.Empty)
|
||||
{
|
||||
@ -168,7 +168,7 @@ namespace APT.FO.WebApi.Controllers.Api.FO
|
||||
{
|
||||
entity.NAME = DateTime.Now.Date.ToString("yyyyMMdd") + TeamName + "-班前会议";
|
||||
}
|
||||
var isRepeat = GetCount<T_FO_PRE_SHIFT_MEETING_RECORD>(t => t.NAME == entity.NAME && t.PRE_MEETING_STATUS > 0 && t.CLASS_ID == entity.CLASS_ID&&t.USER_ID==entity.USER_ID, new BaseFilter(entity.ORG_ID));
|
||||
var isRepeat = GetCount<T_FO_PRE_SHIFT_MEETING_RECORD>(t => t.NAME == entity.NAME && t.PRE_MEETING_STATUS > 0 && t.CLASS_ID == entity.CLASS_ID && t.USER_ID == entity.USER_ID, new BaseFilter(entity.ORG_ID));
|
||||
if (isRepeat > 0)
|
||||
{
|
||||
throw new Exception("检测到班前会议数据重复,请联系管理员!");
|
||||
@ -226,7 +226,7 @@ namespace APT.FO.WebApi.Controllers.Api.FO
|
||||
{
|
||||
files.ForEach(t =>
|
||||
{
|
||||
t.ORG_ID = entity.ORG_ID; t.PRE_SHIFT_MEETING_RECORD_ID = entity.ID;t.Nav_ImgFile = null;
|
||||
t.ORG_ID = entity.ORG_ID; t.PRE_SHIFT_MEETING_RECORD_ID = entity.ID; t.Nav_ImgFile = null;
|
||||
});
|
||||
}
|
||||
if (entity.RATE.Equals("SaveAndNotify"))
|
||||
@ -326,34 +326,90 @@ namespace APT.FO.WebApi.Controllers.Api.FO
|
||||
entity.Nav_User = null;
|
||||
users.ForEach(t => t.Nav_User = null);
|
||||
users.ForEach(t => t.ORG_ID = entity.ORG_ID);
|
||||
users = users.Where(t => !t.IS_DELETED);
|
||||
this.UnifiedCommit(() =>
|
||||
{
|
||||
if (entity != null)
|
||||
UpdateEntityNoCommit(entity);
|
||||
if (oldUserIds != null && oldUserIds.Any())
|
||||
BantchDeleteEntityNoCommit<T_FO_PRE_SHIFT_MEETING_RECORD_USER>(oldUserIds);
|
||||
if (users!=null && users.Any())
|
||||
BantchSaveEntityNoCommit(users);
|
||||
if (detailIds != null && detailIds.Any())
|
||||
BantchDeleteEntityNoCommit<T_FO_PRE_SHIFT_MEETING_RECORD_DETAIL>(detailIds);
|
||||
if (postIds != null && postIds.Any())
|
||||
BantchDeleteEntityNoCommit<T_FO_PRE_SHIFT_MEETING_RECORD_DETAIL_POST>(postIds);
|
||||
if (details!=null &&details.Any())
|
||||
BantchSaveEntityNoCommit(details);
|
||||
if (postList != null && postList.Any())
|
||||
BantchSaveEntityNoCommit(postList);
|
||||
if (files != null && files.Any())
|
||||
BantchSaveEntityNoCommit(files);
|
||||
if (finishNotice != null)
|
||||
UpdateEntityNoCommit(finishNotice);
|
||||
if (sendNotices != null && sendNotices.Any())
|
||||
BantchAddEntityNoCommit(sendNotices);
|
||||
if (delSchedulings.Any())
|
||||
BantchDeleteEntityNoCommit<T_FM_DEPARTMENT_SCHEDULING_DETAIL>(delSchedulings);
|
||||
if (addSchedulings.Any())
|
||||
BantchAddEntityNoCommit(addSchedulings);
|
||||
});
|
||||
users = users.Where(t => !t.IS_DELETED);
|
||||
|
||||
#region 判断上一个班次超期情况
|
||||
T_FO_PRE_SHIFT_MEETING_RECORD modelLast = null;
|
||||
if (entity.RATE.Equals("SaveAndNotify"))
|
||||
{
|
||||
try
|
||||
{
|
||||
if (entity.TEAM_ID.HasValue)
|
||||
{
|
||||
//上一个 班前会 是否超时标记
|
||||
//entity.OVERTIME = FOISOVERTIME.未统计;
|
||||
//未统计 = 0, //未超时 = 1, //超时 = 2
|
||||
BasePageFilter basf = new BasePageFilter(1, 1);
|
||||
basf.Order = DbOrder.DESC;
|
||||
basf.Sort = "MEETING_TIME";
|
||||
basf.OrgId = entity.ORG_ID;
|
||||
DateTime dtMin = entity.START_TIME.AddMonths(-1);//一个月以内的
|
||||
var lastRecord = GetOrderPageEntities<T_FO_PRE_SHIFT_MEETING_RECORD>(e => e.TEAM_ID.HasValue && e.TEAM_ID.Value == entity.TEAM_ID.Value && e.START_TIME != e.END_TIME && dtMin <= e.START_TIME && e.START_TIME < entity.START_TIME, basf, null);
|
||||
if (lastRecord.Data != null && lastRecord.Data.Count() > 0)
|
||||
modelLast = lastRecord.Data.ToList()[0];
|
||||
if (modelLast != null && modelLast.OVERTIME == FOISOVERTIME.未统计)
|
||||
{
|
||||
Expression<Func<T_FM_NOTIFICATION_TASK, bool>> expressionCheck = e => !e.IS_DELETED && !e.ISCANCEL && e.SOURCE_DATA_ID.HasValue && e.SOURCE_DATA_ID == modelLast.ID && (e.SOURCE_FORMCODE == "FO003_SHOWPRINT" || e.SOURCE_FORMCODE == "FO003");
|
||||
//if (finishNotice != null)
|
||||
//{
|
||||
// expressionCheck = expressionCheck.And(e => e.CREATE_TIME.HasValue && e.CREATE_TIME < finishNotice.CREATE_TIME);
|
||||
//}
|
||||
var listCheckTask = GetEntities(expressionCheck, null, null);
|
||||
if (listCheckTask != null)
|
||||
{
|
||||
var checkT = listCheckTask.FirstOrDefault(e => e.NOTICE_STATUS == 2 || e.NOTICE_STATUS == 0);
|
||||
if (checkT != null)
|
||||
{
|
||||
modelLast.OVERTIME = FOISOVERTIME.超时;
|
||||
modelLast.MODIFY_TIME = DateTime.Now;
|
||||
}
|
||||
else
|
||||
{
|
||||
checkT = listCheckTask.FirstOrDefault(e => e.NOTICE_STATUS == 1);
|
||||
if (checkT != null)
|
||||
{
|
||||
modelLast.OVERTIME = FOISOVERTIME.未超时;
|
||||
modelLast.MODIFY_TIME = DateTime.Now;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
this.UnifiedCommit(() =>
|
||||
{
|
||||
if (entity != null)
|
||||
UpdateEntityNoCommit(entity);
|
||||
if (oldUserIds != null && oldUserIds.Any())
|
||||
BantchDeleteEntityNoCommit<T_FO_PRE_SHIFT_MEETING_RECORD_USER>(oldUserIds);
|
||||
if (users != null && users.Any())
|
||||
BantchSaveEntityNoCommit(users);
|
||||
if (detailIds != null && detailIds.Any())
|
||||
BantchDeleteEntityNoCommit<T_FO_PRE_SHIFT_MEETING_RECORD_DETAIL>(detailIds);
|
||||
if (postIds != null && postIds.Any())
|
||||
BantchDeleteEntityNoCommit<T_FO_PRE_SHIFT_MEETING_RECORD_DETAIL_POST>(postIds);
|
||||
if (details != null && details.Any())
|
||||
BantchSaveEntityNoCommit(details);
|
||||
if (postList != null && postList.Any())
|
||||
BantchSaveEntityNoCommit(postList);
|
||||
if (files != null && files.Any())
|
||||
BantchSaveEntityNoCommit(files);
|
||||
if (finishNotice != null)
|
||||
UpdateEntityNoCommit(finishNotice);
|
||||
if (sendNotices != null && sendNotices.Any())
|
||||
BantchAddEntityNoCommit(sendNotices);
|
||||
if (delSchedulings.Any())
|
||||
BantchDeleteEntityNoCommit<T_FM_DEPARTMENT_SCHEDULING_DETAIL>(delSchedulings);
|
||||
if (addSchedulings.Any())
|
||||
BantchAddEntityNoCommit(addSchedulings);
|
||||
if (modelLast != null && modelLast.OVERTIME != FOISOVERTIME.未统计)
|
||||
UpdateEntityNoCommit(modelLast);
|
||||
});
|
||||
return true;
|
||||
});
|
||||
}
|
||||
@ -517,7 +573,7 @@ namespace APT.FO.WebApi.Controllers.Api.FO
|
||||
var links = this.GetEntities<T_HM_OPERATION_LINK_POST>(t => postionIds.Contains(t.POST_ID), new BaseFilter(model.ORG_ID), "Nav_OperationLink").ToList();
|
||||
var linkIds = links.Select(m => m.OPERATION_LINK_ID).Distinct().ToList();
|
||||
//作业库中取作业环节(周期为每日作业)
|
||||
var operationTemps = this.GetEntities<T_HM_OPERATION_LINK>(t =>t.OPERATION_STEP_ID != null && linkIds.Contains(t.ID) && t.STATUS == (int)STATUSEnum.启用 && t.CYCLE_TYPE == HMCycleTypeEnum.Day, new BaseFilter(model.ORG_ID), new string[] { "Nav_WorkPermitType", "Nav_OperationStep", "Nav_SafeConfirms", "Nav_SafeMeasures", "Nav_DealMeasures" }).Distinct().ToList();
|
||||
var operationTemps = this.GetEntities<T_HM_OPERATION_LINK>(t => t.OPERATION_STEP_ID != null && linkIds.Contains(t.ID) && t.STATUS == (int)STATUSEnum.启用 && t.CYCLE_TYPE == HMCycleTypeEnum.Day, new BaseFilter(model.ORG_ID), new string[] { "Nav_WorkPermitType", "Nav_OperationStep", "Nav_SafeConfirms", "Nav_SafeMeasures", "Nav_DealMeasures" }).Distinct().ToList();
|
||||
var operations = operationTemps.Where(x => x.Nav_OperationStep != null).GroupBy(t => new { t.Nav_OperationStep.NAME }).Select(w => w.OrderBy(m => m.CREATE_TIME).FirstOrDefault()).Distinct().ToList();
|
||||
if (operations != null && operations.Any())
|
||||
{
|
||||
|
||||
@ -140,7 +140,7 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
||||
|
||||
#region 如果没有课件 只有知识点 判断 题库数量是否足够
|
||||
|
||||
if (ListCour == null || ListCour.Count() < 1)
|
||||
if (entity.CHECKTYPE == PlanCheckType.InOnLine && entity.IN_OUT == TrainInOut.In && (ListCour == null || ListCour.Count() < 1))
|
||||
{
|
||||
|
||||
#region 题目数量判断
|
||||
|
||||
Loading…
Reference in New Issue
Block a user