修改一版

Uat_Study
he 2022-05-19 17:24:30 +08:00
parent 8836377ce0
commit db15a3fb7b
2 changed files with 16 additions and 24 deletions

View File

@ -1841,7 +1841,7 @@ namespace IRaCIS.Core.Application.Image.QA
if (command.SubjectFirstGiveMedicineTime != null)
{
await _subjectRepository.UpdatePartialFromQueryAsync(command.SubjectId, u => new Subject() { FirstGiveMedicineTime = command.SubjectFirstGiveMedicineTime, });
await _subjectRepository.UpdatePartialFromQueryAsync(command.SubjectId, u => new Subject() { FirstGiveMedicineTime = command.SubjectFirstGiveMedicineTime, },true);
}
await _subjectVisitRepository.SaveChangesAsync();

View File

@ -849,6 +849,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
entityTypeName = "New/" + entityTypeName;
}
inspection.Identification = $"{_userInfo.RequestUrl}/{ entityTypeName}/{type}";
#region 注释
//if (data != null)
//{
// var originaldata = data.OriginalValues.ToObject();
@ -857,8 +859,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
// inspection.LastJsonDetail = originaldata.ToJcJson();
// }
//}
#endregion
await AddInspectionRecordAsync(inspection, entityobj, otherItem);
}
@ -911,40 +913,30 @@ namespace IRaCIS.Core.Infra.EFCore.Common
/// <param name="data">数据</param>
/// <returns></returns>
/// <exception cref="BusinessValidationFailedException"></exception>
public async Task AddInspectionRecordAsync(DataInspection add, dynamic data,object otherItem=null)
public async Task AddInspectionRecordAsync(DataInspection add, dynamic data, object otherItem = null)
{
MapData(data, add);
InspectionGeneralData generalData = new InspectionGeneralData();
MapData(add, generalData);
await SetInspectionNameValue(generalData);
#region 处理标识
try
{
var from = await _dbContext.FrontAuditConfig.FirstOrDefaultAsync(x => x.Identification == add.Identification);
add.ObjectType = from?.ObjectTypeId;
add.OptType = from?.OptTypeId;
add.ChildrenType = from?.ChildrenTypeId;
add.ModuleType = from?.ModuleTypeId;
}
catch (Exception)
{
throw new BusinessValidationFailedException("操作标识异常");
}
var from = await _dbContext.FrontAuditConfig.FirstOrDefaultAsync(x => x.Identification == add.Identification);
add.ObjectType = from?.ObjectTypeId;
add.OptType = from?.OptTypeId;
add.ChildrenType = from?.ChildrenTypeId;
add.ModuleType = from?.ModuleTypeId;
#endregion
if (add.ParentId == null)
{
add.ParentId = (await _dbContext.DataInspection.AsQueryable().Where(x => x.TrialId == add.TrialId && x.SubjectVisitId == add.SubjectVisitId && x.SubjectId == add.SubjectId && x.SiteId == add.SiteId && x.VisitStageId == add.VisitStageId && x.GeneralId == add.GeneralId).OrderByDescending(x => x.CreateTime).FirstOrDefaultAsync())?.Id;
}
add.CreateUserId = _userInfo.Id;
add.IP = _userInfo.IP;
if (add.CreateTime == default(DateTime))
{
add.CreateTime = DateTime.Now;
}
add.CreateTime = add.CreateTime == default(DateTime) ? DateTime.Now : add.CreateTime;
if (_userInfo.SignId!=null)
if (_userInfo.SignId != null)
{
add.SignId = _userInfo.SignId;
add.IsSign = true;
@ -952,11 +944,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var inspectionData = new InspectionData()
{
Data = AddJsonItem(data,otherItem),
Data = AddJsonItem(data, otherItem),
Inspection = generalData
};
add.JsonDetail = inspectionData.ToJcJson();
await _dbContext.DataInspection.AddAsync(add);
}