工作票关联风险
This commit is contained in:
parent
26aae58eaf
commit
cadd709e06
@ -85,7 +85,7 @@ namespace APT.FO.WebApi.Controllers
|
||||
if (string.IsNullOrEmpty(id))
|
||||
this.ThrowError("060010");
|
||||
var result = this.GetEntity<T_FO_CRUCIAL_LICENSE_JOB>(id, new string[] { "Nav_CrucialLicensePerson", "Nav_CrucialLicensePerson.Nav_User","Nav_Files.Nav_ImgFile",
|
||||
"Nav_CrucialLicensePerson.Nav_User.Nav_Department","Nav_OperationStep","Nav_ApplyUser","Nav_MonitorUser","Nav_JobScheme",
|
||||
"Nav_CrucialLicensePerson.Nav_User.Nav_Department","Nav_OperationStep","Nav_ApplyUser","Nav_MonitorUser","Nav_JobScheme","Nav_Risks",
|
||||
"Nav_JobScheme.Nav_PreOperSchFile","Nav_JobScheme.Nav_PreOperSchFile.Nav_ImgFile","Nav_JobScheme.Nav_PreOperSchFile.Nav_ImgFile"});
|
||||
if (result != null)
|
||||
{
|
||||
@ -161,7 +161,7 @@ namespace APT.FO.WebApi.Controllers
|
||||
// "Nav_JobScheme.Nav_PreOperSchFile.Nav_ImgFile", "Nav_CrucialLicensePerson.Nav_User" };
|
||||
//var entity = this.GetEntity<T_FO_CRUCIAL_LICENSE_JOB>(id);
|
||||
var entity = this.GetEntity<T_FO_CRUCIAL_LICENSE_JOB>(id,
|
||||
"Nav_OperationStep", "Nav_ApplyUser", "Nav_MonitorUser", "Nav_Files.Nav_ImgFile", "Nav_Department");
|
||||
"Nav_OperationStep", "Nav_ApplyUser", "Nav_MonitorUser", "Nav_Files.Nav_ImgFile", "Nav_Department", "Nav_Risks");
|
||||
if (entity != null)
|
||||
{
|
||||
var newFilter = new BaseFilter(filter.OrgId);
|
||||
@ -243,6 +243,7 @@ namespace APT.FO.WebApi.Controllers
|
||||
// dealMeasures = dealMeasures.Where(t => !t.IS_DELETED).ToList();
|
||||
//}
|
||||
var files = entity.Nav_Files;
|
||||
var risks = entity.Nav_Risks;
|
||||
var loginUserId = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
|
||||
if (entity.TaskID != Guid.Empty)
|
||||
{
|
||||
@ -257,6 +258,7 @@ namespace APT.FO.WebApi.Controllers
|
||||
entity.Nav_SafeMeasures = null;
|
||||
entity.Nav_DealMeasures = null;
|
||||
entity.Nav_Files = null;
|
||||
entity.Nav_Risks = null;
|
||||
entity.IS_PUBLISH = (int)FOPreMeetingStatusEnum.草稿;
|
||||
entity.APPLY_USER_ID = loginUserId;
|
||||
var loginUser = this.GetEntity<T_FM_USER>(t => t.ENABLE_STATUS == 0 && t.ID == (Guid)loginUserId);
|
||||
@ -310,6 +312,15 @@ namespace APT.FO.WebApi.Controllers
|
||||
x.Nav_ImgFile = null;
|
||||
});
|
||||
}
|
||||
if (risks != null && risks.Any())
|
||||
{
|
||||
risks.ForEach(x =>
|
||||
{
|
||||
x.ORG_ID = entity.ORG_ID;
|
||||
x.CRUCIAL_LICENSE_JOB_ID = entity.ID;
|
||||
x.Nav_CrucialLicenseJob = null;
|
||||
});
|
||||
}
|
||||
if (string.IsNullOrEmpty(entity.CODE))
|
||||
{
|
||||
//取审批流水码
|
||||
@ -400,6 +411,8 @@ namespace APT.FO.WebApi.Controllers
|
||||
throw new Exception("作业后处理措施不能为空!");
|
||||
if (files != null && files.Any())
|
||||
BantchSaveEntityNoCommit(files);
|
||||
if (risks != null && risks.Any())
|
||||
BantchSaveEntityNoCommit(risks);
|
||||
if (notices != null && notices.Any())
|
||||
this.BantchSaveEntityNoCommit(notices);
|
||||
if (task != null)
|
||||
@ -445,6 +458,8 @@ namespace APT.FO.WebApi.Controllers
|
||||
throw new Exception("作业后处理措施不能为空!");
|
||||
if (files != null && files.Any())
|
||||
BantchSaveEntityNoCommit(files);
|
||||
if (risks != null && risks.Any())
|
||||
BantchSaveEntityNoCommit(risks);
|
||||
if (notices != null && notices.Any())
|
||||
this.BantchSaveEntityNoCommit(notices);
|
||||
if (task != null)
|
||||
|
||||
@ -56,7 +56,7 @@ namespace APT.FO.WebApi.Controllers
|
||||
if (string.IsNullOrEmpty(id))
|
||||
this.ThrowError("060010");
|
||||
var entity = this.GetEntity<T_FO_CRUCIAL_LICENSE_JOB_OUTSOURCE>(id,
|
||||
"Nav_OperationStep", "Nav_ApplyUser", "Nav_MonitorUser", "Nav_Related", "Nav_Department");
|
||||
"Nav_OperationStep", "Nav_ApplyUser", "Nav_MonitorUser", "Nav_Related", "Nav_Department","Nav_Risks");
|
||||
if (entity != null)
|
||||
{
|
||||
var newFilter = new BaseFilter(filter.OrgId);
|
||||
@ -106,6 +106,7 @@ namespace APT.FO.WebApi.Controllers
|
||||
var safeConfirms = entity.Nav_SafeConfirms;
|
||||
var safeMeasures = entity.Nav_SafeMeasures;
|
||||
var dealMeasures = entity.Nav_DealMeasures;
|
||||
var risks = entity.Nav_Risks;
|
||||
var loginUserId = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
|
||||
if (entity.TaskID != Guid.Empty)
|
||||
{
|
||||
@ -119,6 +120,7 @@ namespace APT.FO.WebApi.Controllers
|
||||
entity.Nav_SafeConfirms = null;
|
||||
entity.Nav_SafeMeasures = null;
|
||||
entity.Nav_DealMeasures = null;
|
||||
entity.Nav_Risks = null;
|
||||
entity.IS_PUBLISH = (int)FOPreMeetingStatusEnum.草稿;
|
||||
entity.APPLY_USER_ID = loginUserId;
|
||||
entity.DEPARTMENT_ID = this.GetEntity<T_FM_USER>(t => t.ENABLE_STATUS == 0 && t.ID == (Guid)loginUserId)?.DEPARTMENT_ID;
|
||||
@ -156,6 +158,16 @@ namespace APT.FO.WebApi.Controllers
|
||||
}
|
||||
else
|
||||
throw new Exception("作业后处理措施必须填写!");
|
||||
|
||||
if (risks != null && risks.Any())
|
||||
{
|
||||
risks.ForEach(x =>
|
||||
{
|
||||
x.ORG_ID = entity.ORG_ID;
|
||||
x.CRUCIAL_LICENSE_JOB_ID = entity.ID;
|
||||
x.Nav_CrucialLicenseJob = null;
|
||||
});
|
||||
}
|
||||
if (string.IsNullOrEmpty(entity.CODE))
|
||||
{
|
||||
//取审批流水码
|
||||
@ -220,6 +232,8 @@ namespace APT.FO.WebApi.Controllers
|
||||
BantchSaveEntityNoCommit(safeMeasures); //保存子表
|
||||
if (dealMeasures != null && dealMeasures.Any())
|
||||
BantchSaveEntityNoCommit(dealMeasures); //保存子表
|
||||
if (risks != null && risks.Any())
|
||||
BantchSaveEntityNoCommit(risks);
|
||||
}, null, null, null, null, "", "FO025_SHOWPRINT", userIdss);
|
||||
return true;
|
||||
}
|
||||
@ -242,6 +256,8 @@ namespace APT.FO.WebApi.Controllers
|
||||
BantchSaveEntityNoCommit(safeMeasures); //保存子表
|
||||
if (dealMeasures != null && dealMeasures.Any())
|
||||
BantchSaveEntityNoCommit(dealMeasures); //保存子表
|
||||
if (risks != null && risks.Any())
|
||||
BantchSaveEntityNoCommit(risks);
|
||||
//if (notices != null && notices.Any())
|
||||
// this.BantchSaveEntityNoCommit(notices);
|
||||
//if (tech != null)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user