Uat_Study
hang 2022-07-21 14:40:37 +08:00
parent cdd30a9978
commit 319af50009
8 changed files with 210 additions and 52 deletions

View File

@ -7,6 +7,7 @@ using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Application.Image.QA;
using IRaCIS.Core.Application.Interfaces;
using IRaCIS.Core.Application.Service;
using IRaCIS.Core.Application.Service.Inspection.DTO;
using IRaCIS.Core.Application.Service.Inspection.Interface;
using IRaCIS.Core.Application.Service.Reading.Dto;
@ -383,5 +384,20 @@ namespace IRaCIS.Core.API.Controllers
}
/// <summary>
/// 重阅同意
/// </summary>
/// <returns></returns>
[HttpPost, Route("Inspection/VisitTask/ConfirmReReading")]
[UnitOfWork]
public async Task<IResponseOutput> ConfirmReReading(DataInspectionDto<ConfirmReReadingCommand> opt , [FromServices] IVisitTaskHelpeService _visitTaskCommonService,[FromServices] IVisitTaskService _visitTaskService)
{
var singId = await _inspectionService.RecordSing(opt.SignInfo);
var result = await _visitTaskService.ConfirmReReading(opt.Data, _visitTaskCommonService);
await _inspectionService.CompletedSign(singId, result);
return result;
}
}
}

View File

@ -194,6 +194,12 @@
</summary>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.ConfirmReReading(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.ViewModel.ConfirmReReadingCommand},IRaCIS.Core.Application.Service.IVisitTaskHelpeService,IRaCIS.Core.Application.Service.IVisitTaskService)">
<summary>
重阅同意
</summary>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.API.Controllers.UploadBaseController.SingleFileUploadAsync(System.Func{System.String,System.ValueTuple{System.String,System.String}})">
<summary> 流式上传 直接返回</summary>
</member>

View File

@ -6,11 +6,14 @@
using IRaCIS.Core.Application.ViewModel;
using Microsoft.AspNetCore.Mvc;
namespace IRaCIS.Core.Application.Service
{
public interface IVisitTaskService
{
Task<IResponseOutput> ApplyReReading(ApplyReReadingCommand applyReReadingCommand);
Task<IResponseOutput> ConfirmReReading(ConfirmReReadingCommand agreeReReadingCommand, [FromServices] IVisitTaskHelpeService _visitTaskCommonService);
}
}

View File

@ -1227,6 +1227,19 @@ namespace IRaCIS.Core.Application.Service.Allocation
foreach (var influenceTask in influenceTaskList)
{
//处理申请的任务
if (influenceTask.Id == origenalTask.Id)
{
ReReadingTaskTrackingDeal(influenceTask, agreeReReadingCommand);
influenceTaskList.ForEach(t =>
{
//记录实际影像的任务
influenceTask.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = t.Id });
});
}
//申请的访视 要不是重阅重置,要不就是失效 不会存在取消分配
if (influenceTask.ReadingCategory == ReadingCategory.Visit && influenceTask.VisitTaskNum != origenalTask.VisitTaskNum)
{
@ -1246,6 +1259,93 @@ namespace IRaCIS.Core.Application.Service.Allocation
influenceTask.TaskAllocationState = TaskAllocationState.NotAllocate;
}
}
//另外一个人当前访视
else
{
if (influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned)
{
influenceTask.TaskState = TaskState.HaveReturned;
}
else
{
influenceTask.TaskState = TaskState.Adbandon;
}
}
}
#endregion
}
//无序阅片 没有 全局 肿瘤学
else
{
#region old
////阅片任务产生了裁判
//if (origenalTask.JudgeVisitTaskId != null)
//{
// //裁判任务是否已阅片完成
// var judgeTask = await _visitTaskRepository.FirstOrDefaultAsync(t => t.Id == origenalTask.JudgeVisitTaskId);
// if (judgeTask.ReadingTaskState == ReadingTaskState.HaveSigned)
// {
// judgeTask.TaskState = TaskState.HaveReturned;
// }
// //裁判任务未完
// else
// {
// judgeTask.TaskState = TaskState.Adbandon;
// }
//}
////不管是否触发裁判 阅片任务退回,待影像重传后重新分 配给原阅片人
//if (trialConfig.ReadingType == ReadingMethod.Double)
//{
// //考虑该访视 另外一个阅片人的任务也同时退回
// var otherTask = await _visitTaskRepository.FirstOrDefaultAsync(t => t.SourceSubjectVisitId == origenalTask.SourceSubjectVisitId && t.Id != origenalTask.Id && t.TaskState == TaskState.Effect);
// if (otherTask.ReadingTaskState == ReadingTaskState.HaveSigned)
// {
// otherTask.TaskState = TaskState.HaveReturned;
// }
// else
// {
// otherTask.TaskState = TaskState.Adbandon;
// }
//}
#endregion
// 1.当前任务及裁判任务
// 2.影响所有阅片人的任务
var judegTaskNum = origenalTask.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Judge];
filterExpression = filterExpression.And(t => t.VisitTaskNum == origenalTask.VisitTaskNum || t.VisitTaskNum == judegTaskNum);
var influenceTaskList = await _visitTaskRepository.Where(filterExpression, true).ToListAsync();
foreach (var influenceTask in influenceTaskList)
{
//处理申请的任务
if (influenceTask.Id == origenalTask.Id)
{
ReReadingTaskTrackingDeal(influenceTask, agreeReReadingCommand);
influenceTaskList.ForEach(t =>
{
//记录实际影像的任务
influenceTask.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = t.Id });
});
}
else
{
if (influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned)
@ -1257,56 +1357,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
influenceTask.TaskState = TaskState.Adbandon;
}
}
}
#endregion
}
//无序阅片 没有 全局 肿瘤学
else
{
//阅片任务产生了裁判
if (origenalTask.JudgeVisitTaskId != null)
{
//裁判任务是否已阅片完成
var judgeTask = await _visitTaskRepository.FirstOrDefaultAsync(t => t.Id == origenalTask.JudgeVisitTaskId);
if (judgeTask.ReadingTaskState == ReadingTaskState.HaveSigned)
{
judgeTask.TaskState = TaskState.HaveReturned;
}
//裁判任务未完
else
{
judgeTask.TaskState = TaskState.Adbandon;
}
}
//不管是否触发裁判 阅片任务退回,待影像重传后重新分 配给原阅片人
if (trialConfig.ReadingType == ReadingMethod.Double)
{
//考虑该访视 另外一个阅片人的任务也同时退回
var otherTask = await _visitTaskRepository.FirstOrDefaultAsync(t => t.SourceSubjectVisitId == origenalTask.SourceSubjectVisitId && t.Id != origenalTask.Id && t.TaskState == TaskState.Effect);
if (otherTask.ReadingTaskState == ReadingTaskState.HaveSigned)
{
otherTask.TaskState = TaskState.HaveReturned;
}
else
{
otherTask.TaskState = TaskState.Adbandon;
}
}
}
@ -1380,6 +1432,13 @@ namespace IRaCIS.Core.Application.Service.Allocation
if (influenceTask.Id == origenalTask.Id)
{
ReReadingTaskTrackingDeal(influenceTask, agreeReReadingCommand);
influenceTaskList.ForEach(t =>
{
//记录实际影像的任务
influenceTask.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = t.Id });
});
}
//处理其他任务
else
@ -1462,6 +1521,14 @@ namespace IRaCIS.Core.Application.Service.Allocation
if (influenceTask.Id == origenalTask.Id)
{
ReReadingTaskTrackingDeal(influenceTask, agreeReReadingCommand);
influenceTaskList.ForEach(t =>
{
//记录实际影像的任务
influenceTask.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = t.Id });
});
}
else
{
@ -1762,6 +1829,15 @@ namespace IRaCIS.Core.Application.Service.Allocation
{
influenceTask.TaskState = TaskState.Adbandon;
}
influenceTaskList.ForEach(t =>
{
//记录实际影像的任务
influenceTask.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = t.Id });
});
}
}
@ -1809,6 +1885,17 @@ namespace IRaCIS.Core.Application.Service.Allocation
{
visitTask.TaskState = TaskState.Adbandon;
}
//同意的访视
if (visitTask.Id == task.Id)
{
currentVisitList.ForEach(t =>
{
//记录实际影像的任务
visitTask.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = t.Id });
});
}
}
}

View File

@ -0,0 +1,36 @@
//--------------------------------------------------------------------
// 此代码由T4模板自动生成 byzhouhang 20210918
// 生成时间 2022-07-21 13:44:02
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
using System;
using IRaCIS.Core.Domain.Share;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace IRaCIS.Core.Domain.Models
{
///<summary>
///TaskInfluence
///</summary>
[Table("TaskInfluence")]
public class TaskInfluence : Entity, IAuditAdd
{
public Guid CreateUserId { get; set; }
public DateTime CreateTime { get; set; }
public Guid OriginalTaskId { get; set; }
public VisitTask OriginalTask { get; set; }
public Guid InfluenceTaskId { get; set; }
}
}

View File

@ -108,10 +108,7 @@ namespace IRaCIS.Core.Domain.Models
public Subject Subject { get; set; }
public List<ReadingTaskQuestionAnswer> ReadingTaskQuestionAnswerList { get; set; } = new List<ReadingTaskQuestionAnswer>();
//对于裁判项而言,触发裁判的列表
public List<VisitTask> JudgeVisitList { get; set; }
public List<TaskMedicalReview> TaskMedicalReviewList { get; set; }
@ -162,6 +159,10 @@ namespace IRaCIS.Core.Domain.Models
#region 裁判任务特有
//对于裁判任务而言,触发裁判的列表
public List<VisitTask> JudgeVisitList { get; set; }
/// <summary>
/// 裁判结果的备注
/// </summary>
@ -202,6 +203,11 @@ namespace IRaCIS.Core.Domain.Models
#endregion
public List<ReadingTaskQuestionAnswer> ReadingTaskQuestionAnswerList { get; set; } = new List<ReadingTaskQuestionAnswer>();
//重阅或者退回影像的记录中间表
public List<TaskInfluence> TaskInfluenceList { get; set; } = new List<TaskInfluence>();
}

View File

@ -106,6 +106,9 @@ namespace IRaCIS.Core.Infra.EFCore
modelBuilder.Entity<VisitTask>().HasOne(t => t.Subject).WithMany(s=>s.SubjectVisitTaskList).HasForeignKey(t => t.SubjectId);
modelBuilder.Entity<VisitTask>().HasMany(t => t.TaskInfluenceList).WithOne(s => s.OriginalTask).HasForeignKey(t => t.OriginalTaskId);
modelBuilder.Entity<Dictionary>().HasMany(t => t.ChildList).WithOne(t => t.Parent);
@ -614,6 +617,7 @@ namespace IRaCIS.Core.Infra.EFCore
public virtual DbSet<TaskConsistentRule> TaskConsistentRule { get; set; }
public virtual DbSet<TaskInfluence> TaskInfluence { get; set; }

View File

@ -4,7 +4,7 @@
public static readonly string ConnectionString = "Server=123.56.94.154,1433\\MSSQLSERVER;Database=IRaCIS_New_Tet;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true";
public static readonly string DbDatabase = "IRaCIS_New_Tet";
//表名称用字符串,拼接
public static readonly string TableName = "ReadingGlobalTaskInfo";
public static readonly string TableName = "TaskInfluence";
//具体文件里面 例如service 可以配置是否分页
}
#>