注释废弃代码
parent
d55c9c07c8
commit
6120ea029c
|
@ -1591,7 +1591,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
#endregion
|
||||
|
||||
#region 保存任务问题
|
||||
#region 保存访视任务阅片问题答案
|
||||
/// <summary>
|
||||
/// 保存任务问题
|
||||
/// </summary>
|
||||
|
@ -1613,7 +1613,7 @@ namespace IRaCIS.Application.Services
|
|||
TrialId = inDto.TrialId
|
||||
}).ToList();
|
||||
|
||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.VisitTaskId, x => new VisitTask()
|
||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(inDto.VisitTaskId, x => new VisitTask()
|
||||
{
|
||||
ReadingTaskState = ReadingTaskState.Reading,
|
||||
|
||||
|
@ -1756,7 +1756,7 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
//var result = await this.SaveGlobalReadingInfo(inDto);
|
||||
|
||||
await FinishReadUpdateState(inDto.OncologyTaskId);
|
||||
//await FinishReadUpdateState(inDto.OncologyTaskId);
|
||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => x.Id == inDto.OncologyTaskId, x => new VisitTask()
|
||||
{
|
||||
ReadingTaskState = ReadingTaskState.HaveSigned,
|
||||
|
@ -1789,7 +1789,7 @@ namespace IRaCIS.Application.Services
|
|||
/// <returns></returns>
|
||||
private async Task SubmitTaskChangeState(Guid visitTaskId)
|
||||
{
|
||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => x.Id == visitTaskId, x => new VisitTask()
|
||||
await _visitTaskRepository.UpdatePartialFromQueryAsync( visitTaskId, x => new VisitTask()
|
||||
{
|
||||
ReadingTaskState = ReadingTaskState.HaveSigned,
|
||||
SignTime = DateTime.Now,
|
||||
|
@ -1799,8 +1799,9 @@ namespace IRaCIS.Application.Services
|
|||
await this.TriggerJudgeQuestion(visitTaskId);
|
||||
// 添加阅片期任务
|
||||
await this.AddReadingTask(visitTaskId);
|
||||
|
||||
// 完成阅片修改状态
|
||||
await this.FinishReadUpdateState(visitTaskId);
|
||||
//await this.FinishReadUpdateState(visitTaskId);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -306,10 +306,9 @@ namespace IRaCIS.Core.Application.Services
|
|||
{
|
||||
|
||||
|
||||
var isSuccess = await _trialSiteUserRepository.UpdatePartialFromQueryAsync(id, u => new TrialSiteUser()
|
||||
{ IsDeleted = isDelete, DeletedTime = isDelete ? DateTime.Now : null },true,true);
|
||||
await _trialSiteUserRepository.UpdatePartialFromQueryAsync(t=>t.Id==id, u => new TrialSiteUser(){ IsDeleted = isDelete, DeletedTime = isDelete ? DateTime.Now : null },true,true);
|
||||
|
||||
return ResponseOutput.Ok(isSuccess);
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
|
||||
/// <summary> EF跟踪方式 会去数据库查询完整的实体,再更新部分字段 </summary>
|
||||
Task<TEntity> UpdatePartialFromQueryAsync(Guid id, Expression<Func<TEntity, TEntity>> updateFactory,
|
||||
bool autoSave = false, bool ignoreQueryFilter = false, CancellationToken cancellationToken = default);
|
||||
bool autoSave = false, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary> 稽查用这个 EF跟踪方式 先查询出来所有实体,再更新部分字段 </summary>
|
||||
Task UpdatePartialFromQueryAsync(Expression<Func<TEntity, bool>> updateFilter,
|
||||
|
|
|
@ -197,12 +197,14 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
|
||||
/// <summary>EF跟踪方式 先查询出来,再更新部分字段 稽查的时候需要完整的实体信息</summary>
|
||||
public async Task<TEntity> UpdatePartialFromQueryAsync(Guid id, Expression<Func<TEntity, TEntity>> updateFactory,
|
||||
bool autoSave = false, bool ignoreQueryFilter = false, CancellationToken cancellationToken = default)
|
||||
bool autoSave = false, CancellationToken cancellationToken = default)
|
||||
{
|
||||
|
||||
var query = ignoreQueryFilter ? _dbSet.AsNoTracking().IgnoreQueryFilters() : _dbSet.AsNoTracking();
|
||||
//var query = ignoreQueryFilter ? _dbSet.AsNoTracking().IgnoreQueryFilters() : _dbSet.AsNoTracking();
|
||||
|
||||
|
||||
//不跟踪 查询出来的实体就是Detached
|
||||
var searchEntity = await query.FirstOrDefaultAsync(t => t.Id == id);
|
||||
var searchEntity = await _dbSet.FindAsync( id);
|
||||
|
||||
if (searchEntity == null)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue