代码修改
parent
b6149c4d32
commit
587c12f331
|
@ -180,6 +180,25 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
inDto.FristAddTaskId = await _readingTaskQuestionMarkRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.TableQuestionId == inDto.TableQuestionId && x.RowId == inDto.RowId).Select(x => x.FristAddTaskId).FirstOrDefaultAsync();
|
||||
inDto.FristAddTaskId = inDto.FristAddTaskId == null ? inDto.VisitTaskId : inDto.FristAddTaskId;
|
||||
|
||||
if (param == "-10")
|
||||
{
|
||||
var existingMark = await _readingTaskQuestionMarkRepository.AnyAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.MeasureData != string.Empty && x.RowId == inDto.RowId && x.TableQuestionId == inDto.TableQuestionId);
|
||||
|
||||
if (!existingMark && inDto.MeasureData!=string.Empty)
|
||||
{
|
||||
_userInfo.AuditIdentification = "AddMark";
|
||||
}
|
||||
else if (existingMark&& inDto.MeasureData != string.Empty)
|
||||
{
|
||||
_userInfo.AuditIdentification = "UpdateMark";
|
||||
}
|
||||
else
|
||||
{
|
||||
_userInfo.AuditIdentification = "DeleteMark";
|
||||
}
|
||||
}
|
||||
|
||||
var visitTaskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
|
||||
await _readingTableQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == inDto.QuestionId && x.RowId == inDto.RowId.Value && x.TableQuestionId == inDto.TableQuestionId);
|
||||
await _readingTableQuestionAnswerRepository.AddAsync(new ReadingTableQuestionAnswer()
|
||||
|
@ -1902,11 +1921,13 @@ namespace IRaCIS.Core.Application.Service
|
|||
if (param == "-10")
|
||||
{
|
||||
var questionMarkList = inDto.QuestionMarkInfoList.Select(x => x.QuestionId).ToList();
|
||||
if (!(await _readingTaskQuestionMarkRepository.AnyAsync(x => x.VisitTaskId == inDto.VisitTaskId&&x.MeasureData!=string.Empty && questionMarkList.Contains(x.QuestionId))) && inDto.QuestionMarkInfoList.Count(x=>x.MeasureData.IsNotNullOrEmpty()) > 0)
|
||||
|
||||
var existsMark = await _readingTaskQuestionMarkRepository.AnyAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.MeasureData != string.Empty && questionMarkList.Contains(x.QuestionId));
|
||||
if (!existsMark && inDto.QuestionMarkInfoList.Count(x=>x.MeasureData.IsNotNullOrEmpty()) > 0)
|
||||
{
|
||||
_userInfo.AuditIdentification = "AddMark";
|
||||
}
|
||||
else if (await _readingTaskQuestionMarkRepository.AnyAsync(x => x.VisitTaskId == inDto.VisitTaskId &&x.MeasureData != string.Empty && questionMarkList.Contains(x.QuestionId)) && inDto.QuestionMarkInfoList.Count(x => x.MeasureData.IsNotNullOrEmpty()) > 0)
|
||||
else if (existsMark && inDto.QuestionMarkInfoList.Count(x => x.MeasureData.IsNotNullOrEmpty()) > 0)
|
||||
{
|
||||
_userInfo.AuditIdentification = "UpdateMark";
|
||||
}
|
||||
|
|
|
@ -3138,16 +3138,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
var mark = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTaskQuestionMark)).Select(x=>x.Entity as ReadingTaskQuestionMark).FirstOrDefault();
|
||||
|
||||
var markName= string.Empty;
|
||||
if (mark != null && mark.MeasureData.IsNotNullOrEmpty())
|
||||
if (mark != null)
|
||||
{
|
||||
// 解析 JSON 字符串
|
||||
JObject jsonObject = JObject.Parse(mark.MeasureData);
|
||||
|
||||
// 提取 label 的值
|
||||
markName = jsonObject["data"]["label"].ToString();
|
||||
markName=mark.OrderMarkName;
|
||||
}
|
||||
|
||||
|
||||
await InsertInspection<ReadingTaskQuestionAnswer>(cloneEntity, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
VisitTaskId = x.VisitTaskId,
|
||||
|
@ -3194,8 +3189,18 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
var entity = item.Entity as ReadingTaskQuestionMark;
|
||||
|
||||
var answer = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTableQuestionAnswer)).Select(x => x.Entity as ReadingTableQuestionAnswer)
|
||||
.Where(x => x.RowId == entity.RowId && x.TableQuestionId == entity.TableQuestionId).Select(x => x.Answer).FirstOrDefault();
|
||||
var tableQuestionAnswer = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTableQuestionAnswer)).Select(x => x.Entity as ReadingTableQuestionAnswer)
|
||||
.Where(x => x.RowId == entity.RowId && x.TableQuestionId == entity.TableQuestionId).FirstOrDefault();
|
||||
var answer=string.Empty;
|
||||
var questionName=string.Empty;
|
||||
if (tableQuestionAnswer != null)
|
||||
{
|
||||
answer = tableQuestionAnswer.Answer;
|
||||
|
||||
|
||||
}
|
||||
|
||||
questionName = await _dbContext.ReadingTableQuestionTrial.Where(x => x.Id == entity.TableQuestionId).Select(x => _userInfo.IsEn_Us? x.QuestionEnName:x.QuestionName).FirstOrDefaultAsync();
|
||||
|
||||
var liverSegmentation = await _dbContext.ReadingTableQuestionAnswer.Where(x => x.RowId == entity.RowId && x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.liverSegmentation).Select(x => x.Answer).FirstOrDefaultAsync();
|
||||
|
||||
|
@ -3207,6 +3212,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
}, new
|
||||
{
|
||||
|
||||
QuestionName = questionName,
|
||||
Answer = answer,
|
||||
LiverSegmentation = liverSegmentation,
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue