Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
07b496eb67
|
@ -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>
|
||||||
|
|
|
@ -602,6 +602,9 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
? $"{TotalImageSize.Value / 1024d / 1024d:F3} MB"
|
? $"{TotalImageSize.Value / 1024d / 1024d:F3} MB"
|
||||||
: "0.000 MB";
|
: "0.000 MB";
|
||||||
|
|
||||||
|
public bool IsHaveDicom { get; set; }
|
||||||
|
|
||||||
|
public bool IsHaveNoneDicom { get; set; }
|
||||||
|
|
||||||
#region 废弃,为了字段排序
|
#region 废弃,为了字段排序
|
||||||
//public int TotalStudyCount => DicomStudyCount + NoneDicomStudyCount;
|
//public int TotalStudyCount => DicomStudyCount + NoneDicomStudyCount;
|
||||||
|
|
|
@ -1179,6 +1179,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
.Select(t => new TrialVisitImageStatView()
|
.Select(t => new TrialVisitImageStatView()
|
||||||
{
|
{
|
||||||
TrialId = t.TrialId,
|
TrialId = t.TrialId,
|
||||||
|
SubjectVisitId = t.Id,
|
||||||
SubjectCode = t.Subject.Code,
|
SubjectCode = t.Subject.Code,
|
||||||
TrialSiteCode = t.TrialSite.TrialSiteCode,
|
TrialSiteCode = t.TrialSite.TrialSiteCode,
|
||||||
TrialSiteId = t.TrialSiteId,
|
TrialSiteId = t.TrialSiteId,
|
||||||
|
@ -1187,6 +1188,10 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
EarliestScanDate = t.EarliestScanDate,
|
EarliestScanDate = t.EarliestScanDate,
|
||||||
LatestScanDate = t.LatestScanDate,
|
LatestScanDate = t.LatestScanDate,
|
||||||
|
|
||||||
|
IsHaveDicom = t.StudyList.Any(),
|
||||||
|
|
||||||
|
IsHaveNoneDicom = t.NoneDicomStudyList.Any(),
|
||||||
|
|
||||||
|
|
||||||
TotalStudyCount = t.StudyList.Count() + t.NoneDicomStudyList.Count(),
|
TotalStudyCount = t.StudyList.Count() + t.NoneDicomStudyList.Count(),
|
||||||
|
|
||||||
|
@ -1206,7 +1211,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
var pagelist = await query.ToPagedListAsync(inQuery);
|
var pagelist = await query.Where(t => t.TotalImageCount > 0).ToPagedListAsync(inQuery);
|
||||||
|
|
||||||
return ResponseOutput.Ok(pagelist);
|
return ResponseOutput.Ok(pagelist);
|
||||||
}
|
}
|
||||||
|
@ -1225,8 +1230,9 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
{
|
{
|
||||||
SubjectId = g.Key,
|
SubjectId = g.Key,
|
||||||
VisitCount = g.Count(),
|
VisitCount = g.Count(),
|
||||||
ImageSize = g.Sum(t => t.NoneDicomStudyList.SelectMany(t => t.NoneDicomFileList).Sum(t => t.FileSize)
|
ImageSize = g.SelectMany(t => t.NoneDicomStudyList).SelectMany(t => t.NoneDicomFileList).Sum(t => t.FileSize)
|
||||||
+ g.Sum(t => t.StudyList.SelectMany(t => t.InstanceList).Sum(t => t.FileSize)))
|
|
||||||
|
+ g.SelectMany(t => t.StudyList).SelectMany(t => t.InstanceList).Sum(t => t.FileSize)
|
||||||
})
|
})
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
|
@ -1263,15 +1269,17 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
SubjectCode = t.Subject.Code,
|
SubjectCode = t.Subject.Code,
|
||||||
VisitName = (string?)t.SourceSubjectVisit.VisitName,
|
VisitName = (string?)t.SourceSubjectVisit.VisitName,
|
||||||
|
|
||||||
QuestionMarkPictureList = t.ReadingTaskQuestionMarkList.SelectMany(c => new List<string>() { c.PicturePath, c.OtherPicturePath }).ToList(),
|
ArmEnum= t.ArmEnum,
|
||||||
|
|
||||||
TableQuestionRowPictureList = t.LesionList.SelectMany(c => new List<string>() { c.PicturePath, c.OtherPicturePath }).ToList(),
|
QuestionMarkPictureList = t.ReadingTaskQuestionMarkList.Select(c => new { c.PicturePath, c.OtherPicturePath }).ToList(),
|
||||||
|
|
||||||
|
TableQuestionRowPictureList = t.LesionList.Select(c => new { c.PicturePath, c.OtherPicturePath }).ToList(),
|
||||||
|
|
||||||
|
|
||||||
IsJudgeSelect = t.JudgeResultTaskId == t.Id
|
IsJudgeSelect = t.JudgeResultTaskId == t.Id
|
||||||
|
|
||||||
|
|
||||||
}).FirstOrDefault();
|
}).ToList();
|
||||||
|
|
||||||
return ResponseOutput.Ok(downloadInfo);
|
return ResponseOutput.Ok(downloadInfo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -346,7 +346,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
var relatedVisitTaskIds = JsonConvert.SerializeObject(relatedVisitTaskIdList);
|
var relatedVisitTaskIds = JsonConvert.SerializeObject(relatedVisitTaskIdList);
|
||||||
|
|
||||||
// 这里先保存 签名的时候 会统一创建关系
|
// 这里先保存 签名的时候 会统一创建关系
|
||||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(t => t.Id == inDto.OncologyTaskId, u => new VisitTask()
|
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.Id == inDto.OncologyTaskId, u => new VisitTask()
|
||||||
{
|
{
|
||||||
RelatedVisitTaskIds = relatedVisitTaskIds
|
RelatedVisitTaskIds = relatedVisitTaskIds
|
||||||
});
|
});
|
||||||
|
|
|
@ -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