Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
212268cfa5
|
@ -364,87 +364,93 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
var isReadingTaskViewInOrder = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == taskinfo.TrialReadingCriterionId).Select(x => x.IsReadingTaskViewInOrder).FirstOrDefaultAsync();
|
var isReadingTaskViewInOrder = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == taskinfo.TrialReadingCriterionId).Select(x => x.IsReadingTaskViewInOrder).FirstOrDefaultAsync();
|
||||||
var baseLineVisitId = await _subjectVisitRepository.Where(x => x.SubjectId == taskinfo.SubjectId && x.IsBaseLine).Select(x => x.Id).FirstOrDefaultAsync();
|
var baseLineVisitId = await _subjectVisitRepository.Where(x => x.SubjectId == taskinfo.SubjectId && x.IsBaseLine).Select(x => x.Id).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
if (!(await _readingTableQuestionAnswerRepository.AnyAsync(x => x.VisitTaskId == visitTaskId)))
|
||||||
var dictionList = await _dictionaryRepository.Where(x => x.Parent.Code == "LiverSegmentation").OrderBy(x => x.ShowOrder).ToListAsync();
|
|
||||||
|
|
||||||
|
|
||||||
var tableQuestion = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId && x.LesionType == LesionType.FatFraction).FirstNotNullAsync();
|
|
||||||
|
|
||||||
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == tableQuestion.Id).ToListAsync();
|
|
||||||
var LastVisitTaskId = await _visitTaskRepository.Where(x => x.ReadingCategory == ReadingCategory.Visit &&
|
|
||||||
x.TrialReadingCriterionId == taskinfo.TrialReadingCriterionId &&
|
|
||||||
x.IsAnalysisCreate == taskinfo.IsAnalysisCreate &&
|
|
||||||
x.DoctorUserId == taskinfo.DoctorUserId &&
|
|
||||||
x.IsSelfAnalysis == taskinfo.IsSelfAnalysis &&
|
|
||||||
x.SubjectId == taskinfo.SubjectId && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.VisitTaskNum < taskinfo.VisitTaskNum && x.TaskState == TaskState.Effect && x.ArmEnum == taskinfo.ArmEnum
|
|
||||||
).OrderByDescending(x => x.VisitTaskNum).Select(x => x.Id).FirstOrDefaultAsync();
|
|
||||||
|
|
||||||
|
|
||||||
List<TableMarkInfo> marks = await _readingTaskQuestionMarkRepository.Where(x => x.VisitTaskId == LastVisitTaskId && x.RowId != null).ProjectTo<TableMarkInfo>(_mapper.ConfigurationProvider).ToListAsync();
|
|
||||||
|
|
||||||
|
|
||||||
marks.ForEach(x => {
|
|
||||||
|
|
||||||
x.VisitTaskId = visitTaskId;
|
|
||||||
});
|
|
||||||
|
|
||||||
List<ReadingTableAnswerRowInfo> rowlist = new List<ReadingTableAnswerRowInfo>();
|
|
||||||
List<ReadingTableQuestionAnswer> tableAnswerList = new List<ReadingTableQuestionAnswer>();
|
|
||||||
|
|
||||||
decimal num = 1;
|
|
||||||
foreach (var item in dictionList)
|
|
||||||
{
|
{
|
||||||
var guid = NewId.NextGuid();
|
|
||||||
|
|
||||||
|
|
||||||
|
var dictionList = await _dictionaryRepository.Where(x => x.Parent.Code == "LiverSegmentation").OrderBy(x => x.ShowOrder).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
|
var tableQuestion = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId && x.LesionType == LesionType.FatFraction).FirstNotNullAsync();
|
||||||
|
|
||||||
|
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == tableQuestion.Id).ToListAsync();
|
||||||
|
var LastVisitTaskId = await _visitTaskRepository.Where(x => x.ReadingCategory == ReadingCategory.Visit &&
|
||||||
|
x.TrialReadingCriterionId == taskinfo.TrialReadingCriterionId &&
|
||||||
|
x.IsAnalysisCreate == taskinfo.IsAnalysisCreate &&
|
||||||
|
x.DoctorUserId == taskinfo.DoctorUserId &&
|
||||||
|
x.IsSelfAnalysis == taskinfo.IsSelfAnalysis &&
|
||||||
|
x.SubjectId == taskinfo.SubjectId && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.VisitTaskNum < taskinfo.VisitTaskNum && x.TaskState == TaskState.Effect && x.ArmEnum == taskinfo.ArmEnum
|
||||||
|
).OrderByDescending(x => x.VisitTaskNum).Select(x => x.Id).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
|
||||||
|
List<TableMarkInfo> marks = await _readingTaskQuestionMarkRepository.Where(x => x.VisitTaskId == LastVisitTaskId && x.RowId != null).ProjectTo<TableMarkInfo>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
marks.ForEach(x => {
|
marks.ForEach(x => {
|
||||||
x.RowId = x.RowIndex == num ? guid : x.RowId;
|
|
||||||
});
|
x.VisitTaskId = visitTaskId;
|
||||||
rowlist.Add(new ReadingTableAnswerRowInfo()
|
|
||||||
{
|
|
||||||
FristAddTaskId= visitTaskId,
|
|
||||||
FristAddTaskNum= taskinfo.VisitTaskNum,
|
|
||||||
IsCurrentTaskAdd=true,
|
|
||||||
BlindName= taskinfo.TaskBlindName,
|
|
||||||
OrderMark= tableQuestion.OrderMark+ num.GetLesionMark(),
|
|
||||||
VisitTaskId= visitTaskId,
|
|
||||||
TrialId= taskinfo.TrialId,
|
|
||||||
QuestionId= tableQuestion.Id,
|
|
||||||
RowIndex= num,
|
|
||||||
Id= guid,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
tableAnswerList.Add(new ReadingTableQuestionAnswer()
|
List<ReadingTableAnswerRowInfo> rowlist = new List<ReadingTableAnswerRowInfo>();
|
||||||
{
|
List<ReadingTableQuestionAnswer> tableAnswerList = new List<ReadingTableQuestionAnswer>();
|
||||||
QuestionId= tableQuestion.Id,
|
|
||||||
Answer= item.Code,
|
|
||||||
TableQuestionId= tableQuestionList.Where(x=>x.QuestionMark==QuestionMark.liverSegmentation).Select(x=>x.Id).FirstOrDefault(),
|
|
||||||
VisitTaskId= visitTaskId,
|
|
||||||
TrialId= taskinfo.TrialId,
|
|
||||||
RowIndex= num,
|
|
||||||
RowId= guid,
|
|
||||||
});
|
|
||||||
|
|
||||||
foreach (var otherQuestion in tableQuestionList.Where(x => !tableAnswerList.Any(y=>y.RowId== guid&&y.TableQuestionId==x.Id)))
|
decimal num = 1;
|
||||||
|
foreach (var item in dictionList)
|
||||||
{
|
{
|
||||||
|
var guid = NewId.NextGuid();
|
||||||
|
marks.ForEach(x => {
|
||||||
|
x.RowId = x.RowIndex == num ? guid : x.RowId;
|
||||||
|
});
|
||||||
|
rowlist.Add(new ReadingTableAnswerRowInfo()
|
||||||
|
{
|
||||||
|
FristAddTaskId = visitTaskId,
|
||||||
|
FristAddTaskNum = taskinfo.VisitTaskNum,
|
||||||
|
IsCurrentTaskAdd = true,
|
||||||
|
BlindName = taskinfo.TaskBlindName,
|
||||||
|
OrderMark = tableQuestion.OrderMark + num.GetLesionMark(),
|
||||||
|
VisitTaskId = visitTaskId,
|
||||||
|
TrialId = taskinfo.TrialId,
|
||||||
|
QuestionId = tableQuestion.Id,
|
||||||
|
RowIndex = num,
|
||||||
|
Id = guid,
|
||||||
|
});
|
||||||
|
|
||||||
tableAnswerList.Add(new ReadingTableQuestionAnswer()
|
tableAnswerList.Add(new ReadingTableQuestionAnswer()
|
||||||
{
|
{
|
||||||
Answer = otherQuestion.DefaultValue,
|
|
||||||
QuestionId = tableQuestion.Id,
|
QuestionId = tableQuestion.Id,
|
||||||
|
Answer = item.Code,
|
||||||
|
TableQuestionId = tableQuestionList.Where(x => x.QuestionMark == QuestionMark.liverSegmentation).Select(x => x.Id).FirstOrDefault(),
|
||||||
|
VisitTaskId = visitTaskId,
|
||||||
TrialId = taskinfo.TrialId,
|
TrialId = taskinfo.TrialId,
|
||||||
VisitTaskId = taskinfo.Id,
|
|
||||||
RowId = guid,
|
|
||||||
RowIndex = num,
|
RowIndex = num,
|
||||||
TableQuestionId = otherQuestion.Id,
|
RowId = guid,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
foreach (var otherQuestion in tableQuestionList.Where(x => !tableAnswerList.Any(y => y.RowId == guid && y.TableQuestionId == x.Id)))
|
||||||
|
{
|
||||||
|
tableAnswerList.Add(new ReadingTableQuestionAnswer()
|
||||||
|
{
|
||||||
|
Answer = otherQuestion.DefaultValue,
|
||||||
|
QuestionId = tableQuestion.Id,
|
||||||
|
TrialId = taskinfo.TrialId,
|
||||||
|
VisitTaskId = taskinfo.Id,
|
||||||
|
RowId = guid,
|
||||||
|
RowIndex = num,
|
||||||
|
TableQuestionId = otherQuestion.Id,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
num++;
|
||||||
}
|
}
|
||||||
|
await _readingTableAnswerRowInfoRepository.AddRangeAsync(rowlist);
|
||||||
|
await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswerList);
|
||||||
|
|
||||||
|
await _readingTaskQuestionMarkRepository.AddRangeAsync(_mapper.Map<List<ReadingTaskQuestionMark>>(marks));
|
||||||
num++;
|
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
await _readingTableAnswerRowInfoRepository.AddRangeAsync(rowlist);
|
|
||||||
await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswerList);
|
|
||||||
|
|
||||||
await _readingTaskQuestionMarkRepository.AddRangeAsync(_mapper.Map<List<ReadingTaskQuestionMark>>(marks));
|
|
||||||
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
|
||||||
|
|
||||||
return new AddTaskLesionAnswerFromLastTaskOutDto()
|
return new AddTaskLesionAnswerFromLastTaskOutDto()
|
||||||
{
|
{
|
||||||
|
|
|
@ -62,6 +62,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
return new List<Type>()
|
return new List<Type>()
|
||||||
{
|
{
|
||||||
typeof(TrialUserRole),
|
typeof(TrialUserRole),
|
||||||
|
typeof(TrialIdentityUser),
|
||||||
typeof(TrialSiteSurvey),
|
typeof(TrialSiteSurvey),
|
||||||
typeof(TrialSiteUserRole),
|
typeof(TrialSiteUserRole),
|
||||||
typeof(VisitStage),
|
typeof(VisitStage),
|
||||||
|
@ -1728,6 +1729,54 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(UserRole)))
|
||||||
|
{
|
||||||
|
var type = GetEntityAuditOpt(item);
|
||||||
|
|
||||||
|
var entity = item.Entity as UserRole;
|
||||||
|
//var user = await _dbContext.Users.Include(x => x.UserTypeRole).FirstOrDefaultAsync(x => x.Id == entity.UserId);
|
||||||
|
await InsertInspection<UserRole>(entity, type, x => new InspectionConvertDTO
|
||||||
|
{
|
||||||
|
IsDistinctionInterface = type == AuditOpt.Update ? true : false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 项目参与人员
|
||||||
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialIdentityUser)))
|
||||||
|
{
|
||||||
|
var type = GetEntityAuditOpt(item);
|
||||||
|
var entity = item.Entity as TrialIdentityUser;
|
||||||
|
string extraIndentification = string.Empty;
|
||||||
|
|
||||||
|
var identityUser = await _dbContext.IdentityUser.AsNoTracking().Where(x => x.Id == entity.IdentityUserId).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
//if (type == AuditOpt.Update)
|
||||||
|
//{
|
||||||
|
// extraIndentification = "/" + entity.IsDeleted.ToString();
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
//var user = await _dbContext.Users.Include(x => x.UserTypeRole).FirstOrDefaultAsync(x => x.Id == entity.UserId);
|
||||||
|
await InsertInspection<TrialIdentityUser>(entity, type, x => new InspectionConvertDTO
|
||||||
|
{
|
||||||
|
//IsDistinctionInterface = true ,
|
||||||
|
TrialId = x.TrialId,
|
||||||
|
ObjectRelationParentId = x.TrialId,
|
||||||
|
ExtraIndentification = extraIndentification,
|
||||||
|
//ObjectRelationParentId2 = x.IdentityUserId,
|
||||||
|
},new {
|
||||||
|
|
||||||
|
identityUser.FullName,
|
||||||
|
identityUser.EMail,
|
||||||
|
identityUser.Code,
|
||||||
|
identityUser.UserCode,
|
||||||
|
identityUser.UserName,
|
||||||
|
identityUser.DepartmentName,
|
||||||
|
identityUser.Phone,
|
||||||
|
identityUser.OrganizationName,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// 项目人员
|
// 项目人员
|
||||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialUserRole)))
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialUserRole)))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue