PI 审核接口提交
parent
6df64d68af
commit
11b4cf0351
|
@ -295,6 +295,27 @@
|
|||
<param name="_visitTaskCommonService"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.PIAuditTask(IRaCIS.Core.Application.ViewModel.PIAuditTaskCommand)">
|
||||
<summary>
|
||||
new- 首次审核 后续编辑审核
|
||||
</summary>
|
||||
<param name="incommand"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.PIAuditTaskReply(IRaCIS.Core.Application.ViewModel.PIAuditTaskReplyCommand)">
|
||||
<summary>
|
||||
new- 回复审核内容
|
||||
</summary>
|
||||
<param name="incommand"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.GetPIAuditDialogList(IRaCIS.Core.Application.ViewModel.PIAuditDialogQuery)">
|
||||
<summary>
|
||||
new- 获取审核对话列表
|
||||
</summary>
|
||||
<param name="inQuery"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.GetReadingTaskList(IRaCIS.Core.Application.ViewModel.VisitTaskQuery)">
|
||||
<summary>
|
||||
PM阅片跟踪
|
||||
|
|
|
@ -8,6 +8,7 @@ using IRaCIS.Core.Domain.Share;
|
|||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Newtonsoft.Json;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace IRaCIS.Core.Application.ViewModel
|
||||
{
|
||||
|
@ -399,9 +400,41 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
|
||||
|
||||
|
||||
public class PIAuditTaskCommand
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid VisitTaskId { get; set; }
|
||||
public string NotAgreeReason { get; set; }
|
||||
public string PIAuditNote { get; set; } = string.Empty;
|
||||
|
||||
public List<string> PIAuditImagePathList { get; set; }
|
||||
|
||||
public PIAuditState PIAuditState { get; set; }
|
||||
|
||||
public bool? IsEnrollment { get; set; }
|
||||
|
||||
public bool? IsPDConfirm { get; set; }
|
||||
}
|
||||
|
||||
public class PIAuditTaskReplyCommand
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid VisitTaskId { get; set; }
|
||||
|
||||
public string ReplyContent { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class PIAuditDialogQuery
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid VisitTaskId { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class PIAuditDialogListView: PIAuditTaskCommand
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ using Org.BouncyCastle.Crypto;
|
|||
using IRaCIS.Core.Domain.Share.Reading;
|
||||
using Quartz;
|
||||
using IRaCIS.Application.Services.BackGroundJob;
|
||||
using Magicodes.ExporterAndImporter.Core.Extension;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service.Allocation
|
||||
{
|
||||
|
@ -51,6 +52,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
|
||||
private readonly IRepository<ReadingQuestionCriterionTrial> _trialReadingCriterionRepository;
|
||||
private readonly IRepository<SubjectCriteriaEvaluationVisitStudyFilter> _subjectCriteriaEvaluationVisitStudyFilterRepository;
|
||||
private readonly IRepository<PIAudit> _PIAuditRepository;
|
||||
|
||||
public VisitTaskService(IRepository<SubjectVisit> subjectVisitRepository, IRepository<VisitTask> visitTaskRepository, IRepository<Trial> trialRepository,
|
||||
IRepository<Subject> subjectRepository, IRepository<SubjectUser> subjectUserRepository, IRepository<TaskAllocationRule> taskAllocationRuleRepository,
|
||||
|
@ -61,9 +63,11 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
IRepository<ReadingClinicalData> readingClinicalDataReposiotry,
|
||||
IRepository<SubjectCriteriaEvaluation> subjectCriteriaEvaluationRepository,
|
||||
IRepository<SubjectCriteriaEvaluationVisitFilter> subjectCriteriaEvaluationVisitFilterRepository,
|
||||
IRepository<SubjectCriteriaEvaluationVisitStudyFilter> subjectCriteriaEvaluationVisitStudyFilterRepository
|
||||
IRepository<SubjectCriteriaEvaluationVisitStudyFilter> subjectCriteriaEvaluationVisitStudyFilterRepository,
|
||||
IRepository<PIAudit> PIAuditRepository
|
||||
)
|
||||
{
|
||||
_PIAuditRepository = PIAuditRepository;
|
||||
_readingClinicalDataReposiotry = readingClinicalDataReposiotry;
|
||||
_taskAllocationRuleRepository = taskAllocationRuleRepository;
|
||||
_visitTaskRepository = visitTaskRepository;
|
||||
|
@ -216,10 +220,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
.WhereIf(queryVisitTask.FirstAuditTimeBegin != null, t => t.AllocateTime > queryVisitTask.FirstAuditTimeBegin)
|
||||
.WhereIf(queryVisitTask.FirstAuditTimeEnd != null, t => t.AllocateTime < queryVisitTask.FirstAuditTimeEnd)
|
||||
.WhereIf(queryVisitTask.LatestReplyTimeBegin != null, t => t.AllocateTime > queryVisitTask.LatestReplyTimeBegin)
|
||||
.WhereIf(queryVisitTask.LatestReplyTimeEnd != null, t => t.AllocateTime < queryVisitTask.LatestReplyTimeEnd)
|
||||
|
||||
|
||||
;
|
||||
.WhereIf(queryVisitTask.LatestReplyTimeEnd != null, t => t.AllocateTime < queryVisitTask.LatestReplyTimeEnd);
|
||||
|
||||
return visitTaskQueryable;
|
||||
}
|
||||
|
@ -241,6 +242,76 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///new- 首次审核 后续编辑审核
|
||||
/// </summary>
|
||||
/// <param name="incommand"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
|
||||
public async Task<IResponseOutput> PIAuditTask(PIAuditTaskCommand incommand)
|
||||
{
|
||||
//需要设置首次审核时间 审核人
|
||||
var visitTask = await _visitTaskRepository.FirstOrDefaultAsync(t => t.Id == incommand.VisitTaskId);
|
||||
var isFirstAudit = visitTask.FirstAuditUserId == null;
|
||||
|
||||
visitTask.NotAgreeReason = incommand.NotAgreeReason;
|
||||
visitTask.PIAuditNote = incommand.PIAuditNote;
|
||||
visitTask.PIAuditImagePath = string.Join('|', incommand.PIAuditImagePathList);
|
||||
visitTask.PIAuditState = incommand.PIAuditState;
|
||||
visitTask.IsEnrollment = incommand.IsEnrollment;
|
||||
visitTask.IsPDConfirm = incommand.IsPDConfirm;
|
||||
visitTask.LatestReplyUserId = _userInfo.Id;
|
||||
visitTask.LatestReplyTime = DateTime.Now;
|
||||
|
||||
if (isFirstAudit)
|
||||
{
|
||||
visitTask.FirstAuditUserId = _userInfo.Id;
|
||||
visitTask.FirstAuditTime = DateTime.Now;
|
||||
}
|
||||
|
||||
//发送对话
|
||||
var addDialig = _mapper.Map<PIAudit>(incommand);
|
||||
|
||||
await _PIAuditRepository.AddAsync(addDialig);
|
||||
|
||||
await _visitTaskRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///new- 回复审核内容
|
||||
/// </summary>
|
||||
/// <param name="incommand"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IResponseOutput> PIAuditTaskReply(PIAuditTaskReplyCommand incommand)
|
||||
{
|
||||
await _PIAuditRepository.AddAsync(new PIAudit() { ReplyContent=incommand.ReplyContent,VisitTaskId=incommand.VisitTaskId});
|
||||
|
||||
await _PIAuditRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// new- 获取审核对话列表
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<List<PIAuditDialogListView>> GetPIAuditDialogList(PIAuditDialogQuery inQuery)
|
||||
{
|
||||
|
||||
|
||||
var list = await _PIAuditRepository.Where(t => t.VisitTaskId == inQuery.VisitTaskId).OrderBy(t=>t.CreateTime).ProjectTo<PIAuditDialogListView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// PM阅片跟踪
|
||||
|
|
|
@ -315,8 +315,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
.ForMember(o => o.Id, t => t.MapFrom(u => u.InfluenceTask.Id));
|
||||
|
||||
|
||||
CreateMap<PIAuditTaskCommand, PIAudit>();
|
||||
|
||||
|
||||
CreateMap<PIAudit, PIAuditDialogListView>();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,9 @@ using System;
|
|||
using IRaCIS.Core.Domain.Share;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace IRaCIS.Core.Domain.Models
|
||||
{
|
||||
///<summary>
|
||||
|
@ -16,39 +19,49 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public class PIAudit : Entity, IAuditAdd
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Id
|
||||
/// </summary>
|
||||
[Key]
|
||||
[Required]
|
||||
public Guid Id { get; set; }
|
||||
[JsonIgnore]
|
||||
public VisitTask VisitTask { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// PIAuditNote
|
||||
/// </summary>
|
||||
public string PIAuditNote { get; set; }
|
||||
public Guid VisitTaskId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// NotAgreeReason
|
||||
/// </summary>
|
||||
public string NotAgreeReason { get; set; }
|
||||
public string ReplyContent { get; set; }=string.Empty;
|
||||
|
||||
public bool? IsEnrollment { get; set; }
|
||||
|
||||
public bool? IsPDConfirm { get; set; }
|
||||
|
||||
public string PIAuditNote { get; set; } = string.Empty;
|
||||
|
||||
|
||||
public string NotAgreeReason { get; set; } = string.Empty;
|
||||
|
||||
|
||||
public string PIAuditImagePath { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// PIAuditImagePath
|
||||
/// </summary>
|
||||
public string PIAuditImagePath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// CreateUserId
|
||||
/// </summary>
|
||||
[Required]
|
||||
public Guid CreateUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// CreateTime
|
||||
/// </summary>
|
||||
[Required]
|
||||
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public List<string> PIAuditImagePathList
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
return this.PIAuditImagePath.Trim().Split('|').ToList();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
return new List<string>();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
[Table("VisitTask")]
|
||||
public class VisitTask : Entity, IAuditUpdate, IAuditAdd
|
||||
{
|
||||
|
||||
public List<PIAudit> PIAuditList { get; set; } = new List<PIAudit>();
|
||||
public string TaskName { get; set; } = string.Empty;
|
||||
public string TaskBlindName { get; set; } = string.Empty;
|
||||
|
||||
|
@ -451,7 +451,9 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
public PIAuditState PIAuditState { get; set; }
|
||||
|
||||
public bool? IsEnrollment { get; set; }
|
||||
|
||||
public bool? IsPDConfirm { get; set; }
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
|
|
Loading…
Reference in New Issue