项目结构修改

Uat_Study
DK 2022-03-28 16:38:06 +08:00
parent dc78fd1a09
commit b31e70e573
11 changed files with 1150 additions and 178 deletions

View File

@ -1,13 +1,22 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using AutoMapper; using AutoMapper;
using Castle.Core.Internal;
using IRaCIS.Application.Interfaces;
using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Application.Filter;
using IRaCIS.Core.Application.Image.QA;
using IRaCIS.Core.Application.Service.Inspection.DTO;
using IRaCIS.Core.Application.Service.Inspection.Interface;
using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Domain.Models;
using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infra.EFCore; using IRaCIS.Core.Infra.EFCore;
using IRaCIS.Core.Infrastructure.Extention; using IRaCIS.Core.Infrastructure.Extention;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace IRaCIS.Core.API.Controllers namespace IRaCIS.Core.API.Controllers
{ {
@ -18,93 +27,153 @@ namespace IRaCIS.Core.API.Controllers
private readonly IRepository _repository; private readonly IRepository _repository;
private readonly IMapper _mapper; private readonly IMapper _mapper;
private readonly IUserInfo _userInfo; private readonly IUserInfo _userInfo;
private readonly ITrialDocumentService _trialDocumentService;
private readonly IQCListService _qCListService;
private readonly ITrialConfigService _trialConfigService;
private readonly ISubjectService _subjectService;
private readonly IInspectionService _inspectionService;
private readonly IRepository<DataInspection> _dataInspectionRepository;
private delegate Task<IResponseOutput> executionFun(dynamic data);
public InspectionController(IRepository repository, IMapper mapper, IUserInfo userInfo) public InspectionController(IRepository repository,
IRepository<DataInspection> _repositoryDataInspection,
IMapper mapper, IUserInfo userInfo,
ITrialDocumentService trialDocumentService,
IRepository<DataInspection> dataInspectionRepository,
IQCListService _qCListService,
IInspectionService sinspectionService,
ITrialConfigService _trialConfigService,
ISubjectService _subjectService)
{ {
_repository = repository; _repository = repository;
_mapper = mapper; _mapper = mapper;
_userInfo = userInfo; _userInfo = userInfo;
this._inspectionService = sinspectionService;
this._trialDocumentService = trialDocumentService;
this._qCListService = _qCListService;
this._trialConfigService = _trialConfigService;
this._subjectService = _subjectService;
this._dataInspectionRepository = dataInspectionRepository;
} }
[HttpPost, Route("trialDocument/userConfirm")] /// <summary>
public async Task<IResponseOutput> UserConfirm(TrialDocumentConfirmDTO opt, [FromServices] ITrialDocumentService _trialDocumentService) /// 获取稽查数据
/// </summary>
/// <returns></returns>
[HttpPost, Route("Inspection/GetInspectionData")]
public async Task<PageOutput<GetDataInspectionOutDto>> GetInspectionData(GetDataInspectionDto dto)
{ {
var verifyResult = await VerifySignatureAsync(opt.SignInfo); return await _inspectionService.GetInspectionData(dto);
if (verifyResult.IsSuccess == false)
{
return verifyResult;
}
var bResult = await _trialDocumentService.UserConfirm(opt.OptCommand);
if (bResult.IsSuccess == false)
{
return bResult;
}
//SiteId SubjectId SubjectVisitId TrialId 最开始没有 需要特殊处理
//表冗余字段 前端只传递一次的话 后台模型就需要单独处理
if (opt.AuditInfo.IsSign)
{
var signId = await AddSignRecordAsync(opt.SignInfo);
await AddInspectionRecordAsync(opt.AuditInfo, signId);
}
else
{
await AddInspectionRecordAsync(opt.AuditInfo, null);
}
return bResult;
} }
/// <summary>
/// 用户 签名某个文档 签署文件
/// <summary> 验证用户签名信息 </summary> /// /// </summary>
private async Task<IResponseOutput> VerifySignatureAsync(SignDTO signDTO) /// <param name="opt"></param>
/// <returns></returns>
[HttpPost, Route("Inspection/trialDocument/userConfirm")]
[UnitOfWork]
public async Task<IResponseOutput> UserConfirm(TrialDocumentConfirmDTO opt)
{ {
var user = await _repository.FirstOrDefaultAsync<User>(u => u.UserName == signDTO.UserName && u.Password == signDTO.PassWord); var fun = _trialDocumentService.UserConfirm;
if (user == null) return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, fun);
{
return ResponseOutput.NotOk("password error");
}
else if (user.Status == UserStateEnum.Disable)
{
return ResponseOutput.NotOk("The user has been disabled!");
}
return ResponseOutput.Ok();
} }
/// <summary> 添加签名记录 </summary> /// #region setting
private async Task<Guid> AddSignRecordAsync(SignDTO signDTO) ///// <summary>
{ ///// 配置 基础逻辑信息
var add = await _repository.AddAsync(_mapper.Map<TrialSign>(signDTO)); ///// </summary>
///// <param name="opt"></param>
///// <returns></returns>
//[HttpPut, Route("configTrialBasicInfo/configTrialBasicInfo")]
//[UnitOfWork]
//public async Task<IResponseOutput> ConfigTrialBasicInfo(InsBasicTrialConfig opt)
//{
// var fun = _trialConfigService.ConfigTrialBasicInfo;
// return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, fun);
//}
var success = await _repository.SaveChangesAsync(); ///// <summary>
///// 配置流程
///// </summary>
///// <param name="opt"></param>
///// <returns></returns>
//[HttpPut, Route("configTrialBasicInfo/configTrialProcessInfo")]
//[UnitOfWork]
//public async Task<IResponseOutput> ConfigTrialProcessInfo(InsTrialProcessConfig opt)
//{
// var fun = _trialConfigService.ConfigTrialProcessInfo;
// return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, fun);
//}
return add.Id; ///// <summary>
///// 配置加急信息
///// </summary>
///// <param name="opt"></param>
///// <returns></returns>
//[HttpPut, Route("configTrialBasicInfo/ConfigTrialUrgentInfo")]
//[UnitOfWork]
//public async Task<IResponseOutput> ConfigTrialUrgentInfo(InsTrialUrgentConfig opt)
//{
// var fun = _trialConfigService.ConfigTrialUrgentInfo;
// return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, fun);
//}
}
/// <summary> 添加稽查记录( 有的会签名,有的不会签名) </summary> /// #endregion
private async Task AddInspectionRecordAsync(DataInspectionAddDTO addDto, Guid? signId)
#region 受试者
/// <summary>
/// 添加或更新受试者信息[New]
/// </summary>
/// <param name="opt"></param>
/// <returns></returns>
//[TypeFilter(typeof(TrialResourceFilter))]
[HttpPost, Route("Inspection/Subject/AddOrUpdateSubject")]
[UnitOfWork]
public async Task<IResponseOutput> AddOrUpdateSubject(InsSubjectCommand opt)
{ {
var add = await _repository.AddAsync(_mapper.Map<DataInspection>(addDto)); opt.AuditInfo.SubjectId = opt.OptCommand.Id;
var fun = _subjectService.AddOrUpdateSubject;
add.SignId = signId; return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, fun);
add.IP = _userInfo.IP;
var success = await _repository.SaveChangesAsync();
} }
/// <summary>
/// 修改受试者状态
/// </summary>
/// <param name="opt"></param>
/// <returns></returns>
///
[HttpPut, Route("Inspection/Subject/UpdateSubjectStatus")]
[UnitOfWork]
public async Task<IResponseOutput> UpdateSubjectStatus(InsUpdateSubjectStatus opt)
{
var fun = _subjectService.UpdateSubjectStatus;
return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, fun);
}
/// <summary>
/// 删除受试者
/// </summary>
/// <param name="opt"></param>
/// <returns></returns>
[HttpDelete, Route("Inspection/Subject/DeleteSubject")]
[UnitOfWork]
public async Task<IResponseOutput> DeleteSubject(InsDeleteSubjectDto opt)
{
var fun = _subjectService.DeleteSubject;
var data = await _subjectService.DeleteSubject(opt.OptCommand.SubjectId);
return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, fun, data);
}
#endregion
} }

View File

@ -152,14 +152,40 @@
Financials /Monthly Payment 列表查询接口 Financials /Monthly Payment 列表查询接口
</summary> </summary>
</member> </member>
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.VerifySignatureAsync(IRaCIS.Core.Application.Contracts.SignDTO)"> <member name="M:IRaCIS.Core.API.Controllers.InspectionController.GetInspectionData(IRaCIS.Core.Application.Service.Inspection.DTO.GetDataInspectionDto)">
<summary> 验证用户签名信息 </summary> /// <summary>
获取稽查数据
</summary>
<returns></returns>
</member> </member>
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.AddSignRecordAsync(IRaCIS.Core.Application.Contracts.SignDTO)"> <member name="M:IRaCIS.Core.API.Controllers.InspectionController.UserConfirm(IRaCIS.Core.Application.Service.Inspection.DTO.TrialDocumentConfirmDTO)">
<summary> 添加签名记录 </summary> /// <summary>
用户 签名某个文档 签署文件
</summary>
<param name="opt"></param>
<returns></returns>
</member> </member>
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.AddInspectionRecordAsync(IRaCIS.Core.Application.Contracts.DataInspectionAddDTO,System.Nullable{System.Guid})"> <member name="M:IRaCIS.Core.API.Controllers.InspectionController.AddOrUpdateSubject(IRaCIS.Core.Application.Service.Inspection.DTO.InsSubjectCommand)">
<summary> 添加稽查记录( 有的会签名,有的不会签名) </summary> /// <summary>
添加或更新受试者信息[New]
</summary>
<param name="opt"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.UpdateSubjectStatus(IRaCIS.Core.Application.Service.Inspection.DTO.InsUpdateSubjectStatus)">
<summary>
修改受试者状态
</summary>
<param name="opt"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.DeleteSubject(IRaCIS.Core.Application.Service.Inspection.DTO.InsDeleteSubjectDto)">
<summary>
删除受试者
</summary>
<param name="opt"></param>
<returns></returns>
</member> </member>
<member name="M:IRaCIS.Core.API.Controllers.UploadController.UploadVisitData(System.Guid,IRaCIS.Core.API.Controllers.UploadController.UploadFileTypeEnum,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit})"> <member name="M:IRaCIS.Core.API.Controllers.UploadController.UploadVisitData(System.Guid,IRaCIS.Core.API.Controllers.UploadController.UploadFileTypeEnum,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit})">
<summary> <summary>

View File

@ -699,6 +699,107 @@
SystemAnonymizationService SystemAnonymizationService
</summary> </summary>
</member> </member>
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionAddDTO.ChildrenType">
<summary>
子类
</summary>
</member>
<member name="T:IRaCIS.Core.Application.Service.Inspection.DTO.InsBasicTrialConfig">
<summary>
配置 基础逻辑信息
</summary>
</member>
<member name="T:IRaCIS.Core.Application.Service.Inspection.DTO.InsTrialProcessConfig">
<summary>
配置流程
</summary>
</member>
<member name="T:IRaCIS.Core.Application.Service.Inspection.DTO.InsTrialUrgentConfig">
<summary>
配置加急信息
</summary>
</member>
<member name="T:IRaCIS.Core.Application.Service.Inspection.DTO.TrialDocumentConfirmDTO">
<summary>
用户 签名某个文档 Dto
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.GetDataInspectionDto.ModuleType">
<summary>
功能模块
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.GetDataInspectionDto.BlindName">
<summary>
盲态访视名
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.GetDataInspectionDto.TrialId">
<summary>
项目iD
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.GetDataInspectionDto.SiteId">
<summary>
中心
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.GetDataInspectionDto.SubjectId">
<summary>
受试者
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.GetDataInspectionDto.SubjectVisitId">
<summary>
访视
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.GetDataInspectionDto.OptType">
<summary>
操作类型
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.GetDataInspectionDto.ChildrenType">
<summary>
子类
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.GetDataInspectionDto.Reason">
<summary>
修改原因
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.GetDataInspectionDto.IsSign">
<summary>
是否有签名
</summary>
</member>
<member name="M:IRaCIS.Core.Application.Service.Inspection.InspectionService.Enforcement(System.Object,IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionAddDTO,IRaCIS.Core.Application.Contracts.SignDTO,System.Object,IRaCIS.Core.Infrastructure.Extention.IResponseOutput)">
<summary>
通用逻辑封装
</summary>
<param name="OptCommand">方法参数</param>
<param name="AuditInfo">添加稽查</param>
<param name="SignInfo">用户签名</param>
<param name="fun">委托</param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.Inspection.InspectionService.MapData(System.Object,System.Object)">
<summary>
映射 SiteId SubjectId SubjectVisitId TrialId 最开始没有 需要特殊处理
</summary>
<param name="data"></param>
<param name="mapData"></param>
</member>
<member name="M:IRaCIS.Core.Application.Service.Inspection.InspectionService.VerifySignatureAsync(IRaCIS.Core.Application.Contracts.SignDTO)">
<summary> 验证用户签名信息 </summary> ///
</member>
<member name="M:IRaCIS.Core.Application.Service.Inspection.InspectionService.AddSignRecordAsync(IRaCIS.Core.Application.Contracts.SignDTO)">
<summary> 添加签名记录 </summary> ///
</member>
<member name="M:IRaCIS.Core.Application.Service.Inspection.InspectionService.AddInspectionRecordAsync(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionAddDTO,System.Nullable{System.Guid})">
<summary> 添加稽查记录( 有的会签名,有的不会签名) </summary> ///
</member>
<member name="T:IRaCIS.Core.Application.Service.TrialExternalUserService"> <member name="T:IRaCIS.Core.Application.Service.TrialExternalUserService">
<summary> <summary>
项目外部人员 录入流程相关 项目外部人员 录入流程相关

View File

@ -1,5 +1,5 @@
{ {
"test{0}": "英文本地化{0}", "test{0}{1}": "英文本地化{0}{1}",
"RequiredAttribute": "{0} is required", "RequiredAttribute": "{0} is required",
// SiteSurvey -------------------------------------------------------------------------------------------------------------------------- // SiteSurvey --------------------------------------------------------------------------------------------------------------------------
@ -15,28 +15,180 @@
"RecordLockUpdateDisable": "Your record is not locked, you are not allowed to choose to update, if submitted, can be rejected after operation", // "RecordLockUpdateDisable": "Your record is not locked, you are not allowed to choose to update, if submitted, can be rejected after operation", //
"SiteLockUpdateDisableOther": "At the current Site, your survey record has been locked, and it is not allowed to update other people's email survey record", //Site "SiteLockUpdateDisableOther": "At the current Site, your survey record has been locked, and it is not allowed to update other people's email survey record", //Site
"SiteLockUpdateDisableSelf": "At the current Site, your survey record has been locked, and there are other unlocked records, so you are not allowed to update your own survey record", //Site "SiteLockUpdateDisableSelf": "At the current Site, your survey record has been locked, and there are other unlocked records, so you are not allowed to update your own survey record", //Site
"SiteLockUpdateDisableEmail": "当前Site 存在未锁定的调研记录,不允许更新已锁定邮箱的调研记录", //Site "SiteLockUpdateDisableEmail": "Currently, there are unlocked survey records in the Site, and the survey records of the locked mailbox are not allowed to be updated", //Site
"EmailNotLatestDisableEmail{0}": "该邮箱{0}对应的调查表不是最新锁定的记录,不允许更新", // "EmailNotLatestDisableEmail{0}": "The questionnaire corresponding to this mailbox {0} is not the latest locked record and is not allowed to be updated", //
"SiteExistOtherUpdateDisable": "该Site下已经有其他用户已填写的调研表您不被允许继续填写", // "SiteExistOtherUpdateDisable": "Other users have already filled in the survey form under this Site, you are not allowed to continue to fill in", //
"IsLockUpdateDisable": "已锁定,不允许操作", //, "IsLockUpdateDisable": "The operation is not allowed because it has been locked", //,
"OnlyAbolishNotFiled": "只允许废除未提交的记录", // "OnlyAbolishNotFiled": "Only uncommitted records are allowed to be annulled", //
"AdminOperateDisable": "不允许Admin操作", // Admin "AdminOperateDisable": "The Admin operation is not allowed", // Admin
"UserWrongNotSubmit": "人员信息有不正确项,不允许提交", // "UserWrongNotSubmit": "Personnel information is not allowed to be submitted because there are incorrect items", //
"FillInTheType": "请填写生成账号的类型。人员姓名{0}", // "FillInTheType{0}": "Please enter the type of account to be generated. Name of person {0}", //
// TrialSiteUserSurveyService // TrialSiteUserSurveyService
"InfoInconformity": "该用户在系统中账户名为:{0} ,与填写信息存在不一致项, 现将界面信息修改为与系统一致,可进行保存", // "InfoInconformity": "The user name in the system is {0}, which is inconsistent with the entered information. You can modify the information to be consistent with the system and save the information", //
// TrialSiteUser ------------------------------------------------------------------------------------------------------------ // TrialSiteUser ------------------------------------------------------------------------------------------------------------
// TrialConfigService // TrialConfigService
"NoDataDound": "未在系统中找到该签名场景的数据", // "NoDataDound": "No data for the signature scenario was found in the system", //
"PasswordError": "password error", // "PasswordError": "password error", //
"UserBeDisabled": "The user has been disabled!", "UserBeDisabled": "The user has been disabled!",
"ProjSetDisable": "项目不在Initializing/Ongoing不允许确认配置", // "ProjSetDisable": "The project is not Initializing/Ongoing and configuration confirmation is not allowed", //
"QCRepate": "QC问题显示序号不允许重复", // QC "QCRepate": "The serial number of QC problem display is not allowed to repeat", // QC
"ParentNumToLow": "父问题的序号要比子问题序号小,请确认", // "ParentNumToLow": "Please confirm that the parent problem number is smaller than the child problem number", //
"ExistUnconfirmedItems": "项目、基础配置、流程配置、加急配置、访视计划,有未确认项", // "ExistUnconfirmedItems": "Project, basic configuration, process configuration, urgent configuration, visit plan, unconfirmed items", //
"NotAllCanOperate": "only in Initializing or Ongoing State can operate" // "NotAllCanOperate": "only in Initializing or Ongoing State can operate", //
// TrialExternalUserService
"InfoDoNotAgree{0}{1}": "The user account name in the system is {0} Phone number: {1}. The information is inconsistent with the entered information. Now, modify the page information to be consistent with the system information and save the information", //
"UserExist": "The email address and user type already exist", //
// TrialMaintenanceService
"OneTrial": "Only one pm is allowed in a trial",
"Participant": "Participant has participated in site maintenance",
// TrialService
"OnlyPMAPM": "Only PM/APM can perform this operation!",
"TrialIDExist": "Same Trial ID already exists.",
"ProjNot": "Operations are allowed only when the project is initialized or in progress",
"TrialConfirm": "The Trial visit schedule has been confirmed and cannot be deleted",
"TrialIntoTheGroup": "The Trial cannot be deleted because a doctor has been enrolled in the Trial or is in the enrollment process",
"TrialHaveSite": "There is a Site under this Trial and it cannot be deleted",
"TrialHaveParticipants": "There are participants under this Trial and they cannot be deleted",
"NotRevertEditable": "VisitPlan has been generated for some subjects,can not revert editable state",
// TrialSiteService
"CodeRepeated": "Code is not allowed to be repeated",
"CRCCanNotDeleted": "The site has been associated with CRC, and couldn't be deleted",
"SiteCanNotDeleted": "The subjects has been added to this site, and couldn't be deleted",
"StudyCanNotDeleted": "The site has been uploaded study, and couldn't be deleted.",
// Visit -------------------------------------------------------------------------------------------------------------------------------------------
// SubjectService
"VisitNotConfirmed": "The trial visit plan has not been confirmed yet.Please contact the project manager to confirm the visit plan before adding subject",
"ExistedTrial": "A subjects with the same subject ID already existed in this trial.",
"TheLastVisit": "The subject is not allowed to set this visit as the last visit since there is already an visit set as the last visit",
"ImagesUploaded": "The subject uploaded the image after this visit, and this visit is not allowed to be set as the last visit",
"StudyImagesCanBotDeleted": "This subject has executed a visit with uploading study images,and couldn't be deleted",
// SubjectVisitService
"ContainsVisitnum": "This subject's visit plan already contains a visit with the same visitnum",
"LastEvaluationNotAllowed": "After setting the last evaluation, you are not allowed to add scheduled outbound visits",
"CRCSubmit": "PD confirmation status cannot be modified after CRC submission",
"BacktrackingVisits": "After the CRC is submitted, the PD confirmation status cannot be changed",
"ImageUpload": "The subject uploaded the image after this visit, and this visit is not allowed to be set as the last visit",
"AssociatedUploaded": "This visit is associated with the uploaded study images and couldn't be deleted",
"InPlanCanNotDeleted": "This visit is InPlan and couldn't be deleted",
// VisitPlanService
"OnlyInitializing": "only in Initializing or Ongoing State can operate",
"AccordWithVisitNum": "For the visit plan, the VisitDay with a larger VisitNum should be larger than the VisitDay with a smaller VisitNum",
"same/VisitName": "A visit with the same VisitName/VisitNum already existed in the current visit plan",
"AlreadyBaseline": "A visit already is baseline in the current visit plan",
"IsUploadVideo": "A CRC has uploaded image data for the baseline and is not allowed to modify the baseline",
"VisitHasBeenExecuted": "The visit plan has been assigned to the subjects and executed",
"OnlyProgressCanEdit": "Modification validation is allowed only during project initialization or in progress",
"NoBaselineNoConfirmation": "No baseline, no confirmation allowed",
"NotConfirmedCanNotVisit": "If the project configuration is not confirmed, the visit plan is not allowed to be confirmed",
"VisitDayNotMinimum": "Baseline VisitDay is not minimum and confirmation is not allowed",
//Document-----------------------------------------------------------------------------------------------------------------------------------------------
//SystemDocumentService
"ExistsFileName": "The filename of the same type already exists",
"SignedUser": "A user has signed the document",
//TrialDocumentService
// ExistsFileName
"ExistsSignedUser": "This document, which has been signed by the user, cannot be deleted",
//password error PasswordError
//The user has been disabled UserBeDisabled
"DocumentsSigned": "The document has been signed",
"FileBeDelete": "File deleted or cancelled, signing failed",
//QC--------------------------------------------------------------------------------------------------------------------------
// ClinicalDataService
// NoneDicomStudyService
// QCListService
"NotFirstTrial": "The current user is not a preliminary user and cannot perform this operation",
"NotReviewUser": "The current user is not a review user and cannot perform this operation",
// QCOperationService
"AuditQuestionMust": "The audit question must be filled out and saved, otherwise no challenge is allowed to be added",
"VisitNoClose": "The current viewer has unclosed query for CRC upload permission. No further query is allowed",
"NotFinish": "CRC retransmission request /QC agrees to retransmission challenge and is not allowed to close the challenge until CRC setup retransmission is complete",
"QCHasBeenReplied": "This QC inquiry has been answered",
"OperationUserMustBeCRC/PM": "Only CRC and PM are allowed",
"CanNotCloseQuery": "Visits that perform conformance checks are not allowed to close queries",
"OnlyPMCanSet": "Only PM manual Settings are allowed to pass the consistency check",
"CanNotSettingConsistency": "Currently, the PM approves the rollback and does not allow the consistency check to pass",
"ConsistencyNotClose": "Compliance check challenge unclosed/audit status is not passed, setting conformance check is not allowed to pass",
"PassDataNotFallback": "The data that passes the verification is not allowed to apply for rollback",
"OnlyPMFallback": "Only PM rollback is allowed",
"UnderDetectionNotFallback": "Data to be verified/verified is not allowed to be rolled back",
"OnlyPMCanOperation": "Only PM operations are allowed",
"OnlyExcelCSV": "Only Excel and CSV are allowed!",
"ExcelVerificationFailed": "Please upload an Excel file in the specified format to ensure valid data",
"QCUnconfirmed": "The QC problem is not confirmed, it is not allowed to receive the task",
"MustBeFinish": "You are not allowed to pick up new subjects until you have already picked up other subjects",
"BeReceive": "It is currently claimed and not allowed to be claimed",
"CancelQCTask": "The project is configured to not review, not receive or cancel the QC Task",
"FirstTriaPassed": "The first examination has been passed, can not continue to receive",
"CanNotReceive": "The item is configured as single audit and cannot be collected if SubmmitState: submitted or AuditState: to be audited/audited is not met. Please refresh the interface",
"MustBeDifferent": "The retrial cannot be the same person as the first trial",
"IsNotSatisfied": "The project is configured for review and does not meet the submission status: Submitted or reviewed status: pending review /QC, it is not allowed to receive, please refresh the interface",
"VisitNotUploaded": "Visitors who have not uploaded any Dicom/ non-DICOM data are not allowed to submit",
"MandatoryFailed": "The project is configured to require filling in the date of first administration, but subjects do not fill in the date of first administration, which is not allowed to submit",
"YouBeenRemoved": "You have been removed from the project and are not allowed to do this",
"QuestionsNotClosed": "The operation is not allowed if it is not closed",
"CanNotSetQCPassed": "QC Passed cannot be set if the value is not Passed",
"MustSetQuestion": "The audit question must be filled out and saved, otherwise submission will not be allowed",
"CanNotChangeQCPassed": "The audit status of the item is not InPrimaryQC and cannot be changed to QCPassed",
// "必须填写审核问题,并保存,否则不允许提交" MustSetQuestion
"TrialIsDoubleCheck{0}": "The audit status of the item is {0} and cannot be changed to QCPassed",
"CanNotSetQCFailed": "QC Failed cannot be set in the unchecked state",
"NotInPrimaryQCQCFailed": "The project is configured as a single audit. The current audit status is not InPrimaryQC and cannot be changed to QCFailed",
"TrialIsDoubleCheckCanNotQCFailed{0}": "The project is configured with double audit. The current audit status is {0} and cannot be changed to QCFailed",
"CRCHasBeenSubmitted": "CRC has submitted an unmodified group confirmation status",
"CannotBeChangedPD": "PD confirmation status cannot be modified for rollback visits",
"OtherQCProcessAudit": "Other QC is conducting audit, current operation is not allowed",
"ForwardFailed": "Forward failure",
// QCQuestionService
// TrialQCQuestionService
"QCHasConfirmed": "QC has confirmed that operation is not allowed",
"BeforeClearSubproblem": "The parent problem can only be deleted if the child problem is cleared",
"HasQCAuditRecord": "There is QC audit record, it is not allowed to delete the problem item",
//ImageAndDoc -----------------------------------------------------------------------------------------------------------------------------
//DicomArchiveService
//ImageShareService
"NoImage": "There is no image in the current study and cannot be shared!",
"ResourceNotExist": "The resource does not exist! ",
"PasswordIsError": "Shared password error!",
"ResourceExpired": "Resource sharing has expired!",
//InstanceService
//SeriesService
//StudyListService
"TimeTooLow": "当前访视检查时间不能小于该访视之前检查的时间,请核对检查数据是否有误",
"SomeoneLoading": "当前有人正在上传归档该检查!",
"VisitEnd": "受试者访视结束,不允许上传!",
"DICOMUploaded{0}{1}{2}{3}": "{0}: This DICOM images have been uploaded and allocate to the {1} of the subject {2} (Study ID: {3}), which cannot continue to upload and assign it to others."
//StudyService
//SystemAnonymizationService
} }

View File

@ -1,5 +1,5 @@
{ {
"test{0}": "中文本地化{0}", "test{0}{1}": "中文本地化{0}{1}",
"RequiredAttribute": "{0} 字段是必须的", "RequiredAttribute": "{0} 字段是必须的",
// SiteSurvey -------------------------------------------------------------------------------------------------------------------------- // SiteSurvey --------------------------------------------------------------------------------------------------------------------------
@ -40,6 +40,157 @@
"NotAllCanOperate": "只有“初始化中”和“正在进行中”才能进行操作", // "NotAllCanOperate": "只有“初始化中”和“正在进行中”才能进行操作", //
// TrialExternalUserService // TrialExternalUserService
"InfoDoNotAgree{0}{1}": "该用户在系统中账户名为:{0} 电话:{1},与填写信息存在不一致项, 现将界面信息修改为与系统一致,可进行保存" // "InfoDoNotAgree{0}{1}": "该用户在系统中账户名为:{0} 电话:{1},与填写信息存在不一致项, 现将界面信息修改为与系统一致,可进行保存", //
"UserExist" "UserExist": "该邮箱和用户类型,已存在该账户", //
// TrialMaintenanceService
"OneTrial": "一次验证中只能一个PM",
"Participant": "参与过现场维护工作",
// TrialService
"OnlyPMAPM": "仅PM/APM可以操作!",
"TrialIDExist": "相同的试用ID已经存在。",
"ProjNot": "项目初始化或者进行中时,才允许操作",
"TrialConfirm": "Trial访视计划已经确认无法删除",
"TrialIntoTheGroup": "该Trial有医生入组或在入组流程中无法删除",
"TrialHaveSite": "该Trial下面有Site无法删除",
"TrialHaveParticipants": "该Trial下面有参与者无法删除",
"NotRevertEditable": "部分主题已生成VisitPlan无法恢复编辑状态",
// TrialSiteService
"CodeRepeated": "编码不允许重复",
"CRCCanNotDeleted": "该站点已与CRC关联无法删除",
"SiteCanNotDeleted": "主题已添加到本网站,无法删除",
"StudyCanNotDeleted": "该网站已上传研究,无法删除",
// Visit -------------------------------------------------------------------------------------------------------------------------------------------
// SubjectService
"VisitNotConfirmed": "试访计划尚未确定。添加主题前请联系项目经理确认访问计划",
"ExistedTrial": "在本试验中已经存在一个具有相同受试者ID的受试者.",
"TheLastVisit": "该受试者已经有访视设置为末次访视,不允许将该访视设置为末次访视",
"ImagesUploaded": "该受试者此访视后有影像上传,该访视不允许设置为末次访视",
"StudyImagesCanBotDeleted": "本课题已上传研究图像进行访问,无法删除",
// SubjectVisitService
"ContainsVisitnum": "这个主题的访问计划已经包含了一个访问次数相同的访问",
//访访访访 TheLastVisit
"LastEvaluationNotAllowed": "设置末次评估后,不允许添加计划外访视",
"CRCSubmit": "CRC提交后不允许修改PD确认状态",
"BacktrackingVisits": "回退的访视不允许修改PD确认状态",
"ImageUpload": "该受试者此访视后有影像上传,该访视不允许设置为末次访视",
"AssociatedUploaded": "本次访问与上传的研究图片有关,无法删除",
"InPlanCanNotDeleted": "此访问为InPlan不能删除",
// VisitPlanService
"OnlyInitializing": "只有“初始化中”和“正在进行中”才能进行操作",
"AccordWithVisitNum": "对于访问计划具有较大VisitNum的VisitDay应该大于具有较小VisitNum的VisitDay",
"same/VisitName": "当前访问计划中已经存在具有相同VisitName/VisitNum的访问",
"AlreadyBaseline": "已访视是当前访视计划的基线",
"IsUploadVideo": "有CRC已经为基线上传了影像数据,不允许修改基线",
"VisitHasBeenExecuted": "访问计划已分配给受试者并执行",
"OnlyProgressCanEdit": "仅仅在项目初始化或者进行中时,才允许修改确认",
"NoBaselineNoConfirmation": "没有基线,不允许确认",
"NotConfirmedCanNotVisit": "项目配置未确认,不允许确认访视计划",
"VisitDayNotMinimum": "基线VisitDay 不是最小的, 不允许确认",
//Document-----------------------------------------------------------------------------------------------------------------------------------------------
//SystemDocumentService
"ExistsFileName": "同类型已存在该文件名",
"SignedUser": "该文档下已有签名的用户",
//TrialDocumentService
// ExistsFileName
"ExistsSignedUser": "该文档,已有用户签名,不允许删除",
//password error PasswordError
//The user has been disabled UserBeDisabled
"DocumentsSigned": "该文档已经签名",
"FileBeDelete": "文件已删除或者废除,签署失败",
//QC--------------------------------------------------------------------------------------------------------------------------
// ClinicalDataService
// NoneDicomStudyService
// QCListService
"NotFirstTrial": "当前用户不是初审用户,不允许操作",
"NotReviewUser": "当前用户不是复审用户,不允许操作",
// QCOperationService
"AuditQuestionMust": "必须填写审核问题,并保存,否则不允许添加质疑",
"VisitNoClose": "当前访视有未关闭的 同意CRC上传的质疑不允许再次添加质疑",
"NotFinish": "CRC申请重传的/QC同意重传的质疑在CRC设置重传完成前不允许关闭质疑",
"QCHasBeenReplied": "此QC质询已回复",
"OperationUserMustBeCRC/PM": "一致性核查对话操作用户 只允许 CRC/PM",
"CanNotCloseQuery": "执行一致性核查的访视 不允许关闭质疑",
"OnlyPMCanSet": "只允许PM 手动设置一致性核查通过",
"CanNotSettingConsistency": "当前是PM同意回退,不允许设置一致性核查通过",
"ConsistencyNotClose": "致性核查质疑未关闭/审核状态不是通过,不允许设置一致性核查通过",
"PassDataNotFallback": "核查通过的数据不允许申请回退",
"OnlyPMFallback": "只允许PM 回退",
"UnderDetectionNotFallback": "待核查/核查通过的数据不允许回退",
"OnlyPMCanOperation": "只允许PM 操作",
"OnlyExcelCSV": "只允许Excel、 CSV",
"ExcelVerificationFailed": "请上传规定格式的Excel文件保证有有效数据",
"QCUnconfirmed": "QC问题未确认不允许领取任务",
"MustBeFinish": "您已经领取了其他受试者,完成后才允许领取新的受试者",
"BeReceive": "当前已被领取,不允许领取",
"CancelQCTask": "项目配置为不审没有领取或者取消QC Task",
"FirstTriaPassed": "初审已通过,不能继续领取",
"CanNotReceive": "项目配置为单审,不满足SubmmitState已提交 或者 AuditState待审核/审核中, 不允许领取,请刷新界面",
"MustBeDifferent": "复审不能和初审是同一个人",
"IsNotSatisfied": "项目配置为复审,不满足提交状态:已提交 或者 审核状态:待审核/QC中, 不允许领取,请刷新界面",
"VisitNotUploaded": "有访视未上传任何Dicom/非Dicom数据 不允许提交",
"MandatoryFailed": "项目配置了需要填写首次给药日期 但是受试者没有填写首次给药日期,不允许提交",
"YouBeenRemoved": "您已经被移出项目,不允许该操作",
"QuestionsNotClosed": "有质疑未关闭,不允许该操作",
"CanNotSetQCPassed": "不审状态下不允许设置为QC Passed",
"MustSetQuestion": "必须填写审核问题,并保存,否则不允许提交",
"CanNotChangeQCPassed": "项目配置为单审 当前审核状态不为 InPrimaryQC不能变更到 QCPassed",
// "必须填写审核问题,并保存,否则不允许提交" MustSetQuestion
"TrialIsDoubleCheck{0}": "项目配置为双审 当前审核状态为 {0},不能变更到 QCPassed",
"CanNotSetQCFailed": "不审状态下不允许设置为QC Failed",
"NotInPrimaryQCQCFailed": "项目配置为单审 当前审核状态不为 InPrimaryQC不能变更到 QCFailed",
"TrialIsDoubleCheckCanNotQCFailed{0}": "项目配置为双审 当前审核状态为 {0},不能变更到 QCFailed",
"CRCHasBeenSubmitted": "CRC已提交了 不能修改入组确认状态",
"CannotBeChangedPD": "回退的访视不允许修改PD确认状态",
"OtherQCProcessAudit": "其他QC正在进行审核当前操作不允许",
"ForwardFailed": "转发失败",
// QCQuestionService
// TrialQCQuestionService
"QCHasConfirmed": "QC已确认不允许操作",
"BeforeClearSubproblem": "清除子问题 才允许删除父问题",
"HasQCAuditRecord": "已有QC审核记录不允许删除问题项",
//ImageAndDoc -----------------------------------------------------------------------------------------------------------------------------
//DicomArchiveService
//ImageShareService
"NoImage": "目前研究中没有图片,不能分享!",
"ResourceNotExist": "资源不存在!",
"PasswordIsError": "共享密码错误!",
"ResourceExpired": "资源共享过期!",
//InstanceService
//SeriesService
//StudyListService
"TimeTooLow": "当前访视检查时间不能小于该访视之前检查的时间,请核对检查数据是否有误",
"SomeoneLoading": "当前有人正在上传归档该检查!",
"VisitEnd": "受试者访视结束,不允许上传!",
"DICOMUploaded{0}{1}{2}{3}": "{0}:此DICOM图片已上传并分配给课题{2}(研究ID:{3})的{1},课题{2}无法继续上传并分配给他人。"
//StudyService
//SystemAnonymizationService
} }

View File

@ -0,0 +1,206 @@
using IRaCIS.Application.Contracts;
using IRaCIS.Core.Application.Contracts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IRaCIS.Core.Application.Service.Inspection.DTO
{
public class DataInspectionAddDTO
{
public Guid? TrialId { get; set; }
public Guid? SiteId { get; set; }
public Guid? SubjectId { get; set; }
public Guid? SubjectVisitId { get; set; }
public string ModuleType { get; set; } = string.Empty;
public string OptType { get; set; } = string.Empty;
public string BlindName { get; set; } = string.Empty;
public string Reason { get; set; } = string.Empty;
/// <summary>
/// 子类
/// </summary>
public int ChildrenType { get; set; }
public bool IsSign { get; set; }
public string JsonDetail { get; set; } = string.Empty;
////需要单独处理
//public string IP { get; set; }
//public Guid? SignId { get; set; }
}
public interface IInspectionDTO
{
public DataInspectionAddDTO AuditInfo { get; set; }
}
public interface ISignDTO
{
public SignDTO SignInfo { get; set; }
}
#region Setting
/// <summary>
/// 配置 基础逻辑信息
/// </summary>
public class InsBasicTrialConfig : InspectionBase, IInspectionDTO, ISignDTO
{
public BasicTrialConfig OptCommand { get; set; }
}
/// <summary>
/// 配置流程
/// </summary>
public class InsTrialProcessConfig : InspectionBase, IInspectionDTO, ISignDTO
{
public TrialProcessConfig OptCommand { get; set; }
}
/// <summary>
/// 配置加急信息
/// </summary>
public class InsTrialUrgentConfig : InspectionBase, IInspectionDTO, ISignDTO
{
public TrialUrgentConfig OptCommand { get; set; }
}
#endregion
#region 受试者
public class InsSubjectCommand : InspectionBase, IInspectionDTO, ISignDTO
{
public SubjectCommand OptCommand { get; set; }
}
public class InsUpdateSubjectStatus : InspectionBase, IInspectionDTO, ISignDTO
{
public SubjectStatusChangeCommand OptCommand { get; set; }
}
public class InsDeleteSubjectDto : InspectionBase, IInspectionDTO, ISignDTO
{
public DeleteSubjectDto OptCommand { get; set; }
}
public class DeleteSubjectDto
{
public Guid SubjectId { get; set; }
public Guid TrialId { get; set; }
public Guid SiteId { get; set; }
}
#endregion
/// <summary>
/// 用户 签名某个文档 Dto
/// </summary>
public class TrialDocumentConfirmDTO : InspectionBase, IInspectionDTO, ISignDTO
{
public UserConfirmCommand OptCommand { get; set; }
}
public class GetDataInspectionOutDto : DataInspection
{
public string ExperimentName { get; set; } = string.Empty;
public string SiteName { get; set; } = string.Empty;
public string FirstName { get; set; } = string.Empty;
public string LastName { get; set; } = string.Empty;
public string VisitName { get; set; } = string.Empty;
public string ParentJson { get; set; } = string.Empty;
public string CreateUser { get; set; } = string.Empty;
public string UserFirstName { get; set; } = string.Empty;
public string UserLastName { get; set; } = string.Empty;
}
public class GetDataInspectionDto : PageInput
{
/// <summary>
/// 功能模块
/// </summary>
public string ModuleType { get; set; } = string.Empty;
/// <summary>
/// 盲态访视名
/// </summary>
public string BlindName { get; set; } = string.Empty;
/// <summary>
/// 项目iD
/// </summary>
public Guid? TrialId { get; set; }
/// <summary>
/// 中心
/// </summary>
public Guid? SiteId { get; set; }
/// <summary>
/// 受试者
/// </summary>
public Guid? SubjectId { get; set; }
/// <summary>
/// 访视
/// </summary>
public Guid? SubjectVisitId { get; set; }
/// <summary>
/// 操作类型
/// </summary>
public string OptType { get; set; } = string.Empty;
/// <summary>
/// 子类
/// </summary>
public int? ChildrenType { get; set; }
/// <summary>
/// 修改原因
/// </summary>
public string Reason { get; set; } = string.Empty;
/// <summary>
/// 是否有签名
/// </summary>
public bool? IsSign { get; set; }
}
public class InspectionBase
{
public DataInspectionAddDTO AuditInfo { get; set; }
public SignDTO SignInfo { get; set; } = new SignDTO();
}
}

