修改一版
parent
5ef1c90289
commit
ba9874b41e
|
@ -110,20 +110,11 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
public async Task<IResponseOutput> ConfigTrialBasicInfoConfirm(DataInspectionDto<BasicTrialConfig> opt)
|
public async Task<IResponseOutput> ConfigTrialBasicInfoConfirm(DataInspectionDto<BasicTrialConfig> opt)
|
||||||
{
|
{
|
||||||
|
|
||||||
await _inspectionService.RecordSing(opt.SignInfo);
|
|
||||||
opt.Data.IsTrialBasicLogicConfirmed = true;
|
opt.Data.IsTrialBasicLogicConfirmed = true;
|
||||||
return await _trialConfigService.ConfigTrialBasicInfo(opt.Data);
|
var result = await _trialConfigService.ConfigTrialBasicInfo(opt.Data);
|
||||||
//if (!data.IsSuccess)
|
await _inspectionService.RecordSing(opt.SignInfo, result);
|
||||||
//{
|
return result;
|
||||||
// return ResponseOutput.NotOk(data.ErrorMessage);
|
|
||||||
//}
|
|
||||||
|
|
||||||
//return ResponseOutput.Ok();
|
|
||||||
//return await _trialConfigService.TrialConfigSignatureConfirm(new SignConfirmDTO()
|
|
||||||
//{
|
|
||||||
// TrialId = opt.Data.TrialId,
|
|
||||||
// SignCode = opt.SignInfo.SignCode
|
|
||||||
//});
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -136,8 +127,9 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> TrialConfigSignatureConfirm(DataInspectionDto<SignConfirmDTO> opt)
|
public async Task<IResponseOutput> TrialConfigSignatureConfirm(DataInspectionDto<SignConfirmDTO> opt)
|
||||||
{
|
{
|
||||||
await _inspectionService.RecordSing(opt.SignInfo);
|
var result = await _trialConfigService.TrialConfigSignatureConfirm(opt.Data);
|
||||||
return await _trialConfigService.TrialConfigSignatureConfirm(opt.Data);
|
await _inspectionService.RecordSing(opt.SignInfo, result);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -153,21 +145,10 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> ConfigTrialProcessInfoConfirm(DataInspectionDto<TrialProcessConfig> opt)
|
public async Task<IResponseOutput> ConfigTrialProcessInfoConfirm(DataInspectionDto<TrialProcessConfig> opt)
|
||||||
{
|
{
|
||||||
await _inspectionService.RecordSing(opt.SignInfo);
|
|
||||||
opt.Data.IsTrialProcessConfirmed = true;
|
opt.Data.IsTrialProcessConfirmed = true;
|
||||||
return await _trialConfigService.ConfigTrialProcessInfo(opt.Data);
|
var result = await _trialConfigService.ConfigTrialProcessInfo(opt.Data);
|
||||||
//if (!data.IsSuccess)
|
await _inspectionService.RecordSing(opt.SignInfo,result);
|
||||||
//{
|
return result;
|
||||||
// return ResponseOutput.NotOk(data.ErrorMessage);
|
|
||||||
//}
|
|
||||||
|
|
||||||
//return ResponseOutput.Ok();
|
|
||||||
//return await _trialConfigService.TrialConfigSignatureConfirm(new SignConfirmDTO()
|
|
||||||
//{
|
|
||||||
// TrialId = opt.Data.TrialId,
|
|
||||||
// SignCode = opt.SignInfo.SignCode
|
|
||||||
//});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -183,19 +164,10 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> ConfigTrialUrgentInfoConfirm(DataInspectionDto<TrialUrgentConfig> opt)
|
public async Task<IResponseOutput> ConfigTrialUrgentInfoConfirm(DataInspectionDto<TrialUrgentConfig> opt)
|
||||||
{
|
{
|
||||||
|
|
||||||
await _inspectionService.RecordSing(opt.SignInfo);
|
|
||||||
opt.Data.IsTrialUrgentConfirmed = true;
|
opt.Data.IsTrialUrgentConfirmed = true;
|
||||||
return await _trialConfigService.ConfigTrialUrgentInfo(opt.Data);
|
var result= await _trialConfigService.ConfigTrialUrgentInfo(opt.Data);
|
||||||
//if (!data.IsSuccess)
|
await _inspectionService.RecordSing(opt.SignInfo, result);
|
||||||
//{
|
return result;
|
||||||
// return ResponseOutput.NotOk(data.ErrorMessage);
|
|
||||||
//}
|
|
||||||
//return await _trialConfigService.TrialConfigSignatureConfirm(new SignConfirmDTO()
|
|
||||||
//{
|
|
||||||
// TrialId = opt.Data.TrialId,
|
|
||||||
// SignCode = opt.SignInfo.SignCode
|
|
||||||
//});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -208,8 +180,9 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> CRCRequestToQC(DataInspectionDto<CRCRequestToQCCommand> opt)
|
public async Task<IResponseOutput> CRCRequestToQC(DataInspectionDto<CRCRequestToQCCommand> opt)
|
||||||
{
|
{
|
||||||
await _inspectionService.RecordSing(opt.SignInfo);
|
var result = await _qCOperationService.CRCRequestToQC(opt.Data);
|
||||||
return await _qCOperationService.CRCRequestToQC(opt.Data);
|
await _inspectionService.RecordSing(opt.SignInfo, result);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -220,8 +193,9 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> QCPassedOrFailed(DataInspectionDto<QCPassedOrFailedDto> opt)
|
public async Task<IResponseOutput> QCPassedOrFailed(DataInspectionDto<QCPassedOrFailedDto> opt)
|
||||||
{
|
{
|
||||||
await _inspectionService.RecordSing(opt.SignInfo);
|
var result= await _qCOperationService.QCPassedOrFailed(opt.Data.trialId, opt.Data.subjectVisitId, opt.Data.auditState);
|
||||||
return await _qCOperationService.QCPassedOrFailed(opt.Data.trialId, opt.Data.subjectVisitId, opt.Data.auditState);
|
await _inspectionService.RecordSing(opt.SignInfo, result);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -231,10 +205,13 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> CheckBack(DataInspectionDto<IDDto> opt)
|
public async Task<IResponseOutput> CheckBack(DataInspectionDto<IDDto> opt)
|
||||||
{
|
{
|
||||||
await _inspectionService.RecordSing(opt.SignInfo);
|
var result = await _qCOperationService.CheckBack(opt.Data.Id);
|
||||||
return await _qCOperationService.CheckBack(opt.Data.Id);
|
await _inspectionService.RecordSing(opt.SignInfo, result);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -244,8 +221,9 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> SetReuploadFinished(DataInspectionDto<CRCReuploadFinishedCommand> opt)
|
public async Task<IResponseOutput> SetReuploadFinished(DataInspectionDto<CRCReuploadFinishedCommand> opt)
|
||||||
{
|
{
|
||||||
await _inspectionService.RecordSing(opt.SignInfo);
|
var result = await _qCOperationService.SetReuploadFinished(opt.Data);
|
||||||
return await _qCOperationService.SetReuploadFinished(opt.Data);
|
await _inspectionService.RecordSing(opt.SignInfo, result);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -257,8 +235,9 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> UpdateTrialState(DataInspectionDto<UpdateTrialStateDto> opt)
|
public async Task<IResponseOutput> UpdateTrialState(DataInspectionDto<UpdateTrialStateDto> opt)
|
||||||
{
|
{
|
||||||
await _inspectionService.RecordSing(opt.SignInfo);
|
var result = await _trialConfigService.UpdateTrialState(opt.Data.trialId, opt.Data.trialStatusStr, opt.Data.reason);
|
||||||
return await _trialConfigService.UpdateTrialState(opt.Data.trialId, opt.Data.trialStatusStr, opt.Data.reason);
|
await _inspectionService.RecordSing(opt.SignInfo, result);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -270,8 +249,9 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> UserConfirm(DataInspectionDto<UserConfirmCommand> opt)
|
public async Task<IResponseOutput> UserConfirm(DataInspectionDto<UserConfirmCommand> opt)
|
||||||
{
|
{
|
||||||
await _inspectionService.RecordSing(opt.SignInfo);
|
var result = await _trialDocumentService.UserConfirm(opt.Data);
|
||||||
return await _trialDocumentService.UserConfirm(opt.Data);
|
await _inspectionService.RecordSing(opt.SignInfo, result);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,17 +156,18 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
||||||
return await query.ToPagedListAsync(dto.PageIndex, dto.PageSize, "CreateTime", dto.Asc);
|
return await query.ToPagedListAsync(dto.PageIndex, dto.PageSize, "CreateTime", dto.Asc);
|
||||||
}
|
}
|
||||||
|
|
||||||
//public async Task<string>
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 传入参数记录ID
|
/// 传入参数记录ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="SignInfo"></param>
|
/// <param name="SignInfo"></param>
|
||||||
|
/// <param name="response"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task RecordSing(SignDTO SignInfo)
|
public async Task RecordSing(SignDTO SignInfo, IResponseOutput response)
|
||||||
{
|
{
|
||||||
if (SignInfo != null)
|
if (SignInfo != null&&response.IsSuccess)
|
||||||
{
|
{
|
||||||
var verifyResult = await VerifySignatureAsync(SignInfo);
|
var verifyResult = await VerifySignatureAsync(SignInfo);
|
||||||
var signId = await AddSignRecordAsync(SignInfo);
|
var signId = await AddSignRecordAsync(SignInfo);
|
||||||
|
@ -176,91 +177,7 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 通用逻辑封装
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="OptCommand">方法参数</param>
|
|
||||||
/// <param name="AuditInfo">添加稽查</param>
|
|
||||||
/// <param name="SignInfo">用户签名</param>
|
|
||||||
/// <param name="fun">委托</param>
|
|
||||||
/// <param name="response">方法返回的结果</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<dynamic> Enforcement(dynamic OptCommand, DataInspectionAddDTO AuditInfo, SignDTO SignInfo, dynamic fun, IResponseOutput? response=null)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (response != null && response.IsSuccess == false)
|
|
||||||
{
|
|
||||||
return response;
|
|
||||||
}
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (AuditInfo.IsSign)
|
|
||||||
{
|
|
||||||
var signSuccess = await _repository.BatchUpdateAsync<TrialSign>(t => t.Id == signId, u => new TrialSign() { IsCompleted = true });
|
|
||||||
}
|
|
||||||
|
|
||||||
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 i = mapData.GetType().GetProperty(item).GetValue(mapData);
|
|
||||||
if (i == null)
|
|
||||||
{
|
|
||||||
var value = data.GetType().GetProperty(item).GetValue(data);
|
|
||||||
mapData.GetType().GetProperty(item).SetValue(mapData, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary> 验证用户签名信息 </summary> ///
|
/// <summary> 验证用户签名信息 </summary> ///
|
||||||
public async Task<IResponseOutput> VerifySignatureAsync(SignDTO signDTO)
|
public async Task<IResponseOutput> VerifySignatureAsync(SignDTO signDTO)
|
||||||
|
@ -288,49 +205,6 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
||||||
return add.Id;
|
return add.Id;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 往json里面添加属性
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="json">json</param>
|
|
||||||
/// <param name="keyValues">字典</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public string AddJsonItem(string json, Dictionary<string,object> keyValues)
|
|
||||||
{
|
|
||||||
|
|
||||||
var JsonData = JsonConvert.DeserializeObject<IDictionary<string, object>>(json);
|
|
||||||
|
|
||||||
foreach (var item in keyValues)
|
|
||||||
{
|
|
||||||
if (JsonData.ContainsKey(item.Key))
|
|
||||||
{
|
|
||||||
JsonData[item.Key] = item.Value;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
JsonData.Add(item.Key, item.Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
return JsonConvert.SerializeObject(JsonData);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 设置项目以及名称
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="Data"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task SetInspectionNameValue(DataInspection Data)
|
|
||||||
{
|
|
||||||
await _dataInspectionRepository.SetInspectionNameValue(Data);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,15 +13,14 @@ namespace IRaCIS.Core.Application.Service.Inspection.Interface
|
||||||
|
|
||||||
Task<PageOutput<GetDataInspectionOutDto>> GetInspectionData(GetDataInspectionDto dto);
|
Task<PageOutput<GetDataInspectionOutDto>> GetInspectionData(GetDataInspectionDto dto);
|
||||||
|
|
||||||
string AddJsonItem(string json, Dictionary<string, object> keyValues);
|
|
||||||
void MapData(dynamic data, dynamic mapData);
|
|
||||||
|
|
||||||
Task<IResponseOutput> VerifySignatureAsync(SignDTO signDTO);
|
Task<IResponseOutput> VerifySignatureAsync(SignDTO signDTO, IResponseOutput response);
|
||||||
|
|
||||||
Task<Guid> AddSignRecordAsync(SignDTO signDTO);
|
Task<Guid> AddSignRecordAsync(SignDTO signDTO);
|
||||||
|
|
||||||
Task RecordSing(SignDTO SignInfo);
|
Task RecordSing(SignDTO SignInfo, IResponseOutput response);
|
||||||
Task<dynamic> Enforcement(dynamic OptCommand, DataInspectionAddDTO AuditInfo, SignDTO SignInfo, dynamic fun, IResponseOutput? response = null);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue