修改一版
parent
186a1061a9
commit
c34e9dbda9
|
@ -119,6 +119,9 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
if (visitPlan.Id == Guid.Empty || visitPlan.Id == null)//add
|
if (visitPlan.Id == Guid.Empty || visitPlan.Id == null)//add
|
||||||
{
|
{
|
||||||
|
var trial = (await _trialRepository.FirstOrDefaultAsync(t => t.Id == visitPlan.TrialId)).IfNullThrowException();
|
||||||
|
|
||||||
|
trial.VisitPlanConfirmed = false;
|
||||||
|
|
||||||
if (await _visitStageRepository.AnyAsync(t => t.TrialId == visitPlan.TrialId && (t.VisitName == visitPlan.VisitName || t.VisitNum == visitPlan.VisitNum), true))
|
if (await _visitStageRepository.AnyAsync(t => t.TrialId == visitPlan.TrialId && (t.VisitName == visitPlan.VisitName || t.VisitNum == visitPlan.VisitNum), true))
|
||||||
{
|
{
|
||||||
|
|
|
@ -82,6 +82,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
typeof(TrialUser),
|
typeof(TrialUser),
|
||||||
typeof(TrialSiteSurvey),
|
typeof(TrialSiteSurvey),
|
||||||
typeof(TrialSiteUser),
|
typeof(TrialSiteUser),
|
||||||
|
typeof(VisitStage),
|
||||||
typeof(TrialSite)
|
typeof(TrialSite)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -132,7 +133,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
type = type + (entity.ParentId == null ? "/parent" : string.Empty);
|
type = type + (entity.ParentId == null ? "/parent" : string.Empty);
|
||||||
await InsertInspection<SystemBasicData>(item, type, x => new DataInspection()
|
await InsertInspection<SystemBasicData>(item, type, x => new DataInspection()
|
||||||
{
|
{
|
||||||
VisitStageId = x.Id,
|
GeneralId = x.Id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,9 +185,20 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
// 访视计划
|
// 访视计划
|
||||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(VisitStage)))
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(VisitStage)))
|
||||||
{
|
{
|
||||||
|
var entity = item.Entity as VisitStage;
|
||||||
|
|
||||||
|
|
||||||
|
var VisitPlanStatus =await this._dbContext.Trial.Where(x => x.Id == entity.TrialId).Select(x => x.VisitPlanConfirmed).FirstOrDefaultAsync();
|
||||||
|
if (type == "Add")
|
||||||
|
{
|
||||||
|
VisitPlanStatus = false;
|
||||||
|
}
|
||||||
await InsertInspection<VisitStage>(item, type, x => new DataInspection()
|
await InsertInspection<VisitStage>(item, type, x => new DataInspection()
|
||||||
{
|
{
|
||||||
VisitStageId = x.Id,
|
VisitStageId = x.Id,
|
||||||
|
GeneralId=x.Id,
|
||||||
|
},new {
|
||||||
|
VisitPlanStatus= VisitPlanStatus,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue