Merge branch 'master' of http://192.168.1.2:8033/IRaCIS_Core_Api
commit
48e273d4af
|
@ -137,9 +137,22 @@ namespace IRaCIS.Core.API.Controllers
|
|||
public async Task<IResponseOutput> AddOrUpdateSubject(InsSubjectCommand opt)
|
||||
{
|
||||
|
||||
opt.AuditInfo.SubjectId = opt.OptCommand.Id;
|
||||
var fun = _subjectService.AddOrUpdateSubject;
|
||||
return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, fun);
|
||||
|
||||
var fun = await _subjectService.AddOrUpdateSubject(opt.OptCommand);
|
||||
opt.AuditInfo.SubjectId = Guid.Parse(fun.Data);
|
||||
|
||||
var statusdata = new {
|
||||
Status = 1,
|
||||
OutEnrollmentTime = DateTime.Now.ToString("yyyy-MM-dd"),
|
||||
VisitOverTime = DateTime.Now.ToString("yyyy-MM-dd"),
|
||||
Reason = string.Empty,
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, null, fun, statusdata);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -670,7 +670,7 @@
|
|||
是否有签名
|
||||
</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)">
|
||||
<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,System.Object)">
|
||||
<summary>
|
||||
通用逻辑封装
|
||||
</summary>
|
||||
|
@ -678,6 +678,8 @@
|
|||
<param name="AuditInfo">添加稽查</param>
|
||||
<param name="SignInfo">用户签名</param>
|
||||
<param name="fun">委托</param>
|
||||
<param name="response">方法返回的结果</param>
|
||||
<param name="Statusdata">添加状态的对象</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Inspection.InspectionService.MapData(System.Object,System.Object)">
|
||||
|
@ -693,8 +695,14 @@
|
|||
<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 name="M:IRaCIS.Core.Application.Service.Inspection.InspectionService.AddInspectionRecordAsync(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionAddDTO,System.Nullable{System.Guid},System.Object)">
|
||||
<summary>
|
||||
添加稽查记录
|
||||
</summary>
|
||||
<param name="addDto">添加对象</param>
|
||||
<param name="signId">签名Id</param>
|
||||
<param name="Statusdata">初始化状态对象</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Service.TrialExternalUserService">
|
||||
<summary>
|
||||
|
|
|
@ -12,33 +12,37 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
public class FrontAuditConfigView
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Value { get; set; }
|
||||
public string ValueCN { get; set; }
|
||||
public string Description { get; set; }
|
||||
public DateTime CreateTime { get; set; }
|
||||
public string Value { get; set; } = string.Empty;
|
||||
public string ValueCN { get; set; } = string.Empty;
|
||||
public string Description { get; set; } = string.Empty;
|
||||
public DateTime CreateTime { get; set; }
|
||||
public Guid CreateUserId { get; set; }
|
||||
public DateTime UpdateTime { get; set; }
|
||||
public Guid UpdateUserId { get; set; }
|
||||
public string Code { get; set; }
|
||||
public Guid? ParentId { get; set; }
|
||||
public string Code { get; set; } = string.Empty;
|
||||
public Guid? ParentId { get; set; }
|
||||
public bool? IsEnable { get; set; }
|
||||
public bool? IsConfig { get; set; }
|
||||
public string ModuleTypeId { get; set; }
|
||||
public string OptTypeId { get; set; }
|
||||
public string ChildrenTypeId { get; set; }
|
||||
public string ModuleTypeId { get; set; } = string.Empty;
|
||||
public string OptTypeId { get; set; } = string.Empty;
|
||||
public string ChildrenTypeId { get; set; } = string.Empty;
|
||||
|
||||
public string ConfigType { get; set; }
|
||||
public string ConfigType { get; set; } = string.Empty;
|
||||
|
||||
public bool? IsShowParent { get; set; }
|
||||
public bool? IsShowParent { get; set; }
|
||||
|
||||
public string ChildrenTypeValue { get; set; }
|
||||
public string ChildrenTypeValueCN { get; set; }
|
||||
|
||||
public string ModuleTypeValue { get; set; }
|
||||
public string ModuleTypeValueCN { get; set; }
|
||||
|
||||
public string OptTypeValue { get; set; }
|
||||
public string OptTypeValueCN { get; set; }
|
||||
public string ChildrenTypeValue { get; set; } = string.Empty;
|
||||
public string ChildrenTypeValueCN { get; set; } = string.Empty;
|
||||
|
||||
public string ModuleTypeValue { get; set; } = string.Empty;
|
||||
public string ModuleTypeValueCN { get; set; } = string.Empty;
|
||||
|
||||
public string OptTypeValue { get; set; } = string.Empty;
|
||||
public string OptTypeValueCN { get; set; } = string.Empty;
|
||||
|
||||
public int? Sort { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
///<summary>FrontAuditConfigQuery 列表查询参数模型</summary>
|
||||
|
@ -87,6 +91,8 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
|
||||
public bool? IsShowParent { get; set; }
|
||||
|
||||
public int? Sort { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
OptTypeValue = leftOptTypeId.Value,
|
||||
OptTypeValueCN = leftOptTypeId.ValueCN,
|
||||
UpdateUserId = data.UpdateUserId,
|
||||
|
||||
Sort=data.Sort,
|
||||
ValueCN = data.ValueCN,
|
||||
ChildrenTypeValue = leftchildrenType.Value,
|
||||
};
|
||||
|
@ -80,7 +80,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.WhereIf(!iq.Value.IsNullOrEmpty(), x => x.Code == iq.Code)
|
||||
.WhereIf(!iq.Value.IsNullOrEmpty(), x => x.ChildrenTypeId == iq.ChildrenTypeId);
|
||||
|
||||
return await query.ToListAsync();
|
||||
return await query.OrderBy(x=>x.Sort).ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
|
|||
/// <summary>
|
||||
/// 子类
|
||||
/// </summary>
|
||||
public string ChildrenType { get; set; }
|
||||
public string ChildrenType { get; set; } = string.Empty;
|
||||
public bool IsSign { get; set; }
|
||||
public string JsonDetail { get; set; } = string.Empty;
|
||||
|
||||
|
@ -141,6 +141,8 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
|
|||
public string UserFirstName { get; set; } = string.Empty;
|
||||
public string UserLastName { get; set; } = string.Empty;
|
||||
|
||||
public string SubjectCode { get; set; } = string.Empty;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ 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 Newtonsoft.Json;
|
||||
using Panda.DynamicWebApi.Attributes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
@ -66,6 +67,7 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
|||
CreateUser = leftuser.UserName,
|
||||
UserFirstName = leftuser.FirstName,
|
||||
UserLastName = leftuser.LastName,
|
||||
SubjectCode=leftsubject.Code,
|
||||
};
|
||||
|
||||
query = query.WhereIf(!dto.BlindName.IsNullOrEmpty(), x => x.BlindName == dto.BlindName)
|
||||
|
@ -126,8 +128,10 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
|||
/// <param name="AuditInfo">添加稽查</param>
|
||||
/// <param name="SignInfo">用户签名</param>
|
||||
/// <param name="fun">委托</param>
|
||||
/// <param name="response">方法返回的结果</param>
|
||||
/// <param name="Statusdata">添加状态的对象</param>
|
||||
/// <returns></returns>
|
||||
public async Task<dynamic> Enforcement(dynamic OptCommand, DataInspectionAddDTO AuditInfo, SignDTO SignInfo, dynamic fun, IResponseOutput response=null)
|
||||
public async Task<dynamic> Enforcement(dynamic OptCommand, DataInspectionAddDTO AuditInfo, SignDTO SignInfo, dynamic fun, IResponseOutput? response=null, object? Statusdata=null)
|
||||
{
|
||||
Guid? signId = null;
|
||||
MapData(OptCommand, AuditInfo);
|
||||
|
@ -164,7 +168,7 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
|||
|
||||
// 判断是否需要前面
|
||||
|
||||
await AddInspectionRecordAsync(AuditInfo, signId);
|
||||
await AddInspectionRecordAsync(AuditInfo, signId, Statusdata);
|
||||
|
||||
if (bResult.IsSuccess == false)
|
||||
{
|
||||
|
@ -224,18 +228,49 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
|||
|
||||
}
|
||||
|
||||
/// <summary> 添加稽查记录( 有的会签名,有的不会签名) </summary> ///
|
||||
public async Task<IResponseOutput> AddInspectionRecordAsync(DataInspectionAddDTO addDto, Guid? signId)
|
||||
/// <summary>
|
||||
/// 添加稽查记录
|
||||
/// </summary>
|
||||
/// <param name="addDto">添加对象</param>
|
||||
/// <param name="signId">签名Id</param>
|
||||
/// <param name="Statusdata">初始化状态对象</param>
|
||||
/// <returns></returns>
|
||||
public async Task<IResponseOutput> AddInspectionRecordAsync(DataInspectionAddDTO addDto, Guid? signId, object? Statusdata = null)
|
||||
{
|
||||
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;
|
||||
parentId = (await _repository.GetQueryable<DataInspection>().Where(x => x.TrialId == add.TrialId && x.SubjectVisitId == add.SubjectVisitId && x.SubjectId == add.SubjectId && x.SiteId == add.SiteId&&x.ModuleType==add.ModuleType&&x.ChildrenType==add.ChildrenType).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);
|
||||
if (addDto.OptType.ToLower() == "Add".ToLower()|| Statusdata!=null)
|
||||
{
|
||||
|
||||
|
||||
DataInspection ststus = new DataInspection()
|
||||
{
|
||||
SignId = signId,
|
||||
SiteId = add.SiteId,
|
||||
SubjectId = add.SubjectId,
|
||||
SubjectVisitId = add.SubjectVisitId,
|
||||
IsSign = add.IsSign,
|
||||
BlindName = add.BlindName,
|
||||
ChildrenType = "Status",
|
||||
OptType = "Init",
|
||||
CreateTime = add.CreateTime,
|
||||
CreateUserId = add.CreateUserId,
|
||||
IP = add.IP,
|
||||
ModuleType = add.ModuleType,
|
||||
TrialId = add.TrialId,
|
||||
JsonDetail = JsonConvert.SerializeObject(Statusdata)
|
||||
};
|
||||
|
||||
await _repository.AddAsync(ststus);
|
||||
}
|
||||
|
||||
var success = await _repository.SaveChangesAsync();
|
||||
return ResponseOutput.Ok(success);
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@ namespace IRaCIS.Core.Application.Service.Inspection.Interface
|
|||
|
||||
Task<Guid> AddSignRecordAsync(SignDTO signDTO);
|
||||
|
||||
Task<dynamic> Enforcement(dynamic OptCommand, DataInspectionAddDTO AuditInfo, SignDTO SignInfo, dynamic fun, IResponseOutput response = null);
|
||||
Task<dynamic> Enforcement(dynamic OptCommand, DataInspectionAddDTO AuditInfo, SignDTO SignInfo, dynamic fun, IResponseOutput? response = null, object? Statusdata = null);
|
||||
|
||||
Task<IResponseOutput> AddInspectionRecordAsync(DataInspectionAddDTO addDto, Guid? signId);
|
||||
Task<IResponseOutput> AddInspectionRecordAsync(DataInspectionAddDTO addDto, Guid? signId, object? Statusdata = null);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,9 +43,14 @@ namespace IRaCIS.Application.Contracts
|
|||
|
||||
public class SubjectStatusChangeCommand
|
||||
{
|
||||
[NotDefault]
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
|
||||
public Guid? TrialId { get; set; }
|
||||
|
||||
public Guid? SiteId { get; set; }
|
||||
|
||||
public SubjectStatus Status { get; set; }
|
||||
public DateTime? OutEnrollmentTime { get; set; }
|
||||
public DateTime? VisitOverTime { get; set; }
|
||||
|
|
|
@ -5,7 +5,7 @@ namespace IRaCIS.Application.Interfaces
|
|||
{
|
||||
public interface ISubjectService
|
||||
{
|
||||
Task<IResponseOutput> AddOrUpdateSubject([FromBody] SubjectCommand subjectCommand);
|
||||
Task<IResponseOutput<string>> AddOrUpdateSubject([FromBody] SubjectCommand subjectCommand);
|
||||
Task<IResponseOutput> DeleteSubject(Guid id);
|
||||
|
||||
Task<IResponseOutput> UpdateSubjectStatus(SubjectStatusChangeCommand subjectStatusChangeCommand);
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
[TrialAudit(AuditType.SubjectAudit, AuditOptType.AddOrUpdateSubject)]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
public async Task<IResponseOutput> AddOrUpdateSubject([FromBody] SubjectCommand subjectCommand)
|
||||
public async Task<IResponseOutput<string>> AddOrUpdateSubject([FromBody] SubjectCommand subjectCommand)
|
||||
{
|
||||
|
||||
if (await _repository.AnyAsync<Trial>(t => t.Id == subjectCommand.TrialId && !t.VisitPlanConfirmed))
|
||||
|
|
|
@ -99,6 +99,8 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
public string ConfigType { get; set; }
|
||||
|
||||
public int? Sort { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue