添加数据
This commit is contained in:
@@ -78,6 +78,8 @@ namespace IRaCIS.Core.Application.Service
|
||||
ModuleTypeId = additem?.ModuleTypeId,
|
||||
ObjectTypeId = additem?.ObjectTypeId,
|
||||
OptTypeId = additem?.OptTypeId,
|
||||
DictionaryCode = lst.Max(x => x.DictionaryCode),
|
||||
DictionaryType = lst.Max(x => x.DictionaryType),
|
||||
DateType = lst.Select(x => x.DateType).FirstOrDefault(),
|
||||
Id =Guid.NewGuid(),
|
||||
}).ToList();
|
||||
@@ -101,6 +103,8 @@ namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
x.Code=x.Code.IsNullOrEmpty()?item.Code:x.Code;
|
||||
x.Value = x.Code.IsNullOrEmpty() ? item.Value : x.Value;
|
||||
x.DictionaryType = x.DictionaryType.IsNullOrEmpty() ? item.DictionaryType : x.DictionaryType;
|
||||
x.DictionaryCode = x.DictionaryCode.IsNullOrEmpty() ? item.DictionaryCode : x.DictionaryCode;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
public interface ITrialDocumentService
|
||||
{
|
||||
Task<IResponseOutput> UserAbandonDoc(Guid documentId, bool isSystemDoc);
|
||||
Task<IResponseOutput> AddOrUpdateTrialDocument(AddOrEditTrialDocument addOrEditTrialDocument);
|
||||
Task<IResponseOutput> DeleteTrialDocument(Guid trialDocumentId, Guid trialId);
|
||||
Task<PageOutput<UnionDocumentWithConfirmInfoView>> GetDocumentConfirmList(DocumentTrialUnionQuery querySystemDocument);
|
||||
|
||||
@@ -14,6 +14,7 @@ using IRaCIS.Core.Application.Service.Inspection.Interface;
|
||||
using IRaCIS.Core.Application.Service.Inspection.DTO;
|
||||
using Nito.AsyncEx;
|
||||
using IRaCIS.Application.Interfaces;
|
||||
using IRaCIS.Core.Domain.Common;
|
||||
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
@@ -138,7 +139,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
TrialId = subvisit.TrialId,
|
||||
SubjectVisitId = subvisit.Id,
|
||||
Identification = "Edit|Visit|Status|Visit-Image Upload|Add Image",
|
||||
JsonDetail = JsonConvert.SerializeObject(subvisit)
|
||||
JsonDetail = subvisit.ToJcJson()
|
||||
});
|
||||
|
||||
await _inspectionService.AddListInspectionRecordAsync(datas);
|
||||
@@ -189,7 +190,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
TrialId = subvisit.TrialId,
|
||||
SubjectVisitId = subvisit.Id,
|
||||
Identification = "Edit|Visit|Status|Visit-Image Upload|Add Image",
|
||||
JsonDetail = JsonConvert.SerializeObject(subvisit)
|
||||
JsonDetail = subvisit.ToJcJson()
|
||||
});
|
||||
|
||||
await _inspectionService.AddListInspectionRecordAsync(datas);
|
||||
|
||||
@@ -22,6 +22,7 @@ using IRaCIS.Core.Infrastructure;
|
||||
using IRaCIS.Core.Application.Service.Inspection.DTO;
|
||||
using Nito.AsyncEx;
|
||||
using IRaCIS.Application.Interfaces;
|
||||
using IRaCIS.Core.Domain.Common;
|
||||
|
||||
namespace IRaCIS.Core.Application.Image.QA
|
||||
{
|
||||
@@ -1051,7 +1052,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
TrialId = subvisit.TrialId,
|
||||
SubjectVisitId = subvisit.Id,
|
||||
Identification = "Edit|Visit|Status|Visit-Image Upload|Add Image",
|
||||
JsonDetail = JsonConvert.SerializeObject(subvisit)
|
||||
JsonDetail = subvisit.ToJcJson()
|
||||
});
|
||||
await _inspectionService.AddListInspectionRecordAsync(datas);
|
||||
return ResponseOutput.Ok();
|
||||
@@ -1363,12 +1364,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
TrialId = x.TrialId,
|
||||
SubjectVisitId = x.Id,
|
||||
Identification = "Edit|Visit|Status|Visit-Image Upload-1",
|
||||
JsonDetail = JsonConvert.SerializeObject(new
|
||||
{
|
||||
SubmitState = "已提交",
|
||||
AuditState="未审核",
|
||||
|
||||
})
|
||||
JsonDetail = x.ToJcJson(),
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1883,7 +1879,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
IsSign = false,
|
||||
Identification = "Edit|Subject|Info|Subject",
|
||||
CreateTime = DateTime.Now.AddSeconds(1),
|
||||
JsonDetail = JsonConvert.SerializeObject(command)
|
||||
JsonDetail = command.ToJcJson()
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using IRaCIS.Core.Application.Service.Inspection.Interface;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using Newtonsoft.Json;
|
||||
using IRaCIS.Core.Domain.Common;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
@@ -34,6 +35,7 @@ namespace IRaCIS.Application.Services
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
public async Task<IResponseOutput<string>> AddOrUpdateSubject([FromBody] SubjectCommand subjectCommand)
|
||||
{
|
||||
var svlist = new List<SubjectVisit>();
|
||||
if (await _repository.AnyAsync<Trial>(t => t.Id == subjectCommand.TrialId && !t.VisitPlanConfirmed))
|
||||
{
|
||||
return ResponseOutput.NotOk("The trial visit plan has not been confirmed yet.Please contact the project manager to confirm the visit plan before adding subject.");
|
||||
@@ -60,7 +62,7 @@ namespace IRaCIS.Application.Services
|
||||
//添加受试者的时候,获取访视计划列表,添加到受试者访视表。
|
||||
var visitPlan = await _repository.Where<VisitStage>(t => t.TrialId == subjectCommand.TrialId).ToListAsync();
|
||||
|
||||
var svlist = _mapper.Map<List<SubjectVisit>>(visitPlan);
|
||||
svlist = _mapper.Map<List<SubjectVisit>>(visitPlan);
|
||||
|
||||
var IsEnrollementQualificationConfirm = await _repository.Where<Trial>(t => t.Id == mapedSubject.TrialId).Select(u => u.IsEnrollementQualificationConfirm).FirstOrDefaultAsync();
|
||||
|
||||
@@ -109,8 +111,14 @@ namespace IRaCIS.Application.Services
|
||||
// })
|
||||
//});
|
||||
|
||||
|
||||
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 mapedSubject.SubjectVisitList)
|
||||
foreach (var item in svlist)
|
||||
{
|
||||
// 添加访视
|
||||
datas.Add(new DataInspection()
|
||||
@@ -125,7 +133,7 @@ namespace IRaCIS.Application.Services
|
||||
IsSign = false,
|
||||
CreateTime = visittime,
|
||||
Identification = "Add|Visit|Info|Visit-Image Upload",
|
||||
JsonDetail = JsonConvert.SerializeObject(item)
|
||||
JsonDetail = item.ToJcJson()
|
||||
});
|
||||
|
||||
// 初始化访视
|
||||
@@ -142,7 +150,7 @@ namespace IRaCIS.Application.Services
|
||||
IsSign = false,
|
||||
CreateTime = visittime.AddSeconds(1),
|
||||
Identification = "Init|Visit|Status|Visit-Image Upload",
|
||||
JsonDetail = JsonConvert.SerializeObject(item)
|
||||
JsonDetail = item.ToJcJson()
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ using IRaCIS.Core.Application.Interfaces;
|
||||
using IRaCIS.Core.Application.Service.Inspection.Interface;
|
||||
using Newtonsoft.Json;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using IRaCIS.Core.Domain.Common;
|
||||
|
||||
namespace IRaCIS.Core.Application.Services
|
||||
{
|
||||
@@ -138,7 +139,7 @@ namespace IRaCIS.Core.Application.Services
|
||||
IsSign = false,
|
||||
Identification = "Edit|Subject|Info|Subject",
|
||||
CreateTime = DateTime.Now.AddSeconds(1),
|
||||
JsonDetail = JsonConvert.SerializeObject(subject)
|
||||
JsonDetail = subject.ToJcJson(),
|
||||
});
|
||||
await _inspectionService.AddListInspectionRecordAsync(datas);
|
||||
}
|
||||
@@ -179,7 +180,7 @@ namespace IRaCIS.Core.Application.Services
|
||||
IsSign = false,
|
||||
CreateTime = DateTime.Now.AddSeconds(1),
|
||||
Identification = "Init|Visit|Status|Visit-Image Upload",
|
||||
JsonDetail = JsonConvert.SerializeObject(svCommand)
|
||||
JsonDetail = svCommand.ToJcJson()
|
||||
});
|
||||
|
||||
await _inspectionService.AddListInspectionRecordAsync(dataInspection);
|
||||
|
||||
@@ -13,6 +13,7 @@ using IRaCIS.Core.Application.Service.Inspection.Interface;
|
||||
using Newtonsoft.Json;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using MassTransit;
|
||||
using IRaCIS.Core.Domain.Common;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
@@ -266,6 +267,7 @@ namespace IRaCIS.Application.Services
|
||||
t.VisitNum,
|
||||
t.IsBaseLine,
|
||||
t.BlindName,
|
||||
|
||||
t.Description,
|
||||
IsConfirmed = true,
|
||||
}).ToListAsync();
|
||||
@@ -283,7 +285,7 @@ namespace IRaCIS.Application.Services
|
||||
//SubjectVisitName = x.VisitName,
|
||||
VisitStageId = x.Id,
|
||||
TrialId = x.TrialId,
|
||||
JsonDetail = JsonConvert.SerializeObject(x),
|
||||
JsonDetail = x.ToJcJson(),
|
||||
Identification = "Confirm|Visit Plan Template|Data|Trial Setting-Visit Plan",
|
||||
|
||||
});
|
||||
@@ -430,7 +432,7 @@ namespace IRaCIS.Application.Services
|
||||
VisitName = changedItem.VisitName,
|
||||
VisitNum = changedItem.VisitNum,
|
||||
VisitDay = changedItem.VisitDay,
|
||||
SubmitState = "未提交",
|
||||
SubmitState = x.SubmitState,
|
||||
VisitWindowLeft = changedItem.VisitWindowLeft,
|
||||
VisitWindowRight = changedItem.VisitWindowRight
|
||||
}),
|
||||
@@ -456,7 +458,8 @@ namespace IRaCIS.Application.Services
|
||||
x.SiteId,
|
||||
x.Id,
|
||||
x.IsEnrollment,
|
||||
x.IsUrgent
|
||||
x.IsUrgent,
|
||||
|
||||
|
||||
});
|
||||
|
||||
@@ -471,8 +474,26 @@ namespace IRaCIS.Application.Services
|
||||
{
|
||||
subjectsids.ForEach(y =>
|
||||
{
|
||||
|
||||
|
||||
|
||||
Guid dataindtid = NewId.NextGuid();
|
||||
Guid guid = NewId.NextGuid();
|
||||
|
||||
SubjectVisit subjectVisit = new SubjectVisit()
|
||||
{
|
||||
SiteId = y.SiteId,
|
||||
SubjectId = y.Id,
|
||||
Id = guid,
|
||||
VisitName = x.VisitName,
|
||||
|
||||
BlindName = x.BlindName,
|
||||
IsBaseLine = x.IsBaseLine,
|
||||
IsCheckBack = x.IsBaseLine,
|
||||
IsUrgent = trial.IsSubjectExpeditedView,
|
||||
};
|
||||
subjectVisits.Add(subjectVisit);
|
||||
|
||||
//
|
||||
datas.Add(new DataInspection()
|
||||
{
|
||||
@@ -492,14 +513,14 @@ namespace IRaCIS.Application.Services
|
||||
VisitName = x.VisitName,
|
||||
VisitNum = x.VisitNum,
|
||||
VisitDay = x.VisitDay,
|
||||
VisitExecuted = false,
|
||||
VisitExecuted = subjectVisit.VisitExecuted,
|
||||
BlindName = x.BlindName,
|
||||
VisitWindowLeft = x.VisitWindowLeft,
|
||||
VisitWindowRight = x.VisitWindowRight,
|
||||
IsEnrollment = y.IsEnrollment,
|
||||
IsUrgent = trial.IsSubjectExpeditedView,
|
||||
IsFinalVisit = false,
|
||||
IsLostVisit = false,
|
||||
IsFinalVisit = subjectVisit.IsFinalVisit,
|
||||
IsLostVisit = subjectVisit.IsLostVisit,
|
||||
PDState = trial.IsPDProgressView,
|
||||
}),
|
||||
});
|
||||
@@ -522,37 +543,23 @@ namespace IRaCIS.Application.Services
|
||||
{
|
||||
BlindName = x.BlindName,
|
||||
VisitName = x.VisitName,
|
||||
SubmitState = "未提交",
|
||||
AuditState = "未审核",
|
||||
SubmitState = subjectVisit.SubmitState,
|
||||
AuditState = subjectVisit.AuditState,
|
||||
IsBaseLine = x.IsBaseLine,
|
||||
IsEnrollment = y.IsEnrollment,
|
||||
IsUrgent = y.IsUrgent,
|
||||
VisitNum = x.VisitNum,
|
||||
VisitDay = x.VisitDay,
|
||||
VisitExecuted = false,
|
||||
VisitExecuted = subjectVisit.VisitExecuted,
|
||||
VisitWindowLeft = x.VisitWindowLeft,
|
||||
VisitWindowRight = x.VisitWindowRight,
|
||||
IsFinalVisit = false,
|
||||
IsLostVisit = false,
|
||||
IsFinalVisit = subjectVisit.IsFinalVisit,
|
||||
IsLostVisit = subjectVisit.IsLostVisit,
|
||||
PDState = trial.IsPDProgressView,
|
||||
}),
|
||||
});
|
||||
|
||||
subjectVisits.Add(new SubjectVisit()
|
||||
{
|
||||
|
||||
SiteId = y.SiteId,
|
||||
SubjectId = y.Id,
|
||||
Id = guid,
|
||||
VisitName = x.VisitName,
|
||||
|
||||
BlindName = x.BlindName,
|
||||
IsBaseLine = x.IsBaseLine,
|
||||
IsCheckBack = x.IsBaseLine,
|
||||
IsUrgent = trial.IsSubjectExpeditedView,
|
||||
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user