修改代码
This commit is contained in:
@@ -2022,12 +2022,28 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
[HttpPost("{trialId:guid}")]
|
||||
public async Task<IResponseOutput> ForwardSVDicomImage(Guid[] subjectVisitIdList)
|
||||
{
|
||||
|
||||
List<DataInspection> datas = new List<DataInspection>();
|
||||
|
||||
foreach (var subjectVisitId in subjectVisitIdList)
|
||||
{
|
||||
var info = await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).ProjectTo<DicomTrialSiteSubjectInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
|
||||
|
||||
|
||||
var info = await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).ProjectTo<DicomTrialSiteSubjectInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
|
||||
Dictionary<string, object> keyValuePairs = new Dictionary<string, object>() {
|
||||
{"SubmitState","已提交" },
|
||||
{ "AuditState","通过"},
|
||||
{ "CheckState",info.CheckState== CheckStateEnum.CVIng? "核查中": "核查通过"},
|
||||
{ "ForwardState",""}
|
||||
|
||||
};
|
||||
DataInspection data = new DataInspection()
|
||||
{
|
||||
TrialId= info.TrialId,
|
||||
SiteId=info.SiteId,
|
||||
SubjectId=info.SubjectId,
|
||||
SubjectVisitId= subjectVisitId,
|
||||
Identification= "NaN-14-0"
|
||||
};
|
||||
var targetPath = "/IMPORT-IMAGES/" + info.TrialCode + "_" + info.SubjectCode + "_" + info.VisitName;
|
||||
|
||||
var path = _dicomFileStoreHelper.GetSubjectVisitPath(info.TrialId, info.SiteId, info.SubjectId, info.SubjectVisitId);
|
||||
@@ -2091,13 +2107,21 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
|
||||
await _subjectVisitRepository.BatchUpdateAsync(t => t.Id == subjectVisitId,
|
||||
u => new SubjectVisit() { ForwardState = ForwardStateEnum.ForwardFailed });
|
||||
keyValuePairs["ForwardState"] = "转发失败";
|
||||
}
|
||||
|
||||
await _subjectVisitRepository.BatchUpdateAsync(t => t.Id == subjectVisitId,
|
||||
u => new SubjectVisit() { ForwardState = ForwardStateEnum.Forwarded,ForwardUserId = _userInfo.Id,ForwardTime = DateTime.Now});
|
||||
}
|
||||
|
||||
|
||||
keyValuePairs["ForwardState"] = "转发成功";
|
||||
|
||||
data.JsonDetail = JsonConvert.SerializeObject(keyValuePairs);
|
||||
datas.Add(data);
|
||||
}
|
||||
await _subjectVisitRepository.AddListInspectionRecordAsync(datas);
|
||||
|
||||
await _subjectVisitRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user