添加
This commit is contained in:
@@ -86,76 +86,6 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
await _repository.SaveChangesAsync();
|
||||
|
||||
|
||||
var createtime = DateTime.Now.AddSeconds(1);
|
||||
// 添加稽查记录
|
||||
if (isadd)
|
||||
{
|
||||
List<DataInspection> datas = new List<DataInspection>();
|
||||
|
||||
// 移到仓储了
|
||||
|
||||
//datas.Add(new DataInspection()
|
||||
//{
|
||||
// TrialId = subjectCommand.TrialId,
|
||||
// SiteId = subjectCommand.SiteId,
|
||||
// SubjectId = mapedSubject.Id,
|
||||
// SubjectCode = subjectCommand.Code,
|
||||
// IsSign=false,
|
||||
// CreateTime = createtime,
|
||||
// Identification = "Init|Subject|Status|Subject",
|
||||
// JsonDetail= JsonConvert.SerializeObject(new {
|
||||
// Status= "新增",
|
||||
// })
|
||||
//});
|
||||
|
||||
|
||||
JsonSerializerSettings settings = new JsonSerializerSettings();
|
||||
settings.PreserveReferencesHandling = PreserveReferencesHandling.Objects;
|
||||
settings.ReferenceLoopHandling = ReferenceLoopHandling.Serialize;
|
||||
//var jsonData = JsonConvert.SerializeObject(info, settings);
|
||||
|
||||
var visittime = createtime.AddSeconds(1);
|
||||
foreach (var item in svlist)
|
||||
{
|
||||
// 添加访视
|
||||
datas.Add(new DataInspection()
|
||||
{
|
||||
TrialId = subjectCommand.TrialId,
|
||||
SiteId = subjectCommand.SiteId,
|
||||
SubjectId = mapedSubject.Id,
|
||||
SubjectCode = subjectCommand.Code,
|
||||
SubjectVisitId = item.Id,
|
||||
SubjectVisitName = item.VisitName,
|
||||
BlindName = item.BlindName,
|
||||
IsSign = false,
|
||||
CreateTime = visittime,
|
||||
Identification = "Add|Visit|Info|Visit-Image Upload",
|
||||
JsonDetail = item.ToJcJson()
|
||||
});
|
||||
|
||||
// 初始化访视
|
||||
datas.Add(new DataInspection()
|
||||
{
|
||||
TrialId = subjectCommand.TrialId,
|
||||
SiteId = subjectCommand.SiteId,
|
||||
SubjectId = mapedSubject.Id,
|
||||
SubjectCode = subjectCommand.Code,
|
||||
SubjectVisitId = item.Id,
|
||||
|
||||
BlindName = item.BlindName,
|
||||
SubjectVisitName = item.VisitName,
|
||||
IsSign = false,
|
||||
CreateTime = visittime.AddSeconds(1),
|
||||
Identification = "Init|Visit|Status|Visit-Image Upload",
|
||||
JsonDetail = item.ToJcJson()
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
await _inspectionService.AddListInspectionRecordAsync(datas);
|
||||
}
|
||||
|
||||
return ResponseOutput.Ok(mapedSubject.Id.ToString());
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user