修改一版
parent
667cedbded
commit
00e915c26d
|
@ -24,12 +24,18 @@ namespace IRaCIS.Core.Application.Services
|
|||
|
||||
|
||||
private readonly IRepository<TrialDocument> _trialDocumentRepository;
|
||||
private readonly IRepository<TrialDocUserTypeConfirmedUser> _trialDocUserTypeConfirmedUserRepository;
|
||||
private readonly IRepository<SystemDocConfirmedUser> _systemDocConfirmedUserRepository;
|
||||
private readonly IRepository<SystemDocument> _systemDocumentRepository;
|
||||
|
||||
public TrialDocumentService(IRepository<TrialDocument> trialDocumentRepository
|
||||
public TrialDocumentService(IRepository<TrialDocument> trialDocumentRepository,
|
||||
IRepository<TrialDocUserTypeConfirmedUser> trialDocUserTypeConfirmedUserRepository,
|
||||
IRepository<SystemDocConfirmedUser> systemDocConfirmedUserRepository
|
||||
, IRepository<SystemDocument> systemDocumentRepository)
|
||||
{
|
||||
_trialDocumentRepository = trialDocumentRepository;
|
||||
this._trialDocUserTypeConfirmedUserRepository = trialDocUserTypeConfirmedUserRepository;
|
||||
this._systemDocConfirmedUserRepository = systemDocConfirmedUserRepository;
|
||||
_systemDocumentRepository = systemDocumentRepository;
|
||||
}
|
||||
|
||||
|
@ -408,7 +414,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
}
|
||||
|
||||
//entity.Id = NewId.NextGuid();
|
||||
await _repository.AddAsync(entity, true);
|
||||
await _trialDocumentRepository.AddAsync(entity, true);
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
}
|
||||
else
|
||||
|
@ -540,7 +546,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
return ResponseOutput.NotOk("文件已删除或者废除,签署失败!");
|
||||
}
|
||||
|
||||
await _repository.AddAsync(new SystemDocConfirmedUser() { ConfirmTime = DateTime.Now, ConfirmUserId = _userInfo.Id, SystemDocumentId = userConfirmCommand.DocumentId });
|
||||
await _systemDocConfirmedUserRepository.AddAsync(new SystemDocConfirmedUser() { ConfirmTime = DateTime.Now, ConfirmUserId = _userInfo.Id, SystemDocumentId = userConfirmCommand.DocumentId },true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -554,7 +560,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
return ResponseOutput.NotOk("文件已删除或者废除,签署失败!");
|
||||
}
|
||||
|
||||
await _repository.AddAsync(new TrialDocUserTypeConfirmedUser() { ConfirmTime = DateTime.Now, ConfirmUserId = _userInfo.Id, TrialDocumentId = userConfirmCommand.DocumentId });
|
||||
await _trialDocUserTypeConfirmedUserRepository.AddAsync(new TrialDocUserTypeConfirmedUser() { ConfirmTime = DateTime.Now, ConfirmUserId = _userInfo.Id, TrialDocumentId = userConfirmCommand.DocumentId },true);
|
||||
}
|
||||
|
||||
await _repository.SaveChangesAsync();
|
||||
|
@ -574,11 +580,11 @@ namespace IRaCIS.Core.Application.Services
|
|||
{
|
||||
if (isSystemDoc)
|
||||
{
|
||||
await _systemDocumentRepository.UpdatePartialFromQueryAsync(documentId, u => new SystemDocument() { IsDeleted = true });
|
||||
await _systemDocumentRepository.UpdatePartialFromQueryAsync(documentId, u => new SystemDocument() { IsDeleted = true },true);
|
||||
}
|
||||
else
|
||||
{
|
||||
await _trialDocumentRepository.UpdatePartialFromQueryAsync(documentId, u => new TrialDocument() { IsDeleted = true });
|
||||
await _trialDocumentRepository.UpdatePartialFromQueryAsync(documentId, u => new TrialDocument() { IsDeleted = true }, true);
|
||||
}
|
||||
|
||||
await _systemDocumentRepository.SaveChangesAsync();
|
||||
|
|
|
@ -15,13 +15,16 @@ namespace IRaCIS.Core.Application
|
|||
public class TrialConfigService : BaseService, ITrialConfigService
|
||||
{
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
private readonly IRepository<TrialQCQuestion> _trialQCQuestionRepository;
|
||||
private readonly IEasyCachingProvider _provider;
|
||||
|
||||
public TrialConfigService(IRepository<Trial> trialRepository,
|
||||
IRepository<TrialQCQuestion> trialQCQuestionRepository,
|
||||
IEasyCachingProvider provider
|
||||
)
|
||||
{
|
||||
_trialRepository = trialRepository;
|
||||
this._trialQCQuestionRepository = trialQCQuestionRepository;
|
||||
this._provider = provider;
|
||||
}
|
||||
|
||||
|
@ -161,7 +164,12 @@ namespace IRaCIS.Core.Application
|
|||
throw new BusinessValidationFailedException("QC审核问题已被其他QC确认,不允许再次确认");
|
||||
}
|
||||
|
||||
await _trialRepository.UpdatePartialFromQueryAsync(t => t.Id == signConfirmDTO.TrialId, u => new Trial() { QCQuestionConfirmedTime = DateTime.Now, QCQuestionConfirmedUserId = _userInfo.Id, IsQCQuestionConfirmed = true },true);
|
||||
await _trialQCQuestionRepository.UpdatePartialFromQueryAsync(t => t.TrialId == signConfirmDTO.TrialId, x => new TrialQCQuestion
|
||||
{
|
||||
IsConfirm = true
|
||||
});
|
||||
await _trialRepository.UpdatePartialFromQueryAsync(t => t.Id == signConfirmDTO.TrialId, u => new Trial() { QCQuestionConfirmedTime = DateTime.Now, QCQuestionConfirmedUserId = _userInfo.Id, IsQCQuestionConfirmed = true });
|
||||
await _trialRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -94,6 +94,13 @@ namespace IRaCIS.Core.Domain.Models
|
|||
[Required]
|
||||
public Guid UpdateUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否确认
|
||||
/// </summary>
|
||||
public bool? IsConfirm { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
public List<TrialQCQuestionAnswer> TrialQCQuestionAnswerList { get; set; }
|
||||
|
||||
|
|
|
@ -177,7 +177,26 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
// 项目文档
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialDocument)))
|
||||
{
|
||||
await InsertInspection<TrialDocument>(item, type);
|
||||
|
||||
var entity = item.Entity as TrialDocument;
|
||||
var userTypes = entity.NeedConfirmedUserTypeList;
|
||||
if (userTypes == null)
|
||||
{
|
||||
userTypes = await _dbContext.TrialDocNeedConfirmedUserType.Where(x => x.TrialDocumentId == entity.Id).ToListAsync();
|
||||
}
|
||||
|
||||
var userTypeIds = userTypes.Select(x => x.NeedConfirmUserTypeId).ToList();
|
||||
var usertypeNames = await _dbContext.UserType.Where(x => userTypeIds.Contains(x.Id)).Select(x => x.UserTypeShortName).ToListAsync();
|
||||
var usertypeName = string.Join(",", usertypeNames);
|
||||
await InsertInspection<TrialDocument>(item, type, x => new DataInspection()
|
||||
{
|
||||
GeneralId = x.Id
|
||||
}, new
|
||||
{
|
||||
NeedConfirmedUserType = usertypeName,
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
// 项目中心
|
||||
|
@ -224,7 +243,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
// 项目中心人员
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialSiteUser)))
|
||||
{
|
||||
|
@ -270,8 +288,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 中心调研表
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialSiteSurvey)))
|
||||
{
|
||||
|
@ -310,9 +326,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
// 项目问题
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialQCQuestion)))
|
||||
{
|
||||
|
||||
var entity = item.Entity as TrialQCQuestion;
|
||||
var isQCQuestionConfirmed = await _dbContext.Trial.Where(x => x.Id == entity.TrialId).Select(x => x.IsQCQuestionConfirmed).FirstOrDefaultAsync();
|
||||
var paretName = await _dbContext.TrialQCQuestionConfigure.Where(x => x.Id == entity.ParentId).Select(x => x.QuestionName).FirstOrDefaultAsync();
|
||||
await InsertInspection<TrialQCQuestion>(item, type, x => new DataInspection()
|
||||
{
|
||||
|
@ -326,7 +340,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
ParentName= paretName,
|
||||
ParentTriggerValue=entity.ParentTriggerValue,
|
||||
IsEnable=entity.IsEnable,
|
||||
IsQCQuestionConfirmed= isQCQuestionConfirmed,
|
||||
IsQCQuestionConfirmed= entity.IsConfirm,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -346,8 +360,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 检查
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(DicomStudy)))
|
||||
{
|
||||
|
@ -357,7 +369,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
// 序列
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(DicomSeries)))
|
||||
{
|
||||
|
@ -508,7 +519,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
// 既往手术史
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(PreviousSurgery)))
|
||||
{
|
||||
|
@ -529,7 +539,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
// 既往放疗史
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(PreviousHistory)))
|
||||
{
|
||||
|
@ -597,7 +606,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
// 质疑信息
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(QCChallengeDialog)))
|
||||
{
|
||||
|
@ -676,7 +684,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
// Qc 问题答案
|
||||
if (entitys.Any(x => x.Entity.GetType() == typeof(TrialQCQuestionAnswer)))
|
||||
{
|
||||
|
@ -737,6 +744,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
}
|
||||
|
||||
#region 备注
|
||||
////Qc 问题答案
|
||||
//foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialQCQuestionAnswer)))
|
||||
//{
|
||||
|
@ -754,6 +762,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
//}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -293,6 +293,8 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
public virtual DbSet<SystemDocConfirmedUser> SystemDocConfirmedUser { get; set; }
|
||||
public virtual DbSet<SystemDocNeedConfirmedUserType> SystemDocNeedConfirmedUserType { get; set; }
|
||||
|
||||
public virtual DbSet<TrialDocNeedConfirmedUserType> TrialDocNeedConfirmedUserType { get; set; }
|
||||
|
||||
public virtual DbSet<TrialDocUserTypeConfirmedUser> TrialDocUserTypeConfirmUser { get; set; }
|
||||
#endregion
|
||||
|
||||
|
|
Loading…
Reference in New Issue