增加进入阅片中稽查
parent
9f187e4b36
commit
1a4ca6e36b
|
@ -2523,7 +2523,7 @@
|
||||||
<param name="inDto"></param>
|
<param name="inDto"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.GetModuleTypeDescriptionLiset(System.Guid,System.Guid)">
|
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.getModuleTypeDescriptionList(System.Guid,System.Guid)">
|
||||||
<summary>
|
<summary>
|
||||||
获取Description
|
获取Description
|
||||||
</summary>
|
</summary>
|
||||||
|
|
|
@ -54,7 +54,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <param name="inDto"></param>
|
/// <param name="inDto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
public async Task<IResponseOutput> BatchSubmitGlobalReadingInfo(BatchSubmitGlobalReadingInfo inDto)
|
public async Task<IResponseOutput> BatchSubmitGlobalReadingInfo(BatchSubmitGlobalReadingInfo inDto)
|
||||||
{
|
{
|
||||||
await VerifyTaskIsSign(inDto.GlobalTaskId);
|
await VerifyTaskIsSign(inDto.GlobalTaskId);
|
||||||
|
@ -94,7 +94,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
})).ToList();
|
})).ToList();
|
||||||
|
|
||||||
await _readingGlobalTaskInfoRepository.AddRangeAsync(answers);
|
await _readingGlobalTaskInfoRepository.AddRangeAsync(answers);
|
||||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(t => t.Id == inDto.GlobalTaskId, u => new VisitTask() { ReadingTaskState = ReadingTaskState.Reading });
|
await _visitTaskRepository.UpdatePartialFromEFAutoAsync(inDto.GlobalTaskId, u => new VisitTask() { ReadingTaskState = ReadingTaskState.Reading });
|
||||||
var result = await _readingGlobalTaskInfoRepository.SaveChangesAsync();
|
var result = await _readingGlobalTaskInfoRepository.SaveChangesAsync();
|
||||||
return ResponseOutput.Ok(result);
|
return ResponseOutput.Ok(result);
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <param name="inDto"></param>
|
/// <param name="inDto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
public async Task<IResponseOutput> SaveGlobalReadingInfo(SaveGlobalReadingInfoInDto inDto)
|
public async Task<IResponseOutput> SaveGlobalReadingInfo(SaveGlobalReadingInfoInDto inDto)
|
||||||
{
|
{
|
||||||
await VerifyTaskIsSign(inDto.GlobalTaskId);
|
await VerifyTaskIsSign(inDto.GlobalTaskId);
|
||||||
|
@ -301,7 +301,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
LimitEdit = y.LimitEdit,
|
LimitEdit = y.LimitEdit,
|
||||||
MaxAnswerLength = y.MaxAnswerLength,
|
MaxAnswerLength = y.MaxAnswerLength,
|
||||||
FileType = y.FileType,
|
FileType = y.FileType,
|
||||||
Unit=y.Unit,
|
Unit = y.Unit,
|
||||||
QuestionGenre = y.QuestionGenre,
|
QuestionGenre = y.QuestionGenre,
|
||||||
ShowOrder = y.ShowOrder,
|
ShowOrder = y.ShowOrder,
|
||||||
DictionaryCode = y.DictionaryCode,
|
DictionaryCode = y.DictionaryCode,
|
||||||
|
|
|
@ -3556,26 +3556,27 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
case "ReadingImageTask/SubmitVisitTaskQuestions":
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//访视任务-- 非Dicom 阅片
|
//访视任务-- 非Dicom 阅片
|
||||||
if (_userInfo.RequestUrl == "ReadingImageTask/SubmitVisitTaskQuestions" && entity.ReadingTaskState != ReadingTaskState.HaveSigned && type == AuditOpt.Update)
|
if (entity.ReadingTaskState != ReadingTaskState.HaveSigned)
|
||||||
{
|
{
|
||||||
//提交访视任务的时候 会多次更新同一个记录 只记录最后一次
|
//提交访视任务的时候 会多次更新同一个记录 只记录最后一次
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
//Dicom 阅片 签名
|
//Dicom 阅片 签名
|
||||||
if (_userInfo.RequestUrl == "ReadingImageTask/SubmitDicomVisitTask")
|
case "ReadingImageTask/SubmitDicomVisitTask":
|
||||||
{
|
|
||||||
//跳转阅片结果需要该参数
|
//跳转阅片结果需要该参数
|
||||||
var subjectCode = _dbContext.Subject.Where(t => t.Id == entity.SubjectId).Select(t => t.Code).First();
|
var subjectCode = _dbContext.Subject.Where(t => t.Id == entity.SubjectId).Select(t => t.Code).First();
|
||||||
|
|
||||||
obj.SubjectCode = subjectCode;
|
obj.SubjectCode = subjectCode;
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 裁判、肿瘤学、全局 都是通用的
|
#region 裁判、肿瘤学、全局 都是通用的
|
||||||
|
@ -3596,10 +3597,21 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
obj.SelectResult = r1.Id == entity.JudgeResultTaskId ? "R1" : "R2";
|
obj.SelectResult = r1.Id == entity.JudgeResultTaskId ? "R1" : "R2";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
//增加进入阅片中的稽查
|
||||||
|
|
||||||
|
if (entity.ReadingTaskState == ReadingTaskState.Reading)
|
||||||
|
{
|
||||||
|
if(_dbContext.VisitTask.Where(t => t.Id == entity.Id).Any(t => t.ReadingTaskState== ReadingTaskState.WaitReading))
|
||||||
|
{
|
||||||
|
isDistinctionInterface = false;
|
||||||
|
extraIdentification = "/ChangeToReading";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#region 通过链接跳转 2022 12-19
|
#region 通过链接跳转 2022 12-19
|
||||||
|
|
|
@ -35,15 +35,19 @@ namespace IRaCIS.Core.Infra.EFCore
|
||||||
Task<bool> UpdateAsync(TEntity entity, Expression<Func<TEntity, TEntity>> updateFactory,
|
Task<bool> UpdateAsync(TEntity entity, Expression<Func<TEntity, TEntity>> updateFactory,
|
||||||
bool autoSave = false, CancellationToken cancellationToken = default);
|
bool autoSave = false, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
/// <summary> EF跟踪方式 会去数据库查询完整的实体,再更新部分字段 </summary>
|
/// <summary> EF跟踪方式 会去数据库查询完整的实体,再更新部分字段 一定会产生更新sql </summary>
|
||||||
Task<TEntity> UpdatePartialFromQueryAsync(Guid id, Expression<Func<TEntity, TEntity>> updateFactory,
|
Task<TEntity> UpdatePartialFromQueryAsync(Guid id, Expression<Func<TEntity, TEntity>> updateFactory,
|
||||||
bool autoSave = false, CancellationToken cancellationToken = default);
|
bool autoSave = false, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
/// <summary> 稽查用这个 EF跟踪方式 先查询出来所有实体,再更新部分字段 </summary>
|
/// <summary> 稽查用这个 EF跟踪方式 先查询出来所有实体,再更新部分字段 一定会产生更新sql</summary>
|
||||||
Task UpdatePartialFromQueryAsync(Expression<Func<TEntity, bool>> updateFilter,
|
Task UpdatePartialFromQueryAsync(Expression<Func<TEntity, bool>> updateFilter,
|
||||||
Expression<Func<TEntity, TEntity>> updateFactory,
|
Expression<Func<TEntity, TEntity>> updateFactory,
|
||||||
bool autoSave = false, bool ignoreQueryFilter = false, CancellationToken cancellationToken = default);
|
bool autoSave = false, bool ignoreQueryFilter = false, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
|
/// <summary> EF跟踪方式 会去数据库查询完整的实体,再更新部分字段 根据是否修改了字段ef 自动判断是否生成sql</summary>
|
||||||
|
Task<TEntity> UpdatePartialFromEFAutoAsync(Guid id, Expression<Func<TEntity, TEntity>> updateFactory,
|
||||||
|
bool autoSave = false, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.ChangeTracking;
|
using Microsoft.EntityFrameworkCore.ChangeTracking;
|
||||||
using Microsoft.EntityFrameworkCore.Query;
|
using Microsoft.EntityFrameworkCore.Query;
|
||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Infra.EFCore
|
namespace IRaCIS.Core.Infra.EFCore
|
||||||
{
|
{
|
||||||
|
@ -167,6 +168,36 @@ namespace IRaCIS.Core.Infra.EFCore
|
||||||
return searchEntity;
|
return searchEntity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<TEntity> UpdatePartialFromEFAutoAsync(Guid id, Expression<Func<TEntity, TEntity>> updateFactory,
|
||||||
|
bool autoSave = false, CancellationToken cancellationToken = default)
|
||||||
|
{
|
||||||
|
var searchEntity = await _dbSet.FindAsync(id);
|
||||||
|
|
||||||
|
if (searchEntity == null)
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException(I18n.T("Repository_UpdateError"));
|
||||||
|
}
|
||||||
|
|
||||||
|
var list = ((MemberInitExpression)updateFactory.Body).Bindings.Select(mb => mb.Member.Name)
|
||||||
|
.Select(propName => typeof(TEntity).GetProperty(propName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)).ToList();
|
||||||
|
|
||||||
|
Func<TEntity, TEntity> func = updateFactory.Compile();
|
||||||
|
|
||||||
|
TEntity applyObj = func(searchEntity);
|
||||||
|
|
||||||
|
foreach (PropertyInfo prop in list)
|
||||||
|
{
|
||||||
|
object value = prop.GetValue(applyObj);
|
||||||
|
prop.SetValue(searchEntity, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
await SaveChangesAsync(autoSave);
|
||||||
|
|
||||||
|
return searchEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task UpdatePartialFromQueryAsync(Expression<Func<TEntity, bool>> updateFilter,
|
public async Task UpdatePartialFromQueryAsync(Expression<Func<TEntity, bool>> updateFilter,
|
||||||
Expression<Func<TEntity, TEntity>> updateFactory,
|
Expression<Func<TEntity, TEntity>> updateFactory,
|
||||||
bool autoSave = false, bool ignoreQueryFilter = false, CancellationToken cancellationToken = default)
|
bool autoSave = false, bool ignoreQueryFilter = false, CancellationToken cancellationToken = default)
|
||||||
|
@ -191,6 +222,7 @@ namespace IRaCIS.Core.Infra.EFCore
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>EF跟踪方式 删除</summary>
|
/// <summary>EF跟踪方式 删除</summary>
|
||||||
public async Task<bool> DeleteAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default)
|
public async Task<bool> DeleteAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue