Uat_Study
parent
10f2887c2b
commit
a6b39efdf2
|
@ -169,6 +169,10 @@ namespace IRaCIS.Core.Application.Service
|
|||
DictionaryCode = lst.Max(x => x.DictionaryCode),
|
||||
DictionaryType = lst.Max(x => x.DictionaryType),
|
||||
DateType = lst.Select(x => x.DateType).FirstOrDefault(),
|
||||
ForeignKeyValue = lst.Select(x => x.ForeignKeyValue).FirstOrDefault(),
|
||||
ForeignKeyText = lst.Select(x => x.ForeignKeyText).FirstOrDefault(),
|
||||
ForeignKeyTable = lst.Select(x => x.ForeignKeyTable).FirstOrDefault(),
|
||||
DataType = lst.Select(x => x.DataType).FirstOrDefault(),
|
||||
Id =NewId.NextGuid()//新id,
|
||||
}).ToList();
|
||||
|
||||
|
@ -189,10 +193,18 @@ namespace IRaCIS.Core.Application.Service
|
|||
var item = alllist.FirstOrDefault(y => y.ValueCN == x.ValueCN);
|
||||
if (item != null)
|
||||
{
|
||||
x.Code=x.Code.IsNullOrEmpty()?item.Code:x.Code;
|
||||
x.Code=item.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;
|
||||
x.DataType = x.DataType.IsNullOrEmpty() ? item.DataType : x.DataType;
|
||||
x.DateType = x.DateType.IsNullOrEmpty() ? item.DateType : x.DateType;
|
||||
x.DictionaryKey = x.DictionaryKey.IsNullOrEmpty() ? item.DictionaryKey : x.DictionaryKey;
|
||||
x.IsShowParent = x.IsShowParent==null ? item.IsShowParent : x.IsShowParent;
|
||||
x.ForeignKeyTable = x.ForeignKeyTable.IsNullOrEmpty() ? item.ForeignKeyTable : x.ForeignKeyTable;
|
||||
x.ForeignKeyText = x.ForeignKeyText.IsNullOrEmpty() ? item.ForeignKeyText : x.ForeignKeyText;
|
||||
x.ForeignKeyValue = x.ForeignKeyValue.IsNullOrEmpty() ? item.ForeignKeyValue : x.ForeignKeyValue;
|
||||
x.EnumType = x.EnumType.IsNullOrEmpty() ? item.EnumType : x.EnumType;
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
@ -79,7 +79,7 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
|||
from lefttrialSign in trialSigntemp.DefaultIfEmpty()
|
||||
|
||||
|
||||
join leftfrontAuditConfig in _repository.GetQueryable<FrontAuditConfig>().Where(x=>x.ConfigType=="M"&&x.Identification!=null) on
|
||||
join leftfrontAuditConfig in _repository.GetQueryable<FrontAuditConfig>().Where(x=>x.ConfigType=="M"&&x.Identification!=null&&x.IsEnable==true) on
|
||||
data.Identification.ToLower()
|
||||
equals
|
||||
leftfrontAuditConfig.Identification.ToLower()
|
||||
|
|
|
@ -1441,7 +1441,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
dbSubjectVisit.Auditor = _userInfo.Id;
|
||||
dbSubjectVisit.IsTake = false;
|
||||
dbSubjectVisit.CurrentActionUserId = null;
|
||||
dbSubjectVisit.CurrentActionUserExpireTime = null;
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
|
||||
//添加受试者的时候,获取访视计划列表,添加到受试者访视表。
|
||||
var visitPlan = await _repository.Where<VisitStage>(t => t.TrialId == subjectCommand.TrialId).ToListAsync();
|
||||
var visitPlan = await _repository.Where<VisitStage>(t => t.TrialId == subjectCommand.TrialId&&t.IsConfirmed).ToListAsync();
|
||||
|
||||
svlist = _mapper.Map<List<SubjectVisit>>(visitPlan);
|
||||
|
||||
|
|
|
@ -49,6 +49,9 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public Guid UpdateUserId { get; set; }
|
||||
public DateTime UpdateTime { get; set; }
|
||||
|
||||
public Guid? Auditor { get; set; }
|
||||
|
||||
|
||||
//public SubjectVisitStateEnum VisitState { get; set; }
|
||||
|
||||
//核查状态
|
||||
|
|
|
@ -49,8 +49,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
public async Task IncomingEntitys(List<EntityEntry> entitys)
|
||||
{
|
||||
// 修改
|
||||
await InsertAddEntitys(entitys.Where(x => x.State == EntityState.Modified && (!typeof(ISoftDelete).IsAssignableFrom(x.Entity.GetType())
|
||||
|| !(bool)x.Entity.GetType().GetProperty("IsDeleted").GetValue(x.Entity))
|
||||
await InsertAddEntitys(entitys.Where(x => x.State == EntityState.Modified && ((!typeof(ISoftDelete).IsAssignableFrom(x.Entity.GetType())
|
||||
|| !(bool)x.Entity.GetType().GetProperty("IsDeleted").GetValue(x.Entity))||x.Entity.GetType()== typeof(DicomSeries))
|
||||
).ToList(), "Update");
|
||||
|
||||
// 新增
|
||||
|
@ -58,7 +58,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
// 删除
|
||||
await InsertAddEntitys(entitys.Where(x => x.State == EntityState.Deleted
|
||||
||((typeof(ISoftDelete).IsAssignableFrom(x.Entity.GetType())&& (bool)x.Entity.GetType().GetProperty("IsDeleted").GetValue(x.Entity)))
|
||||
||((typeof(ISoftDelete).IsAssignableFrom(x.Entity.GetType())&& x.Entity.GetType() != typeof(DicomSeries) && (bool)x.Entity.GetType().GetProperty("IsDeleted").GetValue(x.Entity)))
|
||||
).ToList(), "Deleted");
|
||||
|
||||
|
||||
|
@ -146,17 +146,18 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(DicomSeries)))
|
||||
{
|
||||
var entity = item.Entity as DicomSeries;
|
||||
if (entity.DicomStudy == null)
|
||||
var dicomStudy = entity.DicomStudy.Clone();
|
||||
if (dicomStudy == null)
|
||||
{
|
||||
entity.DicomStudy = await _dbContext.DicomStudys.AsNoTracking().FirstOrDefaultAsync(x => x.Id == entity.StudyId);
|
||||
dicomStudy = await _dbContext.DicomStudys.AsNoTracking().FirstOrDefaultAsync(x => x.Id == entity.StudyId);
|
||||
}
|
||||
await InsertInspection<DicomSeries>(item, type, x => new DataInspection()
|
||||
{
|
||||
GeneralId = x.Id,
|
||||
}, new
|
||||
{
|
||||
StudyCode = entity.DicomStudy?.StudyCode,
|
||||
Modalities = entity.DicomStudy?.Modalities,
|
||||
StudyCode = dicomStudy?.StudyCode,
|
||||
Modalities = dicomStudy?.Modalities,
|
||||
|
||||
});
|
||||
}
|
||||
|
|
|
@ -701,27 +701,31 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
string Table = item.ForeignKeyTable;
|
||||
string ForeignKeyValue = item.ForeignKeyValue;
|
||||
string ForeignKeyText = item.ForeignKeyText;
|
||||
string value = JsonDataValue[item.Key].ToString();
|
||||
string para = string.Empty;
|
||||
string sql = string.Empty;
|
||||
var JsonData = JsonConvert.DeserializeObject<IDictionary<string, object>>(JsonConvert.SerializeObject(new { item = value }));
|
||||
if (JsonData["item"].GetType() == typeof(JArray))
|
||||
if (JsonDataValue[item.Key] != null)
|
||||
{
|
||||
foreach (var v in JsonData["item"] as JArray)
|
||||
string value = JsonDataValue[item.Key].ToString();
|
||||
string para = string.Empty;
|
||||
string sql = string.Empty;
|
||||
var JsonData = JsonConvert.DeserializeObject<IDictionary<string, object>>(JsonConvert.SerializeObject(new { item = value }));
|
||||
if (JsonData["item"].GetType() == typeof(JArray))
|
||||
{
|
||||
para += para == string.Empty ? $"'{v.ToString()}'" : $",'{v.ToString()}'";
|
||||
foreach (var v in JsonData["item"] as JArray)
|
||||
{
|
||||
para += para == string.Empty ? $"'{v.ToString()}'" : $",'{v.ToString()}'";
|
||||
}
|
||||
sql = $"select {ForeignKeyText} Text from {Table} where {ForeignKeyValue} in (@para)";
|
||||
}
|
||||
sql = $"select {ForeignKeyText} Text from {Table} where {ForeignKeyValue} in (@para)";
|
||||
}
|
||||
else
|
||||
{
|
||||
para = $"{JsonData["item"].ToString()}";
|
||||
sql = $"select {ForeignKeyText} Text from {Table} where {ForeignKeyValue} = @para";
|
||||
}
|
||||
SqlParameter[] paravalue = new SqlParameter[] {
|
||||
else
|
||||
{
|
||||
para = $"{JsonData["item"].ToString()}";
|
||||
sql = $"select {ForeignKeyText} Text from {Table} where {ForeignKeyValue} = @para";
|
||||
}
|
||||
SqlParameter[] paravalue = new SqlParameter[] {
|
||||
new SqlParameter("@para",para)
|
||||
};
|
||||
JsonDataValue[item.Key] = string.Join(",", _dbContext.Database.SqlQuery<ForeignKey>(sql, paravalue).Select(x => x.Text).ToList());
|
||||
JsonDataValue[item.Key] = string.Join(",", _dbContext.Database.SqlQuery<ForeignKey>(sql, paravalue).Select(x => x.Text).ToList());
|
||||
}
|
||||
|
||||
}
|
||||
return JsonConvert.SerializeObject(JsonDataValue);
|
||||
|
||||
|
|
Loading…
Reference in New Issue