View File

@ -0,0 +1,244 @@
using Castle.Core.Internal;
using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Application.Service.Inspection.DTO;
using IRaCIS.Core.Application.Service.Inspection.Interface;
using IRaCIS.Core.Domain.Share;
using Panda.DynamicWebApi.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IRaCIS.Core.Application.Service.Inspection
{
[NonDynamicWebApi]
public class InspectionService : BaseService, IInspectionService
{
public InspectionService()
{
}
public async Task<PageOutput<GetDataInspectionOutDto>> GetInspectionData(GetDataInspectionDto dto)
{
//_repository.GetQueryable.GetQueryable < DataInspection >
#region 逻辑代码
var query = from data in _repository.GetQueryable<DataInspection>()
join trial in _repository.GetQueryable<Trial>() on data.TrialId equals trial.Id into trialtemp
from leftrial in trialtemp.DefaultIfEmpty()
join site in _repository.GetQueryable<Site>() on data.SiteId equals site.Id into sitetemp
from leftsite in sitetemp.DefaultIfEmpty()
join subject in _repository.GetQueryable<Subject>() on data.SubjectId equals subject.Id into subtemp
from leftsubject in subtemp.DefaultIfEmpty()
join subjectVisit in _repository.GetQueryable<SubjectVisit>() on data.SubjectVisitId equals subjectVisit.Id into subjectVisittemp
from leftsubjectVisit in subjectVisittemp.DefaultIfEmpty()
join parent in _repository.GetQueryable<DataInspection>() on data.ParentId equals parent.Id into parenttemp
from leftparent in parenttemp.DefaultIfEmpty()
join user in _repository.GetQueryable<User>() on data.CreateUserId equals user.Id into usertemp
from leftuser in usertemp.DefaultIfEmpty()
select new GetDataInspectionOutDto()
{
CreateTime = data.CreateTime,
CreateUserId = data.CreateUserId,
ModuleType = data.ModuleType,
BlindName = data.BlindName,
TrialId = data.TrialId,
SiteId = data.SiteId,
SubjectId = data.SubjectId,
SubjectVisitId = data.SubjectVisitId,
OptType = data.OptType,
IP = data.IP,
Reason = data.Reason,
IsSign = data.IsSign,
SignId = data.SignId,
ParentId = data.ParentId,
ChildrenType = data.ChildrenType,
JsonDetail = data.JsonDetail,
SiteName = leftsite.SiteName,
ExperimentName = leftrial.ExperimentName,
FirstName = leftsubject.FirstName,
LastName = leftsubject.LastName,
Id = data.Id,
ParentJson = leftparent.JsonDetail,
VisitName = leftsubjectVisit.VisitName,
CreateUser = leftuser.UserName,
UserFirstName = leftuser.FirstName,
UserLastName = leftuser.LastName,
};
query = query.WhereIf(!dto.BlindName.IsNullOrEmpty(), x => x.BlindName == dto.BlindName)
.WhereIf(dto.IsSign != null, x => x.IsSign == dto.IsSign)
.WhereIf(dto.ChildrenType != null, x => x.ChildrenType == dto.ChildrenType)
.WhereIf(!dto.ModuleType.IsNullOrEmpty(), x => x.ModuleType == dto.ModuleType)
.WhereIf(!dto.OptType.IsNullOrEmpty(), x => x.OptType == dto.OptType)
.WhereIf(!dto.Reason.IsNullOrEmpty(), x => x.Reason == dto.Reason)
.WhereIf(dto.TrialId != null, x => x.TrialId == dto.TrialId)
.WhereIf(dto.SubjectId != null, x => x.SubjectId == dto.SubjectId)
.WhereIf(dto.SubjectVisitId != null, x => x.SubjectVisitId == dto.SubjectVisitId)
.WhereIf(dto.SiteId != null, x => x.SiteId == dto.SiteId);
#endregion
#region 测试
//var query = from data in _repository.GetQueryable<DataInspection>()
// join parent in _repository.GetQueryable<DataInspection>() on data.ParentId equals parent.Id into parenttemp
// from leftparent in parenttemp.DefaultIfEmpty()
// join subjectVisit in _repository.GetQueryable<SubjectVisit>() on data.SubjectVisitId equals subjectVisit.Id into subjectVisittemp
// from leftsubjectVisit in subjectVisittemp.DefaultIfEmpty()
// select new GetDataInspectionOutDto()
// {
// CreateTime = data.CreateTime,
// CreateUserId = data.CreateUserId,
// ModuleType = data.ModuleType,
// BlindName = data.BlindName,
// TrialId = data.TrialId,
// SiteId = data.SiteId,
// SubjectId = data.SubjectId,
// SubjectVisitId = data.SubjectVisitId,
// OptType = data.OptType,
// IP = data.IP,
// Reason = data.Reason,
// IsSign = data.IsSign,
// SignId = data.SignId,
// ParentId = data.ParentId,
// ChildrenType = data.ChildrenType,
// JsonDetail = data.JsonDetail,
// VisitName = leftsubjectVisit.VisitName,
// Id = data.Id,
// ParentJson = leftparent.JsonDetail,
// };
#endregion
dto.Asc = false;
return await query.ToPagedListAsync(dto.PageIndex, dto.PageSize, "CreateTime", dto.Asc);
}
/// <summary>
/// 通用逻辑封装
/// </summary>
/// <param name="OptCommand">方法参数</param>
/// <param name="AuditInfo">添加稽查</param>
/// <param name="SignInfo">用户签名</param>
/// <param name="fun">委托</param>
/// <returns></returns>
public async Task<dynamic> Enforcement(dynamic OptCommand, DataInspectionAddDTO AuditInfo, SignDTO SignInfo, dynamic fun, IResponseOutput response=null)
{
Guid? signId = null;
MapData(OptCommand, AuditInfo);
if (AuditInfo.IsSign)
{
// 验证用户签名信息
var verifyResult = await VerifySignatureAsync(SignInfo);
signId = await AddSignRecordAsync(SignInfo);
if (verifyResult.IsSuccess == false)
{
return verifyResult;
}
await AddSignRecordAsync(SignInfo);
}
IResponseOutput bResult;
if (response != null)
{
bResult = response;
}
else
{
bResult = await fun(OptCommand);
}
// 用户 签名某个文档
if (bResult.IsSuccess == false)
{
return bResult;
}
// 判断是否需要前面
await AddInspectionRecordAsync(AuditInfo, signId);
if (bResult.IsSuccess == false)
{
return bResult;
}
return bResult;
}
/// <summary>
/// 映射 SiteId SubjectId SubjectVisitId TrialId 最开始没有 需要特殊处理
/// </summary>
/// <param name="data"></param>
/// <param name="mapData"></param>
public void MapData(dynamic data, dynamic mapData)
{
List<string> column = new List<string>() { "TrialId", "SiteId", "SubjectId", "SubjectVisitId" };
foreach (var item in column)
{
try
{
var value = data.GetType().GetProperty(item).GetValue(data);
mapData.GetType().GetProperty(item).SetValue(mapData, value);
}
catch (Exception)
{
continue;
}
}
}
/// <summary> 验证用户签名信息 </summary> ///
public async Task<IResponseOutput> VerifySignatureAsync(SignDTO signDTO)
{
var user = await _repository.FirstOrDefaultAsync<User>(u => u.UserName == signDTO.UserName && u.Password == signDTO.PassWord);
if (user == null)
{
return ResponseOutput.NotOk("password error");
}
else if (user.Status == UserStateEnum.Disable)
{
return ResponseOutput.NotOk("The user has been disabled!");
}
return ResponseOutput.Ok();
}
/// <summary> 添加签名记录 </summary> ///
public async Task<Guid> AddSignRecordAsync(SignDTO signDTO)
{
var add = await _repository.AddAsync(_mapper.Map<TrialSign>(signDTO));
var success = await _repository.SaveChangesAsync();
return add.Id;
}
/// <summary> 添加稽查记录( 有的会签名,有的不会签名) </summary> ///
public async Task<IResponseOutput> AddInspectionRecordAsync(DataInspectionAddDTO addDto, Guid? signId)
{
var add = _mapper.Map<DataInspection>(addDto);
Guid? parentId = null;
parentId = (await _repository.GetQueryable<DataInspection>().Where(x => x.TrialId == add.TrialId && x.SubjectVisitId == add.SubjectVisitId && x.SubjectId == add.SubjectId && x.SiteId == x.SiteId).OrderByDescending(x => x.CreateTime).FirstOrDefaultAsync())?.Id;
add.ParentId = parentId;
add.CreateTime = DateTime.Now;
add.CreateUserId = _userInfo.Id;
add.SignId = signId;
add.IP = _userInfo.IP;
await _repository.AddAsync(add);
var success = await _repository.SaveChangesAsync();
return ResponseOutput.Ok(success);
}
}
}

