动火作业
This commit is contained in:
parent
2dc63f37c2
commit
03f1f56643
@ -266,9 +266,24 @@ namespace APT.FO.WebApi.Controllers
|
||||
List<T_FM_NOTIFICATION_TASK> notices = new List<T_FM_NOTIFICATION_TASK>();
|
||||
if (entity.PUBLISH != null && entity.PUBLISH.Equals("SaveAndNotify"))
|
||||
{
|
||||
//监护人员填写
|
||||
if (entity.FIRE_STATUS == FOFireStatus.Monitor)
|
||||
{
|
||||
//监护人员填写
|
||||
if (entity.FIRE_STATUS == FOFireStatus.Monitor)
|
||||
{
|
||||
if (string.IsNullOrEmpty(entity.COMPLETED_CONTENT))
|
||||
throw new Exception("动火作业完工验收情况必须填写");
|
||||
if (entity.IS_LEAVE == null)
|
||||
throw new Exception("是否撤离必须填写");
|
||||
if (entity.IS_LEAVE == FOYesOrNoEnum.No)
|
||||
throw new Exception("不可撤离请稍后再进行验收");
|
||||
if (entity.ACT_END_DATE == null)
|
||||
throw new Exception("动火实际结束时间必须填写");
|
||||
if (entity.LEAVE_DATE == null)
|
||||
throw new Exception("离开现场时间必须填写");
|
||||
if (entity.Nav_MonitorFiles == null|| !entity.Nav_MonitorFiles.Any())
|
||||
throw new Exception("必须上传完工验收附件,如照片视频等");
|
||||
var detailNeed = detailList.FirstOrDefault(t => (t.JOB_STEP == FOJobStepEnum.Ing && t.IS_CONFIRM_NEW == false) || (t.JOB_STEP == FOJobStepEnum.After && t.IS_CONFIRM_NEW == false));
|
||||
if (detailNeed != null)
|
||||
throw new Exception("作业中或作业后未全部确认!");
|
||||
//触发给动火部门负责人、安全管理人员审阅
|
||||
var sendUser = this.GetEntities<T_FM_USER>(t => t.ID == entity.FIRE_USER_ID || t.ID == entity.SAFE_USER_ID, new BaseFilter(entity.ORG_ID)).ToList();
|
||||
if (sendUser != null && sendUser.Any())
|
||||
@ -288,6 +303,19 @@ namespace APT.FO.WebApi.Controllers
|
||||
//动火作业人员填写
|
||||
else if (entity.FIRE_STATUS == FOFireStatus.Sign)
|
||||
{
|
||||
if (string.IsNullOrEmpty(entity.COMPLETED_CONDITION))
|
||||
throw new Exception("动火作业现场条件验收情况必须填写");
|
||||
if (entity.IS_FIRE == null)
|
||||
throw new Exception("是否可以动火必须填写");
|
||||
if (entity.IS_FIRE == FOYesOrNoEnum.No)
|
||||
throw new Exception("不可动火请稍后再进行验收");
|
||||
if (entity.ACT_DATE == null)
|
||||
throw new Exception("动火实际开始时间必须填写");
|
||||
if (entity.Nav_FireFiles == null || !entity.Nav_FireFiles.Any())
|
||||
throw new Exception("必须上传现场条件验收附件,如照片视频等");
|
||||
var detailNeed = detailList.FirstOrDefault(t => t.JOB_STEP == FOJobStepEnum.Pre && t.IS_CONFIRM_NEW == false);
|
||||
if (detailNeed != null)
|
||||
throw new Exception("作业前未全部确认!");
|
||||
//触发给动火部门负责人、安全管理人员、矿调度人员审阅
|
||||
var sendUser = this.GetEntities<T_FM_USER>(t => t.ID == entity.FIRE_USER_ID || t.ID == entity.SAFE_USER_ID || t.ID == entity.DISPATCH_USER_ID, new BaseFilter(entity.ORG_ID)).ToList();
|
||||
if (sendUser != null && sendUser.Any())
|
||||
@ -372,6 +400,12 @@ namespace APT.FO.WebApi.Controllers
|
||||
return true;
|
||||
}
|
||||
}
|
||||
T_FM_NOTIFICATION_TASK task = null;
|
||||
if (entity.TaskID != Guid.Empty)
|
||||
{
|
||||
task = NotificationTaskService.GetTaskFinishModel(entity.TaskID);
|
||||
task.SOURCE_FORMCODE = "FO043_SHOWPRINT";
|
||||
}
|
||||
this.UnifiedCommit(() =>
|
||||
{
|
||||
if (detailFileIds != null && detailFileIds.Any())
|
||||
@ -410,6 +444,8 @@ namespace APT.FO.WebApi.Controllers
|
||||
this.BantchSaveEntityNoCommit(fileList);
|
||||
if (notices != null && notices.Any())
|
||||
this.BantchSaveEntityNoCommit(notices);
|
||||
if (task != null)
|
||||
UpdateEntityNoCommit(task);
|
||||
});
|
||||
return true;
|
||||
});
|
||||
|
||||
@ -292,6 +292,21 @@ namespace APT.FO.WebApi.Controllers
|
||||
//监护人员填写
|
||||
if (entity.FIRE_STATUS == FOFireStatus.Monitor)
|
||||
{
|
||||
if (string.IsNullOrEmpty(entity.COMPLETED_CONTENT))
|
||||
throw new Exception("动火作业完工验收情况必须填写");
|
||||
if (entity.IS_LEAVE == null)
|
||||
throw new Exception("是否撤离必须填写");
|
||||
if (entity.IS_LEAVE == FOYesOrNoEnum.No)
|
||||
throw new Exception("不可撤离请稍后再进行验收");
|
||||
if (entity.ACT_END_DATE == null)
|
||||
throw new Exception("动火实际结束时间必须填写");
|
||||
if (entity.LEAVE_DATE == null)
|
||||
throw new Exception("离开现场时间必须填写");
|
||||
if (entity.Nav_MonitorFiles == null || !entity.Nav_MonitorFiles.Any())
|
||||
throw new Exception("必须上传完工验收附件,如照片视频等");
|
||||
var detailNeed = detailList.FirstOrDefault(t => (t.JOB_STEP == FOJobStepEnum.Ing && t.IS_CONFIRM_NEW == false) || (t.JOB_STEP == FOJobStepEnum.After && t.IS_CONFIRM_NEW == false));
|
||||
if (detailNeed != null)
|
||||
throw new Exception("作业中或作业后未全部确认!");
|
||||
//外部施工单位,安全员自动置为已审阅
|
||||
entity.USER_DEAL_FINISH_STATUS = FOUserShiftStatusEnum.已处理;
|
||||
entity.SAFE_DEAL_FINISH_STATUS = FOUserShiftStatusEnum.已处理;
|
||||
@ -301,6 +316,20 @@ namespace APT.FO.WebApi.Controllers
|
||||
//发起人填写
|
||||
else if (entity.FIRE_STATUS == FOFireStatus.Sign)
|
||||
{
|
||||
|
||||
if (string.IsNullOrEmpty(entity.COMPLETED_CONDITION))
|
||||
throw new Exception("动火作业现场条件验收情况必须填写");
|
||||
if (entity.IS_FIRE == null)
|
||||
throw new Exception("是否可以动火必须填写");
|
||||
if (entity.IS_FIRE == FOYesOrNoEnum.No)
|
||||
throw new Exception("不可动火请稍后再进行验收");
|
||||
if (entity.ACT_DATE == null)
|
||||
throw new Exception("动火实际开始时间必须填写");
|
||||
if (entity.Nav_FireFiles == null || !entity.Nav_FireFiles.Any())
|
||||
throw new Exception("必须上传现场条件验收附件,如照片视频等");
|
||||
var detailNeed = detailList.FirstOrDefault(t => t.JOB_STEP == FOJobStepEnum.Pre && t.IS_CONFIRM_NEW == false);
|
||||
if (detailNeed != null)
|
||||
throw new Exception("作业前未全部确认!");
|
||||
//外部施工单位,安全员自动置为已审阅
|
||||
entity.USER_DEAL_STATUS = FOUserShiftStatusEnum.已处理;
|
||||
entity.SAFE_DEAL_STATUS = FOUserShiftStatusEnum.已处理;
|
||||
@ -449,6 +478,12 @@ namespace APT.FO.WebApi.Controllers
|
||||
}
|
||||
|
||||
}
|
||||
T_FM_NOTIFICATION_TASK task = null;
|
||||
if (entity.TaskID != Guid.Empty)
|
||||
{
|
||||
task = NotificationTaskService.GetTaskFinishModel(entity.TaskID);
|
||||
task.SOURCE_FORMCODE = "FO045_SHOWPRINT";
|
||||
}
|
||||
this.UnifiedCommit(() =>
|
||||
{
|
||||
if (deleteUserSignIds != null && deleteUserSignIds.Any())
|
||||
@ -505,6 +540,8 @@ namespace APT.FO.WebApi.Controllers
|
||||
this.BantchSaveEntityNoCommit(detailUser);
|
||||
if (notices != null && notices.Any())
|
||||
this.BantchSaveEntityNoCommit(notices);
|
||||
if (task != null)
|
||||
UpdateEntityNoCommit(task);
|
||||
});
|
||||
return true;
|
||||
});
|
||||
|
||||
@ -1931,7 +1931,7 @@ namespace APT.PP.WebApi.Controllers.Api.PP
|
||||
if (sendUser != null)
|
||||
{
|
||||
var userName = users.FirstOrDefault(t => t.ID == sendUser.USER_ID)?.NAME;
|
||||
var notice = NotificationTaskService.InsertUserNoticeTaskModel("动火作业工作票现场验收" + step?.NAME, item.ID, item.ORG_ID, (Guid)sendUser.USER_ID, userName, DateTime.Now,
|
||||
var notice = NotificationTaskService.InsertUserNoticeTaskModel("动火作业工作票"+ step?.NAME + "-现场验收", item.ID, item.ORG_ID, (Guid)sendUser.USER_ID, userName, DateTime.Now,
|
||||
DateTime.Now.AddHours(24), (int)FMNoticeTypeEnum.消息, "FO043");
|
||||
notices.Add(notice);
|
||||
}
|
||||
@ -1949,7 +1949,7 @@ namespace APT.PP.WebApi.Controllers.Api.PP
|
||||
if (item.APPLY_USER_ID != null )
|
||||
{
|
||||
var userName = users.FirstOrDefault(t => t.ID == item.APPLY_USER_ID)?.NAME;
|
||||
var notice = NotificationTaskService.InsertUserNoticeTaskModel("动火作业工作票现场验收(外包)" + step?.NAME, item.ID, item.ORG_ID, (Guid)item.APPLY_USER_ID, userName, DateTime.Now,
|
||||
var notice = NotificationTaskService.InsertUserNoticeTaskModel("动火作业工作票"+ step?.NAME + "-现场验收(外包)", item.ID, item.ORG_ID, (Guid)item.APPLY_USER_ID, userName, DateTime.Now,
|
||||
DateTime.Now.AddHours(24), (int)FMNoticeTypeEnum.消息, "FO045");
|
||||
notices.Add(notice);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user