修改问题

This commit is contained in:
he
2022-04-20 13:16:01 +08:00
parent fa33be9718
commit ee0ead7017
13 changed files with 121 additions and 13 deletions
@@ -112,6 +112,8 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
public DateTime? CreateTime { get; set; }
public bool NeedSava { get; set; } = true;
}
@@ -187,7 +189,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
{
public Guid trialId { get; set; }
public Guid subjectVisitId { get; set; }
public Guid signId { get; set; }
public AuditStateEnum auditState { get; set; }
}
@@ -216,7 +216,11 @@ namespace IRaCIS.Core.Application.Service.Inspection
}
// 判断是否需要前面
await AddInspectionRecordAsync(AuditInfo, signId);
if (AuditInfo.NeedSava)
{
await AddInspectionRecordAsync(AuditInfo, signId);
}
return bResult;
}
@@ -282,7 +286,7 @@ namespace IRaCIS.Core.Application.Service.Inspection
/// <param name="addDto">添加对象</param>
/// <param name="signId">签名Id</param>
/// <returns></returns>
public async Task<IResponseOutput> AddInspectionRecordAsync(DataInspectionAddDTO addDto, Guid? signId=null)
public async Task<IResponseOutput> AddInspectionRecordAsync(DataInspectionAddDTO addDto, Guid? signId = null)
{
if (addDto == new DataInspectionAddDTO())
{
@@ -292,15 +296,19 @@ namespace IRaCIS.Core.Application.Service.Inspection
var add = _mapper.Map<DataInspection>(addDto);
await SetInspectionNameValue(add);
Guid? parentId = null;
parentId = (await _repository.GetQueryable<DataInspection>().Where( x => x.TrialId == add.TrialId && x.SubjectVisitId == add.SubjectVisitId && x.SubjectId == add.SubjectId && x.SiteId == add.SiteId&&x.ChildrenType==add.ChildrenType && x.ObjectType==add.ObjectType&&x.VisitStageId==add.VisitStageId&&x.GeneralId==add.GeneralId).OrderByDescending(x => x.CreateTime).FirstOrDefaultAsync())?.Id;
parentId = (await _repository.GetQueryable<DataInspection>().Where(x => x.TrialId == add.TrialId && x.SubjectVisitId == add.SubjectVisitId && x.SubjectId == add.SubjectId && x.SiteId == add.SiteId && x.ChildrenType == add.ChildrenType && x.ObjectType == add.ObjectType && x.VisitStageId == add.VisitStageId && x.GeneralId == add.GeneralId).OrderByDescending(x => x.CreateTime).FirstOrDefaultAsync())?.Id;
add.ParentId = parentId;
add.CreateTime = DateTime.Now;
add.CreateUserId = _userInfo.Id;
add.SignId = signId;
add.IP = _userInfo.IP;
add =await _dataInspectionRepository.SetDataInspectionDateType(add);
await _repository.AddAsync(add);
var success = await _repository.SaveChangesAsync();
return ResponseOutput.Ok(success);