View File

@ -0,0 +1,26 @@
using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Application.Service.Inspection.DTO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IRaCIS.Core.Application.Service.Inspection.Interface
{
public interface IInspectionService
{
Task<PageOutput<GetDataInspectionOutDto>> GetInspectionData(GetDataInspectionDto dto);
void MapData(dynamic data, dynamic mapData);
Task<IResponseOutput> VerifySignatureAsync(SignDTO signDTO);
Task<Guid> AddSignRecordAsync(SignDTO signDTO);
Task<dynamic> Enforcement(dynamic OptCommand, DataInspectionAddDTO AuditInfo, SignDTO SignInfo, dynamic fun, IResponseOutput response = null);
Task<IResponseOutput> AddInspectionRecordAsync(DataInspectionAddDTO addDto, Guid? signId);
}
}

View File

@ -1,75 +1,27 @@
using System.ComponentModel.DataAnnotations; using IRaCIS.Application.Contracts;
using System.ComponentModel.DataAnnotations;
namespace IRaCIS.Core.Application.Contracts; namespace IRaCIS.Core.Application.Contracts;
public class SignDTO public class SignDTO
{ {
public string UserName { get; set; } = String.Empty; public string UserName { get; set; } = string.Empty;
public string PassWord { get; set; } = String.Empty; public string PassWord { get; set; } = string.Empty;
public string SignText { get; set; } = String.Empty; public string SignText { get; set; } = string.Empty;
[NotDefault]
public Guid TrialId { get; set; }
[NotDefault] public Guid? TrialId { get; set; }
public Guid SignCodeId { get; set; }
[NotDefault] public Guid? SignCodeId { get; set; }
public string SignCode { get; set; } = String.Empty;
public string SignCode { get; set; } = string.Empty;
public Guid? SubjectVisitId { get; set; } public Guid? SubjectVisitId { get; set; }
} }
public class DataInspectionAddDTO
{
public Guid TrialId { get; set; }
public Guid SiteId { get; set; }
public Guid SubjectId { get; set; }
public Guid SubjectVisitId { get; set; }
public int ModuleEnum { get; set; }
public int OptEnum { get; set; }
public string BlindName { get; set; } = string.Empty;
public string Reason { get; set; } = string.Empty;
public bool IsSign { get; set; }
public string JsonDetail { get; set; } = string.Empty;
////需要单独处理
//public string IP { get; set; }
//public Guid? SignId { get; set; }
}
public interface IInspectionDTO
{
public DataInspectionAddDTO AuditInfo { get; set; }
}
public interface ISignDTO
{
public SignDTO SignInfo { get; set; }
}
public class TrialDocumentConfirmDTO : IInspectionDTO, ISignDTO
{
public UserConfirmCommand OptCommand { get; set; }
public DataInspectionAddDTO AuditInfo { get; set; }
public SignDTO SignInfo { get; set; }
}

