修改数据
parent
f9de0e08b9
commit
fdb32f8a94
|
@ -137,21 +137,18 @@ namespace IRaCIS.Core.API.Controllers
|
|||
public async Task<IResponseOutput> AddOrUpdateSubject(InsSubjectCommand opt)
|
||||
{
|
||||
|
||||
|
||||
opt.AuditInfo.SubjectName = opt.OptCommand.ShortName;
|
||||
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"),
|
||||
//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);
|
||||
}
|
||||
|
||||
|
|
|
@ -600,6 +600,36 @@
|
|||
子类
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionAddDTO.CreateUserName">
|
||||
<summary>
|
||||
创建人名称
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionAddDTO.TrialName">
|
||||
<summary>
|
||||
项目名称
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionAddDTO.SiteName">
|
||||
<summary>
|
||||
中心名称
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionAddDTO.SubjectName">
|
||||
<summary>
|
||||
受试者名称
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionAddDTO.SubjectVisitName">
|
||||
<summary>
|
||||
访视名称
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionAddDTO.RoleName">
|
||||
<summary>
|
||||
角色名称
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Service.Inspection.DTO.InsBasicTrialConfig">
|
||||
<summary>
|
||||
配置 基础逻辑信息
|
||||
|
@ -704,6 +734,13 @@
|
|||
<param name="Statusdata">初始化状态对象</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Inspection.InspectionService.SetInspectionNameValue(IRaCIS.Core.Domain.Models.DataInspection)">
|
||||
<summary>
|
||||
设置项目以及名称
|
||||
</summary>
|
||||
<param name="Data"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Service.TrialExternalUserService">
|
||||
<summary>
|
||||
项目外部人员 录入流程相关
|
||||
|
|
|
@ -42,6 +42,10 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
|
||||
public int? Sort { get; set; }
|
||||
|
||||
public string? EnumList { get; set; }
|
||||
|
||||
public string? DictionaryKey { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -93,6 +97,10 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
|
||||
public int? Sort { get; set; }
|
||||
|
||||
public string EnumList { get; set; } = string.Empty;
|
||||
|
||||
public string DictionaryKey { get; set; } = string.Empty;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -70,6 +70,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
Sort=data.Sort,
|
||||
ValueCN = data.ValueCN,
|
||||
ChildrenTypeValue = leftchildrenType.Value,
|
||||
EnumList=data.EnumList,
|
||||
DictionaryKey=data.DictionaryKey
|
||||
|
||||
};
|
||||
|
||||
query = query
|
||||
|
|
|
@ -35,7 +35,35 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
|
|||
public bool IsSign { get; set; }
|
||||
public string JsonDetail { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 创建人名称
|
||||
/// </summary>
|
||||
public string CreateUserName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 项目名称
|
||||
/// </summary>
|
||||
public string TrialName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 中心名称
|
||||
/// </summary>
|
||||
public string SiteName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 受试者名称
|
||||
/// </summary>
|
||||
public string SubjectName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 访视名称
|
||||
/// </summary>
|
||||
public string SubjectVisitName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 角色名称
|
||||
/// </summary>
|
||||
public string RoleName { get; set; } = string.Empty;
|
||||
|
||||
|
||||
////需要单独处理
|
||||
|
@ -144,6 +172,8 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
|
|||
public string SubjectCode { get; set; } = string.Empty;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -68,6 +68,11 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
|||
UserFirstName = leftuser.FirstName,
|
||||
UserLastName = leftuser.LastName,
|
||||
SubjectCode=leftsubject.Code,
|
||||
SubjectName=data.SubjectName,
|
||||
SubjectVisitName=data.SubjectVisitName,
|
||||
CreateUserName = data.CreateUserName,
|
||||
RoleName=data.RoleName,
|
||||
TrialName=data.TrialName,
|
||||
};
|
||||
|
||||
query = query.WhereIf(!dto.BlindName.IsNullOrEmpty(), x => x.BlindName == dto.BlindName)
|
||||
|
@ -245,6 +250,7 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
|||
add.CreateUserId = _userInfo.Id;
|
||||
add.SignId = signId;
|
||||
add.IP = _userInfo.IP;
|
||||
await SetInspectionNameValue(add);
|
||||
await _repository.AddAsync(add);
|
||||
if (addDto.OptType.ToLower() == "Add".ToLower()&& Statusdata!=null)
|
||||
{
|
||||
|
@ -265,7 +271,13 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
|||
IP = add.IP,
|
||||
ModuleType = add.ModuleType,
|
||||
TrialId = add.TrialId,
|
||||
JsonDetail = JsonConvert.SerializeObject(Statusdata)
|
||||
JsonDetail = JsonConvert.SerializeObject(Statusdata),
|
||||
TrialName=add.TrialName,
|
||||
SiteName=add.SiteName,
|
||||
SubjectName=add.SubjectName,
|
||||
SubjectVisitName=add.SubjectVisitName,
|
||||
CreateUserName=add.CreateUserName,
|
||||
RoleName=add.RoleName,
|
||||
};
|
||||
|
||||
await _repository.AddAsync(ststus);
|
||||
|
@ -275,5 +287,76 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
|||
return ResponseOutput.Ok(success);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置项目以及名称
|
||||
/// </summary>
|
||||
/// <param name="Data"></param>
|
||||
/// <returns></returns>
|
||||
public async Task SetInspectionNameValue(DataInspection Data)
|
||||
{
|
||||
#region 项目名称
|
||||
if (Data.TrialName.IsNullOrEmpty())
|
||||
{
|
||||
Data.TrialName = (await _repository.GetQueryable<Trial>().FirstOrDefaultAsync(x => x.Id == Data.TrialId))?.ExperimentName;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 测试中心名称
|
||||
if (Data.SiteName.IsNullOrEmpty())
|
||||
{
|
||||
Data.SiteName = (await _repository.GetQueryable<Site>().FirstOrDefaultAsync(x => x.Id == Data.SiteId))?.SiteName;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 受试者
|
||||
if (Data.SubjectName.IsNullOrEmpty())
|
||||
{
|
||||
var subjectdata = await _repository.GetQueryable<Subject>().FirstOrDefaultAsync(x => x.Id == Data.SubjectId);
|
||||
if (subjectdata != null)
|
||||
{
|
||||
Data.SubjectName = subjectdata.FirstName + subjectdata.LastName;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 访视
|
||||
if (Data.SubjectVisitName.IsNullOrEmpty())
|
||||
{
|
||||
Data.SubjectVisitName = (await _repository.GetQueryable<SubjectVisit>().FirstOrDefaultAsync(x => x.Id == Data.SubjectVisitId))?.VisitName;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 创建者
|
||||
if (Data.CreateUserName.IsNullOrEmpty() || Data.RoleName.IsNullOrEmpty())
|
||||
{
|
||||
var userdata = await _repository.GetQueryable<User>().Where(x => x.Id == Data.CreateUserId).GroupJoin(_repository.GetQueryable<UserType>(), a => a.UserTypeId, b => b.Id, (a, b) => new
|
||||
{
|
||||
UserName = a.FirstName + a.LastName,
|
||||
Role = b
|
||||
}).SelectMany(a => a.Role, (m, n) => new
|
||||
{
|
||||
UserName = m.UserName,
|
||||
RoleName = n.UserTypeShortName
|
||||
}).FirstOrDefaultAsync();
|
||||
|
||||
if (userdata != null)
|
||||
{
|
||||
if (Data.CreateUserName.IsNullOrEmpty())
|
||||
{
|
||||
Data.CreateUserName = userdata?.UserName;
|
||||
}
|
||||
|
||||
|
||||
if (Data.RoleName.IsNullOrEmpty())
|
||||
{
|
||||
Data.RoleName = userdata?.RoleName;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,6 +101,13 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
public int? Sort { get; set; }
|
||||
|
||||
|
||||
public string EnumList { get; set; }
|
||||
|
||||
public string DictionaryKey { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -120,11 +120,12 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public string SubjectName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人名称
|
||||
/// 访视名称
|
||||
/// </summary>
|
||||
public string SubjectVisitName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人名称
|
||||
/// 角色名称
|
||||
/// </summary>
|
||||
public string RoleName { get; set; }
|
||||
|
||||
|
|
Loading…
Reference in New Issue