作业活动记录
This commit is contained in:
parent
a7176ff65b
commit
4fdf21e31b
@ -140,7 +140,8 @@ namespace APT.MS.Domain.Enums
|
||||
签到中 = 1,
|
||||
已归档 = 2,
|
||||
审核中 = 3,
|
||||
已驳回 = 4,
|
||||
已驳回 = 4,
|
||||
完工验收 = 5,
|
||||
终止 = 6,
|
||||
}
|
||||
/// <summary>
|
||||
|
||||
@ -366,6 +366,10 @@ namespace APT.FO.WebApi.Controllers
|
||||
users.ForEach(t => t.DEAL_STATUS = 1);
|
||||
//触发完工验收
|
||||
GetAutoNext(entity, ref notices);
|
||||
if (notices != null && notices.Any())
|
||||
{
|
||||
entity.FORM_STATUS = (int)FOTeamActivityState.完工验收;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -389,20 +393,32 @@ namespace APT.FO.WebApi.Controllers
|
||||
notices = NotificationTaskService.InsertUserNoticeTaskModels("作业活动记录表单(关键和许可作业)", entity.ID, entity.ORG_ID, userIds, UserNames, DateTime.Now,
|
||||
dtEnd, (int)FMNoticeTypeEnum.消息, "FO021_SHOWPRINT");
|
||||
//触发完工验收
|
||||
GetAutoNext(entity, ref notices);
|
||||
GetAutoNext(entity, ref notices);
|
||||
if (notices != null && notices.Any())
|
||||
{
|
||||
entity.FORM_STATUS = (int)FOTeamActivityState.完工验收;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
entity.FORM_STATUS = (int)FOTeamActivityState.已归档;
|
||||
//触发完工验收
|
||||
GetAutoNext(entity, ref notices);
|
||||
GetAutoNext(entity, ref notices);
|
||||
if (notices != null && notices.Any())
|
||||
{
|
||||
entity.FORM_STATUS = (int)FOTeamActivityState.完工验收;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//触发完工验收
|
||||
GetAutoNext(entity,ref notices);
|
||||
GetAutoNext(entity,ref notices);
|
||||
if (notices != null && notices.Any())
|
||||
{
|
||||
entity.FORM_STATUS = (int)FOTeamActivityState.完工验收;
|
||||
}
|
||||
}
|
||||
//查询消息表
|
||||
//var userID = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
|
||||
@ -615,12 +631,12 @@ namespace APT.FO.WebApi.Controllers
|
||||
var user = this.GetEntity<T_FO_JOB_ACTIVITY_PERSON>(t => t.JOB_ACTIVITY_RECORD_ID == entity.ID && t.USER_ID == userID, new BaseFilter(orgId));
|
||||
user.DEAL_STATUS = (int)FOUserShiftStatusEnum.已处理;
|
||||
var todoCount = this.GetCount<T_FO_JOB_ACTIVITY_PERSON>(t => t.JOB_ACTIVITY_RECORD_ID == entity.ID && t.DEAL_STATUS == 0 && t.USER_ID != userID, new BaseFilter(orgId));
|
||||
T_FO_JOB_ACTIVITY_RECORD model = null;
|
||||
//T_FO_JOB_ACTIVITY_RECORD model = null;
|
||||
//List<T_FM_NOTIFICATION_TASK> notices = new List<T_FM_NOTIFICATION_TASK>();
|
||||
if (todoCount == 0)
|
||||
{
|
||||
model = GetEntity<T_FO_JOB_ACTIVITY_RECORD>(entity.ID.ToString());
|
||||
model.FORM_STATUS = (int)FOTeamActivityState.已归档;
|
||||
//model = GetEntity<T_FO_JOB_ACTIVITY_RECORD>(entity.ID.ToString());
|
||||
//model.FORM_STATUS = (int)FOTeamActivityState.已归档;
|
||||
//触发完工验收
|
||||
//var userIds = new List<Guid>();
|
||||
//var record = this.GetEntity<T_FO_JOB_ACTIVITY_RECORD>(t=>t.ID == entity.ID);
|
||||
@ -663,8 +679,8 @@ namespace APT.FO.WebApi.Controllers
|
||||
}
|
||||
this.UnifiedCommit(() =>
|
||||
{
|
||||
if (model != null)
|
||||
UpdateEntityNoCommit(model);
|
||||
//if (model != null)
|
||||
// UpdateEntityNoCommit(model);
|
||||
if (task != null)
|
||||
this.UpdateEntityNoCommit(task);
|
||||
if (user != null)
|
||||
@ -698,10 +714,18 @@ namespace APT.FO.WebApi.Controllers
|
||||
task = NotificationTaskService.GetTaskFinishModel(entity.TaskID);
|
||||
task.SOURCE_FORMCODE = "FO022_SHOWPRINT";
|
||||
}
|
||||
var record = this.GetEntity<T_FO_JOB_ACTIVITY_RECORD>(t => t.ID == entity.ID);
|
||||
var taskFinish = GetEntity<T_FM_NOTIFICATION_TASK>(t => t.SOURCE_DATA_ID == entity.ID && t.ID != entity.TaskID && t.NOTICE_STATUS == 0 && t.NOTICE_TITLE.Contains("完工验收"));
|
||||
if (taskFinish == null)
|
||||
{
|
||||
record.FORM_STATUS = (int)FOTeamActivityState.已归档;
|
||||
}
|
||||
this.UnifiedCommit(() =>
|
||||
{
|
||||
if (task != null)
|
||||
this.UpdateEntityNoCommit(task);
|
||||
this.UpdateEntityNoCommit(task);
|
||||
if (record != null)
|
||||
this.UpdateEntityNoCommit(record);
|
||||
});
|
||||
return true;
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user