View File

@ -7,6 +7,8 @@ namespace IRaCIS.Application.Interfaces
{ {
Task<IResponseOutput> AddOrUpdateSubject([FromBody] SubjectCommand subjectCommand); Task<IResponseOutput> AddOrUpdateSubject([FromBody] SubjectCommand subjectCommand);
Task<IResponseOutput> DeleteSubject(Guid id); Task<IResponseOutput> DeleteSubject(Guid id);
Task<IResponseOutput> UpdateSubjectStatus(SubjectStatusChangeCommand subjectStatusChangeCommand);
Task<IResponseOutput<PageOutput<SubjectQueryView>, TrialSubjectConfig>> GetSubjectList(SubjectQueryParam param); Task<IResponseOutput<PageOutput<SubjectQueryView>, TrialSubjectConfig>> GetSubjectList(SubjectQueryParam param);
} }
} }

View File

@ -1,6 +1,5 @@
//-------------------------------------------------------------------- //--------------------------------------------------------------------
// 此代码由T4模板自动生成 byzhouhang 20210918
// 生成时间 2022-03-21 17:13:43 // 生成时间 2022-03-21 17:13:43
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
using System; using System;
@ -9,56 +8,100 @@ using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace IRaCIS.Core.Domain.Models namespace IRaCIS.Core.Domain.Models
{ {
///<summary> ///<summary>
///DataInspection ///DataInspection
///</summary> ///</summary>
[Table("DataInspection")] [Table("DataInspection")]
public class DataInspection : Entity, IAuditAdd public class DataInspection : Entity, IAuditAdd
{ {
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; } public DateTime CreateTime { get; set; }
public Guid CreateUserId { get; set; }
[Required] /// <summary>
public int ModuleEnum { get; set; } /// 创建用户ID
/// </summary>
public Guid CreateUserId { get; set; }
/// <summary>
/// 功能模块
/// </summary>
public string ModuleType { get; set; }
public string BlindName { get; set; } = string.Empty; /// <summary>
/// 盲态访视名
/// </summary>
public string BlindName { get; set; } = string.Empty;
/// <summary>
/// 项目iD
/// </summary>
[Required] [Required]
public Guid TrialId { get; set; } public Guid TrialId { get; set; }
[Required] /// <summary>
public Guid SiteId { get; set; } /// 中心
/// </summary>
public Guid? SiteId { get; set; }
[Required] /// <summary>
public Guid SubjectId { get; set; } /// 受试者
/// </summary>
public Guid? SubjectId { get; set; }
[Required] /// <summary>
public Guid SubjectVisitId { get; set; } /// 访视
/// </summary>
public Guid? SubjectVisitId { get; set; }
[Required] /// <summary>
public int OptEnum { get; set; } /// 操作类型
/// </summary>
public string OptType { get; set; }
/// <summary>
/// IP地址
/// </summary>
public string IP { get; set; } = string.Empty; public string IP { get; set; } = string.Empty;
/// <summary>
/// 修改原因
/// </summary>
[Required] [Required]
public string Reason { get; set; } = string.Empty; public string Reason { get; set; } = string.Empty;
/// <summary>
/// 是否有签名
/// </summary>
public bool IsSign { get; set; } public bool IsSign { get; set; }
/// <summary>
/// 签名ID
/// </summary>
public Guid? SignId { get; set; } public Guid? SignId { get; set; }
public string JsonDetail { get; set; } = string.Empty; /// <summary>
/// 父类ID
/// </summary>
public Guid? ParentId { get; set; }
/// <summary>
/// 子类
/// </summary>
public int? ChildrenType { get; set; }
/// <summary>
/// Json 对象
/// </summary>
public string JsonDetail { get; set; } = string.Empty;
} }
}
}